# This is a patch for xemacs-21.5.17 to update it to xemacs-21.5.18 # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # If you have a decent Bourne-type shell: # STEP 2: Run the shell with this file as input. # If you don't have such a shell, you may need to manually create/delete # the files as shown below. # STEP 3: Run the 'patch' program with this file as input. # # These are the commands needed to create/delete files/directories: # rm -f './src/callproc.c' touch './etc/ETAGS.EBNF' chmod 0644 './etc/ETAGS.EBNF' touch './etc/gtkrc' chmod 0644 './etc/gtkrc' touch './lib-src/insert-data-in-exec.c' chmod 0644 './lib-src/insert-data-in-exec.c' touch './src/dump-data.c' chmod 0644 './src/dump-data.c' touch './src/dump-data.h' chmod 0644 './src/dump-data.h' touch './src/number-gmp.c' chmod 0644 './src/number-gmp.c' touch './src/number-gmp.h' chmod 0644 './src/number-gmp.h' touch './src/number-mp.c' chmod 0644 './src/number-mp.c' touch './src/number-mp.h' chmod 0644 './src/number-mp.h' touch './src/number.c' chmod 0644 './src/number.c' touch './src/number.h' chmod 0644 './src/number.h' touch './tests/automated/tag-tests.el' chmod 0644 './tests/automated/tag-tests.el' # # This command terminates the shell and need not be executed manually. exit # #### End of Preamble #### #### Patch data follows #### diff --text -u 'xemacs-21.5.17/CHANGES-beta' 'xemacs-21.5.18/CHANGES-beta' Index: ./CHANGES-beta --- ./CHANGES-beta Mon Mar 22 16:55:40 2004 +++ ./CHANGES-beta Fri Oct 22 11:14:14 2004 @@ -1,3 +1,104 @@ +to 21.5.18 "chestnut" + +Major Features + +-- Improve: GTK support gets many fixes and improvements - Purvis. +-- Improve: pdump gets data in executable support, -si option - Galibert. +-- New: GTK gets default gtkrc - Purvis. +-- New: bignum support - James (lead), Sivakumar, Turnbull. + +User-Visible Bug Fixes and Minor Improvements + +-- Fix: 'no-conversion is special in eol detection - Turnbull. +-- Fix: `display-completion-list' does not overflow window - Grundmann. +-- Fix: X error handler must not call stderr_out - Clements. +-- Fix: bogus error in `apropros' - Turnbull. +-- Fix: bogus error in `package-require' - Youngs. +-- Fix: buffer editing by `call-process-region' - Aichner. +-- Fix: coredump from bogus position computation in syntax cache - Euler. +-- Fix: coredump from redisplay wrapping in signal.c - James. +-- Fix: coredump in giflib - Hines. +-- Fix: etags.el correctly handles tags with name fields - Grundmann. +-- Fix: prevent minibuffer from hijacking marks - Sperber. +-- Fix: respect `allow-deletion-of-last-visible-frame' - Zajcev. +-- Fix: sync revert-buffer to 21.4 - Turnbull, Sparapani. +-- Improve: error message formatting - Gatzemeier. +-- Improve: etags.el optimized for exuberant ctags - Grundmann. +-- Improve: isearch-abort preserves interim successes - Turnbull, Zawinski. +-- Improve: package info reporting - Youngs. +-- Improve: window configuration handling - Rychter. + +Build Infrastructure + +-- Fix: 64-bit support - Purvis, SuSE. +-- Fix: configure.in syntax, logic - Turnbull, James, Purvis. +-- Fix: make install went interactive - Aichner. +-- Fix: rebuild finder-inf.el - Turnbull. +-- Improve: Makefile diagnostics - Turnbull. +-- Improve: Windows build support - Aichner. +-- Improve: configure compiler warning setup - James, Purvis. +-- Improve: configure diagnostics - Turnbull. +-- Improve: configure feature detection - Purvis, James, Turnbull. +-- Improve: configure report - Turnbull, James. +-- Improve: icc support - James. +-- Improve: install procedure - Galibert. +-- New: configure supports Playstation2 - Myrkraverk. +-- New: support for parallel builds - Purvis. + +Documentation + +-- Improve: about.el version reporting - Turnbull. +-- Improve: comments and docstrings - Turnbull, Aichner, Gatzemeier. +-- New: lispref.texi documents bignum support - Turnbull, James. +-- New: lispref.texi documents text field support - James. +-- Update: FAQ - Turnbull. +-- Update: NEWS - Turnbull. +-- Update: PACKAGES - Koch. +-- Update: about.el - Turnbull. +-- Update: internals.texi - James, Turnbull. +-- Update: lispref.texi - Turnbull, Okahata. +-- Update: menus to XEmacs config file reality - Turnbull. + +Lisp API + +-- Improve: pixel position reporting - Okahata. + +Internal API and Implementation + +-- Fix: C macro definition for icc - James. +-- Fix: C++ build problems - James, Verna. +-- Fix: Cygwin bug workaround conditionalized - James. +-- Fix: Lisp internal type manipulation - James. +-- Fix: bogus CVS conflict in package-ui.el - Aichner. +-- Fix: callproc.c vestiges removed - James. +-- Fix: format conversions in pdump report - Turnbull. +-- Fix: function argument usage - James. +-- Fix: incomplete macro in external widget support - Golubev. +-- Fix: lwlib GC handling - James. +-- Fix: lwlib computation of widget changes - James. +-- Fix: mark unused parameters - James, Wing. +-- Fix: remove duplicate functions - Turnbull. +-- Fix: remove unused variables - James. +-- Fix: specifier validation - James. +-- Fix: update byte compiler function database - James. +-- Fix: warning suppression - James, Gatzemeier. +-- Fix: workaround Darwin's distaste for ISO 8859/2 filenames. +-- Improve: custom database save - Aichner, Niksic. +-- Improve: itimer implementation - James, Jones, Buchholz, Yamaoka. +-- Improve: test-harness.el Assert macro - James. +-- New: LTDL support in ELLs - James. +-- Update: INSTALL Canna, Make descriptions - James, Purvis. +-- Update: SERVICE sync with upstream - James. +-- Update: derived.el, subr.el, cl*.el sync to Emacs 21.3 - James. +-- Update: etags sync with upstream v17.6 - James. + +Quality Assurance Infrastructure + +-- Fix: regression tests using most-negative-fixnum - James. +-- Improve: faster Mule tests - Turnbull. +-- New: Uno support - James. +-- New: regression tests - Turnbull, Youngs, Yamaoka, Shelton, James. + to 21.5.17 "chayote" Build diff --text -u 'xemacs-21.5.17/ChangeLog' 'xemacs-21.5.18/ChangeLog' Index: ./ChangeLog --- ./ChangeLog Mon Mar 22 18:22:45 2004 +++ ./ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,129 @@ +2004-10-22 Stephen J. Turnbull + + * XEmacs 21.5.18 "chestnut" is released. + +2004-10-22 Stephen J. Turnbull + + * CHANGES-beta: Update for release. + +2004-09-29 Jerry James + + * configure.in: Don't use -Wunused-parameter with g++. + +2004-09-21 Malcolm Purvis + + * configure.in: Unused parameter and variables warnings are GCC 3 + or greater. + +2004-09-14 Jerry James + + * configure.in (TAB): Add unused parameter and variables warnings + to gcc CFLAGS. + +2004-09-20 Jerry James + + * INSTALL: Update Canna description to reflect recent changes. + +2004-09-11 Malcolm Purvis + + * configure.in Check for sys/resource.h, sys/vlimit.h, getrlimit() + and vlimit(). + +2004-09-10 Malcolm Purvis + + * INSTALL: A POSIX compatible Make is required for builds. + * Makefile.in.in: Enable support for parallel builds. + +2004-08-12 "Johann 'Myrkraverk' Oskarsson" + + * config.guess: Identify PlayStation2. + +2004-06-16 Stephen J. Turnbull + + * configure.in: Character classes in globs don't work, die when + GTK is mixed with other toolkits, protect comma in quoted message. + +2004-06-14 Stephen J. Turnbull + + * configure.in (Autodetection of Gdk libraries and includes): + Don't allow mixing of GTK with other toolkits. + +2004-06-12 Stephen J. Turnbull + + * configure.in: Improve style of WARNINGs. + +2004-05-20 Stephen J. Turnbull + + * configure.in (HAVE_GPM): Die if GPM requested but not found. + +2004-05-10 Jerry James + + * aclocal.m4: Typo fix. + * configure.in (XE_COMPUTE_RUNPATH): Add checks for shl_load and + LTDL; unify the OS-specific checks into a case statement. + +2004-04-30 Jerry James + + * configure.in: Turn ICC warning 147 into an error to get a good + XRegisterIMInstantiateCallback prototype. + +2004-04-28 Jerry James + + * configure.in: Get version information for both icc and icpc. + +2004-04-08 Stephen J. Turnbull + + * configure.in (GTK setup): Warn if other toolkits requested. + +2004-03-31 Stephen J. Turnbull + + * configure.in (Compiler feature macros): Kaarthik Sivakumar says + _POSIX_C_SOURCE should be defined for FreeBSD 4.5 to 4.9 at least. + +2004-03-31 Stephen J. Turnbull + + * Makefile.in.in (install-arch-indep): make gzip-el now saves ~4MB. + +2003-12-07 Olivier Galibert + + * Makefile.in.in: Don't install the dmp file when it's in the + executable. + +2004-04-12 Kaarthik Sivakumar + + * configure.in: Check for libmp dependencies before checking for + the existence of the move function. + +2004-03-04 Malcolm Purvis + + * configure.in (src/Makefile): No longer include a special linker + script for PowerPC Linux. Thanks to Stefan Bruda for reporting + this bug. + +2004-04-08 Stephen J. Turnbull + + * configure.in (Compiler-specific hacks): Restore warning flags + for XEMACS_CC if gcc. Report warning flags at compute time. + +2004-04-07 Jerry James + + * configure.in: FreeBSD MP needs -lcrypto. + +2004-04-06 Jerry James + + * configure.in: Change test -e to test -r for portability. + +2004-04-06 Stephen J. Turnbull + + * configure.in (use_number_lib): Accepts no to disable bignums. + * configure.usage: Document the "no" value. + +2004-04-05 Jerry James + + * configure.in (use_number_lib): New. Values are "gmp" or "mp". + * configure.in: Use it. Report it. Check for size of a double. + * configure.usage: Tell how to use use-number-lib. + 2004-03-22 Stephen J. Turnbull * XEmacs 21.5.17 "chayote" is released. diff --text -u 'xemacs-21.5.17/INSTALL' 'xemacs-21.5.18/INSTALL' Index: ./INSTALL --- ./INSTALL Mon Mar 24 23:13:40 2003 +++ ./INSTALL Tue Sep 21 03:00:39 2004 @@ -45,10 +45,11 @@ on-line documentation. The exact amount depends greatly on the number of extra Lisp packages that are installed. -XEmacs requires an ANSI C compiler, such as GCC. If you wish to build -the documentation yourself, you will need at least version 1.68 of -makeinfo (GNU texinfo-3.11). GNU Texinfo 4.2 is recommended; it is -necessary for building Lisp packages, and we may move to it for the core. +XEmacs requires an ANSI C compiler, such as GCC, and a POSIX compatible +make, such as GNU Make. If you wish to build the documentation +yourself, you will need at least version 1.68 of makeinfo (GNU +texinfo-3.11). GNU Texinfo 4.2 is recommended; it is necessary for +building Lisp packages, and we may move to it for the core. A note on terminology: unfortunately the terms "library" and "package" are heavily overloaded. In the following, "library" refers to an @@ -385,14 +386,14 @@ The `--with-canna' option enables the use of the Canna Japanese input method. This is stable code and fairly well tested. In order to use -it, you will have to have the Canna server installed and running. -Canna versions 3.2pl2 and 3.5b2 are known to work. Version 3.2pl2 is -considered most stable than version 3.5b2. If Canna is already -installed, configure will autodetect it, so you never need to -explicitly use this option unless your Canna libraries are somewhere -strange. Canna run time support is currently bundled with the -`mule-base' package so there is nothing additional to install in order -to use it. +it, you will have to have the Canna server installed and running. Canna +versions 3.2pl2, 3.5b2, and 3.7p3 are known to work. Version 3.2pl2 is +considered more stable than version 3.5b2; the stability of 3.7p3 is +still unknown. If Canna is already installed, configure will autodetect +it, so you never need to explicitly use this option unless your Canna +libraries are somewhere strange. Canna run time support is currently +bundled with the `mule-base' package so there is nothing additional to +install in order to use it. The `--with-wnn' and `--with-wnn6' options are for compiling with the Wnn multi-language input method. `--with-wnn' is for compiling with Wnn-4.2, diff --text -u 'xemacs-21.5.17/Makefile.in.in' 'xemacs-21.5.18/Makefile.in.in' Index: ./Makefile.in.in --- ./Makefile.in.in Wed Jan 28 20:20:34 2004 +++ ./Makefile.in.in Fri Sep 10 20:58:08 2004 @@ -275,13 +275,13 @@ cd ${srcdir} && $(SHELL) lib-src/config.values.sh depend ${srcdir}/src/depend: - cd ./src && $(RECURSIVE_MAKE) depend + +cd ./src && $(RECURSIVE_MAKE) depend check: - cd ./src && $(RECURSIVE_MAKE) $@ + +cd ./src && $(RECURSIVE_MAKE) $@ check-features: all - cd ./src && $(RECURSIVE_MAKE) $@ + +cd ./src && $(RECURSIVE_MAKE) $@ ## We have to force the building of Emacs.ad.h as well in order to get it ## updated correctly when VPATH is being used. Since we use move-if-change, @@ -310,7 +310,10 @@ FRC.lisp.finder-inf.el: ${SUBDIR}: ${SUBDIR_MAKEFILES} ${GENERATED_HEADERS} FRC - cd ./$@ && $(RECURSIVE_MAKE) all + +cd ./$@ && $(RECURSIVE_MAKE) all + +## Building modules depends on ellcc, found in lib-src. +modules/sample modules/ldap modules/zlib modules/base64 modules/postgresql: lib-src Makefile: ${srcdir}/Makefile.in.in config.status ./config.status @@ -385,7 +388,7 @@ for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; \ do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \ else true; fi -#ifdef PDUMP +#if defined(PDUMP) && defined(WIN32_NATIVE) ${INSTALL_DATA} src/${PROGNAME}.dmp ${bindir}/${PROGNAME}-${version}-`src/${PROGNAME} -sd`.dmp #endif #ifdef WIN32_NATIVE @@ -456,7 +459,7 @@ ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext} ; \ chmod 0644 ${mandir}/$${page}${manext} ; \ done - @echo "If you would like to save approximately 2M of disk space, do" + @echo "If you would like to save approximately 4M of disk space, do" @echo "make gzip-el" @echo "or you may run " @echo ${srcdir}/lib-src/gzip-el.sh lispdir " from the command line." @@ -521,7 +524,7 @@ ## target for GCC does not delete `libgcc.a', because recompiling it ## is rarely necessary and takes a lot of time. mostlyclean: FRC.mostlyclean - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + +for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done $(RM) core ## `clean' @@ -537,7 +540,7 @@ ## when they don't work right. (beta can't depend on distclean, which ## removes necessary files generated by configure.) clean: FRC.clean - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + +for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done $(RM) core lisp/auto-autoloads.el* lisp/custom-load.el* $(RM) lisp/mule/auto-autoloads.el* lisp/mule/custom-load.el* $(RM) modules/auto-autoloads.el* modules/custom-load.el* @@ -555,7 +558,7 @@ $(RM) -r site-packages xemacs-packages mule-packages site-lisp distclean: FRC.distclean - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + +for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done -${top_distclean} ## `realclean' @@ -570,7 +573,7 @@ ## anything that needs to exist in order to run `configure' and then ## begin to build the program. realclean: FRC.realclean - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + +for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done -${top_distclean} $(RM) TAGS @@ -579,7 +582,7 @@ ## the coding standards seem to come from. It's like distclean, but ## it deletes backup and autosave files too. extraclean: - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + +for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done $(RM) *~ \#* -${top_distclean} @@ -630,10 +633,10 @@ xargs etags -a -l none -r "/^(def\\(var\\|un\\|alias\\|const\\|macro\\|subst\\|struct\\|face\\|group\\|custom\\|ine-\\(function\\|compiler-macro\\|[a-z-]+alias\\)\\)[ ]+'?\\([^ ]+\\)/\\3/" info: FRC.info - cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ + +cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ dvi: - cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ + +cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ ## Fix up version information in executables (Solaris-only) mcs: diff --text -u 'xemacs-21.5.17/aclocal.m4' 'xemacs-21.5.18/aclocal.m4' Index: ./aclocal.m4 --- ./aclocal.m4 Fri Oct 17 04:44:34 2003 +++ ./aclocal.m4 Sat May 15 00:35:29 2004 @@ -218,7 +218,7 @@ dnl dnl So, having said all of that, we diverge from libtool significantly dnl here. We want to try and use the C compiler as much as possible. Only -dnl if the C compiler itself cannot create shared libraries to we try to +dnl if the C compiler itself cannot create shared libraries do we try to dnl find the linker. dnl dnl The other advantage to my scheme is that it removes the dependancy diff --text -u 'xemacs-21.5.17/config.guess' 'xemacs-21.5.18/config.guess' Index: ./config.guess --- ./config.guess Fri Apr 13 03:20:33 2001 +++ ./config.guess Sat Aug 14 05:55:31 2004 @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. -timestamp='2001-01-17' +timestamp='2004-08-12' # 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 @@ -918,8 +918,14 @@ printf ("%s-unknown-linux-gnu\n", argv[1]); #endif #ifdef __MIPSEL__ +#ifdef __R5900 +/* Little Endian R5900 running Linux, + this *must* be Sony PlayStation 2 */ + printf ("%sel-PlayStation2-linux-gnu\n", argv[1]); +#else printf ("%sel-unknown-linux-gnu\n", argv[1]); #endif +#endif return 0; } EOF diff --text -u 'xemacs-21.5.17/configure' 'xemacs-21.5.18/configure' Index: ./configure --- ./configure Thu Mar 18 18:57:12 2004 +++ ./configure Fri Oct 22 14:16:35 2004 @@ -270,6 +270,7 @@ with_tty="" use_union_type="no" with_dnet="" +use_number_lib="no" pdump="" with_dragndrop_default="no" with_ipv6_cname="no" @@ -539,6 +540,19 @@ eval "$opt=\"$val\"" ;; + "use_number_lib" ) + case "$val" in + gmp ) val=gmp ;; + mp ) val=mp ;; + no|non|none ) val=no ;; + * ) (echo "$progname: Usage error:" +echo " " "The \`--$optname' option must have one of these values: + \`gmp', \`mp', or \`no'." +echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; + esac + eval "$opt=\"$val\"" + ;; + "error_checking" ) for x in `echo "$val" | sed -e 's/,/ /g'` ; do @@ -835,7 +849,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:839: checking whether ln -s works" >&5 +echo "configure:853: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -1121,7 +1135,7 @@ echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:1125: checking "host system type"" >&5 +echo "configure:1139: checking "host system type"" >&5 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'` canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"` configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` @@ -1659,7 +1673,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1663: checking for $ac_word" >&5 +echo "configure:1677: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1686,7 +1700,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1690: checking for $ac_word" >&5 +echo "configure:1704: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1734,7 +1748,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1738: checking for $ac_word" >&5 +echo "configure:1752: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1763,7 +1777,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1781: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -1776,12 +1790,12 @@ cat > conftest.$ac_ext << EOF -#line 1780 "configure" +#line 1794 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1809,19 +1823,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1813: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1827: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1818: checking whether we are using GNU C" >&5 +echo "configure:1832: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1839,7 +1853,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1843: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1857: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1872,7 +1886,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1876: checking for $ac_word" >&5 +echo "configure:1890: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1899,7 +1913,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1903: checking for $ac_word" >&5 +echo "configure:1917: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1947,7 +1961,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1951: checking for $ac_word" >&5 +echo "configure:1965: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1976,7 +1990,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1980: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1994: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -1989,12 +2003,12 @@ cat > conftest.$ac_ext << EOF -#line 1993 "configure" +#line 2007 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2022,19 +2036,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2026: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2031: checking whether we are using GNU C" >&5 +echo "configure:2045: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2052,7 +2066,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2056: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2070: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2085,7 +2099,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2089: checking for $ac_word" >&5 +echo "configure:2103: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2112,7 +2126,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2116: checking for $ac_word" >&5 +echo "configure:2130: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2160,7 +2174,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2164: checking for $ac_word" >&5 +echo "configure:2178: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2189,7 +2203,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2193: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2207: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -2202,12 +2216,12 @@ cat > conftest.$ac_ext << EOF -#line 2206 "configure" +#line 2220 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2235,19 +2249,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2239: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2253: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2244: checking whether we are using GNU C" >&5 +echo "configure:2258: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2265,7 +2279,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2269: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2283: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2298,7 +2312,7 @@ if test "$GCC" = "yes"; then cat > conftest.$ac_ext <= 3 @@ -2308,7 +2322,7 @@ #endif } EOF -if { (eval echo configure:2312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2334,7 +2348,7 @@ test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2338: checking how to run the C preprocessor" >&5 +echo "configure:2352: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2347,13 +2361,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2364,13 +2378,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2381,13 +2395,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2413,9 +2427,9 @@ echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2417: checking for AIX" >&5 +echo "configure:2431: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:2446: checking for GNU libc" >&5 +echo "configure:2460: checking for GNU libc" >&5 cat > conftest.$ac_ext < int main() { @@ -2456,7 +2470,7 @@ ; return 0; } EOF -if { (eval echo configure:2460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -2530,7 +2544,7 @@ } ;; - freebsd4.9) + freebsd4*) { test "$extra_verbose" = "yes" && cat << \EOF Defining _POSIX_C_SOURCE = 199506L EOF @@ -2551,7 +2565,7 @@ esac cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2821,17 +2835,17 @@ if test "$__USLC__" = yes; then echo $ac_n "checking for whether the -Kalloca compiler flag is needed""... $ac_c" 1>&6 -echo "configure:2825: checking for whether the -Kalloca compiler flag is needed" >&5 +echo "configure:2839: checking for whether the -Kalloca compiler flag is needed" >&5 need_kalloca=no cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* : else @@ -2842,14 +2856,14 @@ xe_save_c_switch_system="$c_switch_system" c_switch_system="$c_switch_system -Kalloca" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* need_kalloca=yes else @@ -2877,6 +2891,9 @@ fi +echo $ac_n "checking for preferred CFLAGS""... $ac_c" 1>&6 +echo "configure:2896: checking for preferred CFLAGS" >&5 + if test "$cflags_specified" = "no"; then if test "$GCC" = "yes"; then CFLAGS="-g -O3" @@ -2894,7 +2911,11 @@ else CFLAGS="-O" ; fi fi +echo "$ac_t""${CFLAGS}" 1>&6 + +echo $ac_n "checking for preferred warning flags for XEMACS_CC""... $ac_c" 1>&6 +echo "configure:2919: checking for preferred warning flags for XEMACS_CC" >&5 xe_cflags_warning="" @@ -2907,28 +2928,35 @@ cflags_warning="-qinfo" elif test "$GCC" = "yes"; then cflags_warning="-Wall -Wno-switch -Winline -Wmissing-prototypes" + cflags_warning="$cflags_warning -Wsign-compare" cflags_warning="$cflags_warning -Wundef -Wstrict-prototypes" - if test "$__GCC3" = "yes"; then - cflags_warning="$cflags_warning -Wpacked" - fi - test "$xemacs_compiler" = "g++" && \ - xe_cflags_warning="$cflags_warning -Weffc++" - cflags_warning="$cflags_warning -Wshadow -Wmissing-declarations" + test "$__GCC3" = "yes" && cflags_warning="$cflags_warning -Wpacked" test "$have_glibc" != "yes" && \ cflags_warning="$cflags_warning -Wpointer-arith" - elif test "$__ICC" = "yes"; then - cflags_warning="-Wall -w1" - fi + if test "$xemacs_compiler" = "g++"; then + xe_cflags_warning="$cflags_warning -Weffc++" + elif test "$__GCC3" = "yes"; then + xe_cflags_warning="$cflags_warning -Wunused-parameter" + fi + cflags_warning="$cflags_warning -Wshadow -Wmissing-declarations" + elif test "$__ICC" = "yes"; then + cflags_warning="-Wall -w1 -we147" + fi fi +test -z "$xe_cflags_warning" && xe_cflags_warning="$cflags_warning" +echo "$ac_t""${xe_cflags_warning}" 1>&6 + +echo $ac_n "checking for preferred warning flags for CC""... $ac_c" 1>&6 +echo "configure:2952: checking for preferred warning flags for CC" >&5 +echo "$ac_t""${cflags_warning}" 1>&6 -test -z "xe_cflags_warning" && xe_cflags_warning=cflags_warning XE_CFLAGS="$xe_cflags_warning $CFLAGS" CFLAGS="$cflags_warning $CFLAGS" if test "$GCC" = "yes"; then echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6 -echo "configure:2932: checking for buggy gcc versions" >&5 +echo "configure:2960: checking for buggy gcc versions" >&5 GCC_VERSION=`$CC --version` case `uname -s`:`uname -m`:$GCC_VERSION in *:sun4*:2.8.1|*:sun4*:egcs-2.90.*) @@ -2986,7 +3014,7 @@ if test "$pdump" != "yes"; then echo $ac_n "checking for \"-z nocombreloc\" linker flag""... $ac_c" 1>&6 -echo "configure:2990: checking for \"-z nocombreloc\" linker flag" >&5 +echo "configure:3018: checking for \"-z nocombreloc\" linker flag" >&5 case "`ld --help 2>&1`" in *-z\ nocombreloc* ) echo "$ac_t""yes" 1>&6 ld_switch_site="-z nocombreloc $ld_switch_site" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-z nocombreloc\" to \$ld_switch_site"; fi ;; @@ -3075,7 +3103,7 @@ fi echo $ac_n "checking for dynodump""... $ac_c" 1>&6 -echo "configure:3079: checking for dynodump" >&5 +echo "configure:3107: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -3099,7 +3127,6 @@ fi -test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript" if test "$unexec" = "unexaix.o"; then if test "$dynamic" = "no"; then @@ -3113,12 +3140,12 @@ done echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6 -echo "configure:3117: checking for terminateAndUnload in -lC" >&5 +echo "configure:3144: checking for terminateAndUnload in -lC" >&5 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'` xe_check_libs=" -lC " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3171,13 +3198,13 @@ libc_version="" echo $ac_n "checking for compiler version information""... $ac_c" 1>&6 -echo "configure:3175: checking for compiler version information" >&5 +echo "configure:3202: checking for compiler version information" >&5 if test "$GCC" = "yes"; then compiler_version=`$XEMACS_CC --version | head -1` gcc_compiler_specs=`$XEMACS_CC -v 2>&1 | sed 's/.* \([^ ]\)/\1/' | head -1` else case "$XEMACS_CC" in - icc*) + ic*) compiler_version=`icc -V 2>&1 | head -1` ;; *) case "$canonical" in @@ -3222,7 +3249,7 @@ fi echo $ac_n "checking for standard C library version information""... $ac_c" 1>&6 -echo "configure:3226: checking for standard C library version information" >&5 +echo "configure:3253: checking for standard C library version information" >&5 case "$canonical" in *-*-linux*) @@ -3334,7 +3361,7 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:3338: checking "for runtime libraries flag"" >&5 +echo "configure:3365: checking "for runtime libraries flag"" >&5 case "$opsys" in sol2 ) dash_r="-R" ;; decosf* | linux* | irix*) dash_r="-rpath " ;; @@ -3356,14 +3383,14 @@ done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* dash_r="$try_dash_r" else @@ -3464,10 +3491,10 @@ fi after_morecore_hook_exists=yes echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:3468: checking for malloc_set_state" >&5 +echo "configure:3495: checking for malloc_set_state" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_malloc_set_state=yes" else @@ -3510,16 +3537,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:3514: checking whether __after_morecore_hook exists" >&5 +echo "configure:3541: checking whether __after_morecore_hook exists" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -3575,7 +3602,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3579: checking for $ac_word" >&5 +echo "configure:3606: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -3630,7 +3657,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:3634: checking for a BSD compatible install" >&5 +echo "configure:3661: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -3684,7 +3711,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3688: checking for $ac_word" >&5 +echo "configure:3715: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -3712,19 +3739,19 @@ test -n "$YACC" || YACC="yacc" -for ac_hdr in a.out.h elf.h cygwin/version.h fcntl.h inttypes.h libgen.h locale.h wchar.h mach/mach.h sys/param.h sys/pstat.h sys/time.h sys/timeb.h sys/times.h sys/un.h ulimit.h unistd.h +for ac_hdr in a.out.h elf.h cygwin/version.h fcntl.h inttypes.h libgen.h locale.h wchar.h mach/mach.h sys/param.h sys/pstat.h sys/resource.h sys/time.h sys/timeb.h sys/times.h sys/un.h sys/vlimit.h ulimit.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3720: checking for $ac_hdr" >&5 +echo "configure:3747: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3754,10 +3781,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3758: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:3785: checking for sys/wait.h that is POSIX.1 compatible" >&5 cat > conftest.$ac_ext < #include @@ -3773,7 +3800,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3797,10 +3824,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3801: checking for ANSI C header files" >&5 +echo "configure:3828: checking for ANSI C header files" >&5 cat > conftest.$ac_ext < #include @@ -3808,7 +3835,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3825,7 +3852,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3843,7 +3870,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3861,7 +3888,7 @@ if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3872,7 +3899,7 @@ exit (0); } EOF -if { (eval echo configure:3876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -3898,10 +3925,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3902: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3929: checking whether time.h and sys/time.h may both be included" >&5 cat > conftest.$ac_ext < #include @@ -3910,7 +3937,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3934,10 +3961,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3938: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:3965: checking for sys_siglist declaration in signal.h or unistd.h" >&5 cat > conftest.$ac_ext < #include @@ -3949,7 +3976,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3975,9 +4002,9 @@ echo $ac_n "checking for utime""... $ac_c" 1>&6 -echo "configure:3979: checking for utime" >&5 +echo "configure:4006: checking for utime" >&5 cat > conftest.$ac_ext < #include @@ -3985,7 +4012,7 @@ struct utimbuf x; x.actime = x.modtime = 0; utime ("/", &x); ; return 0; } EOF -if { (eval echo configure:3989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -4004,10 +4031,10 @@ for ac_func in utimes do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4008: checking for $ac_func" >&5 +echo "configure:4035: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4062,10 +4089,10 @@ echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:4066: checking return type of signal handlers" >&5 +echo "configure:4093: checking return type of signal handlers" >&5 cat > conftest.$ac_ext < #include @@ -4082,7 +4109,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:4086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -4104,10 +4131,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:4108: checking for size_t" >&5 +echo "configure:4135: checking for size_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4138,10 +4165,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:4142: checking for pid_t" >&5 +echo "configure:4169: checking for pid_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4172,10 +4199,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4176: checking for uid_t in sys/types.h" >&5 +echo "configure:4203: checking for uid_t in sys/types.h" >&5 cat > conftest.$ac_ext < EOF @@ -4211,10 +4238,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:4215: checking for mode_t" >&5 +echo "configure:4242: checking for mode_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4245,10 +4272,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:4249: checking for off_t" >&5 +echo "configure:4276: checking for off_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4279,10 +4306,10 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:4283: checking for ssize_t" >&5 +echo "configure:4310: checking for ssize_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4315,9 +4342,9 @@ if test "$ac_cv_header_inttypes_h" != "yes"; then echo $ac_n "checking for intptr_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4319: checking for intptr_t in sys/types.h" >&5 +echo "configure:4346: checking for intptr_t in sys/types.h" >&5 cat > conftest.$ac_ext < intptr_t x; @@ -4326,7 +4353,7 @@ ; return 0; } EOF -if { (eval echo configure:4330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -4347,9 +4374,9 @@ fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:4351: checking for socklen_t" >&5 +echo "configure:4378: checking for socklen_t" >&5 cat > conftest.$ac_ext < #include @@ -4359,7 +4386,7 @@ ; return 0; } EOF -if { (eval echo configure:4363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -4368,7 +4395,7 @@ rm -rf conftest* cat > conftest.$ac_ext < #include @@ -4378,7 +4405,7 @@ ; return 0; } EOF -if { (eval echo configure:4382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""size_t" 1>&6 @@ -4410,9 +4437,9 @@ rm -f conftest* echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:4414: checking for struct timeval" >&5 +echo "configure:4441: checking for struct timeval" >&5 cat > conftest.$ac_ext < @@ -4428,7 +4455,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:4432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -4450,10 +4477,10 @@ rm -f conftest* echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:4454: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:4481: checking whether struct tm is in sys/time.h or time.h" >&5 cat > conftest.$ac_ext < #include @@ -4461,7 +4488,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:4465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -4485,10 +4512,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:4489: checking for tm_zone in struct tm" >&5 +echo "configure:4516: checking for tm_zone in struct tm" >&5 cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -4496,7 +4523,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:4500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -4519,10 +4546,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:4523: checking for tzname" >&5 +echo "configure:4550: checking for tzname" >&5 cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -4532,7 +4559,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:4536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -4558,10 +4585,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4562: checking for working const" >&5 +echo "configure:4589: checking for working const" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4635,7 +4662,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:4639: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:4666: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -4660,12 +4687,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4664: checking whether byte ordering is bigendian" >&5 +echo "configure:4691: checking whether byte ordering is bigendian" >&5 ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -4676,11 +4703,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:4680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4691,7 +4718,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:4695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4708,7 +4735,7 @@ rm -f conftest* if test $ac_cv_c_bigendian = unknown; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_bigendian=no else @@ -4748,10 +4775,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4752: checking size of short" >&5 +echo "configure:4779: checking size of short" >&5 cat > conftest.$ac_ext < #include @@ -4763,7 +4790,7 @@ exit(0); } EOF -if { (eval echo configure:4767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -4791,10 +4818,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4795: checking size of int" >&5 +echo "configure:4822: checking size of int" >&5 cat > conftest.$ac_ext < #include @@ -4806,7 +4833,7 @@ exit(0); } EOF -if { (eval echo configure:4810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -4828,10 +4855,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4832: checking size of long" >&5 +echo "configure:4859: checking size of long" >&5 cat > conftest.$ac_ext < #include @@ -4843,7 +4870,7 @@ exit(0); } EOF -if { (eval echo configure:4847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -4865,10 +4892,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4869: checking size of long long" >&5 +echo "configure:4896: checking size of long long" >&5 cat > conftest.$ac_ext < #include @@ -4880,7 +4907,7 @@ exit(0); } EOF -if { (eval echo configure:4884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long_long=`cat conftestval` else @@ -4902,10 +4929,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4906: checking size of void *" >&5 +echo "configure:4933: checking size of void *" >&5 cat > conftest.$ac_ext < #include @@ -4917,7 +4944,7 @@ exit(0); } EOF -if { (eval echo configure:4921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_void_p=`cat conftestval` else @@ -4938,9 +4965,46 @@ } +echo $ac_n "checking size of double""... $ac_c" 1>&6 +echo "configure:4970: checking size of double" >&5 + +cat > conftest.$ac_ext < +#include +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(double)); + exit(0); +} +EOF +if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +then + ac_cv_sizeof_double=`cat conftestval` +else + conftest_rc="$?" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_double=0 +fi +rm -fr conftest* +echo "$ac_t""$ac_cv_sizeof_double" 1>&6 +{ test "$extra_verbose" = "yes" && cat << EOF + Defining SIZEOF_DOUBLE = $ac_cv_sizeof_double +EOF +cat >> confdefs.h <&6 -echo "configure:4944: checking for long file names" >&5 +echo "configure:5008: checking for long file names" >&5 ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: @@ -4986,10 +5050,10 @@ echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4990: checking for sin" >&5 +echo "configure:5054: checking for sin" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -5030,12 +5094,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:5034: checking for sin in -lm" >&5 +echo "configure:5098: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` xe_check_libs=" -lm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5081,14 +5145,14 @@ cat > conftest.$ac_ext < int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:5092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_INVERSE_HYPERBOLIC @@ -5107,10 +5171,10 @@ for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5111: checking for $ac_func" >&5 +echo "configure:5175: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5162,14 +5226,14 @@ echo "checking type of mail spool file locking" 1>&6 -echo "configure:5166: checking type of mail spool file locking" >&5 +echo "configure:5230: checking type of mail spool file locking" >&5 for ac_func in lockf flock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5170: checking for $ac_func" >&5 +echo "configure:5234: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5274,12 +5338,12 @@ case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:5278: checking for cma_open in -lpthreads" >&5 +echo "configure:5342: checking for cma_open in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lpthreads " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5327,7 +5391,7 @@ echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:5331: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:5395: checking whether the -xildoff compiler flag is required" >&5 if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then echo "$ac_t""no" 1>&6; @@ -5339,7 +5403,7 @@ if test "$opsys" = "sol2"; then if test "$os_release" -ge 506; then echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6 -echo "configure:5343: checking for \"-z ignore\" linker flag" >&5 +echo "configure:5407: checking for \"-z ignore\" linker flag" >&5 case "`ld -h 2>&1`" in *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6 ld_switch_site="-z ignore $ld_switch_site" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-z ignore\" to \$ld_switch_site"; fi ;; @@ -5350,7 +5414,7 @@ echo "checking "for specified window system"" 1>&6 -echo "configure:5354: checking "for specified window system"" >&5 +echo "configure:5418: checking "for specified window system"" >&5 GNOME_CONFIG=no @@ -5358,7 +5422,7 @@ if test "$with_gnome" != "no"; then echo $ac_n "checking for GNOME configuration script""... $ac_c" 1>&6 -echo "configure:5362: checking for GNOME configuration script" >&5 +echo "configure:5426: checking for GNOME configuration script" >&5 for possible in gnome-config do possible_version=`${possible} --version 2> /dev/null` @@ -5389,7 +5453,7 @@ if test "$with_gtk" != "no";then echo $ac_n "checking for GTK configuration script""... $ac_c" 1>&6 -echo "configure:5393: checking for GTK configuration script" >&5 +echo "configure:5457: checking for GTK configuration script" >&5 for possible in gtk12-config gtk14-config gtk-config do possible_version=`${possible} --version 2> /dev/null` @@ -5411,18 +5475,18 @@ if test "${GTK_CONFIG}" != "no"; then echo $ac_n "checking gtk version""... $ac_c" 1>&6 -echo "configure:5415: checking gtk version" >&5 +echo "configure:5479: checking gtk version" >&5 GTK_VERSION=`${GTK_CONFIG} --version` echo "$ac_t""${GTK_VERSION}" 1>&6 echo $ac_n "checking gtk libs""... $ac_c" 1>&6 -echo "configure:5420: checking gtk libs" >&5 +echo "configure:5484: checking gtk libs" >&5 GTK_LIBS=`${GTK_CONFIG} --libs` libs_gtk="$libs_gtk ${GTK_LIBS}" && if test "$extra_verbose" = "yes"; then echo " Appending \"${GTK_LIBS}\" to \$libs_gtk"; fi echo "$ac_t""${GTK_LIBS}" 1>&6 echo $ac_n "checking gtk cflags""... $ac_c" 1>&6 -echo "configure:5426: checking gtk cflags" >&5 +echo "configure:5490: checking gtk cflags" >&5 GTK_CFLAGS=`${GTK_CONFIG} --cflags` if test "$GCC" = "yes"; then GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow" @@ -5432,19 +5496,19 @@ echo $ac_n "checking for main in -lgdk_imlib""... $ac_c" 1>&6 -echo "configure:5436: checking for main in -lgdk_imlib" >&5 +echo "configure:5500: checking for main in -lgdk_imlib" >&5 ac_lib_var=`echo gdk_imlib'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdk_imlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5466,12 +5530,12 @@ echo $ac_n "checking for Imlib_init in -lImlib""... $ac_c" 1>&6 -echo "configure:5470: checking for Imlib_init in -lImlib" >&5 +echo "configure:5534: checking for Imlib_init in -lImlib" >&5 ac_lib_var=`echo Imlib'_'Imlib_init | sed 'y%./+-%__p_%'` xe_check_libs=" -lImlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5505,10 +5569,10 @@ for ac_func in gdk_imlib_init do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5509: checking for $ac_func" >&5 +echo "configure:5573: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5579,10 +5643,28 @@ window_system=gtk with_gtk=yes - with_x11=no + if test "$with_x11" != "no"; then + echo "configure: warning: Configuring GTK, forcing with_x11 to no" 1>&2 + with_x11=no + fi + + for feature in scrollbars toolbars menubars dialogs widgets + do + eval "feature_value=\${with_${feature}}" + case "${feature_value}" in + yes|no|gtk|"" ) + ;; + * ) + feature_conflict_with_gtk=yes + echo "configure: warning: --with-${feature}=${feature_value} is incompatible with --with-gtk" 1>&2 ;; + esac + done + if test "${feature_conflict_with_gtk}" = "yes"; then + { echo "Error:" "One or more GUI toolkit features conflict with GTK" >&2; exit 1; } + fi test "${with_scrollbars}" != "no" && with_scrollbars=gtk - test "${with_toolbars}" != no && with_toolbars=gtk + test "${with_toolbars}" != "no" && with_toolbars=gtk test "${with_menubars}" != "no" && with_menubars=gtk test "${with_dialogs}" != "no" && with_dialogs=gtk test "${with_widgets}" != "no" && with_widgets=gtk @@ -5597,15 +5679,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5601: checking for $ac_hdr" >&5 +echo "configure:5683: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5636,19 +5718,19 @@ echo $ac_n "checking for main in -lxml""... $ac_c" 1>&6 -echo "configure:5640: checking for main in -lxml" >&5 +echo "configure:5722: checking for main in -lxml" >&5 ac_lib_var=`echo xml'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lxml " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5670,19 +5752,19 @@ echo $ac_n "checking for main in -lglade""... $ac_c" 1>&6 -echo "configure:5674: checking for main in -lglade" >&5 +echo "configure:5756: checking for main in -lglade" >&5 ac_lib_var=`echo glade'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lglade " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5704,19 +5786,19 @@ echo $ac_n "checking for main in -lglade-gnome""... $ac_c" 1>&6 -echo "configure:5708: checking for main in -lglade-gnome" >&5 +echo "configure:5790: checking for main in -lglade-gnome" >&5 ac_lib_var=`echo glade-gnome'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lglade-gnome " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5737,7 +5819,7 @@ cat > conftest.$ac_ext < EOF @@ -5796,7 +5878,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:5800: checking for X" >&5 +echo "configure:5882: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5856,12 +5938,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5930,14 +6012,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -6046,17 +6128,17 @@ case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:6050: checking whether -R must be followed by a space" >&5 +echo "configure:6132: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -6072,14 +6154,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -6115,12 +6197,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:6119: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:6201: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6155,12 +6237,12 @@ if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:6159: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:6241: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet_stub " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6200,10 +6282,10 @@ # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:6204: checking for gethostbyname" >&5 +echo "configure:6286: checking for gethostbyname" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -6247,12 +6329,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:6251: checking for gethostbyname in -lnsl" >&5 +echo "configure:6333: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` xe_check_libs=" -lnsl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6293,10 +6375,10 @@ # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:6297: checking for connect" >&5 +echo "configure:6379: checking for connect" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -6342,12 +6424,12 @@ xe_msg_checking="for connect in -lsocket" test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6346: checking "$xe_msg_checking"" >&5 +echo "configure:6428: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocket $X_EXTRA_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6382,10 +6464,10 @@ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:6386: checking for remove" >&5 +echo "configure:6468: checking for remove" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -6429,12 +6511,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:6433: checking for remove in -lposix" >&5 +echo "configure:6515: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` xe_check_libs=" -lposix " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6469,10 +6551,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:6473: checking for shmat" >&5 +echo "configure:6555: checking for shmat" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -6516,12 +6598,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:6520: checking for shmat in -lipc" >&5 +echo "configure:6602: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` xe_check_libs=" -lipc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6568,12 +6650,12 @@ xe_msg_checking="for IceConnectionNumber in -lICE" test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6572: checking "$xe_msg_checking"" >&5 +echo "configure:6654: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` xe_check_libs=" -lICE $X_EXTRA_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6630,15 +6712,15 @@ ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:6634: checking for Xm/Xm.h" >&5 +echo "configure:6716: checking for Xm/Xm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6655,12 +6737,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:6659: checking for XmStringFree in -lXm" >&5 +echo "configure:6741: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6823,7 +6905,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:6827: checking for X defines extracted by xmkmf" >&5 +echo "configure:6909: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -6872,15 +6954,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:6876: checking for X11/Intrinsic.h" >&5 +echo "configure:6958: checking for X11/Intrinsic.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6904,12 +6986,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:6908: checking for XOpenDisplay in -lX11" >&5 +echo "configure:6990: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6945,12 +7027,12 @@ xe_msg_checking="for XGetFontProperty in -lX11" test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6949: checking "$xe_msg_checking"" >&5 +echo "configure:7031: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 -b i486-linuxaout" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6988,12 +7070,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:6992: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:7074: checking for XShapeSelectInput in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'` xe_check_libs=" -lXext " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7027,12 +7109,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:7031: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:7113: checking for XtOpenDisplay in -lXt" >&5 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lXt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7066,14 +7148,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:7070: checking the version of X11 being used" >&5 +echo "configure:7152: checking the version of X11 being used" >&5 cat > conftest.$ac_ext < int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; } EOF -if { (eval echo configure:7077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest foobar; x11_release=$? else @@ -7104,10 +7186,10 @@ for ac_func in XConvertCase do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7108: checking for $ac_func" >&5 +echo "configure:7190: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7162,15 +7244,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7166: checking for $ac_hdr" >&5 +echo "configure:7248: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7203,10 +7285,10 @@ for ac_func in XRegisterIMInstantiateCallback do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7207: checking for $ac_func" >&5 +echo "configure:7289: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7257,9 +7339,9 @@ done echo $ac_n "checking for standard XRegisterIMInstantiateCallback prototype""... $ac_c" 1>&6 -echo "configure:7261: checking for standard XRegisterIMInstantiateCallback prototype" >&5 +echo "configure:7343: checking for standard XRegisterIMInstantiateCallback prototype" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -7292,12 +7374,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:7296: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:7378: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` xe_check_libs=" -lXmu " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7347,19 +7429,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:7351: checking for main in -lXbsd" >&5 +echo "configure:7433: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lXbsd " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7396,22 +7478,22 @@ fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:7400: checking for MS-Windows" >&5 +echo "configure:7482: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:7403: checking for main in -lgdi32" >&5 +echo "configure:7485: checking for main in -lgdi32" >&5 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdi32 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7462,12 +7544,12 @@ test "$with_widgets" != "no" && with_widgets=msw fi cat > conftest.$ac_ext < int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } EOF -if { (eval echo configure:7471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MSG_SELECT @@ -7528,15 +7610,15 @@ if test "$with_x11" = "yes"; then ac_safe=`echo "X11/extensions/shape.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6 -echo "configure:7532: checking for X11/extensions/shape.h" >&5 +echo "configure:7614: checking for X11/extensions/shape.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7586,7 +7668,7 @@ esac echo "checking for WM_COMMAND option" 1>&6 -echo "configure:7590: checking for WM_COMMAND option" >&5; +echo "configure:7672: checking for WM_COMMAND option" >&5; if test "$with_wmcommand" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_WMCOMMAND @@ -7601,15 +7683,15 @@ test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6 -echo "configure:7605: checking for X11/Xauth.h" >&5 +echo "configure:7687: checking for X11/Xauth.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7632,12 +7714,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:7636: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:7718: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7699,32 +7781,32 @@ if test "$with_modules" != "no"; then echo "checking for module support" 1>&6 -echo "configure:7703: checking for module support" >&5 +echo "configure:7785: checking for module support" >&5 - if test "$with_msw" = "yes"; then - have_dl=yes; - else - case "$opsys" in - darwin ) have_dl=yes; { test "$extra_verbose" = "yes" && cat << \EOF + case "$opsys" in + mingw* | cygwin* ) have_dl=yes ;; + darwin ) have_dl=yes + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DYLD EOF cat >> confdefs.h <<\EOF #define HAVE_DYLD 1 EOF } - ;; - * ) + + ;; + * ) ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:7720: checking for dlfcn.h" >&5 +echo "configure:7802: checking for dlfcn.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7741,16 +7823,16 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:7745: checking for dlopen in -lc" >&5 +echo "configure:7827: checking for dlopen in -lc" >&5 cat > conftest.$ac_ext < int main() { - dlopen ("", 0); + dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7759,18 +7841,37 @@ rm -rf conftest* echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:7763: checking for dlopen in -ldl" >&5 - ac_save_LIBS="$LIBS" - LIBS="-ldl $LIBS" - cat > conftest.$ac_ext <&5 + ac_save_LIBS="$LIBS" + LIBS="$LIBS -ldl" + cat > conftest.$ac_ext < int main() { - dlopen ("", 0); + dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + have_dl=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 +echo "configure:7865: checking for dlopen in -lsvld" >&5 + LIBS="$ac_save_LIBS -lsvld" + cat > conftest.$ac_ext < +int main() { + dlopen ("", 0); +; return 0; } +EOF +if { (eval echo configure:7875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7780,14 +7881,15 @@ LIBS="$ac_save_LIBS" fi rm -f conftest* - ac_save_LIBS= +fi +rm -f conftest* fi rm -f conftest* else echo "$ac_t""no" 1>&6 fi - if test -n "$have_dl"; then + if test "$have_dl" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DLOPEN EOF @@ -7796,8 +7898,156 @@ EOF } - fi - esac fi + else + ac_safe=`echo "dl.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for dl.h""... $ac_c" 1>&6 +echo "configure:7905: checking for dl.h" >&5 + +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + echo $ac_n "checking for shl_load in -lc""... $ac_c" 1>&6 +echo "configure:7930: checking for shl_load in -lc" >&5 + cat > conftest.$ac_ext < +int main() { + shl_load ("", 0, 0); +; return 0; } +EOF +if { (eval echo configure:7939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + have_dl=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo $ac_n "checking for shl_load in -ldl""... $ac_c" 1>&6 +echo "configure:7948: checking for shl_load in -ldl" >&5 + ac_save_LIBS="$LIBS" + LIBS="$LIBS -ldld" + cat > conftest.$ac_ext < +int main() { + shl_load ("", 0, 0); +; return 0; } +EOF +if { (eval echo configure:7959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + have_dl=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + LIBS="$ac_save_LIBS" +fi +rm -f conftest* +fi +rm -f conftest* +else + echo "$ac_t""no" 1>&6 +fi + + if test "$have_dl" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_SHL_LOAD +EOF +cat >> confdefs.h <<\EOF +#define HAVE_SHL_LOAD 1 +EOF +} + + else + ac_safe=`echo "ltdl.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for ltdl.h""... $ac_c" 1>&6 +echo "configure:7987: checking for ltdl.h" >&5 + +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6 +echo "configure:8012: checking for lt_dlinit in -lltdl" >&5 + ac_save_LIBS="$LIBS" + LIBS="$LIBS -lltdl" + cat > conftest.$ac_ext < +int main() { + lt_dlinit (); +; return 0; } +EOF +if { (eval echo configure:8023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + have_dl=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + LIBS="$ac_save_LIBS" +fi +rm -f conftest* +else + echo "$ac_t""no" 1>&6 +fi + + if test "$have_dl" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_LTDL +EOF +cat >> confdefs.h <<\EOF +#define HAVE_LTDL 1 +EOF +} + + fi + fi + fi + ac_save_LIBS= + esac + if test -n "$have_dl"; then dll_ld= @@ -7810,7 +8060,7 @@ xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:7814: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:8064: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -7838,9 +8088,9 @@ XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:7842: checking checking whether we are using GNU C" >&5 +echo "configure:8092: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <&6 -echo "configure:7866: checking how to produce PIC code" >&5 +echo "configure:8116: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -7966,18 +8216,18 @@ # Check to make sure the dll_cflags actually works. echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6 -echo "configure:7970: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:8220: checking if PIC flag ${dll_cflags} really works" >&5 save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $dll_cflags -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also @@ -8008,7 +8258,7 @@ xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:8012: checking if C compiler can produce shared libraries" >&5 +echo "configure:8262: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes -o "$__ICC" = yes; then case "$xehost_os" in *darwin*) @@ -8067,14 +8317,14 @@ xe_libs= ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cc_produces_so=yes else @@ -8099,7 +8349,7 @@ if test "$XEGCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:8103: checking for ld used by GCC" >&5 +echo "configure:8353: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -8125,7 +8375,7 @@ esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:8129: checking for GNU ld" >&5 +echo "configure:8379: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -8163,7 +8413,7 @@ # Check to see if it really is or isn't GNU ld. echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6 -echo "configure:8167: checking if the linker is GNU ld" >&5 +echo "configure:8417: checking if the linker is GNU ld" >&5 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LTLD -v 2>&1 &5; then xe_gnu_ld=yes @@ -8198,7 +8448,7 @@ # OK - only NOW do we futz about with ld. # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6 -echo "configure:8202: checking whether the linker supports shared libraries" >&5 +echo "configure:8452: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -8411,10 +8661,10 @@ for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8415: checking for $ac_func" >&5 +echo "configure:8665: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8501,15 +8751,15 @@ for dir in "" "Tt/" "desktop/" ; do ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6 -echo "configure:8505: checking for ${dir}tt_c.h" >&5 +echo "configure:8755: checking for ${dir}tt_c.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8545,12 +8795,12 @@ xe_msg_checking="for tt_message_create in -ltt" test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:8549: checking "$xe_msg_checking"" >&5 +echo "configure:8799: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` xe_check_libs=" -ltt $extra_libs" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8615,15 +8865,15 @@ test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6 -echo "configure:8619: checking for Dt/Dt.h" >&5 +echo "configure:8869: checking for Dt/Dt.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8646,12 +8896,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:8650: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:8900: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8743,7 +8993,7 @@ if test "$with_dragndrop" != "no" ; then echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 -echo "configure:8747: checking if drag and drop API is needed" >&5 +echo "configure:8997: checking if drag and drop API is needed" >&5 if test -n "$dragndrop_proto" ; then with_dragndrop=yes echo "$ac_t""yes (${dragndrop_proto} )" 1>&6 @@ -8763,19 +9013,19 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:8767: checking for LDAP" >&5 +echo "configure:9017: checking for LDAP" >&5 ldap_libs= test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ldap.h""... $ac_c" 1>&6 -echo "configure:8771: checking for ldap.h" >&5 +echo "configure:9021: checking for ldap.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8798,15 +9048,15 @@ } test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for lber.h""... $ac_c" 1>&6 -echo "configure:8802: checking for lber.h" >&5 +echo "configure:9052: checking for lber.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8830,12 +9080,12 @@ if test "$with_ldap" != "no"; then echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:8834: checking for ldap_search in -lldap" >&5 +echo "configure:9084: checking for ldap_search in -lldap" >&5 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8871,12 +9121,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:8875: checking "$xe_msg_checking"" >&5 +echo "configure:9125: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8912,12 +9162,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:8916: checking "$xe_msg_checking"" >&5 +echo "configure:9166: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber -lkrb" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8953,12 +9203,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:8957: checking "$xe_msg_checking"" >&5 +echo "configure:9207: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber -lkrb -ldes" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9018,10 +9268,10 @@ for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9022: checking for $ac_func" >&5 +echo "configure:9272: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9083,20 +9333,20 @@ postgresql_libs= if test "$with_postgresql" != "no"; then echo "checking for PostgreSQL" 1>&6 -echo "configure:9087: checking for PostgreSQL" >&5 +echo "configure:9337: checking for PostgreSQL" >&5 for header_dir in "" "pgsql/" "postgresql/"; do ac_safe=`echo "${header_dir}libpq-fe.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${header_dir}libpq-fe.h""... $ac_c" 1>&6 -echo "configure:9092: checking for ${header_dir}libpq-fe.h" >&5 +echo "configure:9342: checking for ${header_dir}libpq-fe.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9120,12 +9370,12 @@ test -n "$libpq_fe_h_file" && { echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6 -echo "configure:9124: checking for PQconnectdb in -lpq" >&5 +echo "configure:9374: checking for PQconnectdb in -lpq" >&5 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'` xe_check_libs=" -lpq " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9169,12 +9419,12 @@ echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6 -echo "configure:9173: checking for PQconnectStart in -lpq" >&5 +echo "configure:9423: checking for PQconnectStart in -lpq" >&5 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lpq " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9236,7 +9486,7 @@ if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:9240: checking for graphics libraries" >&5 +echo "configure:9490: checking for graphics libraries" >&5 libpath_xpm= incpath_xpm= @@ -9262,10 +9512,10 @@ CFLAGS=""$incpath_xpm" $CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi LDFLAGS=""$libpath_xpm" $LDFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$libpath_xpm"\" to \$LDFLAGS"; fi echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:9266: checking for Xpm - no older than 3.4f" >&5 +echo "configure:9516: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext < @@ -9274,7 +9524,7 @@ XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:9278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest dummy_arg; xpm_status=$?; if test "$xpm_status" = "0"; then @@ -9318,17 +9568,17 @@ libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi CFLAGS=""$incpath_xpm" $CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6 -echo "configure:9322: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:9572: checking for \"FOR_MSW\" xpm" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xpm_for_msw=no else @@ -9354,15 +9604,15 @@ test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for compface.h""... $ac_c" 1>&6 -echo "configure:9358: checking for compface.h" >&5 +echo "configure:9608: checking for compface.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9385,12 +9635,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:9389: checking for UnGenFace in -lcompface" >&5 +echo "configure:9639: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9450,12 +9700,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:9454: checking for inflate in -lc" >&5 +echo "configure:9704: checking for inflate in -lc" >&5 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9485,12 +9735,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:9489: checking for inflate in -lz" >&5 +echo "configure:9739: checking for inflate in -lz" >&5 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9520,12 +9770,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:9524: checking for inflate in -lgz" >&5 +echo "configure:9774: checking for inflate in -lgz" >&5 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lgz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9566,15 +9816,15 @@ test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6 -echo "configure:9570: checking for jpeglib.h" >&5 +echo "configure:9820: checking for jpeglib.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9597,12 +9847,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:9601: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:9851: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` xe_check_libs=" -ljpeg " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9649,10 +9899,10 @@ png_problem="" test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:9653: checking for pow" >&5 +echo "configure:9903: checking for pow" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -9696,15 +9946,15 @@ } test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:9700: checking for png.h" >&5 +echo "configure:9950: checking for png.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9727,12 +9977,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:9731: checking for png_read_image in -lpng" >&5 +echo "configure:9981: checking for png_read_image in -lpng" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` xe_check_libs=" -lpng " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9766,10 +10016,10 @@ } if test -z "$with_png"; then echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:9770: checking for workable png version information" >&5 +echo "configure:10020: checking for workable png version information" >&5 xe_check_libs="-lpng -lz" cat > conftest.$ac_ext < int main(int c, char **v) { @@ -9777,7 +10027,7 @@ if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1; return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;} EOF -if { (eval echo configure:9781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest dummy_arg; png_status=$?; if test "$png_status" = "0"; then @@ -9820,15 +10070,15 @@ test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6 -echo "configure:9824: checking for tiffio.h" >&5 +echo "configure:10074: checking for tiffio.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9851,12 +10101,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:9855: checking for TIFFClientOpen in -ltiff" >&5 +echo "configure:10105: checking for TIFFClientOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'` xe_check_libs=" -ltiff " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9906,15 +10156,15 @@ if test "$with_gtk" = "yes"; then test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for compface.h""... $ac_c" 1>&6 -echo "configure:9910: checking for compface.h" >&5 +echo "configure:10160: checking for compface.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9937,12 +10187,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:9941: checking for UnGenFace in -lcompface" >&5 +echo "configure:10191: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9992,7 +10242,7 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:9996: checking for X11 graphics libraries" >&5 +echo "configure:10246: checking for X11 graphics libraries" >&5 fi case "$with_widgets" in @@ -10002,7 +10252,7 @@ if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then echo "checking for the Athena widgets" 1>&6 -echo "configure:10006: checking for the Athena widgets" >&5 +echo "configure:10256: checking for the Athena widgets" >&5 case "$with_athena" in "xaw" | "") athena_variant=Xaw athena_3d=no ;; @@ -10016,12 +10266,12 @@ if test "$athena_3d" = "no"; then echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:10020: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 +echo "configure:10270: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10048,12 +10298,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:10052: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:10302: checking for threeDClassRec in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10095,12 +10345,12 @@ else echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:10099: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:10349: checking for threeDClassRec in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10129,12 +10379,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:10133: checking for threeDClassRec in -lXaw" >&5 +echo "configure:10383: checking for threeDClassRec in -lXaw" >&5 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10176,15 +10426,15 @@ if test "$athena_3d" = "no"; then ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10180: checking for X11/Xaw/ThreeD.h" >&5 +echo "configure:10430: checking for X11/Xaw/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10204,15 +10454,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6 -echo "configure:10208: checking for X11/Xaw/XawInit.h" >&5 +echo "configure:10458: checking for X11/Xaw/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10238,15 +10488,15 @@ else ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6 -echo "configure:10242: checking for X11/$athena_variant/XawInit.h" >&5 +echo "configure:10492: checking for X11/$athena_variant/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10263,15 +10513,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10267: checking for X11/$athena_variant/ThreeD.h" >&5 +echo "configure:10517: checking for X11/$athena_variant/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10299,15 +10549,15 @@ if test -z "$athena_h_path"; then ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6 -echo "configure:10303: checking for $athena_variant/XawInit.h" >&5 +echo "configure:10553: checking for $athena_variant/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10324,15 +10574,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10328: checking for $athena_variant/ThreeD.h" >&5 +echo "configure:10578: checking for $athena_variant/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10361,15 +10611,15 @@ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6 -echo "configure:10365: checking for X11/Xaw3d/XawInit.h" >&5 +echo "configure:10615: checking for X11/Xaw3d/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10386,15 +10636,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10390: checking for X11/Xaw3d/ThreeD.h" >&5 +echo "configure:10640: checking for X11/Xaw3d/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10426,15 +10676,15 @@ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6 -echo "configure:10430: checking for Xaw3d/XawInit.h" >&5 +echo "configure:10680: checking for Xaw3d/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10451,15 +10701,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10455: checking for Xaw3d/ThreeD.h" >&5 +echo "configure:10705: checking for Xaw3d/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10491,15 +10741,15 @@ if test -z "$athena_h_path"; then ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10495: checking for X11/Xaw/ThreeD.h" >&5 +echo "configure:10745: checking for X11/Xaw/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10538,15 +10788,15 @@ if test "$with_x11" = "yes"; then ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:10542: checking for Xm/Xm.h" >&5 +echo "configure:10792: checking for Xm/Xm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10563,12 +10813,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:10567: checking for XmStringFree in -lXm" >&5 +echo "configure:10817: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10608,9 +10858,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:10612: checking for Lesstif" >&5 +echo "configure:10862: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -10983,7 +11233,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:10987: checking for Mule-related features" >&5 +echo "configure:11237: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -10997,15 +11247,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11001: checking for $ac_hdr" >&5 +echo "configure:11251: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11036,12 +11286,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:11040: checking for strerror in -lintl" >&5 +echo "configure:11290: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11085,18 +11335,18 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:11089: checking for Mule input methods" >&5 +echo "configure:11339: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:11092: checking for XIM" >&5 +echo "configure:11342: checking for XIM" >&5 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6 -echo "configure:11095: checking for XOpenIM in -lX11" >&5 +echo "configure:11345: checking for XOpenIM in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11131,12 +11381,12 @@ if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:11135: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:11385: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11212,15 +11462,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:11216: checking for XFontSet" >&5 +echo "configure:11466: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:11219: checking for XmbDrawString in -lX11" >&5 +echo "configure:11469: checking for XmbDrawString in -lX11" >&5 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11271,15 +11521,15 @@ test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6 -echo "configure:11275: checking for wnn/jllib.h" >&5 +echo "configure:11525: checking for wnn/jllib.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11302,15 +11552,15 @@ } test -z "$with_wnn" && { ac_safe=`echo "wnn/commonhd.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wnn/commonhd.h""... $ac_c" 1>&6 -echo "configure:11306: checking for wnn/commonhd.h" >&5 +echo "configure:11556: checking for wnn/commonhd.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11335,10 +11585,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11339: checking for $ac_func" >&5 +echo "configure:11589: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11390,12 +11640,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:11394: checking for crypt in -lcrypt" >&5 +echo "configure:11644: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` xe_check_libs=" -lcrypt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11441,12 +11691,12 @@ if test -z "$with_wnn" -o "$with_wnn" = "yes"; then echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6 -echo "configure:11445: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:11695: checking for jl_dic_list_e in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11475,12 +11725,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6 -echo "configure:11479: checking for jl_dic_list_e in -lwnn4" >&5 +echo "configure:11729: checking for jl_dic_list_e in -lwnn4" >&5 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn4 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11509,12 +11759,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6 -echo "configure:11513: checking for jl_dic_list_e in -lwnn6" >&5 +echo "configure:11763: checking for jl_dic_list_e in -lwnn6" >&5 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn6 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11543,12 +11793,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6 -echo "configure:11547: checking for dic_list_e in -lwnn6_fromsrc" >&5 +echo "configure:11797: checking for dic_list_e in -lwnn6_fromsrc" >&5 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn6_fromsrc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11604,12 +11854,12 @@ if test "$with_wnn6" != "no"; then echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6 -echo "configure:11608: checking for jl_fi_dic_list in -l$libwnn" >&5 +echo "configure:11858: checking for jl_fi_dic_list in -l$libwnn" >&5 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'` xe_check_libs=" -l$libwnn " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11655,15 +11905,15 @@ if test "$with_canna" != "no"; then ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6 -echo "configure:11659: checking for canna/jrkanji.h" >&5 +echo "configure:11909: checking for canna/jrkanji.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11690,15 +11940,15 @@ c_switch_site="$c_switch_site -I/usr/local/canna/include" ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6 -echo "configure:11694: checking for canna/jrkanji.h" >&5 +echo "configure:11944: checking for canna/jrkanji.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11726,15 +11976,15 @@ test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6 -echo "configure:11730: checking for canna/RK.h" >&5 +echo "configure:11980: checking for canna/RK.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11757,12 +12007,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:11761: checking for RkBgnBun in -lRKC" >&5 +echo "configure:12011: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11796,12 +12046,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:11800: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:12050: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11858,12 +12108,12 @@ libs_x="-lXm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXm\" to \$libs_x"; fi echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6 -echo "configure:11862: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:12112: checking for layout_object_getvalue in -li18n" >&5 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'` xe_check_libs=" -li18n " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11958,13 +12208,13 @@ fi -for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror strlwr strupr symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp +for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize getrlimit gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror strlwr strupr symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp vlimit do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11965: checking for $ac_func" >&5 +echo "configure:12215: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12028,10 +12278,10 @@ for ac_func in getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12032: checking for $ac_func" >&5 +echo "configure:12282: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12083,10 +12333,10 @@ echo $ac_n "checking for openpty""... $ac_c" 1>&6 -echo "configure:12087: checking for openpty" >&5 +echo "configure:12337: checking for openpty" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_openpty=yes" else @@ -12128,12 +12378,12 @@ echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 -echo "configure:12132: checking for openpty in -lutil" >&5 +echo "configure:12382: checking for openpty in -lutil" >&5 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'` xe_check_libs=" -lutil " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12179,15 +12429,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12183: checking for $ac_hdr" >&5 +echo "configure:12433: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12224,15 +12474,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12228: checking for $ac_hdr" >&5 +echo "configure:12478: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12265,15 +12515,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12269: checking for $ac_hdr" >&5 +echo "configure:12519: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12306,15 +12556,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12310: checking for $ac_hdr" >&5 +echo "configure:12560: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12350,15 +12600,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12354: checking for $ac_hdr" >&5 +echo "configure:12604: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12391,10 +12641,10 @@ for ac_func in isastream do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12395: checking for $ac_func" >&5 +echo "configure:12645: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12448,15 +12698,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12452: checking for $ac_hdr" >&5 +echo "configure:12702: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12489,10 +12739,10 @@ for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12493: checking for $ac_func" >&5 +echo "configure:12743: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12548,15 +12798,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12552: checking for $ac_hdr" >&5 +echo "configure:12802: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12592,12 +12842,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:12596: checking for kstat_open in -lkstat" >&5 +echo "configure:12846: checking for kstat_open in -lkstat" >&5 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lkstat " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12643,15 +12893,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12647: checking for $ac_hdr" >&5 +echo "configure:12897: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12683,12 +12933,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:12687: checking for kvm_read in -lkvm" >&5 +echo "configure:12937: checking for kvm_read in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` xe_check_libs=" -lkvm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12733,16 +12983,16 @@ fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:12737: checking whether netdb declares h_errno" >&5 +echo "configure:12987: checking whether netdb declares h_errno" >&5 cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:12746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -12762,16 +13012,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:12766: checking for sigsetjmp" >&5 +echo "configure:13016: checking for sigsetjmp" >&5 cat > conftest.$ac_ext < int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:12775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -12791,11 +13041,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:12795: checking whether localtime caches TZ" >&5 +echo "configure:13045: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext < #if STDC_HEADERS @@ -12830,7 +13080,7 @@ exit (0); } EOF -if { (eval echo configure:12834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then emacs_cv_localtime_cache=no else @@ -12860,9 +13110,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:12864: checking whether gettimeofday accepts one or two arguments" >&5 +echo "configure:13114: checking whether gettimeofday accepts one or two arguments" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""two" 1>&6 else @@ -12905,19 +13155,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:12909: checking for inline" >&5 +echo "configure:13159: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -12954,16 +13204,16 @@ fi echo $ac_n "checking for typeof""... $ac_c" 1>&6 -echo "configure:12958: checking for typeof" >&5 +echo "configure:13208: checking for typeof" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* typeofname="__typeof__" else @@ -12971,14 +13221,14 @@ cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* typeofname="typeof" else @@ -13007,17 +13257,17 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:13011: checking for working alloca.h" >&5 +echo "configure:13261: checking for working alloca.h" >&5 cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:13021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -13041,10 +13291,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:13045: checking for alloca" >&5 +echo "configure:13295: checking for alloca" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -13111,10 +13361,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:13115: checking whether alloca needs Cray hooks" >&5 +echo "configure:13365: checking whether alloca needs Cray hooks" >&5 cat > conftest.$ac_ext <&6 -echo "configure:13142: checking for $ac_func" >&5 +echo "configure:13392: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13194,10 +13444,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:13198: checking stack direction for C alloca" >&5 +echo "configure:13448: checking stack direction for C alloca" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_stack_direction=1 else @@ -13245,9 +13495,9 @@ fi echo $ac_n "checking for working alloca in function calls""... $ac_c" 1>&6 -echo "configure:13249: checking for working alloca in function calls" >&5 +echo "configure:13499: checking for working alloca in function calls" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then working_alloca_in_function_calls=yes else @@ -13323,10 +13573,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:13327: checking for working strcoll" >&5 +echo "configure:13577: checking for working strcoll" >&5 cat > conftest.$ac_ext < main () @@ -13336,7 +13586,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:13340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -13364,10 +13614,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13368: checking for $ac_func" >&5 +echo "configure:13618: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13418,10 +13668,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:13422: checking whether getpgrp takes no argument" >&5 +echo "configure:13672: checking whether getpgrp takes no argument" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -13503,10 +13753,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:13507: checking for working mmap" >&5 +echo "configure:13757: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext < #include @@ -13539,7 +13789,7 @@ return 1; } EOF -if { (eval echo configure:13543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then have_mmap=yes else @@ -13568,9 +13818,9 @@ if test "$rel_alloc $have_mmap" = "default yes"; then if test "$doug_lea_malloc" = "yes"; then echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6 -echo "configure:13572: checking for M_MMAP_THRESHOLD" >&5 +echo "configure:13822: checking for M_MMAP_THRESHOLD" >&5 cat > conftest.$ac_ext < int main() { @@ -13582,7 +13832,7 @@ ; return 0; } EOF -if { (eval echo configure:13586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rel_alloc=no; echo "$ac_t""yes" 1>&6; else @@ -13607,15 +13857,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:13611: checking for termios.h" >&5 +echo "configure:13861: checking for termios.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13619: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13658,15 +13908,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termio.h""... $ac_c" 1>&6 -echo "configure:13662: checking for termio.h" >&5 +echo "configure:13912: checking for termio.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13698,10 +13948,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:13702: checking for socket" >&5 +echo "configure:13952: checking for socket" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -13739,15 +13989,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6 -echo "configure:13743: checking for netinet/in.h" >&5 +echo "configure:13993: checking for netinet/in.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13764,15 +14014,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6 -echo "configure:13768: checking for arpa/inet.h" >&5 +echo "configure:14018: checking for arpa/inet.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13797,9 +14047,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:13801: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:14051: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext < @@ -13810,7 +14060,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:13814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SOCKADDR_SUN_LEN @@ -13828,9 +14078,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:13832: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:14082: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext < @@ -13840,7 +14090,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:13844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MULTICAST @@ -13871,10 +14121,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:13875: checking for msgget" >&5 +echo "configure:14125: checking for msgget" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -13912,15 +14162,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6 -echo "configure:13916: checking for sys/ipc.h" >&5 +echo "configure:14166: checking for sys/ipc.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13937,15 +14187,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6 -echo "configure:13941: checking for sys/msg.h" >&5 +echo "configure:14191: checking for sys/msg.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13983,15 +14233,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:13987: checking for dirent.h" >&5 +echo "configure:14237: checking for dirent.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14018,15 +14268,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6 -echo "configure:14022: checking for sys/dir.h" >&5 +echo "configure:14272: checking for sys/dir.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14059,15 +14309,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:14063: checking for nlist.h" >&5 +echo "configure:14313: checking for nlist.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14097,22 +14347,22 @@ echo "checking "for sound support"" 1>&6 -echo "configure:14101: checking "for sound support"" >&5 +echo "configure:14351: checking "for sound support"" >&5 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes if test "$with_native_sound" != "no"; then if test -n "$native_sound_lib"; then ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6 -echo "configure:14108: checking for multimedia/audio_device.h" >&5 +echo "configure:14358: checking for multimedia/audio_device.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14168,12 +14418,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:14172: checking for ALopenport in -laudio" >&5 +echo "configure:14422: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14215,12 +14465,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:14219: checking for AOpenAudio in -lAlib" >&5 +echo "configure:14469: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14279,15 +14529,15 @@ for dir in "machine" "sys" "linux"; do ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6 -echo "configure:14283: checking for ${dir}/soundcard.h" >&5 +echo "configure:14533: checking for ${dir}/soundcard.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14341,15 +14591,15 @@ if test "$with_nas_sound" != "no"; then ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6 -echo "configure:14345: checking for audio/audiolib.h" >&5 +echo "configure:14595: checking for audio/audiolib.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14367,12 +14617,12 @@ echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6 -echo "configure:14371: checking for AuOpenServer in -laudio" >&5 +echo "configure:14621: checking for AuOpenServer in -laudio" >&5 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14422,7 +14672,7 @@ fi libs_x="-laudio $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-laudio\" to \$libs_x"; fi cat > conftest.$ac_ext < EOF @@ -14453,7 +14703,7 @@ # Extract the first word of "esd-config", so it can be a program name with args. set dummy esd-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:14457: checking for $ac_word" >&5 +echo "configure:14707: checking for $ac_word" >&5 if test -n "$have_esd_config"; then ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test. @@ -14482,10 +14732,10 @@ c_switch_site="$c_switch_site `esd-config --cflags`" && if test "$extra_verbose" = "yes"; then echo " Appending \"`esd-config --cflags`\" to \$c_switch_site"; fi LIBS="`esd-config --libs` $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"`esd-config --libs`\" to \$LIBS"; fi echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6 -echo "configure:14486: checking for esd_play_stream" >&5 +echo "configure:14736: checking for esd_play_stream" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_esd_play_stream=yes" else @@ -14559,7 +14809,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:14563: checking for TTY-related features" >&5 +echo "configure:14813: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -14572,12 +14822,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:14576: checking for tgetent in -lncurses" >&5 +echo "configure:14826: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14621,15 +14871,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:14625: checking for ncurses/curses.h" >&5 +echo "configure:14875: checking for ncurses/curses.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14651,15 +14901,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:14655: checking for ncurses/term.h" >&5 +echo "configure:14905: checking for ncurses/term.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14689,15 +14939,15 @@ c_switch_site="$c_switch_site -I/usr/include/ncurses" ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:14693: checking for ncurses/curses.h" >&5 +echo "configure:14943: checking for ncurses/curses.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14732,12 +14982,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:14736: checking for tgetent in -l$lib" >&5 +echo "configure:14986: checking for tgetent in -l$lib" >&5 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -l$lib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14779,12 +15029,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:14783: checking for tgetent in -lcurses" >&5 +echo "configure:15033: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lcurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14813,12 +15063,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:14817: checking for tgetent in -ltermcap" >&5 +echo "configure:15067: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -ltermcap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14875,17 +15125,18 @@ } - test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'` + if test "$with_gpm" != "no"; then + ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gpm.h""... $ac_c" 1>&6 -echo "configure:14881: checking for gpm.h" >&5 +echo "configure:15132: checking for gpm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14900,20 +15151,15 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -with_gpm=no -fi - } - test -z "$with_gpm" && { + + echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:14912: checking for Gpm_Open in -lgpm" >&5 +echo "configure:15158: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgpm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14938,15 +15184,19 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - with_gpm=yes + have_gpm=yes else echo "$ac_t""no" 1>&6 -with_gpm=no fi - } - if test "$with_gpm" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF + +else + echo "$ac_t""no" 1>&6 +fi + + if test "$have_gpm" = "yes"; then + with_gpm=yes + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_GPM EOF cat >> confdefs.h <<\EOF @@ -14954,7 +15204,12 @@ EOF } - LIBS="-lgpm $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgpm\" to \$LIBS"; fi + LIBS="-lgpm $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgpm\" to \$LIBS"; fi + elif test "$with_gpm" = "yes"; then + { echo "Error:" "GPM requested, but gpm.h or libgpm seems to be missing." >&2; exit 1; } + else + with_gpm=no + fi fi else for feature in ncurses gpm; do @@ -14967,20 +15222,20 @@ test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ != "no no no" && echo "checking for database support" 1>&6 -echo "configure:14971: checking for database support" >&5 +echo "configure:15226: checking for database support" >&5 if test "$with_database_gdbm $with_database_dbm" != "no no"; then ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6 -echo "configure:14976: checking for ndbm.h" >&5 +echo "configure:15231: checking for ndbm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -15010,12 +15265,12 @@ if test "$with_database_gdbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:15014: checking for dbm_open in -lgdbm" >&5 +echo "configure:15269: checking for dbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdbm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -15054,10 +15309,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:15058: checking for dbm_open" >&5 +echo "configure:15313: checking for dbm_open" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -15099,12 +15354,12 @@ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:15103: checking for dbm_open in -ldbm" >&5 +echo "configure:15358: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -ldbm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -15156,10 +15411,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:15160: checking for Berkeley db.h" >&5 +echo "configure:15415: checking for Berkeley db.h" >&5 for header in "db/db.h" "db.h"; do cat > conftest.$ac_ext < @@ -15181,7 +15436,7 @@ ; return 0; } EOF -if { (eval echo configure:15185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:15440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_file="$header"; break else @@ -15197,9 +15452,9 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6 -echo "configure:15201: checking for Berkeley DB version" >&5 +echo "configure:15456: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 1 @@ -15211,7 +15466,7 @@ egrep "yes" >/dev/null 2>&1; then rm -rf conftest* cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 2 @@ -15223,7 +15478,7 @@ egrep "yes" >/dev/null 2>&1; then rm -rf conftest* cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 3 @@ -15257,10 +15512,10 @@ rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:15261: checking for $dbfunc" >&5 +echo "configure:15516: checking for $dbfunc" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$dbfunc=yes" else @@ -15302,12 +15557,12 @@ echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:15306: checking for $dbfunc in -ldb" >&5 +echo "configure:15561: checking for $dbfunc in -ldb" >&5 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -15352,12 +15607,12 @@ echo "configure: warning: "db_create is really $dbfunc"" 1>&2 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:15356: checking for $dbfunc in -ldb" >&5 +echo "configure:15611: checking for $dbfunc in -ldb" >&5 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -15427,12 +15682,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:15431: checking for SOCKSinit in -lsocks" >&5 +echo "configure:15686: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -15496,12 +15751,358 @@ LIBS="-Bstatic -lut -Bdynamic $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi fi +if test "$use_number_lib" = "gmp"; then + ac_safe=`echo "gmp.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for gmp.h""... $ac_c" 1>&6 +echo "configure:15758: checking for gmp.h" >&5 + +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:15766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + +echo $ac_n "checking for __gmpz_init in -lgmp""... $ac_c" 1>&6 +echo "configure:15784: checking for __gmpz_init in -lgmp" >&5 +ac_lib_var=`echo gmp'_'__gmpz_init | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lgmp " +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + have_mpz_init=yes +else + echo "$ac_t""no" 1>&6 +fi + + +else + echo "$ac_t""no" 1>&6 +fi + + if test "$have_mpz_init" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining WITH_NUMBER_TYPES +EOF +cat >> confdefs.h <<\EOF +#define WITH_NUMBER_TYPES 1 +EOF +} + + { test "$extra_verbose" = "yes" && cat << \EOF + Defining WITH_GMP +EOF +cat >> confdefs.h <<\EOF +#define WITH_GMP 1 +EOF +} + + LIBS="-lgmp $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgmp\" to \$LIBS"; fi + else + { echo "Error:" "Required GMP numeric support cannot be provided." >&2; exit 1; } + fi +elif test "$use_number_lib" = "mp"; then + for library in "" "-lcrypto"; do + ac_safe=`echo "mp.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for mp.h""... $ac_c" 1>&6 +echo "configure:15849: checking for mp.h" >&5 + +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:15857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + +xe_msg_checking="for mp_mfree in -lmp" +test -n "$library" && xe_msg_checking="$xe_msg_checking using extra libs $library" +echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 +echo "configure:15877: checking "$xe_msg_checking"" >&5 +ac_lib_var=`echo mp'_'mp_mfree | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lmp $library" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + have_mp_mfree=yes; break +else + echo "$ac_t""no" 1>&6 + +xe_msg_checking="for mfree in -lmp" +test -n "$library" && xe_msg_checking="$xe_msg_checking using extra libs $library" +echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 +echo "configure:15914: checking "$xe_msg_checking"" >&5 +ac_lib_var=`echo mp'_'mfree | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lmp $library" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + have_mfree=yes; break +else + echo "$ac_t""no" 1>&6 +fi + + +fi + + +else + echo "$ac_t""no" 1>&6 +fi + + done + if test "$have_mp_mfree" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining MP_PREFIX +EOF +cat >> confdefs.h <<\EOF +#define MP_PREFIX 1 +EOF +} + + LIBS="$LIBS -lmp" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lmp\" to \$LIBS"; fi + if test "$library" != ""; then + LIBS="$LIBS $library" && if test "$extra_verbose" = "yes"; then echo " Appending \"$library\" to \$LIBS"; fi + fi + echo $ac_n "checking for mp_move""... $ac_c" 1>&6 +echo "configure:15972: checking for mp_move" >&5 + +cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mp_move(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mp_move) || defined (__stub___mp_move) +choke me +#else +mp_move(); +#endif + +; return 0; } +EOF +if { (eval echo configure:15998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_mp_move=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_mp_move=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'mp_move`\" = yes"; then + echo "$ac_t""yes" 1>&6 + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_MP_MOVE +EOF +cat >> confdefs.h <<\EOF +#define HAVE_MP_MOVE 1 +EOF +} + +else + echo "$ac_t""no" 1>&6 +fi + + elif test "$have_mfree" = "yes"; then + LIBS="$LIBS -lmp" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lmp\" to \$LIBS"; fi + if test "$library" != ""; then + LIBS="$LIBS $library" && if test "$extra_verbose" = "yes"; then echo " Appending \"$library\" to \$LIBS"; fi + fi + echo $ac_n "checking for move""... $ac_c" 1>&6 +echo "configure:16029: checking for move" >&5 + +cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char move(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_move) || defined (__stub___move) +choke me +#else +move(); +#endif + +; return 0; } +EOF +if { (eval echo configure:16055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_move=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_move=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'move`\" = yes"; then + echo "$ac_t""yes" 1>&6 + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_MP_MOVE +EOF +cat >> confdefs.h <<\EOF +#define HAVE_MP_MOVE 1 +EOF +} + +else + echo "$ac_t""no" 1>&6 +fi + + else + { echo "Error:" "Required MP numeric support cannot be provided." >&2; exit 1; } + fi + { test "$extra_verbose" = "yes" && cat << \EOF + Defining WITH_NUMBER_TYPES +EOF +cat >> confdefs.h <<\EOF +#define WITH_NUMBER_TYPES 1 +EOF +} + + { test "$extra_verbose" = "yes" && cat << \EOF + Defining WITH_MP +EOF +cat >> confdefs.h <<\EOF +#define WITH_MP 1 +EOF +} + +fi + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:16106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -16309,24 +16910,26 @@ test "$with_socks" = yes && echo " Compiling in support for SOCKS." test "$with_dnet" = yes && echo " Compiling in support for DNET." test "$with_modules" = "yes" && echo " Compiling in support for dynamic shared object modules." +test "$use_number_lib" = "gmp" && echo " Compiling in support for more number types using the GNU MP library." +test "$use_number_lib" = "mp" && echo " Compiling in support for more number types using the BSD MP library." if test "$use_union_type" = yes ; then echo " Using the union type for Lisp_Objects." echo " WARNING: ---------------------------------------------------------" echo " WARNING: This tends to trigger compiler bugs, especially when" echo " WARNING: combined with MULE and ERROR_CHECKING. Crashes have" - echo " WARNING: been seen with various versions of GCC, and recently" - echo " WARNING: with Visual C++ as well." + echo " WARNING: been seen with various versions of GCC (up to about 2.95)," + echo " WARNING: and recently with Visual C++ as well (mid-2003)." + echo " WARNING: More recent versions may be safer, or not." echo " WARNING: ---------------------------------------------------------" fi -test "$use_union_type" = yes && echo " WARNING: Use of the union type may cause crashes due to compiler bugs." test "$use_kkcc" = yes && echo " Using the new GC algorithms." test "$pdump" = yes && echo " Using the new portable dumper." test "$debug" = yes && echo " Compiling in support for extra debugging code." test "$usage_tracking" = yes && echo " Compiling in support for active usage tracking (Sun internal)." if test "$error_check_extents $error_check_types $error_check_text $error_check_gc $error_check_malloc $error_check_glyphs $error_check_byte_code $error_check_display $error_check_structures" \ != "no no no no no no no no no"; then + echo " Compiling in support for runtime error checking." echo " WARNING: ---------------------------------------------------------" - echo " WARNING: Compiling in support for runtime error checking." echo " WARNING: XEmacs will run noticeably more slowly as a result." echo " WARNING: Error checking is on by default for XEmacs beta releases." echo " WARNING: ---------------------------------------------------------" @@ -16813,7 +17416,7 @@ chmod 444 Makefile.new mv -f Makefile.new GNUmakefile - if test -e "xemacs.def.in"; then + if test -r "xemacs.def.in"; then cp -f xemacs.def.in junk.c echo creating $dir/xemacs.def $CPP -I. -I${top_srcdir}/src junk.c \ diff --text -u 'xemacs-21.5.17/configure.in' 'xemacs-21.5.18/configure.in' Index: ./configure.in --- ./configure.in Thu Mar 18 18:57:11 2004 +++ ./configure.in Thu Sep 30 00:38:31 2004 @@ -400,6 +400,7 @@ with_tty="" use_union_type="no" with_dnet="" +use_number_lib="no" dnl pdump defaults per opsys, do not default it here pdump="" dnl dragndrop is still experimental, except on Windows. When it is stable, @@ -703,6 +704,18 @@ eval "$opt=\"$val\"" ;; + dnl Enhanced Lisp numbers + "use_number_lib" ) + case "$val" in + gmp ) val=gmp ;; + mp ) val=mp ;; + no|non|none ) val=no ;; + * ) USAGE_ERROR(["The \`--$optname' option must have one of these values: + \`gmp', \`mp', or \`no'."]) ;; + esac + eval "$opt=\"$val\"" + ;; + dnl Has the user requested error-checking? "error_checking" ) dnl value can be all, none, and/or a list of categories to check. @@ -1750,7 +1763,7 @@ AC_DEFINE(_XOPEN_SOURCE,500) AC_DEFINE(_XOPEN_SOURCE_EXTENDED) ;; - freebsd4.9) + freebsd4*) AC_DEFINE(_POSIX_C_SOURCE,199506L) dnl #### Do we want these too? Apparently yes for _XOPEN_SOURCE=500. AC_DEFINE(_XOPEN_SOURCE,500) @@ -1997,7 +2010,8 @@ dnl #### This may need to be overhauled so that all of XEMACS_CC's flags dnl are handled separately, not just the xe_cflags_warning stuff. -dnl Calculate value of CFLAGS: +AC_MSG_CHECKING([for preferred CFLAGS]) + dnl Use either command line flag, environment var, or autodetection if test "$cflags_specified" = "no"; then dnl Following values of CFLAGS are known to work well. @@ -2020,11 +2034,14 @@ CFLAGS="-O" ;dnl The only POSIX-approved flag fi fi +AC_MSG_RESULT([${CFLAGS}]) dnl Calculate warning flags. We separate the flags for warnings from dnl the other flags because we want to force the warnings to be seen dnl by everyone who doesn't specifically override them. +AC_MSG_CHECKING([for preferred warning flags for XEMACS_CC]) + dnl If this stays nil, it will be set to cflags_warning before use. xe_cflags_warning="" @@ -2038,39 +2055,47 @@ cflags_warning="-qinfo" elif test "$GCC" = "yes"; then cflags_warning="-Wall -Wno-switch -Winline -Wmissing-prototypes" + dnl Yuck, bad compares have been worth at least 3 crashes! cflags_warning="$cflags_warning -Wsign-compare" cflags_warning="$cflags_warning -Wundef -Wstrict-prototypes" - if test "$__GCC3" = "yes"; then - cflags_warning="$cflags_warning -Wpacked" - fi - dnl Warning flags for the XEMACS_CC compiler + test "$__GCC3" = "yes" && cflags_warning="$cflags_warning -Wpacked" + dnl glibc is intentionally not `-Wpointer-arith'-clean. + dnl Ulrich Drepper has rejected patches to fix the glibc header files. + test "$have_glibc" != "yes" && \ + cflags_warning="$cflags_warning -Wpointer-arith" + dnl Warning flags that may differ for gcc and g++ (xemacs_compiler) dnl With g++, -Wshadow produces five zillion utterly random warnings -- dnl a local var named `buffer' conflicts with `struct buffer' for dnl example. Even with gcc, -Wshadow is questionable because of its dnl complaints about parameters with the same names as global functions. dnl There is no -Wmissing-declarations under g++. dnl But gcc warns about -Weffc++ in C compiles. - test "$xemacs_compiler" = "g++" && \ + dnl With g++, there is no effective way to use -Wunused-parameter without + dnl some very ugly code changes. + if test "$xemacs_compiler" = "g++"; then xe_cflags_warning="$cflags_warning -Weffc++" + elif test "$__GCC3" = "yes"; then + xe_cflags_warning="$cflags_warning -Wunused-parameter" + fi cflags_warning="$cflags_warning -Wshadow -Wmissing-declarations" - dnl glibc is intentionally not `-Wpointer-arith'-clean. - dnl Ulrich Drepper has rejected patches to fix the glibc header files. - test "$have_glibc" != "yes" && \ - cflags_warning="$cflags_warning -Wpointer-arith" - elif test "$__ICC" = "yes"; then - cflags_warning="-Wall -w1" dnl **** If more gcc/g++ flags are added, from here on must handle dnl **** cflags_warning and xe_cflags_warning in parallel + elif test "$__ICC" = "yes"; then + cflags_warning="-Wall -w1 -we147" dnl ### Add optimal cflags_warning support for other compilers HERE! fi fi +test -z "$xe_cflags_warning" && xe_cflags_warning="$cflags_warning" +AC_MSG_RESULT([${xe_cflags_warning}]) + +AC_MSG_CHECKING([for preferred warning flags for CC]) +AC_MSG_RESULT([${cflags_warning}]) dnl Now combine all C flags. Put the warning flags first so that dnl user-specified flags will override. dnl Do XE_CFLAGS before adding warning flags to CFLAGS. dnl Flags for XEMACS_CC: -test -z "xe_cflags_warning" && xe_cflags_warning=cflags_warning XE_CFLAGS="$xe_cflags_warning $CFLAGS" dnl Flags for CC: CFLAGS="$cflags_warning $CFLAGS" @@ -2202,7 +2227,9 @@ dnl Feed s&m crud to src/Makefile dnl Linux/powerpc needs the following magic for some reason -test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript" +dnl [Not needed with YellowDog 2.3 and causes link problems with YellowDog 3.0, +dnl the two most popular PowerPC distributions.] +dnl test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript" if test "$unexec" = "unexaix.o"; then dnl AIX needs various hacks to make static linking work. @@ -2253,7 +2280,7 @@ gcc_compiler_specs=`$XEMACS_CC -v 2>&1 | sed 's/.* \([[^ ]]\)/\1/' | head -1` else case "$XEMACS_CC" in dnl The Intel cc compiler - icc*) + ic*) compiler_version=`icc -V 2>&1 | head -1` ;; dnl non-gcc machine-specific magic - contributions welcome @@ -2633,10 +2660,12 @@ mach/mach.h dnl sys/param.h dnl sys/pstat.h dnl + sys/resource.h dnl sys/time.h dnl sys/timeb.h dnl sys/times.h dnl sys/un.h dnl + sys/vlimit.h dnl ulimit.h dnl unistd.h dnl ) @@ -2739,6 +2768,7 @@ AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(double) dnl check for long file names AC_SYS_LONG_FILE_NAMES @@ -2899,10 +2929,28 @@ window_system=gtk with_gtk=yes - with_x11=no + if test "$with_x11" != "no"; then + AC_MSG_WARN([Configuring GTK, forcing with_x11 to no]) + with_x11=no + fi + + for feature in scrollbars toolbars menubars dialogs widgets + do + eval "feature_value=\${with_${feature}}" + case "${feature_value}" in + yes|no|gtk|"" ) + ;; + * ) + feature_conflict_with_gtk=yes + AC_MSG_WARN([--with-${feature}=${feature_value} is incompatible with --with-gtk]) ;; + esac + done + if test "${feature_conflict_with_gtk}" = "yes"; then + XE_DIE(["One or more GUI toolkit features conflict with GTK"]) + fi test "${with_scrollbars}" != "no" && with_scrollbars=gtk - test "${with_toolbars}" != no && with_toolbars=gtk + test "${with_toolbars}" != "no" && with_toolbars=gtk test "${with_menubars}" != "no" && with_menubars=gtk test "${with_dialogs}" != "no" && with_dialogs=gtk test "${with_widgets}" != "no" && with_widgets=gtk @@ -3326,30 +3374,59 @@ if test "$with_modules" != "no"; then AC_CHECKING(for module support) - dnl Check for MS-Windows - if test "$with_msw" = "yes"; then - have_dl=yes; - else - case "$opsys" in - darwin ) have_dl=yes; AC_DEFINE(HAVE_DYLD) ;; - * ) - dnl Find headers and libraries + case "$opsys" in + mingw* | cygwin* ) have_dl=yes ;; + darwin ) have_dl=yes + AC_DEFINE(HAVE_DYLD) + ;; + * ) + dnl Check for the ELFish dlopen() AC_CHECK_HEADER(dlfcn.h, [ AC_MSG_CHECKING([for dlopen in -lc]) AC_TRY_LINK([#include ],dnl - [dlopen ("", 0);], [ have_dl=yes ], [ + [dlopen ("", 0);], [ have_dl=yes ], [ AC_MSG_CHECKING([for dlopen in -ldl]) - ac_save_LIBS="$LIBS" - LIBS="-ldl $LIBS" - AC_TRY_LINK([#include ],dnl - [dlopen ("", 0);], [ have_dl=yes ], - [LIBS="$ac_save_LIBS"]) - ac_save_LIBS=])]) - if test -n "$have_dl"; then + ac_save_LIBS="$LIBS" + LIBS="$LIBS -ldl" + AC_TRY_LINK([#include ],dnl + [dlopen ("", 0);], [ have_dl=yes ], [ + AC_MSG_CHECKING([for dlopen in -lsvld]) + LIBS="$ac_save_LIBS -lsvld" + AC_TRY_LINK([#include ],dnl + [dlopen ("", 0);], [ have_dl=yes ], [LIBS="$ac_save_LIBS"])])])]) + if test "$have_dl" = "yes"; then AC_DEFINE(HAVE_DLOPEN) + else + dnl Check for HP/UX shl_load + AC_CHECK_HEADER(dl.h, [ + AC_MSG_CHECKING([for shl_load in -lc]) + AC_TRY_LINK([#include ],dnl + [shl_load ("", 0, 0);], [have_dl=yes], [ + AC_MSG_CHECKING([for shl_load in -ldl]) + ac_save_LIBS="$LIBS" + LIBS="$LIBS -ldld" + AC_TRY_LINK([#include ],dnl + [shl_load ("", 0, 0);], [have_dl=yes], [LIBS="$ac_save_LIBS"])])]) + if test "$have_dl" = "yes"; then + AC_DEFINE(HAVE_SHL_LOAD) + else + dnl Check for libtool's libltdl + AC_CHECK_HEADER(ltdl.h, [ + AC_MSG_CHECKING([for lt_dlinit in -lltdl]) + ac_save_LIBS="$LIBS" + LIBS="$LIBS -lltdl" + AC_TRY_LINK([#include ],dnl + [lt_dlinit ();], [have_dl=yes], [LIBS="$ac_save_LIBS"])]) + if test "$have_dl" = "yes"; then + AC_DEFINE(HAVE_LTDL) + fi + dnl end !HP/UX + fi + dnl end !dlopen fi - esac dnl end !darwin - fi dnl end !MS-Windows + ac_save_LIBS= + dnl end !darwin + esac if test -n "$have_dl"; then dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared @@ -4149,7 +4226,7 @@ dnl Check for POSIX functions. dnl ---------------------------------------------------------------- -AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror strlwr strupr symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp) +AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize getrlimit gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror strlwr strupr symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp vlimit) dnl getaddrinfo() is borked under hpux11 if test "$ac_cv_func_getaddrinfo" != "no" ; then @@ -4703,12 +4780,19 @@ AC_DEFINE_UNQUOTED(CURSES_H_FILE, "${curses_h_file-curses.h}") AC_DEFINE_UNQUOTED(TERM_H_FILE, "${term_h_file-term.h}") - dnl Autodetect gpm - test -z "$with_gpm" && { AC_CHECK_HEADER(gpm.h, , with_gpm=no) } - test -z "$with_gpm" && { AC_CHECK_LIB(gpm, Gpm_Open, with_gpm=yes, with_gpm=no) } - if test "$with_gpm" = "yes"; then - AC_DEFINE(HAVE_GPM) - XE_PREPEND(-lgpm, LIBS) + dnl General Purpose Mouse (libgpm) support + if test "$with_gpm" != "no"; then + AC_CHECK_HEADER(gpm.h, [ + AC_CHECK_LIB(gpm, Gpm_Open, have_gpm=yes)]) + if test "$have_gpm" = "yes"; then + with_gpm=yes + AC_DEFINE(HAVE_GPM) + XE_PREPEND(-lgpm, LIBS) + elif test "$with_gpm" = "yes"; then + XE_DIE(["GPM requested, but gpm.h or libgpm seems to be missing."]) + else + with_gpm=no + fi fi else dnl "$with_tty" = "no" @@ -4853,6 +4937,44 @@ XE_PREPEND(-Bstatic -lut -Bdynamic, LIBS) fi +dnl Enhanced number support +if test "$use_number_lib" = "gmp"; then + AC_CHECK_HEADER(gmp.h, [ + AC_CHECK_LIB(gmp, __gmpz_init, have_mpz_init=yes)]) + if test "$have_mpz_init" = "yes"; then + AC_DEFINE(WITH_NUMBER_TYPES) + AC_DEFINE(WITH_GMP) + XE_PREPEND(-lgmp, LIBS) + else + XE_DIE("Required GMP numeric support cannot be provided.") + fi +elif test "$use_number_lib" = "mp"; then + for library in "" "-lcrypto"; do + AC_CHECK_HEADER(mp.h, [ + AC_CHECK_LIB(mp, mp_mfree, have_mp_mfree=yes; break, [ + AC_CHECK_LIB(mp, mfree, have_mfree=yes; break, , $library)], + $library)]) + done + if test "$have_mp_mfree" = "yes"; then + AC_DEFINE(MP_PREFIX) + XE_APPEND(-lmp, LIBS) + if test "$library" != ""; then + XE_APPEND($library, LIBS) + fi + AC_CHECK_FUNC(mp_move, [AC_DEFINE(HAVE_MP_MOVE)]) + elif test "$have_mfree" = "yes"; then + XE_APPEND(-lmp, LIBS) + if test "$library" != ""; then + XE_APPEND($library, LIBS) + fi + AC_CHECK_FUNC(move, [AC_DEFINE(HAVE_MP_MOVE)]) + else + XE_DIE("Required MP numeric support cannot be provided.") + fi + AC_DEFINE(WITH_NUMBER_TYPES) + AC_DEFINE(WITH_MP) +fi + dnl Unfortunately, just because we can link doesn't mean we can run. dnl One of the above link tests may have succeeded but caused resulting dnl executables to fail to run. Also any tests using AC_TRY_RUN will @@ -5456,24 +5578,26 @@ test "$with_socks" = yes && echo " Compiling in support for SOCKS." test "$with_dnet" = yes && echo " Compiling in support for DNET." test "$with_modules" = "yes" && echo " Compiling in support for dynamic shared object modules." +test "$use_number_lib" = "gmp" && echo " Compiling in support for more number types using the GNU MP library." +test "$use_number_lib" = "mp" && echo " Compiling in support for more number types using the BSD MP library." if test "$use_union_type" = yes ; then echo " Using the union type for Lisp_Objects." echo " WARNING: ---------------------------------------------------------" echo " WARNING: This tends to trigger compiler bugs, especially when" echo " WARNING: combined with MULE and ERROR_CHECKING. Crashes have" - echo " WARNING: been seen with various versions of GCC, and recently" - echo " WARNING: with Visual C++ as well." + echo " WARNING: been seen with various versions of GCC (up to about 2.95)," + echo " WARNING: and recently with Visual C++ as well (mid-2003)." + echo " WARNING: More recent versions may be safer, or not." echo " WARNING: ---------------------------------------------------------" fi -test "$use_union_type" = yes && echo " WARNING: Use of the union type may cause crashes due to compiler bugs." test "$use_kkcc" = yes && echo " Using the new GC algorithms." test "$pdump" = yes && echo " Using the new portable dumper." test "$debug" = yes && echo " Compiling in support for extra debugging code." test "$usage_tracking" = yes && echo " Compiling in support for active usage tracking (Sun internal)." if test "$error_check_extents $error_check_types $error_check_text $error_check_gc $error_check_malloc $error_check_glyphs $error_check_byte_code $error_check_display $error_check_structures" \ != "no no no no no no no no no"; then + echo " Compiling in support for runtime error checking." echo " WARNING: ---------------------------------------------------------" - echo " WARNING: Compiling in support for runtime error checking." echo " WARNING: XEmacs will run noticeably more slowly as a result." echo " WARNING: Error checking is on by default for XEmacs beta releases." echo " WARNING: ---------------------------------------------------------" @@ -5559,7 +5683,7 @@ CPP_MAKEFILE(,Makefile) CPP_MAKEFILE(-DUSE_GNU_MAKE,GNUmakefile) - if test -e "xemacs.def.in"; then + if test -r "xemacs.def.in"; then cp -f xemacs.def.in junk.c CPP_MAKEFILE(,xemacs.def) fi diff --text -u 'xemacs-21.5.17/configure.usage' 'xemacs-21.5.18/configure.usage' Index: ./configure.usage --- ./configure.usage Tue Aug 12 15:36:38 2003 +++ ./configure.usage Tue Apr 6 21:13:55 2004 @@ -289,6 +289,14 @@ --with-debug-malloc Use the debugging malloc package. +Emacs Lisp options: +------------------- + +--use-number-lib=TYPE Compile in support for bignums, ratios, or bigfloats + using library support. TYPE must be one of "gmp" + (for GNU MP), "mp" (for BSD MP), or "no" (disabled). + + Debugging options: ------------------ diff --text -u 'xemacs-21.5.17/etc/ChangeLog' 'xemacs-21.5.18/etc/ChangeLog' Index: ./etc/ChangeLog --- ./etc/ChangeLog Mon Mar 22 18:22:56 2004 +++ ./etc/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,35 @@ +2004-10-22 Stephen J. Turnbull + + * XEmacs 21.5.18 "chestnut" is released. + +2004-10-07 Jerry James + + * ETAGS.EBNF: + * etags.1: + Update to author version 17.6. + +2004-04-19 Stephen J. Turnbull + + * NEWS (Introduction): Rewording. + (Changes in XEmacs 21.5): New section. + +2004-08-10 Jerry James + + * ETAGS.EBNF: New file. Describes the syntax of an ETAGS file. + +2004-08-10 Jerry James + + * SERVICE: Update to latest version from www.gnu.org. + +2004-05-15 Malcolm Purvis + + * etc/gtkrc: New file. This is the GTK equivalent of the app-default + file. + +2004-03-30 Norbert Koch + + * PACKAGES: Introduce new packages escreen, xlib, and xwem. + 2004-03-22 Stephen J. Turnbull * XEmacs 21.5.17 "chayote" is released. diff --text -u /dev/null 'xemacs-21.5.18/etc/ETAGS.EBNF' Index: ./etc/ETAGS.EBNF --- ./etc/ETAGS.EBNF Thu Jan 1 09:00:00 1970 +++ ./etc/ETAGS.EBNF Thu Oct 7 23:51:11 2004 @@ -0,0 +1,93 @@ +-*- indented-text -*- + +This file contains two sections: + +1) An EBNF (Extended Backus Normal Form) description of the format of + the tags file created by etags.c and interpreted by etags.el; +2) A discussion of tag names and implicit tag names. + +====================== 1) EBNF tag file description ===================== + +Productions created from current behaviour to aid extensions +Francesco Potorti` 2002 +---------------- + +FF ::= #x0c /* tag section starter */ + +LF ::= #x0a /* line terminator */ + +DEL ::= #x7f /* pattern terminator */ + +SOH ::= #x01 /* name terminator */ + +regchar ::= [^#x0a#x0c#x7f] /* regular character */ + +regstring ::= { regchar } /* regular string */ + +unsint ::= [0-9] { [0-9] } /* non-negative integer */ + + + +tagfile ::= { tagsection } /* a tags file */ + +tagsection ::= FF LF ( includesec | regularsec ) LF + +includesec ::= filename ",include" [ LF fileprop ] + +regularsec ::= filename "," [ unsint ] [ LF fileprop ] { LF tag } + +filename ::= regchar regstring /* a file name */ + +fileprop ::= "(" regstring ")" /* an elisp alist */ + +tag ::= directtag | patterntag + +directtag ::= DEL realposition /* no pattern */ + +patterntag ::= pattern DEL [ tagname SOH ] position + +pattern ::= regstring /* a tag pattern */ + +tagname ::= regchar regstring /* a tag name */ + +position ::= realposition | "," /* charpos,linepos */ + +realposition ::= "," unsint | unsint "," | unsint "," unsint + +==================== end of EBNF tag file description ==================== + + + +======================= 2) discussion of tag names ======================= + +- WHAT ARE TAG NAMES +Tag lines in a tags file are usually made from the above defined pattern +and by an optional tag name. The pattern is a string that is searched +in the source file to find the tagged line. + +- WHY TAG NAMES ARE GOOD +When a user looks for a tag, Emacs first compares the tag with the tag +names contained in the tags file. If no match is found, Emacs compares +the tag with the patterns. The tag name is then the preferred way to +look for tags in the tags file, because when the tag name is present +Emacs can find a tag faster and more accurately. These tag names are +part of tag lines in the tags file, so we call them "explicit". + +- WHY IMPLICIT TAG NAMES ARE EVEN BETTER +When a tag line has no name, but a name can be deduced from the pattern, +we say that the tag line has an implicit tag name. Often tag names are +redundant; this happens when the name of a tag is an easily guessable +substring of the tag pattern. We define a set of rules to decide +whether it is possible to deduce the tag name from the pattern, and make +an unnamed tag in those cases. The name deduced from the pattern of an +unnamed tag is the implicit name of that tag. + When the user looks for a tag, and Emacs finds no explicit tag names +that match it, Emacs then looks for an tag whose implicit tag name +matches the request. etags.c uses implicit tag names when possible, in +order to reduce the size of the tags file. + An implicit tag name is deduced from the pattern by discarding the +last character if it is one of ` \f\t\n\r()=,;', then taking all the +rightmost consecutive characters in the pattern which are not one of +those. + +===================== end of discussion of tag names ===================== diff --text -u 'xemacs-21.5.17/etc/NEWS' 'xemacs-21.5.18/etc/NEWS' Index: ./etc/NEWS --- ./etc/NEWS Tue Dec 4 03:02:49 2001 +++ ./etc/NEWS Tue Sep 21 18:24:11 2004 @@ -3,30 +3,45 @@ * Introduction ============== -This file presents the changes in recent XEmacs versions. It -primarily documents user-visible (interface) changes, but also -includes internal changes of possible interest to the users. When -describing new features, we try to also document ways of reverting to -the old behavior, where applicable. If you dislike a recent change in -how XEmacs behaves, this file might contain a remedy. - -Use `C-c C-f' to move to the next equal level of outline, and -`C-c C-b' to move to previous equal level. `C-h m' will give more -info about the Outline mode. Many commands are also available through -the menubar. +This file presents the changes in recent XEmacs versions. Primarily +it documents user-visible (interface) changes, but also includes +internal changes of possible interest to users. When describing new +features, we also document ways of reverting to the old behavior, +where applicable. If you dislike a recent change in how XEmacs +behaves, you may find a remedy in this file. + +Use `C-c C-f' to move to the next heading at the same level, and +`C-c C-b' to move to the previous heading at this level. `C-h m' gives +help on Outline mode. The menubar provides more commands. Users who would like to know which capabilities have been introduced in each release should look at the appropriate section of this file. Starting with version 20.0, XEmacs includes ChangeLogs, which can be consulted for a more detailed list of changes. - N.B. The term "GNU Emacs" refers to any release of Emacs Version - 19 from the Free Software Foundation's GNU Project. (We do not - say just "Emacs" as Richard M. Stallman ["RMS"] prefers, because - it is clearly a more generic term.) The term "XEmacs" refers to - this program or sometimes to its predecessors "Era" and "Lucid - Emacs". The predecessor of all these program is called "Emacs - 18". When no particular version is implied, "Emacs" will be used. + N.B. The term "GNU Emacs" refers to any release of Emacs from the + Free Software Foundation's GNU Project starting with Version 19. + The term "XEmacs" refers to this program or sometimes to its + predecessors "Era" and "Lucid Emacs". The predecessor of all these + programs is called "Emacs 18". When no particular version is + implied, "Emacs" will be used. + + +* Changes in XEmacs 21.5 +======================== + +** Summary of user-visible changes: + + -- Bignums have been implemented. + -- Windows users have benefit of the full Win32 Unicode API. + -- (in process) Xft provides antialiased fonts on X11. + +** Bignum implementation. + +Integer computations no longer overflow, rational arithmetic "just +works", and very precise floating point calculation is available. +This also means that large buffers (over 2^30 = 1GB) can be +manipulated. * Changes in XEmacs 21.4 diff --text -u 'xemacs-21.5.17/etc/PACKAGES' 'xemacs-21.5.18/etc/PACKAGES' Index: ./etc/PACKAGES --- ./etc/PACKAGES Fri Nov 28 16:48:16 2003 +++ ./etc/PACKAGES Wed Mar 31 06:45:15 2004 @@ -104,6 +104,9 @@ *** erc ERC is an Emacs InternetRelayChat client. +*** escreen +Multiple editing sessions withing a single frame (like screen). + *** eshell Command shell implemented entirely in Emacs Lisp. @@ -354,6 +357,9 @@ supporting Lisp development. It is a single-file package so it may be tailored. +*** xlib +Emacs interface to X server. + *** xslide XSL editing support. @@ -361,6 +367,9 @@ A minor mode for (X)Emacs which allows running an XSLT processor on a buffer. +*** xwem +X Emacs Window Manager. + *** zenirc ZENIRC IRC Client. diff --text -u 'xemacs-21.5.17/etc/SERVICE' 'xemacs-21.5.18/etc/SERVICE' Index: ./etc/SERVICE --- ./etc/SERVICE Fri Apr 13 03:20:48 2001 +++ ./etc/SERVICE Wed Aug 11 02:59:11 2004 @@ -1,4 +1,4 @@ - -*- text -*- +-*- text -*- GNU Service Directory --------------------- @@ -19,10 +19,10 @@ that you agree informally to the following terms: 1. You will not restrict (except by copyleft) the use or distribution -of any software, documentation, or other information you supply anyone -in the course of modifying, extending, or supporting GNU software. -This includes any information specifically designed to ameliorate the -use of GNU software. +of any software, documentation, or other technical information you +supply anyone in the course of modifying, extending, or supporting GNU +software. This includes any information specifically designed to +ameliorate the use of GNU software. 2. You will not take advantage of contact made through the Service Directory to advertise an unrelated business (e.g., sales of @@ -35,699 +35,1148 @@ Please put nothing else inside "<>". Thanks! For a current copy of this directory, or to have yourself listed, ask: - gnu@prep.ai.mit.edu + service@gnu.org ** Please keep the entries in this file alphabetical ** -  -BeOpen -4880 Stevens Creek Blvd., Suite 205 -San Jose, CA 95129-1034 -+1 408 243 3300 -http://www.beopen.com - -BeOpen provides corporate-quality support, development and user -documentation for GNU Emacs, XEmacs and InfoDock. (InfoDock is a turnkey -information management and software development toolset built atop emacs, -written by one of our associates.) Emacs distributions for a variety of -platforms are also available, as is support for other emacs variants, such as -those often found on PCs. - -Our unique focus on emacs-related work allows us to attract expert talent in -this area to keep you on the leading edge of productivity, especially if you -do software development work. We do the porting, patching, coding, -integrating, debugging, documenting and testing so that your people spend -much more productive time on their mainline tasks. - -Standard support packages include help on all aspects of the packages -supported, including all tools shipped as a standard part of the original -package distribution. In general, we want to give you an unbelievably strong -level of support, so where we can, we will also answer questions concerning -any add-on Lisp code that is used at your site. Setup and customization -help, bug fixes, and announcements of new releases are, of course, included. - -Support rates start at $1,000 USD, for single user support for one year. -Discounts are available for group contracts. We also offer Golden Support -contracts for those who need the absolute best in mission-critical support; -contact us for details. Hourly development rates and fixed bid work are -available. - -Updated 20-March-1997. - -Joseph Arceneaux -PO Box 460633 http://www.samsara.com/~jla -San Francisco, CA 94146-0633 -+1 415 648 9988 -+1 415 285 9088 - -Recently led the project making Wells Fargo Bank the first to provide -secure customer account access over the Internet. - -Former FSF staffmember. Performed X11 implementation of Emacs version -19, designed and implemented WYSIWYG Emacs. Installed and -administered FSF network. Maintainer of GNU indent. Over 15 years -experience with Unix and other systems, from writing ROM monitors to -UI design and system administration. - -I provide installation, porting, debugging and customization or -development of GNU and other Unix software. I also design and -implement free software projects and consult on software engineering -and systems design. Handholding and teaching services are also -available as well as things like LAN and compute--infrastructure design. - -Time and material rates around $150 USD per hour, depending upon the -particular job. I am also very interested in fixed-bid jobs. For -selected non-profit organizations with worthy goals, I work for free. +Aaronsen Group, Ltd. +600 Grant St. +Suite 5345 +Pittsburgh, PA 15219 US ++1 412 391 6000 voice ++1 412 391 6006 fax +http://www.aaronsen.com/gnu + +The Aaronsen Group provides several levels of service in the free software +arena, from simple configuration and installation to large extensions and +new development. We specialize in unique applications, but have the +experience to handle all manner of prospects, from database-backed +web-sites to high-end multiprocessor clusters. + +Our service area covers the US, with key offices in Pittsburgh, PA; San +Jose, CA; and New York, NY. + +We are available for both hourly work (at $450 per hour, some qualified +discounts are available) and fixed-price projects. Work is done on the +client site, at our offices, or remote via Internet or telephone +connection. + +Updated: 2002-04-18 + +ACT Europe +8 rue de Milan +75009 Paris ++33 1 49 70 67 16 ++33 1 49 70 05 52 fax +www.act-europe.com + +ACT Europe, developer and maintainer of the Ada 95 GNAT Pro +Development Environment, specializes in project support and consulting +for users of GNAT Pro. + +GNAT Pro, based on GNU/GCC technology, is the most widely used Ada 95 +development environment, and the ideal solution in environments where +efficient and reliable code is critical. GNAT Pro is available on the +widest number of platforms, from Unix workstations and PCs to bare +boards and embedded systems. + +ACT Europe offers full Ada 95 solutions and is continuously enhancing +and developing programming tools, debuggers and integrated development +environments. + +We believe the Ada market and your project will best benefit from an +open, non-proprietary technology, we have made all our products Open +Source software by adopting the licensing policy of the Free Software +Foundation. This means that all components of the GNAT technology, +including the run-time, come with sources. + +Highest-quality, responsive support is a key ingredient in complex and +reliable Ada software products. GNAT Pro, the leading Ada 95 +development system, is the only Ada solution that comes with +outstanding support. Please visit www.act-europe.com for further +details of our products and services or contact us at + + +UPDATED: 2004-02-13 + +Ada Core Technologies +104 Fifth Avenue, 15th Fl. +New York, NY 10011 ++1 212 620 7300 ++1 212 807 0162 fax +www.gnat.com + +Ada Core Technologies, developer and maintainer of the Ada 95 GNAT Pro +Development Environment, specializes in project support and consulting +for users of GNAT Pro. + +GNAT Pro, based on GNU/GCC technology, is the most widely used Ada 95 +development environment, and the ideal solution in environments where +efficient and reliable code is critical. GNAT Pro is available on the +widest number of platforms, from Unix workstations and PCs to bare +boards and embedded systems. + +Ada Core Technologies offers full Ada 95 solutions and is continuously +enhancing and developing programming tools, debuggers and integrated +development environments. + +We believe the Ada market and your project will best benefit from an +open, non-proprietary technology, we have made all our products Open +Source software by adopting the licensing policy of the Free Software +Foundation. This means that all components of the GNAT technology, +including the run-time, come with sources. + +Highest-quality, responsive support is a key ingredient in complex and +reliable Ada software products. GNAT Pro, the leading Ada 95 +development system, is the only Ada solution that comes with +outstanding support. Please visit www.gnat.com for further details of +our products and services or contact us at + +UPDATED: 2004-02-13 + +Alcôve +------ + +Alcôve, Centre Paris Pleyel, 153 bld Anatole France +93200 Saint-Denis France + +Email: + +Web: http://www.alcove.com +Tél.: +33 1 49 22 68 00 +Fax: +33 1 49 22 68 01 + +Founded in 1996, Alcôve's main purpose is to promote and support the +use of GNU/Linux and OSS on the European market. +Expertise in OSS innovation is the foundation of all Alcôve's +activities. +We provide key accounts and leading businesses in the field of IT with : + + Consultancy + Engineering + Training + Support + Technical watching brief + OSS Certification - Validation - Guarantee + Drivers for the linux kernel + Company directory and unified messaging + Linux Firewall Security Package + +Keys: support services, consulting, open source software, GNU/Linux, +Apache, Perl, GNU, Samba, Zope, Imp, OpenLDAP + +Average daily rate, depending on the job : 1000 euros. + +Updated: 2002-06-12 + +Allegro Consultants, Inc. +1072 De Anza Blvd., Suite B101 +San Jose, CA 95129-3532 +USA ++1 408 252-2330 voice ++1 408 252-2334 fax +http://www.gccsupport.com + +Allegro Consultants, Inc, in association with DIS International, is +now offering annual support contracts covering the GNU Compiler +Collection and related tools, including the GCC C and C++ compilers +for MPE/iX. + +The free GCC C and C++ compilers have been available on MPE/iX for +several years now, and are used for mission-critical applications by +many organizations including Hewlett-Packard. Until now, assistance +was available only from Mark Klein of DIS on a limited, voluntary +basis. Mark is the person who originally ported GCC to the HP e3000, +and he continues to maintain the software and port new versions. + +Support contracts start at $1,995.00/year for an organization +(unlimited number of HP e3000 computer systems) with two designated +callers. Additional options are available for large organizations who +need to designate more than two authorized callers, or who want the +additional security of 24x7 coverage. + +Updated: 2002-04-18 + +Amazonia Computing + + +http://www.efn.com/~rick + +5050 Donald St +Eugene, OR 97405 +541-485-7264 + + +I provide development and technical support for free software +and open source systems including embedded programming, GNU/Linux, the +GNU development suite... + +I have over 10 years experience building and maintaining systems ranging +from medical patient monitoring systems to Linux device drivers for +custom PCI plug in cards. + +Rates range from $85.00/hr to $90/hr USD. Will work for a lower rate +if in involves working in either Brazil, Vietnam, Indonesia, or Cuba. +I am also willing to work on fixed price contracts. -Updated: 17Oct95 +Updated: 2002-04-22  -Gerd Aschemann -Osannstr. 49 +Dipl.-Inform. Gerd Aschemann +Martinstr. 81f D-64285 Darmstadt -Tel.: +49 6151 16 2259 -http://www.informatik.th-darmstadt.de/~ascheman/ +Tel.: +49 173 3264070 +http://www.aschemann.net/ -- System Administrator (UNIX) at CS Department, TU Darmstadt, Germany -- 15 years expirience with CS, Systemadministration on different platforms -- 8 years with UNIX/Networking/FreeWare/GNU/X11 -- 6 years organizer of Operating Systems and Distributed Systems courses +- Consultant + + Unix Network and System Administration + + Distributed Systems and Middleware Infrastructures +- former System Administrator (UNIX and NT) at CS Department, TU Darmstadt, Germany +- 22 years working in the CS field, System administration on different platforms +- 15 years with UNIX/Networking/FreeWare/GNU/X11 +- 12 years courses on Operating Systems and Distributed Systems - Lectures on System and Network Administration -- Platforms: Solaris, SunOS, Ultrix, OSF1, HP-UX, Linux, FreeBSD, AIX -- Experience with parallel environments (Connection Machine, Meiko, Parsytec) -- Consultant for other UNIX users at TU Darmstadt +- Platforms: Solaris, GNU/Linux, SunOS, Ultrix, HP-UX, Digital Unix, AIX, SCO, FreeBSDs +- Distributed Platforms and Information Systems (CORBA, WWW, Java, SOAP) -Rates are at 100,-- DM (~60 US$) per hour minimum, depending on the job. +Rates are at 100,-- EUR (~90 US$) per hour minimum, depending on the job. I am willing to travel for sufficiently large jobs. -Updated: 17Oct95 +Updated: 2002-04-23  -Giuseppe Attardi -Dipartimento di Informatica -Corso Italia 40 -I-56125 Pisa, Italy -+39 50 887-244 +Baker Research, Ltd. +P. O. Box 4057, Leesburg, VA 20177 +Phone: (703) 999-6719 (Voice) +Web: http://www.baker-research.com +email: +Rate: $75.00/hr to $150.00/hr, or fixed-price projects. + +Services: + --Full-lifecycle software development + --Database design and migration + --Programming (C/C++, tcl/tk, bash, perl) + --Custom backup and archival systems + --GNU/Linux system installation, configuration, and management + --Customization of systems for user needs + --Software product evaluation and recommendation + --Cluster systems support + -Installation, configuration, and management + -MPI and Myrinet support + --Data acquisition, management, visualization, and archival + +Updated: 2004-05-13 + +Don Barry, Ph.D. +Ithaca, NY + +Astrophysicist with extensive and varied hacker background. Substantial +expertise in mathematical modeling, instrument interface, low-level and +high-level hardware control, statistical analysis, automated/mathematical +typesetting. Also fluent in opto/electro/mechanical design. I try to find +solutions using free software when possible and specialize in GNU/Linux +platforms. Degrees also in chemistry and mathematics. + +Speak: C, APL, Fortran, J, Perl, Emacs Lisp, IDL, variety of machine +languages from CDC CYBER (!) to x86 families, TeX/LaTeX, sendmail, and +quite a few others. Experience on platforms from PDP to present. + +Rates: $75--$150 per hour + travel (if required) depending on the needs of +the project, the level of support and availability required, and its +interest to me. -GNU: help on obtaininig GNU, for italian sites. +Services: consulting, design, porting, lecturing, support, project definition, +system implementation. -Updated: 5Apr94 +Updated: 2002-04-18  James Craig Burley 97 Arrowhead Circle -Ashland, MA 01721-1987 -508 881-6087, -4745 -(Please call only between 0900-1700 Eastern time, and only if you -are prepared to hire me -- ask me to help you for free only -via email, to which I might or might not respond.) -Email: --preferred-- - - +Ashland, MA 01721 +Email: +Web: http://world.std.com/~burley/ + +Expertise (mainly Development and Maintenance): + Compilers for Imperative Languages (author of GNU Fortran, aka g77) + Operating System Kernels + Tools/Utilities + Microcode (mainly VLIW) and Assembler + Software-Development-System Architecture (including APIs, IDEs) + Debugging + Documentation Authoring and Project Management -Expertise: - Compiler Internals (author of GNU Fortran, for example) - Operating Systems Internals - Tools/Utilities Development and Maintenance - Microcode Development and Maintenance (primarily VLIW machines) - System Design (computers, operating systems, toolsets, &c) - Debugging (often asked to help debug Other People's Code) - Documentation (authored many books and ran a few doc projects) - Extensive experience with a variety of operating systems, hardware, - languages, and so on - -Rate: $70/hour -- willing to consider flat-fee arrangements - -Updated: 14Aug95 - -Michael I. Bushnell -545 Technology Square, NE43-426 -Cambridge, MA 02139 -(617) 253-8568 - -All GNU software: Installation, customization, answering simple or - complex questions, bug fixing, extension. - -Experience: I have done Unix and GNU programming for several years, - I am the primary author of the Hurd (which provides most - kernel related facilities for the GNU OS). +Experience: + Programming Languages such as C, Fortran + Operating Systems such as Unix, GNU/Linux, Solaris, HP-UX + Assembler/Microcode Languages -- RISC (such as SPARC), CISC, VLIW + Scripting Languages + API Design, Documentation, and Use + +Rate: $200/hour + +Updated: 2002-04-18 + + C2V Michel Delval + 82 bd Haussmann Jean-Alain Le Borgne + 75008 Paris + France + Tel (33 1) 40.08.07.07 + Fax (33 1) 43.87.35.99 + http://www.c2v.com/freesoft.htm + e-mail: + + Services: we offer source or source+binary distribution, + installation, training, maintenance, technical support, + consulting, specific development and followup on the GNU software + development environment: Emacs, gcc/g++, binutils, gas, gdb. + + Porting on new platforms, and professionally developing software + with the GNU tools in the Unix/X11 environment since they were + first available. + + Experience: GNU C Compilation toolchain for the SGS-Thomson D950 + and ST20 DSP chips. + + GNU C compilation toolchain (cross-compiler, compiler, linker, + assembler, debugger) for SparcV7 ERC32 based space systems + (Sextant Avionique / Alcatel Espace). + + Feasability study, analysis and prototyping of a complete + compilation toolchain based on the GNU programming tools for the + CSEM RISC microprocessor family. + + Rates: from 800 Euros/day to 120 000 Euros/year, 40% discount for + educational institutions, add taxes and expenses. Ask for list. + +Updated: 2002-04-25 + +Cendio Systems AB +Teknikringen 3 +SE-583 30 Linkoping +SWEDEN ++46 13 21 46 00 voice ++46 13 21 47 00 fax +http://www.cendio.com/ -I am easily available in the Cambridge/Boston area; work via email. -I am willing to travel for sufficiently large jobs. +Cendio Systems develops, implements and integrates solutions based on +Open Source Software. We also develop and market the Fuego +Firewall(TM), an award winning and easy-to-use firewall, based on +GNU/Linux. + +We offer professional services, including support, maintenance, +integration and development in the following areas: + +* Embedded Linux +* Client/Server Solutions GNU/Linux/BSD +* Professional Training GNU/Linux, certifications from SAIR Linux/GNU +* Open Source Strategy +* Development/Adaptation of free software + +Cendio Systems have deep roots in Linkoping University, and was +founded 1992 as Signum Support. Our headquarters resides in Mjardevi +Science Park in Linkoping and we have an office in Stockholm. We are +currently about fifty employees at both locations. + +Cendio Systems won the Lotus 'Tux Award' at LotusSphere 2000 for "the +partner who best exemplifies a unique dedication to Lotus and Linux +technologies and has successfully executed their vision in the +marketplace." + +Cendio Systems have the following certifications and memberships: + +Association of Computing Machinery, Professional Membership +COMPAQ System Specialist (Intel and Alpha Systems) +Embedded Linux Consortium, Founding Member +IBM Value Added Reseller (Netfinity) +IBM Solution Provider (RS/6000) +SAIR GNU/Linux, Accredited Center for education +SGI Systems Integrator + +Rates: Please request our price list. + +Updated: 2001-05-09 + +CodeSourcery, LLC +9978 Granite Point Ct +Granite Bay, CA 95746 +(916) 791-8304 +http://www.codesourcery.com + +CodeSourcery specializes in customization of, enhancements to, and +support for all GNU software. We have particular experience in the +field of programming tools, and have been responsible for many +features in the GNU C and C++ compilers including the implementation +of member templates and type-based alias analysis. Mark Mitchell, one +of our co-founders, is a co-maintainer of the GNU Compiler Collection. + +We also have experience with GNU tools ranging from emacs to binutils +to gdb to autoconf, and are willing to work on any and all free +software projects. -Rates: $100/hr, negotiable, less for non-profit organizaions. +Please see our web page at www.codesourcery.com for more information +about our products, services, and prices. -Updated: 5Apr94 +Updated: 2002-04-19  -C2V Renaud Dumeur -82 bd Haussmann Michel Delval -75009 Paris Jean-Alain Le Borgne -France -Tel (1) 40.08.07.07 -Fax (1) 43.87.35.99 +Stuart Cracraft +25682 Cresta Loma +Laguna Niguel, CA, 92607, USA +Phone: 949-347-8106 +Rate: negotiable -We offer source or source+binary distribution, installation, training, -maintenance, technical support, consulting, specific development and -followup on the GNU software development environment: Emacs, gcc/g++, -binutils, gas, gdb. - -Experience: adapted gcc, gas and binutils to work as cross-development -tools for the Thomson st18950 DSP chip: GCC parser and typing system -have been augmented to allow the manipulation of variables located in -separated memory spaces. Porting on new platforms, and professionally -developing software with the GNU tools in the Unix/X11 environment -since they were first available. - -Rates: from 2000 FF/day to 150 000 FF/year, 40% discount for -educational institutions, add taxes and expenses. Ask for list. - -Entered: 5May94 - -Contributed Software -Graefestr. 76 -10967 Berlin, Germany -phone: (+49 30) 694 69 07 -FAX: (+49 30) 694 68 09 -modems: (+49 30) 694 60 55 (5xZyXEL ) -modems: (+49 30) 693 40 51 (8xUSR DS) -email: -internet: uropax.contrib.de [192.109.39.2], login as 'guest'. - -We distribute, install, port, teach and support free software -in general, i.e. X11, GNU, khoros etc. Rates are ECU 80,-- plus -tax per hour. We offer maintenance and support contracts for full -customer satisfaction. -Highlights are transparent development environments for multi-platform -sites and configuration management. Traveling is no problem. +Consultation topics: +Entire GNU suite - porting, compilation, installation, +user-training, administrator-training -Free Archive login for downloading on above modem numbers. +Method: via any combination of telephone, dialup, Internet, in-person, email. -Updated: 5Apr94 - -Stuart Cracraft -25682 Cresta Loma -Laguna Niguel, Ca. -92677 -GNUline: 714-347-8106 -Rate: $75/hour -Consultation topics: - Entire GNU suite - porting, compilation, installation, - user-training, administrator-training -Method: telephone line support, call-in via modem to your site, -or direct visit. - -Experience: supporting GNU since the mid-1980's, coordinator -of GNU Chess (original author), GNU Shogi, GNU Go. Ported GNU Emacs -to Solaris (System V Release 4). Expertise in C, Emacs Lisp, and Perl. -Customized programming also available. - -Entered: 5Apr94 - -Cygnus Support -1937 Landings Drive ...uunet!cygint!info -Mountain View, CA 94043 USA -+1 415 903 1400 voice -+1 415 903 0122 fax - -Cygnus Support -48 Grove Street -Somerville, MA 02144 -+1 617 629 3000 voice -+1 617 629 3010 fax - -Cygnus Support continues to provide supported, maintained versions of -the GNU toolset including GCC, G++, the GNU debugger with graphical -user interface, GNU linker, GNU macro-assembler and Emacs 19. In -keeping with the rapidly advancing needs of software developers, -Cygnus maintains a 90 day release cycle of the GNU toolset. Each -release is regression tested and includes substantial improvements and -additions to the existing matrix of over 65 supported platform -configurations. - -Updated: 2Feb95 - -Edgar Der-Danieliantz -P.O. Box 10 -Yerevan 375009 AM -ARMENIA - -Support for GCC (C & Objective C), X Window System, -World Wide Web, x86-based embedded systems, logic programming, etc. - -Via Internet (mail, talk, irc, etc.) - -Experience: - OS's: 4.3 & 4.4 BSD, SVR3.2 & 4.2, FreeBSD, Linux, - NetBSD, SCO, Solaris, SunOS, Ultrix, NEXTSTEP, UnixWare. - Languages: C, C++, Objective C, Pascal, Tcl/Tk, Perl, - Bourne Shell, PostScript, HTML, Prolog. - Platforms: Intel, SPARC, Mac, VAX, NeXT. - -Rates: Depending on type of work, appx $20/hour. Contact for more information. - Negotiable for individuals and non-profit organizations. - FREE for individuals who can't pay. Your 'Thanks!' just enough! :-) - Payment by international wire transfer. - -Entered: 6Mar96 - -Free Software Association of Germany -Michaela Merz -Heimatring 19 -6000 Frankfurt/Main 70 -phone: (+49 69) 6312083) -ert : (+49-172-6987246) -email: (info@elara.fsag.de) - -Supporting all kinds of freeware (i.e. GNU), freeware development, consulting, -training, installation. Special LINUX support group. - -RATES: - -Companies and for profit -organizations : 100 US$ / hour -Private and not-for-profit -organizations : 40 US$ / hour -ert (24h Emergency -response team) : 300 US$ / hour - -Entered: 14Apr94 - -Noah Friedman -Building 600, Suite 214 2002-A Guadalupe St. #214 -One Kendall Square Austin, TX 78705 -Cambridge, MA 02139 (Local, faster to reach me) -(Permanent) - - -Author of several Emacs Lisp packages and parts of Emacs 19, as well as -numerous utilities written in shell script and perl. Co-maintained GNU -Texinfo and Autoconf for a couple of years. System administrator for a -network of heterogenous machines. FSF employee Feb 1991--Sep 1994. - -I can perform installation, porting, and enhancement of all GNU software -and any other free software; system administration for unix-type systems -and ethernet networks; and I am willing to teach shell programming and -Emacs Lisp. - -Fees negotiable, averaging $60-$75/hour. I can work in the Austin, TX area -or anywhere accessible on the Internet. For larger jobs I may be willing -to travel. +Experience: supporting GNU since project inception, original port of +GNU Emacs to Sun Solaris, original author of GNU Emacs online tutorial. +Expertise in C, Emacs Lisp, Perl, Expect, Oracle, Informix, SunOS, Solaris, +NIS, NFS, system-monitoring via paging. Unix System and Database +administration or development. -Updated: 16Aug95 +Updated: 2002-04-20  -Ronald F. Guilmette -Infinite Monkeys & Co. -1751 East Roseville Pkwy. #1828 -Roseville, CA 95661 -Tel: +1 916 786 7945 -FAX: +1 916 786 5311 +Bruce Dawson - +CodeMeta, Inc. +London, NH USA +800-354-2209 -Services: Development & porting of GNU software development tools. +Specializing in GNU tools such as CVS, gnats, bash, gawk, fileutils... -GNU Contributions: - Invented, designed, and implemented the protoize and - unprotoize tools supplied with GCC2. +Services: - Designed and developed all code to support the generation - of Dwarf symbolic debugging information for System V Release - 4 in GCC2. + o 800 phone support. - Performed original port of GNU compilers to SVr4 system. + o Modification and development. - Finished port of GNU compilers to Intel i860 RISC - processor. + o Training. -Experience: 13+ years UNIX systems experience, all working on compilers - and related tools. +Rate: Fixed rate deliverables or $110/hour for hourly work. - 7+ years working professionally on GCC, G++, and GDB under - contract to various firms including the Microelectronics - and Computer Technology Corporation (MCC), Data General (DG), - Network Computing Devices (NCD), and Intel Corp. +http://www.codemeta.com -Other qualifications: - Developer of the RoadTest (tm) C and C++ commercial - compiler test suites. +Updated: 2002-04-23 + +DSS Distributed Systems Software, Inc. +3253 Georgia St. +Richmond, British Columbia V7E 2R4 http://www.dss.bc.ca +CANADA (604) 270-9559 + +GNU-related services: + We specialize in support for GCC (mainly C and C++), including porting, + retargeting, and customizing. + Also, GNU and other free software that falls within our areas of expertise. - Former vice-chairman of UNIX International Programming - Languages Special Interest Group (UI/PLSIG). +Expertise: + DSS provides software design, implementation, and consulting services for: + o Client/Server architectures + Including web-based systems, Apache web server customization, CGI, + server-side processing, JavaScript, automatic web page generation + o E-Security, including PKI and SSL + o Directory systems, including X.500 and LDAP + o High-performance and special-purpose distributed systems and databases + o Computer networking and communication protocols + Internet protocols such as TCP/IP and UDP, development of custom protocols + o Creating and customizing "small", embedded, and special-purpose programming + languages - Bachelor's and a Master's degrees, both in Computer Science. +Rates: + Consulting rates are $65-$200 USD per hour, plus + applicable taxes. Fixed-cost projects are also possible. -Rates: Variable depending upon contract duration. Call for quote. - -Updated: 23Sep95 - -Hundred Acre Consulting -1155 W Fourth St Ste 225 -PO Box 6209 -Reno NV 89513-6209 -(702)-348-7299 -Hundred Acre is a consulting group providing support and development -services to organizations of all sizes. We support GNU C++ and C in -particular, but also provide support for all other GNU software and -certain non-GNU public domain software as well. We work on a "service -contract" basis for support -- for a yearly fee, we provide multiple -levels of email and toll free telephone support, and free updates and -bug fixes. The highersupport levels have on-site support. Development -is charged on either an hourly or fixed bid basis. - -Consulting rates: $70 to $90 per hour, or fixed bid. -Support contracts: Several levels, from $495 to $90000 per year. - -Updated: 27Dec94 - -Interactive Information Limited - -Interactive Information Limited is an Edinburgh-based company that -specialises in WWW services and support for using the Internet for -marketing. - -Our staff have many years experience in using, and developing lisp packages -within, Emacs, and in using other GNU/Unix tools, particularly under public -domain UNIXes. - -We can provide services throughout the UK, at any level from general -consultancy through fetching, installing and customising software to -bespoke programming. Fees would be in the range #300 - #600 per day, -depending primarily on the size of the job. - -You can contact us - by email: - by phone: 0370 30 40 52 (UK) - (+44) 370 30 40 52 (International) - by post: 3, Lauriston Gardens, - Edinburgh EH3 9HH - Scotland - -Entered: 13Nov95 - -Scott D. Kalter +Box 325 http://fig.org/gord/ +Lumsden, SK S0G 3C0 Voice: (306) 731-3011 +CANADA -Rates: $50/hr - May answer brief and interesting questions for free. - Prefer e-mail communication to telephone. +I will gladly help novice and intermediate computer users to install, +understand, and use free software, whether or not I have prior +experience with that software. I know my limitations well, and will +freely give other contacts if I cannot solve your problem myself. -Qualifications: BS Math/CS 1985: Carnegie Mellon University - MS CS 1988: UCLA +I have over 5 years of experience with several of the major free OSes: +GNU/Linux (Debian, Red Hat), NetBSD, FreeBSD, and GNU/Hurd. Some of +my specialties are networking, Emacs, Automake, Autoconf, C, Perl, and +shell script programming. - Very familiar with all levels of elisp programming. Taught - Emacs use and customization in universities and industry. Extensive - troubleshooting and user support experience. Co-developed an - object-oriented extension to Elisp that can be used for - projects. Extensive Elisp level modification for rapid - prototyping of designs used in groupware research. This - includes the development of an infrastructure to support - multiple, communicating Emacs processes. +My rates are negotiable depending on the task: usually $40-$60 +(Canadian) per hour. Flat rates preferred. -Updated: 6Apr94 +Updated: 2002-04-18  -KAMAN SCIENCES CORPORATION -258 GENESEE STREET -UTICA NY 13502 -(315) 734-3600 +John W. Eaton +, -CONTACTS: Alan Piszcz (peesh) - : Dennis Fitzgerald +Experience: Original author and current maintainer of GNU Octave + (http://www.octave.org). -Kaman Sciences has performed a GNU port for a custom RISC processor. -We have experience in the definition and description of the machine -register transfer language to the GNU tool-set. This includes rewriting -and modification of the necessary description and source files of gcc, gas, -and gld and other binutils. Kaman also has services for installation and -setup of GNU tools, (GAWK, GCC, EMACS, etc.) on Sun workstations. + Derivatives of the Unix man utility that I wrote in 1990 + are currently distributed with several GNU/Linux systems. -Work is on a "service contract" basis and development is charged either -hourly or as a fixed price contract. + Improved GNU Make's support for VPATH and object + libraries on VMS systems. -Consulting rates: $70 to $200 per hour. + Various other enhancements and bug fixes for other free + software tools. -Entered: 13Jan95 - -Scott J. Kramer -P.O. Box 620207 -Woodside, CA 94062 -+1 415-941-0755 + I have more than 19 years experience programming various + languages and systems, more than 14 years as a user and + system mangler of Unix systems, including Ultrix, SunOS, + AIX, HP/UX, BSD, IRIX, Digital Unix, and GNU/Linux. + Long-time user of GNU tools on all these platforms. -GNU Software: Tutoring, installations/upgrades, Emacs Lisp customizations, - general troubleshooting/support. Prefer that work I do - becomes part integrated into official Free Software Foundation - distributions. +Programming: Octave, Matlab, C++, C, Fortran, Emacs Lisp, TeX/LaTeX, + AWK, M4, Autoconf, Make, Lex & YACC, Unix shell + programming, etc. -Systems Administration: Sun (SunOS & Solaris) and SGI (IRIX) - UNIX hardware/software platforms. +Services: Anything related to programming and extending Octave. + Porting, installation, and customization of GNU/Linux and + GNU tools. Unix system administration. -Rate: Task- and time-dependent; non-monetary offers accepted. +Rates: $100/hour + travel and expenses (if required). Will + consider travel for short periods and/or sufficiently + interesting jobs, but prefer to work via the net or email. + Lower rates for non-profits. -Updated: 12Apr94 +Updated: 2002-04-19  -Fen Labalme +6114 La Salle Ave. #739 +Oakland, CA 94611-2802 + +Author of several Emacs Lisp packages and parts of Emacs, as well as +numerous network and unix system utilities. Co-maintained GNU Texinfo and +Autoconf for a couple of years. Experienced unix systems engineer. +FSF employee Feb 1991--Sep 1994. -Rates: $80 hour (negotiable); quick email or phone questions free. - Lower rates -- free of barter -- for schools and non-profits. +I can design and implement relational database services; perform +installation, porting, and enhancement of all GNU software and any other +free software, especially for linux- and unix-derived systems; design +high-capacity hardware-redundant servers for production environments; +provide consulting on the use of version control management. -Consulting, installation, customization and training for GNU Emacs, -and selected other GNU & network software (but not G++). I have been -hacking Emacs since '76 when it was TECO and ^R macros (don't ask). +Fees negotiable, averaging $100-$150/hour. I can work in the California +bay area or anywhere accessible on the Internet. For larger jobs I may be +willing to travel. -Updated: 6Apr94 +Updated: 2002-04-19  -Greg Lehey -LEMIS -Schellnhausen 2 -36325 Feldatal -Germany - -Phone: +49-6637-919123 -Fax: +49-6637-919122 -Mail +Ronald F. Guilmette +RG Consulting +1751 East Roseville Pkwy. #1828 +Roseville, CA 95661 +Tel: +1 916 786 7945 +FAX: +1 916 786 5311 +http://www.monkeys.com/ -Services: Supply, porting, installation, consultation on all GNU -products. +Services: Development & porting of GNU software development tools. -Experience: 20 years OS and compiler experience, portations of most -GNU products. Author of ported software CD-ROM for Unix 4.2. +GNU Contributions: + Invented, designed, and implemented the protoize and + unprotoize tools supplied with GCC2. -Rates: Choice of DM 150 per hour or hotline rates 3 DM per minute + 10 -DM per phone call. Quick questions may be free. Limited free support -available for purchasers of LEMIS CD-ROMs. + Designed and developed all code to support the generation + of Dwarf symbolic debugging information for System V Release + 4 in GCC2. -Updated: 21Feb95 - -Marty Leisner -332 Shaftsbury Road -Rochester, New York 14610 -Home:(716) 654-7931 + Performed original port of GNU compilers to SVr4 system. -Experience: 12 years C/Unix, 7 years DOS. - Extensive experience with GNU binary tools, cross-compilers, - embedded/hosted systems, realtime. -Degree : BS CS, Cornell University -Rates: $75/hr + Finished port of GNU compilers to Intel i860 RISC + processor. +Experience: 15+ years UNIX systems experience; 15+ years working on + compilers and related tools. + 10+ years working professionally on GCC, G++, and GDB under + contract to various firms including the Microelectronics + and Computer Technology Corporation (MCC), Data General (DG), + Network Computing Devices (NCD), and Intel Corp. -marty - +Other qualifications: + Developer of commercial C and C++ compiler test suites. -Updated: 15Apr94 - -Richard Levitte (in TeX: Richard Levitte -Södra Långgatan 39, II S\"odra L{\aa}nggatan 39, II -S-171 49 Solna S-171 49 Solna -Sweden Sweden) -Tel.nr.: +46 (8) 18 30 99 (there is an answering machine) -e-mail: (preferred) - + Former vice-chairman of UNIX International Programming + Languages Special Interest Group (UI/PLSIG). -What I do: - Primarly I work on GNU software for VMS, both VAX and AXP. I - also work on GNU stuff for Unix on occasion. I'm familiar with - SunOS (version 4.x.x), BSD (version 4.2 and up), - Ultrix (version 4.2 and up). - I've been porting GNU Emacs to VMS since spring 1991. This - includes versions 18.57 to 18.59 and version 19.22. - I maintain GNU vmslib. + Bachelor's and a Master's degrees, both in Computer Science. -Programs supported: - GNU vmslib: extending, installation, upgrading aid, - simple and complex questions, you name it. - GNU Emacs: porting, extending, installation, upgrading aid, - customization, simple or complex questions, - training, you name it. - GNU autoconf: porting, extending, installation, upgrading aid. - GNU zip, diffutils, m4, patch, texinfo: - porting, installation, upgrading aid. - GNU C/C++: installation, upgrading aid. I might start to - hack at it some day. +Rates: Variable depending upon contract duration. Call for quote. -The list of programs I currently support represents both my interests and -current priorities. Your interest and funding can influence my priorities. +Updated: 2002-05-04 + +IDEALX +15-17 avenue de ségur +75007 Paris +France -Experience: - Fluent in C, C++, Emacs Lisp, Pascal as well as assembler - on VAX, Motorola 680x0, Intel 8086 and 80x86. Modified key - elements in Emacs (e.g., memory and process management) to work - transparently on VMS. I have very good knowledge in the VMS - operating system, as well as MS-DOS and IBM PC compatibles. - I have worked for four and a half years as a VMS system manager. - I've also provided consulting services on IBM PC compatibles, - as well as held classes for IBM PC users. - A reference list is available on request. +Tel - +33144420000 Fax - +33144420001 +http://www.IDEALX.com, http://www.IDEALX.org -Your Rate: - $50-$80/hour (400-700 SEK in sweden), plus expenses. My rates - are negotiable, depending on how interesting the project is to me. +IDEALX is involved in the development of Open Source solutions,and +ensures their deployment and maintenance. +IDEALX also contributes to the community, by producing its own +Open Source components such as : IDX-PKI (a 100% Open Source +Public Key Infrastructure) see :http://idx-pki.idealx.com -Entered: 18Aug94 - -Roland McGrath -545 Tech Sq, Rm 426 -Cambridge, MA 02139 -Work: (617) 253-8568 +Development +Technical support +Technology watch +Consulting +Engineering +Training + +Rates - Variable -Co-author of GNU Make (with Richard Stallman); maintainer of GNU Make. -Author and maintainer of the GNU C Library and co-author of the GNU Hurd. -Author of several GNU Emacs Lisp packages and parts of GNU Emacs 19. -FSF employee summer 1989, fall 1990 to the present. +Updated: 2002-07-22 + +Ehud Karni +Israel -Installation, maintenance, porting, enhancement of all GNU software. I can -install GNU software and maintain its installation on call via the Internet. +Support of Emacs & Emacs lisp, GNU/Linux, Cygwin. -Fees negotiable; $75-$100/hour, higher for very short term projects. I can -work anywhere in the Boston or SF Bay Area, or anywhere on the Internet. I -am working full-time for the FSF on the GNU Hurd, so I am likely to take on -only jobs that either can be done entirely via the Internet and are -short-term, or that are very interesting. +Fee: $75/hour. -Updated: 21Jan95 +Updated: 2002-04-20  -Erik Naggum -P.O. Box 1570 Vika http://www.naggum.no -0118 OSLO phone: +47 2295 0313 -NORWAY NIC handle: EN9 +Bradley M. Kuhn + +http://www.ebb.org/bkuhn -Have extensive experience with Unix and C (since 1983), Internet protocols -(1987), International Standards for character sets (1988), SGML (1990), -ANSI Common Lisp (1994); Emacs user and programmer from 1984 to 1987 -(TOPS-20) and 1991 to present (Unix). Have worked on GNU Emacs development -since early 1994, both in Emacs Lisp and C. Have been tracking development -code for Emacs since mid-1995, and know new versions intimately. +I am available for part-time system administration, software development +and training. I have extensive experience with system administration of +GNU/Linux systems and Free Software development. I have also taught +courses in C++ and Perl. As an employee of the FSF, I have a unique +perspective on the free software community. -Services offered: installation, support, customization, and development of -new packages, plus courses and seminars from basic usage through Emacs Lisp -programming to writing extensions in C. General aid with all GNU software. +Please visit my homepage for more information on my background and skills. +My resume is also available there. -Rates depend on duration of work: From $6/minute for <= 1 hour, to $500/day -for >= 1 month. Service agreements are encouraged. Cover Scandinavia for -on-site work. Remote debugging and help by mail available for smaller -fees, without limits to distance. +I am available for both 1099 and W2 on-site contracting in the Boston, MA, +USA metropolitan area, as well as remote consulting via dialup or Internet +connection anywhere in the USA. I am not interested in relocation. +However, temporary (two week maximum) jobs with paid expenses at other +locations will be considered. -Please call only about actual work, I prefer mail for all other questions. +My rate varies greatly (between $25-$60/hour) depending on the +circumstances. Rates for non-profit organizations will be on the lower end +of the spectrum if I support your cause. -I accept VISA and Mastercard, preferred for remote jobs and small amounts. +Updated: 2002-04-20  -Wolfgang S. Rupprecht -47 Esparito Ave. -Fremont, CA 94539-3827 -(510) 659-9757 +Greg Lehey +LEMIS +PO Box 460 +Echunga SA 5153 +Australia + +Phone: +61-8-8388-8286 +Fax: +61-8-8388-8725 +Mobile: +61-418-838-708 +Mail -Anything, (lisp, C, customization, porting, installing) I have -written thousands of lines of GNU Emacs C and Lisp code. Original -author of the floating point additions in Emacs 19. +Services: Supply, porting, installation, consultation on all GNU +products. -Rates: $95/hr. +Experience: 30 years OS and compiler experience, ports of most GNU +products. Author of ported software CD-ROM for UNIX System V.4.2, +"Porting UNIX Software" (O'Reilly), "Installing and Running FreeBSD" +and "The Complete FreeBSD" (both Walnut Creek). + +Rates: Choice of AUD 300 per hour or hotline rates AUD 6 per minute. +Outside Australia, $US 180 per hour or $US 3.50 per minute. Quick, +well prepared questions by mail may be free. + +Updated: 2002-04-21 + +Alan Lehotsky +Quality Software Management +634 West St +Carlisle, MA 01741 -Updated: 14Apr94 - -Signum Support AB -Box 2044 _ ...!seunet!signum!info -S-580 02 Linkoping, Sweden -+46 13 21 46 00 voice -+46 13 21 47 00 fax +Phone: (978)287-0435 +Fax: (978)287-0436 -Signum Support AB is a company dedicated to supporting, developing -and distributing free software for, including but not limited to, -UNIX systems. The people behind Signum Support AB have many years -of general UNIX experience, both as system administrators and as -programmers, and also extensive experience in maintaining the GNU -programs, both administrating it and finding and fixing bugs. +Services: + - Support for GNU compilers, including rehost/retarget + - GNU Binutils rehost/retarget. + - cgen/sim + - Perl internals hacking + - General system software work (SW tools, O/S, device drivers) + - runtime library (especially floating point) + - project management + - software process improvement + +Experience: 20+ years of design and implementation of optimizing + compilers. "Mr. Bliss" at Digital in the 70's and early + 80's. Experience with Motorola 68k, PowerPC, SPARC, Intel + x86 and IA64 (Merced), MIPS, NS32K, ADI SHARC DSP, VAX, PDP-11, + PDP-10. Wrote or maintained compilers for Ada, BLISS, C, C++, + FORTRAN, Pascal, Modula/2, O/S experience includes Unix (OSF/1, + SunOS, Solaris, AIX, HP/UX), VAX/VMS, Windows/NT, MacOS. + + 8 years experience with GCC internals, including major changes to + support 8 bit bytes on word-address Analog Devices SHARC DSP and + general support of PowerPC code generation. Retargetted gcc/binutils + cross-tools to ASIC used in optical switch. Retargeted gcc to 8 bit "internet toaster" + micro-computer. + +References available. + +Rates: $110/hr. + fixed price possible for well-defined deliverables. + +Updated: 2002-04-18 + +Reuven M. Lerner +Lerner Communications Consulting Ltd. +PO Box 518 +Modi'in 71700 +Israel + +Phone: 08-973-2225 (within Israel) + +972-8-973-2225 (outside of Israel) + +Fax: 08-973-0477 (within Israel) + +972-8-973-0477 (outside of Israel) + +WWW: http://www.lerner.co.il + +We specialize in writing custom Web and Internet applications. In +particular: + +- We create database-backed Web sites using Perl, Tcl, Python, Java, + Apache, mod_perl, OpenACS, Zope, MySQL, and PostgreSQL. + +- We offer support and service for system administrators who need help + with their GNU/Linux systems. + +- We offer training in a variety of programming languages (Perl, Tcl, + Python, and Java) and in GNU/Linux administration. + +Consulting rates: $110/hour, or $85/hour for non-profits. (Our rates +drop when we're hired on retainer or for projects that last longer +than one week.) + +Updated: 2002-04-18 + +Richard Levitte +Levitte Programming +Spannvägen 38, I +S-168 35 Bromma +Sweden +Tel.nr.: +46 (8) 26 52 47 (there is an answering machine) +Cellular: +46 (708) 26 53 44 (there is an answering machine) +e-mail: -Services offered: +What I do: + I work with various free software packages, mostly GNU ones, + for Unix and VMS (the latter both on VAX and Alpha). I've + been porting GNU Emacs to VMS between spring 1991 and + somewhere in 1998. I've ported a bunch of other GNU programs + as well. I maintain GNU vmslib. + For further info, see http://www.lp.se/~levitte/prof/resume.html +Programs supported: + To a varying degree (ranging from extension and porting to + installation and simple questions) at the time of updating + this entry: + - GNU vmslib, emacs, autoconf, zip, diffutils, m4, patch, + texinfo, C/C++; on both VMS and Unix. + - Other GNU programs to a small degree; on Unix. + For further info, look at http://www.lp.se/products/gnu.html + +Experience: + Fluent in TeX/LaTeX and many programming languages. + Modified key elements in Emacs (e.g., memory and process + management) to work transparently on VMS. I have very good + knowledge in the VMS operating system. I'm also knowledged in + the a few Unix flavors. + Well knowledged in cryptography as well as the development of + the PKIX standards (both based on X.500 and RFC 2459) and + involved protocols (SSL, OCSP, CMS, ...) + For further info, see http://www.lp.se/~levitte/prof/resume.html + +Your Rate: + $75-$100/hour (750-1000 SEK in sweden), plus expenses. My + rates are negotiable, depending on how interesting the project + is to me. + +Updated: 2002-04-18 + +Moss - Card Consulting Inc +16360 Broadway Avenue +Building A, Suite 103-104 +Cleveland OH 44137 USA + +www.mosscard.com ++1 216 587 4343 ++1 216 587 4342 Fax + +This dynamic Cleveland company offers the following services: +- installation and configuration for SGI machines +- Cross-platform development using wxWindows under GNU\Linux +- Programming (C/C++,tcsh) +- Compiler development using CORBA and gcc +- Real-time Cross-Platform Development +- Consulting +- Engineering +- Staff Augmentation + +We are Cleveland's first GNU\Linux developers, and one of our company's +members has just launched NASA's first cross development tool. + +Our rates vary from ($50 - $400) USD depending on the nature of the project. + +Updated 2004-2-23 + + NetGuide Scandinavia AB + Tankeg=E5ngen 4 + S-417 56 G=F6teborg, Sweden + +46 31 50 79 00 voice + +46 31 50 79 39 fax + http://www.netg.se + +NetGuide Scandinavia AB is a company that does consultant jobs and holds +courses in the fields of Unix software, TCP/IP networking and Internet +applications. The people behind NetGuide Scandinavia AB have many years of +general Unix experience, both as system administrators and as +programmers, and also extensive experience in maintaining the GNU +programs; in administration as well as finding and fixing bugs. + +Services offered: + - Installation and customizing GNU and other free software. We will make free software as easy to install and use as shrink wrapped programs. + - Service and support subscriptions. - Warranty protection. - Customization and porting. - Subscriptions to new versions which we will send monthly or with any other interval. - - Finding, Recommending and Investigation of free software in any - area of the customers choise. + - Finding, recommending and investigating free software in any + area of the customers choice. - Regular consulting. + - Support on Internet service software, especially the free + - Support on GNU/Linux. + - Freeware based courses in Unix usage, C, C++, or any GNU tools + + Rates: For courses, contact us for a quote, + For consulting, $60-120/hour, depending on contract length. + +Updated: 2000-12-13 + +Network Theory Ltd +15 Royal Park +Bristol +United Kingdom +Tel: +44 117 3179309 +Fax: +44 117 9048108 +http://www.network-theory.co.uk/gsl/ + +We provide software maintenance contracts for commercial users of the +GNU Scientific Library. + +We can also provide general numerical consulting for all types of +scientific and quantitative applications. -Rates: For software items, request our price list. - For consulting, 400-800 SEK/hour. +Rate: $1495/year (950 ukp) for base maintenance contract. -Updated: 14Apr94 +Updated: 2004-04-26  -Small Business Systems, Inc. -Box 17220, Route 104 -Esmond, RI 02917 -401.273.4669 - -Rate: Varies depending on complexity of task. - Hourly and fixed-rate contracts are available. -Programs Supported: All - -Updated: 14Apr94 - -Julian H. Stacey. -Vector Systems Ltd, Holz Strasse 27d, D 80469 Munich (Muenchen), GERMANY. -Tel. +49 89 268616 (089 268616 in Germany) 09:00-21:00 Timezone=GMT+01:00 - -Sources: All FSF/GNU, FreeBSD-current, X-Windows, XFree86, NetBSD, Mach, etc. - (Plus various other things, such as, but not limited to: - blas blt cflow CAD cnews crypt dvi2lj eispack elm encryption expect - ezd f2c flexfax gic gopher info-zip ingres inn jpeg kermit ksh - less lha linpack md5 mh mprof mtools mush nntp octave pbmplus - popper sather sc schemetoc slurp sml spreadsheet sup tcl tcl-dp - tcsh tcx term tex tiff tk top trn unarj ups urt wine xlock xv - xview xxgdb zmodem zip zircon zoo zsh.) -Media: QIC 1/4" Cartridge 525M, 150M, & 60M, TEAC CAS-60 60M Cassette, - CD-ROM, Floppies 1.4M & 1.2 & 720K & 360K. DAT arrangeable. - Postal Service C.O.D.(=`Nachnahme') or pre payment available. -Commercial Consultancy: - Custom Designs, Provision & support of FreeBSD or Unix, C, FSF tools, - X Windows, own tools, systems engineering, hardware interfacing, - multi lingual European, Cyrillic & Chinese tools & systems, - Unix, MSDOS, real time etc, communications & scientific & industrial. -DEUTSCH + FRANCAIS: - Man kann mir in Deutsch schreiben, (oder mich anrufen). - Je comprend Francais, mais je n'ecris pas des responses en Francais. - (Contact me in English, German, or French). -FREE for Symmetric Computer Systems Model 375 owners: - Free Binaries & sources on SCS/375's TEAC 50/60M Cassette, for: - GCC-1.40, UUCP-1.4, Ghostscript 2.3, Tar-1.08, Gzip-1.2.2 etc. - (Native SCS compiler can't compile GCC on this NSC32016 based BSD4.2) -On Request: Resume, Company Profile, Index of public & proprietary tools, -Rate: ~120 DM/hour. ~100DM/Cartridge. (1.5DM = $1 USA = 0.6 UK Pounds @4/'94) -Short enquiries free. (Kurze Anfragen Ohne Gebuhr). - -Updated: 14Jun94 - -Richard M. Stallman -UUCP: {mit-eddie,ucbvax,uunet,harvard,uw-beaver}!ai.mit.edu!rms -545 Tech Sq, Rm 430 +Thien-Thi Nguyen +Solana Free Software +ttn@glug.org +San Diego, CA, USA + +Service: General Consulting and Hacking on all things GNU + Resume: http://www.glug.org/people/ttn/resume.html + Rates: no job too small, everything negotiable + +Updated: 2002-04-20 + +David Nicol +Post office box 45163 +Kansas City, Missouri 64171 + +http://www.tipjar.com/dnconsult + +Unix, GNU/Linux, Perl installation, C, C++, Lisp, Perl programming. + +CGI programming. + +Installation, porting. + +Specification development, design, implementation, documentation. + +Rate: $60/hour, or fixed contract. On-site support available in +greater Kansas City area. + +Updated: 2002-04-23 + +Jonas Oberg (TeX: Jonas \"Oberg +Rimfrostgatan 95 Rimfrostgatan 95 +S-418 40 Goteborg S-418 40 G\"oteborg +Sweden Sweden) + +Phone: +46-733-423962 +E-mail: + +I offer support for most GNU software including the GNU +Hurd and also do system administration on GNU systems. +I can do free software development and have a good +understanding of automake, autoconf, flex, bison, guile, +texinfo and much more. Rates around USD$100. + +Updated: 2002-04-22 + +Francesco Potortì +Via S.Stefano, 8 +56123 Pisa, Italy +Tel. (050)560671 + +Emacs: installation and maintenance, training and tutorials, + customisation, extensions, troubleshooting. Author of some of + the packages in the emacs distribution, has made the porting + of emacs to the Motorola Delta architecture. + +Other: installation and maintenance of GNU software. Experience with + hylafax, RCS, gperf, etags, smail, indent, diff, gawk, gcc, + screen. Is the current maintainer of etags. + +Rates: 100 E/hour. + Prefer e-mail communication to telephone. + +Qualifications: Electronic Engineering degree, Pisa. Full time + researcher in CNUCE-CNR. + Familiar with elisp programming, porting of C programs, + low-level TCP/IP programming for embedded systems. + +Updated: 2002-06-28 + +Rodolphe Quiedeville +1 Quai Martin +56400 Auray +France +Tel (33 1) 613796341 +http://rodolphe.quiedeville.org/ + +Experience: Original author and current maintainer of the Lolix project + can be found at http://www.lolix.com + + I have more than 5 years experience on free software + system administration. + +Programming: PHP, Perl, Unix shell + +Services: Anything related to free software network and system administration. + +Updated: 2002-07-01 + +Red Hat, Inc. + +1325 Chesapeake Terrace +Sunnyvale, CA 94089 USA +Toll free: 866-2REDHAT ext. 3005 ++1 408 542 9600 voice ++1 408 542 9699 fax + +GNUPro Tools +Red Hat provides supported and maintained versions of gcc, g++, gdb +with GUI, GNU linker and GNU macro assembler. In addition, Red Hat +provides these GNU software development tools for well over many +popular host-target configurations. Support includes bug fixes and +semi-annual releases of the toolset. Each release is regression +tested and includes substantial improvements and additions to the +current release. Support is available through Incident support +packages, or Unlimited support for specific user groups. GNUPro is +available with standard, custom, and vintage toolchains for both +native and embedded application development. New target processors +are being added regularly. Rates for support for standard products +start at $12,500. + +Embedded Linux +Red Hat offers Red Hat Embedded Linux to companies looking for an open +source and royalty-free runtime solution. Red Hat Embedded Linux +currently supports certain ARM, StrongARM, and MIPS families of +processors. Embedded Linux supports multiple graphics APIs, is +compliant with POSIX APIs and thread support, can be configured as low +as 512k memory footprint including TCP/IP and NFS built into the +kernel, and supports journaling and transparent compression in +filesystems. Support for new processors is available via Red Hat +Professional Services. + +Updated: 2001-05-16 + +Relogic AB +Pipersgatan 26 +Box 868 +SE-112 28 Stockholm +SWEDEN + +web http://www.relogic.se +e-mail info@relogic.se +phone +46 708 800 000 +fax +46 708 800 580 + +Relogic provides experienced unix developers that know and love GNU +products. We can take on anything from single contractor support to +full scale projects. We know all programming languages and all Unix +dialects. + +Updated: 2002-04-19 + +RON's Datacom Co., Ltd. +79, DongWu Ave., +Wuhan, Hubei Province +430040 China P.R. +Tel +1370-113-0868(mobile) +86-27-83222108(office), Fax +86-27-83222108 +http://www.rons.net.cn +info@mail.rons.net.cn + +Ron's Datacom publishes the truly free ( the "free" in freedom) +monthly periodical --- FREE SOFTWARE Magazine(FSM), offering a series +of free software training courses entitled "Hackerdom", including: + +- Working with GNU Emacs; +- Programming in Emacs Lisp; +- Using and Porting GNU CC; +- Flex and Bison; +- Debugging with GDB; +- Device Driver Development with GNU AS and C; +- Shell Programming with BASH; +- GNU Building Tools: Make, Automake, Autoconf, M4; +- Typesetting and Layout Designing in TeX and PostScript; +- Parsing XML Documents. +- Source Code Version Management with CVS; +- GNU Awk and Sed; + +RON's Datacom Typesetting Workshop offers professional typesetting service +for both academic and commericial publishers, and solutions for building +the modern electronic publishing system with industrial strength. + +Hong Feng gives speeches to the public about the philosophy of free +software, and importance of freedom, suggestions for curriculum +reforms of computing science department in the universities and colleges. + +Please visit our website (www.rons.net.cn) for more details. + +Updated: 2002-05-12 + +Phillip Rulon +122 Blossom Rd. +Westport, MA 02790 +USA +508.672.3007 + + +15 years experience with GNU systems and tools. Available for any free +software project. Most useful for network design and construction or +dynamic web development. Very good Debian, Perl, and Apache. + +Boston, travel OK. +$100/hr, flat rate possible. + +Updated: 2002-06-28 + +Sankhya Technologies Private Limited, +III FLoor, #30-15-58 "Silver Willow", +Dabagardens, Visakhapatnam - 530 020 +INDIA +Tel: +91 891 5542665 +Fax: +91 891 5542666 +http://www.sankhya.com/info/services/gnu/gnu.html + +SANKHYA Development is a package of software engineering services +structured around select technologies in the areas of Compilers, +Assemblers and Linkers, Debuggers. Our rich experience with such +technologies enables us to deliver competitive software development +services to you, customized to your specific requirements. + +Sankhya offers competitive and cost-effective GNU maintenance and +support services for gcc, binutils, libtools and gdb. GNU Development +and Maintenance focuses on providing C, C++ compiler development, +assembler and linker development, debugger development, and compiler +optimizations. For semiconductor and chip design companies we offer +annual maintenance packages, and for software developers we offer +annual support packages. Following services are provided for gcc, +binutils, libtools and gdb, + + * Retargeting gcc, binutils, libtools and gdb for new processor + architectures, including RISC, CISC, VLIW or DSP architectures. + * Implementing processor specific optimizations. + * Annual Developer Support for developers. + * Maintenance packages for CPU/SoC vendors. We offer variety of + development/maintenance packages. + +UPDATED: 2004-02-13 + +Sparkle Computer Co Ltd + +email: +web: www.sparkle-cc.co.uk + +Specialists in software development and networks in London and +South-East England, primarily using open source tools. + + - Network security implementation using iptables, snort + - Network security testing using nmap and nessus + - Web services infrastruture with apache, tomcat, perl, jboss + - Software development in C, C++, java, perl + - Databases including MySQL and PostgreSQL. + - Mail services with sendmaill, MailScanner, spamassassin and virus + scanners + - Windows file and print services with Samba + +Development, configuration and consultancy services at 600 +(pounds)/day. Fixed price negotiable. Managed administration and +monitoring negotiable. + +Updated: 2002-07-01 + +Andre Spiegel +Dipl.-Inform. +Berlin, Germany + +Maintainer of the GNU Emacs version control package (VC). + +I can provide consulting and practical help for the installation and +administration of GNU/Linux systems, in particular Debian. Also +knowledgeable on many other Unix derivates, and network technology. +Installation, porting and customization of GNU software is possible; I +have programming experience in C, C++, Java, and Emacs Lisp, among +others. Expertise in version control using RCS or CVS. I also give +seminars on the above subjects. + +Rates: 75 EUR/hr (US$ 70) + +Updated: 2002-04-22 + +Name: Julian Stacey +Location: Muenchen, Deutschland (Munich, Germany). +Qualifications: University Degree, BSc Hons Computers & Cybernetics, 1980. +Resume: http://bim.bsn.com/~jhs/stacey/ (includes phone number). +Rate: 80 - 100 Euros / Hour. +Specialisation: Unix (Pref. BSD or Linux), C, X-Windows, FSF tools, firewalls, + systems engineering, hardware interfacing, real time/embedded, + custom design & porting. No { Emacs, Cobol, Microsoft }. +Net Consulting: Link speed: DSL @ 768 K bit/s. +Free Sources: BSD, X-Windows, XFree86, FSF; Personal sources on web. +Free GCC-1.40: For Symmetric Computer Systems Model 375 (native cc is broken). +Languages: I am English. Ich verstehe Deutsch. Je comprend Francais, + (lentment!). Use Hoch Deutsch, not Bayerisch, Spell slowly + & clearly, Use single digits, no inverted digit pairs etc. +Contact: State aprox. amount of days/months you want to purchase + professional consultancy .. OR .. Note I am NOT a free help + desk ! Please post your questions to a newsgroup, for those + with more time, knowledge, & inclination than I. + +Updated: 2002-04-19 + +Richard M. Stallman +545 Tech Sq, Rm 425 Cambridge, MA 02139 Emacs: anything whatever @@ -737,199 +1186,222 @@ Rates: $6/min or $250/hr. -Updated: 14Apr94 +Updated: 2002-04-19  -JoS-Ware Comp Tech Johan Svensson -Box 739 -220 07 LUND -SWEDEN -Tel +46-46-104505 (Dept. of Economics, University of LUND) -Fax +46-46-188445 (JoS-Ware Comp Tech) +Static Free Software +4119 Alpine Road +Portola Valley, Ca 94028 +(650) 851-2927 +http://www.staticfreesoft.com + +Static Free Software developed and supports the "Electric VLSI Design +System". Steven Rubin, the founder of the company and author of +Electric, is available for enhancements, support, and training. + +Please see our web page at www.staticfreesoft.com for more information +about our products, services, and prices. + +Updated: 2002-04-19 + +Tommy Stiansen +Skeielia 112 +5238 Raadal +Norway + ++ 47 92 40 42 00 ++ 47 55 22 12 17 +ts@pcias.no + +Special fields: +Unix, GNU/Linux, Perl installation, C, C++, Lisp, Perl programming. +CGI programming. +Installation, porting. +Specification development, design, implementation, documentation. +Firewalls, security analysis. Porting Windows platforms to GNU/Linux. +Teaching, preaching GNU/Linux / unix and Telecom. +15 years experience with GNU systems and tools. +Most useful for network design and construction or +dynamic web development. Expert in Apache, php, Mysql, Telecom related, +C, Lisp, Perl. + +Updated: 2002-04-18 + +Swing Digital Ltd. +15-17 Middle Street +Brighton +BN1 1AL +United Kingdom +Tel +44 (0) 1273 20 11 66 +Fax +44 (0) 1273 20 11 68 +http://www.swingdigital.com + +Swing Digital actively supports the development of the GNU.FREE +Internet Voting system. Through this support we have gained the +unique expertise to support, install and run GUN.FREE-based Internet +votes. We are also available in a consultancy basis to offer advice +for organisations wishing to run GNU.FREE themselves. -What: We offer consulting services regarding installation, - customization, troubleshooting, porting and integration - of all free software, including GNU software. - -Spec.: Network integration, integration of public domain software - into commercial systems, WorldWideWeb, C, X-Windows, Linux, - networked information systems - -How: Remote login over internet, email, modem, phone, personal - visits (in southern Sweden mainly) - -Rates: 550SEK (+ tax) per hour within Sweden - 370SEK (+ tax) per hour within Sweden for educational org. - US $90 per hour outside Sweden - US $70 per hour outside Sweden for educational org. - Note: fees may vary and special arrangements may be considered +Our consultancy fees start at 900 Euro (550 UK pounds) per day. We +are also able to securely host Internet Votes, prices on application. -Entered: 7Apr94 +Updated: 2002-04-19  -Kayvan Sylvan -Sylvan Associates +Kayvan A. Sylvan +Sylvan Associates, Inc. 879 Lewiston Drive -San Jose, CA 95136 -Phone: 408-978-1407 +San Jose, CA 95136-1517 +Phone: (408) 978-1407 +Fax: (408) 978-0472 + +I will help you port, install and customize GNU Emacs, GCC, G++, GNUmake, +bison, and other GNU tools on almost any architecture and operating +system. Questions answered. GNU C/C++, Java and lisp hacking available. -I will help you port, install and customize GNU Emacs, GCC, G++, -bison, and other GNU tools on almost any architechture and operating -system. Questions answered. GNU C and lisp hacking available. I will -also do ongoing support and periodic upgrades if you get on my GNU +I will also do ongoing support and periodic upgrades if you get on my GNU software subscription list. -Rates: $60-$100/hour, depending on type of work. Substantial discounts -for long-term contracts and also for educational or non-profit -institutions. - -Experience: Many different Unix systems (2.9BSD to 4.4BSD, SVR3 and -SVR4, Linux, Xenix). Systems programming and system administration on all -brands of Unix. Kernel hacking experience. Lots of porting experience. -I can port anything to anything (within reason). +Rates: $100-$125/hour, depending on type and quantity of work. +Substantial discounts for long-term contracts and also for educational or +non-profit institutions. + +Experience: Many different Unix systems (2.9BSD to 4.4BSD, Xenix, SVR3 and +SVR4, Solaris, Linux, FreeBSD). Systems programming and system +administration on all brands of Unix. -Updated: 14Apr94 +Kernel hacking experience. Lots of porting experience. + +Updated: 2002-04-18  -Leonard H. Tower Jr. -36 Porter Street -Somerville, MA 02143, USA -+1 (617) 623-7739 +Alfredo Tomasini +, -Will work on most GNU software. -Installation, handholding, trouble shooting, extensions, teaching. +GNU/Linux Intel desktop/laptop installation, setup, and networking. +Installation of GNU tools on SunOS and GNU/Linux. +Sed and Gawk script development. -Rates: 100.00/hour + travel expenses. Negotiable for non-profits. +Languages: English and Italian. -Experience: Have hacked on over a dozen architectures in many languages. Have -system mothered several varieties of Unixes. Assisted rms with the front end -of gcc and it's back-end support. Resume available on request. +Fee: $50/hour. -Entered: 14Apr94 +Updated: 2002-04-19  -UrbanSoft AO -68 Malooktinskii Prospect -St. Petersburg, Russia 195272 - -Custom GhostScript and TeX programming by e-mail. -Database documents, directories, standard forms. - -UrbanSoft uses a portion of its revenues to contribute -diskette distributions of GNU software to Russian -universities (most of which lack FTP access). - -Rates: 30,000 rubles (currently USD 16.80) per hour. - Fixed rate contracts also possible. - Payable by bank transfer. - -Updated: 20Apr94 - -noris network -Matthias Urlichs -Schleiermacherstrasse 12 -90491 Nuernberg -Germany -Phone: +49 911 9959621 -Fax: +49 911 5980150 - -http://info.noris.de/ (German) +Tksoft Inc. +Papinkatu 19 +06100, Porvoo +Finland ++358 40 570 9900 -Expertise: - OS internals, esp. Linux and BSD, esp. device drivers - Network protocol / program design and coding - Utilities coding and maintainance - Program debugging, testing - User interface design and testing - Several programming and tool languages +http://www.tksoft.com/ -Services: - Installation, debugging, enhancement, distribution, - for all kinds of free software. - System administration for most Unix-like systems. - Email, Fax, phone, and in-person consulting (and/or "question answering"). - Remote support and system monitoring (over the Internet), - Update service (new tools tested and installed automagically) - Internet access +Software development services for GNU programs. +We can modify and fix GNU software. +We will also develop new software under the GNU license. -Rates: - DM 110 (~$70) per hour - Support contracts start at DM 170/month + DM 30/supported system. - Willing to travel for sufficiently large jobs. - Rates don't include taxes. - -Entered: 16Aug94 - -Joe Wells -Postal Address: - care of: Boston University Computer Science Department - 111 Cummington Street, Room 138 - Boston, Massachusetts 02215 -Work Telephone: (617) 353-3381 (sorry, but no answering machine or voice mail) -Home Telephone: (617) 739-7456 (until August 1995) -Finger "jbw@cs.bu.edu" for up-to-date contact information. +10 years of experience in linux and other GNU software. -Experience: - I have B.A. and M.A. degrees in Computer Science and have completed - all but the dissertation for a Ph.D. in C.S. My research for my - Ph.D. is in the areas of logic, type systems, and programming - language theory. My primary programming languages are Emacs Lisp, - Perl, and Bourne shell, but of course I can program in any language. - I have written numerous Emacs Lisp packages. I started the USENET - "List of Frequently Asked Questions about GNU Emacs with Answers" and - maintained it for more than two years. Most of my work has been - related to the telephone system (modems, voice mail, etc.), but I am - not limited to that. Send e-mail for my complete resume or curriculum - vita. +We speak Finnish, Japanese and English. -Programs supported: - GNU Emacs and Taylor UUCP: - Installation, training, customization, bug fixing, troubleshooting, - extension, development, porting, or answering any kind of question. - Any other GNU program: - The same things, but I don't necessarily have huge amounts of - experience with the particular program. - -Working conditions: - I am usually available for part-time work (less than 20 hours per week - including any travel time). I can sometimes make time for full-time - work for a month or two; please inquire. I can either work in or near - Boston or via the Internet or via telephone; travel outside the Boston - metropolitan area can be negotiated. My schedule is very flexible. - Any programs I write will normally have the copying conditions of the - GNU General Public License; this is negotiable. - -Rates: $65/hour as an independent contractor. - travel and telephone expenses. - higher rates if extensive travel is required. - -Updated: 27Sep94. - -Herb Wood -phone: 1-415-789-7173 -email: - -I'm a better "planner" than I am a hacker. A really good hacker will be able -to keep many pieces of information in their short-term memory and to memorize -new pieces of information at a fast rate. This is not my strong point. -Rather, I excel in domains that require knowledge of the slightly more -theoretical parts of computer science --for example, logic, formal methods of -program development, and functional programming. I can write, and I have -"tutoring" (teaching one-on-one) experience, an, unlike some programmers, -I enjoy doing these things. - -I have spend a lot of time looking at the Emacs Lisp sources and customizing -Emacs and VM. I think I can customize Emacs and its packages quickly and -effectively. - -Entered: 30Jul95 - -Yggdrasil Computing, Inc./ Freesoft, Inc. -4880 Stevens Creek Blvd. Ste. 205 -San Jose, CA 95129 -(408) 261-6630 -(800) 261 6630 +Updated: 2004-05-13 + +Leonard H. Tower Jr. +36 Porter Street +Somerville, MA 02143-2313 +USA ++1-617-623-7739 + +Will work on most GNU, GPLed, and Open Source software. +Installation, handholding, trouble shooting, extensions, teaching, etc. + +Rates: $ 250.00/hour + travel + expenses. Fixed fee quotes available. + Negotiable for non-profits. -Updated: 14Apr94 +Experience: Have hacked on over a dozen architectures in many languages. Have +system mothered too many varieties of Unixes. Assisted rms with the front end +of GCC and its back-end support. Installed and worked with many GNU +programs including GNU Emacs. Resume available on request. + +Updated: 2002-04-18 + +Xetpoint Oy +P.O. Box 43, FIN-33961 Pirkkala, Finland + +Email: +Web: http://www.xetpoint.fi/ + +Services: +- GNU/Linux system installation, configuration and maintenance +- GNU/Linux system administration +- GNU/Linux consultation and support +- GNU/Linux and free software customization +- Network administration +- Free software development and integration +- Training +- Security analysis + +Rates: 80 EUR/hour or fixed contract. + +Updated: 2004-02-13 + +Wasabi Systems + +500 E. Main St., Suite 1520 +Norfolk, VA 23510 ++1 757 248-9601 voice ++1 509 461-7283 fax +http://www.wasabisystems.com/ + +Wasabi Systems provides service and support for the popular GNU +development tools, as service packages and as stand-alone software +distributions. We provide cross-compilers and cross-debuggers to be +used for developing all types of embedded systems. We specialize in +optimizing the GNU tools for particular targets, and in providing +support for standardized tools to be used on multiple types of hosts +for multiple types of targets. We provide first- and/or second- tier +support for you and/or your end-users. + +Support is available in a variety of packages, with a base rate of +$200/hour. + +Updated: 2004-03-02 + +Jody Winston +xprt Computer Consulting, Inc. +731 Voyager +Houston, TX, 77062 +(281) 480-UNIX, + +We have supported, installed, and used the entire GNU software suite +for over 10 years on many different Unix platforms. We have written +character device drivers and proc file systems for custom hardware +running on GNU/Linux. We have developed extensions for tcl and Python. +In addition, we have developed a custom X11 server and X input +extensions. Our consulting rate is $150.00 US dollars per hour, +negotiable, plus a per diem for out of town work. + +Updated: 2002-04-19 + +The Written Word +Web: http://thewrittenword.com +Email: info@thewrittenword.com +Tel: (800) 372-7476 + +The Written Word provides CDs of pre-compiled Open Source applications +on popular UNIX variants. Clients can purchase a one-time CD set +($149/set), or a subscription, which provides four quarterly releases. +Two types of subscription are available: "media only" ($550/year), or +"media and updates" ($1459/year). The "media and updates" +subscription entitles the subscriber, via a web site, to patches, +security fixes, new releases to existing packages, new packages, +online documentation, and changelog information, between releases, and +a central bug tracking system for all packages. + +Updated: 2000-11-27  For a current copy of this directory, or to have yourself listed, ask: - gnu@prep.ai.mit.edu + service@gnu.org + +A current version should be available on our web site at: + http://www.gnu.org/prep/service.html ** Please keep the entries in this file alphabetical ** diff --text -u 'xemacs-21.5.17/etc/etags.1' 'xemacs-21.5.18/etc/etags.1' Index: ./etc/etags.1 --- ./etc/etags.1 Fri Apr 13 03:20:50 2001 +++ ./etc/etags.1 Thu Oct 7 23:51:11 2004 @@ -1,6 +1,6 @@ -.\" Copyright (c) 1992 Free Software Foundation +.\" Copyright (c) 1992, 2001 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH etags 1 "14gen2001" "GNU Tools" "GNU Tools" +.TH etags 1 "23nov2001" "GNU Tools" "GNU Tools" .de BP .sp .ti -.2i @@ -12,55 +12,60 @@ .SH SYNOPSIS .hy 0 .na -.B etags [\|\-aCDGImRVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] +\fBetags\fP [\|\-aCDGImRVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] .if n .br -.B [\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|] +[\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|] +[\|\-\-parse\-stdin=\fIfile\fP\|] .br -.B [\|\-\-append\|] [\|\-\-no\-defines\|] -.B [\|\-\-no\-globals\|] [\|\-\-include=\fIfile\fP\|] -.B [\|\-\-ignore\-indentation\|] [\|\-\-language=\fIlanguage\fP\|] -.B [\|\-\-members\|] [\|\-\-output=\fItagfile\fP\|] -.B [\|\-\-regex=\fIregexp\fP\|] [\|\-\-no\-regex\|] -.B [\|\-\-ignore\-case\-regex=\fIregexp\fP\|] -.B [\|\-\-help\|] [\|\-\-version\|] +[\|\-\-append\|] [\|\-\-no\-defines\|] +[\|\-\-no\-globals\|] [\|\-\-include=\fIfile\fP\|] +[\|\-\-ignore\-indentation\|] [\|\-\-language=\fIlanguage\fP\|] +[\|\-\-members\|] [\|\-\-output=\fItagfile\fP\|] +[\|\-\-regex=\fIregexp\fP\|] [\|\-\-no\-regex\|] +[\|\-\-help\|] [\|\-\-version\|] \fIfile\fP .\|.\|. -.B ctags [\|\-aCdgImRVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|] +\fBctags\fP [\|\-aCdgImRVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|] .if n .br -.B [\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|] +[\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|] +[\|\-\-parse\-stdin=\fIfile\fP\|] .br -.B [\|\-\-append\|] [\|\-\-backward\-search\|] -.B [\|\-\-cxref\|] [\|\-\-defines\|] [\|\-\-forward\-search\|] -.B [\|\-\-globals\|] [\|\-\-ignore\-indentation\|] -.B [\|\-\-language=\fIlanguage\fP\|] [\|\-\-members\|] -.B [\|\-\-output=\fItagfile\fP\|] [\|\-\-regex=\fIregexp\fP\|] -.B [\|\-\-ignore\-case\-regex=\fIregexp\fP\|] -.B [\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] -.B [\|\-\-update\|] [\|\-\-no\-warn\|] -.B [\|\-\-help\|] [\|\-\-version\|] +[\|\-\-append\|] [\|\-\-backward\-search\|] +[\|\-\-cxref\|] [\|\-\-defines\|] [\|\-\-forward\-search\|] +[\|\-\-globals\|] [\|\-\-ignore\-indentation\|] +[\|\-\-language=\fIlanguage\fP\|] [\|\-\-members\|] +[\|\-\-output=\fItagfile\fP\|] [\|\-\-regex=\fIregexp\fP\|] +[\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] +[\|\-\-update\|] [\|\-\-no\-warn\|] +[\|\-\-help\|] [\|\-\-version\|] \fIfile\fP .\|.\|. .ad b .hy 1 .SH DESCRIPTION -The `\|\fBetags\fP\|' program is used to create a tag table file, in a format +The \|\fBetags\fP\| program is used to create a tag table file, in a format understood by .BR emacs ( 1 )\c -\&; the `\|\fBctags\fP\|' program is used to create a similar table in a +\&; the \|\fBctags\fP\| program is used to create a similar table in a format understood by .BR vi ( 1 )\c -\&. Both forms of the program understand the syntax of C, Objective C, -C++, Java, Fortran, Ada, Cobol, Erlang, LaTeX, Emacs Lisp/Common Lisp, -makefiles, Pascal, Perl, Postscript, Python, Prolog, Scheme and most -assembler\-like syntaxes. +\&. Both forms of the program understand +the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang, HTML, +LaTeX, Emacs Lisp/Common Lisp, Lua, makefile, Pascal, Perl, PHP, Postscript, +Python, Prolog, Scheme and +most assembler\-like syntaxes. Both forms read the files specified on the command line, and write a tag -table (defaults: `\|TAGS\|' for \fBetags\fP, `\|tags\|' for +table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for \fBctags\fP) in the current working directory. Files specified with relative file names will be recorded in the tag table with file names relative to the directory where the tag table -resides. Files specified with absolute file names will be recorded -with absolute file names. +resides. If the tag table is in /dev, however, the file names are made +relative to the working directory. Files specified with absolute file +names will be recorded +with absolute file names. Files generated from a source file\-\-like +a C file generated from a source Cweb file\-\-will be recorded with +the name of the source file. The programs recognize the language used in an input file based on its -file name and contents. The --language switch can be used to force +file name and contents. The \fB\-\-language\fP switch can be used to force parsing of the file names following the switch according to the given language, overriding guesses based on filename extensions. .SH OPTIONS @@ -70,7 +75,7 @@ The programs accept unambiguous abbreviations for long option names. .TP .B \-a, \-\-append -Append to existing tag file. (For vi-format tag files, see also +Append to existing tag file. (For \fBvi\fP-format tag files, see also \fB\-\-update\fP.) .TP .B \-B, \-\-backward\-search @@ -134,28 +139,61 @@ .B \-\-packages\-only Only tag packages in Ada files. .TP +\fB\-\-parse\-stdin=\fIfile\fP +May be used (only once) in place of a file name on the command line. +\fBetags\fP will read from standard input and mark the produced tags +as belonging to the file \fBFILE\fP. +.TP \fB\-o\fP \fItagfile\fP, \fB\-\-output=\fItagfile\fP -Explicit name of file for tag table; overrides default `\|TAGS\|' or -`\|tags\|'. (But ignored with \fB\-v\fP or \fB\-x\fP.) +Explicit name of file for tag table; overrides default \fBTAGS\fP or +\fBtags\fP. (But ignored with \fB\-v\fP or \fB\-x\fP.) .TP -\fB\-r\fP \fIregexp\fP, \fB\-\-regex=\fIregexp\fP, \fB\-\-ignore\-case\-regex=\fIregexp\fP -Make tags based on regexp matching for each line of the files following -this option, in addition to the tags made with the standard parsing based -on language. When using \-\-regex, case is significant, while it is not -with \-\-ignore\-case\-regex. May be freely intermixed with filenames and -the \fB\-R\fP option. The regexps are cumulative, i.e. each option will -add to the previous ones. The regexps are of the form: -.br - \fB/\fP\fItagregexp\fP[\fB/\fP\fInameregexp\fP]\fB/\fP -.br - -where \fItagregexp\fP is used to match the lines that must be tagged. -It should not match useless characters. If the match is -such that more characters than needed are unavoidably matched by -\fItagregexp\fP, it may be useful to add a \fInameregexp\fP, to -narrow down the tag scope. \fBctags\fP ignores regexps without a -\fInameregexp\fP. The syntax of regexps is the same as in emacs, -augmented with intervals of the form \\{m,n\\}, as in ed or grep. +\fB\-r\fP \fIregexp\fP, \fB\-\-regex=\fIregexp\fP + +Make tags based on regexp matching for the files following this option, +in addition to the tags made with the standard parsing based on +language. May be freely intermixed with filenames and the \fB\-R\fP +option. The regexps are cumulative, i.e. each such option will add to +the previous ones. The regexps are of one of the forms: +.br + [\fB{\fP\fIlanguage\fP\fB}\fP]\fB/\fP\fItagregexp/\fP[\fInameregexp\fP\fB/\fP]\fImodifiers\fP +.br + \fB@\fP\fIregexfile\fP +.br + +where \fItagregexp\fP is used to match the tag. It should not match +useless characters. If the match is such that more characters than +needed are unavoidably matched by \fItagregexp\fP, it may be useful to +add a \fInameregexp\fP, to narrow down the tag scope. \fBctags\fP +ignores regexps without a \fInameregexp\fP. The syntax of regexps is +the same as in emacs. The following character escape sequences are +supported: \\a, \\b, \\d, \\e, \\f, \\n, \\r, \\t, \\v, which +respectively stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL, +CR, TAB, VT. +.br +The \fImodifiers\fP are a sequence of 0 or more characters among +\fIi\fP, which means to ignore case when matching; \fIm\fP, which means +that the \fItagregexp\fP will be matched against the whole file contents +at once, rather than line by line, and the matching sequence can match +multiple lines; and \fIs\fP, which implies \fIm\fP and means that the +dot character in \fItagregexp\fP matches the newline char as well. +.br +The separator, which is \fB/\fP in the examples, can be any character +different from space, tab, braces and \fB@\fP. If the separator +character is needed inside the regular expression, it must be quoted +by preceding it with \fB\\\fP. +.br +The optional \fB{\fP\fIlanguage\fP\fB}\fP prefix means that the tag +should be +created only for files of language \fIlanguage\fP, and ignored +otherwise. This is particularly useful when storing many predefined +regexps in a file. +.br +In its second form, \fIregexfile\fP is the name of a file that contains +a number of arguments to the \fI\-\-regex\=\fP option, +one per line. Lines beginning with a space or tab are assumed +to be comments, and ignored. + .br Here are some examples. All the regexps are quoted to protect them from shell interpretation. @@ -164,6 +202,7 @@ Tag the DEFVAR macros in the emacs source files: .br \fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"\/'\fP +.\"" This comment is to avoid confusion to Emacs syntax highlighting .br Tag VHDL files (this example is a single long line, broken here for @@ -180,17 +219,17 @@ \fI\-\-lang\=none \-\-regex\='/proc[\ \\t]+\\([^\ \\t]+\\)/\\1/'\fP .br -A regexp can be preceded by {lang}, thus restriciting it to match lines of -files of the specified language. Use \fBetags --help\fP to obtain a list -of the recognised languages. This feature is particularly useful inside +A regexp can be preceded by {\fIlang\fP}, thus restricting it to match +lines of files of the specified language. Use \fBetags --help\fP to obtain +a list of the recognised languages. This feature is particularly useful inside \fBregex files\fP. A regex file contains one regex per line. Empty lines, and those lines beginning with space or tab are ignored. Lines beginning with @ are references to regex files whose name follows the @ sign. Other -lines are considered regular expressions like those following \-\-regex. +lines are considered regular expressions like those following \fB\-\-regex\fP. .br For example, the command .br -etags \-\-regex=@regex.file *.c +\fIetags \-\-regex=@regex.file *.c\fP .br reads the regexes contained in the file regex.file. .TP @@ -199,12 +238,12 @@ freely intermixed with filenames and the \fB\-\-regex\fP option. .TP .B \-t, \-\-typedefs -Record typedefs in C code as tags. Since this is the default behaviour +Record typedefs in C code as tags. Since this is the default behavior of \fBetags\fP, only \fBctags\fP accepts this option. .TP .B \-T, \-\-typedefs\-and\-c++ Generate tag entries for typedefs, struct, enum, and union tags, and -C++ member functions. Since this is the default behaviour +C++ member functions. Since this is the default behavior of \fBetags\fP, only \fBctags\fP accepts this option. .TP .B \-u, \-\-update @@ -229,7 +268,8 @@ \fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option. .TP .B \-h, \-H, \-\-help -Print usage information. +Print usage information. Followed by one or more \-\-language=LANG +prints detailed information about how tags are created for LANG. .TP .B \-V, \-\-version Print the current version of the program (same as the version of the @@ -245,19 +285,23 @@ .BR vi ( 1 ). .SH COPYING -Copyright (c) 1999 Free Software Foundation, Inc. +Copyright +.if t \(co +.if n (c) +1999, 2001 Free Software Foundation, Inc. .PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. +Permission is granted to make and distribute verbatim copies of this +document provided the copyright notice and this permission notice are +preserved on all copies. .PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. +Permission is granted to copy and distribute modified versions of +this document under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of +a permission notice identical to this one. .PP Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. +document into another language, under the above conditions for +modified versions, except that this permission notice may be stated +in a translation approved by the Free Software Foundation. + +.\" arch-tag: 9534977f-af78-42f0-991d-1df6b6c05573 diff --text -u /dev/null 'xemacs-21.5.18/etc/gtkrc' Index: ./etc/gtkrc --- ./etc/gtkrc Thu Jan 1 09:00:00 1970 +++ ./etc/gtkrc Sat May 15 16:43:05 2004 @@ -0,0 +1,9 @@ +# Force the window background to be the same as the default face background: +# white. + +style "default_background" +{ + bg[NORMAL] = { 1.0, 1.0, 1.0 } +} + +class "GtkXEmacs" style "default_background" diff --text -u 'xemacs-21.5.17/lib-src/ChangeLog' 'xemacs-21.5.18/lib-src/ChangeLog' Index: ./lib-src/ChangeLog --- ./lib-src/ChangeLog Mon Mar 22 18:23:05 2004 +++ ./lib-src/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,37 @@ +2004-10-22 Stephen J. Turnbull + + * XEmacs 21.5.18 "chestnut" is released. + +2004-10-07 Jerry James + + * etags.c: Update to author version 17.6. + +2004-09-14 Jerry James + + * digest-doc.c (main): Remove unused argc and argv. + * fakemail.c (main): Ditto. + * make-dump-id.c (main): Ditto. + * profile.c (main): Ditto. + * sorted-doc.c (main): Ditto. + * gnuclient.c (tell_emacs_to_resume): Mark unused parameters. + * gnuserv.c (main): Ditto. + * make-docfile.c (write_c_args): Ditto. + * pop.c (socket_connection): Ditto. + +2004-08-10 Jerry James + + * etags.c: Update to author version 16.56. + +2004-04-17 Olivier Galibert + + * insert-data-in-exec.c (main): Fix error message. + +2003-12-07 Olivier Galibert + + * Makefile.in.in (insert-data-in-exec): Added target. + + * insert-data-in-exec.c: Added. + 2004-03-22 Stephen J. Turnbull * XEmacs 21.5.17 "chayote" is released. @@ -359,7 +393,6 @@ * XEmacs 21.5.0 "alfalfa" is released. ->>>>>>> 1.136 2000-08-01 Jon Schewe * gnuclient.c (filename_expand): Let Cygwin convert Windows path diff --text -u 'xemacs-21.5.17/lib-src/Makefile.in.in' 'xemacs-21.5.18/lib-src/Makefile.in.in' Index: ./lib-src/Makefile.in.in --- ./lib-src/Makefile.in.in Wed Jan 28 02:49:44 2004 +++ ./lib-src/Makefile.in.in Fri Apr 16 05:56:17 2004 @@ -129,7 +129,7 @@ ## Things that XEmacs uses during the build process itself. ## Not installed. -BUILD_UTILITIES = make-path make-dump-id +BUILD_UTILITIES = make-path make-dump-id insert-data-in-exec EXES = ${PUBLIC_INSTALLABLE_EXES} ${PRIVATE_INSTALLABLE_EXES} ${BUILD_UTILITIES} SCRIPTS = ${PUBLIC_INSTALLABLE_SCRIPTS} ${PRIVATE_INSTALLABLE_SCRIPTS} @@ -375,6 +375,9 @@ make-dump-id: ${srcdir}/make-dump-id.c $(CC) $(cflags) ${srcdir}/make-dump-id.c $(ldflags) -o $@ +insert-data-in-exec: ${srcdir}/insert-data-in-exec.c + $(CC) $(cflags) ${srcdir}/insert-data-in-exec.c $(ldflags) -o $@ + cflags_gnuserv = $(CFLAGS) $(cppflags) $(c_switch_all) ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) @libs_xauth@ $(ld_libs_general) gnuslib.o: ${srcdir}/gnuslib.c ${srcdir}/gnuserv.h ../src/config.h diff --text -u 'xemacs-21.5.17/lib-src/config.values.in' 'xemacs-21.5.18/lib-src/config.values.in' Index: ./lib-src/config.values.in --- ./lib-src/config.values.in Mon Mar 10 02:23:59 2003 +++ ./lib-src/config.values.in Sat May 15 00:34:36 2004 @@ -44,6 +44,7 @@ INSTALL_SCRIPT "@INSTALL_SCRIPT@" LDFLAGS "@LDFLAGS@" LIBS "@LIBS@" +LIBSTDCPP "@LIBSTDCPP@" LISPDIR "@LISPDIR@" LISPDIR_USER_DEFINED "@LISPDIR_USER_DEFINED@" LN_S "@LN_S@" @@ -72,6 +73,7 @@ SRC_SUBDIR_DEPS "@SRC_SUBDIR_DEPS@" SUBDIR_MAKEFILES "@SUBDIR_MAKEFILES@" XEMACS_CC "@XEMACS_CC@" +XE_CFLAGS "@XE_CFLAGS@" X_CFLAGS "@X_CFLAGS@" X_EXTRA_LIBS "@X_EXTRA_LIBS@" X_LIBS "@X_LIBS@" diff --text -u 'xemacs-21.5.17/lib-src/digest-doc.c' 'xemacs-21.5.18/lib-src/digest-doc.c' Index: ./lib-src/digest-doc.c --- ./lib-src/digest-doc.c Sun Jun 10 19:42:17 2001 +++ ./lib-src/digest-doc.c Tue Sep 21 04:19:10 2004 @@ -11,7 +11,7 @@ #include int -main (int argc, char *argv[]) +main () { register int ch; register int notfirst = 0; diff --text -u 'xemacs-21.5.17/lib-src/etags.c' 'xemacs-21.5.18/lib-src/etags.c' Index: ./lib-src/etags.c --- ./lib-src/etags.c Sun Jul 14 23:23:46 2002 +++ ./lib-src/etags.c Thu Oct 7 23:51:19 2004 @@ -1,22 +1,22 @@ /* Tags file maker to go with GNU Emacs -*- coding: latin-1 -*- - Copyright (C) 1984, 87, 88, 89, 93, 94, 95, 98, 99, 2000, 2001 + Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2001, 2002 Free Software Foundation, Inc. and Ken Arnold -This file is not considered part of GNU Emacs. + This file is not considered part of GNU Emacs. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Authors: @@ -25,14 +25,22 @@ * Ed Pelegri-Llopart added C typedefs. * Gnu Emacs TAGS format and modifications by RMS? * 1989 Sam Kendall added C++. - * 1993 Francesco Potortì reorganised C and C++ based on work by Joe Wells. - * 1994 Regexp tags by Tom Tromey. - * 2001 Nested classes by Francesco Potortì based on work by Mykola Dzyuba. + * 1992 Joseph B. Wells improved C and C++ parsing. + * 1993 Francesco Potortì reorganised C and C++. + * 1994 Line-by-line regexp tags by Tom Tromey. + * 2001 Nested classes by Francesco Potortì (concept by Mykola Dzyuba). + * 2002 #line directives by Francesco Potortì. * - * Francesco Potortì has maintained it since 1993. + * Francesco Potortì has maintained and improved it since 1993. */ -char pot_etags_version[] = "@(#) pot revision number is 14.28"; +/* + * If you want to add support for a new language, start by looking at the LUA + * language, which is the simplest. Alternatively, consider shipping a + * configuration file containing regexp definitions for etags. + */ + +char pot_etags_version[] = "@(#) pot revision number is 17.6"; #define TRUE 1 #define FALSE 0 @@ -52,17 +60,17 @@ # undef static # define ETAGS_REGEXPS /* use the regexp features */ # define LONG_OPTIONS /* accept long options */ -# ifndef __P -# define __P(args) args -# endif -# ifndef PTR +# ifndef PTR /* for XEmacs */ # define PTR void * # endif -#else +# ifndef __P /* for XEmacs */ +# define __P(args) args +# endif +#else /* no config.h */ # if defined(__STDC__) && (__STDC__ || defined(__SUNPRO_C)) # define __P(args) args /* use prototypes */ # define PTR void * /* for generic pointers */ -# else +# else /* not standard C */ # define __P(args) () /* no prototypes */ # define const /* remove const for old compilers' sake */ # define PTR long * /* don't use void* */ @@ -73,6 +81,13 @@ # define _GNU_SOURCE 1 /* enables some compiler checks on GNU */ #endif +#ifdef LONG_OPTIONS +# undef LONG_OPTIONS +# define LONG_OPTIONS TRUE +#else +# define LONG_OPTIONS FALSE +#endif + /* WIN32_NATIVE is for XEmacs. MSDOS, WINDOWSNT, DOS_NT are for Emacs. */ #ifdef WIN32_NATIVE @@ -108,12 +123,19 @@ # ifndef HAVE_GETCWD # define HAVE_GETCWD # endif /* undef HAVE_GETCWD */ -#else /* !WINDOWSNT */ +#else /* not WINDOWSNT */ # ifdef STDC_HEADERS # include # include -# else +# else /* no standard C headers */ extern char *getenv (); +# ifdef VMS +# define EXIT_SUCCESS 1 +# define EXIT_FAILURE 0 +# else /* no VMS */ +# define EXIT_SUCCESS 0 +# define EXIT_FAILURE 1 +# endif # endif #endif /* !WINDOWSNT */ @@ -144,7 +166,7 @@ # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif -#ifdef LONG_OPTIONS +#if LONG_OPTIONS # include #else # define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr) @@ -174,25 +196,18 @@ # define CTAGS FALSE #endif -/* Exit codes for success and failure. */ -#ifdef VMS -# define GOOD 1 -# define BAD 0 -#else -# define GOOD 0 -# define BAD 1 -#endif - #define streq(s,t) (assert((s)!=NULL || (t)!=NULL), !strcmp (s, t)) +#define strcaseeq(s,t) (assert((s)!=NULL && (t)!=NULL), !etags_strcasecmp (s, t)) #define strneq(s,t,n) (assert((s)!=NULL || (t)!=NULL), !strncmp (s, t, n)) +#define strncaseeq(s,t,n) (assert((s)!=NULL && (t)!=NULL), !etags_strncasecmp (s, t, n)) #define CHARS 256 /* 2^sizeof(char) */ #define CHAR(x) ((unsigned int)(x) & (CHARS - 1)) -#define iswhite(c) (_wht[CHAR(c)]) /* c is white */ -#define notinname(c) (_nin[CHAR(c)]) /* c is not in a name */ -#define begtoken(c) (_btk[CHAR(c)]) /* c can start token */ -#define intoken(c) (_itk[CHAR(c)]) /* c can be in token */ -#define endtoken(c) (_etk[CHAR(c)]) /* c ends tokens */ +#define iswhite(c) (_wht[CHAR(c)]) /* c is white (see white) */ +#define notinname(c) (_nin[CHAR(c)]) /* c is not in a name (see nonam) */ +#define begtoken(c) (_btk[CHAR(c)]) /* c can start token (see begtk) */ +#define intoken(c) (_itk[CHAR(c)]) /* c can be in token (see midtk) */ +#define endtoken(c) (_etk[CHAR(c)]) /* c ends tokens (see endtk) */ #define ISALNUM(c) isalnum (CHAR(c)) #define ISALPHA(c) isalpha (CHAR(c)) @@ -227,29 +242,45 @@ typedef struct { - char *suffix; - char *command; /* Takes one arg and decompresses to stdout */ + char *suffix; /* file name suffix for this compressor */ + char *command; /* takes one arg and decompresses to stdout */ } compressor; typedef struct { - char *name; - Lang_function *function; - char **filenames; - char **suffixes; - char **interpreters; + char *name; /* language name */ + char *help; /* detailed help for the language */ + Lang_function *function; /* parse function */ + char **suffixes; /* name suffixes of this language's files */ + char **filenames; /* names of this language's files */ + char **interpreters; /* interpreters for this language */ + bool metasource; /* source used to generate other sources */ } language; +typedef struct fdesc +{ + struct fdesc *next; /* for the linked list */ + char *infname; /* uncompressed input file name */ + char *infabsname; /* absolute uncompressed input file name */ + char *infabsdir; /* absolute dir of input file */ + char *taggedfname; /* file name to write in tagfile */ + language *lang; /* language of file */ + char *prop; /* file properties to write in tagfile */ + bool usecharno; /* etags tags shall contain char number */ + bool written; /* entry written in the tags file */ +} fdesc; + typedef struct node_st -{ /* sorting structure */ - char *name; /* function or type name */ - char *file; /* file name */ - bool is_func; /* use pattern or line no */ - bool been_warned; /* set if noticed dup */ - int lno; /* line number tag is on */ +{ /* sorting structure */ + struct node_st *left, *right; /* left and right sons */ + fdesc *fdp; /* description of file to whom tag belongs */ + char *name; /* tag name */ + char *regex; /* search regexp */ + bool valid; /* write this tag on the tag file */ + bool is_func; /* function tag: use regexp in CTAGS mode */ + bool been_warned; /* warning already given for duplicated tag */ + int lno; /* line number tag is on */ long cno; /* character number line starts on */ - char *pat; /* search pattern */ - struct node_st *left, *right; /* left and right sons */ } node; /* @@ -266,6 +297,38 @@ char *buffer; } linebuffer; +/* Used to support mixing of --lang and file names. */ +typedef struct +{ + enum { + at_language, /* a language specification */ + at_regexp, /* a regular expression */ + at_filename, /* a file name */ + at_stdin, /* read from stdin here */ + at_end /* stop parsing the list */ + } arg_type; /* argument type */ + language *lang; /* language associated with the argument */ + char *what; /* the argument itself */ +} argument; + +#ifdef ETAGS_REGEXPS +/* Structure defining a regular expression. */ +typedef struct regexp +{ + struct regexp *p_next; /* pointer to next in list */ + language *lang; /* if set, use only for this language */ + char *pattern; /* the regexp pattern */ + char *name; /* tag name */ + struct re_pattern_buffer *pat; /* the compiled pattern */ + struct re_registers regs; /* re registers */ + bool error_signaled; /* already signaled for this regexp */ + bool force_explicit_name; /* do not allow implict tag name */ + bool ignore_case; /* ignore case when matching */ + bool multi_line; /* do a multi-line match on the whole file */ +} regexp; +#endif /* ETAGS_REGEXPS */ + + /* Many compilers barf on this: Lang_function Ada_funcs; so let's write it this way */ @@ -280,39 +343,40 @@ static void Cstar_entries __P((FILE *)); static void Erlang_functions __P((FILE *)); static void Fortran_functions __P((FILE *)); -static void Yacc_entries __P((FILE *)); +static void HTML_labels __P((FILE *)); static void Lisp_functions __P((FILE *)); +static void Lua_functions __P((FILE *)); static void Makefile_targets __P((FILE *)); static void Pascal_functions __P((FILE *)); static void Perl_functions __P((FILE *)); static void PHP_functions __P((FILE *)); -static void Postscript_functions __P((FILE *)); +static void PS_functions __P((FILE *)); static void Prolog_functions __P((FILE *)); static void Python_functions __P((FILE *)); static void Scheme_functions __P((FILE *)); static void TeX_commands __P((FILE *)); static void Texinfo_nodes __P((FILE *)); +static void Yacc_entries __P((FILE *)); static void just_read_file __P((FILE *)); static void print_language_names __P((void)); static void print_version __P((void)); -static void print_help __P((void)); +static void print_help __P((argument *)); int main __P((int, char **)); -static int number_len __P((long)); static compressor *get_compressor_from_suffix __P((char *, char **)); static language *get_language_from_langname __P((const char *)); static language *get_language_from_interpreter __P((char *)); -static language *get_language_from_filename __P((char *)); -static int total_size_of_entries __P((node *)); -static long readline __P((linebuffer *, FILE *)); +static language *get_language_from_filename __P((char *, bool)); +static void readline __P((linebuffer *, FILE *)); static long readline_internal __P((linebuffer *, FILE *)); -static void get_tag __P((char *)); +static bool nocase_tail __P((char *)); +static void get_tag __P((char *, char **)); #ifdef ETAGS_REGEXPS -static void analyse_regex __P((char *, bool)); -static void add_regex __P((char *, bool, language *)); -static void free_patterns __P((void)); +static void analyse_regex __P((char *)); +static void free_regexps __P((void)); +static void regex_tag_multiline __P((void)); #endif /* ETAGS_REGEXPS */ static void error __P((const char *, const char *)); static void suggest_asking_for_help __P((void)); @@ -321,14 +385,15 @@ static void add_node __P((node *, node **)); static void init __P((void)); -static void initbuffer __P((linebuffer *)); -static void find_entries __P((char *, FILE *)); +static void process_file_name __P((char *, language *)); +static void process_file __P((FILE *, char *, language *)); +static void find_entries __P((FILE *)); static void free_tree __P((node *)); +static void free_fdesc __P((fdesc *)); static void pfnote __P((char *, bool, char *, int, int, long)); -static void new_pfnote __P((char *, int, bool, char *, int, int, long)); -static void process_file __P((char *)); +static void make_tag __P((char *, int, bool, char *, int, int, long)); +static void invalidate_nodes __P((fdesc *, node **)); static void put_entries __P((node *)); -static void takeprec __P((void)); static char *concat __P((char *, char *, char *)); static char *skip_spaces __P((char *)); @@ -337,44 +402,51 @@ static char *savestr __P((char *)); static char *etags_strchr __P((const char *, int)); static char *etags_strrchr __P((const char *, int)); +static int etags_strcasecmp __P((const char *, const char *)); +static int etags_strncasecmp __P((const char *, const char *, int)); static char *etags_getcwd __P((void)); static char *relative_filename __P((char *, char *)); static char *absolute_filename __P((char *, char *)); static char *absolute_dirname __P((char *, char *)); static bool filename_is_absolute __P((char *f)); static void canonicalize_filename __P((char *)); +static void linebuffer_init __P((linebuffer *)); static void linebuffer_setlen __P((linebuffer *, int)); -PTR xmalloc __P((unsigned int)); -PTR xrealloc __P((char *, unsigned int)); +static PTR xmalloc __P((unsigned int)); +static PTR xrealloc __P((char *, unsigned int)); -char searchar = '/'; /* use /.../ searches */ - -char *tagfile; /* output file */ -char *progname; /* name this program was invoked with */ -char *cwd; /* current working directory */ -char *tagfiledir; /* directory of tagfile */ -FILE *tagf; /* ioptr for tags file */ - -char *curfile; /* current input file name */ -language *curlang; /* current language */ - -int lineno; /* line number of current line */ -long charno; /* current character number */ -long linecharno; /* charno of start of current line */ -char *dbp; /* pointer to start of current tag */ +static char searchar = '/'; /* use /.../ searches */ -node *head; /* the head of the binary tree of tags */ - -linebuffer lb; /* the current line */ +static char *tagfile; /* output file */ +static char *progname; /* name this program was invoked with */ +static char *cwd; /* current working directory */ +static char *tagfiledir; /* directory of tagfile */ +static FILE *tagf; /* ioptr for tags file */ + +static fdesc *fdhead; /* head of file description list */ +static fdesc *curfdp; /* current file description */ +static int lineno; /* line number of current line */ +static long charno; /* current character number */ +static long linecharno; /* charno of start of current line */ +static char *dbp; /* pointer to start of current tag */ + +static const int invalidcharno = -1; + +static node *nodehead; /* the head of the binary tree of tags */ +static node *last_node; /* the last node created */ + +static linebuffer lb; /* the current line */ +static linebuffer filebuf; /* a buffer containing the whole file */ +static linebuffer token_name; /* a buffer containing a tag name */ /* boolean "functions" (see init) */ -bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS]; -char +static bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS]; +static char /* white chars */ *white = " \f\t\n\r\v", /* not in a name */ - *nonam = " \f\t\n\r(=,[;", + *nonam = " \f\t\n\r()=,;", /* look at make_tag before modifying! */ /* token ending chars */ *endtk = " \t\n\r\"'#()[]{}=-+%*/&|^~!<>;,.:?", /* token starting chars */ @@ -382,86 +454,81 @@ /* valid in-token chars */ *midtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789"; -bool append_to_tagfile; /* -a: append to tags */ -/* The following four default to TRUE for etags, but to FALSE for ctags. */ -bool typedefs; /* -t: create tags for C and Ada typedefs */ -bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */ +static bool append_to_tagfile; /* -a: append to tags */ +/* The next four default to TRUE for etags, but to FALSE for ctags. */ +static bool typedefs; /* -t: create tags for C and Ada typedefs */ +static bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */ /* 0 struct/enum/union decls, and C++ */ /* member functions. */ -bool constantypedefs; /* -d: create tags for C #define, enum */ +static bool constantypedefs; /* -d: create tags for C #define, enum */ /* constants and variables. */ /* -D: opposite of -d. Default under ctags. */ -bool declarations; /* --declarations: tag them and extern in C&Co*/ -bool globals; /* create tags for global variables */ -bool members; /* create tags for C member variables */ -bool update; /* -u: update tags */ -bool vgrind_style; /* -v: create vgrind style index output */ -bool no_warnings; /* -w: suppress warnings */ -bool cxref_style; /* -x: create cxref style output */ -bool cplusplus; /* .[hc] means C++, not C */ -bool noindentypedefs; /* -I: ignore indentation in C */ -bool packages_only; /* --packages-only: in Ada, only tag packages*/ +static bool globals; /* create tags for global variables */ +static bool declarations; /* --declarations: tag them and extern in C&Co*/ +static bool members; /* create tags for C member variables */ +static bool no_line_directive; /* ignore #line directives (undocumented) */ +static bool update; /* -u: update tags */ +static bool vgrind_style; /* -v: create vgrind style index output */ +static bool no_warnings; /* -w: suppress warnings */ +static bool cxref_style; /* -x: create cxref style output */ +static bool cplusplus; /* .[hc] means C++, not C */ +static bool ignoreindent; /* -I: ignore indentation in C */ +static bool packages_only; /* --packages-only: in Ada, only tag packages*/ -#ifdef LONG_OPTIONS -struct option longopts[] = +#define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */ +static bool parsing_stdin; /* --parse-stdin used */ + +#ifdef ETAGS_REGEXPS +static regexp *p_head; /* list of all regexps */ +static bool need_filebuf; /* some regexes are multi-line */ +#else +# define need_filebuf FALSE +#endif /* ETAGS_REGEXPS */ + +#if LONG_OPTIONS +static struct option longopts[] = { - { "packages-only", no_argument, &packages_only, TRUE }, - { "append", no_argument, NULL, 'a' }, - { "backward-search", no_argument, NULL, 'B' }, - { "c++", no_argument, NULL, 'C' }, - { "cxref", no_argument, NULL, 'x' }, - { "defines", no_argument, NULL, 'd' }, - { "declarations", no_argument, &declarations, TRUE }, - { "no-defines", no_argument, NULL, 'D' }, - { "globals", no_argument, &globals, TRUE }, - { "no-globals", no_argument, &globals, FALSE }, - { "help", no_argument, NULL, 'h' }, - { "help", no_argument, NULL, 'H' }, - { "ignore-indentation", no_argument, NULL, 'I' }, - { "include", required_argument, NULL, 'i' }, - { "language", required_argument, NULL, 'l' }, - { "members", no_argument, &members, TRUE }, - { "no-members", no_argument, &members, FALSE }, - { "no-warn", no_argument, NULL, 'w' }, - { "output", required_argument, NULL, 'o' }, + { "packages-only", no_argument, &packages_only, TRUE }, + { "c++", no_argument, NULL, 'C' }, + { "declarations", no_argument, &declarations, TRUE }, + { "no-line-directive", no_argument, &no_line_directive, TRUE }, + { "help", no_argument, NULL, 'h' }, + { "help", no_argument, NULL, 'H' }, + { "ignore-indentation", no_argument, NULL, 'I' }, + { "language", required_argument, NULL, 'l' }, + { "members", no_argument, &members, TRUE }, + { "no-members", no_argument, &members, FALSE }, + { "output", required_argument, NULL, 'o' }, #ifdef ETAGS_REGEXPS - { "regex", required_argument, NULL, 'r' }, - { "no-regex", no_argument, NULL, 'R' }, - { "ignore-case-regex", required_argument, NULL, 'c' }, + { "regex", required_argument, NULL, 'r' }, + { "no-regex", no_argument, NULL, 'R' }, + { "ignore-case-regex", required_argument, NULL, 'c' }, #endif /* ETAGS_REGEXPS */ - { "typedefs", no_argument, NULL, 't' }, - { "typedefs-and-c++", no_argument, NULL, 'T' }, - { "update", no_argument, NULL, 'u' }, - { "version", no_argument, NULL, 'V' }, - { "vgrind", no_argument, NULL, 'v' }, + { "parse-stdin", required_argument, NULL, STDIN }, + { "version", no_argument, NULL, 'V' }, + +#if CTAGS /* Etags options */ + { "backward-search", no_argument, NULL, 'B' }, + { "cxref", no_argument, NULL, 'x' }, + { "defines", no_argument, NULL, 'd' }, + { "globals", no_argument, &globals, TRUE }, + { "typedefs", no_argument, NULL, 't' }, + { "typedefs-and-c++", no_argument, NULL, 'T' }, + { "update", no_argument, NULL, 'u' }, + { "vgrind", no_argument, NULL, 'v' }, + { "no-warn", no_argument, NULL, 'w' }, + +#else /* Ctags options */ + { "append", no_argument, NULL, 'a' }, + { "no-defines", no_argument, NULL, 'D' }, + { "no-globals", no_argument, &globals, FALSE }, + { "include", required_argument, NULL, 'i' }, +#endif { NULL } }; #endif /* LONG_OPTIONS */ -#ifdef ETAGS_REGEXPS -/* Structure defining a regular expression. Elements are - the compiled pattern, and the name string. */ -typedef struct pattern -{ - struct pattern *p_next; - language *lang; - char *regex; - struct re_pattern_buffer *pat; - struct re_registers regs; - char *name_pattern; - bool error_signaled; -} pattern; - -/* List of all regexps. */ -pattern *p_head = NULL; - -/* How many characters in the character set. (From regex.c.) */ -#define CHAR_SET_SIZE 256 -/* Translation table for case-insensitive matching. */ -char lc_trans[CHAR_SET_SIZE]; -#endif /* ETAGS_REGEXPS */ - -compressor compressors[] = +static compressor compressors[] = { { "z", "gzip -d -c"}, { "Z", "gzip -d -c"}, @@ -475,96 +542,224 @@ * Language stuff. */ -/* Non-NULL if language fixed. */ -language *forced_lang = NULL; - /* Ada code */ -char *Ada_suffixes [] = +static char *Ada_suffixes [] = { "ads", "adb", "ada", NULL }; +static char Ada_help [] = +"In Ada code, functions, procedures, packages, tasks and types are\n\ +tags. Use the `--packages-only' option to create tags for\n\ +packages only.\n\ +Ada tag names have suffixes indicating the type of entity:\n\ + Entity type: Qualifier:\n\ + ------------ ----------\n\ + function /f\n\ + procedure /p\n\ + package spec /s\n\ + package body /b\n\ + type /t\n\ + task /k\n\ +Thus, `M-x find-tag bidule/b ' will go directly to the\n\ +body of the package `bidule', while `M-x find-tag bidule '\n\ +will just search for any tag `bidule'."; /* Assembly code */ -char *Asm_suffixes [] = { "a", /* Unix assembler */ - "asm", /* Microcontroller assembly */ - "def", /* BSO/Tasking definition includes */ - "inc", /* Microcontroller include files */ - "ins", /* Microcontroller include files */ - "s", "sa", /* Unix assembler */ - "S", /* cpp-processed Unix assembler */ - "src", /* BSO/Tasking C compiler output */ - NULL - }; +static char *Asm_suffixes [] = + { "a", /* Unix assembler */ + "asm", /* Microcontroller assembly */ + "def", /* BSO/Tasking definition includes */ + "inc", /* Microcontroller include files */ + "ins", /* Microcontroller include files */ + "s", "sa", /* Unix assembler */ + "S", /* cpp-processed Unix assembler */ + "src", /* BSO/Tasking C compiler output */ + NULL + }; +static char Asm_help [] = +"In assembler code, labels appearing at the beginning of a line,\n\ +followed by a colon, are tags."; + /* Note that .c and .h can be considered C++, if the --c++ flag was - given, or if the `class' keyowrd is met inside the file. + given, or if the `class' or `template' keyowrds are met inside the file. That is why default_C_entries is called for these. */ -char *default_C_suffixes [] = +static char *default_C_suffixes [] = { "c", "h", NULL }; +static char default_C_help [] = +"In C code, any C function or typedef is a tag, and so are\n\ +definitions of `struct', `union' and `enum'. `#define' macro\n\ +definitions and `enum' constants are tags unless you specify\n\ +`--no-defines'. Global variables are tags unless you specify\n\ +`--no-globals'. Use of `--no-globals' and `--no-defines'\n\ +can make the tags table file much smaller.\n\ +You can tag function declarations and external variables by\n\ +using `--declarations', and struct members by using `--members'."; -char *Cplusplus_suffixes [] = +static char *Cplusplus_suffixes [] = { "C", "c++", "cc", "cpp", "cxx", "H", "h++", "hh", "hpp", "hxx", "M", /* Objective C++ */ "pdb", /* Postscript with C syntax */ NULL }; +static char Cplusplus_help [] = +"In C++ code, all the tag constructs of C code are tagged. (Use\n\ +--help --lang=c --lang=c++ for full help.)\n\ +In addition to C tags, member functions are also recognized, and\n\ +optionally member variables if you use the `--members' option.\n\ +Tags for variables and functions in classes are named `CLASS::VARIABLE'\n\ +and `CLASS::FUNCTION'. `operator' definitions have tag names like\n\ +`operator+'."; -char *Cjava_suffixes [] = +static char *Cjava_suffixes [] = { "java", NULL }; +static char Cjava_help [] = +"In Java code, all the tags constructs of C and C++ code are\n\ +tagged. (Use --help --lang=c --lang=c++ --lang=java for full help.)"; -char *Cobol_suffixes [] = + +static char *Cobol_suffixes [] = { "COB", "cob", NULL }; +static char Cobol_help [] = +"In Cobol code, tags are paragraph names; that is, any word\n\ +starting in column 8 and followed by a period."; -char *Cstar_suffixes [] = +static char *Cstar_suffixes [] = { "cs", "hs", NULL }; -char *Erlang_suffixes [] = +static char *Erlang_suffixes [] = { "erl", "hrl", NULL }; +static char Erlang_help [] = +"In Erlang code, the tags are the functions, records and macros\n\ +defined in the file."; -char *Fortran_suffixes [] = +static char *Fortran_suffixes [] = { "F", "f", "f90", "for", NULL }; +static char Fortran_help [] = +"In Fortran code, functions, subroutines and block data are tags."; + +static char *HTML_suffixes [] = + { "htm", "html", "shtml", NULL }; +static char HTML_help [] = +"In HTML input files, the tags are the `title' and the `h1', `h2',\n\ +`h3' headers. Also, tags are `name=' in anchors and all\n\ +occurrences of `id='."; -char *Lisp_suffixes [] = +static char *Lisp_suffixes [] = { "cl", "clisp", "el", "l", "lisp", "LSP", "lsp", "ml", NULL }; +static char Lisp_help [] = +"In Lisp code, any function defined with `defun', any variable\n\ +defined with `defvar' or `defconst', and in general the first\n\ +argument of any expression that starts with `(def' in column zero\n\ +is a tag."; + +static char *Lua_suffixes [] = + { "lua", "LUA", NULL }; +static char Lua_help [] = +"In Lua scripts, all functions are tags."; -char *Makefile_filenames [] = +static char *Makefile_filenames [] = { "Makefile", "makefile", "GNUMakefile", "Makefile.in", "Makefile.am", NULL}; +static char Makefile_help [] = +"In makefiles, targets are tags; additionally, variables are tags\n\ +unless you specify `--no-globals'."; + +static char *Objc_suffixes [] = + { "lm", /* Objective lex file */ + "m", /* Objective C file */ + NULL }; +static char Objc_help [] = +"In Objective C code, tags include Objective C definitions for classes,\n\ +class categories, methods and protocols. Tags for variables and\n\ +functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'."; -char *Pascal_suffixes [] = +static char *Pascal_suffixes [] = { "p", "pas", NULL }; +static char Pascal_help [] = +"In Pascal code, the tags are the functions and procedures defined\n\ +in the file."; -char *Perl_suffixes [] = +static char *Perl_suffixes [] = { "pl", "pm", NULL }; -char *Perl_interpreters [] = +static char *Perl_interpreters [] = { "perl", "@PERL@", NULL }; +static char Perl_help [] = +"In Perl code, the tags are the packages, subroutines and variables\n\ +defined by the `package', `sub', `my' and `local' keywords. Use\n\ +`--globals' if you want to tag global variables. Tags for\n\ +subroutines are named `PACKAGE::SUB'. The name for subroutines\n\ +defined in the default package is `main::SUB'."; -char *PHP_suffixes [] = +static char *PHP_suffixes [] = { "php", "php3", "php4", NULL }; +static char PHP_help [] = +"In PHP code, tags are functions, classes and defines. When using\n\ +the `--members' option, vars are tags too."; -char *plain_C_suffixes [] = - { "lm", /* Objective lex file */ - "m", /* Objective C file */ - "pc", /* Pro*C file */ +static char *plain_C_suffixes [] = + { "pc", /* Pro*C file */ NULL }; -char *Postscript_suffixes [] = +static char *PS_suffixes [] = { "ps", "psw", NULL }; /* .psw is for PSWrap */ +static char PS_help [] = +"In PostScript code, the tags are the functions."; -char *Prolog_suffixes [] = +static char *Prolog_suffixes [] = { "prolog", NULL }; +static char Prolog_help [] = +"In Prolog code, tags are predicates and rules at the beginning of\n\ +line."; -char *Python_suffixes [] = +static char *Python_suffixes [] = { "py", NULL }; +static char Python_help [] = +"In Python code, `def' or `class' at the beginning of a line\n\ +generate a tag."; /* Can't do the `SCM' or `scm' prefix with a version number. */ -char *Scheme_suffixes [] = +static char *Scheme_suffixes [] = { "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL }; +static char Scheme_help [] = +"In Scheme code, tags include anything defined with `def' or with a\n\ +construct whose name starts with `def'. They also include\n\ +variables set with `set!' at top level in the file."; -char *TeX_suffixes [] = +static char *TeX_suffixes [] = { "bib", "clo", "cls", "ltx", "sty", "TeX", "tex", NULL }; +static char TeX_help [] = +"In LaTeX text, the argument of any of the commands `\\chapter',\n\ +`\\section', `\\subsection', `\\subsubsection', `\\eqno', `\\label',\n\ +`\\ref', `\\cite', `\\bibitem', `\\part', `\\appendix', `\\entry',\n\ +`\\index', `\\def', `\\newcommand', `\\renewcommand',\n\ +`\\newenvironment' or `\\renewenvironment' is a tag.\n\ +\n\ +Other commands can be specified by setting the environment variable\n\ +`TEXTAGS' to a colon-separated list like, for example,\n\ + TEXTAGS=\"mycommand:myothercommand\"."; + -char *Texinfo_suffixes [] = +static char *Texinfo_suffixes [] = { "texi", "texinfo", "txi", NULL }; +static char Texinfo_help [] = +"for texinfo files, lines starting with @node are tagged."; -char *Yacc_suffixes [] = +static char *Yacc_suffixes [] = { "y", "y++", "ym", "yxx", "yy", NULL }; /* .ym is Objective yacc file */ +static char Yacc_help [] = +"In Bison or Yacc input files, each rule defines as a tag the\n\ +nonterminal it constructs. The portions of the file that contain\n\ +C code are parsed as C code (use --help --lang=c --lang=yacc\n\ +for full help)."; + +static char auto_help [] = +"`auto' is not a real language, it indicates to use\n\ +a default language for files base on file name suffix and file contents."; + +static char none_help [] = +"`none' is not a real language, it indicates to only do\n\ +regexp processing on files."; + +static char no_lang_help [] = +"No detailed help available for this language."; + /* * Table of languages. @@ -573,33 +768,36 @@ * name. I just didn't. */ -language lang_names [] = +static language lang_names [] = { - { "ada", Ada_funcs, NULL, Ada_suffixes, NULL }, - { "asm", Asm_labels, NULL, Asm_suffixes, NULL }, - { "c", default_C_entries, NULL, default_C_suffixes, NULL }, - { "c++", Cplusplus_entries, NULL, Cplusplus_suffixes, NULL }, - { "c*", Cstar_entries, NULL, Cstar_suffixes, NULL }, - { "cobol", Cobol_paragraphs, NULL, Cobol_suffixes, NULL }, - { "erlang", Erlang_functions, NULL, Erlang_suffixes, NULL }, - { "fortran", Fortran_functions, NULL, Fortran_suffixes, NULL }, - { "java", Cjava_entries, NULL, Cjava_suffixes, NULL }, - { "lisp", Lisp_functions, NULL, Lisp_suffixes, NULL }, - { "makefile", Makefile_targets, Makefile_filenames, NULL, NULL }, - { "pascal", Pascal_functions, NULL, Pascal_suffixes, NULL }, - { "perl", Perl_functions, NULL, Perl_suffixes, Perl_interpreters }, - { "php", PHP_functions, NULL, PHP_suffixes, NULL }, - { "postscript", Postscript_functions, NULL, Postscript_suffixes, NULL }, - { "proc", plain_C_entries, NULL, plain_C_suffixes, NULL }, - { "prolog", Prolog_functions, NULL, Prolog_suffixes, NULL }, - { "python", Python_functions, NULL, Python_suffixes, NULL }, - { "scheme", Scheme_functions, NULL, Scheme_suffixes, NULL }, - { "tex", TeX_commands, NULL, TeX_suffixes, NULL }, - { "texinfo", Texinfo_nodes, NULL, Texinfo_suffixes, NULL }, - { "yacc", Yacc_entries, NULL, Yacc_suffixes, NULL }, - { "auto", NULL }, /* default guessing scheme */ - { "none", just_read_file }, /* regexp matching only */ - { NULL, NULL } /* end of list */ + { "ada", Ada_help, Ada_funcs, Ada_suffixes }, + { "asm", Asm_help, Asm_labels, Asm_suffixes }, + { "c", default_C_help, default_C_entries, default_C_suffixes }, + { "c++", Cplusplus_help, Cplusplus_entries, Cplusplus_suffixes }, + { "c*", no_lang_help, Cstar_entries, Cstar_suffixes }, + { "cobol", Cobol_help, Cobol_paragraphs, Cobol_suffixes }, + { "erlang", Erlang_help, Erlang_functions, Erlang_suffixes }, + { "fortran", Fortran_help, Fortran_functions, Fortran_suffixes }, + { "html", HTML_help, HTML_labels, HTML_suffixes }, + { "java", Cjava_help, Cjava_entries, Cjava_suffixes }, + { "lisp", Lisp_help, Lisp_functions, Lisp_suffixes }, + { "lua", Lua_help, Lua_functions, Lua_suffixes }, + { "makefile", Makefile_help,Makefile_targets,NULL,Makefile_filenames}, + { "objc", Objc_help, plain_C_entries, Objc_suffixes }, + { "pascal", Pascal_help, Pascal_functions, Pascal_suffixes }, + { "perl",Perl_help,Perl_functions,Perl_suffixes,NULL,Perl_interpreters}, + { "php", PHP_help, PHP_functions, PHP_suffixes }, + { "postscript",PS_help, PS_functions, PS_suffixes }, + { "proc", no_lang_help, plain_C_entries, plain_C_suffixes }, + { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes }, + { "python", Python_help, Python_functions, Python_suffixes }, + { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, + { "tex", TeX_help, TeX_commands, TeX_suffixes }, + { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, + { "yacc", Yacc_help,Yacc_entries,Yacc_suffixes,NULL,NULL,TRUE}, + { "auto", auto_help }, /* default guessing scheme */ + { "none", none_help, just_read_file }, /* regexp matching only */ + { NULL } /* end of list */ }; @@ -622,55 +820,72 @@ printf (" .%s", *ext); puts (""); } - puts ("Where `auto' means use default language for files based on file\n\ + puts ("where `auto' means use default language for files based on file\n\ name suffix, and `none' means only do regexp processing on files.\n\ If no language is specified and no matching suffix is found,\n\ the first line of the file is read for a sharp-bang (#!) sequence\n\ followed by the name of an interpreter. If no such sequence is found,\n\ Fortran is tried first; if no tags are found, C is tried next.\n\ -When parsing any C file, a \"class\" keyword switches to C++.\n\ -Compressed files are supported using gzip and bzip2."); +When parsing any C file, a \"class\" or \"template\" keyword\n\ +switches to C++."); + puts ("Compressed files are supported using gzip and bzip2.\n\ +\n\ +For detailed help on a given language use, for example,\n\ +etags --help --lang=ada."); } #ifndef EMACS_NAME -# define EMACS_NAME "GNU Emacs" +# define EMACS_NAME "standalone" #endif #ifndef VERSION -# define VERSION "21" +# define VERSION "version" #endif static void print_version () { printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); - puts ("Copyright (C) 1999 Free Software Foundation, Inc. and Ken Arnold"); + puts ("Copyright (C) 2002 Free Software Foundation, Inc. and Ken Arnold"); puts ("This program is distributed under the same terms as Emacs"); - exit (GOOD); + exit (EXIT_SUCCESS); } static void -print_help () +print_help (argbuffer) + argument *argbuffer; { + bool help_for_lang = FALSE; + + for (; argbuffer->arg_type != at_end; argbuffer++) + if (argbuffer->arg_type == at_language) + { + if (help_for_lang) + puts (""); + puts (argbuffer->lang->help); + help_for_lang = TRUE; + } + + if (help_for_lang) + exit (EXIT_SUCCESS); + printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ \n\ These are the options accepted by %s.\n", progname, progname); -#ifdef LONG_OPTIONS - puts ("You may use unambiguous abbreviations for the long option names."); -#else - puts ("Long option names do not work with this executable, as it is not\n\ + if (LONG_OPTIONS) + puts ("You may use unambiguous abbreviations for the long option names."); + else + puts ("Long option names do not work with this executable, as it is not\n\ linked with GNU getopt."); -#endif /* LONG_OPTIONS */ - puts ("A - as file name means read names from stdin (one per line)."); - if (!CTAGS) - printf (" Absolute names are stored in the output file as they are.\n\ -Relative ones are stored relative to the output file's directory."); - puts ("\n"); + puts (" A - as file name means read names from stdin (one per line).\n\ +Absolute names are stored in the output file as they are.\n\ +Relative ones are stored relative to the output file's directory.\n"); - puts ("-a, --append\n\ + if (!CTAGS) + puts ("-a, --append\n\ Append tag entries to existing tags file."); puts ("--packages-only\n\ - For Ada files, only generate tags for packages ."); + For Ada files, only generate tags for packages."); if (CTAGS) puts ("-B, --backward-search\n\ @@ -680,7 +895,7 @@ /* This option is mostly obsolete, because etags can now automatically detect C++. Retained for backward compatibility and for debugging and experimentation. In principle, we could want to tag as C++ even - before any "class" keyword. + before any "class" or "template" keyword. puts ("-C, --c++\n\ Treat files whose name suffix defaults to C language as C++ files."); */ @@ -702,15 +917,14 @@ This makes the tags file smaller."); if (!CTAGS) - { - puts ("-i FILE, --include=FILE\n\ + puts ("-i FILE, --include=FILE\n\ Include a note in tag file indicating that, when searching for\n\ a tag, one should also consult the tags file FILE after\n\ checking the current file."); - puts ("-l LANG, --language=LANG\n\ + + puts ("-l LANG, --language=LANG\n\ Force the following files to be considered as written in the\n\ named language up to the next --language=LANG option."); - } if (CTAGS) puts ("--globals\n\ @@ -720,29 +934,31 @@ Do not create tag entries for global variables in some\n\ languages. This makes the tags file smaller."); puts ("--members\n\ - Create tag entries for member variables in C and derived languages."); + Create tag entries for members of structures in some languages."); #ifdef ETAGS_REGEXPS - puts ("-r /REGEXP/, --regex=/REGEXP/ or --regex=@regexfile\n\ - Make a tag for each line matching pattern REGEXP in the following\n\ - files. {LANGUAGE}/REGEXP/ uses REGEXP for LANGUAGE files only.\n\ - regexfile is a file containing one REGEXP per line.\n\ - REGEXP is anchored (as if preceded by ^).\n\ - The form /REGEXP/NAME/ creates a named tag.\n\ + puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ + Make a tag for each line matching a regular expression pattern\n\ + in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ + files only. REGEXFILE is a file containing one REGEXP per line.\n\ + REGEXP takes the form /TAGREGEXP/TAGNAME/MODS, where TAGNAME/ is\n\ + optional. The TAGREGEXP pattern is anchored (as if preceded by ^)."); + puts (" If TAGNAME/ is present, the tags created are named.\n\ For example Tcl named tags can be created with:\n\ - --regex=\"/proc[ \\t]+\\([^ \\t]+\\)/\\1/.\""); - puts ("-c /REGEXP/, --ignore-case-regex=/REGEXP/ or --ignore-case-regex=@regexfile\n\ - Like -r, --regex but ignore case when matching expressions."); + --regex=\"/proc[ \\t]+\\([^ \\t]+\\)/\\1/.\".\n\ + MODS are optional one-letter modifiers: `i' means to ignore case,\n\ + `m' means to allow multi-line matches, `s' implies `m' and\n\ + causes dot to match any character, including newline."); puts ("-R, --no-regex\n\ Don't create tags from regexps for the following files."); #endif /* ETAGS_REGEXPS */ + puts ("-I, --ignore-indentation\n\ + In C and C++ do not assume that a closing brace in the first\n\ + column is the final brace of a function or structure definition."); puts ("-o FILE, --output=FILE\n\ Write the tags to FILE."); - puts ("-I, --ignore-indentation\n\ - Don't rely on indentation quite as much as normal. Currently,\n\ - this means not to assume that a closing brace in the first\n\ - column is the final brace of a function or structure\n\ - definition in C and C++."); + puts ("--parse-stdin=NAME\n\ + Read from standard input and record tags as belonging to file NAME."); if (CTAGS) { @@ -751,13 +967,19 @@ puts ("-T, --typedefs-and-c++\n\ Generate tag entries for C typedefs, C struct/enum/union tags,\n\ and C++ member functions."); - puts ("-u, --update\n\ + } + + if (CTAGS) + puts ("-u, --update\n\ Update the tag entries for the given files, leaving tag\n\ entries for other files in place. Currently, this is\n\ implemented by deleting the existing entries for the given\n\ files and then rewriting the new entries at the end of the\n\ tags file. It is often faster to simply rebuild the entire\n\ tag file than to use this."); + + if (CTAGS) + { puts ("-v, --vgrind\n\ Generates an index of items intended for human consumption,\n\ similar to the output of vgrind. The index is sorted, and\n\ @@ -775,33 +997,19 @@ puts ("-V, --version\n\ Print the version of the program.\n\ -h, --help\n\ - Print this help message."); + Print this help message.\n\ + Followed by one or more `--language' options prints detailed\n\ + help about tag generation for the specified languages."); print_language_names (); puts (""); puts ("Report bugs to bug-gnu-emacs@gnu.org"); - exit (GOOD); + exit (EXIT_SUCCESS); } -enum argument_type -{ - at_language, - at_regexp, - at_filename, - at_icregexp -}; - -/* This structure helps us allow mixing of --lang and file names. */ -typedef struct -{ - enum argument_type arg_type; - char *what; - language *lang; /* language of the regexp */ -} argument; - #ifdef VMS /* VMS specific functions */ #define EOS '\0' @@ -935,13 +1143,16 @@ int i; unsigned int nincluded_files; char **included_files; - char *this_file; argument *argbuffer; int current_arg, file_count; linebuffer filename_lb; + bool help_asked = FALSE; #ifdef VMS bool got_err; #endif + char *optstring; + int opt; + #ifdef DOS_NT _fmode = O_BINARY; /* all of files are treated as binary files */ @@ -957,14 +1168,6 @@ is small. */ argbuffer = xnew (argc, argument); -#ifdef ETAGS_REGEXPS - /* Set syntax for regular expression routines. */ - re_set_syntax (RE_SYNTAX_EMACS | RE_INTERVALS); - /* Translation table for case-insensitive search. */ - for (i = 0; i < CHAR_SET_SIZE; i++) - lc_trans[i] = lowcase (i); -#endif /* ETAGS_REGEXPS */ - /* * If etags, always find typedefs and structure tags. Why not? * Also default to find macro constants, enum constants and @@ -974,122 +1177,114 @@ { typedefs = typedefs_or_cplusplus = constantypedefs = TRUE; globals = TRUE; - declarations = FALSE; - members = FALSE; } - while (1) - { - int opt; - char *optstring; - + optstring = "-"; #ifdef ETAGS_REGEXPS - optstring = "-aCdDf:Il:o:r:c:RStTi:BuvxwVhH"; -#else - optstring = "-aCdDf:Il:o:StTi:BuvxwVhH"; + optstring = "-r:Rc:"; #endif /* ETAGS_REGEXPS */ + if (LONG_OPTIONS) + optstring += 1; + optstring = concat (optstring, + "Cf:Il:o:SVhH", + (CTAGS) ? "BxdtTuvw" : "aDi:"); -#ifndef LONG_OPTIONS - optstring = optstring + 1; -#endif /* LONG_OPTIONS */ - - opt = getopt_long (argc, argv, optstring, longopts, 0); - if (opt == EOF) + while ((opt = getopt_long (argc, argv, optstring, longopts, 0)) != EOF) + switch (opt) + { + case 0: + /* If getopt returns 0, then it has already processed a + long-named option. We should do nothing. */ break; - switch (opt) - { - case 0: - /* If getopt returns 0, then it has already processed a - long-named option. We should do nothing. */ - break; + case 1: + /* This means that a file name has been seen. Record it. */ + argbuffer[current_arg].arg_type = at_filename; + argbuffer[current_arg].what = optarg; + ++current_arg; + ++file_count; + break; - case 1: - /* This means that a file name has been seen. Record it. */ - argbuffer[current_arg].arg_type = at_filename; - argbuffer[current_arg].what = optarg; - ++current_arg; - ++file_count; - break; + case STDIN: + /* Parse standard input. Idea by Vivek . */ + argbuffer[current_arg].arg_type = at_stdin; + argbuffer[current_arg].what = optarg; + ++current_arg; + ++file_count; + if (parsing_stdin) + fatal ("cannot parse standard input more than once", (char *)NULL); + parsing_stdin = TRUE; + break; - /* Common options. */ - case 'a': append_to_tagfile = TRUE; break; - case 'C': cplusplus = TRUE; break; - case 'd': constantypedefs = TRUE; break; - case 'D': constantypedefs = FALSE; break; - case 'f': /* for compatibility with old makefiles */ - case 'o': - if (tagfile) - { - error ("-o option may only be given once.", (char *)NULL); - suggest_asking_for_help (); - } - tagfile = optarg; - break; - case 'I': - case 'S': /* for backward compatibility */ - noindentypedefs = TRUE; - break; - case 'l': + /* Common options. */ + case 'C': cplusplus = TRUE; break; + case 'f': /* for compatibility with old makefiles */ + case 'o': + if (tagfile) { - language *lang = get_language_from_langname (optarg); - if (lang != NULL) - { - argbuffer[current_arg].lang = lang; - argbuffer[current_arg].arg_type = at_language; - ++current_arg; - } + error ("-o option may only be given once.", (char *)NULL); + suggest_asking_for_help (); + /* NOTREACHED */ } - break; -#ifdef ETAGS_REGEXPS - case 'r': - argbuffer[current_arg].arg_type = at_regexp; - argbuffer[current_arg].what = optarg; - ++current_arg; - break; - case 'R': - argbuffer[current_arg].arg_type = at_regexp; - argbuffer[current_arg].what = NULL; - ++current_arg; - break; - case 'c': - argbuffer[current_arg].arg_type = at_icregexp; - argbuffer[current_arg].what = optarg; - ++current_arg; - break; -#endif /* ETAGS_REGEXPS */ - case 'V': - print_version (); - break; - case 'h': - case 'H': - print_help (); - break; - case 't': - typedefs = TRUE; - break; - case 'T': - typedefs = typedefs_or_cplusplus = TRUE; - break; -#if (!CTAGS) - /* Etags options */ - case 'i': - included_files[nincluded_files++] = optarg; - break; -#else /* CTAGS */ - /* Ctags options. */ - case 'B': searchar = '?'; break; - case 'u': update = TRUE; break; - case 'v': vgrind_style = TRUE; /*FALLTHRU*/ - case 'x': cxref_style = TRUE; break; - case 'w': no_warnings = TRUE; break; -#endif /* CTAGS */ - default: - suggest_asking_for_help (); + tagfile = optarg; + break; + case 'I': + case 'S': /* for backward compatibility */ + ignoreindent = TRUE; + break; + case 'l': + { + language *lang = get_language_from_langname (optarg); + if (lang != NULL) + { + argbuffer[current_arg].lang = lang; + argbuffer[current_arg].arg_type = at_language; + ++current_arg; + } } - } + break; + case 'c': + /* Backward compatibility: support obsolete --ignore-case-regexp. */ + optarg = concat (optarg, "i", ""); /* memory leak here */ + /* FALLTHRU */ + case 'r': + argbuffer[current_arg].arg_type = at_regexp; + argbuffer[current_arg].what = optarg; + ++current_arg; + break; + case 'R': + argbuffer[current_arg].arg_type = at_regexp; + argbuffer[current_arg].what = NULL; + ++current_arg; + break; + case 'V': + print_version (); + break; + case 'h': + case 'H': + help_asked = TRUE; + break; + + /* Etags options */ + case 'a': append_to_tagfile = TRUE; break; + case 'D': constantypedefs = FALSE; break; + case 'i': included_files[nincluded_files++] = optarg; break; + + /* Ctags options. */ + case 'B': searchar = '?'; break; + case 'd': constantypedefs = TRUE; break; + case 't': typedefs = TRUE; break; + case 'T': typedefs = typedefs_or_cplusplus = TRUE; break; + case 'u': update = TRUE; break; + case 'v': vgrind_style = TRUE; /*FALLTHRU*/ + case 'x': cxref_style = TRUE; break; + case 'w': no_warnings = TRUE; break; + default: + suggest_asking_for_help (); + /* NOTREACHED */ + } - for (; optind < argc; ++optind) + for (; optind < argc; optind++) { argbuffer[current_arg].arg_type = at_filename; argbuffer[current_arg].what = argv[optind]; @@ -1097,10 +1292,17 @@ ++file_count; } + argbuffer[current_arg].arg_type = at_end; + + if (help_asked) + print_help (argbuffer); + /* NOTREACHED */ + if (nincluded_files == 0 && file_count == 0) { error ("no input files specified.", (char *)NULL); suggest_asking_for_help (); + /* NOTREACHED */ } if (tagfile == NULL) @@ -1112,15 +1314,19 @@ cwd = concat (oldcwd, "/", ""); free (oldcwd); } - if (streq (tagfile, "-")) + /* Relative file names are made relative to the current directory. */ + if (streq (tagfile, "-") + || strneq (tagfile, "/dev/", 5)) tagfiledir = cwd; else tagfiledir = absolute_dirname (tagfile, cwd); init (); /* set up boolean "functions" */ - initbuffer (&lb); - initbuffer (&filename_lb); + linebuffer_init (&lb); + linebuffer_init (&filename_lb); + linebuffer_init (&filebuf); + linebuffer_init (&token_name); if (!CTAGS) { @@ -1143,19 +1349,19 @@ /* * Loop through files finding functions. */ - for (i = 0; i < current_arg; ++i) + for (i = 0; i < current_arg; i++) { + static language *lang; /* non-NULL if language is forced */ + char *this_file; + switch (argbuffer[i].arg_type) { case at_language: - forced_lang = argbuffer[i].lang; + lang = argbuffer[i].lang; break; #ifdef ETAGS_REGEXPS case at_regexp: - analyse_regex (argbuffer[i].what, FALSE); - break; - case at_icregexp: - analyse_regex (argbuffer[i].what, TRUE); + analyse_regex (argbuffer[i].what); break; #endif case at_filename: @@ -1177,38 +1383,54 @@ /* Input file named "-" means read file names from stdin (one per line) and use them. */ if (streq (this_file, "-")) - while (readline_internal (&filename_lb, stdin) > 0) - process_file (filename_lb.buffer); + { + if (parsing_stdin) + fatal ("cannot parse standard input AND read file names from it", + (char *)NULL); + while (readline_internal (&filename_lb, stdin) > 0) + process_file_name (filename_lb.buffer, lang); + } else - process_file (this_file); + process_file_name (this_file, lang); #ifdef VMS } #endif break; + case at_stdin: + this_file = argbuffer[i].what; + process_file (stdin, this_file, lang); + break; } } #ifdef ETAGS_REGEXPS - free_patterns (); + free_regexps (); #endif /* ETAGS_REGEXPS */ + free (lb.buffer); + free (filebuf.buffer); + free (token_name.buffer); - if (!CTAGS) + if (!CTAGS || cxref_style) { - while (nincluded_files-- > 0) - fprintf (tagf, "\f\n%s,include\n", *included_files++); + put_entries (nodehead); /* write the remainig tags (ETAGS) */ + free_tree (nodehead); + nodehead = NULL; + if (!CTAGS) + { + fdesc *fdp; - fclose (tagf); - exit (GOOD); - } + /* Output file entries that have no tags. */ + for (fdp = fdhead; fdp != NULL; fdp = fdp->next) + if (!fdp->written) + fprintf (tagf, "\f\n%s,0\n", fdp->taggedfname); - /* If CTAGS, we are here. process_file did not write the tags yet, - because we want them ordered. Let's do it now. */ - if (cxref_style) - { - put_entries (head); - free_tree (head); - head = NULL; - exit (GOOD); + while (nincluded_files-- > 0) + fprintf (tagf, "\f\n%s,include\n", *included_files++); + } + + if (fclose (tagf) == EOF) + pfatal (tagfile); + exit (EXIT_SUCCESS); } if (update) @@ -1216,12 +1438,18 @@ char cmd[BUFSIZ]; for (i = 0; i < current_arg; ++i) { - if (argbuffer[i].arg_type != at_filename) - continue; + switch (argbuffer[i].arg_type) + { + case at_filename: + case at_stdin: + break; + default: + continue; /* the for loop */ + } sprintf (cmd, "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS", tagfile, argbuffer[i].what, tagfile); - if (system (cmd) != GOOD) + if (system (cmd) != EXIT_SUCCESS) fatal ("failed to execute shell command", (char *)NULL); } append_to_tagfile = TRUE; @@ -1230,22 +1458,22 @@ tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); if (tagf == NULL) pfatal (tagfile); - put_entries (head); - free_tree (head); - head = NULL; - fclose (tagf); + put_entries (nodehead); /* write all the tags (CTAGS) */ + free_tree (nodehead); + nodehead = NULL; + if (fclose (tagf) == EOF) + pfatal (tagfile); if (update) { - char cmd[BUFSIZ]; - sprintf (cmd, "sort %s -o %s", tagfile, tagfile); + char cmd[2*BUFSIZ+10]; + sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile); exit (system (cmd)); } - return GOOD; + return EXIT_SUCCESS; } - /* * Return a compressor given the file name. If EXTPTR is non-zero, * return a pointer into FILE where the compressor-specific @@ -1338,8 +1566,9 @@ * Return a language given the file name. */ static language * -get_language_from_filename (file) +get_language_from_filename (file, case_sensitive) char *file; + bool case_sensitive; { language *lang; char **name, **ext, *suffix; @@ -1348,7 +1577,9 @@ for (lang = lang_names; lang->name != NULL; lang++) if (lang->filenames != NULL) for (name = lang->filenames; *name != NULL; name++) - if (streq (*name, file)) + if ((case_sensitive) + ? streq (*name, file) + : strcaseeq (*name, file)) return lang; /* If not found, try suffix after last dot. */ @@ -1359,26 +1590,29 @@ for (lang = lang_names; lang->name != NULL; lang++) if (lang->suffixes != NULL) for (ext = lang->suffixes; *ext != NULL; ext++) - if (streq (*ext, suffix)) + if ((case_sensitive) + ? streq (*ext, suffix) + : strcaseeq (*ext, suffix)) return lang; return NULL; } - - + /* * This routine is called on each file argument. */ static void -process_file (file) +process_file_name (file, lang) char *file; + language *lang; { struct stat stat_buf; FILE *inf; + fdesc *fdp; compressor *compr; char *compressed_name, *uncompressed_name; char *ext, *real_name; - + int retval; canonicalize_filename (file); if (streq (file, tagfile) && !streq (tagfile, "-")) @@ -1397,25 +1631,14 @@ uncompressed_name = savenstr (file, ext - file); } - /* If the canonicalised uncompressed name has already be dealt with, - skip it silently, else add it to the list. */ - { - typedef struct processed_file - { - char *filename; - struct processed_file *next; - } processed_file; - static processed_file *pf_head = NULL; - register processed_file *fnp; - - for (fnp = pf_head; fnp != NULL; fnp = fnp->next) - if (streq (uncompressed_name, fnp->filename)) - goto exit; - fnp = pf_head; - pf_head = xnew (1, struct processed_file); - pf_head->filename = savestr (uncompressed_name); - pf_head->next = fnp; - } + /* If the canonicalized uncompressed name + has already been dealt with, skip it silently. */ + for (fdp = fdhead; fdp != NULL; fdp = fdp->next) + { + assert (fdp->infname != NULL); + if (streq (uncompressed_name, fdp->infname)) + goto cleanup; + } if (stat (real_name, &stat_buf) != 0) { @@ -1462,14 +1685,14 @@ if (real_name == NULL) { perror (file); - goto exit; + goto cleanup; } } /* try with a different name */ if (!S_ISREG (stat_buf.st_mode)) { error ("skipping %s: it is not a regular file.", real_name); - goto exit; + goto cleanup; } if (real_name == compressed_name) { @@ -1482,42 +1705,96 @@ if (inf == NULL) { perror (real_name); - goto exit; + goto cleanup; } - find_entries (uncompressed_name, inf); + process_file (inf, uncompressed_name, lang); if (real_name == compressed_name) - pclose (inf); + retval = pclose (inf); else - fclose (inf); + retval = fclose (inf); + if (retval < 0) + pfatal (file); + + cleanup: + if (compressed_name) free (compressed_name); + if (uncompressed_name) free (uncompressed_name); + last_node = NULL; + curfdp = NULL; + return; +} - if (!CTAGS) +static void +process_file (fh, fn, lang) + FILE *fh; + char *fn; + language *lang; +{ + static const fdesc emptyfdesc; + fdesc *fdp; + + /* Create a new input file description entry. */ + fdp = xnew (1, fdesc); + *fdp = emptyfdesc; + fdp->next = fdhead; + fdp->infname = savestr (fn); + fdp->lang = lang; + fdp->infabsname = absolute_filename (fn, cwd); + fdp->infabsdir = absolute_dirname (fn, cwd); + if (filename_is_absolute (fn)) { - char *filename; + /* An absolute file name. Canonicalize it. */ + fdp->taggedfname = absolute_filename (fn, NULL); + } + else + { + /* A file name relative to cwd. Make it relative + to the directory of the tags file. */ + fdp->taggedfname = relative_filename (fn, tagfiledir); + } + fdp->usecharno = TRUE; /* use char position when making tags */ + fdp->prop = NULL; + fdp->written = FALSE; /* not written on tags file yet */ + + fdhead = fdp; + curfdp = fdhead; /* the current file description */ + + find_entries (fh); + + /* If not Ctags, and if this is not metasource and if it contained no #line + directives, we can write the tags and free all nodes pointing to + curfdp. */ + if (!CTAGS + && curfdp->usecharno /* no #line directives in this file */ + && !curfdp->lang->metasource) + { + node *np, *prev; + + /* Look for the head of the sublist relative to this file. See add_node + for the structure of the node tree. */ + prev = NULL; + for (np = nodehead; np != NULL; prev = np, np = np->left) + if (np->fdp == curfdp) + break; - if (filename_is_absolute (uncompressed_name)) + /* If we generated tags for this file, write and delete them. */ + if (np != NULL) { - /* file is an absolute file name. Canonicalise it. */ - filename = absolute_filename (uncompressed_name, cwd); + /* This is the head of the last sublist, if any. The following + instructions depend on this being true. */ + assert (np->left == NULL); + + assert (fdhead == curfdp); + assert (last_node->fdp == curfdp); + put_entries (np); /* write tags for file curfdp->taggedfname */ + free_tree (np); /* remove the written nodes */ + if (prev == NULL) + nodehead = NULL; /* no nodes left */ + else + prev->left = NULL; /* delete the pointer to the sublist */ } - else - { - /* file is a file name relative to cwd. Make it relative - to the directory of the tags file. */ - filename = relative_filename (uncompressed_name, tagfiledir); - } - fprintf (tagf, "\f\n%s,%d\n", filename, total_size_of_entries (head)); - free (filename); - put_entries (head); - free_tree (head); - head = NULL; } - - exit: - if (compressed_name) free(compressed_name); - if (uncompressed_name) free(uncompressed_name); - return; } /* @@ -1551,44 +1828,34 @@ * This routine opens the specified file and calls the function * which finds the function and type definitions. */ -node *last_node = NULL; - static void -find_entries (file, inf) - char *file; +find_entries (inf) FILE *inf; { char *cp; - language *lang; - node *old_last_node; - - /* Memory leakage here: the string pointed by curfile is - never released, because curfile is copied into np->file - for each node, to be used in CTAGS mode. The amount of - memory leaked here is the sum of the lengths of the - file names. */ - curfile = savestr (file); + language *lang = curfdp->lang; + Lang_function *parser = NULL; /* If user specified a language, use it. */ - lang = forced_lang; if (lang != NULL && lang->function != NULL) { - curlang = lang; - lang->function (inf); - return; + parser = lang->function; } - /* Try to guess the language given the file name. */ - lang = get_language_from_filename (file); - if (lang != NULL && lang->function != NULL) + /* Else try to guess the language given the file name. */ + if (parser == NULL) { - curlang = lang; - lang->function (inf); - return; + lang = get_language_from_filename (curfdp->infname, TRUE); + if (lang != NULL && lang->function != NULL) + { + curfdp->lang = lang; + parser = lang->function; + } } - /* Look for sharp-bang as the first two characters. */ - if (readline_internal (&lb, inf) > 0 + /* Else look for sharp-bang as the first two characters. */ + if (parser == NULL + && readline_internal (&lb, inf) > 0 && lb.len >= 2 && lb.buffer[0] == '#' && lb.buffer[1] == '!') @@ -1611,141 +1878,214 @@ lang = get_language_from_interpreter (lp); if (lang != NULL && lang->function != NULL) { - curlang = lang; - lang->function (inf); - return; + curfdp->lang = lang; + parser = lang->function; } } } + /* We rewind here, even if inf may be a pipe. We fail if the length of the first line is longer than the pipe block size, which is unlikely. */ rewind (inf); - /* Try Fortran. */ - old_last_node = last_node; - curlang = get_language_from_langname ("fortran"); - Fortran_functions (inf); - - /* No Fortran entries found. Try C. */ - if (old_last_node == last_node) - { - /* We do not tag if rewind fails. - Only the file name will be recorded in the tags file. */ - rewind (inf); - curlang = get_language_from_langname (cplusplus ? "c++" : "c"); - default_C_entries (inf); + /* Else try to guess the language given the case insensitive file name. */ + if (parser == NULL) + { + lang = get_language_from_filename (curfdp->infname, FALSE); + if (lang != NULL && lang->function != NULL) + { + curfdp->lang = lang; + parser = lang->function; + } } - return; + + /* Else try Fortran or C. */ + if (parser == NULL) + { + node *old_last_node = last_node; + + curfdp->lang = get_language_from_langname ("fortran"); + find_entries (inf); + + if (old_last_node == last_node) + /* No Fortran entries found. Try C. */ + { + /* We do not tag if rewind fails. + Only the file name will be recorded in the tags file. */ + rewind (inf); + curfdp->lang = get_language_from_langname (cplusplus ? "c++" : "c"); + find_entries (inf); + } + return; + } + + if (!no_line_directive + && curfdp->lang != NULL && curfdp->lang->metasource) + /* It may be that this is a bingo.y file, and we already parsed a bingo.c + file, or anyway we parsed a file that is automatically generated from + this one. If this is the case, the bingo.c file contained #line + directives that generated tags pointing to this file. Let's delete + them all before parsing this file, which is the real source. */ + { + fdesc **fdpp = &fdhead; + while (*fdpp != NULL) + if (*fdpp != curfdp + && streq ((*fdpp)->taggedfname, curfdp->taggedfname)) + /* We found one of those! We must delete both the file description + and all tags referring to it. */ + { + fdesc *badfdp = *fdpp; + + /* Delete the tags referring to badfdp->taggedfname + that were obtained from badfdp->infname. */ + invalidate_nodes (badfdp, &nodehead); + + *fdpp = badfdp->next; /* remove the bad description from the list */ + free_fdesc (badfdp); + } + else + fdpp = &(*fdpp)->next; /* advance the list pointer */ + } + + assert (parser != NULL); + + /* Generic initialisations before reading from file. */ + linebuffer_setlen (&filebuf, 0); /* reset the file buffer */ + + /* Generic initialisations before parsing file with readline. */ + lineno = 0; /* reset global line number */ + charno = 0; /* reset global char number */ + linecharno = 0; /* reset global char number of line start */ + + parser (inf); + +#ifdef ETAGS_REGEXPS + regex_tag_multiline (); +#endif /* ETAGS_REGEXPS */ } -/* Record a tag. */ +/* + * Check whether an implicitly named tag should be created, + * then call `pfnote'. + * NAME is a string that is internally copied by this function. + * + * TAGS format specification + * Idea by Sam Kendall (1997) + * The following is explained in some more detail in etc/ETAGS.EBNF. + * + * make_tag creates tags with "implicit tag names" (unnamed tags) + * if the following are all true, assuming NONAM=" \f\t\n\r()=,;": + * 1. NAME does not contain any of the characters in NONAM; + * 2. LINESTART contains name as either a rightmost, or rightmost but + * one character, substring; + * 3. the character, if any, immediately before NAME in LINESTART must + * be a character in NONAM; + * 4. the character, if any, immediately after NAME in LINESTART must + * also be a character in NONAM. + * + * The implementation uses the notinname() macro, which recognises the + * characters stored in the string `nonam'. + * etags.el needs to use the same characters that are in NONAM. + */ static void -pfnote (name, is_func, linestart, linelen, lno, cno) +make_tag (name, namelen, is_func, linestart, linelen, lno, cno) char *name; /* tag name, or NULL if unnamed */ + int namelen; /* tag length */ bool is_func; /* tag is a function */ char *linestart; /* start of the line where tag is */ int linelen; /* length of the line where tag is */ int lno; /* line number */ long cno; /* character number */ { - register node *np; + bool named = (name != NULL && namelen > 0); - if (CTAGS && name == NULL) - return; + if (!CTAGS && named) /* maybe set named to false */ + /* Let's try to make an implicit tag name, that is, create an unnamed tag + such that etags.el can guess a name from it. */ + { + int i; + register char *cp = name; - np = xnew (1, node); + for (i = 0; i < namelen; i++) + if (notinname (*cp++)) + break; + if (i == namelen) /* rule #1 */ + { + cp = linestart + linelen - namelen; + if (notinname (linestart[linelen-1])) + cp -= 1; /* rule #4 */ + if (cp >= linestart /* rule #2 */ + && (cp == linestart + || notinname (cp[-1])) /* rule #3 */ + && strneq (name, cp, namelen)) /* rule #2 */ + named = FALSE; /* use implicit tag name */ + } + } + + if (named) + name = savenstr (name, namelen); + else + name = NULL; + pfnote (name, is_func, linestart, linelen, lno, cno); +} + +/* Record a tag. */ +static void +pfnote (name, is_func, linestart, linelen, lno, cno) + char *name; /* tag name, or NULL if unnamed */ + bool is_func; /* tag is a function */ + char *linestart; /* start of the line where tag is */ + int linelen; /* length of the line where tag is */ + int lno; /* line number */ + long cno; /* character number */ +{ + register node *np; + + assert (name == NULL || name[0] != '\0'); + if (CTAGS && name == NULL) + return; + + np = xnew (1, node); /* If ctags mode, change name "main" to M. */ if (CTAGS && !cxref_style && streq (name, "main")) { - register char *fp = etags_strrchr (curfile, '/'); - np->name = concat ("M", fp == NULL ? curfile : fp + 1, ""); + register char *fp = etags_strrchr (curfdp->taggedfname, '/'); + np->name = concat ("M", fp == NULL ? curfdp->taggedfname : fp + 1, ""); fp = etags_strrchr (np->name, '.'); if (fp != NULL && fp[1] != '\0' && fp[2] == '\0') fp[0] = '\0'; } else np->name = name; + np->valid = TRUE; np->been_warned = FALSE; - np->file = curfile; + np->fdp = curfdp; np->is_func = is_func; np->lno = lno; - /* Our char numbers are 0-base, because of C language tradition? - ctags compatibility? old versions compatibility? I don't know. - Anyway, since emacs's are 1-base we expect etags.el to take care - of the difference. If we wanted to have 1-based numbers, we would - uncomment the +1 below. */ - np->cno = cno /* + 1 */ ; + if (np->fdp->usecharno) + /* Our char numbers are 0-base, because of C language tradition? + ctags compatibility? old versions compatibility? I don't know. + Anyway, since emacs's are 1-base we expect etags.el to take care + of the difference. If we wanted to have 1-based numbers, we would + uncomment the +1 below. */ + np->cno = cno /* + 1 */ ; + else + np->cno = invalidcharno; np->left = np->right = NULL; if (CTAGS && !cxref_style) { if (strlen (linestart) < 50) - np->pat = concat (linestart, "$", ""); + np->regex = concat (linestart, "$", ""); else - np->pat = savenstr (linestart, 50); + np->regex = savenstr (linestart, 50); } else - np->pat = savenstr (linestart, linelen); - - add_node (np, &head); -} - -/* - * TAGS format specification - * Idea by Sam Kendall (1997) - * - * pfnote should emit the optimized form [unnamed tag] only if: - * 1. name does not contain any of the characters " \t\r\n(),;"; - * 2. linestart contains name as either a rightmost, or rightmost but - * one character, substring; - * 3. the character, if any, immediately before name in linestart must - * be one of the characters " \t(),;"; - * 4. the character, if any, immediately after name in linestart must - * also be one of the characters " \t(),;". - * - * The real implementation uses the notinname() macro, which recognises - * characters slightly different form " \t\r\n(),;". See the variable - * `nonam'. - */ -#define traditional_tag_style TRUE -static void -new_pfnote (name, namelen, is_func, linestart, linelen, lno, cno) - char *name; /* tag name, or NULL if unnamed */ - int namelen; /* tag length */ - bool is_func; /* tag is a function */ - char *linestart; /* start of the line where tag is */ - int linelen; /* length of the line where tag is */ - int lno; /* line number */ - long cno; /* character number */ -{ - register char *cp; - bool named; - - named = TRUE; - if (!CTAGS) - { - for (cp = name; !notinname (*cp); cp++) - continue; - if (*cp == '\0') /* rule #1 */ - { - cp = linestart + linelen - namelen; - if (notinname (linestart[linelen-1])) - cp -= 1; /* rule #4 */ - if (cp >= linestart /* rule #2 */ - && (cp == linestart - || notinname (cp[-1])) /* rule #3 */ - && strneq (name, cp, namelen)) /* rule #2 */ - named = FALSE; /* use unnamed tag */ - } - } + np->regex = savenstr (linestart, linelen); - if (named) - name = savenstr (name, namelen); - else - name = NULL; - pfnote (name, is_func, linestart, linelen, lno, cno); + add_node (np, &nodehead); } /* @@ -1762,17 +2102,33 @@ free_tree (np->left); if (np->name != NULL) free (np->name); - free (np->pat); + free (np->regex); free (np); np = node_right; } } /* + * free_fdesc () + * delete a file description + */ +static void +free_fdesc (fdp) + register fdesc *fdp; +{ + if (fdp->infname != NULL) free (fdp->infname); + if (fdp->infabsname != NULL) free (fdp->infabsname); + if (fdp->infabsdir != NULL) free (fdp->infabsdir); + if (fdp->taggedfname != NULL) free (fdp->taggedfname); + if (fdp->prop != NULL) free (fdp->prop); + free (fdp); +} + +/* * add_node () - * Adds a node to the tree of nodes. In etags mode, we don't keep - * it sorted; we just keep a linear list. In ctags mode, maintain - * an ordered tree, with no attempt at balancing. + * Adds a node to the tree of nodes. In etags mode, sort by file + * name. In ctags mode, sort by tag name. Make no attempt at + * balancing. * * add_node is the only function allowed to add nodes, so it can * maintain state. @@ -1792,13 +2148,31 @@ } if (!CTAGS) + /* Etags Mode */ { - /* Etags Mode */ - if (last_node == NULL) - fatal ("internal error in add_node", (char *)NULL); - last_node->right = np; - last_node = np; - } + /* For each file name, tags are in a linked sublist on the right + pointer. The first tags of different files are a linked list + on the left pointer. last_node points to the end of the last + used sublist. */ + if (last_node != NULL && last_node->fdp == np->fdp) + { + /* Let's use the same sublist as the last added node. */ + assert (last_node->right == NULL); + last_node->right = np; + last_node = np; + } + else if (cur_node->fdp == np->fdp) + { + /* Scanning the list we found the head of a sublist which is + good for us. Let's scan this sublist. */ + add_node (np, &cur_node->right); + } + else + /* The head of this sublist is not good for us. Let's try the + next one. */ + add_node (np, &cur_node->left); + } /* if ETAGS mode */ + else { /* Ctags Mode */ @@ -1810,12 +2184,12 @@ */ if (!dif) { - if (streq (np->file, cur_node->file)) + if (np->fdp == cur_node->fdp) { if (!no_warnings) { fprintf (stderr, "Duplicate entry in file %s, line %d: %s\n", - np->file, lineno, np->name); + np->fdp->infname, lineno, np->name); fprintf (stderr, "Second entry ignored\n"); } } @@ -1824,7 +2198,7 @@ fprintf (stderr, "Duplicate entry in files %s and %s: %s (Warning only)\n", - np->file, cur_node->file, np->name); + np->fdp->infname, cur_node->fdp->infname, np->name); cur_node->been_warned = TRUE; } return; @@ -1832,77 +2206,53 @@ /* Actually add the node */ add_node (np, dif < 0 ? &cur_node->left : &cur_node->right); - } + } /* if CTAGS mode */ } - +/* + * invalidate_nodes () + * Scan the node tree and invalidate all nodes pointing to the + * given file description (CTAGS case) or free them (ETAGS case). + */ static void -put_entries (np) - register node *np; +invalidate_nodes (badfdp, npp) + fdesc *badfdp; + node **npp; { - register char *sp; + node *np = *npp; if (np == NULL) return; - /* Output subentries that precede this one */ - put_entries (np->left); - - /* Output this entry */ - - if (!CTAGS) + if (CTAGS) { - if (np->name != NULL) - fprintf (tagf, "%s\177%s\001%d,%ld\n", - np->pat, np->name, np->lno, np->cno); - else - fprintf (tagf, "%s\177%d,%ld\n", - np->pat, np->lno, np->cno); + if (np->left != NULL) + invalidate_nodes (badfdp, &np->left); + if (np->fdp == badfdp) + np->valid = FALSE; + if (np->right != NULL) + invalidate_nodes (badfdp, &np->right); } else { - if (np->name == NULL) - error ("internal error: NULL name in ctags mode.", (char *)NULL); - - if (cxref_style) + assert (np->fdp != NULL); + if (np->fdp == badfdp) { - if (vgrind_style) - fprintf (stdout, "%s %s %d\n", - np->name, np->file, (np->lno + 63) / 64); - else - fprintf (stdout, "%-16s %3d %-16s %s\n", - np->name, np->lno, np->file, np->pat); + *npp = np->left; /* detach the sublist from the list */ + np->left = NULL; /* isolate it */ + free_tree (np); /* free it */ + invalidate_nodes (badfdp, npp); } else - { - fprintf (tagf, "%s\t%s\t", np->name, np->file); - - if (np->is_func) - { /* a function */ - putc (searchar, tagf); - putc ('^', tagf); - - for (sp = np->pat; *sp; sp++) - { - if (*sp == '\\' || *sp == searchar) - putc ('\\', tagf); - putc (*sp, tagf); - } - putc (searchar, tagf); - } - else - { /* a typedef; text pattern inadequate */ - fprintf (tagf, "%d", np->lno); - } - putc ('\n', tagf); - } + invalidate_nodes (badfdp, &np->left); } - - /* Output subentries that follow this one */ - put_entries (np->right); } -/* Length of a number's decimal representation. */ + +static int total_size_of_entries __P((node *)); +static int number_len __P((long)); + +/* Length of a non-negative number's decimal representation. */ static int number_len (num) long num; @@ -1915,33 +2265,115 @@ /* * Return total number of characters that put_entries will output for - * the nodes in the subtree of the specified node. Works only if - * we are not ctags, but called only in that case. This count - * is irrelevant with the new tags.el, but is still supplied for - * backward compatibility. + * the nodes in the linked list at the right of the specified node. + * This count is irrelevant with etags.el since emacs 19.34 at least, + * but is still supplied for backward compatibility. */ static int total_size_of_entries (np) register node *np; { - register int total; + register int total = 0; + + for (; np != NULL; np = np->right) + if (np->valid) + { + total += strlen (np->regex) + 1; /* pat\177 */ + if (np->name != NULL) + total += strlen (np->name) + 1; /* name\001 */ + total += number_len ((long) np->lno) + 1; /* lno, */ + if (np->cno != invalidcharno) /* cno */ + total += number_len (np->cno); + total += 1; /* newline */ + } + + return total; +} + +static void +put_entries (np) + register node *np; +{ + register char *sp; + static fdesc *fdp = NULL; if (np == NULL) - return 0; + return; - for (total = 0; np != NULL; np = np->right) + /* Output subentries that precede this one */ + if (CTAGS) + put_entries (np->left); + + /* Output this entry */ + if (np->valid) { - /* Count left subentries. */ - total += total_size_of_entries (np->left); + if (!CTAGS) + { + /* Etags mode */ + if (fdp != np->fdp) + { + fdp = np->fdp; + fprintf (tagf, "\f\n%s,%d\n", + fdp->taggedfname, total_size_of_entries (np)); + fdp->written = TRUE; + } + fputs (np->regex, tagf); + fputc ('\177', tagf); + if (np->name != NULL) + { + fputs (np->name, tagf); + fputc ('\001', tagf); + } + fprintf (tagf, "%d,", np->lno); + if (np->cno != invalidcharno) + fprintf (tagf, "%ld", np->cno); + fputs ("\n", tagf); + } + else + { + /* Ctags mode */ + if (np->name == NULL) + error ("internal error: NULL name in ctags mode.", (char *)NULL); + + if (cxref_style) + { + if (vgrind_style) + fprintf (stdout, "%s %s %d\n", + np->name, np->fdp->taggedfname, (np->lno + 63) / 64); + else + fprintf (stdout, "%-16s %3d %-16s %s\n", + np->name, np->lno, np->fdp->taggedfname, np->regex); + } + else + { + fprintf (tagf, "%s\t%s\t", np->name, np->fdp->taggedfname); - /* Count this entry */ - total += strlen (np->pat) + 1; - total += number_len ((long) np->lno) + 1 + number_len (np->cno) + 1; - if (np->name != NULL) - total += 1 + strlen (np->name); /* \001name */ - } + if (np->is_func) + { /* function or #define macro with args */ + putc (searchar, tagf); + putc ('^', tagf); - return total; + for (sp = np->regex; *sp; sp++) + { + if (*sp == '\\' || *sp == searchar) + putc ('\\', tagf); + putc (*sp, tagf); + } + putc (searchar, tagf); + } + else + { /* anything else; text pattern inadequate */ + fprintf (tagf, "%d", np->lno); + } + putc ('\n', tagf); + } + } + } /* if this node contains a valid tag */ + + /* Output subentries that follow this one */ + put_entries (np->right); + if (!CTAGS) + put_entries (np->left); } @@ -1962,11 +2394,11 @@ st_none, st_C_objprot, st_C_objimpl, st_C_objend, st_C_gnumacro, - st_C_ignore, + st_C_ignore, st_C_attribute, st_C_javastruct, st_C_operator, st_C_class, st_C_template, - st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef, st_C_typespec + st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef }; static unsigned int hash __P((const char *, unsigned int)); @@ -1974,79 +2406,67 @@ static enum sym_type C_symtype __P((char *, int, int)); /* Feed stuff between (but not including) %[ and %] lines to: - gperf -c -k 1,3 -o -p -r -t + gperf -m 5 %[ +%compare-strncmp +%enum +%struct-type struct C_stab_entry { char *name; int c_ext; enum sym_type type; } %% -if, 0, st_C_ignore -for, 0, st_C_ignore -while, 0, st_C_ignore -switch, 0, st_C_ignore -return, 0, st_C_ignore -@interface, 0, st_C_objprot -@protocol, 0, st_C_objprot -@implementation,0, st_C_objimpl -@end, 0, st_C_objend -import, C_JAVA, st_C_ignore -package, C_JAVA, st_C_ignore -friend, C_PLPL, st_C_ignore -extends, C_JAVA, st_C_javastruct -implements, C_JAVA, st_C_javastruct -interface, C_JAVA, st_C_struct -class, 0, st_C_class -namespace, C_PLPL, st_C_struct -domain, C_STAR, st_C_struct -union, 0, st_C_struct -struct, 0, st_C_struct -extern, 0, st_C_extern -enum, 0, st_C_enum -typedef, 0, st_C_typedef -define, 0, st_C_define -operator, C_PLPL, st_C_operator -template, 0, st_C_template -bool, C_PLPL, st_C_typespec -long, 0, st_C_typespec -short, 0, st_C_typespec -int, 0, st_C_typespec -char, 0, st_C_typespec -float, 0, st_C_typespec -double, 0, st_C_typespec -signed, 0, st_C_typespec -unsigned, 0, st_C_typespec -auto, 0, st_C_typespec -void, 0, st_C_typespec -static, 0, st_C_typespec -const, 0, st_C_typespec -volatile, 0, st_C_typespec -explicit, C_PLPL, st_C_typespec -mutable, C_PLPL, st_C_typespec -typename, C_PLPL, st_C_typespec +if, 0, st_C_ignore +for, 0, st_C_ignore +while, 0, st_C_ignore +switch, 0, st_C_ignore +return, 0, st_C_ignore +__attribute__, 0, st_C_attribute +@interface, 0, st_C_objprot +@protocol, 0, st_C_objprot +@implementation,0, st_C_objimpl +@end, 0, st_C_objend +import, (C_JAVA & !C_PLPL), st_C_ignore +package, (C_JAVA & !C_PLPL), st_C_ignore +friend, C_PLPL, st_C_ignore +extends, (C_JAVA & !C_PLPL), st_C_javastruct +implements, (C_JAVA & !C_PLPL), st_C_javastruct +interface, (C_JAVA & !C_PLPL), st_C_struct +class, 0, st_C_class +namespace, C_PLPL, st_C_struct +domain, C_STAR, st_C_struct +union, 0, st_C_struct +struct, 0, st_C_struct +extern, 0, st_C_extern +enum, 0, st_C_enum +typedef, 0, st_C_typedef +define, 0, st_C_define +operator, C_PLPL, st_C_operator +template, 0, st_C_template # DEFUN used in emacs, the next three used in glibc (SYSCALL only for mach). -DEFUN, 0, st_C_gnumacro -SYSCALL, 0, st_C_gnumacro -ENTRY, 0, st_C_gnumacro -PSEUDO, 0, st_C_gnumacro +DEFUN, 0, st_C_gnumacro +SYSCALL, 0, st_C_gnumacro +ENTRY, 0, st_C_gnumacro +PSEUDO, 0, st_C_gnumacro # These are defined inside C functions, so currently they are not met. # EXFUN used in glibc, DEFVAR_* in emacs. -#EXFUN, 0, st_C_gnumacro -#DEFVAR_, 0, st_C_gnumacro +#EXFUN, 0, st_C_gnumacro +#DEFVAR_, 0, st_C_gnumacro %] -and replace lines between %< and %> with its output, -then make in_word_set static. */ +and replace lines between %< and %> with its output, then: + - remove the #if characterset check + - make in_word_set static and not inline. */ /*%<*/ -/* C code produced by gperf version 2.7.1 (19981006 egcs) */ -/* Command-line: gperf -c -k 1,3 -o -p -r -t */ -struct C_stab_entry { char *name; int c_ext; enum sym_type type; }; +/* C code produced by gperf version 3.0.1 */ +/* Command-line: gperf -m 5 */ +/* Computed positions: -k'1-2' */ -#define TOTAL_KEYWORDS 47 -#define MIN_WORD_LENGTH 2 -#define MAX_WORD_LENGTH 15 -#define MIN_HASH_VALUE 18 -#define MAX_HASH_VALUE 138 -/* maximum key range = 121, duplicates = 0 */ +struct C_stab_entry { char *name; int c_ext; enum sym_type type; }; +/* maximum key range = 31, duplicates = 0 */ #ifdef __GNUC__ __inline +#else +#ifdef __cplusplus +inline +#endif #endif static unsigned int hash (str, len) @@ -2055,132 +2475,84 @@ { static unsigned char asso_values[] = { - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 63, 139, 139, 139, 33, 44, - 62, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 42, 139, 139, 12, 32, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 34, 59, 37, - 24, 58, 33, 3, 139, 16, 139, 139, 42, 60, - 18, 11, 39, 139, 23, 57, 4, 63, 6, 20, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139 + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 1, 34, 34, 34, 14, 14, + 34, 34, 34, 34, 34, 34, 34, 34, 13, 34, + 13, 34, 34, 12, 34, 34, 34, 34, 34, 11, + 34, 34, 34, 34, 34, 8, 34, 11, 34, 12, + 11, 0, 1, 34, 7, 0, 34, 34, 11, 9, + 0, 4, 0, 34, 7, 4, 14, 21, 34, 15, + 0, 2, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34 }; - register int hval = len; - - switch (hval) - { - default: - case 3: - hval += asso_values[(unsigned char)str[2]]; - case 2: - case 1: - hval += asso_values[(unsigned char)str[0]]; - break; - } - return hval; + return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]]; } -#ifdef __GNUC__ -__inline -#endif static struct C_stab_entry * in_word_set (str, len) register const char *str; register unsigned int len; { + enum + { + TOTAL_KEYWORDS = 31, + MIN_WORD_LENGTH = 2, + MAX_WORD_LENGTH = 15, + MIN_HASH_VALUE = 3, + MAX_HASH_VALUE = 33 + }; + static struct C_stab_entry wordlist[] = { - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"if", 0, st_C_ignore}, - {""}, {""}, {""}, {""}, - {"int", 0, st_C_typespec}, - {""}, {""}, - {"void", 0, st_C_typespec}, - {""}, {""}, - {"interface", C_JAVA, st_C_struct}, - {""}, - {"SYSCALL", 0, st_C_gnumacro}, - {""}, - {"return", 0, st_C_ignore}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"while", 0, st_C_ignore}, - {"auto", 0, st_C_typespec}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"float", 0, st_C_typespec}, - {"typedef", 0, st_C_typedef}, - {"typename", C_PLPL, st_C_typespec}, {""}, {""}, {""}, - {"friend", C_PLPL, st_C_ignore}, - {"volatile", 0, st_C_typespec}, - {""}, {""}, - {"for", 0, st_C_ignore}, - {"const", 0, st_C_typespec}, - {"import", C_JAVA, st_C_ignore}, - {""}, - {"define", 0, st_C_define}, - {"long", 0, st_C_typespec}, - {"implements", C_JAVA, st_C_javastruct}, - {"signed", 0, st_C_typespec}, - {""}, - {"extern", 0, st_C_extern}, - {"extends", C_JAVA, st_C_javastruct}, - {""}, - {"mutable", C_PLPL, st_C_typespec}, - {"template", 0, st_C_template}, - {"short", 0, st_C_typespec}, - {"bool", C_PLPL, st_C_typespec}, - {"char", 0, st_C_typespec}, - {"class", 0, st_C_class}, - {"operator", C_PLPL, st_C_operator}, - {""}, - {"switch", 0, st_C_ignore}, - {""}, - {"ENTRY", 0, st_C_gnumacro}, - {""}, - {"package", C_JAVA, st_C_ignore}, - {"union", 0, st_C_struct}, - {"@end", 0, st_C_objend}, - {"struct", 0, st_C_struct}, - {"namespace", C_PLPL, st_C_struct}, - {""}, {""}, - {"domain", C_STAR, st_C_struct}, - {"@interface", 0, st_C_objprot}, - {"PSEUDO", 0, st_C_gnumacro}, - {"double", 0, st_C_typespec}, - {""}, - {"@protocol", 0, st_C_objprot}, - {""}, - {"static", 0, st_C_typespec}, - {""}, {""}, - {"DEFUN", 0, st_C_gnumacro}, - {""}, {""}, {""}, {""}, - {"explicit", C_PLPL, st_C_typespec}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"enum", 0, st_C_enum}, - {""}, {""}, - {"unsigned", 0, st_C_typespec}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"@implementation",0, st_C_objimpl} + {"if", 0, st_C_ignore}, + {"enum", 0, st_C_enum}, + {"@end", 0, st_C_objend}, + {"extern", 0, st_C_extern}, + {"extends", (C_JAVA & !C_PLPL), st_C_javastruct}, + {"for", 0, st_C_ignore}, + {"interface", (C_JAVA & !C_PLPL), st_C_struct}, + {"@protocol", 0, st_C_objprot}, + {"@interface", 0, st_C_objprot}, + {"operator", C_PLPL, st_C_operator}, + {"return", 0, st_C_ignore}, + {"friend", C_PLPL, st_C_ignore}, + {"import", (C_JAVA & !C_PLPL), st_C_ignore}, + {"@implementation",0, st_C_objimpl}, + {"define", 0, st_C_define}, + {"package", (C_JAVA & !C_PLPL), st_C_ignore}, + {"implements", (C_JAVA & !C_PLPL), st_C_javastruct}, + {"namespace", C_PLPL, st_C_struct}, + {"domain", C_STAR, st_C_struct}, + {"template", 0, st_C_template}, + {"typedef", 0, st_C_typedef}, + {"struct", 0, st_C_struct}, + {"switch", 0, st_C_ignore}, + {"union", 0, st_C_struct}, + {"while", 0, st_C_ignore}, + {"class", 0, st_C_class}, + {"__attribute__", 0, st_C_attribute}, + {"SYSCALL", 0, st_C_gnumacro}, + {"PSEUDO", 0, st_C_gnumacro}, + {"ENTRY", 0, st_C_gnumacro}, + {"DEFUN", 0, st_C_gnumacro} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) @@ -2191,7 +2563,7 @@ { register const char *s = wordlist[key].name; - if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) + if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') return &wordlist[key]; } } @@ -2214,10 +2586,15 @@ /* + * Ignoring __attribute__ ((list)) + */ +static bool inattribute; /* looking at an __attribute__ construct */ + +/* * C functions and variables are recognized using a simple * finite automaton. fvdef is its state variable. */ -enum +static enum { fvnone, /* nothing seen */ fdefunkey, /* Emacs DEFUN keyword seen */ @@ -2231,13 +2608,13 @@ vignore /* var-like: ignore until ';' */ } fvdef; -bool fvextern; /* func or var: extern keyword seen; */ +static bool fvextern; /* func or var: extern keyword seen; */ /* * typedefs are recognized using a simple finite automaton. * typdef is its state variable. */ -enum +static enum { tnone, /* nothing seen */ tkeyseen, /* typedef keyword seen */ @@ -2252,25 +2629,24 @@ * using another simple finite automaton. `structdef' is its state * variable. */ -enum +static enum { snone, /* nothing seen yet, - or in struct body if cblev > 0 */ + or in struct body if bracelev > 0 */ skeyseen, /* struct-like keyword seen */ stagseen, /* struct-like tag seen */ - sintemplate, /* inside template (ignore) */ scolonseen /* colon seen after struct-like tag */ } structdef; /* * When objdef is different from onone, objtag is the name of the class. */ -char *objtag = ""; +static char *objtag = ""; /* * Yet another little state machine to deal with preprocessor lines. */ -enum +static enum { dnone, /* nothing seen */ dsharpseen, /* '#' seen as first char on line */ @@ -2282,7 +2658,7 @@ * State machine for Objective C protocols and implementations. * Idea by Tom R.Hageman (1995) */ -enum +static enum { onone, /* nothing seen */ oprotocol, /* @interface or @protocol seen */ @@ -2303,17 +2679,24 @@ * Use this structure to keep info about the token read, and how it * should be tagged. Used by the make_C_tag function to build a tag. */ -struct tok +static struct tok { - bool valid; - bool named; - int offset; - int length; - int lineno; - long linepos; - char *line; + char *line; /* string containing the token */ + int offset; /* where the token starts in LINE */ + int length; /* token length */ + /* + The previous members can be used to pass strings around for generic + purposes. The following ones specifically refer to creating tags. In this + case the token contained here is the pattern that will be used to create a + tag. + */ + bool valid; /* do not create a tag; the token should be + invalidated whenever a state machine is + reset prematurely */ + bool named; /* create a named tag */ + int lineno; /* source line number of tag */ + long linepos; /* source char number of tag */ } token; /* latest token read */ -linebuffer token_name; /* its name */ /* * Variables and functions for dealing with nested structures. @@ -2323,48 +2706,48 @@ static void popclass_above __P((int)); static void write_classname __P((linebuffer *, char *qualifier)); -struct { +static struct { char **cname; /* nested class names */ - int *cblev; /* nested class curly brace level */ + int *bracelev; /* nested class brace level */ int nl; /* class nesting level (elements used) */ int size; /* length of the array */ } cstack; /* stack for nested declaration tags */ /* Current struct nesting depth (namespace, class, struct, union, enum). */ #define nestlev (cstack.nl) -/* After struct keyword or in struct body, not inside an nested function. */ +/* After struct keyword or in struct body, not inside a nested function. */ #define instruct (structdef == snone && nestlev > 0 \ - && cblev == cstack.cblev[nestlev-1] + 1) + && bracelev == cstack.bracelev[nestlev-1] + 1) static void -pushclass_above (cblev, str, len) - int cblev; +pushclass_above (bracelev, str, len) + int bracelev; char *str; int len; { int nl; - popclass_above (cblev); + popclass_above (bracelev); nl = cstack.nl; if (nl >= cstack.size) { int size = cstack.size *= 2; xrnew (cstack.cname, size, char *); - xrnew (cstack.cblev, size, int); + xrnew (cstack.bracelev, size, int); } - assert (nl == 0 || cstack.cblev[nl-1] < cblev); + assert (nl == 0 || cstack.bracelev[nl-1] < bracelev); cstack.cname[nl] = (str == NULL) ? NULL : savenstr (str, len); - cstack.cblev[nl] = cblev; + cstack.bracelev[nl] = bracelev; cstack.nl = nl + 1; } static void -popclass_above (cblev) - int cblev; +popclass_above (bracelev) + int bracelev; { int nl; for (nl = cstack.nl - 1; - nl >= 0 && cstack.cblev[nl] >= cblev; + nl >= 0 && cstack.bracelev[nl] >= bracelev; nl--) { if (cstack.cname[nl] != NULL) @@ -2431,268 +2814,295 @@ */ static bool -consider_token (str, len, c, c_extp, cblev, parlev, is_func_or_var) +consider_token (str, len, c, c_extp, bracelev, parlev, is_func_or_var) register char *str; /* IN: token pointer */ register int len; /* IN: token length */ register int c; /* IN: first char after the token */ int *c_extp; /* IN, OUT: C extensions mask */ - int cblev; /* IN: curly brace level */ + int bracelev; /* IN: brace level */ int parlev; /* IN: parenthesis level */ bool *is_func_or_var; /* OUT: function or variable found */ { - /* When structdef is stagseen, scolonseen, or snone with cblev > 0, + /* When structdef is stagseen, scolonseen, or snone with bracelev > 0, structtype is the type of the preceding struct-like keyword, and - structcblev is the curly brace level where it has been seen. */ + structbracelev is the brace level where it has been seen. */ static enum sym_type structtype; - static int structcblev; + static int structbracelev; static enum sym_type toktype; toktype = C_symtype (str, len, *c_extp); /* - * Advance the definedef state machine. - */ - switch (definedef) - { - case dnone: - /* We're not on a preprocessor line. */ - if (toktype == st_C_gnumacro) - { - fvdef = fdefunkey; - return FALSE; - } - break; - case dsharpseen: - if (toktype == st_C_define) - { - definedef = ddefineseen; - } - else - { - definedef = dignorerest; - } - return FALSE; - case ddefineseen: - /* - * Make a tag for any macro, unless it is a constant - * and constantypedefs is FALSE. - */ - definedef = dignorerest; - *is_func_or_var = (c == '('); - if (!*is_func_or_var && !constantypedefs) - return FALSE; - else - return TRUE; - case dignorerest: - return FALSE; - default: - error ("internal error: definedef value.", (char *)NULL); - } - - /* - * Now typedefs - */ - switch (typdef) - { - case tnone: - if (toktype == st_C_typedef) - { - if (typedefs) - typdef = tkeyseen; - fvextern = FALSE; - fvdef = fvnone; - return FALSE; - } - break; - case tkeyseen: - switch (toktype) - { - case st_none: - case st_C_typespec: - case st_C_class: - case st_C_struct: - case st_C_enum: - typdef = ttypeseen; - break; - } - break; - case ttypeseen: - if (structdef == snone && fvdef == fvnone) - { - fvdef = fvnameseen; - return TRUE; - } - break; - case tend: - switch (toktype) - { - case st_C_typespec: - case st_C_class: - case st_C_struct: - case st_C_enum: - return FALSE; - } - return TRUE; - } - - /* - * This structdef business is NOT invoked when we are ctags and the - * file is plain C. This is because a struct tag may have the same - * name as another tag, and this loses with ctags. + * Skip __attribute__ */ - switch (toktype) + if (toktype == st_C_attribute) { - case st_C_javastruct: - if (structdef == stagseen) - structdef = scolonseen; - return FALSE; - case st_C_template: - case st_C_class: - if (cblev == 0 - && (*c_extp & C_AUTO) /* automatic detection of C++ language */ - && definedef == dnone && structdef == snone - && typdef == tnone && fvdef == fvnone) - *c_extp = (*c_extp | C_PLPL) & ~C_AUTO; - if (toktype == st_C_template) - break; - /* FALLTHRU */ - case st_C_struct: - case st_C_enum: - if (parlev == 0 - && fvdef != vignore - && (typdef == tkeyseen - || (typedefs_or_cplusplus && structdef == snone))) - { - structdef = skeyseen; - structtype = toktype; - structcblev = cblev; - } + inattribute = TRUE; return FALSE; - } + } - if (structdef == skeyseen) - { - structdef = stagseen; - return TRUE; - } - - if (typdef != tnone) - definedef = dnone; - - /* Detect Objective C constructs. */ - switch (objdef) - { - case onone: - switch (toktype) - { - case st_C_objprot: - objdef = oprotocol; - return FALSE; - case st_C_objimpl: - objdef = oimplementation; - return FALSE; - } - break; - case oimplementation: - /* Save the class tag for functions or variables defined inside. */ - objtag = savenstr (str, len); - objdef = oinbody; - return FALSE; - case oprotocol: - /* Save the class tag for categories. */ - objtag = savenstr (str, len); - objdef = otagseen; - *is_func_or_var = TRUE; - return TRUE; - case oparenseen: - objdef = ocatseen; - *is_func_or_var = TRUE; - return TRUE; - case oinbody: - break; - case omethodsign: - if (parlev == 0) - { - objdef = omethodtag; - linebuffer_setlen (&token_name, len); - strncpy (token_name.buffer, str, len); - token_name.buffer[len] = '\0'; - return TRUE; - } - return FALSE; - case omethodcolon: - if (parlev == 0) - objdef = omethodparm; - return FALSE; - case omethodparm: - if (parlev == 0) - { - objdef = omethodtag; - linebuffer_setlen (&token_name, token_name.len + len); - strncat (token_name.buffer, str, len); - return TRUE; - } - return FALSE; - case oignore: - if (toktype == st_C_objend) - { - /* Memory leakage here: the string pointed by objtag is - never released, because many tests would be needed to - avoid breaking on incorrect input code. The amount of - memory leaked here is the sum of the lengths of the - class tags. - free (objtag); */ - objdef = onone; - } - return FALSE; - } - - /* A function, variable or enum constant? */ - switch (toktype) - { - case st_C_extern: - fvextern = TRUE; - /* FALLTHRU */ - case st_C_typespec: - if (fvdef != finlist && fvdef != fignore && fvdef != vignore) - fvdef = fvnone; /* should be useless */ - return FALSE; - case st_C_ignore: - fvextern = FALSE; - fvdef = vignore; - return FALSE; - case st_C_operator: - fvdef = foperator; - *is_func_or_var = TRUE; - return TRUE; - case st_none: - if (constantypedefs - && structdef == snone - && structtype == st_C_enum && cblev > structcblev) - return TRUE; /* enum constant */ - switch (fvdef) - { - case fdefunkey: - if (cblev > 0) - break; - fvdef = fdefunname; /* GNU macro */ - *is_func_or_var = TRUE; - return TRUE; - case fvnone: - if ((strneq (str, "asm", 3) && endtoken (str[3])) - || (strneq (str, "__asm__", 7) && endtoken (str[7]))) - { - fvdef = vignore; - return FALSE; - } - if ((*c_extp & C_PLPL) && strneq (str+len-10, "::operator", 10)) + /* + * Advance the definedef state machine. + */ + switch (definedef) + { + case dnone: + /* We're not on a preprocessor line. */ + if (toktype == st_C_gnumacro) + { + fvdef = fdefunkey; + return FALSE; + } + break; + case dsharpseen: + if (toktype == st_C_define) + { + definedef = ddefineseen; + } + else + { + definedef = dignorerest; + } + return FALSE; + case ddefineseen: + /* + * Make a tag for any macro, unless it is a constant + * and constantypedefs is FALSE. + */ + definedef = dignorerest; + *is_func_or_var = (c == '('); + if (!*is_func_or_var && !constantypedefs) + return FALSE; + else + return TRUE; + case dignorerest: + return FALSE; + default: + error ("internal error: definedef value.", (char *)NULL); + } + + /* + * Now typedefs + */ + switch (typdef) + { + case tnone: + if (toktype == st_C_typedef) + { + if (typedefs) + typdef = tkeyseen; + fvextern = FALSE; + fvdef = fvnone; + return FALSE; + } + break; + case tkeyseen: + switch (toktype) + { + case st_none: + case st_C_class: + case st_C_struct: + case st_C_enum: + typdef = ttypeseen; + } + break; + case ttypeseen: + if (structdef == snone && fvdef == fvnone) + { + fvdef = fvnameseen; + return TRUE; + } + break; + case tend: + switch (toktype) + { + case st_C_class: + case st_C_struct: + case st_C_enum: + return FALSE; + } + return TRUE; + } + + /* + * This structdef business is NOT invoked when we are ctags and the + * file is plain C. This is because a struct tag may have the same + * name as another tag, and this loses with ctags. + */ + switch (toktype) + { + case st_C_javastruct: + if (structdef == stagseen) + structdef = scolonseen; + return FALSE; + case st_C_template: + case st_C_class: + if ((*c_extp & C_AUTO) /* automatic detection of C++ language */ + && bracelev == 0 + && definedef == dnone && structdef == snone + && typdef == tnone && fvdef == fvnone) + *c_extp = (*c_extp | C_PLPL) & ~C_AUTO; + if (toktype == st_C_template) + break; + /* FALLTHRU */ + case st_C_struct: + case st_C_enum: + if (parlev == 0 + && fvdef != vignore + && (typdef == tkeyseen + || (typedefs_or_cplusplus && structdef == snone))) + { + structdef = skeyseen; + structtype = toktype; + structbracelev = bracelev; + if (fvdef == fvnameseen) + fvdef = fvnone; + } + return FALSE; + } + + if (structdef == skeyseen) + { + structdef = stagseen; + return TRUE; + } + + if (typdef != tnone) + definedef = dnone; + + /* Detect Objective C constructs. */ + switch (objdef) + { + case onone: + switch (toktype) + { + case st_C_objprot: + objdef = oprotocol; + return FALSE; + case st_C_objimpl: + objdef = oimplementation; + return FALSE; + } + break; + case oimplementation: + /* Save the class tag for functions or variables defined inside. */ + objtag = savenstr (str, len); + objdef = oinbody; + return FALSE; + case oprotocol: + /* Save the class tag for categories. */ + objtag = savenstr (str, len); + objdef = otagseen; + *is_func_or_var = TRUE; + return TRUE; + case oparenseen: + objdef = ocatseen; + *is_func_or_var = TRUE; + return TRUE; + case oinbody: + break; + case omethodsign: + if (parlev == 0) + { + fvdef = fvnone; + objdef = omethodtag; + linebuffer_setlen (&token_name, len); + strncpy (token_name.buffer, str, len); + token_name.buffer[len] = '\0'; + return TRUE; + } + return FALSE; + case omethodcolon: + if (parlev == 0) + objdef = omethodparm; + return FALSE; + case omethodparm: + if (parlev == 0) + { + fvdef = fvnone; + objdef = omethodtag; + linebuffer_setlen (&token_name, token_name.len + len); + strncat (token_name.buffer, str, len); + return TRUE; + } + return FALSE; + case oignore: + if (toktype == st_C_objend) + { + /* Memory leakage here: the string pointed by objtag is + never released, because many tests would be needed to + avoid breaking on incorrect input code. The amount of + memory leaked here is the sum of the lengths of the + class tags. + free (objtag); */ + objdef = onone; + } + return FALSE; + } + + /* A function, variable or enum constant? */ + switch (toktype) + { + case st_C_extern: + fvextern = TRUE; + switch (fvdef) + { + case finlist: + case flistseen: + case fignore: + case vignore: + break; + default: + fvdef = fvnone; + } + return FALSE; + case st_C_ignore: + fvextern = FALSE; + fvdef = vignore; + return FALSE; + case st_C_operator: + fvdef = foperator; + *is_func_or_var = TRUE; + return TRUE; + case st_none: + if (constantypedefs + && structdef == snone + && structtype == st_C_enum && bracelev > structbracelev) + return TRUE; /* enum constant */ + switch (fvdef) + { + case fdefunkey: + if (bracelev > 0) + break; + fvdef = fdefunname; /* GNU macro */ + *is_func_or_var = TRUE; + return TRUE; + case fvnone: + switch (typdef) + { + case ttypeseen: + return FALSE; + case tnone: + if ((strneq (str, "asm", 3) && endtoken (str[3])) + || (strneq (str, "__asm__", 7) && endtoken (str[7]))) + { + fvdef = vignore; + return FALSE; + } + break; + } + /* FALLTHRU */ + case fvnameseen: + if (len >= 10 && strneq (str+len-10, "::operator", 10)) { + if (*c_extp & C_AUTO) /* automatic detection of C++ */ + *c_extp = (*c_extp | C_PLPL) & ~C_AUTO; fvdef = foperator; *is_func_or_var = TRUE; return TRUE; } - if (cblev > 0 && !instruct) + if (bracelev > 0 && !instruct) break; fvdef = fvnameseen; /* function or variable */ *is_func_or_var = TRUE; @@ -2710,7 +3120,7 @@ * the line currently read. By keeping two line buffers, and switching * them at end of line, it is possible to use those pointers. */ -struct +static struct { long linepos; linebuffer lb; @@ -2724,12 +3134,14 @@ #define curlinepos (lbs[curndx].linepos) #define newlinepos (lbs[newndx].linepos) +#define plainc ((c_ext & C_EXT) == C_PLAIN) +#define cplpl (c_ext & C_PLPL) +#define cjava ((c_ext & C_JAVA) == C_JAVA) + #define CNL_SAVE_DEFINEDEF() \ do { \ curlinepos = charno; \ - lineno++; \ - linecharno = charno; \ - charno += readline (&curlb, inf); \ + readline (&curlb, inf); \ lp = curlb.buffer; \ quotednl = FALSE; \ newndx = curndx; \ @@ -2753,31 +3165,18 @@ { /* This function should never be called when token.valid is FALSE, but we must protect against invalid input or internal errors. */ - if (DEBUG || token.valid) - { - if (traditional_tag_style) - { - /* This was the original code. Now we call new_pfnote instead, - which uses the new method for naming tags (see new_pfnote). */ - char *name = NULL; + if (!DEBUG && !token.valid) + return; - if (CTAGS || token.named) - name = savestr (token_name.buffer); - if (DEBUG && !token.valid) - { - if (token.named) - name = concat (name, "##invalid##", ""); - else - name = savestr ("##invalid##"); - } - pfnote (name, isfun, token.line, - token.offset+token.length+1, token.lineno, token.linepos); - } - else - new_pfnote (token_name.buffer, token_name.len, isfun, token.line, - token.offset+token.length+1, token.lineno, token.linepos); - token.valid = FALSE; - } + if (token.valid) + make_tag (token_name.buffer, token_name.len, isfun, token.line, + token.offset+token.length+1, token.lineno, token.linepos); + else /* this case is optimised away if !DEBUG */ + make_tag (concat ("INVALID TOKEN:-->", token_name.buffer, ""), + token_name.len + 17, isfun, token.line, + token.offset+token.length+1, token.lineno, token.linepos); + + token.valid = FALSE; } @@ -2799,30 +3198,29 @@ register int toklen; /* length of current token */ char *qualifier; /* string used to qualify names */ int qlen; /* length of qualifier */ - int cblev; /* current curly brace level */ + int bracelev; /* current brace level */ + int bracketlev; /* current bracket level */ int parlev; /* current parenthesis level */ - int typdefcblev; /* cblev where a typedef struct body begun */ + int attrparlev; /* __attribute__ parenthesis level */ + int templatelev; /* current template level */ + int typdefbracelev; /* bracelev where a typedef struct body begun */ bool incomm, inquote, inchar, quotednl, midtoken; - bool cplpl, cjava; bool yacc_rules; /* in the rules part of a yacc file */ struct tok savetoken; /* token saved during preprocessor handling */ - initbuffer (&token_name); - initbuffer (&lbs[0].lb); - initbuffer (&lbs[1].lb); + linebuffer_init (&lbs[0].lb); + linebuffer_init (&lbs[1].lb); if (cstack.size == 0) { cstack.size = (DEBUG) ? 1 : 4; cstack.nl = 0; cstack.cname = xnew (cstack.size, char *); - cstack.cblev = xnew (cstack.size, int); + cstack.bracelev = xnew (cstack.size, int); } - tokoff = toklen = typdefcblev = 0; /* keep compiler quiet */ + tokoff = toklen = typdefbracelev = 0; /* keep compiler quiet */ curndx = newndx = 0; - lineno = 0; - charno = 0; lp = curlb.buffer; *lp = 0; @@ -2831,10 +3229,7 @@ yacc_rules = FALSE; midtoken = inquote = inchar = incomm = quotednl = FALSE; token.valid = savetoken.valid = FALSE; - cblev = 0; - parlev = 0; - cplpl = (c_ext & C_PLPL) == C_PLPL; - cjava = (c_ext & C_JAVA) == C_JAVA; + bracelev = bracketlev = parlev = attrparlev = templatelev = 0; if (cjava) { qualifier = "."; qlen = 1; } else @@ -2846,8 +3241,8 @@ c = *lp++; if (c == '\\') { - /* If we're at the end of the line, the next character is a - '\0'; don't skip it, because it's the thing that tells us + /* If we are at the end of the line, the next character is a + '\0'; do not skip it, because it is what tells us to read the next line. */ if (*lp == '\0') { @@ -2906,107 +3301,127 @@ } continue; } - else - switch (c) - { - case '"': - inquote = TRUE; - switch (fvdef) - { - case fdefunkey: - case fstartlist: - case finlist: - case fignore: - case vignore: - break; - default: - fvextern = FALSE; - fvdef = fvnone; - } - continue; - case '\'': - inchar = TRUE; - if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) - { - fvextern = FALSE; - fvdef = fvnone; - } - continue; - case '/': - if (*lp == '*') - { - lp++; - incomm = TRUE; + else if (bracketlev > 0) + { + switch (c) + { + case ']': + if (--bracketlev > 0) continue; - } - else if (/* cplpl && */ *lp == '/') - { - c = '\0'; - break; - } - else break; - case '%': - if ((c_ext & YACC) && *lp == '%') - { - /* Entering or exiting rules section in yacc file. */ - lp++; - definedef = dnone; fvdef = fvnone; fvextern = FALSE; - typdef = tnone; structdef = snone; - midtoken = inquote = inchar = incomm = quotednl = FALSE; - cblev = 0; - yacc_rules = !yacc_rules; - continue; - } - else + case '\0': + CNL_SAVE_DEFINEDEF (); + break; + } + continue; + } + else switch (c) + { + case '"': + inquote = TRUE; + if (inattribute) + break; + switch (fvdef) + { + case fdefunkey: + case fstartlist: + case finlist: + case fignore: + case vignore: + break; + default: + fvextern = FALSE; + fvdef = fvnone; + } + continue; + case '\'': + inchar = TRUE; + if (inattribute) + break; + if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) + { + fvextern = FALSE; + fvdef = fvnone; + } + continue; + case '/': + if (*lp == '*') + { + lp++; + incomm = TRUE; + continue; + } + else if (/* cplpl && */ *lp == '/') + { + c = '\0'; break; - case '#': - if (definedef == dnone) - { - char *cp; - bool cpptoken = TRUE; - - /* Look back on this line. If all blanks, or nonblanks - followed by an end of comment, this is a preprocessor - token. */ - for (cp = newlb.buffer; cp < lp-1; cp++) - if (!iswhite (*cp)) - { - if (*cp == '*' && *(cp+1) == '/') - { - cp++; - cpptoken = TRUE; - } - else - cpptoken = FALSE; - } - if (cpptoken) - definedef = dsharpseen; - } /* if (definedef == dnone) */ + } + else + break; + case '%': + if ((c_ext & YACC) && *lp == '%') + { + /* Entering or exiting rules section in yacc file. */ + lp++; + definedef = dnone; fvdef = fvnone; fvextern = FALSE; + typdef = tnone; structdef = snone; + midtoken = inquote = inchar = incomm = quotednl = FALSE; + bracelev = 0; + yacc_rules = !yacc_rules; + continue; + } + else + break; + case '#': + if (definedef == dnone) + { + char *cp; + bool cpptoken = TRUE; + /* Look back on this line. If all blanks, or nonblanks + followed by an end of comment, this is a preprocessor + token. */ + for (cp = newlb.buffer; cp < lp-1; cp++) + if (!iswhite (*cp)) + { + if (*cp == '*' && *(cp+1) == '/') + { + cp++; + cpptoken = TRUE; + } + else + cpptoken = FALSE; + } + if (cpptoken) + definedef = dsharpseen; + } /* if (definedef == dnone) */ + continue; + case '[': + bracketlev++; continue; - } /* switch (c) */ + } /* switch (c) */ /* Consider token only if some involved conditions are satisfied. */ if (typdef != tignore && definedef != dignorerest && fvdef != finlist - && structdef != sintemplate + && templatelev == 0 && (definedef != dnone - || structdef != scolonseen)) + || structdef != scolonseen) + && !inattribute) { if (midtoken) { if (endtoken (c)) { - if (c == ':' && cplpl && *lp == ':' && begtoken (lp[1])) + if (c == ':' && *lp == ':' && begtoken (lp[1])) + /* This handles :: in the middle, + but not at the beginning of an identifier. + Also, space-separated :: is not recognised. */ { - /* - * This handles :: in the middle, but not at the - * beginning of an identifier. Also, space-separated - * :: is not recognised. - */ + if (c_ext & C_AUTO) /* automatic detection of C++ */ + c_ext = (c_ext | C_PLPL) & ~C_AUTO; lp += 2; toklen += 2; c = lp[-1]; @@ -3018,7 +3433,8 @@ if (yacc_rules || consider_token (newlb.buffer + tokoff, toklen, c, - &c_ext, cblev, parlev, &funorvar)) + &c_ext, bracelev, parlev, + &funorvar)) { if (fvdef == foperator) { @@ -3033,7 +3449,7 @@ toklen += lp - oldlp; } token.named = FALSE; - if ((c_ext & C_EXT) /* not pure C */ + if (!plainc && nestlev > 0 && definedef == dnone) /* in struct body */ { @@ -3103,7 +3519,7 @@ || (funorvar && definedef == dnone && structdef == snone - && cblev > 0)); + && bracelev > 0)); } token.lineno = lineno; token.offset = tokoff; @@ -3128,6 +3544,16 @@ || instruct) make_C_tag (funorvar); } + else /* not yacc and consider_token failed */ + { + if (inattribute && fvdef == fignore) + { + /* We have just met __attribute__ after a + function parameter list: do not tag the + function again. */ + fvdef = fvnone; + } + } midtoken = FALSE; } } /* if (endtoken (c)) */ @@ -3146,24 +3572,28 @@ switch (fvdef) { case fstartlist: + /* This prevents tagging fb in + void (__attribute__((noreturn)) *fb) (void); + Fixing this is not easy and not very important. */ fvdef = finlist; continue; case flistseen: - make_C_tag (TRUE); /* a function */ - fvdef = fignore; - break; - case fvnameseen: - fvdef = fvnone; + if (plainc || declarations) + { + make_C_tag (TRUE); /* a function */ + fvdef = fignore; + } break; } if (structdef == stagseen && !cjava) { - popclass_above (cblev); + popclass_above (bracelev); structdef = snone; } break; case dsharpseen: savetoken = token; + break; } if (!yacc_rules || lp == newlb.buffer + 1) { @@ -3181,6 +3611,8 @@ switch (c) { case ':': + if (inattribute) + break; if (yacc_rules && token.offset == 0 && token.valid) { make_C_tag (FALSE); /* a yacc function */ @@ -3202,10 +3634,20 @@ break; } if (structdef == stagseen) - structdef = scolonseen; + { + structdef = scolonseen; + break; + } + /* Should be useless, but may be work as a safety net. */ + if (cplpl && fvdef == flistseen) + { + make_C_tag (TRUE); /* a function */ + fvdef = fignore; + break; + } break; case ';': - if (definedef != dnone) + if (definedef != dnone || inattribute) break; switch (typdef) { @@ -3221,11 +3663,11 @@ switch (fvdef) { case fignore: - if (typdef == tignore) + if (typdef == tignore || cplpl) fvdef = fvnone; break; case fvnameseen: - if ((globals && cblev == 0 && (!fvextern || declarations)) + if ((globals && bracelev == 0 && (!fvextern || declarations)) || (members && instruct)) make_C_tag (FALSE); /* a variable */ fvextern = FALSE; @@ -3233,20 +3675,20 @@ token.valid = FALSE; break; case flistseen: - if ((declarations && typdef == tnone && !instruct) - || (members && typdef != tignore && instruct)) - make_C_tag (TRUE); /* a function declaration */ + if ((declarations + && (cplpl || !instruct) + && (typdef == tnone || (typdef != tignore && instruct))) + || (members + && plainc && instruct)) + make_C_tag (TRUE); /* a function */ /* FALLTHRU */ default: fvextern = FALSE; fvdef = fvnone; if (declarations - && structdef == stagseen && (c_ext & C_PLPL)) + && cplpl && structdef == stagseen) make_C_tag (FALSE); /* forward declaration */ else - /* The following instruction invalidates the token. - Probably the token should be invalidated in all other - cases where some state machine is reset prematurely. */ token.valid = FALSE; } /* switch (fvdef) */ /* FALLTHRU */ @@ -3258,7 +3700,7 @@ structdef = snone; break; case ',': - if (definedef != dnone) + if (definedef != dnone || inattribute) break; switch (objdef) { @@ -3280,16 +3722,20 @@ case fdefunname: fvdef = fignore; break; - case fvnameseen: /* a variable */ - if ((globals && cblev == 0 && (!fvextern || declarations)) - || (members && instruct)) - make_C_tag (FALSE); + case fvnameseen: + if (parlev == 0 + && ((globals + && bracelev == 0 + && templatelev == 0 + && (!fvextern || declarations)) + || (members && instruct))) + make_C_tag (FALSE); /* a variable */ break; - case flistseen: /* a function */ + case flistseen: if ((declarations && typdef == tnone && !instruct) || (members && typdef != tignore && instruct)) { - make_C_tag (TRUE); /* a function declaration */ + make_C_tag (TRUE); /* a function */ fvdef = fvnameseen; } else if (!declarations) @@ -3302,8 +3748,8 @@ if (structdef == stagseen) structdef = snone; break; - case '[': - if (definedef != dnone) + case ']': + if (definedef != dnone || inattribute) break; if (structdef == stagseen) structdef = snone; @@ -3324,8 +3770,8 @@ case vignore: break; case fvnameseen: - if ((members && cblev == 1) - || (globals && cblev == 0 + if ((members && bracelev == 1) + || (globals && bracelev == 0 && (!fvextern || declarations))) make_C_tag (FALSE); /* a variable */ /* FALLTHRU */ @@ -3336,6 +3782,11 @@ } break; case '(': + if (inattribute) + { + attrparlev++; + break; + } if (definedef != dnone) break; if (objdef == otagseen && parlev == 0) @@ -3365,6 +3816,12 @@ parlev++; break; case ')': + if (inattribute) + { + if (--attrparlev == 0) + inattribute = FALSE; + break; + } if (definedef != dnone) break; if (objdef == ocatseen && parlev == 1) @@ -3398,9 +3855,9 @@ if (typdef == ttypeseen) { /* Whenever typdef is set to tinbody (currently only - here), typdefcblev should be set to cblev. */ + here), typdefbracelev should be set to bracelev. */ typdef = tinbody; - typdefcblev = cblev; + typdefbracelev = bracelev; } switch (fvdef) { @@ -3424,48 +3881,56 @@ break; default: /* Neutralize `extern "C" {' grot. */ - if (cblev == 0 && structdef == snone && nestlev == 0 + if (bracelev == 0 && structdef == snone && nestlev == 0 && typdef == tnone) - cblev = -1; + bracelev = -1; } + break; } switch (structdef) { case skeyseen: /* unnamed struct */ - pushclass_above (cblev, NULL, 0); + pushclass_above (bracelev, NULL, 0); structdef = snone; break; case stagseen: /* named struct or enum */ case scolonseen: /* a class */ - pushclass_above (cblev, token.line+token.offset, token.length); + pushclass_above (bracelev,token.line+token.offset, token.length); structdef = snone; make_C_tag (FALSE); /* a struct or enum */ break; } - cblev++; + bracelev++; break; case '*': if (definedef != dnone) break; if (fvdef == fstartlist) - fvdef = fvnone; /* avoid tagging `foo' in `foo (*bar()) ()' */ + { + fvdef = fvnone; /* avoid tagging `foo' in `foo (*bar()) ()' */ + token.valid = FALSE; + } break; case '}': if (definedef != dnone) break; - if (!noindentypedefs && lp == newlb.buffer + 1) + if (!ignoreindent && lp == newlb.buffer + 1) { - cblev = 0; /* reset curly brace level if first column */ + if (bracelev != 0) + token.valid = FALSE; + bracelev = 0; /* reset brace level if first column */ parlev = 0; /* also reset paren level, just in case... */ } - else if (cblev > 0) - cblev--; - popclass_above (cblev); + else if (bracelev > 0) + bracelev--; + else + token.valid = FALSE; /* something gone amiss, token unreliable */ + popclass_above (bracelev); structdef = snone; - /* Only if typdef == tinbody is typdefcblev significant. */ - if (typdef == tinbody && cblev <= typdefcblev) + /* Only if typdef == tinbody is typdefbracelev significant. */ + if (typdef == tinbody && bracelev <= typdefbracelev) { - assert (cblev == typdefcblev); + assert (bracelev == typdefbracelev); typdef = tend; } break; @@ -3480,8 +3945,8 @@ case vignore: break; case fvnameseen: - if ((members && cblev == 1) - || (globals && cblev == 0 && (!fvextern || declarations))) + if ((members && bracelev == 1) + || (globals && bracelev == 0 && (!fvextern || declarations))) make_C_tag (FALSE); /* a variable */ /* FALLTHRU */ default: @@ -3489,30 +3954,31 @@ } break; case '<': - if (cplpl && structdef == stagseen) + if (cplpl + && (structdef == stagseen || fvdef == fvnameseen)) { - structdef = sintemplate; + templatelev++; break; } goto resetfvdef; case '>': - if (structdef == sintemplate) + if (templatelev > 0) { - structdef = stagseen; + templatelev--; break; } goto resetfvdef; case '+': case '-': - if (objdef == oinbody && cblev == 0) + if (objdef == oinbody && bracelev == 0) { objdef = omethodsign; break; } /* FALLTHRU */ resetfvdef: - case '#': case '~': case '&': case '%': case '/': case '|': - case '^': case '!': case '.': case '?': case ']': + case '#': case '~': case '&': case '%': case '/': + case '|': case '^': case '!': case '.': case '?': if (definedef != dnone) break; /* These surely cannot follow a function tag in C. */ @@ -3543,7 +4009,6 @@ } /* while not eof */ - free (token_name.buffer); free (lbs[0].lb.buffer); free (lbs[1].lb.buffer); } @@ -3602,18 +4067,17 @@ /* Useful macros. */ #define LOOP_ON_INPUT_LINES(file_pointer, line_buffer, char_pointer) \ - for (lineno = charno = 0; /* loop initialization */ \ + for (; /* loop initialization */ \ !feof (file_pointer) /* loop test */ \ - && (lineno++, /* instructions at start of loop */ \ - linecharno = charno, \ - charno += readline (&line_buffer, file_pointer), \ - char_pointer = lb.buffer, \ + && /* instructions at start of loop */ \ + (readline (&line_buffer, file_pointer), \ + char_pointer = line_buffer.buffer, \ TRUE); \ ) #define LOOKING_AT(cp, keyword) /* keyword is a constant string */ \ - (strneq ((cp), keyword, sizeof(keyword)-1) /* cp points at kyword */ \ - && iswhite((cp)[sizeof(keyword)-1]) /* followed by a blank */ \ - && ((cp) = skip_spaces((cp)+sizeof(keyword)-1))) /* skip blanks */ + (strneq ((cp), keyword, sizeof(keyword)-1) /* cp points at keyword */ \ + && notinname ((cp)[sizeof(keyword)-1]) /* end of keyword */ \ + && ((cp) = skip_spaces((cp)+sizeof(keyword)-1))) /* skip spaces */ /* * Read a file, but do no processing. This is used to do regexp @@ -3632,28 +4096,11 @@ /* Fortran parsing */ -static bool tail __P((char *)); -static void takeprec __P((void)); -static void getit __P((FILE *)); - -static bool -tail (cp) - char *cp; -{ - register int len = 0; - - while (*cp != '\0' && lowcase (*cp) == lowcase (dbp[len])) - cp++, len++; - if (*cp == '\0' && !intoken (dbp[len])) - { - dbp += len; - return TRUE; - } - return FALSE; -} +static void F_takeprec __P((void)); +static void F_getit __P((FILE *)); static void -takeprec () +F_takeprec () { dbp = skip_spaces (dbp); if (*dbp != '*') @@ -3676,7 +4123,7 @@ } static void -getit (inf) +F_getit (inf) FILE *inf; { register char *cp; @@ -3684,9 +4131,7 @@ dbp = skip_spaces (dbp); if (*dbp == '\0') { - lineno++; - linecharno = charno; - charno += readline (&lb, inf); + readline (&lb, inf); dbp = lb.buffer; if (dbp[5] != '&') return; @@ -3697,8 +4142,8 @@ return; for (cp = dbp + 1; *cp != '\0' && intoken (*cp); cp++) continue; - pfnote (savenstr (dbp, cp-dbp), TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + make_tag (dbp, cp-dbp, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } @@ -3716,28 +4161,28 @@ switch (lowcase (*dbp)) { case 'i': - if (tail ("integer")) - takeprec (); + if (nocase_tail ("integer")) + F_takeprec (); break; case 'r': - if (tail ("real")) - takeprec (); + if (nocase_tail ("real")) + F_takeprec (); break; case 'l': - if (tail ("logical")) - takeprec (); + if (nocase_tail ("logical")) + F_takeprec (); break; case 'c': - if (tail ("complex") || tail ("character")) - takeprec (); + if (nocase_tail ("complex") || nocase_tail ("character")) + F_takeprec (); break; case 'd': - if (tail ("double")) + if (nocase_tail ("double")) { dbp = skip_spaces (dbp); if (*dbp == '\0') continue; - if (tail ("precision")) + if (nocase_tail ("precision")) break; continue; } @@ -3749,26 +4194,26 @@ switch (lowcase (*dbp)) { case 'f': - if (tail ("function")) - getit (inf); + if (nocase_tail ("function")) + F_getit (inf); continue; case 's': - if (tail ("subroutine")) - getit (inf); + if (nocase_tail ("subroutine")) + F_getit (inf); continue; case 'e': - if (tail ("entry")) - getit (inf); + if (nocase_tail ("entry")) + F_getit (inf); continue; case 'b': - if (tail ("blockdata") || tail ("block data")) + if (nocase_tail ("blockdata") || nocase_tail ("block data")) { dbp = skip_spaces (dbp); if (*dbp == '\0') /* assume un-named */ - pfnote (savestr ("blockdata"), TRUE, - lb.buffer, dbp - lb.buffer, lineno, linecharno); + make_tag ("blockdata", 9, TRUE, + lb.buffer, dbp - lb.buffer, lineno, linecharno); else - getit (inf); /* look for name */ + F_getit (inf); /* look for name */ } continue; } @@ -3778,15 +4223,16 @@ /* * Ada parsing - * Philippe Waroquiers (1998) + * Original code by + * Philippe Waroquiers (1998) */ -static void adagetit __P((FILE *, char *)); +static void Ada_getit __P((FILE *, char *)); /* Once we are positioned after an "interesting" keyword, let's get the real tag value necessary. */ static void -adagetit (inf, name_qualifier) +Ada_getit (inf, name_qualifier) FILE *inf; char *name_qualifier; { @@ -3800,16 +4246,13 @@ if (*dbp == '\0' || (dbp[0] == '-' && dbp[1] == '-')) { - lineno++; - linecharno = charno; - charno += readline (&lb, inf); + readline (&lb, inf); dbp = lb.buffer; } - switch (*dbp) + switch (lowcase(*dbp)) { case 'b': - case 'B': - if (tail ("body")) + if (nocase_tail ("body")) { /* Skipping body of procedure body or package body or .... resetting qualifier to body instead of spec. */ @@ -3818,9 +4261,8 @@ } break; case 't': - case 'T': /* Skipping type of task type or protected type ... */ - if (tail ("type")) + if (nocase_tail ("type")) continue; break; } @@ -3845,7 +4287,9 @@ *cp = '\0'; name = concat (dbp, name_qualifier, ""); *cp = c; - pfnote (name, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + make_tag (name, strlen (name), TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + free (name); if (c == '"') dbp = cp + 1; return; @@ -3857,6 +4301,7 @@ FILE *inf; { bool inquote = FALSE; + bool skip_till_semicolumn = FALSE; LOOP_ON_INPUT_LINES (inf, lb, dbp) { @@ -3893,6 +4338,14 @@ continue; } + if (skip_till_semicolumn) + { + if (*dbp == ';') + skip_till_semicolumn = FALSE; + dbp++; + continue; /* advance char */ + } + /* Search for beginning of a token. */ if (!begtoken (*dbp)) { @@ -3901,33 +4354,40 @@ } /* We are at the beginning of a token. */ - switch (*dbp) + switch (lowcase(*dbp)) { case 'f': - case 'F': - if (!packages_only && tail ("function")) - adagetit (inf, "/f"); + if (!packages_only && nocase_tail ("function")) + Ada_getit (inf, "/f"); else break; /* from switch */ continue; /* advance char */ case 'p': - case 'P': - if (!packages_only && tail ("procedure")) - adagetit (inf, "/p"); - else if (tail ("package")) - adagetit (inf, "/s"); - else if (tail ("protected")) /* protected type */ - adagetit (inf, "/t"); + if (!packages_only && nocase_tail ("procedure")) + Ada_getit (inf, "/p"); + else if (nocase_tail ("package")) + Ada_getit (inf, "/s"); + else if (nocase_tail ("protected")) /* protected type */ + Ada_getit (inf, "/t"); else break; /* from switch */ continue; /* advance char */ + + case 'u': + if (typedefs && !packages_only && nocase_tail ("use")) + { + /* when tagging types, avoid tagging use type Pack.Typename; + for this, we will skip everything till a ; */ + skip_till_semicolumn = TRUE; + continue; /* advance char */ + } + case 't': - case 'T': - if (!packages_only && tail ("task")) - adagetit (inf, "/k"); - else if (typedefs && !packages_only && tail ("type")) + if (!packages_only && nocase_tail ("task")) + Ada_getit (inf, "/k"); + else if (typedefs && !packages_only && nocase_tail ("type")) { - adagetit (inf, "/t"); + Ada_getit (inf, "/t"); while (*dbp != '\0') dbp += 1; } @@ -3946,9 +4406,9 @@ /* - * Bob Weiner, Motorola Inc., 4/3/94 * Unix and microcontroller assembly tag handling - * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]' + * Labels: /^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]/ + * Idea by Bob Weiner, Motorola Inc. (1994) */ static void Asm_labels (inf) @@ -3967,11 +4427,9 @@ while (ISALNUM (*cp) || *cp == '_' || *cp == '.' || *cp == '$') cp++; if (*cp == ':' || iswhite (*cp)) - { - /* Found end of label, so copy it and add it to the table. */ - pfnote (savenstr(lb.buffer, cp-lb.buffer), TRUE, + /* Found end of label, so copy it and add it to the table. */ + make_tag (lb.buffer, cp - lb.buffer, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); - } } } } @@ -3979,59 +4437,83 @@ /* * Perl support - * Perl sub names: look for /^sub[ \t\n]+[^ \t\n{]+/ + * Perl sub names: /^sub[ \t\n]+[^ \t\n{]+/ * Perl variable names: /^(my|local).../ - * Bart Robinson (1995) - * Michael Ernst (1997) + * Original code by Bart Robinson (1995) + * Additions by Michael Ernst (1997) + * Ideas by Kai Großjohann (2001) */ static void Perl_functions (inf) FILE *inf; { + char *package = savestr ("main"); /* current package name */ register char *cp; LOOP_ON_INPUT_LINES (inf, lb, cp) { - if (LOOKING_AT (cp, "sub")) + skip_spaces(cp); + + if (LOOKING_AT (cp, "package")) { - if (*cp != '\0') - { - char *sp = cp; - while (*cp != '\0' - && !iswhite (*cp) && *cp != '{' && *cp != '(') - cp++; - pfnote (savenstr (sp, cp-sp), TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); - } + free (package); + get_tag (cp, &package); + } + else if (LOOKING_AT (cp, "sub")) + { + char *pos; + char *sp = cp; + + while (!notinname (*cp)) + cp++; + if (cp == sp) + continue; /* nothing found */ + if ((pos = etags_strchr (sp, ':')) != NULL + && pos < cp && pos[1] == ':') + /* The name is already qualified. */ + make_tag (sp, cp - sp, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + else + /* Qualify it. */ + { + char savechar, *name; + + savechar = *cp; + *cp = '\0'; + name = concat (package, "::", sp); + *cp = savechar; + make_tag (name, strlen(name), TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + free (name); + } } - else if (globals /* only if tagging global vars is enabled */ - && ((strneq (cp, "my", 2) && (cp+=2)) - || (strneq (cp, "local", 5) && (cp+=5))) - && (*cp == '(' || iswhite (*cp))) + else if (globals) /* only if we are tagging global vars */ { + /* Skip a qualifier, if any. */ + bool qual = LOOKING_AT (cp, "my") || LOOKING_AT (cp, "local"); /* After "my" or "local", but before any following paren or space. */ - char *varname = NULL; + char *varstart = cp; - cp = skip_spaces (cp); - if (*cp == '$' || *cp == '@' || *cp == '%') + if (qual /* should this be removed? If yes, how? */ + && (*cp == '$' || *cp == '@' || *cp == '%')) { - char* varstart = ++cp; - while (ISALNUM (*cp) || *cp == '_') + varstart += 1; + do cp++; - varname = savenstr (varstart, cp-varstart); + while (ISALNUM (*cp) || *cp == '_'); } - else + else if (qual) { /* Should be examining a variable list at this point; could insist on seeing an open parenthesis. */ while (*cp != '\0' && *cp != ';' && *cp != '=' && *cp != ')') cp++; } + else + continue; - /* Perhaps I should back cp up one character, so the TAGS table - doesn't mention (and so depend upon) the following char. */ - pfnote ((CTAGS) ? savenstr (lb.buffer, cp-lb.buffer) : varname, - FALSE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + make_tag (varstart, cp - varstart, FALSE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } } @@ -4039,8 +4521,9 @@ /* * Python support - * Look for /^def[ \t\n]+[^ \t\n(:]+/ or /^class[ \t\n]+[^ \t\n(:]+/ - * Eric S. Raymond (1997) + * Look for /^[\t]*def[ \t\n]+[^ \t\n(:]+/ or /^class[ \t\n]+[^ \t\n(:]+/ + * Idea by Eric S. Raymond (1997) + * More ideas by seb bacon (2002) */ static void Python_functions (inf) @@ -4049,13 +4532,17 @@ register char *cp; LOOP_ON_INPUT_LINES (inf, lb, cp) - if (LOOKING_AT (cp, "def") || LOOKING_AT (cp, "class")) - { - while (*cp != '\0' && !iswhite (*cp) && *cp != '(' && *cp != ':') - cp++; - pfnote (NULL, TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); - } + { + cp = skip_spaces (cp); + if (LOOKING_AT (cp, "def") || LOOKING_AT (cp, "class")) + { + char *name = cp; + while (!notinname (*cp) && *cp != ':') + cp++; + make_tag (name, cp - name, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } + } } @@ -4067,25 +4554,26 @@ * - /^[ \t]*define\(\"[^\"]+/ * Only with --members: * - /^[ \t]*var[ \t\n]+\$[^ \t\n=;]/ - * originally by Diez B. Roggisch 2001-06-06 + * Idea by Diez B. Roggisch (2001) */ static void PHP_functions (inf) FILE *inf; { - register char *cp; + register char *cp, *name; bool search_identifier = FALSE; LOOP_ON_INPUT_LINES (inf, lb, cp) { cp = skip_spaces (cp); + name = cp; if (search_identifier && *cp != '\0') { - while (*cp != '\0' && !iswhite (*cp) && *cp != '(') + while (!notinname (*cp)) cp++; - pfnote (NULL, TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + make_tag (name, cp - name, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); search_identifier = FALSE; } else if (LOOKING_AT (cp, "function")) @@ -4094,10 +4582,11 @@ cp = skip_spaces (cp+1); if(*cp != '\0') { - while (*cp != '\0' && !iswhite (*cp) && *cp != '(') + name = cp; + while (!notinname (*cp)) cp++; - pfnote (NULL, TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + make_tag (name, cp - name, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } else search_identifier = TRUE; @@ -4106,10 +4595,11 @@ { if (*cp != '\0') { + name = cp; while (*cp != '\0' && !iswhite (*cp)) cp++; - pfnote (NULL, FALSE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + make_tag (name, cp - name, FALSE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } else search_identifier = TRUE; @@ -4120,28 +4610,31 @@ && (*cp == '"' || *cp == '\'')) { char quote = *cp++; + name = cp; while (*cp != quote && *cp != '\0') cp++; - pfnote (NULL, FALSE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + make_tag (name, cp - name, FALSE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } else if (members && LOOKING_AT (cp, "var") && *cp == '$') { - while (*cp != '=' && *cp != ';' && *cp != '\0' && !iswhite(*cp)) + name = cp; + while (!notinname(*cp)) cp++; - pfnote (NULL, FALSE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + make_tag (name, cp - name, FALSE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } } -/* Idea by Corny de Souza +/* * Cobol tag functions * We could look for anything that could be a paragraph name. * i.e. anything that starts in column 8 is one word and ends in a full stop. + * Idea by Corny de Souza (1993) */ static void Cobol_paragraphs (inf) @@ -4162,15 +4655,15 @@ for (ep = bp; ISALNUM (*ep) || *ep == '-'; ep++) continue; if (*ep++ == '.') - pfnote (savenstr (bp, ep-bp), TRUE, - lb.buffer, ep - lb.buffer + 1, lineno, linecharno); + make_tag (bp, ep - bp, TRUE, + lb.buffer, ep - lb.buffer + 1, lineno, linecharno); } } /* * Makefile support - * Idea by Assar Westerlund (2001) + * Ideas by Assar Westerlund (2001) */ static void Makefile_targets (inf) @@ -4184,17 +4677,17 @@ continue; while (*bp != '\0' && *bp != '=' && *bp != ':') bp++; - if (*bp == ':') - pfnote (savenstr (lb.buffer, bp - lb.buffer), TRUE, - lb.buffer, bp - lb.buffer + 1, lineno, linecharno); + if (*bp == ':' || (globals && *bp == '=')) + make_tag (lb.buffer, bp - lb.buffer, TRUE, + lb.buffer, bp - lb.buffer + 1, lineno, linecharno); } } -/* Added by Mosur Mohan, 4/22/88 */ -/* Pascal parsing */ - /* + * Pascal parsing + * Original code by Mosur K. Mohan (1989) + * * Locates tags for procedures & functions. Doesn't do any type- or * var-definitions. It does look for the keyword "extern" or * "forward" immediately following the procedure statement; if found, @@ -4206,8 +4699,8 @@ { linebuffer tline; /* mostly copied from C_entries */ long save_lcno; - int save_lineno, save_len; - char c, *cp, *namebuf; + int save_lineno, namelen, taglen; + char c, *name; bool /* each of these flags is TRUE iff: */ incomment, /* point is inside a comment */ @@ -4221,17 +4714,15 @@ is a FORWARD/EXTERN to be ignored, or whether it is a real tag */ - save_lcno = save_lineno = save_len = 0; /* keep compiler quiet */ - namebuf = NULL; /* keep compiler quiet */ - lineno = 0; - charno = 0; + save_lcno = save_lineno = namelen = taglen = 0; /* keep compiler quiet */ + name = NULL; /* keep compiler quiet */ dbp = lb.buffer; *dbp = '\0'; - initbuffer (&tline); + linebuffer_init (&tline); incomment = inquote = FALSE; found_tag = FALSE; /* have a proc name; check if extern */ - get_tagname = FALSE; /* have found "procedure" keyword */ + get_tagname = FALSE; /* found "procedure" keyword */ inparms = FALSE; /* found '(' after "proc" */ verify_tag = FALSE; /* check if "extern" is ahead */ @@ -4241,9 +4732,7 @@ c = *dbp++; if (c == '\0') /* if end of line */ { - lineno++; - linecharno = charno; - charno += readline (&lb, inf); + readline (&lb, inf); dbp = lb.buffer; if (*dbp == '\0') continue; @@ -4302,12 +4791,12 @@ } if (found_tag && verify_tag && (*dbp != ' ')) { - /* check if this is an "extern" declaration */ + /* Check if this is an "extern" declaration. */ if (*dbp == '\0') continue; if (lowcase (*dbp == 'e')) { - if (tail ("extern")) /* superfluous, really! */ + if (nocase_tail ("extern")) /* superfluous, really! */ { found_tag = FALSE; verify_tag = FALSE; @@ -4315,7 +4804,7 @@ } else if (lowcase (*dbp) == 'f') { - if (tail ("forward")) /* check for forward reference */ + if (nocase_tail ("forward")) /* check for forward reference */ { found_tag = FALSE; verify_tag = FALSE; @@ -4325,50 +4814,54 @@ { found_tag = FALSE; verify_tag = FALSE; - pfnote (namebuf, TRUE, - tline.buffer, save_len, save_lineno, save_lcno); + make_tag (name, namelen, TRUE, + tline.buffer, taglen, save_lineno, save_lcno); continue; } } if (get_tagname) /* grab name of proc or fn */ { + char *cp; + if (*dbp == '\0') continue; - /* save all values for later tagging */ + /* Find block name. */ + for (cp = dbp + 1; *cp != '\0' && !endtoken (*cp); cp++) + continue; + + /* Save all values for later tagging. */ linebuffer_setlen (&tline, lb.len); strcpy (tline.buffer, lb.buffer); save_lineno = lineno; save_lcno = linecharno; + name = tline.buffer + (dbp - lb.buffer); + namelen = cp - dbp; + taglen = cp - lb.buffer + 1; - /* grab block name */ - for (cp = dbp + 1; *cp != '\0' && !endtoken (*cp); cp++) - continue; - namebuf = savenstr (dbp, cp-dbp); dbp = cp; /* set dbp to e-o-token */ - save_len = dbp - lb.buffer + 1; get_tagname = FALSE; found_tag = TRUE; continue; - /* and proceed to check for "extern" */ + /* And proceed to check for "extern". */ } else if (!incomment && !inquote && !found_tag) { - /* check for proc/fn keywords */ + /* Check for proc/fn keywords. */ switch (lowcase (c)) { case 'p': - if (tail ("rocedure")) /* c = 'p', dbp has advanced */ + if (nocase_tail ("rocedure")) /* c = 'p', dbp has advanced */ get_tagname = TRUE; continue; case 'f': - if (tail ("unction")) + if (nocase_tail ("unction")) get_tagname = TRUE; continue; } } - } /* while not eof */ + } /* while not eof */ free (tline.buffer); } @@ -4379,56 +4872,22 @@ * look for (def or (DEF, quote or QUOTE */ -static int L_isdef __P((char *)); -static int L_isquote __P((char *)); static void L_getit __P((void)); -static int -L_isdef (strp) - register char *strp; -{ - return ((strp[1] == 'd' || strp[1] == 'D') - && (strp[2] == 'e' || strp[2] == 'E') - && (strp[3] == 'f' || strp[3] == 'F')); -} - -static int -L_isquote (strp) - register char *strp; -{ - return ((*++strp == 'q' || *strp == 'Q') - && (*++strp == 'u' || *strp == 'U') - && (*++strp == 'o' || *strp == 'O') - && (*++strp == 't' || *strp == 'T') - && (*++strp == 'e' || *strp == 'E') - && iswhite (*++strp)); -} - static void L_getit () { - register char *cp; - if (*dbp == '\'') /* Skip prefix quote */ dbp++; else if (*dbp == '(') { - if (L_isquote (dbp)) - dbp += 7; /* Skip "(quote " */ - else - dbp += 1; /* Skip "(" before name in (defstruct (foo)) */ - dbp = skip_spaces (dbp); + dbp++; + /* Try to skip "(quote " */ + if (!LOOKING_AT (dbp, "quote") && !LOOKING_AT (dbp, "QUOTE")) + /* Ok, then skip "(" before name in (defstruct (foo)) */ + dbp = skip_spaces (dbp); } - - for (cp = dbp /*+1*/; - *cp != '\0' && *cp != '(' && !iswhite(*cp) && *cp != ')'; - cp++) - continue; - if (cp == dbp) - return; - - pfnote (savenstr (dbp, cp-dbp), TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + get_tag (dbp, NULL); } static void @@ -4437,33 +4896,32 @@ { LOOP_ON_INPUT_LINES (inf, lb, dbp) { - if (dbp[0] == '(') + if (dbp[0] != '(') + continue; + + if (strneq (dbp+1, "def", 3) || strneq (dbp+1, "DEF", 3)) { - if (L_isdef (dbp)) - { - dbp = skip_non_spaces (dbp); - dbp = skip_spaces (dbp); - L_getit (); - } - else + dbp = skip_non_spaces (dbp); + dbp = skip_spaces (dbp); + L_getit (); + } + else + { + /* Check for (foo::defmumble name-defined ... */ + do + dbp++; + while (!notinname (*dbp) && *dbp != ':'); + if (*dbp == ':') { - /* Check for (foo::defmumble name-defined ... */ do dbp++; - while (*dbp != '\0' && !iswhite (*dbp) - && *dbp != ':' && *dbp != '(' && *dbp != ')'); - if (*dbp == ':') - { - do - dbp++; - while (*dbp == ':'); + while (*dbp == ':'); - if (L_isdef (dbp - 1)) - { - dbp = skip_non_spaces (dbp); - dbp = skip_spaces (dbp); - L_getit (); - } + if (strneq (dbp, "def", 3) || strneq (dbp, "DEF", 3)) + { + dbp = skip_non_spaces (dbp); + dbp = skip_spaces (dbp); + L_getit (); } } } @@ -4472,14 +4930,40 @@ /* + * Lua script language parsing + * Original code by David A. Capello (2004) + * + * "function" and "local function" are tags if they start at column 1. + */ +static void +Lua_functions (inf) + FILE *inf; +{ + register char *bp; + + LOOP_ON_INPUT_LINES (inf, lb, bp) + { + if (bp[0] != 'f' && bp[0] != 'l') + continue; + + LOOKING_AT (bp, "local"); /* skip possible "local" */ + + if (LOOKING_AT (bp, "function")) + get_tag (bp, NULL); + } +} + + +/* * Postscript tag functions * Just look for lines where the first character is '/' * Also look at "defineps" for PSWrap - * Richard Mlynarik (1997) - * Ideas by Masatake Yamato (1999) + * Ideas by: + * Richard Mlynarik (1997) + * Masatake Yamato (1999) */ static void -Postscript_functions (inf) +PS_functions (inf) FILE *inf; { register char *bp, *ep; @@ -4492,15 +4976,11 @@ *ep != '\0' && *ep != ' ' && *ep != '{'; ep++) continue; - pfnote (savenstr (bp, ep-bp), TRUE, - lb.buffer, ep - lb.buffer + 1, lineno, linecharno); - } - else if (strneq (bp, "defineps", 8)) - { - bp = skip_non_spaces (bp); - bp = skip_spaces (bp); - get_tag (bp); + make_tag (bp, ep - bp, TRUE, + lb.buffer, ep - lb.buffer + 1, lineno, linecharno); } + else if (LOOKING_AT (bp, "defineps")) + get_tag (bp, NULL); } } @@ -4508,9 +4988,10 @@ /* * Scheme tag functions * look for (def... xyzzy - * look for (def... (xyzzy - * look for (def ... ((...(xyzzy .... - * look for (set! xyzzy + * (def... (xyzzy + * (def ... ((...(xyzzy .... + * (set! xyzzy + * Original code by Ken Haase (1985?) */ static void @@ -4521,19 +5002,16 @@ LOOP_ON_INPUT_LINES (inf, lb, bp) { - if (bp[0] == '(' - && (bp[1] == 'D' || bp[1] == 'd') - && (bp[2] == 'E' || bp[2] == 'e') - && (bp[3] == 'F' || bp[3] == 'f')) + if (strneq (bp, "(def", 4) || strneq (bp, "(DEF", 4)) { - bp = skip_non_spaces (bp); + bp = skip_non_spaces (bp+4); /* Skip over open parens and white space */ - while (iswhite (*bp) || *bp == '(') + while (notinname (*bp)) bp++; - get_tag (bp); + get_tag (bp, NULL); } if (LOOKING_AT (bp, "(SET!") || LOOKING_AT (bp, "(set!")) - get_tag (bp); + get_tag (bp, NULL); } } @@ -4541,30 +5019,28 @@ /* Find tags in TeX and LaTeX input files. */ /* TEX_toktab is a table of TeX control sequences that define tags. - Each TEX_tabent records one such control sequence. - CONVERT THIS TO USE THE Stab TYPE!! */ -struct TEX_tabent -{ - char *name; - int len; -}; + * Each entry records one such control sequence. + * + * Original code from who knows whom. + * Ideas by: + * Stefan Monnier (2002) + */ -struct TEX_tabent *TEX_toktab = NULL; /* Table with tag tokens */ +static linebuffer *TEX_toktab = NULL; /* Table with tag tokens */ /* Default set of control sequences to put into TEX_toktab. The value of environment var TEXTAGS is prepended to this. */ - -char *TEX_defenv = "\ +static char *TEX_defenv = "\ :chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\ -:part:appendix:entry:index"; +:part:appendix:entry:index:def\ +:newcommand:renewcommand:newenvironment:renewenvironment"; static void TEX_mode __P((FILE *)); -static struct TEX_tabent *TEX_decode_env __P((char *, char *)); -static int TEX_Token __P((char *)); +static void TEX_decode_env __P((char *, char *)); -char TEX_esc = '\\'; -char TEX_opgrp = '{'; -char TEX_clgrp = '}'; +static char TEX_esc = '\\'; +static char TEX_opgrp = '{'; +static char TEX_clgrp = '}'; /* * TeX/LaTeX scanning loop. @@ -4573,46 +5049,64 @@ TeX_commands (inf) FILE *inf; { - char *cp, *lasthit; - register int i; + char *cp; + linebuffer *key; /* Select either \ or ! as escape character. */ TEX_mode (inf); /* Initialize token table once from environment. */ - if (!TEX_toktab) - TEX_toktab = TEX_decode_env ("TEXTAGS", TEX_defenv); + if (TEX_toktab == NULL) + TEX_decode_env ("TEXTAGS", TEX_defenv); LOOP_ON_INPUT_LINES (inf, lb, cp) { - lasthit = cp; - /* Look at each esc in line. */ - while ((cp = etags_strchr (cp, TEX_esc)) != NULL) + /* Look at each TEX keyword in line. */ + for (;;) { - if (*++cp == '\0') - break; - linecharno += cp - lasthit; - lasthit = cp; - i = TEX_Token (lasthit); - if (i >= 0) - { - /* We seem to include the TeX command in the tag name. - register char *p; - for (p = lasthit + TEX_toktab[i].len; - *p != '\0' && *p != TEX_clgrp; - p++) - continue; */ - pfnote (/*savenstr (lasthit, p-lasthit)*/ (char *)NULL, TRUE, - lb.buffer, lb.len, lineno, linecharno); - break; /* We only tag a line once */ - } + /* Look for a TEX escape. */ + while (*cp++ != TEX_esc) + if (cp[-1] == '\0' || cp[-1] == '%') + goto tex_next_line; + + for (key = TEX_toktab; key->buffer != NULL; key++) + if (strneq (cp, key->buffer, key->len)) + { + register char *p; + int namelen, linelen; + bool opgrp = FALSE; + + cp = skip_spaces (cp + key->len); + if (*cp == TEX_opgrp) + { + opgrp = TRUE; + cp++; + } + for (p = cp; + (!iswhite (*p) && *p != '#' && + *p != TEX_opgrp && *p != TEX_clgrp); + p++) + continue; + namelen = p - cp; + linelen = lb.len; + if (!opgrp || *p == TEX_clgrp) + { + while (*p != '\0' && *p != TEX_opgrp && *p != TEX_clgrp) + *p++; + linelen = p - lb.buffer + 1; + } + make_tag (cp, namelen, TRUE, + lb.buffer, linelen, lineno, linecharno); + goto tex_next_line; /* We only tag a line once */ + } } + tex_next_line: + ; } } #define TEX_LESC '\\' #define TEX_SESC '!' -#define TEX_cmt '%' /* Figure out whether TeX's escapechar is '\\' or '!' and set grouping chars accordingly. */ @@ -4625,7 +5119,7 @@ while ((c = getc (inf)) != EOF) { /* Skip to next line if we hit the TeX comment char. */ - if (c == TEX_cmt) + if (c == '%') while (c != '\n') c = getc (inf); else if (c == TEX_LESC || c == TEX_SESC ) @@ -4651,15 +5145,13 @@ /* Read environment and prepend it to the default string. Build token table. */ -static struct TEX_tabent * +static void TEX_decode_env (evarname, defenv) char *evarname; char *defenv; { register char *env, *p; - - struct TEX_tabent *tab; - int size, i; + int i, len; /* Append default string to environment. */ env = getenv (evarname); @@ -4672,78 +5164,187 @@ } /* Allocate a token table */ - for (size = 1, p = env; p;) + for (len = 1, p = env; p;) if ((p = etags_strchr (p, ':')) && *++p != '\0') - size++; - /* Add 1 to leave room for null terminator. */ - tab = xnew (size + 1, struct TEX_tabent); + len++; + TEX_toktab = xnew (len, linebuffer); /* Unpack environment string into token table. Be careful about */ /* zero-length strings (leading ':', "::" and trailing ':') */ - for (i = 0; *env;) + for (i = 0; *env != '\0';) { p = etags_strchr (env, ':'); if (!p) /* End of environment string. */ p = env + strlen (env); if (p - env > 0) { /* Only non-zero strings. */ - tab[i].name = savenstr (env, p - env); - tab[i].len = strlen (tab[i].name); + TEX_toktab[i].buffer = savenstr (env, p - env); + TEX_toktab[i].len = p - env; i++; } if (*p) env = p + 1; else { - tab[i].name = NULL; /* Mark end of table. */ - tab[i].len = 0; + TEX_toktab[i].buffer = NULL; /* Mark end of table. */ + TEX_toktab[i].len = 0; break; } } - return tab; } -/* If the text at CP matches one of the tag-defining TeX command names, - return the pointer to the first occurrence of that command in TEX_toktab. - Otherwise return -1. - Keep the capital `T' in `token' for dumb truncating compilers - (this distinguishes it from `TEX_toktab' */ -static int -TEX_Token (cp) - char *cp; + +/* Texinfo support. Dave Love, Mar. 2000. */ +static void +Texinfo_nodes (inf) + FILE * inf; { - int i; + char *cp, *start; + LOOP_ON_INPUT_LINES (inf, lb, cp) + if (LOOKING_AT (cp, "@node")) + { + start = cp; + while (*cp != '\0' && *cp != ',') + cp++; + make_tag (start, cp - start, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } +} + + +/* Similar to LOOKING_AT but does not use notinname, does not skip */ +#define LOOKING_AT_NOCASE(cp, kw) /* kw is a constant string */ \ + (strncaseeq ((cp), kw, sizeof(kw)-1) /* cp points at kw */ \ + && ((cp) += sizeof(kw)-1)) /* skip spaces */ + +/* + * HTML support. + * Contents of , <h1>, <h2>, <h3> are tags. + * Contents of <a name=xxx> are tags with name xxx. + * + * Francesco Potortì, 2002. + */ +static void +HTML_labels (inf) + FILE * inf; +{ + bool getnext = FALSE; /* next text outside of HTML tags is a tag */ + bool skiptag = FALSE; /* skip to the end of the current HTML tag */ + bool intag = FALSE; /* inside an html tag, looking for ID= */ + bool inanchor = FALSE; /* when INTAG, is an anchor, look for NAME= */ + char *end; + + + linebuffer_setlen (&token_name, 0); /* no name in buffer */ + + LOOP_ON_INPUT_LINES (inf, lb, dbp) + for (;;) /* loop on the same line */ + { + if (skiptag) /* skip HTML tag */ + { + while (*dbp != '\0' && *dbp != '>') + dbp++; + if (*dbp == '>') + { + dbp += 1; + skiptag = FALSE; + continue; /* look on the same line */ + } + break; /* go to next line */ + } + + else if (intag) /* look for "name=" or "id=" */ + { + while (*dbp != '\0' && *dbp != '>' + && lowcase (*dbp) != 'n' && lowcase (*dbp) != 'i') + dbp++; + if (*dbp == '\0') + break; /* go to next line */ + if (*dbp == '>') + { + dbp += 1; + intag = FALSE; + continue; /* look on the same line */ + } + if ((inanchor && LOOKING_AT_NOCASE (dbp, "name=")) + || LOOKING_AT_NOCASE (dbp, "id=")) + { + bool quoted = (dbp[0] == '"'); + + if (quoted) + for (end = ++dbp; *end != '\0' && *end != '"'; end++) + continue; + else + for (end = dbp; *end != '\0' && intoken (*end); end++) + continue; + linebuffer_setlen (&token_name, end - dbp); + strncpy (token_name.buffer, dbp, end - dbp); + token_name.buffer[end - dbp] = '\0'; + + dbp = end; + intag = FALSE; /* we found what we looked for */ + skiptag = TRUE; /* skip to the end of the tag */ + getnext = TRUE; /* then grab the text */ + continue; /* look on the same line */ + } + dbp += 1; + } + + else if (getnext) /* grab next tokens and tag them */ + { + dbp = skip_spaces (dbp); + if (*dbp == '\0') + break; /* go to next line */ + if (*dbp == '<') + { + intag = TRUE; + inanchor = (lowcase (dbp[1]) == 'a' && !intoken (dbp[2])); + continue; /* look on the same line */ + } - for (i = 0; TEX_toktab[i].len > 0; i++) - if (strneq (TEX_toktab[i].name, cp, TEX_toktab[i].len)) - return i; - return -1; -} + for (end = dbp + 1; *end != '\0' && *end != '<'; end++) + continue; + make_tag (token_name.buffer, token_name.len, TRUE, + dbp, end - dbp, lineno, linecharno); + linebuffer_setlen (&token_name, 0); /* no name in buffer */ + getnext = FALSE; + break; /* go to next line */ + } - -/* Texinfo support. Dave Love, Mar. 2000. */ -static void -Texinfo_nodes (inf) - FILE * inf; -{ - char *cp, *start; - LOOP_ON_INPUT_LINES (inf, lb, cp) - if (LOOKING_AT (cp, "@node")) - { - start = cp; - while (*cp != '\0' && *cp != ',') - cp++; - pfnote (savenstr (start, cp - start), TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + else /* look for an interesting HTML tag */ + { + while (*dbp != '\0' && *dbp != '<') + dbp++; + if (*dbp == '\0') + break; /* go to next line */ + intag = TRUE; + if (lowcase (dbp[1]) == 'a' && !intoken (dbp[2])) + { + inanchor = TRUE; + continue; /* look on the same line */ + } + else if (LOOKING_AT_NOCASE (dbp, "<title>") + || LOOKING_AT_NOCASE (dbp, "<h1>") + || LOOKING_AT_NOCASE (dbp, "<h2>") + || LOOKING_AT_NOCASE (dbp, "<h3>")) + { + intag = FALSE; + getnext = TRUE; + continue; /* look on the same line */ + } + dbp += 1; + } } } /* - * Prolog support (rewritten) by Anders Lindgren, Mar. 96 + * Prolog support * * Assumes that the predicate or rule starts at column 0. * Only the first clause of a predicate or rule is added. + * Original code by Sunichirou Sugou (1989) + * Rewritten by Anders Lindgren (1996) */ static int prolog_pr __P((char *, char *)); static void prolog_skip_comment __P((linebuffer *, FILE *)); @@ -4797,8 +5398,7 @@ for (cp = plb->buffer; *cp != '\0'; cp++) if (cp[0] == '*' && cp[1] == '/') return; - lineno++; - linecharno += readline (plb, inf); + readline (plb, inf); } while (!feof(inf)); } @@ -4833,10 +5433,10 @@ || (s[pos] == '(' && (pos += 1)) || (s[pos] == ':' && s[pos + 1] == '-' && (pos += 2))) && (last == NULL /* save only the first clause */ - || len != (int) strlen (last) + || len != (int)strlen (last) || !strneq (s, last, len))) { - pfnote (savenstr (s, len), TRUE, s, pos, lineno, linecharno); + make_tag (s, len, TRUE, s, pos, lineno, linecharno); return len; } else @@ -4875,7 +5475,7 @@ { pos++; - while (1) + for (;;) { if (s[pos] == '\'') { @@ -4904,15 +5504,15 @@ /* - * Support for Erlang -- Anders Lindgren, Feb 1996. + * Support for Erlang * * Generates tags for functions, defines, and records. - * * Assumes that Erlang functions start at column 0. + * Original code by Anders Lindgren (1996) */ static int erlang_func __P((char *, char *)); static void erlang_attribute __P((char *)); -static int erlang_atom __P((char *, int)); +static int erlang_atom __P((char *)); static void Erlang_functions (inf) @@ -4977,7 +5577,7 @@ int pos; int len; - pos = erlang_atom (s, 0); + pos = erlang_atom (s); if (pos < 1) return 0; @@ -4990,7 +5590,7 @@ || len != (int)strlen (last) || !strneq (s, last, len))) { - pfnote (savenstr (s, len), TRUE, s, pos, lineno, linecharno); + make_tag (s, len, TRUE, s, pos, lineno, linecharno); return len; } @@ -5011,20 +5611,14 @@ erlang_attribute (s) char *s; { - int pos; - int len; + char *cp = s; - if (strneq (s, "-define", 7) || strneq (s, "-record", 7)) + if ((LOOKING_AT (cp, "-define") || LOOKING_AT (cp, "-record")) + && *cp++ == '(') { - pos = skip_spaces (s + 7) - s; - if (s[pos++] == '(') - { - pos = skip_spaces (s + pos) - s; - len = erlang_atom (s, pos); - if (len != 0) - pfnote (savenstr (& s[pos], len), TRUE, - s, pos + len, lineno, linecharno); - } + int len = erlang_atom (skip_spaces (cp)); + if (len > 0) + make_tag (cp, len, TRUE, s, cp + len - s, lineno, linecharno); } return; } @@ -5035,65 +5629,46 @@ * Return the number of bytes consumed, or -1 if there was an error. */ static int -erlang_atom (s, pos) +erlang_atom (s) char *s; - int pos; { - int origpos; - - origpos = pos; + int pos = 0; if (ISALPHA (s[pos]) || s[pos] == '_') { /* The atom is unquoted. */ - pos++; - while (ISALNUM (s[pos]) || s[pos] == '_') + do pos++; - return pos - origpos; + while (ISALNUM (s[pos]) || s[pos] == '_'); } else if (s[pos] == '\'') { + for (pos++; s[pos] != '\''; pos++) + if (s[pos] == '\0' /* multiline quoted atoms are ignored */ + || (s[pos] == '\\' && s[++pos] == '\0')) + return 0; pos++; - - while (1) - { - if (s[pos] == '\'') - { - pos++; - break; - } - else if (s[pos] == '\0') - /* Multiline quoted atoms are ignored. */ - return -1; - else if (s[pos] == '\\') - { - if (s[pos+1] == '\0') - return -1; - pos += 2; - } - else - pos++; - } - return pos - origpos; } - else - return -1; + + return pos; } #ifdef ETAGS_REGEXPS static char *scan_separators __P((char *)); -static void analyse_regex __P((char *, bool)); -static void add_regex __P((char *, bool, language *)); +static void add_regex __P((char *, language *)); static char *substitute __P((char *, char *, struct re_registers *)); -/* Take a string like "/blah/" and turn it into "blah", making sure - that the first and last characters are the same, and handling - quoted separator characters. Actually, stops on the occurrence of - an unquoted separator. Also turns "\t" into a Tab character. - Returns pointer to terminating separator. Works in place. Null - terminates name string. */ +/* + * Take a string like "/blah/" and turn it into "blah", verifying + * that the first and last characters are the same, and handling + * quoted separator characters. Actually, stops on the occurrence of + * an unquoted separator. Also process \t, \n, etc. and turn into + * appropriate characters. Works in place. Null terminates name string. + * Returns pointer to terminating separator, or NULL for + * unterminated regexps. + */ static char * scan_separators (name) char *name; @@ -5106,15 +5681,27 @@ { if (quoted) { - if (*name == 't') - *copyto++ = '\t'; - else if (*name == sep) - *copyto++ = sep; - else + switch (*name) { - /* Something else is quoted, so preserve the quote. */ - *copyto++ = '\\'; - *copyto++ = *name; + case 'a': *copyto++ = '\007'; break; /* BEL (bell) */ + case 'b': *copyto++ = '\b'; break; /* BS (back space) */ + case 'd': *copyto++ = 0177; break; /* DEL (delete) */ + case 'e': *copyto++ = 033; break; /* ESC (delete) */ + case 'f': *copyto++ = '\f'; break; /* FF (form feed) */ + case 'n': *copyto++ = '\n'; break; /* NL (new line) */ + case 'r': *copyto++ = '\r'; break; /* CR (carriage return) */ + case 't': *copyto++ = '\t'; break; /* TAB (horizontal tab) */ + case 'v': *copyto++ = '\v'; break; /* VT (vertical tab) */ + default: + if (*name == sep) + *copyto++ = sep; + else + { + /* Something else is quoted, so preserve the quote. */ + *copyto++ = '\\'; + *copyto++ = *name; + } + break; } quoted = FALSE; } @@ -5125,6 +5712,8 @@ else *copyto++ = *name; } + if (*name != sep) + name = NULL; /* signal unterminated regexp */ /* Terminate copied string. */ *copyto = '\0'; @@ -5134,13 +5723,12 @@ /* Look at the argument of --regex or --no-regex and do the right thing. Same for each line of a regexp file. */ static void -analyse_regex (regex_arg, ignore_case) +analyse_regex (regex_arg) char *regex_arg; - bool ignore_case; { if (regex_arg == NULL) { - free_patterns (); /* --no-regex: remove existing regexps */ + free_regexps (); /* --no-regex: remove existing regexps */ return; } @@ -5168,9 +5756,9 @@ pfatal (regexfile); return; } - initbuffer (®exbuf); + linebuffer_init (®exbuf); while (readline_internal (®exbuf, regexfp) > 0) - analyse_regex (regexbuf.buffer, ignore_case); + analyse_regex (regexbuf.buffer); free (regexbuf.buffer); fclose (regexfp); } @@ -5189,69 +5777,136 @@ error ("unterminated language name in regex: %s", regex_arg); return; } - *cp = '\0'; + *cp++ = '\0'; lang = get_language_from_langname (lang_name); if (lang == NULL) return; - add_regex (cp + 1, ignore_case, lang); + add_regex (cp, lang); } break; /* Regexp to be used for any language. */ default: - add_regex (regex_arg, ignore_case, NULL); + add_regex (regex_arg, NULL); break; } } -/* Turn a name, which is an ed-style (but Emacs syntax) regular - expression, into a real regular expression by compiling it. */ +/* Separate the regexp pattern, compile it, + and care for optional name and modifiers. */ static void -add_regex (regexp_pattern, ignore_case, lang) +add_regex (regexp_pattern, lang) char *regexp_pattern; - bool ignore_case; language *lang; { static struct re_pattern_buffer zeropattern; - char *name; + char sep, *pat, *name, *modifiers; const char *err; struct re_pattern_buffer *patbuf; - pattern *pp; + regexp *rp; + bool + force_explicit_name = TRUE, /* do not use implicit tag names */ + ignore_case = FALSE, /* case is significant */ + multi_line = FALSE, /* matches are done one line at a time */ + single_line = FALSE; /* dot does not match newline */ - if (regexp_pattern[strlen(regexp_pattern)-1] != regexp_pattern[0]) + if (strlen(regexp_pattern) < 3) { - error ("%s: unterminated regexp", regexp_pattern); + error ("null regexp", (char *)NULL); return; } + sep = regexp_pattern[0]; name = scan_separators (regexp_pattern); - if (regexp_pattern[0] == '\0') + if (name == NULL) { - error ("null regexp", (char *)NULL); + error ("%s: unterminated regexp", regexp_pattern); + return; + } + if (name[1] == sep) + { + error ("null name for regexp \"%s\"", regexp_pattern); return; } - (void) scan_separators (name); + modifiers = scan_separators (name); + if (modifiers == NULL) /* no terminating separator --> no name */ + { + modifiers = name; + name = ""; + } + else + modifiers += 1; /* skip separator */ + + /* Parse regex modifiers. */ + for (; modifiers[0] != '\0'; modifiers++) + switch (modifiers[0]) + { + case 'N': + if (modifiers == name) + error ("forcing explicit tag name but no name, ignoring", NULL); + force_explicit_name = TRUE; + break; + case 'i': + ignore_case = TRUE; + break; + case 's': + single_line = TRUE; + /* FALLTHRU */ + case 'm': + multi_line = TRUE; + need_filebuf = TRUE; + break; + default: + { + char wrongmod [2]; + wrongmod[0] = modifiers[0]; + wrongmod[1] = '\0'; + error ("invalid regexp modifier `%s', ignoring", wrongmod); + } + break; + } patbuf = xnew (1, struct re_pattern_buffer); *patbuf = zeropattern; if (ignore_case) - patbuf->translate = lc_trans; /* translation table to fold case */ + { + static char lc_trans[CHARS]; + int i; + for (i = 0; i < CHARS; i++) + lc_trans[i] = lowcase (i); + patbuf->translate = lc_trans; /* translation table to fold case */ + } + + if (multi_line) + pat = concat ("^", regexp_pattern, ""); /* anchor to beginning of line */ + else + pat = regexp_pattern; + + if (single_line) + re_set_syntax (RE_SYNTAX_EMACS | RE_DOT_NEWLINE); + else + re_set_syntax (RE_SYNTAX_EMACS); - err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf); + err = re_compile_pattern (pat, strlen (regexp_pattern), patbuf); + if (multi_line) + free (pat); if (err != NULL) { error ("%s while compiling pattern", err); return; } - pp = p_head; - p_head = xnew (1, pattern); - p_head->regex = savestr (regexp_pattern); - p_head->p_next = pp; + rp = p_head; + p_head = xnew (1, regexp); + p_head->pattern = savestr (regexp_pattern); + p_head->p_next = rp; p_head->lang = lang; p_head->pat = patbuf; - p_head->name_pattern = savestr (name); + p_head->name = savestr (name); p_head->error_signaled = FALSE; + p_head->force_explicit_name = force_explicit_name; + p_head->ignore_case = ignore_case; + p_head->multi_line = multi_line; } /* @@ -5285,6 +5940,7 @@ size -= 1; /* Allocate space and do the substitutions. */ + assert (size >= 0); result = xnew (size + 1, char); for (t = result; *out != '\0'; out++) @@ -5299,55 +5955,148 @@ *t++ = *out; *t = '\0'; - assert (t <= result + size && t - result == (int)strlen (result)); + assert (t <= result + size); + assert (t - result == (int)strlen (result)); return result; } -/* Deallocate all patterns. */ +/* Deallocate all regexps. */ static void -free_patterns () +free_regexps () { - pattern *pp; + regexp *rp; while (p_head != NULL) { - pp = p_head->p_next; - free (p_head->regex); - free (p_head->name_pattern); + rp = p_head->p_next; + free (p_head->pattern); + free (p_head->name); free (p_head); - p_head = pp; + p_head = rp; } return; } + +/* + * Reads the whole file as a single string from `filebuf' and looks for + * multi-line regular expressions, creating tags on matches. + * readline already dealt with normal regexps. + * + * Idea by Ben Wing <ben@666.com> (2002). + */ +static void +regex_tag_multiline () +{ + char *buffer = filebuf.buffer; + regexp *rp; + char *name; + + for (rp = p_head; rp != NULL; rp = rp->p_next) + { + int match = 0; + + if (!rp->multi_line) + continue; /* skip normal regexps */ + + /* Generic initialisations before parsing file from memory. */ + lineno = 1; /* reset global line number */ + charno = 0; /* reset global char number */ + linecharno = 0; /* reset global char number of line start */ + + /* Only use generic regexps or those for the current language. */ + if (rp->lang != NULL && rp->lang != curfdp->lang) + continue; + + while (match >= 0 && match < filebuf.len) + { + match = re_search (rp->pat, buffer, filebuf.len, charno, + filebuf.len - match, &rp->regs); + switch (match) + { + case -2: + /* Some error. */ + if (!rp->error_signaled) + { + error ("regexp stack overflow while matching \"%s\"", + rp->pattern); + rp->error_signaled = TRUE; + } + break; + case -1: + /* No match. */ + break; + default: + if (match == rp->regs.end[0]) + { + if (!rp->error_signaled) + { + error ("regexp matches the empty string: \"%s\"", + rp->pattern); + rp->error_signaled = TRUE; + } + match = -3; /* exit from while loop */ + break; + } + + /* Match occurred. Construct a tag. */ + while (charno < rp->regs.end[0]) + if (buffer[charno++] == '\n') + lineno++, linecharno = charno; + name = rp->name; + if (name[0] == '\0') + name = NULL; + else /* make a named tag */ + name = substitute (buffer, rp->name, &rp->regs); + if (rp->force_explicit_name) + /* Force explicit tag name, if a name is there. */ + pfnote (name, TRUE, buffer + linecharno, + charno - linecharno + 1, lineno, linecharno); + else + make_tag (name, strlen (name), TRUE, buffer + linecharno, + charno - linecharno + 1, lineno, linecharno); + break; + } + } + } +} + #endif /* ETAGS_REGEXPS */ -static void -get_tag (bp) - register char *bp; +static bool +nocase_tail (cp) + char *cp; { - register char *cp; + register int len = 0; - if (*bp == '\0') - return; - /* Go till you get to white space or a syntactic break */ - for (cp = bp + 1; - *cp != '\0' && *cp != '(' && *cp != ')' && !iswhite (*cp); - cp++) - continue; - pfnote (savenstr (bp, cp-bp), TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + while (*cp != '\0' && lowcase (*cp) == lowcase (dbp[len])) + cp++, len++; + if (*cp == '\0' && !intoken (dbp[len])) + { + dbp += len; + return TRUE; + } + return FALSE; } -/* Initialize a linebuffer for use */ static void -initbuffer (lbp) - linebuffer *lbp; +get_tag (bp, namepp) + register char *bp; + char **namepp; { - lbp->size = (DEBUG) ? 3 : 200; - lbp->buffer = xnew (lbp->size, char); - lbp->buffer[0] = '\0'; - lbp->len = 0; + register char *cp = bp; + + if (*bp != '\0') + { + /* Go till you get to white space or a syntactic break */ + for (cp = bp + 1; !notinname (*cp); cp++) + continue; + make_tag (bp, cp - bp, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } + + if (namepp != NULL) + *namepp = savenstr (bp, cp - bp); } /* @@ -5355,10 +6104,13 @@ * newline or CR-NL, if any. Return the number of characters read from * `stream', which is the length of the line including the newline. * - * On DOS or Windows we do not count the CR character, if any, before the - * NL, in the returned length; this mirrors the behavior of emacs on those + * On DOS or Windows we do not count the CR character, if any before the + * NL, in the returned length; this mirrors the behavior of Emacs on those * platforms (for text files, it translates CR-NL to NL as it reads in the * file). + * + * If multi-line regular expressions are requested, each line read is + * appended to `filebuf'. */ static long readline_internal (lbp, stream) @@ -5372,7 +6124,7 @@ pend = p + lbp->size; /* Separate to avoid 386/IX compiler bug. */ - while (1) + for (;;) { register int c = getc (stream); if (p == pend) @@ -5417,68 +6169,219 @@ } lbp->len = p - buffer; + if (need_filebuf /* we need filebuf for multi-line regexps */ + && chars_deleted > 0) /* not at EOF */ + { + while (filebuf.size <= filebuf.len + lbp->len + 1) /* +1 for \n */ + { + /* Expand filebuf. */ + filebuf.size *= 2; + xrnew (filebuf.buffer, filebuf.size, char); + } + strncpy (filebuf.buffer + filebuf.len, lbp->buffer, lbp->len); + filebuf.len += lbp->len; + filebuf.buffer[filebuf.len++] = '\n'; + filebuf.buffer[filebuf.len] = '\0'; + } + return lbp->len + chars_deleted; } /* * Like readline_internal, above, but in addition try to match the - * input line against relevant regular expressions. + * input line against relevant regular expressions and manage #line + * directives. */ -static long +static void readline (lbp, stream) linebuffer *lbp; FILE *stream; { - /* Read new line. */ - long result = readline_internal (lbp, stream); -#ifdef ETAGS_REGEXPS - int match; - pattern *pp; + long result; - /* Match against relevant patterns. */ - if (lbp->len > 0) - for (pp = p_head; pp != NULL; pp = pp->p_next) - { - /* Only use generic regexps or those for the current language. */ - if (pp->lang != NULL && pp->lang != curlang) - continue; + linecharno = charno; /* update global char number of line start */ + result = readline_internal (lbp, stream); /* read line */ + lineno += 1; /* increment global line number */ + charno += result; /* increment global char number */ - match = re_match (pp->pat, lbp->buffer, lbp->len, 0, &pp->regs); - switch (match) - { - case -2: - /* Some error. */ - if (!pp->error_signaled) - { - error ("error while matching \"%s\"", pp->regex); - pp->error_signaled = TRUE; - } - break; - case -1: - /* No match. */ - break; - default: - /* Match occurred. Construct a tag. */ - if (pp->name_pattern[0] != '\0') - { - /* Make a named tag. */ - char *name = substitute (lbp->buffer, - pp->name_pattern, &pp->regs); - if (name != NULL) - pfnote (name, TRUE, lbp->buffer, match, lineno, linecharno); - } - else - { - /* Make an unnamed tag. */ - pfnote ((char *)NULL, TRUE, - lbp->buffer, match, lineno, linecharno); - } - break; - } - } -#endif /* ETAGS_REGEXPS */ + /* Honour #line directives. */ + if (!no_line_directive) + { + static bool discard_until_line_directive; - return result; + /* Check whether this is a #line directive. */ + if (result > 12 && strneq (lbp->buffer, "#line ", 6)) + { + int start, lno; + + if (DEBUG) start = 0; /* shut up the compiler */ + if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 1) + { + char *endp = lbp->buffer + start; + + assert (start > 0); + while ((endp = etags_strchr (endp, '"')) != NULL + && endp[-1] == '\\') + endp++; + if (endp != NULL) + /* Ok, this is a real #line directive. Let's deal with it. */ + { + char *taggedabsname; /* absolute name of original file */ + char *taggedfname; /* name of original file as given */ + char *name; /* temp var */ + + discard_until_line_directive = FALSE; /* found it */ + name = lbp->buffer + start; + *endp = '\0'; + canonicalize_filename (name); /* for DOS */ + taggedabsname = absolute_filename (name, curfdp->infabsdir); + if (filename_is_absolute (name) + || filename_is_absolute (curfdp->infname)) + taggedfname = savestr (taggedabsname); + else + taggedfname = relative_filename (taggedabsname,tagfiledir); + + if (streq (curfdp->taggedfname, taggedfname)) + /* The #line directive is only a line number change. We + deal with this afterwards. */ + free (taggedfname); + else + /* The tags following this #line directive should be + attributed to taggedfname. In order to do this, set + curfdp accordingly. */ + { + fdesc *fdp; /* file description pointer */ + + /* Go look for a file description already set up for the + file indicated in the #line directive. If there is + one, use it from now until the next #line + directive. */ + for (fdp = fdhead; fdp != NULL; fdp = fdp->next) + if (streq (fdp->infname, curfdp->infname) + && streq (fdp->taggedfname, taggedfname)) + /* If we remove the second test above (after the &&) + then all entries pertaining to the same file are + coalesced in the tags file. If we use it, then + entries pertaining to the same file but generated + from different files (via #line directives) will + go into separate sections in the tags file. These + alternatives look equivalent. The first one + destroys some apparently useless information. */ + { + curfdp = fdp; + free (taggedfname); + break; + } + /* Else, if we already tagged the real file, skip all + input lines until the next #line directive. */ + if (fdp == NULL) /* not found */ + for (fdp = fdhead; fdp != NULL; fdp = fdp->next) + if (streq (fdp->infabsname, taggedabsname)) + { + discard_until_line_directive = TRUE; + free (taggedfname); + break; + } + /* Else create a new file description and use that from + now on, until the next #line directive. */ + if (fdp == NULL) /* not found */ + { + fdp = fdhead; + fdhead = xnew (1, fdesc); + *fdhead = *curfdp; /* copy curr. file description */ + fdhead->next = fdp; + fdhead->infname = savestr (curfdp->infname); + fdhead->infabsname = savestr (curfdp->infabsname); + fdhead->infabsdir = savestr (curfdp->infabsdir); + fdhead->taggedfname = taggedfname; + fdhead->usecharno = FALSE; + fdhead->prop = NULL; + fdhead->written = FALSE; + curfdp = fdhead; + } + } + free (taggedabsname); + lineno = lno - 1; + readline (lbp, stream); + return; + } /* if a real #line directive */ + } /* if #line is followed by a a number */ + } /* if line begins with "#line " */ + + /* If we are here, no #line directive was found. */ + if (discard_until_line_directive) + { + if (result > 0) + { + /* Do a tail recursion on ourselves, thus discarding the contents + of the line buffer. */ + readline (lbp, stream); + return; + } + /* End of file. */ + discard_until_line_directive = FALSE; + return; + } + } /* if #line directives should be considered */ + +#ifdef ETAGS_REGEXPS + { + int match; + regexp *rp; + char *name; + + /* Match against relevant regexps. */ + if (lbp->len > 0) + for (rp = p_head; rp != NULL; rp = rp->p_next) + { + /* Only use generic regexps or those for the current language. + Also do not use multiline regexps, which is the job of + regex_tag_multiline. */ + if ((rp->lang != NULL && rp->lang != fdhead->lang) + || rp->multi_line) + continue; + + match = re_match (rp->pat, lbp->buffer, lbp->len, 0, &rp->regs); + switch (match) + { + case -2: + /* Some error. */ + if (!rp->error_signaled) + { + error ("regexp stack overflow while matching \"%s\"", + rp->pattern); + rp->error_signaled = TRUE; + } + break; + case -1: + /* No match. */ + break; + case 0: + /* Empty string matched. */ + if (!rp->error_signaled) + { + error ("regexp matches the empty string: \"%s\"", rp->pattern); + rp->error_signaled = TRUE; + } + break; + default: + /* Match occurred. Construct a tag. */ + name = rp->name; + if (name[0] == '\0') + name = NULL; + else /* make a named tag */ + name = substitute (lbp->buffer, rp->name, &rp->regs); + if (rp->force_explicit_name) + /* Force explicit tag name, if a name is there. */ + pfnote (name, TRUE, lbp->buffer, match, lineno, linecharno); + else + make_tag (name, strlen (name), TRUE, + lbp->buffer, match, lineno, linecharno); + break; + } + } + } +#endif /* ETAGS_REGEXPS */ } @@ -5532,7 +6435,6 @@ return (char *)r; } - /* * Return the ptr in sp at which the character c first * appears; NULL if not found @@ -5552,6 +6454,53 @@ return NULL; } +/* + * Compare two strings, ignoring case for alphabetic characters. + * + * Same as BSD's strcasecmp, included for portability. + */ +static int +etags_strcasecmp (s1, s2) + register const char *s1; + register const char *s2; +{ + while (*s1 != '\0' + && (ISALPHA (*s1) && ISALPHA (*s2) + ? lowcase (*s1) == lowcase (*s2) + : *s1 == *s2)) + s1++, s2++; + + return (ISALPHA (*s1) && ISALPHA (*s2) + ? lowcase (*s1) - lowcase (*s2) + : *s1 - *s2); +} + +/* + * Compare two strings, ignoring case for alphabetic characters. + * Stop after a given number of characters + * + * Same as BSD's strncasecmp, included for portability. + */ +static int +etags_strncasecmp (s1, s2, n) + register const char *s1; + register const char *s2; + register int n; +{ + while (*s1 != '\0' && n-- > 0 + && (ISALPHA (*s1) && ISALPHA (*s2) + ? lowcase (*s1) == lowcase (*s2) + : *s1 == *s2)) + s1++, s2++; + + if (n < 0) + return 0; + else + return (ISALPHA (*s1) && ISALPHA (*s2) + ? lowcase (*s1) - lowcase (*s2) + : *s1 - *s2); +} + /* Skip spaces, return new pointer. */ static char * skip_spaces (cp) @@ -5578,7 +6527,7 @@ char *s1, *s2; { error (s1, s2); - exit (BAD); + exit (EXIT_FAILURE); } static void @@ -5586,21 +6535,15 @@ char *s1; { perror (s1); - exit (BAD); + exit (EXIT_FAILURE); } static void suggest_asking_for_help () { fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", - progname, -#ifdef LONG_OPTIONS - "--help" -#else - "-h" -#endif - ); - exit (BAD); + progname, LONG_OPTIONS ? "--help" : "-h"); + exit (EXIT_FAILURE); } /* Print error message. `s1' is printf control string, `s2' is arg for it. */ @@ -5670,7 +6613,7 @@ linebuffer path; FILE *pipe; - initbuffer (&path); + linebuffer_init (&path); pipe = (FILE *) popen ("pwd 2>/dev/null", "r"); if (pipe == NULL || readline_internal (&path, pipe) == 0) pfatal ("pwd"); @@ -5836,6 +6779,18 @@ #endif } + +/* Initialize a linebuffer for use */ +static void +linebuffer_init (lbp) + linebuffer *lbp; +{ + lbp->size = (DEBUG) ? 3 : 200; + lbp->buffer = xnew (lbp->size, char); + lbp->buffer[0] = '\0'; + lbp->len = 0; +} + /* Set the minimum size of a string contained in a linebuffer. */ static void linebuffer_setlen (lbp, toksize) @@ -5850,8 +6805,8 @@ lbp->len = toksize; } -/* Like malloc but get fatal error if memory is exhausted. */ -PTR +/* Like malloc but get fatal error if memory is exhausted. */ +static PTR xmalloc (size) unsigned int size; { @@ -5861,7 +6816,7 @@ return result; } -PTR +static PTR xrealloc (ptr, size) char *ptr; unsigned int size; @@ -5877,6 +6832,12 @@ * c-indentation-style: gnu * indent-tabs-mode: t * tab-width: 8 - * c-font-lock-extra-types: ("FILE" "bool" "language" "linebuffer") + * fill-column: 79 + * c-font-lock-extra-types: ("FILE" "bool" "language" "linebuffer" "fdesc" "node" "regexp") * End: */ + +/* arch-tag: 8a9b748d-390c-4922-99db-2eeefa921051 + (do not change this comment) */ + +/* etags.c ends here */ diff --text -u 'xemacs-21.5.17/lib-src/fakemail.c' 'xemacs-21.5.18/lib-src/fakemail.c' Index: ./lib-src/fakemail.c --- ./lib-src/fakemail.c Sun Jun 10 19:42:17 2001 +++ ./lib-src/fakemail.c Tue Sep 21 04:19:10 2004 @@ -34,7 +34,7 @@ #include <stdio.h> #include <stdlib.h> int -main (int argc, char *argv[]) +main () { /* Linux /bin/mail, if it exists, is NOT the Unix v7 mail that fakemail depends on! This causes garbled mail. Better to diff --text -u 'xemacs-21.5.17/lib-src/gnuclient.c' 'xemacs-21.5.18/lib-src/gnuclient.c' Index: ./lib-src/gnuclient.c --- ./lib-src/gnuclient.c Tue Jun 25 17:09:02 2002 +++ ./lib-src/gnuclient.c Tue Sep 21 04:19:10 2004 @@ -53,6 +53,7 @@ #endif #include "gnuserv.h" +#include "compiler.h" char gnuserv_version[] = "gnuclient version " GNUSERV_VERSION; @@ -81,7 +82,7 @@ void initialize_signals (void); static void -tell_emacs_to_resume (int sig) +tell_emacs_to_resume (int UNUSED (sig)) { char buffer[GSERV_BUFSZ+1]; int s; /* socket / msqid to server */ diff --text -u 'xemacs-21.5.17/lib-src/gnuserv.c' 'xemacs-21.5.18/lib-src/gnuserv.c' Index: ./lib-src/gnuserv.c --- ./lib-src/gnuserv.c Wed Mar 13 17:51:58 2002 +++ ./lib-src/gnuserv.c Tue Sep 21 04:19:10 2004 @@ -59,9 +59,11 @@ #include <string.h> #endif /* HAVE_STRING_H */ +#include "compiler.h" + #if !defined(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && \ !defined(INTERNET_DOMAIN_SOCKETS) -main () +int main () { fprintf (stderr,"Sorry, the Emacs server is only supported on systems that have\n"); fprintf (stderr,"Unix Domain sockets, Internet Domain sockets or System V IPC\n"); @@ -855,7 +857,7 @@ int -main (int argc, char *argv[]) +main (int UNUSED (argc), char *argv[]) { int chan; /* temporary channel number */ #ifdef SYSV_IPC diff --text -u /dev/null 'xemacs-21.5.18/lib-src/insert-data-in-exec.c' Index: ./lib-src/insert-data-in-exec.c --- ./lib-src/insert-data-in-exec.c Thu Jan 1 09:00:00 1970 +++ ./lib-src/insert-data-in-exec.c Sat Apr 17 22:29:20 2004 @@ -0,0 +1,199 @@ +/* Copies the dump file inside the xemacs executable */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static const unsigned char key[] = { + 255, + 6, + 1, + 2, + 3, + 4, + 255, + 3, + 9, + 62, + 255, + 10, + 4, + 61, + 255 +}; + +int main(int argc, char **argv) +{ + FILE *te, *xe, *dump; + unsigned char *xed, *p; + long size, size_dump, size1, i; + long max_size, offset; + + char msg[65536]; + + if(argc != 6 && (argc != 3 || strcmp(argv[1], "-s"))) { + fprintf(stderr, "Usage:\n%s temacs xemacs.dmp xemacs size offset\n%s -s xemacs.dmp\n", argv[0], argv[0]); + exit(1); + } + + if(argc == 3) { + sprintf(msg, "Opening %s failed", argv[2]); + dump = fopen(argv[2], "rb+"); + if(!dump) { + perror(msg); + exit(1); + } + + if(fseek(dump, 0, SEEK_END)) { + perror("fseek end dump"); + exit(1); + } + + size = ftell(dump); + if(size == -1) { + perror("ftell dump"); + exit(1); + } + + printf("%ld\n", size); + exit(0); + } + + + max_size = strtol(argv[4], 0, 10); + offset = strtol(argv[5], 0, 10); + + sprintf(msg, "Opening %s failed", argv[1]); + te = fopen(argv[1], "rb"); + if(!te) { + perror(msg); + exit(1); + } + + if(fseek(te, 0, SEEK_END)) { + perror("fseek end"); + exit(1); + } + + size = ftell(te); + if(size == -1) { + perror("ftell"); + exit(1); + } + + if(fseek(te, 0, SEEK_SET)) { + perror("fseek beginning"); + exit(1); + } + + xed = malloc(size); + if(!xed) { + perror("malloc"); + exit(1); + } + + size1 = fread(xed, 1, size, te); + if(size1 != size) { + if(ferror(te)) { + perror("fread temacs"); + exit(1); + } + fprintf(stderr, "Fread returned %ld, expected %ld ?\n", size1, size); + exit(1); + } + + if(fclose(te)) { + perror("fclose temacs"); + exit(1); + } + + p = xed; + for(i=0; i<size-(long)sizeof(key); i++) { + if(!memcmp(p, key, sizeof(key))) + goto found; + p++; + } + + fprintf(stderr, "dumped_data key not found in executable.\n"); + exit(1); + + found: + fprintf(stderr, "dumped_data found at offset 0x%lx, patching.\n", i); + + sprintf(msg, "Opening %s failed", argv[2]); + dump = fopen(argv[2], "r"); + if(!dump) { + perror(msg); + exit(1); + } + + if(fseek(dump, 0, SEEK_END)) { + perror("fseek end dump"); + exit(1); + } + + size_dump = ftell(dump); + if(size_dump == -1) { + perror("ftell dump"); + exit(1); + } + + if(size_dump > max_size) { + fprintf(stderr, "Dump file too big for available space (max=%ld, dump=%ld)\n", max_size, size_dump); + exit(2); + } + + if(fseek(dump, 0, SEEK_SET)) { + perror("fseek beginning dump"); + exit(1); + } + + size1 = fread(xed+i+offset, 1, size_dump, dump); + if(size1 != size_dump) { + if(ferror(dump)) { + perror("fread dump"); + exit(1); + } + fprintf(stderr, "Fread dump returned %ld, expected %ld ?\n", size1, size_dump); + exit(1); + } + + if(fclose(dump)) { + perror("fclose dump"); + exit(1); + } + + memset(xed+i, 0, offset); + + xed[i ] = size_dump; + xed[i+1] = size_dump >> 8; + xed[i+2] = size_dump >> 16; + xed[i+3] = size_dump >> 24; + + fprintf(stderr, "dumped_data found at offset 0x%lx, patching.\n", i); + + sprintf(msg, "Opening %s failed", argv[3]); + xe = fopen(argv[3], "wb"); + if(!xe) { + perror(msg); + exit(1); + } + + size1 = fwrite(xed, 1, size, xe); + if(size1 != size) { + if(ferror(xe)) { + perror("fwrite xemacs"); + exit(1); + } + fprintf(stderr, "Fwrite xemacs returned %ld, expected %ld ?\n", size1, size); + exit(1); + } + + if(fclose(xe)) { + perror("fclose xemacs"); + exit(1); + } + + exit(0); +} + diff --text -u 'xemacs-21.5.17/lib-src/make-docfile.c' 'xemacs-21.5.18/lib-src/make-docfile.c' Index: ./lib-src/make-docfile.c --- ./lib-src/make-docfile.c Tue Aug 12 23:47:07 2003 +++ ./lib-src/make-docfile.c Tue Sep 21 04:19:10 2004 @@ -49,6 +49,8 @@ #include <string.h> #include <ctype.h> +#include "compiler.h" + /* XEmacs addition */ #define C_IDENTIFIER_CHAR_P(c) \ (('A' <= c && c <= 'Z') || \ @@ -495,7 +497,8 @@ MINARGS and MAXARGS are the minimum and maximum number of arguments. */ static void -write_c_args (FILE *out, const char *func, char *buf, int minargs, int maxargs) +write_c_args (FILE *out, const char *UNUSED (func), char *buf, + int minargs, int maxargs) { register char *p; int in_ident = 0; diff --text -u 'xemacs-21.5.17/lib-src/make-dump-id.c' 'xemacs-21.5.18/lib-src/make-dump-id.c' Index: ./lib-src/make-dump-id.c --- ./lib-src/make-dump-id.c Tue Sep 16 12:57:54 2003 +++ ./lib-src/make-dump-id.c Tue Sep 21 04:19:10 2004 @@ -54,7 +54,7 @@ } int -main (int argc, char *argv[]) +main () { FILE *f; diff --text -u 'xemacs-21.5.17/lib-src/pop.c' 'xemacs-21.5.18/lib-src/pop.c' Index: ./lib-src/pop.c --- ./lib-src/pop.c Wed Mar 13 17:51:59 2002 +++ ./lib-src/pop.c Tue Sep 21 04:19:11 2004 @@ -44,6 +44,7 @@ #define CLOSESOCKET(s) close(s) #endif #include "pop.h" +#include "compiler.h" #ifdef sun #include <malloc.h> @@ -950,7 +951,13 @@ * into pop_error. */ static int -socket_connection (char *host, int flags) +socket_connection (char *host, +#if defined (KERBEROS) || defined (HESIOD) + int flags +#else + int UNUSED (flags) +#endif + ) { struct hostent *hostent; struct servent *servent; diff --text -u 'xemacs-21.5.17/lib-src/profile.c' 'xemacs-21.5.18/lib-src/profile.c' Index: ./lib-src/profile.c --- ./lib-src/profile.c Sun Jun 10 19:42:17 2001 +++ ./lib-src/profile.c Tue Sep 21 04:19:11 2004 @@ -91,7 +91,7 @@ } int -main (int argc, char *argv[]) +main () { int c; while ((c = getchar ()) != EOF) diff --text -u 'xemacs-21.5.17/lib-src/sorted-doc.c' 'xemacs-21.5.18/lib-src/sorted-doc.c' Index: ./lib-src/sorted-doc.c --- ./lib-src/sorted-doc.c Sun Jun 10 19:42:18 2001 +++ ./lib-src/sorted-doc.c Tue Sep 21 04:19:11 2004 @@ -99,7 +99,7 @@ }; int -main (int argc, char *argv[]) +main () { register DOCSTR *dp = NULL; /* allocated DOCSTR */ register LINE *lp = NULL; /* allocated line */ diff --text -u 'xemacs-21.5.17/lisp/ChangeLog' 'xemacs-21.5.18/lisp/ChangeLog' Index: ./lisp/ChangeLog --- ./lisp/ChangeLog Mon Mar 22 18:23:19 2004 +++ ./lisp/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,365 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + +2004-09-25 Jerry James <james@xemacs.org> + + * itimer.el (start-itimer): Cannot use set-itimer-name now that + that function does not uniquify names. + +2004-09-22 Stephen J. Turnbull <stephen@xemacs.org> + + * startup.el (load-init-file): + (load-user-init-file): + Remove bogus comments. + +2004-09-23 Stephen J. Turnbull <stephen@xemacs.org> + + * about.el (xemacs-hackers): Fix Malcolm's address. + +2004-09-22 Jerry James <james@xemacs.org> + + * itimer.el (set-itimer-name): Do not uniquify names, as requested + by Kyle Jones. + +2004-09-19 Stephen J. Turnbull <stephen@xemacs.org> + + * code-init.el: Add to header comment. + * gtk-font-menu.el: Improve documentation. + * unicode.el: Various comments added. + * process.c (process-buffer): + (set-process-buffer): + (process-stderr-buffer): + (set-process-stderr-buffer): + Document interaction with filters. + +2004-09-14 Stephen J. Turnbull <stephen@xemacs.org> + + * x-font-menu.el: (x-fonts-menu-junk-families): Improve docstring. + (hack-font-truename): Improve docstring. + + * font-menu.el (font-menu-ignore-scaled-fonts): Improve docstring. + (font-menu-this-frame-only-p): Improve docstring. + (font-menu-preferred-resolution): Improve docstring. + (font-menu-size-scaling): Improve docstring. + (device-fonts-cache): Move comment into docstring and improve it. + (reset-device-font-menus): Improve docstring. + (reset-device-font-menus): Move message into if; only announce + we're getting font list if we're actually going to do it. + +2003-12-14 Stephen J. Turnbull <stephen@xemacs.org> + + * cl-macs.el (loop): Fixed typo in docstring. + +2003-11-02 Stephen J. Turnbull <stephen@xemacs.org> + + * itimer.el (check-itimer-coerce-string): Fix sense of docstring; + markup signal name as code. + (check-nonnegative-number): Markup signal name as code. + +2004-07-12 Stephen J. Turnbull <stephen@xemacs.org> + + * specifier.el (set-specifier): Sentences in docstrings should be + separated with two spaces, not one. + + * find-paths.el (paths-lisp-filename-regexp): Improve docstring. + +2004-07-12 Stephen J. Turnbull <stephen@xemacs.org> + + * about.el (xemacs-hackers): Update turnbull, add viteno. + (about-current-release-maintainers): Add martin, vin, and viteno. + (about-other-current-hackers): + (about-once-and-future-hackers): + Move inactive hackers from other-current to once-and-future. + (about-url-alist): Add turnbull, xemacs-cvs, and xemacs-lists. + * about.el (about-xemacs): + Add information about package maintainers. + Mention Vin, Stephen, and Andy w.r.t. 21.4. + Mention Ben and Martin w.r.t. 21.2. + (about-advantages): Mention GNU Emacs 21. + (about-personal-info): Update turnbull. + +2004-05-15 Stephen J. Turnbull <stephen@xemacs.org> + + * specifier.el (set-specifier): Fix typo in comment. + +2004-07-12 Stephen J. Turnbull <stephen@xemacs.org> + + * about.el (about-xemacs): + Give more precise version info. + Compute version numbers. + +2004-09-21 Jerry James <james@xemacs.org> + + * itimer.el (start-itimer): Fix my bungling of Martin's intentions. + +2004-09-20 Martin Buchholz <martin@xemacs.org> + + * itimer.el (set-itimer-name): New function. + (start-itimer): Use it. + +2003-12-12 Katsumi Yamaoka <yamaoka@jpl.org> + + * itimer.el (activate-itimer): Modify the itimer timeout value as + if it were begun at the last time when the itimer driver was woken + up. + +2004-09-15 Stephen J. Turnbull <stephen@xemacs.org> + + Fix bug: apropos errors if a defalias refers to an undefined + function. <87pt4pmdcs.fsf@tleepslib.sk.tsukuba.ac.jp> + + * apropos.el (apropos): + (apropos-command): + * help.el (frob-help-extents): + * help-macro.el (make-help-screen): + * hyper-apropos.el (hyper-apropos-grok-functions): + (hyper-apropos-get-doc): + Catch void-function error thrown by `documentation'. + +2004-09-07 Steve Youngs <steve@youngs.au.com> + + * packages.el (package-require): Fix incorrect arg to format. + This fixes a `format specifier' error. + +2004-08-15 Jan Rychter <jwr@xemacs.org> + + * window-xemacs.el (really-set-window-configuration): deal + gracefully with the case when the buffer previously saved in the + configuration (and that we want to switch to) has been + killed. Switch to the next buffer on the buffer-list in that case. + +2004-08-13 Jerry James <james@xemacs.org> + + * bytecomp.el (forward-word): Tell the byte compiler the correct + number of arguments to forward-word. + +2004-07-02 Malcolm Purvis <malcolmp@xemacs.org> + + * widgets-gtk.el (gtk-widget-instantiate-notebook-internal): + Loading items into the notebook is now done by C code. + * widgets-gtk.el (gtk-widget-instantiate-internal): + Style no longer changed. + +2004-06-24 Jerry James <james@xemacs.org> + + * cl-compat.el: Synch with Emacs 21.3. + * cl-extra.el: Ditto. + * cl-extra.el (cl-push): Removed because superfluous. + * cl-extra.el (cl-pop): Removed because superfluous. + * cl-extra.el (cl-emacs-type)): Removed because unused. + * cl-extra.el (cl-map-keymap): Just alias map-keymap. + * cl-extra.el (cl-map-keymap-recursively): Drop Emacs 18 support. + * cl-extra.el (cl-copy-tree): Removed because superfluous. + * cl-extra.el (cl-remprop): New alias. + * cl-extra.el (cl-make-hash-table): New alias. + * cl-extra.el (cl-hash-table-p): New alias. + * cl-extra.el (cl-hash-table-count): New alias. + * cl-macs.el: Synch with Emacs 21.3. + * cl-macs.el (cl-push): Removed because superfluous. + * cl-macs.el (cl-pop): Removed because superfluous. + * cl-macs.el (cl-emacs-type): Removed because unused. + * cl-macs.el (cl-compile-time-init): Drop Emacs 18 and 19 support. + * cl-macs.el (return): Change arg name to match Emacs and docstring. + * cl-macs.el (return-from): Ditto. + * cl-macs.el (loop): Check for 'collecting as well as 'collect. + * cl-macs.el (define-setf-expander): New alias. + * cl-macs.el (caar): New setf method. + * cl-macs.el (cadr): New setf method. + * cl-macs.el (cdar): New setf method. + * cl-macs.el (cddr): New setf method. + * cl-macs.el (deftype): Change arg name to match Emacs and docstring. + * cl-macs.el (ignore-errors): Change docstring to match arg name. + * cl-seq.el: Synch with Emacs 21.3. + * cl-seq.el (cl-push): Removed because superfluous. + * cl-seq.el (cl-pop): Removed because superfluous. + * cl-seq.el (mismatch): Typo fix. + * cl.el: Synch with Emacs 21.3. + * cl.el (cl-map-extents): Alias map-extents. + * cl.el (values): Change from defalias to defsubst to add docstring. + * cl.el (values-list): Ditto. + * cl.el (multiple-value-list): Ditto. + * cl.el (multiple-value-apply): Ditto. + * cl.el (nth-value): Ditto. + * cl.el (cl-abs): Alias the `abs' builtin instead. + * cl.el (svref): New alias. + * cl.el (cl-add-hook): Removed due to obsolescence. + * cl.el (cl-hack-byte-compiler): Set cl-hacked-flag first for safety. + +2004-06-26 Steve Youngs <steve@youngs.au.com> + + * package-get.el (package-get-info-name-array): New. + (package-get-info-info-array): New. + (package-get-info): Use them, adding completion. + (package-get-list-packages-where): Add completion. + +2004-06-21 Adrian Aichner <adrian@xemacs.org> + + * package-ui.el (pui-help-echo): Fix false cvs conflict by + avoiding line solely composed of equal signs. + +2004-06-18 Jerry James <james@xemacs.org> + + * derived.el (define-derived-mode): Put the arguments to + derived-mode-merge-syntax-tables in the correct order. + +2004-06-17 Jerry James <james@xemacs.org> + + * derived.el (define-derived-mode): XEmacs does not have + char-table-parent. Use derived-mode-merge-syntax-tables instead. + +2004-06-09 Stephen J. Turnbull <stephen@xemacs.org> + + * subr.el (split-string): Clean up docstring. + +2004-06-17 Stephen J. Turnbull <stephen@xemacs.org> + + * help.el (with-syntax-table): Removed. (Prefer version in subr.el.) + +2004-06-16 Jerry James <james@xemacs.org> + + * cl.el (cl-set-substring): Increment start by the length of the + string, not the string itself. + +2004-06-07 Jerry James <james@xemacs.org> + + * derived.el: Synch with Emacs 21.3. + * subr.el (with-local-quit): New, from Emacs 21.3. + * subr.el (delayed-mode-hooks): New variable, from Emacs 21.3. + * subr.el (run-mode-hooks): New function, from Emacs 21.3. + * subr.el (delay-mode-hooks): New macro, from Emacs 21.3. + +2004-06-10 Adrian Aichner <adrian@xemacs.org> + + * cus-edit.el (custom-save-variables): Fix bug introduced by + nconc/make-list removal. + * cus-edit.el (custom-save-faces): Ditto. + +2004-06-07 Adrian Aichner <adrian@xemacs.org> + + * cus-edit.el (custom-browse-visibility): Typo fix. + * cus-edit.el (custom-variable-value-create): Ditto. + * cus-edit.el (custom-save-variables): Simply use push instead of + make-list and nconc, as suggested by Hrvoje and already used in + 21.4. + * cus-edit.el (custom-save-faces): Ditto. + +2004-06-07 Adrian Aichner <adrian@xemacs.org> + + * mule/ethio-util.el (ethio-sera-to-fidel-region): Phrase + duplication typo fixes for typos found by + xemacs-builds/adrian/typology/phrase-duplication-typo.pl. + * mule/mule-charset.el (make-translation-table): Ditto. + +2004-06-07 Adrian Aichner <adrian@xemacs.org> + + * files.el (basic-save-buffer): Ditto. + * lisp-mode.el (eval-interactive-verbose): Ditto. + * newcomment.el (uncomment-region): Ditto. + +2003-12-03 Adrian Aichner <adrian@xemacs.org> + + * files.el (delete-old-versions): Avoid going interactive during + make install when environment variable VERSION_CONTROL is set. + +2004-04-21 Sven Grundmann <sven@hellerhof.de> + + * list-mode.el (display-completion-list): Fixed completion list was + taking the width of the frame and not of the window for displaying + the selection methods. + +2004-05-21 Jerry James <james@xemacs.org> + + * cl.el (cl-random-time): Chop a bignum down to a fixnum if + (featurep 'bignum), not if (featurep 'number-types). + +2004-05-15 Malcolm Purvis <malcolmp@xemacs.org> + + * gtk-widgets.el: New import: gtk-accel-group-new. + * dialog-gtk.el: + * dialog-gtk.el (gtk-popup-convert-underscores): New. + * dialog-gtk.el (popup-builtin-question-dialog): + + Added support for dialog button mnemonics. + +2004-04-30 Stephen J. Turnbull <stephen@xemacs.org> + + * cl.el (gensym, gentemp): Improve docstrings. + +2004-05-11 Stephen J. Turnbull <stephen@xemacs.org> + + * code-init.el (set-eol-detection): Special-case 'no-conversion. + +2004-05-10 Stephen J. Turnbull <stephen@xemacs.org> + + * isearch-mode.el (isearch-forward, isearch-abort): Document that our + behavior of `isearch-abort' differs from that of GNU Emacs. + +2004-05-08 Sven Grundmann <sven@xemacs.org> + + * etags.el: + * etags.el (tags-exuberant-ctags-optimization-p): Enable optimization + only for use with exuberant ctags. This will also enable building of + completion tables with exuberant ctags. This will not work with + xemacs ctags. New. + * etags.el (get-tag-table-buffer): New function for creating of + completion table is used if tags-exuberant-ctags-optimization-p ist t + * etags.el (add-to-tag-completion-table-exuberant-ctags): Defun for + building tag completion table with exuberant ctags. New. + * etags.el (find-tag-internal): Improve exact tag matching for tags + with name fields. Before the patch return types of functions or + function parameters (with exuberant ctags) were found as matches. + +2004-04-20 Malcolm Purvis <malcolmpurvis@optushome.com.au> + + * gtk-marshal.el: Return type for INT is gint, not guint. + +2004-02-23 Stephen J. Turnbull <stephen@xemacs.org> + + * isearch-mode.el (isearch-abort): Preserve successful search target. + +2004-04-19 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> + + * startup.el (site-start-file): + (load-init-file): + Improve documentation. + +2004-04-18 Stephen J. Turnbull <stephen@xemacs.org> + + * menubar-items.el (default-menubar): Options are saved to custom.el. + +2004-04-16 Stephen J. Turnbull <stephen@xemacs.org> + + * help.el (help-register-and-maybe-prune-excess): Trim docstring. + Sanity check argument. + (with-displaying-temp-buffer): Improve docstring. + +2004-04-09 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> + + * files.el (revert-buffer): Synch to 21.4. Suggested by + Rodney Sparapani <rsparapa@post.its.mcw.edu>. + +2004-04-09 Mike Sperber <mike@xemacs.org> + + * minibuf.el (reset-buffer): Zap the mark of the minibuffer as + well, to prevent it from hijacking other buffers' marks when + typing in the minibuffer later. + +2004-04-05 Jerry James <james@xemacs.org> + + * cl-extra.el (coerce): Add support for general numeric conversions. + * cl.el (eql): Update for more number types. + * cl.el (cl-random-time): Ensure the result is a fixnum. + * cl.el (most-positive-fixnum): Do not define in Lisp if enhanced + number types are available. + * cl.el (most-negative-fixnum): Ditto. + +2004-03-23 Adrian Aichner <adrian@xemacs.org> + + * code-process.el (call-process-region): Correct start and end + marker construction, delete regions before and after insertion + point. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. diff --text -u 'xemacs-21.5.17/lisp/about.el' 'xemacs-21.5.18/lisp/about.el' Index: ./lisp/about.el --- ./lisp/about.el Thu Nov 6 14:11:15 2003 +++ ./lisp/about.el Thu Sep 23 14:35:07 2004 @@ -147,6 +147,7 @@ (pez "Peter Pezaris" "pez@xemacs.org") (piper "Andy Piper" "andy@xemacs.org") (pittman "Daniel Pittman" "pittman@xemacs.org") + (purvis "Malcolm Purvis" "malcolmp@xemacs.org") (rickc "Rick Campbell" "rickc@xemacs.org") (rose "John Rose" "rose@xemacs.org") (rossini "Anthony Rossini" "rossini@xemacs.org") @@ -158,8 +159,9 @@ (thiessel "Marcus Thiessel" "marcus@xemacs.org") (tomonori "Tomonori Ikeyama" "tomonori@xemacs.org") (tuck "Matt Tucker" "tuck@xemacs.org") - (turnbull "Stephen Turnbull" "turnbull@xemacs.org") + (turnbull "Stephen Turnbull" "stephen@xemacs.org") (vin "Vin Shelton" "acs@xemacs.org") + (viteno "Norbert Koch" "viteno@xemacs.org") (vladimir "Vladimir Ivanovic" "vladimir@xemacs.org") (wmperry "William Perry" "wmperry@xemacs.org") (yoshiki "Yoshiki Hayashi" "yoshiki@xemacs.org") @@ -168,19 +170,19 @@ (defvar about-current-release-maintainers ;; this list should not necessarily be in sorted order. - '(adrian ben hniksic james piper scop sperber turnbull)) + '(adrian james piper purvis sperber turnbull vin viteno)) (defvar about-other-current-hackers ;; to sort this list or the one below, use: ;; M-x sort-regexp-fields RET [a-z]+ RET \(.*\) RET - '(aj alastair cgw craig daiki dan dv fabrice golubev gunnar hisashi - jan jareth jason jmiller jonathan kazz kirill larsi martin morioka mta ograf - olivier oscar pittman tomonori tuck vin wmperry yoshiki)) + '(ben daiki darrylo dv fabrice golubev hniksic jan jason jmiller jonathan + kazz kirill larsi martin morioka mta ograf olivier oscar rossini pittman + scop tomonori tuck wmperry yoshiki)) (defvar about-once-and-future-hackers - '(ajc baw bw chr cthomp darrylo devin dkindred dmoore eb hbs hmuller - hobley jens juhp jwz kyle marcpa mcook mly ograf pelegri pez - rickc rose rossini slb stig stigb thiessel vladimir)) + '(aj ajc alastair baw bw cgw chr craig cthomp dan devin dkindred dmoore eb + gunnar hbs hisashi hmuller hobley jareth jens juhp jwz kyle marcpa mcook + mly ograf pelegri pez rickc rose slb stig stigb thiessel vladimir)) ;; The CAR of alist elements is a valid argument to `about-url-link'. ;; It is preferred to a simple string, because it makes maintenance @@ -215,10 +217,13 @@ (piper . "http://www.andypiper.com/") (rossini . "http://faculty.washington.edu/rossini/") (stigb . "http://www.tihlde.hist.no/~stigb/") + (turnbull . "http://turnbull.sk.tsukuba.ac.jp/yaseppochi-gumi.html") (vin . "http://www.upa.org/") (vladimir . "http://www.leonora.org/~vladimir/") (wget . "http://sunsite.dk/wget/") - (xemacs . "http://www.xemacs.org/")) + (xemacs . "http://www.xemacs.org/") + (xemacs-cvs . "http://cvs.xemacs.org/") + (xemacs-lists . "http://www.xemacs.org/Lists/")) "Some of the more important URLs.") (defvar about-left-margin 3) @@ -359,10 +364,19 @@ :format "%t" :tag-glyph xemacs-logo) (widget-insert "\n") - (let* ((emacs-short-version (format "%d.%d" - emacs-major-version - emacs-minor-version)) - (emacs-about-version (format "version %s; April 2001" + (let* ((emacs-short-version + (cond (emacs-beta-version (format "%d.%d.%d" + emacs-major-version + emacs-minor-version + emacs-beta-version)) + (emacs-patch-level (format "%d.%d.%d" + emacs-major-version + emacs-minor-version + emacs-patch-level)) + (t (format "%d.%d" + emacs-major-version + emacs-minor-version)))) + (emacs-about-version (format "version %s of September 2004" emacs-short-version))) (widget-insert (about-center emacs-about-version)) (widget-create 'link :help-echo "What's new in XEmacs" @@ -398,9 +412,12 @@ :button-prefix "" :button-suffix "" "advantages") - (widget-insert " over GNU Emacs. In addition, XEmacs 21.4 -provides many ") - (widget-create 'link :help-echo "See a list of new features in XEmacs 21.4" + (widget-insert (format " over GNU Emacs. In addition, XEmacs %d.%d +provides many " emacs-major-version emacs-minor-version)) + (widget-create 'link + :help-echo (format + "See a list of new features in XEmacs %d.%d" + emacs-major-version emacs-minor-version) :action 'about-news :button-prefix "" :button-suffix "" @@ -449,6 +466,26 @@ :button-suffix "" "The full list of contributors...") (widget-insert "\n +The current package release engineer is Norbert Koch. +Andreas Jaeger was the first package release engineer following the split +of the XEmacs code base into core implementation and packaged Lisp. +He was succeeded by Steve Youngs, then Ville Skyttä.\n\n") + (setup-person 'viteno) + (setup-person 'aj) + (setup-person 'scop) + (widget-insert " +Vin Shelton is the maintainer of the stable branch, 21.4. +Stephen Turnbull was the project manager for the release. Andy Piper +maintained the Windows branch until the release was declared stable.\n\n") + (setup-person 'vin) + (setup-person 'turnbull) + (setup-person 'piper) + (widget-insert " +Ben Wing and Martin Buchholz were heavy code contributors and maintainers +for 21.2 (the development branch leading to 21.4).\n\n") + (setup-person 'martin) + (setup-person 'ben) + (widget-insert " Steve Baur was the primary maintainer for 19.15 through 21.0.\n\n") (setup-person 'slb) (widget-insert " @@ -655,6 +692,10 @@ -- support for arbitrary pixmaps and widgets in a buffer -- face support on TTY's, including color + Many of these are now available in GNU Emacs 21, but the XEmacs + implementations are generally more efficient, and the XEmacs APIs are + generally more in line with modern programming practices. + * An installable package system, with a huge number of packages available that have been tested and are known to work with the latest version of XEmacs. @@ -1280,6 +1321,10 @@ (widget-insert "\ Sorry, no personal information available about me yet.\n")) + (purvis + (widget-insert + "\ +Sorry, no personal information available about me yet.\n")) (rickc (widget-insert "\ The hacker formerly known as Rick Busdiecker is a developer and @@ -1364,7 +1409,15 @@ (turnbull (widget-insert "\ Stephen lives with his Japanese wife and children in Tsukuba, Japan, -where he is a professor of economics at the University of Tsukuba.\n")) +where he is a professor of economics at the University of Tsukuba, +and occasionally regretting not going to MIT for college, where he +surely would have gotten addicted to computers early enough to have +learned to actually code. + +Well, they also serve who rail 'n' rant. + ") + (about-url-link 'turnbull nil "Visit Steve's personal page") + (widget-insert "\n")) (vin (widget-insert "\ I own and operate my own consulting firm, EtherSoft. Shhh, don't @@ -1718,6 +1771,10 @@ (widget-insert "\ Sorry, no information about my XEmacs contributions yet.\n")) + (purvis + (widget-insert + "\ +Currently filing off some of the splinters in the GTK port.\n")) (rickc (widget-insert "\ Maintainer of ILISP.\n")) @@ -1768,7 +1825,18 @@ (turnbull (widget-insert "\ -Former XEmacs Beta Release Manager.\n")) +Mostly a source of random noise and occasionally useful advice on +I18N up until people starting hinting that (2 years after the release +of 21.1) it was time for various projects to get pushed into the public +eye. Steve was the prime mover behind the release of 21.4. + +Since Vin took over the maintainership of 21.4, Steve has featured as +janitor and waterboy, handling (more or less) all those administrative +tasks that need to get done somehow by somebody---wishing he were coding +the whole time. + +Steve is maintainer of the edict, mule-ucs, and latin-unity packages, +and has contributed quite a bit of documentation, especially for Mule.\n")) (vin (widget-insert "\ Vin helps maintain the older, more mature (read: moldy) versions of diff --text -u 'xemacs-21.5.17/lisp/apropos.el' 'xemacs-21.5.18/lisp/apropos.el' Index: ./lisp/apropos.el --- ./lisp/apropos.el Fri Mar 15 16:43:18 2002 +++ ./lisp/apropos.el Wed Sep 15 17:30:26 2004 @@ -175,7 +175,10 @@ ;; XEmacs change: if obsolete, ;; only mention that. (or (function-obsoleteness-doc symbol) - (documentation symbol t))) + (condition-case nil + (documentation symbol t) + (void-function "(aliased to undefined function)") + (error "(unexpected error from `documention')")))) (substring doc 0 (string-match "\n" doc)) "(not documented)")) (and do-all @@ -225,7 +228,10 @@ ;; XEmacs change: if obsolete, ;; only mention that. (or (function-obsoleteness-doc symbol) - (documentation symbol t))) + (condition-case nil + (documentation symbol t) + (void-function "(aliased to undefined function)") + (error "(unexpected error from `documention')")))) (substring doc 0 (string-match "\n" doc)) "(not documented)")) (if (boundp symbol) diff --text -u 'xemacs-21.5.17/lisp/bytecomp.el' 'xemacs-21.5.18/lisp/bytecomp.el' Index: ./lisp/bytecomp.el --- ./lisp/bytecomp.el Tue Sep 9 22:37:19 2003 +++ ./lisp/bytecomp.el Sat Aug 14 06:19:15 2004 @@ -2956,7 +2956,7 @@ (byte-defop-compiler char-after 0-1+1) (byte-defop-compiler set-buffer 1) ;;(byte-defop-compiler set-mark 1) ;; obsolete -(byte-defop-compiler forward-word 1+1) +(byte-defop-compiler forward-word 0-1+1) (byte-defop-compiler char-syntax 1+1) (byte-defop-compiler nreverse 1) (byte-defop-compiler car-safe 1) diff --text -u 'xemacs-21.5.17/lisp/cl-compat.el' 'xemacs-21.5.18/lisp/cl-compat.el' Index: ./lisp/cl-compat.el --- ./lisp/cl-compat.el Sun Jun 10 19:42:21 2001 +++ ./lisp/cl-compat.el Sun Jun 27 06:25:24 2004 @@ -23,7 +23,7 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: FSF 21.3. ;;; Commentary: @@ -56,11 +56,6 @@ (defmacro defkeyword (x &optional doc) (list* 'defconst x (list 'quote x) (and doc (list doc)))) -;; XEmacs change. -;; We have built-in function. -;;(defun keywordp (sym) -;; (and (symbolp sym) (eq (aref (symbol-name sym) 0) ?\:) (set sym sym))) - (defun keyword-of (sym) (or (keywordp sym) (keywordp (intern (format ":%s" sym))))) @@ -192,5 +187,5 @@ (provide 'cl-compat) +;;; arch-tag: 9996bb4f-aaf5-4592-b436-bf64759a3163 ;;; cl-compat.el ends here - diff --text -u 'xemacs-21.5.17/lisp/cl-extra.el' 'xemacs-21.5.18/lisp/cl-extra.el' Index: ./lisp/cl-extra.el --- ./lisp/cl-extra.el Wed Oct 1 07:09:33 2003 +++ ./lisp/cl-extra.el Sun Jun 27 06:25:24 2004 @@ -1,6 +1,6 @@ ;;; cl-extra.el --- Common Lisp extensions for XEmacs Lisp (part two) -;; Copyright (C) 1993 Free Software Foundation, Inc. +;; Copyright (C) 1993,2000,2003 Free Software Foundation, Inc. ;; Copyright (C) 2002 Ben Wing. ;; Author: Dave Gillespie <daveg@synaptics.com> @@ -25,7 +25,7 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: FSF 21.3. ;;; Commentary: @@ -38,8 +38,6 @@ ;; This package was written by Dave Gillespie; it is a complete ;; rewrite of Cesar Quiroz's original cl.el package of December 1986. ;; -;; This package works with Emacs 18, Emacs 19, and XEmacs/Lucid Emacs 19. -;; ;; Bug reports, comments, and suggestions are welcome! ;; This file contains portions of the Common Lisp extensions @@ -49,6 +47,7 @@ ;;; Code: +;; XEmacs addition (eval-when-compile (require 'obsolete)) @@ -56,16 +55,6 @@ (error "Tried to load `cl-extra' before `cl'!")) -;;; We define these here so that this file can compile without having -;;; loaded the cl.el file already. - -(defmacro cl-push (x place) (list 'setq place (list 'cons x place))) -(defmacro cl-pop (place) - (list 'car (list 'prog1 place (list 'setq place (list 'cdr place))))) - -(defvar cl-emacs-type) - - ;;; Type coercion. (defun coerce (x type) @@ -77,11 +66,18 @@ ((eq type 'array) (if (arrayp x) x (vconcat x))) ((and (eq type 'character) (stringp x) (= (length x) 1)) (aref x 0)) ((and (eq type 'character) (symbolp x)) (coerce (symbol-name x) type)) + ;; XEmacs addition character <-> integer coercions ((and (eq type 'character) (char-int-p x)) (int-char x)) ((and (eq type 'integer) (characterp x)) (char-int x)) ((eq type 'float) (float x)) + ;; XEmacs addition: enhanced numeric type coercions + ((and (featurep 'number-types) + (memq type '(integer ratio bigfloat)) + (coerce-number x type))) + ;; XEmacs addition: bit-vector coercion ((eq type 'bit-vector) (if (bit-vector-p x) x (apply 'bit-vector (append x nil)))) + ;; XEmacs addition: weak-list coercion ((eq type 'weak-list) (if (weak-list-p x) x (let ((wl (make-weak-list))) @@ -100,8 +96,9 @@ strings case-insensitively." (cond ((eq x y) t) ((stringp x) - ;; avoids downcase + ;; XEmacs change: avoid downcase (eq t (compare-strings x nil nil y nil nil t))) + ;; XEmacs addition: compare characters ((characterp x) (and (characterp y) (or (char-equal x y) @@ -109,9 +106,8 @@ ((numberp x) (and (numberp y) (= x y))) ((consp x) - ;; XEmacs change (while (and (consp x) (consp y) (equalp (car x) (car y))) - (cl-pop x) (cl-pop y)) + (setq x (cdr x) y (cdr y))) (and (not (consp x)) (equalp x y))) ((vectorp x) (and (vectorp y) (= (length x) (length y)) @@ -141,7 +137,7 @@ (setcar cl-p1 (cdr (car cl-p1)))) (aref (car cl-p1) cl-i))) (setq cl-p1 (cdr cl-p1) cl-p2 (cdr cl-p2))) - (cl-push (apply cl-func cl-args) cl-res) + (push (apply cl-func cl-args) cl-res) (setq cl-i (1+ cl-i))) (nreverse cl-res)) (let ((cl-res nil) @@ -150,9 +146,9 @@ (let ((cl-n (min (length cl-x) (length cl-y))) (cl-i -1)) (while (< (setq cl-i (1+ cl-i)) cl-n) - (cl-push (funcall cl-func - (if (consp cl-x) (cl-pop cl-x) (aref cl-x cl-i)) - (if (consp cl-y) (cl-pop cl-y) (aref cl-y cl-i))) + (push (funcall cl-func + (if (consp cl-x) (pop cl-x) (aref cl-x cl-i)) + (if (consp cl-y) (pop cl-y) (aref cl-y cl-i))) cl-res))) (nreverse cl-res)))) @@ -172,17 +168,17 @@ (cl-args (cons cl-list (copy-sequence cl-rest))) cl-p) (while (not (memq nil cl-args)) - (cl-push (apply cl-func cl-args) cl-res) + (push (apply cl-func cl-args) cl-res) (setq cl-p cl-args) - (while cl-p (setcar cl-p (cdr (cl-pop cl-p)) ))) + (while cl-p (setcar cl-p (cdr (pop cl-p)) ))) (nreverse cl-res)) (let ((cl-res nil)) (while cl-list - (cl-push (funcall cl-func cl-list) cl-res) + (push (funcall cl-func cl-list) cl-res) (setq cl-list (cdr cl-list))) (nreverse cl-res)))) - +;; XEmacs change: in Emacs, this function is named cl-mapc. (defun mapc (cl-func cl-seq &rest cl-rest) "Like `mapcar', but does not accumulate values returned by the function." (if cl-rest @@ -192,6 +188,9 @@ (mapc-internal cl-func cl-seq)) cl-seq) +;; XEmacs addition: FSF compatibility +(defalias 'cl-mapc 'mapc) + (defun mapl (cl-func cl-list &rest cl-rest) "Like `maplist', but does not accumulate values returned by the function." (if cl-rest @@ -219,7 +218,7 @@ (if cl-res (throw 'cl-some cl-res))))) cl-seq cl-rest) nil) (let ((cl-x nil)) - (while (and cl-seq (not (setq cl-x (funcall cl-pred (cl-pop cl-seq)))))) + (while (and cl-seq (not (setq cl-x (funcall cl-pred (pop cl-seq)))))) cl-x))) (defun every (cl-pred cl-seq &rest cl-rest) @@ -243,35 +242,19 @@ (not (apply 'every cl-pred cl-seq cl-rest))) ;;; Support for `loop'. -(defun cl-map-keymap (cl-func cl-map) - (while (symbolp cl-map) (setq cl-map (symbol-function cl-map))) - (if (eq cl-emacs-type 'lucid) (funcall 'map-keymap cl-func cl-map) - (if (listp cl-map) - (let ((cl-p cl-map)) - (while (consp (setq cl-p (cdr cl-p))) - (cond ((consp (car cl-p)) - (funcall cl-func (car (car cl-p)) (cdr (car cl-p)))) - ((vectorp (car cl-p)) - (cl-map-keymap cl-func (car cl-p))) - ((eq (car cl-p) 'keymap) - (setq cl-p nil))))) - (let ((cl-i -1)) - (while (< (setq cl-i (1+ cl-i)) (length cl-map)) - (if (aref cl-map cl-i) - (funcall cl-func cl-i (aref cl-map cl-i)))))))) +(defalias 'cl-map-keymap 'map-keymap) (defun cl-map-keymap-recursively (cl-func-rec cl-map &optional cl-base) (or cl-base - (setq cl-base (copy-sequence (if (eq cl-emacs-type 18) "0" [0])))) - (cl-map-keymap + (setq cl-base (copy-sequence [0]))) + (map-keymap (function (lambda (cl-key cl-bind) (aset cl-base (1- (length cl-base)) cl-key) (if (keymapp cl-bind) (cl-map-keymap-recursively cl-func-rec cl-bind - (funcall (if (eq cl-emacs-type 18) 'concat 'vconcat) - cl-base (list 0))) + (vconcat cl-base (list 0))) (funcall cl-func-rec cl-base cl-bind)))) cl-map)) @@ -279,17 +262,15 @@ (or cl-what (setq cl-what (current-buffer))) (if (bufferp cl-what) (let (cl-mark cl-mark2 (cl-next t) cl-next2) - (save-excursion - (set-buffer cl-what) + (with-current-buffer cl-what (setq cl-mark (copy-marker (or cl-start (point-min)))) (setq cl-mark2 (and cl-end (copy-marker cl-end)))) (while (and cl-next (or (not cl-mark2) (< cl-mark cl-mark2))) - (setq cl-next (and-fboundp 'next-property-change - (if cl-prop (next-single-property-change - cl-mark cl-prop cl-what) - (next-property-change cl-mark cl-what))) - cl-next2 (or cl-next (save-excursion - (set-buffer cl-what) (point-max)))) + (setq cl-next (if cl-prop (next-single-property-change + cl-mark cl-prop cl-what) + (next-property-change cl-mark cl-what)) + cl-next2 (or cl-next (with-current-buffer cl-what + (point-max)))) (funcall cl-func (prog1 (marker-position cl-mark) (set-marker cl-mark cl-next2)) (if cl-mark2 (min cl-next2 cl-mark2) cl-next2))) @@ -297,10 +278,9 @@ (or cl-start (setq cl-start 0)) (or cl-end (setq cl-end (length cl-what))) (while (< cl-start cl-end) - (let ((cl-next (or (and-fboundp 'next-property-change - (if cl-prop (next-single-property-change - cl-start cl-prop cl-what) - (next-property-change cl-start cl-what))) + (let ((cl-next (or (if cl-prop (next-single-property-change + cl-start cl-prop cl-what) + (next-property-change cl-start cl-what)) cl-end))) (funcall cl-func cl-start (min cl-next cl-end)) (setq cl-start cl-next))))) @@ -313,8 +293,7 @@ ;; This is the preferred algorithm, though overlay-lists is ;; undocumented. (let (cl-ovl) - (save-excursion - (set-buffer cl-buffer) + (with-current-buffer cl-buffer (setq cl-ovl (overlay-lists)) (if cl-start (setq cl-start (copy-marker cl-start))) (if cl-end (setq cl-end (copy-marker cl-end)))) @@ -330,10 +309,10 @@ (if cl-end (set-marker cl-end nil))) ;; This alternate algorithm fails to find zero-length overlays. - (let ((cl-mark (save-excursion (set-buffer cl-buffer) - (copy-marker (or cl-start (point-min))))) - (cl-mark2 (and cl-end (save-excursion (set-buffer cl-buffer) - (copy-marker cl-end)))) + (let ((cl-mark (with-current-buffer cl-buffer + (copy-marker (or cl-start (point-min))))) + (cl-mark2 (and cl-end (with-current-buffer cl-buffer + (copy-marker cl-end)))) cl-pos cl-ovl) (while (save-excursion (and (setq cl-pos (marker-position cl-mark)) @@ -360,28 +339,28 @@ (defvar cl-progv-save) (defun cl-progv-before (syms values) (while syms - (cl-push (if (boundp (car syms)) + (push (if (boundp (car syms)) (cons (car syms) (symbol-value (car syms))) (car syms)) cl-progv-save) (if values - (set (cl-pop syms) (cl-pop values)) - (makunbound (cl-pop syms))))) + (set (pop syms) (pop values)) + (makunbound (pop syms))))) (defun cl-progv-after () (while cl-progv-save (if (consp (car cl-progv-save)) (set (car (car cl-progv-save)) (cdr (car cl-progv-save))) (makunbound (car cl-progv-save))) - (cl-pop cl-progv-save))) + (pop cl-progv-save))) ;;; Numbers. (defun gcd (&rest args) "Return the greatest common divisor of the arguments." - (let ((a (abs (or (cl-pop args) 0)))) + (let ((a (abs (or (pop args) 0)))) (while args - (let ((b (abs (cl-pop args)))) + (let ((b (abs (pop args)))) (while (> b 0) (setq b (% a (setq a b)))))) a)) @@ -389,9 +368,9 @@ "Return the least common multiple of the arguments." (if (memq 0 args) 0 - (let ((a (abs (or (cl-pop args) 1)))) + (let ((a (abs (or (pop args) 1)))) (while args - (let ((b (abs (cl-pop args)))) + (let ((b (abs (pop args)))) (setq a (* (/ a (gcd a b)) b)))) a))) @@ -407,6 +386,7 @@ g) (if (eq a 0) 0 (signal 'arith-error nil)))) +;; XEmacs addition (defun cl-expt (x y) "Return X raised to the power of Y. Works only for integer arguments." (if (<= y 0) (if (= y 0) 1 (if (memq x '(-1 1)) (cl-expt x (- y)) 0)) @@ -573,7 +553,7 @@ ; (if end ; (let ((res nil)) ; (while (>= (setq end (1- end)) start) -; (cl-push (cl-pop seq) res)) +; (push (pop seq) res)) ; (nreverse res)) ; (copy-sequence seq))) ; (t @@ -587,6 +567,7 @@ (defun concatenate (type &rest seqs) "Concatenate, into a sequence of type TYPE, the argument SEQUENCES." + ;; XEmacs change: use case instead of cond for clarity (case type (vector (apply 'vconcat seqs)) (string (apply 'concat seqs)) @@ -616,25 +597,7 @@ (setq list (cdr list))) (if (numberp sublist) (equal sublist list) (eq sublist list))) -(defun cl-copy-tree (tree &optional vecp) - "Make a copy of TREE. -If TREE is a cons cell, this recursively copies both its car and its cdr. -Contrast to copy-sequence, which copies only along the cdrs. With second -argument VECP, this copies vectors as well as conses." - (if (consp tree) - (let ((p (setq tree (copy-list tree)))) - (while (consp p) - (if (or (consp (car p)) (and vecp (vectorp (car p)))) - (setcar p (cl-copy-tree (car p) vecp))) - (or (listp (cdr p)) (setcdr p (cl-copy-tree (cdr p) vecp))) - (cl-pop p))) - (if (and vecp (vectorp tree)) - (let ((i (length (setq tree (copy-sequence tree))))) - (while (>= (setq i (1- i)) 0) - (aset tree i (cl-copy-tree (aref tree i) vecp)))))) - tree) -(or (and (fboundp 'copy-tree) (subrp (symbol-function 'copy-tree))) - (defalias 'copy-tree 'cl-copy-tree)) +(defalias 'cl-copy-tree 'copy-tree) ;;; Property lists. @@ -653,6 +616,11 @@ (while (and (cdr p) (not (eq (car (cdr p)) tag))) (setq p (cdr (cdr p)))) (and (cdr p) (progn (setcdr p (cdr (cdr (cdr p)))) t)))) +;; XEmacs change: we have a builtin remprop +(defalias 'cl-remprop 'remprop) + + + ;;; Hash tables. ;; The `regular' Common Lisp hash-table stuff has been moved into C. @@ -693,6 +661,10 @@ (defalias 'cl-remhash 'remhash) (defalias 'cl-clrhash 'clrhash) (defalias 'cl-maphash 'maphash) +;; These three actually didn't exist in Emacs-20. +(defalias 'cl-make-hash-table 'make-hash-table) +(defalias 'cl-hash-table-p 'hash-table-p) +(defalias 'cl-hash-table-count 'hash-table-count) ;;; Some debugging aids. @@ -714,6 +686,7 @@ (skip-chars-forward " ") (if (looking-at "(") (let ((skip (or (looking-at "((") + ;; XEmacs: be selective about trailing stuff after prog (looking-at "(prog[nv12\\(ress-feedback\\|n-with-message\\)]") (looking-at "(unwind-protect ") (looking-at "(function (") @@ -753,7 +726,7 @@ (cl-macroexpand-all (cons 'progn (cddr form)) env) (let ((letf nil) (res nil) (lets (cadr form))) (while lets - (cl-push (if (consp (car lets)) + (push (if (consp (car lets)) (let ((exp (cl-macroexpand-all (caar lets) env))) (or (symbolp exp) (setq letf t)) (cons exp (cl-macroexpand-body (cdar lets) env))) @@ -782,13 +755,14 @@ (sub (pairlis cl-closure-vars new)) (decls nil)) (while (or (stringp (car body)) (eq (car-safe (car body)) 'interactive)) - (cl-push (list 'quote (cl-pop body)) decls)) + (push (list 'quote (pop body)) decls)) (put (car (last cl-closure-vars)) 'used t) (append (list 'list '(quote lambda) '(quote (&rest --cl-rest--))) (sublis sub (nreverse decls)) (list (list* 'list '(quote apply) + ;; XEmacs: put a quote before the function (list 'list '(quote quote) (list 'function (list* 'lambda @@ -801,6 +775,7 @@ '((quote --cl-rest--))))))) (list (car form) (list* 'lambda (cadadr form) body)))) (let ((found (assq (cadr form) env))) + ;; XEmacs: cadr/caddr operate on nil without errors (if (eq (cadr (caddr found)) 'cl-labels-args) (cl-macroexpand-all (cadr (caddr (cadddr found))) env) form)))) @@ -831,6 +806,8 @@ (run-hooks 'cl-extra-load-hook) +;; XEmacs addition (provide 'cl-extra) +;;; arch-tag: bcd03437-0871-43fb-a8f1-ad0e0b5427ed ;;; cl-extra.el ends here diff --text -u 'xemacs-21.5.17/lisp/cl-macs.el' 'xemacs-21.5.18/lisp/cl-macs.el' Index: ./lisp/cl-macs.el --- ./lisp/cl-macs.el Sat Jul 19 05:39:45 2003 +++ ./lisp/cl-macs.el Wed Sep 22 11:05:49 2004 @@ -1,6 +1,6 @@ ;;; cl-macs.el --- Common Lisp extensions for XEmacs Lisp (part four) -;; Copyright (C) 1993 Free Software Foundation, Inc. +;; Copyright (C) 1993, 2003, 2004 Free Software Foundation, Inc. ;; Copyright (C) 2002 Ben Wing. ;; Author: Dave Gillespie <daveg@synaptics.com> @@ -24,7 +24,7 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: FSF 21.3. ;;; Commentary: @@ -35,8 +35,6 @@ ;; This package was written by Dave Gillespie; it is a complete ;; rewrite of Cesar Quiroz's original cl.el package of December 1986. ;; -;; This package works with Emacs 18, Emacs 19, and Lucid Emacs 19. -;; ;; Bug reports, comments, and suggestions are welcome! ;; This file contains the portions of the Common Lisp extensions @@ -53,20 +51,11 @@ (error "Tried to load `cl-macs' before `cl'!")) -;;; We define these here so that this file can compile without having -;;; loaded the cl.el file already. - -(defmacro cl-push (x place) (list 'setq place (list 'cons x place))) -(defmacro cl-pop (place) - (list 'car (list 'prog1 place (list 'setq place (list 'cdr place))))) (defmacro cl-pop2 (place) (list 'prog1 (list 'car (list 'cdr place)) (list 'setq place (list 'cdr (list 'cdr place))))) -(put 'cl-push 'edebug-form-spec 'edebug-sexps) -(put 'cl-pop 'edebug-form-spec 'edebug-sexps) (put 'cl-pop2 'edebug-form-spec 'edebug-sexps) -(defvar cl-emacs-type) (defvar cl-optimize-safety) (defvar cl-optimize-speed) @@ -76,7 +65,6 @@ (require (progn - (or (fboundp 'defalias) (fset 'defalias 'fset)) (or (fboundp 'cl-transform-function-property) (defalias 'cl-transform-function-property #'(lambda (n p f) @@ -89,24 +77,101 @@ (defvar cl-old-bc-file-form nil) -;; Patch broken Emacs 18 compiler (re top-level macros). -;; Emacs 19 compiler doesn't need this patch. -;; Also, undo broken definition of `eql' that uses same bytecode as `eq'. - ;;;###autoload (defun cl-compile-time-init () - (setq cl-old-bc-file-form (symbol-function 'byte-compile-file-form)) - (or (fboundp 'byte-compile-flush-pending) ; Emacs 19 compiler? - (defalias 'byte-compile-file-form - #'(lambda (form) - (setq form (macroexpand form byte-compile-macro-environment)) - (if (eq (car-safe form) 'progn) - (cons 'progn (mapcar 'byte-compile-file-form (cdr form))) - (funcall cl-old-bc-file-form form))))) - (put 'eql 'byte-compile 'cl-byte-compile-compiler-macro) (run-hooks 'cl-hack-bytecomp-hook)) +;;; Some predicates for analyzing Lisp forms. These are used by various +;;; macro expanders to optimize the results in certain common cases. + +(defconst cl-simple-funcs '(car cdr nth aref elt if and or + - 1+ 1- min max + car-safe cdr-safe progn prog1 prog2)) +(defconst cl-safe-funcs '(* / % length memq list vector vectorp + < > <= >= = error)) + +;;; Check if no side effects, and executes quickly. +(defun cl-simple-expr-p (x &optional size) + (or size (setq size 10)) + (if (and (consp x) (not (memq (car x) '(quote function function*)))) + (and (symbolp (car x)) + (or (memq (car x) cl-simple-funcs) + (get (car x) 'side-effect-free)) + (progn + (setq size (1- size)) + (while (and (setq x (cdr x)) + (setq size (cl-simple-expr-p (car x) size)))) + (and (null x) (>= size 0) size))) + (and (> size 0) (1- size)))) + +(defun cl-simple-exprs-p (xs) + (while (and xs (cl-simple-expr-p (car xs))) + (setq xs (cdr xs))) + (not xs)) + +;;; Check if no side effects. +(defun cl-safe-expr-p (x) + (or (not (and (consp x) (not (memq (car x) '(quote function function*))))) + (and (symbolp (car x)) + (or (memq (car x) cl-simple-funcs) + (memq (car x) cl-safe-funcs) + (get (car x) 'side-effect-free)) + (progn + (while (and (setq x (cdr x)) (cl-safe-expr-p (car x)))) + (null x))))) + +;;; Check if constant (i.e., no side effects or dependencies). +(defun cl-const-expr-p (x) + (cond ((consp x) + (or (eq (car x) 'quote) + (and (memq (car x) '(function function*)) + (or (symbolp (nth 1 x)) + (and (eq (car-safe (nth 1 x)) 'lambda) 'func))))) + ((symbolp x) (and (memq x '(nil t)) t)) + (t t))) + +(defun cl-const-exprs-p (xs) + (while (and xs (cl-const-expr-p (car xs))) + (setq xs (cdr xs))) + (not xs)) + +(defun cl-const-expr-val (x) + (and (eq (cl-const-expr-p x) t) (if (consp x) (nth 1 x) x))) + +(defun cl-expr-access-order (x v) + (if (cl-const-expr-p x) v + (if (consp x) + (progn + (while (setq x (cdr x)) (setq v (cl-expr-access-order (car x) v))) + v) + (if (eq x (car v)) (cdr v) '(t))))) + +;;; Count number of times X refers to Y. Return nil for 0 times. +(defun cl-expr-contains (x y) + (cond ((equal y x) 1) + ((and (consp x) (not (memq (car-safe x) '(quote function function*)))) + (let ((sum 0)) + (while x + (setq sum (+ sum (or (cl-expr-contains (pop x) y) 0)))) + (and (> sum 0) sum))) + (t nil))) + +(defun cl-expr-contains-any (x y) + (while (and y (not (cl-expr-contains x (car y)))) (pop y)) + y) + +;;; Check whether X may depend on any of the symbols in Y. +(defun cl-expr-depends-p (x y) + (and (not (cl-const-expr-p x)) + (or (not (cl-safe-expr-p x)) (cl-expr-contains-any x y)))) + +;;; Symbols. + +(defvar *gensym-counter*) + +;; XEmacs change: gensym and gentemp have been moved to cl.el. + + ;;; Program structure. ;;;###autoload @@ -223,7 +288,7 @@ (intern (upcase (symbol-name arg))))) ((listp arg) (if (memq arg arglist-visited) (error 'circular-list '(arg))) - (cl-push arg arglist-visited) + (push arg arglist-visited) (let ((arg (copy-list arg)) junk) ;; Clean the list (let ((p (last arg))) (if (cdr p) (setcdr p (list '&rest (cdr p))))) @@ -261,15 +326,15 @@ ;; Add CL lambda list to documentation. npak@ispras.ru (if (and (stringp (car body)) (cdr body)) - (setq doc (cl-pop body))) - (cl-push (concat doc - "\nCommon Lisp lambda list:\n" - " " (cl-function-arglist bind-block args) - "\n\n") - header) + (setq doc (pop body))) + (push (concat doc + "\nCommon Lisp lambda list:\n" + " " (cl-function-arglist bind-block args) + "\n\n") + header) (while (or (stringp (car body)) (eq (car-safe (car body)) 'interactive)) - (cl-push (cl-pop body) header)) + (push (pop body) header)) (setq args (if (listp args) (copy-list args) (list '&rest args))) (let ((p (last args))) (if (cdr p) (setcdr p (list '&rest (cdr p))))) (if (setq bind-defs (cadr (memq '&cl-defs args))) @@ -285,19 +350,21 @@ (not (memq (car args) '(nil &rest &body &key &aux))) (not (and (eq (car args) '&optional) (or bind-defs (consp (cadr args)))))) - (cl-push (cl-pop args) simple-args)) + (push (pop args) simple-args)) (or (eq bind-block 'cl-none) (setq body (list (list* 'block bind-block body)))) (if (null args) (list* nil (nreverse simple-args) (nconc (nreverse header) body)) - (if (memq '&optional simple-args) (cl-push '&optional args)) + (if (memq '&optional simple-args) (push '&optional args)) (cl-do-arglist args nil (- (length simple-args) (if (memq '&optional simple-args) 1 0))) (setq bind-lets (nreverse bind-lets)) (list* (and bind-inits (list* 'eval-when '(compile load eval) (nreverse bind-inits))) (nconc (nreverse simple-args) - (list '&rest (car (cl-pop bind-lets)))) + (list '&rest (car (pop bind-lets)))) + ;; XEmacs change: we add usage information using Nickolay's + ;; approach above (nconc (nreverse header) (list (nconc (list 'let* bind-lets) (nreverse bind-forms) body))))))) @@ -306,7 +373,7 @@ (if (nlistp args) (if (or (memq args lambda-list-keywords) (not (symbolp args))) (error "Invalid argument name: %s" args) - (cl-push (list args expr) bind-lets)) + (push (list args expr) bind-lets)) (setq args (copy-list args)) (let ((p (last args))) (if (cdr p) (setcdr p (list '&rest (cdr p))))) (let ((p (memq '&body args))) (if p (setcar p '&rest))) @@ -320,9 +387,9 @@ (if (listp (cadr restarg)) (setq restarg (gensym "--rest--")) (setq restarg (cadr restarg))) - (cl-push (list restarg expr) bind-lets) + (push (list restarg expr) bind-lets) (if (eq (car args) '&whole) - (cl-push (list (cl-pop2 args) restarg) bind-lets)) + (push (list (cl-pop2 args) restarg) bind-lets)) (let ((p args)) (setq minarg restarg) (while (and p (not (memq (car p) lambda-list-keywords))) @@ -336,7 +403,7 @@ (let ((poparg (list (if (or (cdr args) (not exactarg)) 'pop 'car) restarg))) (cl-do-arglist - (cl-pop args) + (pop args) (if (or laterarg (= safety 0)) poparg (list 'if minarg poparg (list 'signal '(quote wrong-number-of-arguments) @@ -344,9 +411,9 @@ (list 'quote bind-block)) (list 'length restarg))))))) (setq num (1+ num) laterarg t)) - (while (and (eq (car args) '&optional) (cl-pop args)) + (while (and (eq (car args) '&optional) (pop args)) (while (and args (not (memq (car args) lambda-list-keywords))) - (let ((arg (cl-pop args))) + (let ((arg (pop args))) (or (consp arg) (setq arg (list arg))) (if (cddr arg) (cl-do-arglist (nth 2 arg) (list 'and restarg t))) (let ((def (if (cdr arg) (nth 1 arg) @@ -361,16 +428,16 @@ (let ((arg (cl-pop2 args))) (if (consp arg) (cl-do-arglist arg restarg))) (or (eq (car args) '&key) (= safety 0) exactarg - (cl-push (list 'if restarg + (push (list 'if restarg (list 'signal '(quote wrong-number-of-arguments) (list 'list (and (not (eq bind-block 'cl-none)) (list 'quote bind-block)) (list '+ num (list 'length restarg))))) bind-forms))) - (while (and (eq (car args) '&key) (cl-pop args)) + (while (and (eq (car args) '&key) (pop args)) (while (and args (not (memq (car args) lambda-list-keywords))) - (let ((arg (cl-pop args))) + (let ((arg (pop args))) (or (consp arg) (setq arg (list arg))) (let* ((karg (if (consp (car arg)) (caar arg) (intern (format ":%s" (car arg))))) @@ -399,13 +466,14 @@ 'quote (list nil (cl-const-expr-val def))) (list 'list nil def)))))))) - (cl-push karg keys) + (push karg keys) + ;; XEmacs addition (if (= (aref (symbol-name karg) 0) ?:) (progn (set karg karg) - (cl-push (list 'setq karg (list 'quote karg)) - bind-inits))))))) + (push (list 'setq karg (list 'quote karg)) + bind-inits))))))) (setq keys (nreverse keys)) - (or (and (eq (car args) '&allow-other-keys) (cl-pop args)) + (or (and (eq (car args) '&allow-other-keys) (pop args)) (null keys) (= safety 0) (let* ((var (gensym "--keys--")) (allow '(:allow-other-keys)) @@ -427,24 +495,24 @@ (format "Keyword argument %%s not one of %s" keys) (list 'car var))))))) - (cl-push (list 'let (list (list var restarg)) check) bind-forms))) - (while (and (eq (car args) '&aux) (cl-pop args)) + (push (list 'let (list (list var restarg)) check) bind-forms))) + (while (and (eq (car args) '&aux) (pop args)) (while (and args (not (memq (car args) lambda-list-keywords))) (if (consp (car args)) (if (and bind-enquote (cadar args)) (cl-do-arglist (caar args) - (list 'quote (cadr (cl-pop args)))) - (cl-do-arglist (caar args) (cadr (cl-pop args)))) - (cl-do-arglist (cl-pop args) nil)))) + (list 'quote (cadr (pop args)))) + (cl-do-arglist (caar args) (cadr (pop args)))) + (cl-do-arglist (pop args) nil)))) (if args (error "Malformed argument list %s" save-args))))) (defun cl-arglist-args (args) (if (nlistp args) (list args) (let ((res nil) (kind nil) arg) (while (consp args) - (setq arg (cl-pop args)) + (setq arg (pop args)) (if (memq arg lambda-list-keywords) (setq kind arg) - (if (eq arg '&cl-defs) (cl-pop args) + (if (eq arg '&cl-defs) (pop args) (and (consp arg) kind (setq arg (car arg))) (and (consp arg) (cdr arg) (eq kind '&key) (setq arg (cadr arg))) (setq res (nconc res (cl-arglist-args arg)))))) @@ -492,13 +560,13 @@ If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level." (if (and (fboundp 'cl-compiling-file) (cl-compiling-file) (not cl-not-toplevel) (not (boundp 'for-effect))) ; horrible kludge - (let ((comp (or (memq 'compile when) (memq ':compile-toplevel when))) + (let ((comp (or (memq 'compile when) (memq :compile-toplevel when))) (cl-not-toplevel t)) - (if (or (memq 'load when) (memq ':load-toplevel when)) + (if (or (memq 'load when) (memq :load-toplevel when)) (if comp (cons 'progn (mapcar 'cl-compile-time-too body)) (list* 'if nil nil body)) (progn (if comp (eval (cons 'progn body))) nil))) - (and (or (memq 'eval when) (memq ':execute when)) + (and (or (memq 'eval when) (memq :execute when)) (cons 'progn body)))) (defun cl-compile-time-too (form) @@ -509,18 +577,11 @@ (cons 'progn (mapcar 'cl-compile-time-too (cdr form)))) ((eq (car-safe form) 'eval-when) (let ((when (nth 1 form))) - (if (or (memq 'eval when) (memq ':execute when)) + (if (or (memq 'eval when) (memq :execute when)) (list* 'eval-when (cons 'compile when) (cddr form)) form))) (t (eval form) form))) -(or (and (fboundp 'eval-when-compile) - (not (eq (car-safe (symbol-function 'eval-when-compile)) 'autoload))) - (eval '(defmacro eval-when-compile (&rest body) - "Like `progn', but evaluates the body at compile time. -The result of the body appears to the compiler as a quoted constant." - (list 'quote (eval (cons 'progn body)))))) - ;;;###autoload (defmacro load-time-value (form &optional read-only) "Like `progn', but evaluates the body at load time. @@ -564,6 +625,7 @@ (mapcar #'(lambda (c) (cons (cond ((memq (car c) '(t otherwise)) + ;; XEmacs addition: check for last clause (or (eq c last-clause) (error "`%s' is allowed only as the last case clause" @@ -579,7 +641,7 @@ (if (memq (car c) head-list) (error "Duplicate key in case: %s" (car c))) - (cl-push (car c) head-list) + (push (car c) head-list) (list 'eql temp (list 'quote (car c))))) (or (cdr c) '(nil)))) clauses)))) @@ -595,6 +657,7 @@ (defmacro ecase (expr &rest clauses) "(ecase EXPR CLAUSES...): like `case', but error if no case fits. `otherwise'-clauses are not allowed." + ;; XEmacs addition: disallow t and otherwise (let ((disallowed (or (assq t clauses) (assq 'otherwise clauses)))) (if disallowed @@ -619,7 +682,7 @@ (list 'error "etypecase failed: %s, %s" temp (list 'quote (reverse type-list)))) (t - (cl-push (car c) type-list) + (push (car c) type-list) (cl-make-type-test temp (car c)))) (or (cdr c) '(nil)))) clauses)))) @@ -672,20 +735,20 @@ (byte-compile-normal-call (cons 'throw (cdr cl-form)))) ;;;###autoload -(defmacro return (&optional res) +(defmacro return (&optional result) "(return [RESULT]): return from the block named nil. This is equivalent to `(return-from nil RESULT)'." - (list 'return-from nil res)) + (list 'return-from nil result)) ;;;###autoload -(defmacro return-from (name &optional res) +(defmacro return-from (name &optional result) "(return-from NAME [RESULT]): return from the block named NAME. This jumps out to the innermost enclosing `(block NAME ...)' form, returning RESULT from that form (or nil if RESULT is omitted). This is compatible with Common Lisp, but note that `defun' and `defmacro' do not create implicit blocks as they do in Common Lisp." (let ((name2 (intern (format "--cl-block-%s--" name)))) - (list 'cl-block-throw (list 'quote name2) res))) + (list 'cl-block-throw (list 'quote name2) result))) ;;; The "loop" macro. @@ -704,7 +767,7 @@ The loop macro consists of a series of clauses, which do things like iterate variables, set conditions for exiting the loop, accumulating values to be returned as the return value of the loop, and executing arbitrary -blocks of code. Each clause is proceed in turn, and the loop executes its +blocks of code. Each clause is processed in turn, and the loop executes its body repeatedly until an exit condition is hit. It's important to understand that loop clauses such as `for' and `while', @@ -993,10 +1056,10 @@ (setq args (append args '(cl-end-loop))) (while (not (eq (car args) 'cl-end-loop)) (cl-parse-loop-clause)) (if loop-finish-flag - (cl-push (list (list loop-finish-flag t)) loop-bindings)) + (push (list (list loop-finish-flag t)) loop-bindings)) (if loop-first-flag - (progn (cl-push (list (list loop-first-flag t)) loop-bindings) - (cl-push (list 'setq loop-first-flag nil) loop-steps))) + (progn (push (list (list loop-first-flag t)) loop-bindings) + (push (list 'setq loop-first-flag nil) loop-steps))) (let* ((epilogue (nconc (nreverse loop-finally) (list (or loop-result-explicit loop-result)))) (ands (cl-loop-build-ands (nreverse loop-body))) @@ -1027,21 +1090,21 @@ (list (list 'if loop-finish-flag (cons 'progn epilogue) loop-result-var))) epilogue)))) - (if loop-result-var (cl-push (list loop-result-var) loop-bindings)) + (if loop-result-var (push (list loop-result-var) loop-bindings)) (while loop-bindings (if (cdar loop-bindings) - (setq body (list (cl-loop-let (cl-pop loop-bindings) body t))) + (setq body (list (cl-loop-let (pop loop-bindings) body t))) (let ((lets nil)) (while (and loop-bindings (not (cdar loop-bindings))) - (cl-push (car (cl-pop loop-bindings)) lets)) + (push (car (pop loop-bindings)) lets)) (setq body (list (cl-loop-let lets body nil)))))) (if loop-symbol-macs (setq body (list (list* 'symbol-macrolet loop-symbol-macs body)))) (list* 'block loop-name body))))) (defun cl-parse-loop-clause () ; uses args, loop-* - (let ((word (cl-pop args)) + (let ((word (pop args)) (hash-types '(hash-key hash-keys hash-value hash-values)) (key-types '(key-code key-codes key-seq key-seqs key-binding key-bindings))) @@ -1051,39 +1114,39 @@ (error "Malformed `loop' macro")) ((eq word 'named) - (setq loop-name (cl-pop args))) + (setq loop-name (pop args))) ((eq word 'initially) - (if (memq (car args) '(do doing)) (cl-pop args)) + (if (memq (car args) '(do doing)) (pop args)) (or (consp (car args)) (error "Syntax error on `initially' clause")) (while (consp (car args)) - (cl-push (cl-pop args) loop-initially))) + (push (pop args) loop-initially))) ((eq word 'finally) (if (eq (car args) 'return) (setq loop-result-explicit (or (cl-pop2 args) '(quote nil))) - (if (memq (car args) '(do doing)) (cl-pop args)) + (if (memq (car args) '(do doing)) (pop args)) (or (consp (car args)) (error "Syntax error on `finally' clause")) (if (and (eq (caar args) 'return) (null loop-name)) - (setq loop-result-explicit (or (nth 1 (cl-pop args)) '(quote nil))) + (setq loop-result-explicit (or (nth 1 (pop args)) '(quote nil))) (while (consp (car args)) - (cl-push (cl-pop args) loop-finally))))) + (push (pop args) loop-finally))))) ((memq word '(for as)) (let ((loop-for-bindings nil) (loop-for-sets nil) (loop-for-steps nil) (ands nil)) (while - (let ((var (or (cl-pop args) (gensym)))) - (setq word (cl-pop args)) - (if (eq word 'being) (setq word (cl-pop args))) - (if (memq word '(the each)) (setq word (cl-pop args))) + (let ((var (or (pop args) (gensym)))) + (setq word (pop args)) + (if (eq word 'being) (setq word (pop args))) + (if (memq word '(the each)) (setq word (pop args))) (if (memq word '(buffer buffers)) (setq word 'in args (cons '(buffer-list) args))) (cond ((memq word '(from downfrom upfrom to downto upto above below by)) - (cl-push word args) + (push word args) (if (memq (car args) '(downto above)) (error "Must specify `from' value for downward loop")) (let* ((down (or (eq (car args) 'downfrom) @@ -1101,31 +1164,31 @@ (gensym)))) (and step (numberp step) (<= step 0) (error "Loop `by' value is not positive: %s" step)) - (cl-push (list var (or start 0)) loop-for-bindings) - (if end-var (cl-push (list end-var end) loop-for-bindings)) - (if step-var (cl-push (list step-var step) + (push (list var (or start 0)) loop-for-bindings) + (if end-var (push (list end-var end) loop-for-bindings)) + (if step-var (push (list step-var step) loop-for-bindings)) (if end - (cl-push (list + (push (list (if down (if excl '> '>=) (if excl '< '<=)) var (or end-var end)) loop-body)) - (cl-push (list var (list (if down '- '+) var + (push (list var (list (if down '- '+) var (or step-var step 1))) loop-for-steps))) ((memq word '(in in-ref on)) (let* ((on (eq word 'on)) (temp (if (and on (symbolp var)) var (gensym)))) - (cl-push (list temp (cl-pop args)) loop-for-bindings) - (cl-push (list 'consp temp) loop-body) + (push (list temp (pop args)) loop-for-bindings) + (push (list 'consp temp) loop-body) (if (eq word 'in-ref) - (cl-push (list var (list 'car temp)) loop-symbol-macs) + (push (list var (list 'car temp)) loop-symbol-macs) (or (eq temp var) (progn - (cl-push (list var nil) loop-for-bindings) - (cl-push (list var (if on temp (list 'car temp))) + (push (list var nil) loop-for-bindings) + (push (list var (if on temp (list 'car temp))) loop-for-sets)))) - (cl-push (list temp + (push (list temp (if (eq (car args) 'by) (let ((step (cl-pop2 args))) (if (and (memq (car-safe step) @@ -1138,20 +1201,20 @@ loop-for-steps))) ((eq word '=) - (let* ((start (cl-pop args)) + (let* ((start (pop args)) (then (if (eq (car args) 'then) (cl-pop2 args) start))) - (cl-push (list var nil) loop-for-bindings) + (push (list var nil) loop-for-bindings) (if (or ands (eq (car args) 'and)) (progn - (cl-push (list var + (push (list var (list 'if (or loop-first-flag (setq loop-first-flag (gensym))) start var)) loop-for-sets) - (cl-push (list var then) loop-for-steps)) - (cl-push (list var + (push (list var then) loop-for-steps)) + (push (list var (if (eq start then) start (list 'if (or loop-first-flag @@ -1161,15 +1224,15 @@ ((memq word '(across across-ref)) (let ((temp-vec (gensym)) (temp-idx (gensym))) - (cl-push (list temp-vec (cl-pop args)) loop-for-bindings) - (cl-push (list temp-idx -1) loop-for-bindings) - (cl-push (list '< (list 'setq temp-idx (list '1+ temp-idx)) + (push (list temp-vec (pop args)) loop-for-bindings) + (push (list temp-idx -1) loop-for-bindings) + (push (list '< (list 'setq temp-idx (list '1+ temp-idx)) (list 'length temp-vec)) loop-body) (if (eq word 'across-ref) - (cl-push (list var (list 'aref temp-vec temp-idx)) + (push (list var (list 'aref temp-vec temp-idx)) loop-symbol-macs) - (cl-push (list var nil) loop-for-bindings) - (cl-push (list var (list 'aref temp-vec temp-idx)) + (push (list var nil) loop-for-bindings) + (push (list var (list 'aref temp-vec temp-idx)) loop-for-sets)))) ((memq word '(element elements)) @@ -1184,26 +1247,26 @@ (cadr (cl-pop2 args)) (error "Bad `using' clause")) (gensym)))) - (cl-push (list temp-seq seq) loop-for-bindings) - (cl-push (list temp-idx 0) loop-for-bindings) + (push (list temp-seq seq) loop-for-bindings) + (push (list temp-idx 0) loop-for-bindings) (if ref (let ((temp-len (gensym))) - (cl-push (list temp-len (list 'length temp-seq)) + (push (list temp-len (list 'length temp-seq)) loop-for-bindings) - (cl-push (list var (list 'elt temp-seq temp-idx)) + (push (list var (list 'elt temp-seq temp-idx)) loop-symbol-macs) - (cl-push (list '< temp-idx temp-len) loop-body)) - (cl-push (list var nil) loop-for-bindings) - (cl-push (list 'and temp-seq + (push (list '< temp-idx temp-len) loop-body)) + (push (list var nil) loop-for-bindings) + (push (list 'and temp-seq (list 'or (list 'consp temp-seq) (list '< temp-idx (list 'length temp-seq)))) loop-body) - (cl-push (list var (list 'if (list 'consp temp-seq) + (push (list var (list 'if (list 'consp temp-seq) (list 'pop temp-seq) (list 'aref temp-seq temp-idx))) loop-for-sets)) - (cl-push (list temp-idx (list '1+ temp-idx)) + (push (list temp-idx (list '1+ temp-idx)) loop-for-steps))) ((memq word hash-types) @@ -1254,7 +1317,7 @@ (t (setq buf (cl-pop2 args))))) (if (and (consp var) (symbolp (car var)) (symbolp (cdr var))) (setq var1 (car var) var2 (cdr var)) - (cl-push (list var (list 'cons var1 var2)) loop-for-sets)) + (push (list var (list 'cons var1 var2)) loop-for-sets)) (setq loop-map-form (list 'cl-map-intervals (list 'function (list 'lambda (list var1 var2) @@ -1273,38 +1336,39 @@ (cadr (cl-pop2 args)) (error "Bad `using' clause")) (gensym)))) + ;; XEmacs addition: track other-word (when (memq word '(key-binding key-bindings)) (setq var (prog1 other (setq other var))) (and other-word (setq word other-word))) (setq loop-map-form (list (if (memq word '(key-seq key-seqs)) - 'cl-map-keymap-recursively 'cl-map-keymap) + 'cl-map-keymap-recursively 'map-keymap) (list 'function (list* 'lambda (list var other) '--cl-map)) map)))) ((memq word '(frame frames screen screens)) (let ((temp (gensym))) - (cl-push (list var '(selected-frame)) + (push (list var '(selected-frame)) loop-for-bindings) - (cl-push (list temp nil) loop-for-bindings) - (cl-push (list 'prog1 (list 'not (list 'eq var temp)) + (push (list temp nil) loop-for-bindings) + (push (list 'prog1 (list 'not (list 'eq var temp)) (list 'or temp (list 'setq temp var))) loop-body) - (cl-push (list var (list 'next-frame var)) + (push (list var (list 'next-frame var)) loop-for-steps))) ((memq word '(window windows)) (let ((scr (and (memq (car args) '(in of)) (cl-pop2 args))) (temp (gensym))) - (cl-push (list var (if scr + (push (list var (if scr (list 'frame-selected-window scr) '(selected-window))) loop-for-bindings) - (cl-push (list temp nil) loop-for-bindings) - (cl-push (list 'prog1 (list 'not (list 'eq var temp)) + (push (list temp nil) loop-for-bindings) + (push (list 'prog1 (list 'not (list 'eq var temp)) (list 'or temp (list 'setq temp var))) loop-body) - (cl-push (list var (list 'next-window var)) loop-for-steps))) + (push (list var (list 'next-window var)) loop-for-steps))) (t (let ((handler (and (symbolp word) @@ -1314,38 +1378,38 @@ (error "Expected a `for' preposition, found %s" word))))) (eq (car args) 'and)) (setq ands t) - (cl-pop args)) + (pop args)) (if (and ands loop-for-bindings) - (cl-push (nreverse loop-for-bindings) loop-bindings) + (push (nreverse loop-for-bindings) loop-bindings) (setq loop-bindings (nconc (mapcar 'list loop-for-bindings) loop-bindings))) (if loop-for-sets - (cl-push (list 'progn + (push (list 'progn (cl-loop-let (nreverse loop-for-sets) 'setq ands) t) loop-body)) (if loop-for-steps - (cl-push (cons (if ands 'psetq 'setq) + (push (cons (if ands 'psetq 'setq) (apply 'append (nreverse loop-for-steps))) loop-steps)))) ((eq word 'repeat) (let ((temp (gensym))) - (cl-push (list (list temp (cl-pop args))) loop-bindings) - (cl-push (list '>= (list 'setq temp (list '1- temp)) 0) loop-body))) + (push (list (list temp (pop args))) loop-bindings) + (push (list '>= (list 'setq temp (list '1- temp)) 0) loop-body))) - ((eq word 'collect) - (let ((what (cl-pop args)) + ((memq word '(collect collecting)) + (let ((what (pop args)) (var (cl-loop-handle-accum nil 'nreverse))) (if (eq var loop-accum-var) - (cl-push (list 'progn (list 'push what var) t) loop-body) - (cl-push (list 'progn + (push (list 'progn (list 'push what var) t) loop-body) + (push (list 'progn (list 'setq var (list 'nconc var (list 'list what))) t) loop-body)))) ((memq word '(nconc nconcing append appending)) - (let ((what (cl-pop args)) + (let ((what (pop args)) (var (cl-loop-handle-accum nil 'nreverse))) - (cl-push (list 'progn + (push (list 'progn (list 'setq var (if (eq var loop-accum-var) (list 'nconc @@ -1358,105 +1422,106 @@ var what))) t) loop-body))) ((memq word '(concat concating)) - (let ((what (cl-pop args)) + (let ((what (pop args)) (var (cl-loop-handle-accum ""))) - (cl-push (list 'progn (list 'callf 'concat var what) t) loop-body))) + (push (list 'progn (list 'callf 'concat var what) t) loop-body))) ((memq word '(vconcat vconcating)) - (let ((what (cl-pop args)) + (let ((what (pop args)) (var (cl-loop-handle-accum []))) - (cl-push (list 'progn (list 'callf 'vconcat var what) t) loop-body))) + (push (list 'progn (list 'callf 'vconcat var what) t) loop-body))) + ;; XEmacs addition: handle bit-vectors ((memq word '(bvconcat bvconcating)) - (let ((what (cl-pop args)) + (let ((what (pop args)) (var (cl-loop-handle-accum #*))) - (cl-push (list 'progn (list 'callf 'bvconcat var what) t) loop-body))) + (push (list 'progn (list 'callf 'bvconcat var what) t) loop-body))) ((memq word '(sum summing)) - (let ((what (cl-pop args)) + (let ((what (pop args)) (var (cl-loop-handle-accum 0))) - (cl-push (list 'progn (list 'incf var what) t) loop-body))) + (push (list 'progn (list 'incf var what) t) loop-body))) ((memq word '(count counting)) - (let ((what (cl-pop args)) + (let ((what (pop args)) (var (cl-loop-handle-accum 0))) - (cl-push (list 'progn (list 'if what (list 'incf var)) t) loop-body))) + (push (list 'progn (list 'if what (list 'incf var)) t) loop-body))) ((memq word '(minimize minimizing maximize maximizing)) - (let* ((what (cl-pop args)) + (let* ((what (pop args)) (temp (if (cl-simple-expr-p what) what (gensym))) (var (cl-loop-handle-accum nil)) (func (intern (substring (symbol-name word) 0 3))) (set (list 'setq var (list 'if var (list func var temp) temp)))) - (cl-push (list 'progn (if (eq temp what) set + (push (list 'progn (if (eq temp what) set (list 'let (list (list temp what)) set)) t) loop-body))) ((eq word 'with) (let ((bindings nil)) - (while (progn (cl-push (list (cl-pop args) + (while (progn (push (list (pop args) (and (eq (car args) '=) (cl-pop2 args))) bindings) (eq (car args) 'and)) - (cl-pop args)) - (cl-push (nreverse bindings) loop-bindings))) + (pop args)) + (push (nreverse bindings) loop-bindings))) ((eq word 'while) - (cl-push (cl-pop args) loop-body)) + (push (pop args) loop-body)) ((eq word 'until) - (cl-push (list 'not (cl-pop args)) loop-body)) + (push (list 'not (pop args)) loop-body)) ((eq word 'always) (or loop-finish-flag (setq loop-finish-flag (gensym))) - (cl-push (list 'setq loop-finish-flag (cl-pop args)) loop-body) + (push (list 'setq loop-finish-flag (pop args)) loop-body) (setq loop-result t)) ((eq word 'never) (or loop-finish-flag (setq loop-finish-flag (gensym))) - (cl-push (list 'setq loop-finish-flag (list 'not (cl-pop args))) + (push (list 'setq loop-finish-flag (list 'not (pop args))) loop-body) (setq loop-result t)) ((eq word 'thereis) (or loop-finish-flag (setq loop-finish-flag (gensym))) (or loop-result-var (setq loop-result-var (gensym))) - (cl-push (list 'setq loop-finish-flag - (list 'not (list 'setq loop-result-var (cl-pop args)))) + (push (list 'setq loop-finish-flag + (list 'not (list 'setq loop-result-var (pop args)))) loop-body)) ((memq word '(if when unless)) - (let* ((cond (cl-pop args)) + (let* ((cond (pop args)) (then (let ((loop-body nil)) (cl-parse-loop-clause) (cl-loop-build-ands (nreverse loop-body)))) (else (let ((loop-body nil)) (if (eq (car args) 'else) - (progn (cl-pop args) (cl-parse-loop-clause))) + (progn (pop args) (cl-parse-loop-clause))) (cl-loop-build-ands (nreverse loop-body)))) (simple (and (eq (car then) t) (eq (car else) t)))) - (if (eq (car args) 'end) (cl-pop args)) + (if (eq (car args) 'end) (pop args)) (if (eq word 'unless) (setq then (prog1 else (setq else then)))) (let ((form (cons (if simple (cons 'progn (nth 1 then)) (nth 2 then)) (if simple (nth 1 else) (list (nth 2 else)))))) (if (cl-expr-contains form 'it) (let ((temp (gensym))) - (cl-push (list temp) loop-bindings) + (push (list temp) loop-bindings) (setq form (list* 'if (list 'setq temp cond) (subst temp 'it form)))) (setq form (list* 'if cond form))) - (cl-push (if simple (list 'progn form t) form) loop-body)))) + (push (if simple (list 'progn form t) form) loop-body)))) ((memq word '(do doing)) (let ((body nil)) (or (consp (car args)) (error "Syntax error on `do' clause")) - (while (consp (car args)) (cl-push (cl-pop args) body)) - (cl-push (cons 'progn (nreverse (cons t body))) loop-body))) + (while (consp (car args)) (push (pop args) body)) + (push (cons 'progn (nreverse (cons t body))) loop-body))) ((eq word 'return) (or loop-finish-flag (setq loop-finish-flag (gensym))) (or loop-result-var (setq loop-result-var (gensym))) - (cl-push (list 'setq loop-result-var (cl-pop args) + (push (list 'setq loop-result-var (pop args) loop-finish-flag nil) loop-body)) (t @@ -1464,7 +1529,7 @@ (or handler (error "Expected a loop keyword, found %s" word)) (funcall handler)))) (if (eq (car args) 'and) - (progn (cl-pop args) (cl-parse-loop-clause))))) + (progn (pop args) (cl-parse-loop-clause))))) (defun cl-loop-let (specs body par) ; uses loop-* (let ((p specs) (temps nil) (new nil)) @@ -1476,24 +1541,24 @@ (while p (or (cl-const-expr-p (cadar p)) (let ((temp (gensym))) - (cl-push (list temp (cadar p)) temps) + (push (list temp (cadar p)) temps) (setcar (cdar p) temp))) (setq p (cdr p))))) (while specs (if (and (consp (car specs)) (listp (caar specs))) (let* ((spec (caar specs)) (nspecs nil) - (expr (cadr (cl-pop specs))) + (expr (cadr (pop specs))) (temp (cdr (or (assq spec loop-destr-temps) - (car (cl-push (cons spec (or (last spec 0) + (car (push (cons spec (or (last spec 0) (gensym))) loop-destr-temps)))))) - (cl-push (list temp expr) new) + (push (list temp expr) new) (while (consp spec) - (cl-push (list (cl-pop spec) + (push (list (pop spec) (and expr (list (if spec 'pop 'car) temp))) nspecs)) (setq specs (nconc (nreverse nspecs) specs))) - (cl-push (cl-pop specs) new))) + (push (pop specs) new))) (if (eq body 'setq) (let ((set (cons (if par 'psetq 'setq) (apply 'nconc (nreverse new))))) (if temps (list 'let* (nreverse temps) set) set)) @@ -1504,12 +1569,12 @@ (if (eq (car args) 'into) (let ((var (cl-pop2 args))) (or (memq var loop-accum-vars) - (progn (cl-push (list (list var def)) loop-bindings) - (cl-push var loop-accum-vars))) + (progn (push (list (list var def)) loop-bindings) + (push var loop-accum-vars))) var) (or loop-accum-var (progn - (cl-push (list (list (setq loop-accum-var (gensym)) def)) + (push (list (list (setq loop-accum-var (gensym)) def)) loop-bindings) (setq loop-result (if func (list func loop-accum-var) loop-accum-var)) @@ -1528,8 +1593,8 @@ (cdadr clauses) (list (cadr clauses)))) (cddr clauses))) - (setq body (cdr (butlast (cl-pop clauses))))) - (cl-push (cl-pop clauses) ands))) + (setq body (cdr (butlast (pop clauses))))) + (push (pop clauses) ands))) (setq ands (or (nreverse ands) (list t))) (list (if (cdr ands) (cons 'and ands) (car ands)) body @@ -1663,7 +1728,7 @@ (list* 'block (car x) (cddr x)))))) (if (and (cl-compiling-file) (boundp 'byte-compile-function-environment)) - (cl-push (cons (car x) (eval func)) + (push (cons (car x) (eval func)) byte-compile-function-environment)) (list (list 'symbol-function (list 'quote (car x))) func))) bindings) @@ -1677,10 +1742,10 @@ (let ((vars nil) (sets nil) (cl-macro-environment cl-macro-environment)) (while bindings (let ((var (gensym))) - (cl-push var vars) - (cl-push (list 'function* (cons 'lambda (cdar bindings))) sets) - (cl-push var sets) - (cl-push (list (car (cl-pop bindings)) 'lambda '(&rest cl-labels-args) + (push var vars) + (push (list 'function* (cons 'lambda (cdar bindings))) sets) + (push var sets) + (push (list (car (pop bindings)) 'lambda '(&rest cl-labels-args) (list 'list* '(quote funcall) (list 'quote var) 'cl-labels-args)) cl-macro-environment))) @@ -1727,8 +1792,9 @@ (let* ((cl-closure-vars cl-closure-vars) (vars (mapcar #'(lambda (x) (or (consp x) (setq x (list x))) - (cl-push (gensym (format "--%s--" (car x))) + (push (gensym (format "--%s--" (car x))) cl-closure-vars) + (set (car cl-closure-vars) [bad-lexical-ref]) (list (car x) (cadr x) (car cl-closure-vars))) bindings)) (ebody @@ -1766,7 +1832,7 @@ (if (null bindings) (cons 'progn body) (setq bindings (reverse bindings)) (while bindings - (setq body (list (list* 'lexical-let (list (cl-pop bindings)) body)))) + (setq body (list (list* 'lexical-let (list (pop bindings)) body)))) (car body))) (defun cl-defun-expander (func &rest rest) @@ -1805,7 +1871,7 @@ (t (let* ((temp (gensym)) (n 0)) (list 'let (list (list temp form)) - (list 'prog1 (list 'setq (cl-pop vars) (list 'car temp)) + (list 'prog1 (list 'setq (pop vars) (list 'car temp)) (cons 'setq (apply 'nconc (mapcar @@ -1828,11 +1894,12 @@ (defvar cl-declare-stack t) ; for future compilers (defun cl-do-proclaim (spec hist) - (and hist (listp cl-proclaim-history) (cl-push spec cl-proclaim-history)) + (and hist (listp cl-proclaim-history) (push spec cl-proclaim-history)) (cond ((eq (car-safe spec) 'special) (if (boundp 'byte-compile-bound-variables) (setq byte-compile-bound-variables (append + ;; XEmacs change (mapcar #'(lambda (v) (cons v byte-compile-global-bit)) (cdr spec)) byte-compile-bound-variables)))) @@ -1879,15 +1946,15 @@ ;;; Process any proclamations made before cl-macs was loaded. (defvar cl-proclaims-deferred) (let ((p (reverse cl-proclaims-deferred))) - (while p (cl-do-proclaim (cl-pop p) t)) + (while p (cl-do-proclaim (pop p) t)) (setq cl-proclaims-deferred nil)) ;;;###autoload (defmacro declare (&rest specs) (if (cl-compiling-file) (while specs - (if (listp cl-declare-stack) (cl-push (car specs) cl-declare-stack)) - (cl-do-proclaim (cl-pop specs) nil))) + (if (listp cl-declare-stack) (push (car specs) cl-declare-stack)) + (cl-do-proclaim (pop specs) nil))) nil) @@ -1906,9 +1973,10 @@ (append '(eval-when (compile load eval)) (if (stringp (car body)) (list (list 'put (list 'quote func) '(quote setf-documentation) - (cl-pop body)))) + (pop body)))) (list (cl-transform-function-property func 'setf-method (cons args body))))) +(defalias 'define-setf-expander 'define-setf-method) ;;;###autoload (defmacro defsetf (func arg1 &rest args) @@ -1991,19 +2059,24 @@ call))))) ;;; Some standard place types from Common Lisp. -(eval-when-compile (defvar ignored-arg)) ; Warning suppression +(eval-when-compile (defvar ignored-arg)) ; XEmacs: warning suppression (defsetf aref aset) (defsetf car setcar) (defsetf cdr setcdr) +(defsetf caar (x) (val) (list 'setcar (list 'car x) val)) +(defsetf cadr (x) (val) (list 'setcar (list 'cdr x) val)) +(defsetf cdar (x) (val) (list 'setcdr (list 'car x) val)) +(defsetf cddr (x) (val) (list 'setcdr (list 'cdr x) val)) (defsetf elt (seq n) (store) (list 'if (list 'listp seq) (list 'setcar (list 'nthcdr n seq) store) (list 'aset seq n store))) +;; XEmacs change: ignore the optional DEFAULT arguments (defsetf get (x y &optional ignored-arg) (store) (list 'put x y store)) (defsetf get* (x y &optional ignored-arg) (store) (list 'put x y store)) -(defsetf gethash (x h &optional ignored-arg) (store) (list 'cl-puthash x store h)) +(defsetf gethash (x h &optional ignored-arg) (store) (list 'puthash x store h)) (defsetf nth (n x) (store) (list 'setcar (list 'nthcdr n x) store)) (defsetf subseq (seq start &optional end) (new) - (list 'progn (list 'replace seq new ':start1 start ':end1 end) new)) + (list 'progn (list 'replace seq new :start1 start :end1 end) new)) (defsetf symbol-function fset) (defsetf symbol-plist setplist) (defsetf symbol-value set) @@ -2023,6 +2096,7 @@ ;;; Some more Emacs-related place types. (defsetf buffer-file-name set-visited-file-name t) +;; XEmacs change: we do not need to wrap this in with-current-buffer (defsetf buffer-modified-p set-buffer-modified-p t) (defsetf buffer-name rename-buffer t) (defsetf buffer-string () (store) @@ -2039,16 +2113,18 @@ (defsetf default-file-modes set-default-file-modes t) (defsetf default-value set-default) (defsetf documentation-property put) +;;(defsetf extent-data set-extent-data) (defsetf extent-face set-extent-face) (defsetf extent-priority set-extent-priority) +;; XEmacs addition (defsetf extent-property (x y &optional ignored-arg) (arg) (list 'set-extent-property x y arg)) -(defsetf extent-start-position (ext) (store) - `(progn (set-extent-endpoints ,ext ,store (extent-end-position ,ext)) - ,store)) (defsetf extent-end-position (ext) (store) `(progn (set-extent-endpoints ,ext (extent-start-position ,ext) ,store) ,store)) +(defsetf extent-start-position (ext) (store) + `(progn (set-extent-endpoints ,ext ,store (extent-end-position ,ext)) + ,store)) (defsetf face-background (f &optional s) (x) (list 'set-face-background f x s)) (defsetf face-background-pixmap (f &optional s) (x) (list 'set-face-background-pixmap f x s)) @@ -2057,16 +2133,18 @@ (defsetf face-underline-p (f &optional s) (x) (list 'set-face-underline-p f x s)) (defsetf file-modes set-file-modes t) +(defsetf frame-height (&optional f) (v) + `(progn (set-frame-height ,f ,v) ,v)) (defsetf frame-parameters modify-frame-parameters t) (defsetf frame-visible-p cl-set-frame-visible-p) +(defsetf frame-width (&optional f) (v) + `(progn (set-frame-width ,f ,v) ,v)) +;; XEmacs change: frame-properties instead of frame-parameters (defsetf frame-properties (&optional f) (p) `(progn (set-frame-properties ,f ,p) ,p)) (defsetf frame-property (f p &optional ignored-arg) (v) `(progn (set-frame-property ,f ,v) ,p)) -(defsetf frame-width (&optional f) (v) - `(progn (set-frame-width ,f ,v) ,v)) -(defsetf frame-height (&optional f) (v) - `(progn (set-frame-height ,f ,v) ,v)) +;; XEmacs addition (defsetf current-frame-configuration set-frame-configuration) ;; XEmacs: new stuff @@ -2138,12 +2216,13 @@ (defsetf trunc-stack-stack set-trunc-stack-stack) (defsetf undoable-stack-max set-undoable-stack-max) (defsetf weak-list-list set-weak-list-list) - +;; End of new XEmacs stuff (defsetf getenv setenv t) (defsetf get-register set-register) (defsetf global-key-binding global-set-key) (defsetf keymap-parent set-keymap-parent) +;; XEmacs addition: more keymap-related setf forms (defsetf keymap-name set-keymap-name) (defsetf keymap-prompt set-keymap-prompt) (defsetf keymap-default-binding set-keymap-default-binding) @@ -2169,9 +2248,13 @@ (defsetf process-buffer set-process-buffer) (defsetf process-filter set-process-filter) (defsetf process-sentinel set-process-sentinel) +;;(defsetf process-get process-put) (defsetf read-mouse-position (scr) (store) (list 'set-mouse-position scr (list 'car store) (list 'cdr store))) +;;(defsetf screen-height set-screen-height t) +;;(defsetf screen-width set-screen-width t) (defsetf selected-window select-window) +;;(defsetf selected-screen select-screen) (defsetf selected-frame select-frame) (defsetf standard-case-table set-standard-case-table) (defsetf syntax-table set-syntax-table) @@ -2255,6 +2338,7 @@ (nth 3 method) store-temp) (list 'substring (nth 4 method) from-temp to-temp)))) +;; XEmacs addition (define-setf-method values (&rest args) (let ((methods (mapcar #'(lambda (x) (get-setf-method x cl-macro-environment)) @@ -2317,8 +2401,8 @@ (simple (and optimize (consp place) (cl-simple-exprs-p (cdr place))))) (while values (if (or simple (cl-const-expr-p (car values))) - (cl-push (cons (cl-pop temps) (cl-pop values)) subs) - (cl-push (list (cl-pop temps) (cl-pop values)) lets))) + (push (cons (pop temps) (pop values)) subs) + (push (list (pop temps) (pop values)) lets))) (list (nreverse lets) (cons (car (nth 2 method)) (sublis subs (nth 3 method))) (sublis subs (nth 4 method))))) @@ -2348,7 +2432,7 @@ The return value is the last VAL in the list." (if (cdr (cdr args)) (let ((sets nil)) - (while args (cl-push (list 'setf (cl-pop args) (cl-pop args)) sets)) + (while args (push (list 'setf (pop args) (pop args)) sets)) (cons 'progn (nreverse sets))) (if (symbolp (car args)) (and args (cons 'setq args)) @@ -2367,9 +2451,9 @@ (setq simple nil)) (if (memq (car p) vars) (error "Destination duplicated in psetf: %s" (car p))) - (cl-push (cl-pop p) vars) + (push (pop p) vars) (or p (error "Odd number of arguments to psetf")) - (cl-pop p)) + (pop p)) (if simple (list 'progn (cons 'setf args) nil) (setq args (reverse args)) @@ -2417,17 +2501,18 @@ "(shiftf PLACE PLACE... VAL): shift left among PLACEs. Example: (shiftf A B C) sets A to B, B to C, and returns the old A. Each PLACE may be a symbol, or any generalized variable allowed by `setf'." + ;; XEmacs change: use iteration instead of recursion (if (not (memq nil (mapcar 'symbolp (butlast (cons place args))))) (list* 'prog1 place (let ((sets nil)) (while args - (cl-push (list 'setq place (car args)) sets) - (setq place (cl-pop args))) + (push (list 'setq place (car args)) sets) + (setq place (pop args))) (nreverse sets))) (let* ((places (reverse (cons place args))) - (form (cl-pop places))) + (form (pop places))) (while places - (let ((method (cl-setf-do-modify (cl-pop places) 'unsafe))) + (let ((method (cl-setf-do-modify (pop places) 'unsafe))) (setq form (list 'let* (car method) (list 'prog1 (nth 2 method) (cl-setf-do-store (nth 1 method) form)))))) @@ -2443,13 +2528,13 @@ (let ((sets nil) (first (car args))) (while (cdr args) - (setq sets (nconc sets (list (cl-pop args) (car args))))) + (setq sets (nconc sets (list (pop args) (car args))))) (nconc (list 'psetf) sets (list (car args) first)))) (let* ((places (reverse args)) (temp (gensym "--rotatef--")) (form temp)) (while (cdr places) - (let ((method (cl-setf-do-modify (cl-pop places) 'unsafe))) + (let ((method (cl-setf-do-modify (pop places) 'unsafe))) (setq form (list 'let* (car method) (list 'prog1 (nth 2 method) (cl-setf-do-store (nth 1 method) form)))))) @@ -2526,7 +2611,7 @@ (cons 'progn body) (setq bindings (reverse bindings)) (while bindings - (setq body (list (list* 'letf (list (cl-pop bindings)) body)))) + (setq body (list (list* 'letf (list (pop bindings)) body)))) (car body))) ;;;###autoload @@ -2599,38 +2684,38 @@ (forms nil) pred-form pred-check) (if (stringp (car descs)) - (cl-push (list 'put (list 'quote name) '(quote structure-documentation) - (cl-pop descs)) forms)) + (push (list 'put (list 'quote name) '(quote structure-documentation) + (pop descs)) forms)) (setq descs (cons '(cl-tag-slot) (mapcar #'(lambda (x) (if (consp x) x (list x))) descs))) (while opts (let ((opt (if (consp (car opts)) (caar opts) (car opts))) - (args (cdr-safe (cl-pop opts)))) - (cond ((eq opt ':conc-name) + (args (cdr-safe (pop opts)))) + (cond ((eq opt :conc-name) (if args (setq conc-name (if (car args) (symbol-name (car args)) "")))) - ((eq opt ':constructor) + ((eq opt :constructor) (if (cdr args) - (cl-push args constrs) + (push args constrs) (if args (setq constructor (car args))))) - ((eq opt ':copier) + ((eq opt :copier) (if args (setq copier (car args)))) - ((eq opt ':predicate) + ((eq opt :predicate) (if args (setq predicate (car args)))) - ((eq opt ':include) + ((eq opt :include) (setq include (car args) include-descs (mapcar #'(lambda (x) (if (consp x) x (list x))) (cdr args)))) - ((eq opt ':print-function) + ((eq opt :print-function) (setq print-func (car args))) - ((eq opt ':type) + ((eq opt :type) (setq type (car args))) - ((eq opt ':named) + ((eq opt :named) (setq named t)) - ((eq opt ':initial-offset) + ((eq opt :initial-offset) (setq descs (nconc (make-list (car args) '(cl-skip-slot)) descs))) (t @@ -2656,14 +2741,14 @@ (error "No slot %s in included struct %s" (caar include-descs) include)) old-descs) - (cl-pop include-descs))) + (pop include-descs))) (setq descs (append old-descs (delq (assq 'cl-tag-slot descs) descs)) type (car inc-type) named (assq 'cl-tag-slot descs)) (if (cadr inc-type) (setq tag name named t)) (let ((incl include)) (while incl - (cl-push (list 'pushnew (list 'quote tag) + (push (list 'pushnew (list 'quote tag) (intern (format "cl-struct-%s-tags" incl))) forms) (setq incl (get incl 'cl-struct-include))))) @@ -2674,7 +2759,7 @@ (if named (setq tag name))) (setq type 'vector named 'true))) (or named (setq descs (delq (assq 'cl-tag-slot descs) descs))) - (cl-push (list 'defvar tag-symbol) forms) + (push (list 'defvar tag-symbol) forms) (setq pred-form (and named (let ((pos (- (length descs) (length (memq (assq 'cl-tag-slot descs) @@ -2695,19 +2780,19 @@ (cons 'and (cdddr pred-form)) pred-form))) (let ((pos 0) (descp descs)) (while descp - (let* ((desc (cl-pop descp)) + (let* ((desc (pop descp)) (slot (car desc))) (if (memq slot '(cl-tag-slot cl-skip-slot)) (progn - (cl-push nil slots) - (cl-push (and (eq slot 'cl-tag-slot) (list 'quote tag)) + (push nil slots) + (push (and (eq slot 'cl-tag-slot) (list 'quote tag)) defaults)) (if (assq slot descp) (error "Duplicate slots named %s in %s" slot name)) (let ((accessor (intern (format "%s%s" conc-name slot)))) - (cl-push slot slots) - (cl-push (nth 1 desc) defaults) - (cl-push (list* + (push slot slots) + (push (nth 1 desc) defaults) + (push (list* 'defsubst* accessor '(cl-x) (append (and pred-check @@ -2719,9 +2804,9 @@ (list (if (eq type 'vector) (list 'aref 'cl-x pos) (if (= pos 0) '(car cl-x) (list 'nth pos 'cl-x)))))) forms) - (cl-push (cons accessor t) side-eff) - (cl-push (list 'define-setf-method accessor '(cl-x) - (if (cadr (memq ':read-only (cddr desc))) + (push (cons accessor t) side-eff) + (push (list 'define-setf-method accessor '(cl-x) + (if (cadr (memq :read-only (cddr desc))) (list 'error (format "%s is a read-only slot" accessor)) (list 'cl-struct-setf-expander 'cl-x @@ -2737,38 +2822,38 @@ (setq slots (nreverse slots) defaults (nreverse defaults)) (and predicate pred-form - (progn (cl-push (list 'defsubst* predicate '(cl-x) + (progn (push (list 'defsubst* predicate '(cl-x) (if (eq (car pred-form) 'and) (append pred-form '(t)) (list 'and pred-form t))) forms) - (cl-push (cons predicate 'error-free) side-eff))) + (push (cons predicate 'error-free) side-eff))) (and copier - (progn (cl-push (list 'defun copier '(x) '(copy-sequence x)) forms) - (cl-push (cons copier t) side-eff))) + (progn (push (list 'defun copier '(x) '(copy-sequence x)) forms) + (push (cons copier t) side-eff))) (if constructor - (cl-push (list constructor + (push (list constructor (cons '&key (delq nil (copy-sequence slots)))) constrs)) (while constrs (let* ((name (caar constrs)) - (args (cadr (cl-pop constrs))) + (args (cadr (pop constrs))) (anames (cl-arglist-args args)) (make (mapcar* #'(lambda (s d) (if (memq s anames) s d)) slots defaults))) - (cl-push (list 'defsubst* name + (push (list 'defsubst* name (list* '&cl-defs (list 'quote (cons nil descs)) args) (cons type make)) forms) (if (cl-safe-expr-p (cons 'progn (mapcar 'second descs))) - (cl-push (cons name t) side-eff)))) + (push (cons name t) side-eff)))) (if print-auto (nconc print-func (list '(princ ")" cl-s) t))) (if print-func - (cl-push (list 'push + (push (list 'push (list 'function (list 'lambda '(cl-x cl-s cl-n) (list 'and pred-form print-func))) 'custom-print-functions) forms)) - (cl-push (list 'setq tag-symbol (list 'list (list 'quote tag))) forms) - (cl-push (list* 'eval-when '(compile load eval) + (push (list 'setq tag-symbol (list 'list (list 'quote tag))) forms) + (push (list* 'eval-when '(compile load eval) (list 'put (list 'quote name) '(quote cl-struct-slots) (list 'quote descs)) (list 'put (list 'quote name) '(quote cl-struct-type) @@ -2812,23 +2897,24 @@ ;;; Types and assertions. ;;;###autoload -(defmacro deftype (name args &rest body) +(defmacro deftype (name arglist &rest body) "(deftype NAME ARGLIST BODY...): define NAME as a new data type. The type name can then be used in `typecase', `check-type', etc." (list 'eval-when '(compile load eval) (cl-transform-function-property - name 'cl-deftype-handler (cons (list* '&cl-defs ''('*) args) body)))) + name 'cl-deftype-handler (cons (list* '&cl-defs ''('*) arglist) body)))) (defun cl-make-type-test (val type) (if (symbolp type) (cond ((get type 'cl-deftype-handler) (cl-make-type-test val (funcall (get type 'cl-deftype-handler)))) ((memq type '(nil t)) type) - ((eq type 'string-char) (list 'characterp val)) - ((eq type 'null) (list 'null val)) - ((eq type 'float) (list 'floatp-safe val)) - ((eq type 'real) (list 'numberp val)) - ((eq type 'fixnum) (list 'integerp val)) + ((eq type 'null) `(null ,val)) + ((eq type 'float) `(floatp-safe ,val)) + ((eq type 'real) `(numberp ,val)) + ((eq type 'fixnum) `(integerp ,val)) + ;; XEmacs change: we do not have char-valid-p + ((memq type '(character string-char)) `(characterp ,val)) (t (let* ((name (symbol-name type)) (namep (intern (concat name "p")))) @@ -2864,23 +2950,21 @@ (defmacro check-type (place type &optional string) "Verify that PLACE is of type TYPE; signal a continuable error if not. STRING is an optional description of the desired type." - (when (or (not (cl-compiling-file)) - (< cl-optimize-speed 3) - (= cl-optimize-safety 3)) - (let* ((temp (if (cl-simple-expr-p place 3) place (gensym))) - (test (cl-make-type-test temp type)) - (signal-error `(signal 'wrong-type-argument - ,(list 'list (or string (list 'quote type)) - temp (list 'quote place)))) - (body - (condition-case nil - `(while (not ,test) - ,(macroexpand `(setf ,place ,signal-error))) - (error - `(if ,test (progn ,signal-error nil)))))) - (if (eq temp place) - body - `(let ((,temp ,place)) ,body))))) + (and (or (not (cl-compiling-file)) + (< cl-optimize-speed 3) (= cl-optimize-safety 3)) + (let* ((temp (if (cl-simple-expr-p place 3) place (gensym))) + (test (cl-make-type-test temp type)) + (signal-error `(signal 'wrong-type-argument + ,(list 'list (or string (list 'quote type)) + temp (list 'quote place)))) + (body + (condition-case nil + `(while (not ,test) + ,(macroexpand `(setf ,place ,signal-error))) + (error + `(if ,test (progn ,signal-error nil)))))) + (if (eq temp place) `(progn ,body nil) + `(let ((,temp ,place)) ,body nil))))) ;;;###autoload (defmacro assert (form &optional show-args string &rest args) @@ -2906,99 +2990,17 @@ ;;;###autoload (defmacro ignore-errors (&rest body) - "Execute FORMS; if an error occurs, return nil. -Otherwise, return result of last FORM." + "Execute BODY; if an error occurs, return nil. +Otherwise, return result of last form in BODY." `(condition-case nil (progn ,@body) (error nil))) +;; XEmacs addition ;;;###autoload (defmacro ignore-file-errors (&rest body) "Execute FORMS; if an error of type `file-error' occurs, return nil. Otherwise, return result of last FORM." `(condition-case nil (progn ,@body) (file-error nil))) -;;; Some predicates for analyzing Lisp forms. These are used by various -;;; macro expanders to optimize the results in certain common cases. - -(defconst cl-simple-funcs '(car cdr nth aref elt if and or + - 1+ 1- min max - car-safe cdr-safe progn prog1 prog2)) -(defconst cl-safe-funcs '(* / % length memq list vector vectorp - < > <= >= = error)) - -;;; Check if no side effects, and executes quickly. -(defun cl-simple-expr-p (x &optional size) - (or size (setq size 10)) - (if (and (consp x) (not (memq (car x) '(quote function function*)))) - (and (symbolp (car x)) - (or (memq (car x) cl-simple-funcs) - (get (car x) 'side-effect-free)) - (progn - (setq size (1- size)) - (while (and (setq x (cdr x)) - (setq size (cl-simple-expr-p (car x) size)))) - (and (null x) (>= size 0) size))) - (and (> size 0) (1- size)))) - -(defun cl-simple-exprs-p (xs) - (while (and xs (cl-simple-expr-p (car xs))) - (setq xs (cdr xs))) - (not xs)) - -;;; Check if no side effects. -(defun cl-safe-expr-p (x) - (or (not (and (consp x) (not (memq (car x) '(quote function function*))))) - (and (symbolp (car x)) - (or (memq (car x) cl-simple-funcs) - (memq (car x) cl-safe-funcs) - (get (car x) 'side-effect-free)) - (progn - (while (and (setq x (cdr x)) (cl-safe-expr-p (car x)))) - (null x))))) - -;;; Check if constant (i.e., no side effects or dependencies). -(defun cl-const-expr-p (x) - (cond ((consp x) - (or (eq (car x) 'quote) - (and (memq (car x) '(function function*)) - (or (symbolp (nth 1 x)) - (and (eq (car-safe (nth 1 x)) 'lambda) 'func))))) - ((symbolp x) (and (memq x '(nil t)) t)) - (t t))) - -(defun cl-const-exprs-p (xs) - (while (and xs (cl-const-expr-p (car xs))) - (setq xs (cdr xs))) - (not xs)) - -(defun cl-const-expr-val (x) - (and (eq (cl-const-expr-p x) t) (if (consp x) (nth 1 x) x))) - -(defun cl-expr-access-order (x v) - (if (cl-const-expr-p x) v - (if (consp x) - (progn - (while (setq x (cdr x)) (setq v (cl-expr-access-order (car x) v))) - v) - (if (eq x (car v)) (cdr v) '(t))))) - -;;; Count number of times X refers to Y. Return NIL for 0 times. -(defun cl-expr-contains (x y) - (cond ((equal y x) 1) - ((and (consp x) (not (memq (car-safe x) '(quote function function*)))) - (let ((sum 0)) - (while x - (setq sum (+ sum (or (cl-expr-contains (cl-pop x) y) 0)))) - (and (> sum 0) sum))) - (t nil))) - -(defun cl-expr-contains-any (x y) - (while (and y (not (cl-expr-contains x (car y)))) (cl-pop y)) - y) - -;;; Check whether X may depend on any of the symbols in Y. -(defun cl-expr-depends-p (x y) - (and (not (cl-const-expr-p x)) - (or (not (cl-safe-expr-p x)) (cl-expr-contains-any x y)))) - ;;; Compiler macros. @@ -3015,8 +3017,8 @@ original function call alone by declaring an initial `&whole foo' parameter and then returning foo." (let ((p (if (listp args) args (list '&rest args))) (res nil)) - (while (consp p) (cl-push (cl-pop p) res)) - (setq args (nreverse res)) (setcdr res (and p (list '&rest p)))) + (while (consp p) (push (pop p) res)) + (setq args (nconc (nreverse res) (and p (list '&rest p))))) (list 'eval-when '(compile load eval) (cl-transform-function-property func 'cl-compiler-macro @@ -3053,11 +3055,13 @@ (let* ((argns (cl-arglist-args args)) (p argns) (pbody (cons 'progn body)) (unsafe (not (cl-safe-expr-p pbody)))) - (while (and p (eq (cl-expr-contains args (car p)) 1)) (cl-pop p)) + (while (and p (eq (cl-expr-contains args (car p)) 1)) (pop p)) (list 'progn (if p nil ; give up if defaults refer to earlier args (list 'define-compiler-macro name - (list* '&whole 'cl-whole '&cl-quote args) + (if (memq '&key args) + (list* '&whole 'cl-whole '&cl-quote args) + (cons '&cl-quote args)) (list* 'cl-defsubst-expand (list 'quote argns) (list 'quote (list* 'block name body)) (not (or unsafe (cl-expr-access-order pbody argns))) @@ -3105,7 +3109,7 @@ (t form))) (define-compiler-macro member* (&whole form a list &rest keys) - (let ((test (and (= (length keys) 2) (eq (car keys) ':test) + (let ((test (and (= (length keys) 2) (eq (car keys) :test) (cl-const-expr-val (nth 1 keys))))) (cond ((eq test 'eq) (list 'memq a list)) ((eq test 'equal) (list 'member a list)) @@ -3127,7 +3131,7 @@ (t form)))) (define-compiler-macro assoc* (&whole form a list &rest keys) - (let ((test (and (= (length keys) 2) (eq (car keys) ':test) + (let ((test (and (= (length keys) 2) (eq (car keys) :test) (cl-const-expr-val (nth 1 keys))))) (cond ((eq test 'eq) (list 'assq a list)) ((eq test 'equal) (list 'assoc a list)) @@ -3138,7 +3142,7 @@ (define-compiler-macro adjoin (&whole form a list &rest keys) (if (and (cl-simple-expr-p a) (cl-simple-expr-p list) - (not (memq ':key keys))) + (not (memq :key keys))) (list 'if (list* 'member* a list keys) list (list 'cons a list)) form)) @@ -3149,6 +3153,7 @@ (setq form (list 'cons (car args) form))) form)) +;; XEmacs change: our builtin get takes the default argument (define-compiler-macro get* (sym prop &optional default) (list 'get sym prop default)) @@ -3193,24 +3198,22 @@ ;;; Things that are inline. (proclaim '(inline floatp-safe acons map concatenate notany notevery -;; XEmacs change - cl-set-elt revappend nreconc - )) +;; XEmacs omission: gethash is builtin + cl-set-elt revappend nreconc)) ;;; Things that are side-effect-free. Moved to byte-optimize.el -;(dolist (fun '(oddp evenp plusp minusp -; abs expt signum last butlast ldiff -; pairlis gcd lcm -; isqrt floor* ceiling* truncate* round* mod* rem* subseq -; list-length getf)) -; (put fun 'side-effect-free t)) +;(mapcar (function (lambda (x) (put x 'side-effect-free t))) +; '(oddp evenp signum last butlast ldiff pairlis gcd lcm +; isqrt floor* ceiling* truncate* round* mod* rem* subseq +; list-length get* getf)) ;;; Things that are side-effect-and-error-free. Moved to byte-optimize.el -;(dolist (fun '(eql floatp-safe list* subst acons equalp random-state-p -; copy-tree sublis)) -; (put fun 'side-effect-free 'error-free)) +;(mapcar (function (lambda (x) (put x 'side-effect-free 'error-free))) +; '(eql floatp-safe list* subst acons equalp random-state-p +; copy-tree sublis)) (run-hooks 'cl-macs-load-hook) +;;; arch-tag: afd947a6-b553-4df1-bba5-000be6388f46 ;;; cl-macs.el ends here diff --text -u 'xemacs-21.5.17/lisp/cl-seq.el' 'xemacs-21.5.18/lisp/cl-seq.el' Index: ./lisp/cl-seq.el --- ./lisp/cl-seq.el Sun Jun 10 19:42:22 2001 +++ ./lisp/cl-seq.el Sun Jun 27 06:25:24 2004 @@ -24,7 +24,7 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: FSF 21.3. ;;; Commentary: @@ -53,14 +53,6 @@ (error "Tried to load `cl-seq' before `cl'!")) -;;; We define these here so that this file can compile without having -;;; loaded the cl.el file already. - -(defmacro cl-push (x place) (list 'setq place (list 'cons x place))) -(defmacro cl-pop (place) - (list 'car (list 'prog1 place (list 'setq place (list 'cdr place))))) - - ;;; Keyword parsing. This is special-cased here so that we can compile ;;; this file independent from cl-macs. @@ -90,9 +82,9 @@ (let* ((var (if (consp x) (car x) x)) (mem (list 'car (list 'cdr (list 'memq (list 'quote var) 'cl-keys))))) - (if (eq var ':test-not) + (if (eq var :test-not) (setq mem (list 'and mem (list 'setq 'cl-test mem) t))) - (if (eq var ':if-not) + (if (eq var :if-not) (setq mem (list 'and mem (list 'setq 'cl-if mem) t))) (list (intern (format "cl-%s" (substring (symbol-name var) 1))) @@ -161,16 +153,16 @@ (or (listp cl-seq) (setq cl-seq (append cl-seq nil))) (setq cl-seq (subseq cl-seq cl-start cl-end)) (if cl-from-end (setq cl-seq (nreverse cl-seq))) - (let ((cl-accum (cond ((memq ':initial-value cl-keys) cl-initial-value) - (cl-seq (cl-check-key (cl-pop cl-seq))) + (let ((cl-accum (cond ((memq :initial-value cl-keys) cl-initial-value) + (cl-seq (cl-check-key (pop cl-seq))) (t (funcall cl-func))))) (if cl-from-end (while cl-seq - (setq cl-accum (funcall cl-func (cl-check-key (cl-pop cl-seq)) + (setq cl-accum (funcall cl-func (cl-check-key (pop cl-seq)) cl-accum))) (while cl-seq (setq cl-accum (funcall cl-func cl-accum - (cl-check-key (cl-pop cl-seq)))))) + (cl-check-key (pop cl-seq)))))) cl-accum))) (defun fill (seq item &rest cl-keys) @@ -247,8 +239,8 @@ (if cl-i (let ((cl-res (apply 'delete* cl-item (append cl-seq nil) (append (if cl-from-end - (list ':end (1+ cl-i)) - (list ':start cl-i)) + (list :end (1+ cl-i)) + (list :start cl-i)) cl-keys)))) (if (listp cl-seq) cl-res (if (stringp cl-seq) (concat cl-res) (vconcat cl-res)))) @@ -271,8 +263,8 @@ (and (cdr cl-p) (apply 'delete* cl-item (copy-sequence (cdr cl-p)) - ':start 0 ':end (1- cl-end) - ':count (1- cl-count) cl-keys)))) + :start 0 :end (1- cl-end) + :count (1- cl-count) cl-keys)))) cl-seq)) cl-seq))))) @@ -281,14 +273,14 @@ This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. Keywords supported: :key :count :start :end :from-end" - (apply 'remove* nil cl-list ':if cl-pred cl-keys)) + (apply 'remove* nil cl-list :if cl-pred cl-keys)) (defun remove-if-not (cl-pred cl-list &rest cl-keys) "Remove all items not satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. Keywords supported: :key :count :start :end :from-end" - (apply 'remove* nil cl-list ':if-not cl-pred cl-keys)) + (apply 'remove* nil cl-list :if-not cl-pred cl-keys)) (defun delete* (cl-item cl-seq &rest cl-keys) "Remove all occurrences of ITEM in SEQ. @@ -336,17 +328,15 @@ "Remove all items satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. Keywords supported: :key :count :start :end :from-end" - (apply 'delete* nil cl-list ':if cl-pred cl-keys)) + (apply 'delete* nil cl-list :if cl-pred cl-keys)) (defun delete-if-not (cl-pred cl-list &rest cl-keys) "Remove all items not satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. Keywords supported: :key :count :start :end :from-end" - (apply 'delete* nil cl-list ':if-not cl-pred cl-keys)) - -(or (and (fboundp 'delete) (subrp (symbol-function 'delete))) - (defalias 'delete (function (lambda (x y) (delete* x y ':test 'equal))))) + (apply 'delete* nil cl-list :if-not cl-pred cl-keys)) +;; XEmacs change: this is in subr.el in Emacs (defun remove (cl-item cl-seq) "Remove all occurrences of ITEM in SEQ, testing with `equal' This is a non-destructive function; it makes a copy of SEQ if necessary @@ -354,6 +344,7 @@ Also see: `remove*', `delete', `delete*'" (remove* cl-item cl-seq ':test 'equal)) +;; XEmacs change: this is in subr.el in Emacs (defun remq (cl-elt cl-list) "Remove all occurrences of ELT in LIST, comparing with `eq'. This is a non-destructive function; it makes a copy of LIST to avoid @@ -430,22 +421,22 @@ (or cl-from-end (progn (cl-set-elt cl-seq cl-i cl-new) (setq cl-i (1+ cl-i) cl-count (1- cl-count)))) - (apply 'nsubstitute cl-new cl-old cl-seq ':count cl-count - ':start cl-i cl-keys)))))) + (apply 'nsubstitute cl-new cl-old cl-seq :count cl-count + :start cl-i cl-keys)))))) (defun substitute-if (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. Keywords supported: :key :count :start :end :from-end" - (apply 'substitute cl-new nil cl-list ':if cl-pred cl-keys)) + (apply 'substitute cl-new nil cl-list :if cl-pred cl-keys)) (defun substitute-if-not (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items not satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. Keywords supported: :key :count :start :end :from-end" - (apply 'substitute cl-new nil cl-list ':if-not cl-pred cl-keys)) + (apply 'substitute cl-new nil cl-list :if-not cl-pred cl-keys)) (defun nsubstitute (cl-new cl-old cl-seq &rest cl-keys) "Substitute NEW for OLD in SEQ. @@ -483,13 +474,13 @@ "Substitute NEW for all items satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. Keywords supported: :key :count :start :end :from-end" - (apply 'nsubstitute cl-new nil cl-list ':if cl-pred cl-keys)) + (apply 'nsubstitute cl-new nil cl-list :if cl-pred cl-keys)) (defun nsubstitute-if-not (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items not satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. Keywords supported: :key :count :start :end :from-end" - (apply 'nsubstitute cl-new nil cl-list ':if-not cl-pred cl-keys)) + (apply 'nsubstitute cl-new nil cl-list :if-not cl-pred cl-keys)) (defun find (cl-item cl-seq &rest cl-keys) "Find the first occurrence of ITEM in LIST. @@ -502,13 +493,13 @@ "Find the first item satisfying PREDICATE in LIST. Return the matching ITEM, or nil if not found. Keywords supported: :key :start :end :from-end" - (apply 'find nil cl-list ':if cl-pred cl-keys)) + (apply 'find nil cl-list :if cl-pred cl-keys)) (defun find-if-not (cl-pred cl-list &rest cl-keys) "Find the first item not satisfying PREDICATE in LIST. Return the matching ITEM, or nil if not found. Keywords supported: :key :start :end :from-end" - (apply 'find nil cl-list ':if-not cl-pred cl-keys)) + (apply 'find nil cl-list :if-not cl-pred cl-keys)) (defun position (cl-item cl-seq &rest cl-keys) "Find the first occurrence of ITEM in LIST. @@ -543,13 +534,13 @@ "Find the first item satisfying PREDICATE in LIST. Return the index of the matching item, or nil if not found. Keywords supported: :key :start :end :from-end" - (apply 'position nil cl-list ':if cl-pred cl-keys)) + (apply 'position nil cl-list :if cl-pred cl-keys)) (defun position-if-not (cl-pred cl-list &rest cl-keys) "Find the first item not satisfying PREDICATE in LIST. Return the index of the matching item, or nil if not found. Keywords supported: :key :start :end :from-end" - (apply 'position nil cl-list ':if-not cl-pred cl-keys)) + (apply 'position nil cl-list :if-not cl-pred cl-keys)) (defun count (cl-item cl-seq &rest cl-keys) "Count the number of occurrences of ITEM in LIST. @@ -559,7 +550,7 @@ (or cl-end (setq cl-end (length cl-seq))) (if (consp cl-seq) (setq cl-seq (nthcdr cl-start cl-seq))) (while (< cl-start cl-end) - (setq cl-x (if (consp cl-seq) (cl-pop cl-seq) (aref cl-seq cl-start))) + (setq cl-x (if (consp cl-seq) (pop cl-seq) (aref cl-seq cl-start))) (if (cl-check-test cl-item cl-x) (setq cl-count (1+ cl-count))) (setq cl-start (1+ cl-start))) cl-count))) @@ -567,17 +558,17 @@ (defun count-if (cl-pred cl-list &rest cl-keys) "Count the number of items satisfying PREDICATE in LIST. Keywords supported: :key :start :end" - (apply 'count nil cl-list ':if cl-pred cl-keys)) + (apply 'count nil cl-list :if cl-pred cl-keys)) (defun count-if-not (cl-pred cl-list &rest cl-keys) "Count the number of items not satisfying PREDICATE in LIST. Keywords supported: :key :start :end" - (apply 'count nil cl-list ':if-not cl-pred cl-keys)) + (apply 'count nil cl-list :if-not cl-pred cl-keys)) (defun mismatch (cl-seq1 cl-seq2 &rest cl-keys) "Compare SEQ1 with SEQ2, return index of first mismatching element. Return nil if the sequences match. If one sequence is a prefix of the -other, the return value indicates the end of the shorted sequence. +other, the return value indicates the end of the shorter sequence. Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end" (cl-parsing-keywords (:test :test-not :key :from-end (:start1 0) :end1 (:start2 0) :end2) () @@ -622,9 +613,9 @@ (setq cl-pos (cl-position cl-first cl-seq2 cl-start2 cl-end2 cl-from-end)) (apply 'mismatch cl-seq1 cl-seq2 - ':start1 (1+ cl-start1) ':end1 cl-end1 - ':start2 (1+ cl-pos) ':end2 (+ cl-pos cl-len) - ':from-end nil cl-keys)) + :start1 (1+ cl-start1) :end1 cl-end1 + :start2 (1+ cl-pos) :end2 (+ cl-pos cl-len) + :from-end nil cl-keys)) (if cl-from-end (setq cl-end2 cl-pos) (setq cl-start2 (1+ cl-pos)))) (and (< cl-start2 cl-end2) cl-pos))))) @@ -659,8 +650,8 @@ (while (and cl-seq1 cl-seq2) (if (funcall cl-pred (cl-check-key (car cl-seq2)) (cl-check-key (car cl-seq1))) - (cl-push (cl-pop cl-seq2) cl-res) - (cl-push (cl-pop cl-seq1) cl-res))) + (push (pop cl-seq2) cl-res) + (push (pop cl-seq1) cl-res))) (coerce (nconc (nreverse cl-res) cl-seq1 cl-seq2) cl-type)))) ;;; See compiler macro in cl-macs.el @@ -681,13 +672,13 @@ "Find the first item satisfying PREDICATE in LIST. Return the sublist of LIST whose car matches. Keywords supported: :key" - (apply 'member* nil cl-list ':if cl-pred cl-keys)) + (apply 'member* nil cl-list :if cl-pred cl-keys)) (defun member-if-not (cl-pred cl-list &rest cl-keys) "Find the first item not satisfying PREDICATE in LIST. Return the sublist of LIST whose car matches. Keywords supported: :key" - (apply 'member* nil cl-list ':if-not cl-pred cl-keys)) + (apply 'member* nil cl-list :if-not cl-pred cl-keys)) (defun cl-adjoin (cl-item cl-list &rest cl-keys) (if (cl-parsing-keywords (:key) t @@ -713,12 +704,12 @@ (defun assoc-if (cl-pred cl-list &rest cl-keys) "Find the first item whose car satisfies PREDICATE in LIST. Keywords supported: :key" - (apply 'assoc* nil cl-list ':if cl-pred cl-keys)) + (apply 'assoc* nil cl-list :if cl-pred cl-keys)) (defun assoc-if-not (cl-pred cl-list &rest cl-keys) "Find the first item whose car does not satisfy PREDICATE in LIST. Keywords supported: :key" - (apply 'assoc* nil cl-list ':if-not cl-pred cl-keys)) + (apply 'assoc* nil cl-list :if-not cl-pred cl-keys)) (defun rassoc* (cl-item cl-alist &rest cl-keys) "Find the first item whose cdr matches ITEM in LIST. @@ -735,12 +726,12 @@ (defun rassoc-if (cl-pred cl-list &rest cl-keys) "Find the first item whose cdr satisfies PREDICATE in LIST. Keywords supported: :key" - (apply 'rassoc* nil cl-list ':if cl-pred cl-keys)) + (apply 'rassoc* nil cl-list :if cl-pred cl-keys)) (defun rassoc-if-not (cl-pred cl-list &rest cl-keys) "Find the first item whose cdr does not satisfy PREDICATE in LIST. Keywords supported: :key" - (apply 'rassoc* nil cl-list ':if-not cl-pred cl-keys)) + (apply 'rassoc* nil cl-list :if-not cl-pred cl-keys)) (defun union (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-union operation. @@ -757,8 +748,8 @@ (if (or cl-keys (numberp (car cl-list2))) (setq cl-list1 (apply 'adjoin (car cl-list2) cl-list1 cl-keys)) (or (memq (car cl-list2) cl-list1) - (cl-push (car cl-list2) cl-list1))) - (cl-pop cl-list2)) + (push (car cl-list2) cl-list1))) + (pop cl-list2)) cl-list1))) (defun nunion (cl-list1 cl-list2 &rest cl-keys) @@ -787,8 +778,8 @@ (apply 'member* (cl-check-key (car cl-list2)) cl-list1 cl-keys) (memq (car cl-list2) cl-list1)) - (cl-push (car cl-list2) cl-res)) - (cl-pop cl-list2)) + (push (car cl-list2) cl-res)) + (pop cl-list2)) cl-res))))) (defun nintersection (cl-list1 cl-list2 &rest cl-keys) @@ -813,8 +804,8 @@ (apply 'member* (cl-check-key (car cl-list1)) cl-list2 cl-keys) (memq (car cl-list1) cl-list2)) - (cl-push (car cl-list1) cl-res)) - (cl-pop cl-list1)) + (push (car cl-list1) cl-res)) + (pop cl-list1)) cl-res)))) (defun nset-difference (cl-list1 cl-list2 &rest cl-keys) @@ -858,20 +849,20 @@ (while (and cl-list1 (apply 'member* (cl-check-key (car cl-list1)) cl-list2 cl-keys)) - (cl-pop cl-list1)) + (pop cl-list1)) (null cl-list1))))) (defun subst-if (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elements matching PREDICATE in TREE (non-destructively). Return a copy of TREE with all matching elements replaced by NEW. Keywords supported: :key" - (apply 'sublis (list (cons nil cl-new)) cl-tree ':if cl-pred cl-keys)) + (apply 'sublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) (defun subst-if-not (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elts not matching PREDICATE in TREE (non-destructively). Return a copy of TREE with all non-matching elements replaced by NEW. Keywords supported: :key" - (apply 'sublis (list (cons nil cl-new)) cl-tree ':if-not cl-pred cl-keys)) + (apply 'sublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) (defun nsubst (cl-new cl-old cl-tree &rest cl-keys) "Substitute NEW for OLD everywhere in TREE (destructively). @@ -884,13 +875,13 @@ "Substitute NEW for elements matching PREDICATE in TREE (destructively). Any element of TREE which matches is changed to NEW (via a call to `setcar'). Keywords supported: :key" - (apply 'nsublis (list (cons nil cl-new)) cl-tree ':if cl-pred cl-keys)) + (apply 'nsublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) (defun nsubst-if-not (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elements not matching PREDICATE in TREE (destructively). Any element of TREE which matches is changed to NEW (via a call to `setcar'). Keywords supported: :key" - (apply 'nsublis (list (cons nil cl-new)) cl-tree ':if-not cl-pred cl-keys)) + (apply 'nsublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) (defun sublis (cl-alist cl-tree &rest cl-keys) "Perform substitutions indicated by ALIST in TREE (non-destructively). @@ -952,4 +943,5 @@ (run-hooks 'cl-seq-load-hook) +;;; arch-tag: ec1cc072-9006-4225-b6ba-d6b07ed1710c ;;; cl-seq.el ends here diff --text -u 'xemacs-21.5.17/lisp/cl.el' 'xemacs-21.5.18/lisp/cl.el' Index: ./lisp/cl.el --- ./lisp/cl.el Sun Jun 10 19:42:22 2001 +++ ./lisp/cl.el Sun Jun 27 06:25:24 2004 @@ -24,7 +24,7 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: FSF 21.3. ;;; Commentary: @@ -37,8 +37,6 @@ ;; This package was written by Dave Gillespie; it is a complete ;; rewrite of Cesar Quiroz's original cl.el package of December 1986. ;; -;; This package works with Emacs 18, Emacs 19, and XEmacs/Lucid Emacs 19. -;; ;; Bug reports, comments, and suggestions are welcome! ;; This file contains the portions of the Common Lisp extensions @@ -107,34 +105,10 @@ 'lucid) (t 19))) -(or (fboundp 'defalias) (fset 'defalias 'fset)) - (defvar cl-optimize-speed 1) (defvar cl-optimize-safety 1) -;;; Keywords used in this package. - -;;; XEmacs - keywords are done in Fintern(). -;;; -;;; (defconst :test ':test) -;;; (defconst :test-not ':test-not) -;;; (defconst :key ':key) -;;; (defconst :start ':start) -;;; (defconst :start1 ':start1) -;;; (defconst :start2 ':start2) -;;; (defconst :end ':end) -;;; (defconst :end1 ':end1) -;;; (defconst :end2 ':end2) -;;; (defconst :count ':count) -;;; (defconst :initial-value ':initial-value) -;;; (defconst :size ':size) -;;; (defconst :from-end ':from-end) -;;; (defconst :rehash-size ':rehash-size) -;;; (defconst :rehash-threshold ':rehash-threshold) -;;; (defconst :allow-other-keys ':allow-other-keys) - - (defvar custom-print-functions nil "This is a list of functions that format user objects for printing. Each function is called in turn with three arguments: the object, the @@ -151,10 +125,8 @@ (defun eql (a b) ; See compiler macro in cl-macs.el "Return t if the two args are the same Lisp object. Floating-point numbers of equal value are `eql', but they may not be `eq'." - (if (floatp a) - (equal a b) - (eq a b))) - + (or (eq a b) + (and (numberp a) (numberp b) (equal a b)))) ;;; Generalized variables. These macros are defined here so that they ;;; can safely be used in .emacs files. @@ -217,7 +189,7 @@ (defun cl-set-substring (str start end val) (if end (if (< end 0) (incf end (length str))) (setq end (length str))) - (if (< start 0) (incf start str)) + (if (< start 0) (incf start (length str))) (concat (and (> start 0) (substring str 0 start)) val (and (< end (length str)) (substring str end)))) @@ -229,13 +201,7 @@ ;; ALWAYS be available. So they've been moved from cl.el to eval.c. ;; Note: FSF Emacs moved them to subr.el in FSF 20. -(defun cl-map-extents (&rest cl-args) - ;; XEmacs: This used to check for overlays first, but that's wrong - ;; because of the new compatibility library. *duh* - (cond ((fboundp 'map-extents) - (apply 'map-extents cl-args)) - ((fboundp 'next-overlay-at) - (apply 'cl-map-overlays cl-args)))) +(defalias 'cl-map-extents 'map-extents) ;;; Blocks and exits. @@ -248,12 +214,40 @@ ;;; simulated. Instead, multiple-value-bind and friends simply expect ;;; the target form to return the values as a list. -(defalias 'values 'list) -(defalias 'values-list 'identity) -(defalias 'multiple-value-list 'identity) +(defsubst values (&rest values) + "Return multiple values, Common Lisp style. +The arguments of `values' are the values +that the containing function should return." + values) + +(defsubst values-list (list) + "Return multiple values, Common Lisp style, taken from a list. +LIST specifies the list of values +that the containing function should return." + list) + +(defsubst multiple-value-list (expression) + "Return a list of the multiple values produced by EXPRESSION. +This handles multiple values in Common Lisp style, but it does not +work right when EXPRESSION calls an ordinary Emacs Lisp function +that returns just one value." + expression) + +(defsubst multiple-value-apply (function expression) + "Evaluate EXPRESSION to get multiple values and apply FUNCTION to them. +This handles multiple values in Common Lisp style, but it does not work +right when EXPRESSION calls an ordinary Emacs Lisp function that returns just +one value." + (apply function expression)) + (defalias 'multiple-value-call 'apply) ; only works for one arg -(defalias 'nth-value 'nth) +(defsubst nth-value (n expression) + "Evaluate EXPRESSION to get multiple values and return the Nth one. +This handles multiple values in Common Lisp style, but it does not work +right when EXPRESSION calls an ordinary Emacs Lisp function that returns just +one value." + (nth n expression)) ;;; Macros. @@ -313,13 +307,19 @@ (defun cl-random-time () (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0)) (while (>= (decf i) 0) (setq v (+ (* v 3) (aref time i)))) - v)) + (if (featurep 'bignum) + (coerce-number v 'fixnum) + v))) (defvar *gensym-counter* (* (logand (cl-random-time) 1023) 100)) +;; XEmacs change: gensym and gentemp moved here from cl-macs.el (defun gensym (&optional arg) "Generate a new uninterned symbol. -The name is made by appending a number to PREFIX, default \"G\"." +The name is made by appending a number to a prefix. If ARG is a string, it +is the prefix, otherwise the prefix defaults to \"G\". If ARG is an integer, +the internal counter is reset to that number before creating the name. +There is no way to specify both using this function." (let ((prefix (if (stringp arg) arg "G")) (num (if (integerp arg) arg (prog1 *gensym-counter* @@ -328,7 +328,8 @@ (defun gentemp (&optional arg) "Generate a new interned symbol with a unique name. -The name is made by appending a number to PREFIX, default \"G\"." +The name is made by appending a number to ARG, default \"G\". +If ARG is not a string, it is ignored." (let ((prefix (if (stringp arg) arg "G")) name) (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*))) @@ -337,6 +338,8 @@ ;;; Numbers. +;; XEmacs change: use floatp, which is right even in the presence of ratios +;; and bigfloats (defun floatp-safe (object) "Return t if OBJECT is a floating point number." (floatp object)) @@ -357,18 +360,19 @@ "Return t if INTEGER is even." (eq (logand integer 1) 0)) -(defun cl-abs (number) - "Return the absolute value of NUMBER." - (if (>= number 0) number (- number))) -(or (fboundp 'abs) (defalias 'abs 'cl-abs)) ; This is built-in to Emacs 19 +;; XEmacs addition +(defalias 'cl-abs 'abs) (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time))) +;; XEmacs: These constants are defined in C when 'number-types is provided. +;; They are always defined in C on Emacs. Maybe we should, too. +(unless (featurep 'number-types) ;;; We use `eval' in case VALBITS differs from compile-time to load-time. -(defconst most-positive-fixnum (eval '(lsh -1 -1)) - "The integer closest in value to positive infinity.") -(defconst most-negative-fixnum (eval '(- -1 (lsh -1 -1))) - "The integer closest in value to negative infinity.") + (defconst most-positive-fixnum (eval '(lsh -1 -1)) + "The integer closest in value to positive infinity.") + (defconst most-negative-fixnum (eval '(- -1 (lsh -1 -1))) + "The integer closest in value to negative infinity.")) ;;; The following are set by code in cl-extra.el (defconst most-positive-float nil @@ -404,6 +408,7 @@ (nreverse cl-res))) (mapcar cl-func cl-x))) +(defalias 'svref 'aref) ;;; List functions. @@ -414,42 +419,44 @@ (defalias 'rest 'cdr) (defalias 'endp 'null) +;; XEmacs change: make it a real function (defun second (x) "Return the second element of the list LIST." (car (cdr x))) (defun third (x) - "Return the third element of the list LIST." + "Return the third element of the list X." (car (cdr (cdr x)))) (defun fourth (x) - "Return the fourth element of the list LIST." + "Return the fourth element of the list X." (nth 3 x)) (defun fifth (x) - "Return the fifth element of the list LIST." + "Return the fifth element of the list X." (nth 4 x)) (defun sixth (x) - "Return the sixth element of the list LIST." + "Return the sixth element of the list X." (nth 5 x)) (defun seventh (x) - "Return the seventh element of the list LIST." + "Return the seventh element of the list X." (nth 6 x)) (defun eighth (x) - "Return the eighth element of the list LIST." + "Return the eighth element of the list X." (nth 7 x)) (defun ninth (x) - "Return the ninth element of the list LIST." + "Return the ninth element of the list X." (nth 8 x)) (defun tenth (x) - "Return the tenth element of the list LIST." + "Return the tenth element of the list X." (nth 9 x)) +;; XEmacs change: Emacs defines caar, cadr, cdar, and cddr in subr.el. (defun caar (x) "Return the `car' of the `car' of X." (car (car x))) @@ -563,34 +570,16 @@ (cdr (cdr (cdr (cdr x))))) ;;; `last' is implemented as a C primitive, as of 1998-11 - -;(defun last (x &optional n) -; "Return the last link in the list LIST. -;With optional argument N, return Nth-to-last link (default 1)." -; (if n -; (let ((m 0) (p x)) -; (while (consp p) (incf m) (pop p)) -; (if (<= n 0) p -; (if (< n m) (nthcdr (- m n) x) x))) -; (while (consp (cdr x)) (pop x)) -; x)) - -;;; `butlast' is implemented as a C primitive, as of 1998-11 -;;; `nbutlast' is implemented as a C primitive, as of 1998-11 - -;(defun butlast (x &optional n) -; "Return a copy of LIST with the last N elements removed." -; (if (and n (<= n 0)) x -; (nbutlast (copy-sequence x) n))) - -;(defun nbutlast (x &optional n) -; "Modify LIST to remove the last N elements." -; (let ((m (length x))) -; (or n (setq n 1)) -; (and (< n m) -; (progn -; (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil)) -; x)))) +;;(defun last* (x &optional n) +;; "Returns the last link in the list LIST. +;;With optional argument N, returns Nth-to-last link (default 1)." +;; (if n +;; (let ((m 0) (p x)) +;; (while (consp p) (incf m) (pop p)) +;; (if (<= n 0) p +;; (if (< n m) (nthcdr (- m n) x) x))) +;; (while (consp (cdr x)) (pop x)) +;; x)) (defun list* (arg &rest rest) ; See compiler macro in cl-macs.el "Return a new list with specified args as elements, cons'd to last arg. @@ -626,10 +615,6 @@ (while (and list (not (equal item (car list)))) (setq list (cdr list))) list) -;;; Define an Emacs 19-compatible `member' for the benefit of Emacs 18 users. -(or (and (fboundp 'member) (subrp (symbol-function 'member))) - (defalias 'member 'cl-maclisp-member)) - (defalias 'cl-member 'memq) ; for compatibility with old CL package (defalias 'cl-floor 'floor*) (defalias 'cl-ceiling 'ceiling*) @@ -677,19 +662,7 @@ ;; XEmacs change (define-error 'cl-assertion-failed "Assertion failed") -;;; This is defined in Emacs 19; define it here for Emacs 18 users. -(defun cl-add-hook (hook func &optional append) - "Add to hook variable HOOK the function FUNC. -FUNC is not added if it already appears on the list stored in HOOK." - (let ((old (and (boundp hook) (symbol-value hook)))) - (and (listp old) (not (eq (car old) 'lambda)) - (setq old (list old))) - (and (not (member func old)) - (set hook (if append (nconc old (list func)) (cons func old)))))) -(or (fboundp 'add-hook) (defalias 'add-hook 'cl-add-hook)) - -;; XEmacs change -;(load "cl-defs") +;; XEmacs change: omit the autoload rules; we handle those a different way ;;; Define data for indentation and edebug. (mapcar @@ -745,10 +718,10 @@ (defun cl-hack-byte-compiler () (if (and (not cl-hacked-flag) (fboundp 'byte-compile-file-form)) (progn + (setq cl-hacked-flag t) ; Do it first, to prevent recursion. (when (not (fboundp 'cl-compile-time-init)) (load "cl-macs" nil t)) - (cl-compile-time-init) ; in cl-macs.el - (setq cl-hacked-flag t)))) + (cl-compile-time-init)))) ; In cl-macs.el. ;;; Try it now in case the compiler has already been loaded. (cl-hack-byte-compiler) @@ -758,7 +731,8 @@ ;;; we can take advantage of the fact that emacs-lisp-mode will be ;;; called when the compiler reads in the file to be compiled. ;;; BUG: If the first compilation is `byte-compile' rather than -;;; `byte-compile-file', we lose. Oh, well. +;;; `byte-compile-file', we lose. Emacs has fixed this by hanging it +;;; on `bytecomp-load-hook' instead, which we do not have. (add-hook 'emacs-lisp-mode-hook 'cl-hack-byte-compiler) @@ -767,8 +741,7 @@ (provide 'cl) -(provide 'mini-cl) ; for Epoch - (run-hooks 'cl-load-hook) +;;; arch-tag: 5f07fa74-f153-4524-9303-21f5be125851 ;;; cl.el ends here diff --text -u 'xemacs-21.5.17/lisp/code-init.el' 'xemacs-21.5.18/lisp/code-init.el' Index: ./lisp/code-init.el --- ./lisp/code-init.el Sat Sep 20 01:32:57 2003 +++ ./lisp/code-init.el Wed Sep 22 11:05:49 2004 @@ -25,6 +25,12 @@ ;; coding systems have been created, because we'll be using them at ;; load time. +;; #### Issues (this discussion probably belongs elsewhere) +;; 1. "Big" characters are unrepresentable. Should give error, warning, +;; not just substitute "~". +;; 2. 21.4 compatibility? +;; 3. make-char: non-mule barfs on non-iso8859-1. + ;;; Code: (defcustom eol-detection-enabled-p (or (featurep 'mule) @@ -56,11 +62,14 @@ if you do this." (dolist (x '(buffer-file-coding-system-for-read keyboard - default-process-coding-system-read - no-conversion-coding-system-mapping)) + default-process-coding-system-read)) (set-coding-system-variable x (coding-system-change-eol-conversion (get-coding-system-variable x) - (if flag nil 'lf))))) + (if flag nil 'lf)))) + (set-coding-category-system + 'no-conversion + (coding-system-change-eol-conversion (coding-category-system 'no-conversion) + (if flag nil 'lf)))) (defun coding-system-current-system-configuration () (cond ((memq system-type '(windows-nt cygwin32)) @@ -75,6 +84,7 @@ '((buffer-file-coding-system-for-read binary raw-text undecided raw-text undecided) (default-buffer-file-coding-system + ;; #### iso-2022-8 with no eol specified? can that be OK? binary binary iso-2022-8 raw-text-dos mswindows-multibyte-dos) (native binary binary binary raw-text-dos mswindows-multibyte-system-default-dos) diff --text -u 'xemacs-21.5.17/lisp/code-process.el' 'xemacs-21.5.18/lisp/code-process.el' Index: ./lisp/code-process.el --- ./lisp/code-process.el Mon Nov 11 01:07:13 2002 +++ ./lisp/code-process.el Sun Apr 4 05:00:26 2004 @@ -169,16 +169,22 @@ ;; a temporary file was used to pass the text to call-process. Now that ;; we don't do that, we delete the text afterward; if it's being inserted ;; in the same buffer, make sure we track the insertion, and don't get - ;; any of it in the deleted region if insertion happens at either end - ;; of the region. - (let ((s (and deletep (copy-marker start t))) - (e (and deletep (copy-marker end)))) + ;; any of it in the deleted region. We keep marker s before the + ;; insertion and e afterward. Finally we delete the regions before + ;; and after the insertion. + (let ((s (and deletep (copy-marker (point)))) + (e (and deletep (copy-marker (point) t)))) (let ((retval (apply #'call-process program (list (current-buffer) start end) buffer displayp args))) - ;; If start and end were the same originally, s will be beyond e now - (if (and deletep (> e s)) - (delete-region s e)) + ;; If start and end were the same originally, e will be beyond s now + (when (and deletep (> e s)) + ;; APA: Is it always correct to honor narrowing, which affects + ;; (point-min) and (point-max)? + ;; Delete region before insertion. + (delete-region (point-min) s) + ;; Delete region after insertion. + (delete-region e (point-max))) retval))) (defun start-process (name buffer program &rest program-args) diff --text -u 'xemacs-21.5.17/lisp/cus-edit.el' 'xemacs-21.5.18/lisp/cus-edit.el' Index: ./lisp/cus-edit.el --- ./lisp/cus-edit.el Sun Aug 31 10:28:03 2003 +++ ./lisp/cus-edit.el Thu Jun 10 21:20:01 2004 @@ -1234,7 +1234,7 @@ (goto-char (point-min))) (define-widget 'custom-browse-visibility 'item - "Control visibility of of items in the customize tree browser." + "Control visibility of items in the customize tree browser." :format "%[[%t]%]" :action 'custom-browse-visibility-action) @@ -2041,7 +2041,7 @@ ;; Don't push it !!! Custom assumes that the first child is the ;; value one. (setq children (append children (list comment-widget))))) - ;; Update the rest of the properties properties. + ;; Update the rest of the properties. (widget-put widget :custom-form form) (widget-put widget :children children) ;; Now update the state. @@ -3471,15 +3471,13 @@ (custom-save-loaded-themes) (custom-save-resets 'theme-value 'custom-reset-variables nil) (let ((standard-output (current-buffer)) - ;; To make nconc work - (sorted-list (make-list 1 t))) + (sorted-list ())) ;; First create a sorted list of saved variables. (mapatoms (lambda (symbol) (when (custom-save-variable-p symbol) - (nconc sorted-list (list symbol))))) - (setq sorted-list (sort (cdr sorted-list) 'string<)) - + (push symbol sorted-list)))) + (setq sorted-list (sort sorted-list 'string<)) (unless (bolp) (princ "\n")) (princ "(custom-set-variables") @@ -3544,15 +3542,13 @@ ;; 'custom-set-faces) (custom-save-resets 'theme-face 'custom-reset-faces '(default)) (let ((standard-output (current-buffer)) - ;; To make nconc work - (sorted-list (make-list 1 t))) + (sorted-list ())) ;; Create a sorted list of faces (mapatoms (lambda (symbol) (when (custom-save-face-p symbol) - (nconc sorted-list (list symbol))))) - (setq sorted-list (sort (cdr sorted-list) 'string<)) - + (push symbol sorted-list)))) + (setq sorted-list (sort sorted-list 'string<)) (unless (bolp) (princ "\n")) (princ "(custom-set-faces") diff --text -u 'xemacs-21.5.17/lisp/derived.el' 'xemacs-21.5.18/lisp/derived.el' Index: ./lisp/derived.el --- ./lisp/derived.el Fri Jul 18 16:42:48 2003 +++ ./lisp/derived.el Sat Jun 19 00:48:38 2004 @@ -1,6 +1,7 @@ -;;; derived.el --- allow inheritance of major modes. +;;; derived.el --- allow inheritance of major modes +;;; (formerly mode-clone.el) -;; Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 1999, 2003 Free Software Foundation, Inc. ;; Author: David Megginson (dmeggins@aix1.uottawa.ca) ;; Maintainer: XEmacs Development Team @@ -23,7 +24,7 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: FSF 21.3. ;;; Commentary: @@ -74,12 +75,6 @@ ;; - assign the value 'hypertext-mode' to the 'major-mode' variable ;; - run the body of commands provided in the macro -- in this case, ;; set the local variable `case-fold-search' to nil. -;; - **run the command (hypertext-mode-setup), which is empty by -;; default, but may be redefined by the user to contain special -;; commands (ie. setting local variables like 'outline-regexp') -;; **NOTE: do not use this option -- it will soon be obsolete. -;; - run anything assigned to 'hypertext-mode-hooks' (obsolete, but -;; supported for the sake of compatibility). ;; ;; The advantages of this system are threefold. First, text mode is ;; untouched -- if you had added the new keystroke to `text-mode-map,' @@ -90,19 +85,34 @@ ;; ;; (define-derived-mode html-mode hypertext-mode "HTML") ;; [various key definitions] -;; -;; will add a new major mode for HTML with very little fuss. ;; -;; Note also the function `derived-mode-class,' which returns the non-derived -;; major mode which a derived mode is based on (ie. NOT necessarily the -;; immediate parent). +;; will add a new major mode for HTML with very little fuss. ;; -;; (derived-mode-class 'text-mode) ==> text-mode -;; (derived-mode-class 'hypertext-mode) ==> text-mode -;; (derived-mode-class 'html-mode) ==> text-mode +;; Note also the function `derived-mode-p' which can tell if the current +;; mode derives from another. In a hypertext-mode, buffer, for example, +;; (derived-mode-p 'text-mode) would return non-nil. This should always +;; be used in place of (eq major-mode 'text-mode). ;;; Code: +;;; PRIVATE: defsubst must be defined before they are first used + +(defsubst derived-mode-hook-name (mode) + "Construct the mode hook name based on mode name MODE." + (intern (concat (symbol-name mode) "-hook"))) + +(defsubst derived-mode-map-name (mode) + "Construct a map name based on a MODE name." + (intern (concat (symbol-name mode) "-map"))) + +(defsubst derived-mode-syntax-table-name (mode) + "Construct a syntax-table name based on a MODE name." + (intern (concat (symbol-name mode) "-syntax-table"))) + +(defsubst derived-mode-abbrev-table-name (mode) + "Construct an abbrev-table name based on a MODE name." + (intern (concat (symbol-name mode) "-abbrev-table"))) + ;; PUBLIC: define a new major mode which inherits from an existing one. ;; XEmacs -- no autoload @@ -112,12 +122,24 @@ The arguments to this command are as follow: CHILD: the name of the command for the derived mode. -PARENT: the name of the command for the parent mode (ie. text-mode). -NAME: a string which will appear in the status line (ie. \"Hypertext\") +PARENT: the name of the command for the parent mode (e.g. `text-mode') + or nil if there is no parent. +NAME: a string which will appear in the status line (e.g. \"Hypertext\") DOCSTRING: an optional documentation string--if you do not supply one, the function will attempt to invent something useful. BODY: forms to execute just before running the - hooks for the new mode. + hooks for the new mode. Do not use `interactive' here. + +BODY can start with a bunch of keyword arguments. The following keyword + arguments are currently understood: +:group GROUP + Declare the customization group that corresponds to this mode. +:syntax-table TABLE + Use TABLE instead of the default. + A nil value means to simply use the same syntax-table as the parent. +:abbrev-table TABLE + Use TABLE instead of the default. + A nil value means to simply use the same abbrev-table as the parent. Here is how you could define LaTeX-Thesis mode as a variant of LaTeX mode: @@ -127,7 +149,7 @@ without changing regular LaTeX mode. In this example, BODY is empty, and DOCSTRING is generated by default. -On a more complicated level, the following command uses sgml-mode as +On a more complicated level, the following command uses `sgml-mode' as the parent, and then sets the variable `case-fold-search' to nil: (define-derived-mode article-mode sgml-mode \"Article\" @@ -135,58 +157,100 @@ (setq case-fold-search nil)) Note that if the documentation string had been left out, it would have -been generated automatically, with a reference to the keymap." +been generated automatically, with a reference to the keymap. + +The new mode runs the hook constructed by the function +`derived-mode-hook-name'." + (declare (debug (&define name symbolp sexp [&optional stringp] + [&rest keywordp sexp] def-body))) + + (when (and docstring (not (stringp docstring))) + ;; Some trickiness, since what appears to be the docstring may really be + ;; the first element of the body. + (push docstring body) + (setq docstring nil)) + + (when (eq parent 'fundamental-mode) (setq parent nil)) + + (let ((map (derived-mode-map-name child)) + (syntax (derived-mode-syntax-table-name child)) + (abbrev (derived-mode-abbrev-table-name child)) + (declare-abbrev t) + (declare-syntax t) + (hook (derived-mode-hook-name child)) + (group nil)) + + ;; Process the keyword args. + (while (keywordp (car body)) + (case (pop body) + (:group (setq group (pop body))) + (:abbrev-table (setq abbrev (pop body)) (setq declare-abbrev nil)) + (:syntax-table (setq syntax (pop body)) (setq declare-syntax nil)) + (t (pop body)))) + + (setq docstring (derived-mode-make-docstring + parent child docstring syntax abbrev)) + + `(progn + (defvar ,hook nil ,(format "Hook run when entering %s mode." name)) + (defvar ,map (make-sparse-keymap)) + ,(if declare-syntax + `(defvar ,syntax (make-syntax-table))) + ,(if declare-abbrev + `(defvar ,abbrev + (progn (define-abbrev-table ',abbrev nil) ,abbrev))) + (put ',child 'derived-mode-parent ',parent) + ,(if group `(put ',child 'custom-mode-group ,group)) - ; Some trickiness, since what - ; appears to be the docstring - ; may really be the first - ; element of the body. - (if (and docstring (not (stringp docstring))) - (progn (setq body (cons docstring body)) - (setq docstring nil))) - (setq docstring (or docstring (derived-mode-make-docstring parent child))) - - `(progn - (derived-mode-init-mode-variables (quote ,child)) - (put (quote ,child) 'derived-mode-parent (quote ,parent)) (defun ,child () ,docstring (interactive) ; Run the parent. - (,parent) - ; Identify special modes. - (if (get (quote ,parent) 'special) - (put (quote ,child) 'special t)) - ;; XEmacs addition - (let ((mode-class (get (quote ,parent) 'mode-class))) - (if mode-class - (put (quote ,child) 'mode-class mode-class))) + (delay-mode-hooks + + (,(or parent 'kill-all-local-variables)) ; Identify the child mode. - (setq major-mode (quote ,child)) - (setq mode-name ,name) + (setq major-mode (quote ,child)) + (setq mode-name ,name) + ; Identify special modes. + ,(when parent + `(progn + (if (get (quote ,parent) 'mode-class) + (put (quote ,child) 'mode-class + (get (quote ,parent) 'mode-class))) ; Set up maps and tables. - (derived-mode-set-keymap (quote ,child)) - (derived-mode-set-syntax-table (quote ,child)) - (derived-mode-set-abbrev-table (quote ,child)) + (unless (keymap-parent ,map) + (set-keymap-parents ,map (list (current-local-map)))) + ,(when declare-syntax + ;; XEmacs change: we do not have char-table-parent + `(derived-mode-merge-syntax-tables + (syntax-table) ,syntax)))) + + (use-local-map ,map) + ,(when syntax `(set-syntax-table ,syntax)) + ,(when abbrev `(setq local-abbrev-table ,abbrev)) ; Splice in the body (if any). - ,@body -;;; ; Run the setup function, if -;;; ; any -- this will soon be -;;; ; obsolete. -;;; (derived-mode-run-setup-function (quote ,child)) - ; Run the hooks, if any. - (derived-mode-run-hooks (quote ,child))))) - + ,@body + ) + ;; Run the hooks, if any. + ;; Make the generated code work in older Emacs versions + ;; that do not yet have run-mode-hooks. + (if (fboundp 'run-mode-hooks) + (run-mode-hooks ',hook) + (run-hooks ',hook)))))) ;; PUBLIC: find the ultimate class of a derived mode. (defun derived-mode-class (mode) - "Find the class of a major mode. + "Find the class of a major MODE. A mode's class is the first ancestor which is NOT a derived mode. -Use the `derived-mode-parent' property of the symbol to trace backwards." +Use the `derived-mode-parent' property of the symbol to trace backwards. +Since major-modes might all derive from `fundamental-mode', this function +is not very useful." (while (get mode 'derived-mode-parent) (setq mode (get mode 'derived-mode-parent))) mode) +(make-obsolete 'derived-mode-class 'derived-mode-p) ;; PUBLIC: find if the current mode derives from another. ;; from GNU Emacs 21 subr.el @@ -200,35 +264,66 @@ parent)) -;; Inline functions to construct various names from a mode name. +;;; PRIVATE -(defsubst derived-mode-setup-function-name (mode) - "Construct a setup-function name based on a mode name." - (intern (concat (symbol-name mode) "-setup"))) +(defun derived-mode-make-docstring (parent child &optional + docstring syntax abbrev) + "Construct a docstring for a new mode if none is provided." -(defsubst derived-mode-hooks-name (mode) - "Construct a hooks name based on a mode name." - ;; XEmacs change from -hooks - (intern (concat (symbol-name mode) "-hook"))) + (let ((map (derived-mode-map-name child)) + (hook (derived-mode-hook-name child))) -(defsubst derived-mode-map-name (mode) - "Construct a map name based on a mode name." - (intern (concat (symbol-name mode) "-map"))) + (unless (stringp docstring) + ;; Use a default docstring. + (setq docstring + (if (null parent) + (format "Major-mode. +Uses keymap `%s', abbrev table `%s' and syntax-table `%s'." map abbrev syntax) + (format "Major mode derived from `%s' by `define-derived-mode'. +It inherits all of the parent's attributes, but has its own keymap, +abbrev table and syntax table: -(defsubst derived-mode-syntax-table-name (mode) - "Construct a syntax-table name based on a mode name." - (intern (concat (symbol-name mode) "-syntax-table"))) + `%s', `%s' and `%s' -(defsubst derived-mode-abbrev-table-name (mode) - "Construct an abbrev-table name based on a mode name." - (intern (concat (symbol-name mode) "-abbrev-table"))) +which more-or-less shadow %s's corresponding tables." + parent map abbrev syntax parent)))) + + (unless (string-match (regexp-quote (symbol-name hook)) docstring) + ;; Make sure the docstring mentions the mode's hook. + (setq docstring + (concat docstring + (if (null parent) + "\n\nThis mode " + (concat + "\n\nIn addition to any hooks its parent mode " + (if (string-match (regexp-quote (format "`%s'" parent)) + docstring) nil + (format "`%s' " parent)) + "might have run,\nthis mode ")) + (format "runs the hook `%s'" hook) + ", as the final step\nduring initialization."))) + + (unless (string-match "\\\\[{[]" docstring) + ;; And don't forget to put the mode's keymap. + (setq docstring (concat docstring "\n\n\\{" (symbol-name map) "}"))) + + docstring)) + + +;;; OBSOLETE +;; The functions below are only provided for backward compatibility with +;; code byte-compiled with versions of derived.el prior to Emacs-21. + +(defsubst derived-mode-setup-function-name (mode) + "Construct a setup-function name based on a MODE name." + (intern (concat (symbol-name mode) "-setup"))) ;; Utility functions for defining a derived mode. ;; XEmacs -- don't autoload (defun derived-mode-init-mode-variables (mode) - "Initialize variables for a new mode. + "Initialise variables for a new MODE. Right now, if they don't already exist, set up a blank keymap, an empty syntax table, and an empty abbrev table -- these will be merged the first time the mode is used." @@ -256,30 +351,15 @@ (if (boundp (derived-mode-abbrev-table-name mode)) t (eval `(defvar ,(derived-mode-abbrev-table-name mode) - (progn (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) - (make-abbrev-table)) + (progn + (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) + (make-abbrev-table)) ,(format "Abbrev table for %s." mode))))) - -(defun derived-mode-make-docstring (parent child) - "Construct a docstring for a new mode if none is provided." - - (format "This major mode is a variant of `%s', created by `define-derived-mode'. -It inherits all of the parent's attributes, but has its own keymap, -abbrev table and syntax table: - - `%s-map' and `%s-syntax-table' - -which more-or-less shadow - - `%s-map' and `%s-syntax-table' - -\\{%s-map}" parent child child parent parent child)) - ;; Utility functions for running a derived mode. (defun derived-mode-set-keymap (mode) - "Set the keymap of the new mode, maybe merging with the parent." + "Set the keymap of the new MODE, maybe merging with the parent." (let* ((map-name (derived-mode-map-name mode)) (new-map (eval map-name)) (old-map (current-local-map))) @@ -289,8 +369,8 @@ (put map-name 'derived-mode-unmerged nil) (use-local-map new-map))) -(defun derived-mode-set-syntax-table (mode) - "Set the syntax table of the new mode, maybe merging with the parent." +(defun derived-mode-set-syntax-table (mode) + "Set the syntax table of the new MODE, maybe merging with the parent." (let* ((table-name (derived-mode-syntax-table-name mode)) (old-table (syntax-table)) (new-table (eval table-name))) @@ -300,7 +380,7 @@ (set-syntax-table new-table))) (defun derived-mode-set-abbrev-table (mode) - "Set the abbrev table if it exists. + "Set the abbrev table for MODE if it exists. Always merge its parent into it, since the merge is non-destructive." (let* ((table-name (derived-mode-abbrev-table-name mode)) (old-table local-abbrev-table) @@ -316,53 +396,45 @@ ;;; (funcall fname)))) (defun derived-mode-run-hooks (mode) - "Run the hooks if they exist." - - (let ((hooks-name (derived-mode-hooks-name mode))) + "Run the mode hook for MODE." + (let ((hooks-name (derived-mode-hook-name mode))) (if (boundp hooks-name) (run-hooks hooks-name)))) ;; Functions to merge maps and tables. (defun derived-mode-merge-keymaps (old new) - "Merge an old keymap into a new one. -The old keymap is set to be the parent of the new one, so that there will + "Merge an OLD keymap into a NEW one. +The old keymap is set to be the last cdr of the new one, so that there will be automatic inheritance." - ;; XEmacs change. FSF 19.30 & 19.34 has a whole bunch of weird crap here + ;; XEmacs change. FSF 19.30 to 21.3 has a whole bunch of weird crap here ;; for merging prefix keys and such. Hopefully none of this is ;; necessary in XEmacs. (set-keymap-parents new (list old))) (defun derived-mode-merge-syntax-tables (old new) - "Merge an old syntax table into a new one. + "Merge an OLD syntax table into a NEW one. Where the new table already has an entry, nothing is copied from the old one." - ;; 20.x - (if (fboundp 'map-char-table) - ;; we use map-char-table not map-syntax-table so we can explicitly - ;; check for inheritance. - (map-char-table - #'(lambda (key value) - (let ((newval (get-range-char-table key new 'multi))) - (cond ((eq newval 'multi) ; OK, dive into the class hierarchy - (map-char-table - #'(lambda (key1 value1) - (when (eq ?@ (char-syntax-from-code - (get-range-char-table key new ?@))) - (put-char-table key1 value new)) - nil) - new - key)) - ((eq ?@ (char-syntax-from-code newval)) ;; class at once - (put-char-table key value new)))) - nil) - old) - ;; pre-20.0 - (let ((idx 0) - (end (min (length new) (length old)))) - (while (< idx end) - (if (not (aref new idx)) - (aset new idx (aref old idx))) - (setq idx (1+ idx)))))) + ;; XEmacs change: on the other hand, Emacs 21.3 just has + ;; (set-char-table-parent new old) here. + ;; We use map-char-table, not map-syntax-table, so we can explicitly + ;; check for inheritance. + (map-char-table + #'(lambda (key value) + (let ((newval (get-range-char-table key new 'multi))) + (cond ((eq newval 'multi) ; OK, dive into the class hierarchy + (map-char-table + #'(lambda (key1 value1) + (when (eq ?@ (char-syntax-from-code + (get-range-char-table key new ?@))) + (put-char-table key1 value new)) + nil) + new + key)) + ((eq ?@ (char-syntax-from-code newval)) ;; class at once + (put-char-table key value new)))) + nil) + old)) ;; Merge an old abbrev table into a new one. ;; This function requires internal knowledge of how abbrev tables work, @@ -370,14 +442,14 @@ ;; as the value of the symbol, and the hook as the function definition. (defun derived-mode-merge-abbrev-tables (old new) (if old - (mapatoms - (function - (lambda (symbol) - (or (intern-soft (symbol-name symbol) new) - (define-abbrev new (symbol-name symbol) - (symbol-value symbol) (symbol-function symbol))))) + (mapatoms + #'(lambda (symbol) + (or (intern-soft (symbol-name symbol) new) + (define-abbrev new (symbol-name symbol) + (symbol-value symbol) (symbol-function symbol)))) old))) - + (provide 'derived) +;;; arch-tag: 630be248-47d1-4f02-afa0-8207de0ebea0 ;;; derived.el ends here diff --text -u 'xemacs-21.5.17/lisp/dialog-gtk.el' 'xemacs-21.5.18/lisp/dialog-gtk.el' Index: ./lisp/dialog-gtk.el --- ./lisp/dialog-gtk.el Thu Dec 20 14:49:30 2001 +++ ./lisp/dialog-gtk.el Sat May 15 16:31:44 2004 @@ -44,7 +44,33 @@ gtk-window-set-title gtk-container-set-border-width gtk-box-set-spacing gtk-dialog-vbox gtk-container-add gtk-label-new gtk-button-new-with-label - gtk-widget-set-sensitive gtk-widget-show gtk-dialog-action-area)) + gtk-widget-set-sensitive gtk-widget-show gtk-dialog-action-area + gtk-label-parse-uline gtk-widget-add-accelerator gtk-accel-group-new)) + +(defun gtk-popup-convert-underscores (str) + ;; Convert the XEmacs button accelerator representation to Gtk mnemonic + ;; form. If no accelerator has been provided, put one at the start of the + ;; string (this mirrors the behaviour under X). This algorithm is also found + ;; in menubar-gtk.c:convert_underscores(). + (let ((new-str (string)) + (i 0) + (found-accel nil)) + (while (< i (length str)) + (let ((c (aref str i))) + (cond ((eq c ?%) + (setq i (1+ i)) + (if (and (not (eq (aref str i) ?_)) (not (eq (aref str i) ?%))) + (setq i (1- i))) + (setq found-accel 1) + ) + ((eq c ?_) + (setq new-str (concat new-str "_"))) + )) + (setq new-str (concat new-str (string (aref str i)))) + (setq i (1+ i)) + ) + (if found-accel new-str (concat "_" new-str)) + )) (defun popup-builtin-open-dialog (keys) ;; Allowed keywords are: @@ -197,6 +223,10 @@ (callback nil) (flushrightp nil) (length nil) + (label nil) + (gui-button nil) + (accel-group (gtk-accel-group-new)) + (accel-key nil) (errp t)) (if (not buttons-descr) (error 'syntax-error @@ -244,7 +274,22 @@ (setq activep (plist-get plist :active) callback (plist-get plist :callback))))) - (push (gtk-button-new-with-label (aref button 0)) buttons) + ;; Create the label and determine what the mnemonic key is. + (setq label (gtk-label-new "")) + (setq accel-key (gtk-label-parse-uline label + (gtk-popup-convert-underscores (aref button 0)))) + ;; Place the label in the button. + (gtk-misc-set-alignment label 0.5 0.5) + (setq gui-button (gtk-button-new)) + (gtk-container-add gui-button label) + ;; Add ALT-mnemonic to the dialog's accelerator group. + (gtk-widget-add-accelerator gui-button "clicked" accel-group + accel-key + 8 ; GDK_MOD1_MASK + 4 ; GTK_ACCEL_LOCKED + ) + + (push gui-button buttons) (gtk-widget-set-sensitive (car buttons) (eval activep)) ;; Apply the callback @@ -273,6 +318,9 @@ (gtk-window-set-transient-for dialog (frame-property nil 'shell-widget)) (put dialog 'type 'dialog) (put dialog 'modal t) + ;; Make the dialog listen for global mnemonic keys/ + (gtk-window-add-accel-group dialog accel-group) + (gtk-widget-show-all dialog) (gtk-main) (gtk-widget-destroy dialog) diff --text -u 'xemacs-21.5.17/lisp/etags.el' 'xemacs-21.5.18/lisp/etags.el' Index: ./lisp/etags.el --- ./lisp/etags.el Mon Jul 21 15:42:32 2003 +++ ./lisp/etags.el Mon May 10 15:26:31 2004 @@ -177,6 +177,19 @@ :type 'boolean :group 'etags) +(defcustom tags-exuberant-ctags-optimization-p nil + "*If this variable is nil (the default), then exact tag search is able +to find tag names in the name part of the tagtable (enclosed by ^?..^A) +and in the sourceline part of the tagtable ( enclosed by ^..^?). +This is needed by xemacs etags as not every tag has a name field. +It is slower for large tables and less precise than the other option. + +If it is non-nil, then exact tag will only search tag names in the name +part (enclosed by ^?..^A). This is faster and more precise than the other +option. This is only usable with exuberant etags, as it has a name field +entry for every tag." +:type 'boolean +:group 'etags) ;; Buffer tag tables. @@ -347,7 +360,9 @@ ;; The user wants to build the table: (condition-case nil (progn - (add-to-tag-completion-table) + (if tags-exuberant-ctags-optimization-p + (add-to-tag-completion-table-exuberant-ctags) + (add-to-tag-completion-table)) (setq tag-table-completion-status t)) ;; Allow user to C-g out correctly (quit @@ -507,6 +522,24 @@ tags-explicit-name-pattern)) (defconst tags-file-pattern "^\f\n\\(.+\\),[0-9]+\n") +(defun add-to-tag-completion-table-exuberant-ctags () + "Sucks the current buffer (a TAGS table) into the completion-table. +This is a version which is optimized for exuberant etags and will not +work with xemacs etags." + (message "Adding %s to tags completion table..." buffer-file-name) + (goto-char (point-min)) + (let ((tag-table-symbol (intern buffer-file-name tag-completion-table)) + ;; tag-table-symbol is used by intern-tag-symbol + name tag-symbol + tag-symbol-tables + (case-fold-search nil)) + (while (re-search-forward tags-explicit-name-pattern nil t) + ;; no need to check the mode here + (setq name (match-string 2)) + (intern-tag-symbol name))) + (message "Adding %s to tags completion table...done" buffer-file-name)) + + ;; #### Should make it work with the `include' directive! (defun add-to-tag-completion-table () "Sucks the current buffer (a TAGS table) into the completion-table." @@ -675,7 +708,11 @@ (t (setq tag-table-currently-matching-exact t))) ;; \_ in the tagname is used to indicate a symbol boundary. - (setq exact-tagname (format "\C-?\\_%s\\_\C-a\\|\\_%s\\_" tagname tagname)) + (if tags-exuberant-ctags-optimization-p + (setq exact-tagname (format "\C-?%s\C-a" tagname)) + (setq exact-tagname (format "\C-?%s\C-a\\|\ +\\_%s.?\C-?[0-9]*,[0-9]*$" tagname tagname)) + ) (while (string-match "\\\\_" exact-tagname) (aset exact-tagname (1- (match-end 0)) ?b)) (save-excursion diff --text -u 'xemacs-21.5.17/lisp/files.el' 'xemacs-21.5.18/lisp/files.el' Index: ./lisp/files.el --- ./lisp/files.el Wed Oct 15 01:10:06 2003 +++ ./lisp/files.el Mon Jun 7 08:58:44 2004 @@ -279,7 +279,7 @@ ; :group 'backup ; :group 'dired) -(defcustom delete-old-versions nil +(defcustom delete-old-versions (when noninteractive 'leave) "*If t, delete excess backup versions silently. If nil, ask confirmation. Any other value prevents any trimming." :type '(choice (const :tag "Delete" t) @@ -2806,7 +2806,7 @@ "Save the current buffer in its visited file, if it has been modified. The hooks `write-contents-hooks', `local-write-file-hooks' and `write-file-hooks' get a chance to do the job of saving; if they do not, -then the buffer is saved in the visited file file in the usual way. +then the buffer is saved in the visited file in the usual way. After saving the buffer, this function runs `after-save-hook'." (interactive) (save-current-buffer @@ -3480,10 +3480,20 @@ ;; The resultant buffer is identical, alter ;; modtime, update mods and exit (set-visited-file-modtime) - (after-find-file nil nil t t t)) + (after-find-file nil nil t t t) + ;; We preserved modes above so fixup the local + ;; variables manually + (condition-case err + (hack-local-variables) + (error (lwarn 'local-variables 'warning + "File local-variables error: %s" + (error-message-string err))))) (t t)) t))))) +;; #### wouldn't something like `revert-buffer-compare-with-file' be a +;; better name? +;; #### why is the argument optional? (defun revert-buffer-internal (&optional file-name) "Read contents of FILE-NAME into a buffer, and compare to current buffer. Return nil if identical, and the new buffer if different." diff --text -u 'xemacs-21.5.17/lisp/find-paths.el' 'xemacs-21.5.18/lisp/find-paths.el' Index: ./lisp/find-paths.el --- ./lisp/find-paths.el Sat Mar 1 16:25:27 2003 +++ ./lisp/find-paths.el Wed Sep 22 11:05:50 2004 @@ -44,7 +44,7 @@ (defvar paths-lisp-filename-regexp "^\\(.*\\.elc?\\)$" - "File bases that contain Lisp file.") + "File bases that name Emacs Lisp files.") (defvar paths-no-lisp-directory-regexp (concat "\\(" paths-version-control-filename-regexp "\\)" diff --text -u 'xemacs-21.5.17/lisp/font-menu.el' 'xemacs-21.5.18/lisp/font-menu.el' Index: ./lisp/font-menu.el --- ./lisp/font-menu.el Sat Sep 20 10:14:24 2003 +++ ./lisp/font-menu.el Wed Sep 22 11:05:50 2004 @@ -121,40 +121,58 @@ ;;;###autoload (defcustom font-menu-ignore-scaled-fonts nil - "*If non-nil, then the font menu will try to show only bitmap fonts." + "*If non-nil, the font menu shows only bitmap fonts. + +Bitmap fonts at their design size are generally noticably higher quality than +scaled fonts, unless the device is capable of interpreting antialiasing hints. +In general, setting this option non-`nil' is useful mostly on older X servers. + +Not all devices make the distinction between bitmap and scaled fonts." :type 'boolean :group 'font-menu) ;;;###autoload (defcustom font-menu-this-frame-only-p nil - "*If non-nil, then changing the default font from the font menu will only -affect one frame instead of all frames." + "*If non-nil, the menu affects the default font only on the selected frame." :type 'boolean :group 'font-menu) (defcustom font-menu-max-number nil - "The maximum number of fonts retrieved from the server" + "The maximum number of fonts retrieved from the display." :type 'integer :group 'font-menu) (defvaralias 'font-menu-max-items 'menu-max-items) (defvaralias 'font-menu-submenu-name-format 'menu-submenu-name-format) +;; #### Need to update for fontconfig/Xft? Document form for MS Windows. (defvar font-menu-preferred-resolution (make-specifier-and-init 'generic '((global ((mswindows) . ":") ((gtk) . "*-*") ((x) . "*-*"))) t) - "Preferred horizontal and vertical font menu resolution (e.g. \"75:75\").") + "Generic specifier containing preferred resolution as a string. +Do not `setq' this variable; use `set-specifier'. + +For X11 and GTK devices, the instance value will be interpolated into an +XLFD, and looks like \"75-75\").") (defvar font-menu-size-scaling (make-specifier-and-init 'integer '((global ((mswindows) . 1) ((gtk) . 10) ((x) . 10))) t) - "Scale factor used in defining font sizes.") + "Generic specifier containing scale factor for font sizes. Don't touch. + +This is really a device type constant. Some devices specify size in points +\(MS Windows), others in decipoints (X11).") -;; only call XListFonts (and parse) once per device. -;; ( (device . [parsed-list-fonts family-menu size-menu weight-menu]) ...) -(defvar device-fonts-cache nil) +(defvar device-fonts-cache nil + "Alist mapping devices to font lists and font menus. Don't use this. + +Instead, use the function `device-fonts-cache' which lazily updates this +variable, and returns the value for the selected device. + +Each element has the form (DEVICE . [FONT-LIST FAMILY SIZE WEIGHT]) where +FAMILY, SIZE, and WEIGHT denote menus.") (defsubst device-fonts-cache () (or (cdr (assq (selected-device) device-fonts-cache)) @@ -169,14 +187,15 @@ (defun reset-device-font-menus (&optional device debug) "Generates the `Font', `Size', and `Weight' submenus for the Options menu. This is run the first time that a font-menu is needed for each device. + If you don't like the lazy invocation of this function, you can add it to `create-device-hook' and that will make the font menus respond more quickly when they are selected for the first time. If you add fonts to your system, or if you change your font path, you can call this to re-initialize the menus." - (message "Getting list of fonts from server... ") (if (or noninteractive (not (or device (setq device (selected-device))))) nil + (message "Getting list of fonts from server... ") (call-device-method 'reset-device-font-menus device device debug) (message "Getting list of fonts from server... done."))) @@ -349,9 +368,12 @@ (message "Font %s" (face-font-name 'default))))) +;; #### This should be called `font-menu-maybe-change-face' +;; I wonder if a better API wouldn't (face attribute from to) (defun font-menu-change-face (face from-family from-weight from-size to-family to-weight to-size) + "Maybe update the font of FACE per TO-FAMILY, TO-WEIGHT, and TO-SIZE." (check-type face symbol) (let* ((dcache (device-fonts-cache)) (font-data (font-menu-font-data face dcache)) @@ -360,8 +382,8 @@ (face-weight (aref font-data 3)) (face-slant (aref font-data 4))) - (or face-family - (signal 'error (list "couldn't parse font name for face" face))) + (or face-family + (signal 'error (list "couldn't parse font name for face" face))) ;; If this face matches the old default face in the attribute we ;; are changing, then change it to the new attribute along that diff --text -u 'xemacs-21.5.17/lisp/gtk-font-menu.el' 'xemacs-21.5.18/lisp/gtk-font-menu.el' Index: ./lisp/gtk-font-menu.el --- ./lisp/gtk-font-menu.el Wed Nov 13 03:58:16 2002 +++ ./lisp/gtk-font-menu.el Wed Sep 22 11:05:50 2004 @@ -28,6 +28,11 @@ ;; Boston, MA 02111-1307, USA. ;;; Code: +;; #### - The comment that this file was GTK-ized by Wm Perry is a lie; +;; nothing was done except to rename everything that was x- to gtk-. +;; This is harmless, but we should reintegrate so that GTK can take +;; advantage of fontconfig, too, I think. + ;; #### - implement these... ;; ;;; (defvar font-menu-ignore-proportional-fonts nil @@ -37,7 +42,8 @@ (globally-declare-boundp '(gtk-font-regexp - gtk-font-regexp-foundry-and-family gtk-font-regexp-spacing)) + gtk-font-regexp-foundry-and-family + gtk-font-regexp-spacing)) (defvar gtk-font-menu-registry-encoding nil "Registry and encoding to use with font menu fonts.") @@ -56,7 +62,8 @@ "A regexp matching font families which are uninteresting (e.g. cursor fonts).") (defun hack-font-truename (fn) - "Filter the output of `font-instance-truename' to deal with Japanese fontsets." + ;; #### This is duplicated from x-font-menu.el. + "Filter the output of `font-instance-truename' to deal with font sets." (if (string-match "," (font-instance-truename fn)) (let ((fpnt (nth 8 (split-string (font-instance-name fn) "-"))) (flist (split-string (font-instance-truename fn) ",")) diff --text -u 'xemacs-21.5.17/lisp/gtk-marshal.el' 'xemacs-21.5.18/lisp/gtk-marshal.el' Index: ./lisp/gtk-marshal.el --- ./lisp/gtk-marshal.el Thu May 9 22:49:39 2002 +++ ./lisp/gtk-marshal.el Sun May 2 13:06:52 2004 @@ -1,5 +1,8 @@ +;; +;; To regenerate ../src/emacs-marshals.c just load this file. +;; (defconst name-to-return-type - '(("INT" . "guint") + '(("INT" . "gint") ("CALLBACK" . "GtkCallback") ("OBJECT" . "GtkObject *") ("POINTER" . "void *") @@ -26,7 +29,7 @@ (setq name (get-marshaller-name rval args)) (if (member name defined-marshallers) - (error "Attempe to define the same marshaller more than once! %s" name)) + (error "Attempt to define the same marshaller more than once! %s" name)) (set-buffer (get-buffer-create "emacs-marshals.c")) (goto-char (point-max)) diff --text -u 'xemacs-21.5.17/lisp/gtk-widgets.el' 'xemacs-21.5.18/lisp/gtk-widgets.el' Index: ./lisp/gtk-widgets.el --- ./lisp/gtk-widgets.el Sat May 5 07:42:05 2001 +++ ./lisp/gtk-widgets.el Sat May 15 16:31:44 2004 @@ -35,6 +35,9 @@ '(gtk-import-function-internal gtk-call-function gtk-import-variable-internal gtk-ctree-recurse)) +(gtk-import-function GtkAccelGroup gtk_accel_group_new) + + (gtk-import-function GtkType gtk_accel_label_get_type) (gtk-import-function GtkWidget gtk_accel_label_new GtkString) (gtk-import-function guint gtk_accel_label_get_accel_width GtkAccelLabel) diff --text -u 'xemacs-21.5.17/lisp/help-macro.el' 'xemacs-21.5.18/lisp/help-macro.el' Index: ./lisp/help-macro.el --- ./lisp/help-macro.el Sat May 5 07:42:06 2001 +++ ./lisp/help-macro.el Wed Sep 15 17:30:26 2004 @@ -110,7 +110,11 @@ (substitute-command-keys ,(eval help-line)))) (when three-step-help (message "%s" line-prompt)) - (let* ((help-screen (documentation (quote ,fname))) + (let* ((help-screen + (condition-case nil + (documentation (quote ,fname)) + (void-function "(alias for undefined function)") + (error "(unexpected error from `documention')"))) ;; We bind overriding-local-map for very small ;; sections, *excluding* where we switch buffers and ;; where we execute the chosen help command. diff --text -u 'xemacs-21.5.17/lisp/help.el' 'xemacs-21.5.18/lisp/help.el' Index: ./lisp/help.el --- ./lisp/help.el Thu Nov 6 14:11:15 2003 +++ ./lisp/help.el Wed Sep 15 17:30:26 2004 @@ -461,7 +461,11 @@ "List of help buffers used by `help-register-and-maybe-prune-excess'") (defun help-register-and-maybe-prune-excess (newbuf) - "Register use of a help buffer and possibly kill any excess ones." + "Register help buffer named NEWBUF and possibly kill excess ones." + ;; don't let client code pass us bogus NEWBUF---if it gets in the list, + ;; help can become unusable + (unless (stringp newbuf) + (error 'wrong-type-argument "help buffer name must be string" newbuf)) ;; remove new buffer from list (setq help-buffer-list (remove newbuf help-buffer-list)) ;; maybe kill excess help buffers @@ -487,7 +491,7 @@ (defvar help-buffer-prefix-string "Help" "Initial string to use in constructing help buffer names. -You should never set this directory, only let-bind it.") +You should never set this directly, only let-bind it.") (defun help-buffer-name (name) "Return a name for a Help buffer using string NAME for context." @@ -528,13 +532,18 @@ (put 'help-window-config 'permanent-local t) (defmacro with-displaying-temp-buffer (name &rest body) - "Form which makes a help buffer with given NAME and evaluates BODY there. + "Make a help buffer with given NAME and evaluate BODY, sending stdout there. Use this function for displaying information in temporary buffers, where the user will typically view the information and then exit using \\<temp-buffer-mode-map>\\[help-mode-quit]. -The buffer is put into the mode specified in `mode-for-temp-buffer'." +On exit from this form, the buffer is put into the mode specified in +`mode-for-temp-buffer' and displayed, typically in a popup window. Ie, +the buffer is a scratchpad which is displayed all at once in formatted +form. + +N.B. Write to this buffer with functions like `princ', not `insert'." `(let* ((winconfig (current-window-configuration)) (was-one-window (one-window-p)) (buffer-name ,name) @@ -1002,17 +1011,6 @@ ) help-map) -(defmacro with-syntax-table (syntab &rest body) - "Evaluate BODY with the SYNTAB as the current syntax table." - `(let ((stab (syntax-table))) - (unwind-protect - (progn - (set-syntax-table (copy-syntax-table ,syntab)) - ,@body) - (set-syntax-table stab)))) -(put 'with-syntax-table 'lisp-indent-function 1) -(put 'with-syntax-table 'edebug-form-spec '(form body)) - (defun function-called-at-point () "Return the function which is called by the list containing point. If that gives no function, return the function whose name is around point. @@ -1216,7 +1214,8 @@ (let ((doc (condition-case nil (or (documentation function) (gettext "not documented")) - (void-function "")))) + (void-function "(alias for undefined function)") + (error "(unexpected error from `documention')")))) (if (and strip-arglist (string-match "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'" doc)) (setq doc (substring doc 0 (match-beginning 0)))) @@ -1326,7 +1325,10 @@ (documentation-property sym 'variable-documentation t))) (fun (and sym (fboundp sym) - (documentation sym t)))) + (condition-case nil + (documentation sym t) + (void-function "(alias for undefined function)") + (error "(unexpected error from `documention')"))))) (when (or var fun) (let ((ex (make-extent b e))) (require 'hyper-apropos) diff --text -u 'xemacs-21.5.17/lisp/hyper-apropos.el' 'xemacs-21.5.18/lisp/hyper-apropos.el' Index: ./lisp/hyper-apropos.el --- ./lisp/hyper-apropos.el Sat Feb 8 11:29:52 2003 +++ ./lisp/hyper-apropos.el Wed Sep 15 17:30:27 2004 @@ -342,8 +342,10 @@ (function-obsoleteness-doc fn) ;; A symbol's function slot can point to an unbound symbol. ;; In that case, `documentation' will fail. - (ignore-errors - (documentation fn))))) + (condition-case nil + (documentation fn) + (void-function "(alias for undefined function)") + (error "(unexpected error from `documention')"))))) (if (and doc (string-match @@ -771,7 +773,12 @@ local (current-local-map) global (current-global-map) obsolete (get symbol 'byte-obsolete-info) - doc (or (documentation symbol) "function not documented")) + doc (or (condition-case nil + (documentation symbol) + (void-function + "(alias for undefined function)") + (error "(unexpected error from `documention')")) + "function not documented")) (save-excursion (set-buffer hyper-apropos-help-buf) (goto-char (point-max)) diff --text -u 'xemacs-21.5.17/lisp/isearch-mode.el' 'xemacs-21.5.18/lisp/isearch-mode.el' Index: ./lisp/isearch-mode.el --- ./lisp/isearch-mode.el Sat Aug 2 17:42:11 2003 +++ ./lisp/isearch-mode.el Mon May 10 16:04:34 2004 @@ -431,7 +431,10 @@ back to what has been found successfully. \\[isearch-abort] when search is successful aborts and moves point to\ - starting point. + starting point, + leaving the search string at the head of the search ring. Note that this + behavior differs from GNU Emacs, which forgets the current search string + on abort regardless of success or failure. Also supported is a search ring of the previous 16 search strings. Type \\[isearch-ring-advance] to search for the next item in the search ring. @@ -864,6 +867,11 @@ (defun isearch-abort () "Abort incremental search mode if searching is successful, signaling quit. +Leave the search string at the head of the search ring. Note that this +behavior differs from GNU Emacs, which forgets the current search string +on abort regardless of success or failure. Use `isearch-cancel' to abort +and forget regardless of success or failure. + Otherwise, revert to previous successful search and continue searching. Use `isearch-exit' to quit without signaling." (interactive) @@ -874,7 +882,7 @@ ;; and really do quit. (progn (goto-char isearch-opoint) (setq isearch-success nil) - (isearch-done t) ; exit isearch + (isearch-done) ; exit and push target string (signal 'quit '(isearch))) ; and pass on quit signal ;; If search is failing, or has an incomplete regexp, ;; rub out until it is once more successful. diff --text -u 'xemacs-21.5.17/lisp/itimer.el' 'xemacs-21.5.18/lisp/itimer.el' Index: ./lisp/itimer.el --- ./lisp/itimer.el Sun Jun 10 19:42:23 2001 +++ ./lisp/itimer.el Sun Sep 26 11:20:31 2004 @@ -25,11 +25,13 @@ ;; `itimer' feature means Emacs-Lisp programmers get: ;; itimerp ;; itimer-live-p +;; itimer-name ;; itimer-value ;; itimer-restart ;; itimer-function ;; itimer-uses-arguments ;; itimer-function-arguments +;; set-itimer-name ;; set-itimer-value ;; set-itimer-restart ;; set-itimer-function @@ -128,9 +130,9 @@ (list 'list ''itimerp var))))) (defmacro check-itimer-coerce-string (var) - "If VAR is not bound to a string, look up the itimer that it names and + "If VAR is bound to a string, look up the itimer that it names and bind VAR to it. Otherwise, if VAR is not bound to an itimer, signal -wrong-type-argument. This is a macro." +`wrong-type-argument'. This is a macro." (list 'setq var (list 'cond (list (list 'itimerp var) var) @@ -140,7 +142,7 @@ (defmacro check-nonnegative-number (var) "If VAR is not bound to a number, signal `wrong-type-argument'. -If VAR is not bound to a positive number, signal args-out-of-range. +If VAR is not bound to a positive number, signal `args-out-of-range'. This is a macro." (list 'setq var (list 'if (list 'not (list 'numberp var)) @@ -218,6 +220,16 @@ (check-itimer itimer) (nth 7 itimer)) +(defun set-itimer-name (itimer name) + "Set the name of ITIMER to be NAME. +NAME is an identifier for the itimer. It must be a string. If an active +itimer already exists with this name, an error is signaled." + (check-string name) + (and (itimer-live-p itimer) + (get-itimer name) + (error "itimer named \"%s\" already existing and activated" name)) + (setcar itimer name)) + (defun set-itimer-value (itimer value) "Set the timeout value of ITIMER to be VALUE. Itimer will expire in this many seconds. @@ -406,6 +418,14 @@ (error "itimer named \"%s\" already existing and activated" (itimer-name itimer)))) (let ((inhibit-quit t)) + (if itimer-timer + ;; Modify the itimer timeout value as if it were begun + ;; at the last time when the itimer driver was woken up. + (set-itimer-value + itimer + (+ (itimer-value itimer) + (itimer-time-difference (current-time) + itimer-timer-last-wakeup)))) ;; add the itimer to the global list (setq itimer-list (cons itimer itimer-list)) ;; If the itimer process is scheduled to wake up too late for diff --text -u 'xemacs-21.5.17/lisp/lisp-mode.el' 'xemacs-21.5.18/lisp/lisp-mode.el' Index: ./lisp/lisp-mode.el --- ./lisp/lisp-mode.el Thu Apr 24 14:29:12 2003 +++ ./lisp/lisp-mode.el Mon Jun 7 08:58:44 2004 @@ -428,8 +428,8 @@ (defcustom eval-interactive-verbose t "*Non-nil means that interactive evaluation can print messages. The messages are printed when the expression is treated differently -using `\\[eval-last-sexp]' and `\\[eval-defun]' than it than it would have been -treated noninteractively. +using `\\[eval-last-sexp]' and `\\[eval-defun]' than it would have +been treated noninteractively. The printed messages are \"defvar treated as defconst\" and \"defcustom evaluation forced\". See `eval-interactive' for more details." diff --text -u 'xemacs-21.5.17/lisp/list-mode.el' 'xemacs-21.5.18/lisp/list-mode.el' Index: ./lisp/list-mode.el --- ./lisp/list-mode.el Fri Apr 13 03:21:29 2001 +++ ./lisp/list-mode.el Wed May 26 07:13:28 2004 @@ -330,19 +330,13 @@ (let ((win-width (or cl-window-width (if bufferp - ;; This needs fixing for the case of windows - ;; that aren't the same width's the frame. - ;; Sadly, the window it will appear in is not known - ;; until after the text has been made. - ;; We have to use last-nonminibuf-frame here ;; and not selected-frame because if a ;; minibuffer-only frame is being used it will ;; be the selected-frame at the point this is ;; run. We keep the selected-frame call around ;; just in case. - (frame-width (or (last-nonminibuf-frame) - (selected-frame))) + (window-width (get-lru-window (last-nonminibuf-frame))) 80)))) (let ((count 0) (max-width 0) diff --text -u 'xemacs-21.5.17/lisp/menubar-items.el' 'xemacs-21.5.18/lisp/menubar-items.el' Index: ./lisp/menubar-items.el --- ./lisp/menubar-items.el Thu Mar 27 21:57:42 2003 +++ ./lisp/menubar-items.el Mon Apr 19 17:54:50 2004 @@ -1598,7 +1598,7 @@ (find-file el-file) (or (eq major-mode 'emacs-lisp-mode) (emacs-lisp-mode)))] - ["%_Save Options to Init File" customize-save-customized] + ["%_Save Options to Custom File" customize-save-customized] ) ("%_Buffers" diff --text -u 'xemacs-21.5.17/lisp/minibuf.el' 'xemacs-21.5.18/lisp/minibuf.el' Index: ./lisp/minibuf.el --- ./lisp/minibuf.el Tue Jun 4 15:04:22 2002 +++ ./lisp/minibuf.el Sat Apr 17 18:59:24 2004 @@ -319,6 +319,7 @@ (setq buffer-backed-up nil) (setq buffer-auto-save-file-name nil) (set-buffer-dedicated-frame buffer nil) + (set-marker (mark-marker t buffer) nil) buffer)) (defvar minibuffer-history-variable 'minibuffer-history diff --text -u 'xemacs-21.5.17/lisp/mule/ethio-util.el' 'xemacs-21.5.18/lisp/mule/ethio-util.el' Index: ./lisp/mule/ethio-util.el --- ./lisp/mule/ethio-util.el Thu Jan 9 22:09:04 2003 +++ ./lisp/mule/ethio-util.el Mon Jun 7 08:58:46 2004 @@ -431,7 +431,7 @@ and `ethio-secondary-language' specifies the secondary. If the 3rd parameter SECONDARY is given and non-nil, assume the region -begins begins with the secondary language; otherwise with the primary +begins with the secondary language; otherwise with the primary language. If the 4th parameter FORCE is given and non-nil, perform conversion diff --text -u 'xemacs-21.5.17/lisp/mule/mule-charset.el' 'xemacs-21.5.18/lisp/mule/mule-charset.el' Index: ./lisp/mule/mule-charset.el --- ./lisp/mule/mule-charset.el Mon Feb 17 23:51:02 2003 +++ ./lisp/mule/mule-charset.el Wed Sep 22 11:25:06 2004 @@ -167,8 +167,8 @@ (defun make-translation-table (&rest args) "Make a translation table from arguments. -A translation table is a char table intended for for character -translation in CCL programs. +A translation table is a char table intended for character translation +in CCL programs. Each argument is a list of elemnts of the form (FROM . TO), where FROM is a character to be translated to TO. diff --text -u 'xemacs-21.5.17/lisp/newcomment.el' 'xemacs-21.5.18/lisp/newcomment.el' Index: ./lisp/newcomment.el Prereq: 1.1 --- ./lisp/newcomment.el Sun Mar 2 18:38:40 2003 +++ ./lisp/newcomment.el Mon Jun 7 08:58:44 2004 @@ -5,7 +5,7 @@ ;; Author: code extracted from Emacs-20's simple.el ;; Maintainer: Stefan Monnier <monnier@cs.yale.edu> ;; Keywords: comment uncomment -;; Revision: $Id: newcomment.el,v 1.1 2003/03/02 09:38:40 ben Exp $ +;; Revision: $Id: newcomment.el,v 1.2 2004/06/06 23:58:44 adrian Exp $ ;; This file is part of GNU Emacs. @@ -714,7 +714,7 @@ (forward-line 1) (re-search-forward sre (line-end-position) t)) (replace-match "" t t nil (if (match-end 2) 2 1))))) - ;; Go the the end for the next comment. + ;; Go to the end for the next comment. (goto-char (point-max))))) (set-marker end nil)))) diff --text -u 'xemacs-21.5.17/lisp/package-get.el' 'xemacs-21.5.18/lisp/package-get.el' Index: ./lisp/package-get.el --- ./lisp/package-get.el Fri Mar 5 06:06:59 2004 +++ ./lisp/package-get.el Sat Jun 26 06:24:36 2004 @@ -854,6 +854,36 @@ t) nil))) +(defun package-get-info-name-array () + "Internal, used by `package-get-info'." + (let ((pkgs package-get-base) + names) + (while pkgs + (setq names (let ((name (caar pkgs))) + (push (cons (format "%s" name) name) names))) + (setq pkgs (cdr pkgs))) + names)) + +(defconst package-get-info-info-array + '(("standards-version" . standards-version) + ("version" . version) + ("author-version" . author-version) + ("date" . date) + ("build-date" . build-date) + ("maintainer" . maintainer) + ("distribution" . distribution) + ("priority" . priority) + ("category" . category) + ("dump" . dump) + ("description" . description) + ("filename" . filename) + ("md5sum" . md5sum) + ("size" . size) + ("provides" . provides) + ("requires" . requires) + ("type" . type)) + "Internal, used by `package-get-info'.") + ;;;###autoload (defun package-get-info (package information &optional arg remote) "Get information about a package. @@ -884,21 +914,40 @@ requires A list of packages that this package requires. type Can be either \"regular\" or \"single-file\". -If optional argument ARG is non-nil insert INFORMATION into current -buffer at point. This is very useful for doing things like inserting -a maintainer's email address into a mail buffer. +Optional argument ARG is a prefix arg. Without a value, ie, just +doing `C-u M-x package-get-info' will insert the information at point +in the current buffer using a local package list. + +ARG can also be given a value of 2 or 3. If 2, use a remote package +list, displaying the information in the minubuffer. If 3, use a remote +package list and insert the information at point in the current buffer. If optional argument REMOTE is non-nil use a package list from a -remote site. For this to work `package-get-remote' must be non-nil. +remote site. + +To use a remote package list, either via the prefix argument ARG or +via the REMOTE argument `package-get-remote' must be non-nil. If +`package-get-remote' is nil, the local package list will be used. If this function is called interactively it will display INFORMATION in the minibuffer." - (interactive "SPackage: \nSInfo: \nP") - (if remote - (package-get-require-base t) - (package-get-require-base nil)) - (let ((all-pkgs package-get-base) - info) + (interactive "i\ni\np") + (if (and package-get-remote + (or (eq arg 2) + (eq arg 3) + remote)) + (package-get-require-base t) + (package-get-require-base nil)) + (let ((all-pkgs package-get-base) + (package (or package + (intern (completing-read + "Package: " + (package-get-info-name-array) nil t)))) + (information (or information + (intern (completing-read + "Info: " + package-get-info-info-array nil t)))) + info) (loop until (equal package (caar all-pkgs)) do (setq all-pkgs (cdr all-pkgs)) do (if (not all-pkgs) @@ -906,14 +955,13 @@ (format "%s is not a valid package" package)))) (setq info (plist-get (cadar all-pkgs) information)) (if (interactive-p) - (if arg + (if (or (eq arg 3) + (eq arg 4)) (insert (format "%s" info)) (if (package-get-key package :version) (message "%s" info) (message "%s (Package: %s is not installed)" info package))) - (if arg - (insert (format "%s" info)) - info)))) + info))) ;;;###autoload (defun package-get-list-packages-where (item field &optional arg) @@ -941,7 +989,19 @@ Optional Argument ARG, a prefix arg, insert output at point in the current buffer." - (interactive "SList packages that have (item): \nSin their (field): \nP") + (interactive + (list (intern (read-string "List packages that contain (text): ")) + (intern (completing-read "in their package-info field (completion available): " + '(("description" . description) + ("category" . category) + ("maintainer" . maintainer) + ("build-date" . build-date) + ("date" . date) + ("type" . type) + ("requires" . requires) + ("provides" . provides) + ("priority" . priority)) nil t)) + current-prefix-arg)) (package-get-require-base nil) (let ((pkgs package-get-base) (strings '(description category maintainer build-date date)) diff --text -u 'xemacs-21.5.17/lisp/package-ui.el' 'xemacs-21.5.18/lisp/package-ui.el' Index: ./lisp/package-ui.el --- ./lisp/package-ui.el Tue Oct 14 03:53:24 2003 +++ ./lisp/package-ui.el Tue Jun 22 03:26:18 2004 @@ -480,8 +480,7 @@ (if (featurep 'balloon-help) (progn (setq balloon (format " -Package Information: [For package: \"%s\"] -================ +Package Information: [For package: \"%s\"]\n================ Installed Upstream Ver: %s Available Upstream Ver: %s Maintainer : %s Released : %s diff --text -u 'xemacs-21.5.17/lisp/packages.el' 'xemacs-21.5.18/lisp/packages.el' Index: ./lisp/packages.el --- ./lisp/packages.el Mon Apr 14 12:40:27 2003 +++ ./lisp/packages.el Tue Sep 7 09:08:19 2004 @@ -140,7 +140,7 @@ ((< (package-get-key name :version) version) (error 'search-failed (format "Need version %g of package %s, got version %g" - version name (cdr pkg)))) + version name (package-get-key name :version)))) (t t)))) (defun package-delete-name (name) diff --text -u 'xemacs-21.5.17/lisp/specifier.el' 'xemacs-21.5.18/lisp/specifier.el' Index: ./lisp/specifier.el --- ./lisp/specifier.el Fri Jan 23 19:00:30 2004 +++ ./lisp/specifier.el Wed Sep 22 11:05:51 2004 @@ -347,7 +347,7 @@ with the VALUE. Tags are symbols (usually naming device types, such as `x' and `tty', or device classes, such as `color', `mono', and `grayscale'); specifying a TAG-SET restricts the scope of VALUE to -devices that match all specified tags. (You can also create your +devices that match all specified tags. (You can also create your own tags using `define-specifier-tag', and use them to identify specifications added by you, so you can remove them later.) @@ -367,7 +367,7 @@ nil (meaning no specs) and `set-specifier' will interpret the `nil' as meaning \"I'm adding a global instantiator and its value is `nil'\"), or in strange cases where there is an ambiguity between a spec-list -and an inst-list, etc. (The built-in specifier types are designed +and an inst-list, etc. (The built-in specifier types are designed in such a way as to avoid any such ambiguities.)" ;; backward compatibility: the old function had HOW-TO-ADD as the diff --text -u 'xemacs-21.5.17/lisp/startup.el' 'xemacs-21.5.18/lisp/startup.el' Index: ./lisp/startup.el --- ./lisp/startup.el Thu Mar 27 21:57:42 2003 +++ ./lisp/startup.el Thu Sep 23 14:44:37 2004 @@ -134,13 +134,13 @@ (defvar site-start-file "site-start" "File containing site-wide run-time initializations. -This file is loaded at run-time before `.emacs'. It -contains inits that need to be in place for the entire site, but +It is loaded at run-time before the user's init file (see `user-init-file'). +It contains inits that need to be in place for the entire site, but which, due to their higher incidence of change, don't make sense to -load into XEmacs' dumped image. Thus, the run-time load order is: +load into XEmacs's dumped image. Thus, the run-time load order is: 1. file described in this variable, if non-nil; - 2. `.emacs'; + 2. the file computed by `find-user-init-file'; 3. `/path/to/xemacs/lisp/default.el'. Don't use the `site-start.el' file for things some users may not like. @@ -898,8 +898,6 @@ (find-user-init-file user-init-directory))) (if (not custom-file) (setq custom-file (make-custom-file-name user-init-file))) - ;; #### should test load-user-init-file-p here, not in load-init-file - ;; see comment there (if (and user-init-file (file-readable-p user-init-file)) (load user-init-file t t t)) @@ -915,13 +913,16 @@ ;; Don't you dare turn this off for anyone except yourself. (load "default" t t)))) +;;; #### move this comment into a docstring. See site-init-file for some +;;; description of what it does. Substitute a pointer to this function in +;;; site-init-file's docstring. ;;; Load user's init file and default ones. (defun load-init-file () (run-hooks 'before-init-hook) ;; Run the site-start library if it exists. The point of this file is - ;; that it is run before .emacs. There is no point in doing this after - ;; .emacs; that is useless. + ;; that it is run before the user's init file. There is no point in + ;; doing this after the user's init file; that is useless. (when site-start-file (load site-start-file t t)) @@ -934,8 +935,6 @@ (debug-on-error-initial (if (eq init-file-debug t) 'startup init-file-debug))) (let ((debug-on-error debug-on-error-initial)) - ;; #### I believe this test is incorrect, it leads to custom-file - ;; (at least) being undefined (if (and load-user-init-file-p init-file-debug) (progn ;; Do this without a condition-case if the user wants to debug. diff --text -u 'xemacs-21.5.17/lisp/subr.el' 'xemacs-21.5.18/lisp/subr.el' Index: ./lisp/subr.el --- ./lisp/subr.el Fri Feb 6 01:54:59 2004 +++ ./lisp/subr.el Thu Jun 17 20:29:39 2004 @@ -521,7 +521,14 @@ (buffer-string) (kill-buffer nil))))) -;; FSF 21.2. +(defmacro with-local-quit (&rest body) + "Execute BODY with `inhibit-quit' temporarily bound to nil." + `(condition-case nil + (let ((inhibit-quit nil)) + ,@body) + (quit (setq quit-flag t)))) + +;; FSF 21.3. ; (defmacro combine-after-change-calls (&rest body) ; "Execute BODY, but don't call the after-change functions till the end. @@ -535,11 +542,41 @@ ; Do not alter `after-change-functions' or `before-change-functions' ; in BODY." +; (declare (indent 0) (debug t)) ; `(unwind-protect ; (let ((combine-after-change-calls t)) ; . ,body) ; (combine-after-change-execute))) + +(defvar delay-mode-hooks nil + "If non-nil, `run-mode-hooks' should delay running the hooks.") +(defvar delayed-mode-hooks nil + "List of delayed mode hooks waiting to be run.") +(make-variable-buffer-local 'delayed-mode-hooks) +(put 'delay-mode-hooks 'permanent-local t) + +(defun run-mode-hooks (&rest hooks) + "Run mode hooks `delayed-mode-hooks' and HOOKS, or delay HOOKS. +Execution is delayed if `delay-mode-hooks' is non-nil. +Major mode functions should use this." + (if delay-mode-hooks + ;; Delaying case. + (dolist (hook hooks) + (push hook delayed-mode-hooks)) + ;; Normal case, just run the hook as before plus any delayed hooks. + (setq hooks (nconc (nreverse delayed-mode-hooks) hooks)) + (setq delayed-mode-hooks nil) + (apply 'run-hooks hooks))) + +(defmacro delay-mode-hooks (&rest body) + "Execute BODY, but delay any `run-mode-hooks'. +Only affects hooks run in the current buffer." + `(progn + (make-local-variable 'delay-mode-hooks) + (let ((delay-mode-hooks t)) + ,@body))) + (defmacro with-syntax-table (table &rest body) "Evaluate BODY with syntax table of current buffer set to a copy of TABLE. The syntax table of the current buffer is saved, BODY is evaluated, and the @@ -632,14 +669,14 @@ the substrings between the splitting points are collected as a list, which is returned. -If SEPARATORS is non-nil, it should be a regular expression matching text -which separates, but is not part of, the substrings. If nil it defaults to +If SEPARATORS is non-`nil', it should be a regular expression matching text +which separates, but is not part of, the substrings. If `nil' it defaults to `split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and -OMIT-NULLS is forced to t. +OMIT-NULLS is forced to `t'. -If OMIT-NULLs is t, zero-length substrings are omitted from the list \(so +If OMIT-NULLS is `t', zero-length substrings are omitted from the list \(so that for the default value of SEPARATORS leading and trailing whitespace -are effectively trimmed). If nil, all zero-length substrings are retained, +are effectively trimmed). If `nil', all zero-length substrings are retained, which correctly parses CSV format, for example. Note that the effect of `(split-string STRING)' is the same as @@ -647,7 +684,7 @@ case that you wish to retain zero-length substrings when splitting on whitespace, use `(split-string STRING split-string-default-separators nil)'. -Modifies the match data; use `save-match-data' if necessary." +Modifies the match data when successful; use `save-match-data' if necessary." (let ((keep-nulls (not (if separators omit-nulls t))) (rexp (or separators split-string-default-separators)) diff --text -u 'xemacs-21.5.17/lisp/term/tvi970.el' 'xemacs-21.5.18/lisp/term/tvi970.el' Index: ./lisp/term/tvi970.el --- ./lisp/term/tvi970.el Sun Dec 22 05:48:42 1996 +++ ./lisp/term/tvi970.el Mon Jun 7 08:58:46 2004 @@ -44,7 +44,7 @@ ;; ("\eOR" [kp-f3]) ;; ("\eOS" [kp-f4]) - ;; These might br set by terminfo + ;; These might be set by terminfo ("\e[H" [home]) ("\e[Z" [backtab]) ("\e[i" [print]) @@ -59,7 +59,7 @@ ("\eOn" [kp-decimal]) ("\eOM" [kp-enter]) - ;; These won't be set up by either either + ;; These won't be set up by either ("\e[K" [key-eol]) ;; Not an X keysym ("\e[J" [key-eos]) ;; Not an X keysym ("\e[2J" [key-clear]) ;; Not an X keysym diff --text -u 'xemacs-21.5.17/lisp/unicode.el' 'xemacs-21.5.18/lisp/unicode.el' Index: ./lisp/unicode.el --- ./lisp/unicode.el Fri Feb 21 15:56:47 2003 +++ ./lisp/unicode.el Wed Sep 22 11:05:51 2004 @@ -31,6 +31,7 @@ ; ;; Subsets of Unicode. +; #### what is this bogosity ... "chars 96, final ?2" !!?! ; (make-charset 'mule-unicode-2500-33ff ; "Unicode characters of the range U+2500..U+33FF." ; '(dimension @@ -124,7 +125,8 @@ ;; "CP950.TXT" ;; "GB12345.TXT" ("GB2312.TXT" chinese-gb2312) - ;; "HANGUL.TXT" + ;; "HANGUL.TXT" + ;; #### shouldn't JIS X 0201's upper limit be 7f? ("JIS0201.TXT" latin-jisx0201 #x21 #x80) ("JIS0201.TXT" katakana-jisx0201 #xA0 #xFF #x-80) ("JIS0208.TXT" japanese-jisx0208 nil nil nil ignore-first-column) @@ -139,6 +141,7 @@ ;; "SHIFTJIS.TXT" ) ("unicode/mule-ucs" + ;; #### we don't support surrogates?!?? ;; use these instead of the above ones once we support surrogates ;;("chinese-cns11643-1.txt" chinese-cns11643-1) ;;("chinese-cns11643-2.txt" chinese-cns11643-2) @@ -249,6 +252,8 @@ "UCS-4 Little Endian" '(mnemonic "UCS4-LE" documentation + ;; #### I don't think this is permitted by ISO 10646, only Unicode. + ;; Call it UTF-32 instead? "Little-endian version of UCS-4 Unicode encoding. See `ucs-4' coding system." type ucs-4 little-endian t)) @@ -259,7 +264,7 @@ '(mnemonic "UTF8" documentation "UTF-8 Unicode encoding -- ASCII-compatible 8-bit variable-width encoding -with the same principles as the Mule-internal encoding: +sharing the following principles with the Mule-internal encoding: -- All ASCII characters (codepoints 0 through 127) are represented by themselves (i.e. using one byte, with the same value as the diff --text -u 'xemacs-21.5.17/lisp/widgets-gtk.el' 'xemacs-21.5.18/lisp/widgets-gtk.el' Index: ./lisp/widgets-gtk.el --- ./lisp/widgets-gtk.el Sat Feb 2 22:39:59 2002 +++ ./lisp/widgets-gtk.el Wed Jul 7 21:00:59 2004 @@ -90,11 +90,11 @@ (defun gtk-widget-instantiate-notebook-internal (plist instance) (let ((widget (gtk-notebook-new)) (items (plist-get plist :items))) - (while items - (gtk-notebook-append-page widget - (gtk-vbox-new nil 3) - (gtk-label-new (aref (car items) 0))) - (setq items (cdr items))) +; (while items +; (gtk-notebook-append-page widget +; (gtk-vbox-new nil 3) +; (gtk-label-new (aref (car items) 0))) +; (setq items (cdr items))) widget)) (defun gtk-widget-instantiate-progress-internal (plist instance) @@ -135,11 +135,11 @@ (plist (cdr (map 'list 'identity instantiator))) (widget (funcall (or (get type 'instantiator) 'ignore) plist instance))) - (add-timeout 0.1 (lambda (obj) - (gtk-widget-set-style obj - (gtk-widget-get-style - (frame-property nil 'text-widget)))) - widget) +; (add-timeout 0.1 (lambda (obj) +; (gtk-widget-set-style obj +; (gtk-widget-get-style +; (frame-property nil 'text-widget)))) +; widget) widget)) (defun gtk-widget-property-internal () diff --text -u 'xemacs-21.5.17/lisp/window-xemacs.el' 'xemacs-21.5.18/lisp/window-xemacs.el' Index: ./lisp/window-xemacs.el --- ./lisp/window-xemacs.el Mon Sep 8 04:46:32 2003 +++ ./lisp/window-xemacs.el Sun Aug 22 02:05:51 2004 @@ -309,7 +309,10 @@ (setq window-min-width (window-configuration-min-width configuration)) (setq window-min-height (window-configuration-min-height configuration)) - (set-buffer (window-configuration-current-buffer configuration))) + (let ((buffer (window-configuration-current-buffer configuration))) + (if (buffer-live-p buffer) + (set-buffer buffer) + (set-buffer (car (buffer-list)))))) (defun set-window-configuration-frame-size (configuration) "Restore the frame size of a window configuration." diff --text -u 'xemacs-21.5.17/lisp/x-font-menu.el' 'xemacs-21.5.18/lisp/x-font-menu.el' Index: ./lisp/x-font-menu.el --- ./lisp/x-font-menu.el Sat Sep 20 10:14:25 2003 +++ ./lisp/x-font-menu.el Wed Sep 22 11:05:51 2004 @@ -1,4 +1,4 @@ -;; x-font-menu.el --- Managing menus of X fonts. +;;; x-font-menu.el --- Managing menus of X fonts. ;; Copyright (C) 1994 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. @@ -36,7 +36,8 @@ (globally-declare-boundp '(x-font-regexp - x-font-regexp-foundry-and-family x-font-regexp-spacing)) + x-font-regexp-foundry-and-family + x-font-regexp-spacing)) (globally-declare-fboundp '(charset-registry)) @@ -55,10 +56,14 @@ ; "Axcob" -> "Applix Courier Bold", etc. ) "\\|") - "A regexp matching font families which are uninteresting (e.g. cursor fonts).") + "Regexp matching font families which should not be menu-selectable. +E.g. cursor fonts.") (defun hack-font-truename (fn) - "Filter the output of `font-instance-truename' to deal with Japanese fontsets." + ;; #### Are "font sets" XFontSets? + ;; #### Is this useful if not configure'd --with-xfs? + ;; #### This is duplicated in gtk-font-menu.el. + "Filter the output of `font-instance-truename' to deal with font sets." (if (string-match "," (font-instance-truename fn)) (let ((fpnt (nth 8 (split-string (font-instance-name fn) "-"))) (flist (split-string (font-instance-truename fn) ",")) diff --text -u 'xemacs-21.5.17/lwlib/ChangeLog' 'xemacs-21.5.18/lwlib/ChangeLog' Index: ./lwlib/ChangeLog --- ./lwlib/ChangeLog Mon Mar 22 18:23:31 2004 +++ ./lwlib/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,52 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + +2004-09-27 Jerry James <james@xemacs.org> + + * lwlib-Xm.c (xm_update_label): + (xm_update_progress): + (activate_button): + (make_dialog): + (mark_dead_instance_destroyed): + (xm_nosel_callback): + Mark more unused parameters with the UNUSED macro. + +2004-09-14 Jerry James <james@xemacs.org> + + * Makefile.in.in (cppflags): Make compiler.h available. + * config.h.in: Include compiler.h. + * lwlib.c (max): Remove; now defined in compiler.h. + (merge_widget_value): Fix misplaced `change' computation. + * xlwcheckbox.c (DrawCheck): conditionalize declaration and + assignment of variable bw like its use. + * xlwtabs.c (TabsResize): Comment out declaration and assignment + of variable tab, whose use is commented out. + + * lwlib-Xaw.c: + * lwlib-Xlw.c: + * lwlib-Xm.c: + * lwlib-utils.c: + * lwlib.c: + * xlwcheckbox.c: + * xlwgauge.c: + * xlwgcs.c: + * xlwmenu.c: + * xlwradio.c: + * xlwscrollbar.c: + * xlwtabs.c: + Mark unused parameters with the UNUSED macro. + +2004-09-14 Jerry James <james@xemacs.org> + + * xlwgauge.c (GaugeConvert): Fix type-punning warning. + +2004-04-23 Jerry James <james@xemacs.org> + + * xlwradio.c (RadioExpose): Do not blindly copy one GC over + another. It messes up the ref counts and is wrong for radio + buttons in any case. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. diff --text -u 'xemacs-21.5.17/lwlib/Makefile.in.in' 'xemacs-21.5.18/lwlib/Makefile.in.in' Index: ./lwlib/Makefile.in.in --- ./lwlib/Makefile.in.in Wed Jan 28 20:20:40 2004 +++ ./lwlib/Makefile.in.in Tue Sep 21 04:19:16 2004 @@ -54,7 +54,7 @@ c_switch_all=@c_switch_all@ -cppflags = $(CPPFLAGS) -I. $(c_switch_all) +cppflags = $(CPPFLAGS) -I. -I$(srcdir)/../src $(c_switch_all) cflags = $(CFLAGS) $(cppflags) #ifdef SOLARIS2 diff --text -u 'xemacs-21.5.17/lwlib/config.h.in' 'xemacs-21.5.18/lwlib/config.h.in' Index: ./lwlib/config.h.in --- ./lwlib/config.h.in Fri Apr 13 03:21:51 2001 +++ ./lwlib/config.h.in Tue Sep 21 04:19:16 2004 @@ -24,6 +24,7 @@ #define _LWLIB_CONFIG_H_ #include "../src/config.h" +#include "../src/compiler.h" #undef NEED_MOTIF #undef NEED_ATHENA diff --text -u 'xemacs-21.5.17/lwlib/lwlib-Xaw.c' 'xemacs-21.5.18/lwlib/lwlib-Xaw.c' Index: ./lwlib/lwlib-Xaw.c --- ./lwlib/lwlib-Xaw.c Fri Apr 13 03:21:51 2001 +++ ./lwlib/lwlib-Xaw.c Tue Sep 21 04:19:16 2004 @@ -122,7 +122,7 @@ void xaw_update_one_widget (widget_instance *instance, Widget widget, - widget_value *val, Boolean deep_p) + widget_value *val, Boolean UNUSED (deep_p)) { if (0) ; @@ -258,7 +258,7 @@ } void -xaw_popup_menu (Widget widget, XEvent *event) +xaw_popup_menu (Widget UNUSED (widget), XEvent *UNUSED (event)) { /* An Athena menubar has not been implemented. */ return; @@ -344,7 +344,7 @@ static Widget make_dialog (const char* name, Widget parent, Boolean pop_up_p, - const char* shell_title, const char* icon_name, + const char* shell_title, const char* UNUSED (icon_name), Boolean text_input_slot, Boolean radio_box, Boolean list, int left_buttons, int right_buttons) @@ -587,7 +587,8 @@ #ifdef LWLIB_DIALOGS_ATHENA static XtActionProc -wm_delete_window (Widget shell, XtPointer closure, XtPointer call_data) +wm_delete_window (Widget shell, XtPointer UNUSED (closure), + XtPointer UNUSED (call_data)) { LWLIB_ID id; Widget *kids = 0; diff --text -u 'xemacs-21.5.17/lwlib/lwlib-Xlw.c' 'xemacs-21.5.18/lwlib/lwlib-Xlw.c' Index: ./lwlib/lwlib-Xlw.c --- ./lwlib/lwlib-Xlw.c Sun Jan 12 19:45:53 2003 +++ ./lwlib/lwlib-Xlw.c Tue Sep 21 04:19:16 2004 @@ -266,7 +266,7 @@ } static void -xlw_update_scrollbar (widget_instance *instance, Widget widget, +xlw_update_scrollbar (widget_instance *UNUSED (instance), Widget widget, widget_value *val) { if (val->scrollbar_data) @@ -392,8 +392,8 @@ return tab; } -static void build_tabs_in_widget (widget_instance* instance, Widget widget, - widget_value* val) +static void build_tabs_in_widget (widget_instance* UNUSED (instance), + Widget widget, widget_value* val) { widget_value* cur = val; for (cur = val; cur; cur = cur->next) @@ -533,7 +533,7 @@ void xlw_update_one_widget (widget_instance* instance, Widget widget, - widget_value* val, Boolean deep_p) + widget_value* val, Boolean UNUSED (deep_p)) { WidgetClass class_ = XtClass (widget); @@ -570,14 +570,13 @@ } void -xlw_update_one_value (widget_instance* instance, Widget widget, - widget_value* val) +xlw_update_one_value (widget_instance* UNUSED (instance), + Widget UNUSED (widget), widget_value* UNUSED (val)) { - return; } void -xlw_pop_instance (widget_instance* instance, Boolean up) +xlw_pop_instance (widget_instance* UNUSED (instance), Boolean UNUSED (up)) { } diff --text -u 'xemacs-21.5.17/lwlib/lwlib-Xm.c' 'xemacs-21.5.18/lwlib/lwlib-Xm.c' Index: ./lwlib/lwlib-Xm.c --- ./lwlib/lwlib-Xm.c Mon May 5 13:52:40 2003 +++ ./lwlib/lwlib-Xm.c Tue Sep 28 03:39:11 2004 @@ -74,9 +74,9 @@ XtPointer); /* static void xm_pop_down_callback (Widget, XtPointer, XtPointer); */ static void xm_generic_callback (Widget, XtPointer, XtPointer); +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) static void mark_dead_instance_destroyed (Widget widget, XtPointer closure, XtPointer call_data); -#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) static void xm_nosel_callback (Widget, XtPointer, XtPointer); #endif #ifdef LWLIB_SCROLLBARS_MOTIF @@ -204,7 +204,8 @@ /* update the label of anything subclass of a label */ static void -xm_update_label (widget_instance* instance, Widget widget, widget_value* val) +xm_update_label (widget_instance* UNUSED (instance), Widget widget, + widget_value* val) { XmString built_string = NULL; XmString key_string = NULL; @@ -339,7 +340,7 @@ /* update of buttons */ static void xm_update_pushbutton (widget_instance* instance, Widget widget, - widget_value* val) + widget_value* UNUSED (val)) { Arg al [1]; XtSetArg (al [0], XmNalignment, XmALIGNMENT_CENTER); @@ -350,8 +351,8 @@ #ifdef LWLIB_WIDGETS_MOTIF static void -xm_update_progress (widget_instance* instance, Widget scale, - widget_value* val) +xm_update_progress (widget_instance* UNUSED (instance), Widget scale, + widget_value* val) { Arg al[20]; int ac = 0; @@ -828,7 +829,13 @@ void xm_update_one_widget (widget_instance* instance, Widget widget, - widget_value* val, Boolean deep_p) + widget_value* val, +#ifdef LWLIB_MENUBARS_MOTIF + Boolean deep_p +#else + Boolean UNUSED (deep_p) +#endif + ) { WidgetClass class_; Arg al [20]; @@ -1034,7 +1041,8 @@ I could not find a way to do that with accelerators. */ static void -activate_button (Widget widget, XtPointer closure, XtPointer call_data) +activate_button (Widget UNUSED (widget), XtPointer closure, + XtPointer UNUSED (call_data)) { Widget button = (Widget)closure; XtCallCallbacks (button, XmNactivateCallback, NULL); @@ -1092,7 +1100,7 @@ static Widget -make_dialog (char* name, Widget parent, Boolean pop_up_p, +make_dialog (char* UNUSED (name), Widget parent, Boolean pop_up_p, const char* shell_title, const char* icon_name, Boolean text_input_slot, Boolean radio_box, Boolean list, int left_buttons, int right_buttons) @@ -1873,7 +1881,13 @@ /* Destruction of instances */ void -xm_destroy_instance (widget_instance* instance) +xm_destroy_instance ( +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) + widget_instance* instance +#else + widget_instance* UNUSED (instance) +#endif + ) { #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) /* It appears that this is used only for dialog boxes. */ @@ -2197,15 +2211,16 @@ #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) static void -mark_dead_instance_destroyed (Widget widget, XtPointer closure, - XtPointer call_data) +mark_dead_instance_destroyed (Widget UNUSED (widget), XtPointer closure, + XtPointer UNUSED (call_data)) { destroyed_instance* instance = (destroyed_instance*)closure; instance->widget = NULL; } static void -xm_nosel_callback (Widget widget, XtPointer closure, XtPointer call_data) +xm_nosel_callback (Widget widget, XtPointer closure, + XtPointer UNUSED (call_data)) { /* This callback is only called when a dialog box is dismissed with the wm's destroy button (WM_DELETE_WINDOW.) We want the dialog box to be destroyed @@ -2223,7 +2238,7 @@ /* set the keyboard focus */ void -xm_set_keyboard_focus (Widget parent, Widget w) +xm_set_keyboard_focus (Widget UNUSED (parent), Widget w) { XmProcessTraversal (w, XmTRAVERSE_CURRENT); /* At some point we believed that it was necessary to use XtSetKeyboardFocus diff --text -u 'xemacs-21.5.17/lwlib/lwlib-utils.c' 'xemacs-21.5.18/lwlib/lwlib-utils.c' Index: ./lwlib/lwlib-utils.c --- ./lwlib/lwlib-utils.c Mon Aug 13 13:45:57 2001 +++ ./lwlib/lwlib-utils.c Tue Sep 21 04:19:17 2004 @@ -166,7 +166,7 @@ } void -XtSafelyDestroyWidget (Widget widget) +XtSafelyDestroyWidget (Widget UNUSED (widget)) { #if 0 diff --text -u 'xemacs-21.5.17/lwlib/lwlib.c' 'xemacs-21.5.18/lwlib/lwlib.c' Index: ./lwlib/lwlib.c --- ./lwlib/lwlib.c Sun Jan 12 19:45:53 2003 +++ ./lwlib/lwlib.c Tue Sep 21 04:19:17 2004 @@ -366,7 +366,8 @@ } static void -mark_widget_destroyed (Widget widget, XtPointer closure, XtPointer call_data) +mark_widget_destroyed (Widget widget, XtPointer closure, + XtPointer UNUSED (call_data)) { widget_instance *instance = (widget_instance*)closure; @@ -512,15 +513,6 @@ return (s1 && s2) ? strcmp (s1, s2) : s1 ? False : !!s2; } -#ifndef WIN32_NATIVE -static change_type -max (change_type i1, change_type i2) -{ - return (int)i1 > (int)i2 ? i1 : i2; -} -#endif - - #if 0 # define EXPLAIN(name, oc, nc, desc, a1, a2) \ printf ("Change: \"%s\"\tmax(%s=%d,%s=%d)\t%s %d %d\n", \ @@ -672,8 +664,8 @@ { EXPLAIN (val1->name, change, merged_next->change, "(following change)", 0, 0); + change = max (change, merged_next->change); } - change = max (change, merged_next->change); } val1->next = merged_next; @@ -1277,7 +1269,7 @@ widget_instance. */ void lw_internal_update_other_instances (Widget widget, XtPointer closure, - XtPointer call_data) + XtPointer UNUSED (call_data)) { /* To forbid recursive calls */ static Boolean updating; @@ -1341,7 +1333,7 @@ /* Show busy */ static void -show_one_widget_busy (Widget w, Boolean flag) +show_one_widget_busy (Widget w, Boolean UNUSED (flag)) { Pixel foreground = 0; Pixel background = 1; diff --text -u 'xemacs-21.5.17/lwlib/xlwcheckbox.c' 'xemacs-21.5.18/lwlib/xlwcheckbox.c' Index: ./lwlib/xlwcheckbox.c --- ./lwlib/xlwcheckbox.c Fri Apr 13 03:21:53 2001 +++ ./lwlib/xlwcheckbox.c Tue Sep 21 04:19:17 2004 @@ -221,10 +221,14 @@ /*ARGSUSED*/ static void -CheckboxInit (Widget request, +CheckboxInit (Widget UNUSED (request), +#if DRAW_CHECK Widget new, - ArgList args, - Cardinal *num_args) +#else + Widget UNUSED (new), +#endif + ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { #if DRAW_CHECK CheckboxWidget cw = (CheckboxWidget) new; @@ -277,9 +281,14 @@ /* ARGSUSED */ static void -CheckboxDestroy (Widget w, - XtPointer junk, - XtPointer garbage) +CheckboxDestroy ( +#if DRAW_CHECK + Widget w, +#else + Widget UNUSED (w), +#endif + XtPointer UNUSED (junk), + XtPointer UNUSED (garbage)) { #if DRAW_CHECK CheckboxWidget cw = (CheckboxWidget) w; @@ -356,8 +365,9 @@ Dimension s = swid(cw); Dimension bsz = bsize(cw); Position bx,by ; /* Check upper-left */ - Dimension bw,bh ; + Dimension bh ; #ifdef _ThreeDP_h + Dimension bw; GC top, bot; #endif GC ctr ; @@ -365,11 +375,13 @@ /* foreground GC */ gc = XtIsSensitive(w) ? cw->command.normal_GC : cw->label.gray_GC ; - bw = bh = bs(cw) ; + bh = bs(cw) ; bx = cw->label.internal_width ; by = cw->core.height/2 - bh/2 ; #ifdef _ThreeDP_h + bw = bh ; + if( !cw->command.set ) { top = cw->threeD.top_shadow_GC ; bot = cw->threeD.bot_shadow_GC ; diff --text -u 'xemacs-21.5.17/lwlib/xlwgauge.c' 'xemacs-21.5.18/lwlib/xlwgauge.c' Index: ./lwlib/xlwgauge.c --- ./lwlib/xlwgauge.c Mon Aug 13 13:45:57 2001 +++ ./lwlib/xlwgauge.c Tue Sep 21 04:19:17 2004 @@ -241,8 +241,8 @@ static void GaugeInit (Widget request, Widget new, - ArgList args, - Cardinal *num_args) + ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { GaugeWidget gw = (GaugeWidget) new; @@ -366,8 +366,8 @@ /* ARGSUSED */ static void GaugeExpose (Widget w, - XEvent *event, - Region region) + XEvent *UNUSED (event), + Region UNUSED (region)) { GaugeWidget gw = (GaugeWidget) w; register Display *dpy = XtDisplay(w) ; @@ -376,7 +376,6 @@ GC gctop, gcbot ; /* dark, light shadows */ int len ; /* length (width or height) of widget */ - int hgt ; /* height (width) of widget */ int e0,e1 ; /* ends of the gauge */ int x ; int y ; /* vertical (horizontal) position */ @@ -397,10 +396,8 @@ if( gw->gauge.orientation == XtorientHorizontal ) { len = gw->core.width ; - hgt = gw->core.height ; } else { len = gw->core.height ; - hgt = gw->core.width ; } /* if the gauge is selected, signify by drawing the background @@ -503,10 +500,10 @@ static Boolean GaugeSetValues (Widget old, - Widget request, + Widget UNUSED (request), Widget new, - ArgList args, - Cardinal *num_args) + ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { GaugeWidget oldgw = (GaugeWidget) old; GaugeWidget gw = (GaugeWidget) new; @@ -649,7 +646,8 @@ #ifdef HAVE_XMU if( *target == XA_TARGETS(XtDisplay(w)) ) { - Atom *rval, *stdTargets ; + XPointer stdTargets; + Atom *rval ; unsigned long stdLength ; /* XmuConvertStandardSelection can handle this. This function @@ -659,7 +657,7 @@ req = XtGetSelectionRequest(w, *selection, NULL) ; XmuConvertStandardSelection(w, req->time, selection, target, - type, (XPointer*)&stdTargets, &stdLength, format) ; + type, &stdTargets, &stdLength, format) ; *type = XA_ATOM ; /* TODO: needed? */ *length = stdLength + 3 ; @@ -668,7 +666,7 @@ *rval++ = XA_INTEGER ; *rval++ = XA_STRING ; *rval++ = XA_TEXT(XtDisplay(w)) ; - memcpy((char *)rval, (char *)stdTargets, stdLength*sizeof(Atom)) ; + memcpy(rval, stdTargets, stdLength*sizeof(Atom)) ; XtFree((char*) stdTargets) ; *format = 8*sizeof(Atom) ; /* TODO: needed? */ return True ; @@ -723,7 +721,7 @@ static void GaugeLoseSel (Widget w, - Atom *selection) /* usually XA_PRIMARY */ + Atom *UNUSED (selection)) /* usually XA_PRIMARY */ { GaugeWidget gw = (GaugeWidget)w ; Display *dpy = XtDisplay(w) ; @@ -741,9 +739,9 @@ static void -GaugeDoneSel (Widget w, - Atom *selection, /* usually XA_PRIMARY */ - Atom *target) /* requested target */ +GaugeDoneSel (Widget UNUSED (w), + Atom *UNUSED (selection), /* usually XA_PRIMARY */ + Atom *UNUSED (target)) /* requested target */ { /* selection done, anything to do? */ } @@ -774,8 +772,8 @@ Atom *selection, Atom *type, XtPointer value, - unsigned long *length, - int *format) + unsigned long *UNUSED (length), + int *UNUSED (format)) { Display *dpy = XtDisplay(w) ; Atom target = (Atom)client ; @@ -1107,7 +1105,7 @@ static void GaugeGetValue (XtPointer clientData, - XtIntervalId *intervalId) + XtIntervalId *UNUSED (intervalId)) { GaugeWidget gw = (GaugeWidget)clientData ; Cardinal value ; diff --text -u 'xemacs-21.5.17/lwlib/xlwgcs.c' 'xemacs-21.5.18/lwlib/xlwgcs.c' Index: ./lwlib/xlwgcs.c --- ./lwlib/xlwgcs.c Fri Apr 13 03:21:54 2001 +++ ./lwlib/xlwgcs.c Tue Sep 21 04:19:17 2004 @@ -231,7 +231,13 @@ GC AllocShadeGC(Widget w, Pixel fg, Pixel bg, Font font, - int contrast, Bool be_nice_to_cmap) + int contrast, +#ifdef HAVE_XMU + Bool be_nice_to_cmap +#else + Bool UNUSED (be_nice_to_cmap) +#endif + ) { XGCValues values ; unsigned long vmask, dcmask ; @@ -318,7 +324,13 @@ /* return arm-shadow gc. */ GC -AllocArmGC(Widget w, int contrast, Bool be_nice_to_cmap) +AllocArmGC(Widget w, int contrast, +#ifdef HAVE_XMU + Bool be_nice_to_cmap +#else + Bool UNUSED (be_nice_to_cmap) +#endif + ) { Screen *scr = XtScreen (w); XGCValues values ; @@ -514,8 +526,9 @@ #if XtSpecificationRelease < 5 static GC -XtAllocateGC(Widget w, int depth, unsigned long mask, XGCValues *values, - unsigned long dynamic, unsigned long dontcare) +XtAllocateGC(Widget w, int UNUSED (depth), unsigned long mask, + XGCValues *values, unsigned long UNUSED (dynamic), + unsigned long UNUSED (dontcare)) { return XtGetGC(w, mask, values) ; } diff --text -u 'xemacs-21.5.17/lwlib/xlwmenu.c' 'xemacs-21.5.18/lwlib/xlwmenu.c' Index: ./lwlib/xlwmenu.c --- ./lwlib/xlwmenu.c Fri Feb 14 16:38:27 2003 +++ ./lwlib/xlwmenu.c Tue Sep 21 04:19:17 2004 @@ -1339,7 +1339,7 @@ Window window, int x, int y, unsigned int width, - Boolean vertical, + Boolean UNUSED (vertical), shadow_type type) { Display *dpy = XtDisplay (mw); @@ -1531,7 +1531,7 @@ static void label_button_size (XlwMenuWidget mw, widget_value *val, - Boolean in_menubar, + Boolean UNUSED (in_menubar), unsigned int *toggle_width, unsigned int *label_width, unsigned int *bindings_width, @@ -1554,10 +1554,10 @@ Boolean highlighted, Window window, int x, int y, - unsigned int width, - unsigned int height, + unsigned int UNUSED (width), + unsigned int UNUSED (height), unsigned int label_offset, - unsigned int binding_tab) + unsigned int UNUSED (binding_tab)) { int y_offset = mw->menu.shadow_thickness + mw->menu.vertical_margin; GC gc; @@ -1949,7 +1949,7 @@ static void separator_size (XlwMenuWidget mw, widget_value *val, - Boolean in_menubar, + Boolean UNUSED (in_menubar), unsigned int *toggle_width, unsigned int *label_width, unsigned int *rest_width, @@ -1964,13 +1964,13 @@ separator_draw (XlwMenuWidget mw, widget_value *val, Boolean in_menubar, - Boolean highlighted, + Boolean UNUSED (highlighted), Window window, int x, int y, unsigned int width, unsigned int height, - unsigned int label_tab, - unsigned int binding_tab) + unsigned int UNUSED (label_tab), + unsigned int UNUSED (binding_tab)) { unsigned int sep_width; @@ -1989,9 +1989,9 @@ } static void -pushright_size (XlwMenuWidget mw, - widget_value *val, - Boolean in_menubar, +pushright_size (XlwMenuWidget UNUSED (mw), + widget_value *UNUSED (val), + Boolean UNUSED (in_menubar), unsigned int *toggle_width, unsigned int *label_width, unsigned int *rest_width, @@ -3000,8 +3000,8 @@ #endif /* NEED_MOTIF */ static void -XlwMenuInitialize (Widget request, Widget new_, ArgList args, - Cardinal *num_args) +XlwMenuInitialize (Widget UNUSED (request), Widget new_, ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { /* Get the GCs and the widget size */ XlwMenuWidget mw = (XlwMenuWidget)new_; @@ -3104,7 +3104,7 @@ receives expose events through Xt. So we repaint all the other panes when receiving an Expose event. */ static void -XlwMenuRedisplay (Widget w, XEvent *ev, Region region) +XlwMenuRedisplay (Widget w, XEvent *UNUSED (ev), Region UNUSED (region)) { XlwMenuWidget mw = (XlwMenuWidget)w; int i; @@ -3163,8 +3163,8 @@ } static Boolean -XlwMenuSetValues (Widget current, Widget request, Widget new_, ArgList args, - Cardinal *num_args) +XlwMenuSetValues (Widget current, Widget UNUSED (request), Widget new_, + ArgList UNUSED (args), Cardinal *UNUSED (num_args)) { XlwMenuWidget oldmw = (XlwMenuWidget)current; XlwMenuWidget newmw = (XlwMenuWidget)new_; @@ -3304,7 +3304,8 @@ Time x_focus_timestamp_really_sucks_fix_me_better; static void -Start (Widget w, XEvent *ev, String *params, Cardinal *num_params) +Start (Widget w, XEvent *ev, String *UNUSED (params), + Cardinal *UNUSED (num_params)) { XlwMenuWidget mw = (XlwMenuWidget)w; @@ -3339,14 +3340,16 @@ } static void -Drag (Widget w, XEvent *ev, String *params, Cardinal *num_params) +Drag (Widget w, XEvent *ev, String *UNUSED (params), + Cardinal *UNUSED (num_params)) { XlwMenuWidget mw = (XlwMenuWidget)w; handle_motion_event (mw, &ev->xmotion, False); } static void -Select (Widget w, XEvent *ev, String *params, Cardinal *num_params) +Select (Widget w, XEvent *ev, String *UNUSED (params), + Cardinal *UNUSED (num_params)) { XlwMenuWidget mw = (XlwMenuWidget)w; widget_value *selected_item = mw->menu.old_stack [mw->menu.old_depth - 1]; @@ -3467,7 +3470,7 @@ /* display the stupid menu already */ void -xlw_display_menu (Time t) +xlw_display_menu (Time UNUSED (t)) { XlwMenuWidget mw = (XlwMenuWidget)lw_menubar_widget; diff --text -u 'xemacs-21.5.17/lwlib/xlwradio.c' 'xemacs-21.5.18/lwlib/xlwradio.c' Index: ./lwlib/xlwradio.c --- ./lwlib/xlwradio.c Sun Jan 12 19:45:53 2003 +++ ./lwlib/xlwradio.c Tue Sep 21 04:19:17 2004 @@ -219,8 +219,8 @@ static void RadioInit (Widget request, Widget new, - ArgList args, - Cardinal *num_args) + ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { RadioWidget rw = (RadioWidget) new; RadioWidget rw_req = (RadioWidget) request; @@ -247,9 +247,9 @@ /* ARGSUSED */ static void -RadioDestroy (Widget w, - XtPointer junk, - XtPointer garbage) +RadioDestroy (Widget UNUSED (w), + XtPointer UNUSED (junk), + XtPointer UNUSED (garbage)) { /* TODO: get rid of this */ } @@ -305,13 +305,6 @@ * but it bears thinking on. */ - /* Command widget may sometimes override the label GC in order - * to draw inverse video. We don't use inverse video, so we need - * to restore the label's normal GC. - */ - rw->label.normal_GC = rw->command.normal_GC ; - - /* Let label widget draw the label. If there was an lbm_x * field, we could let Label draw the bitmap too. But there * isn't, so we need to temporarily remove the bitmap and @@ -351,10 +344,10 @@ /* ARGSUSED */ static Boolean RadioSetValues (Widget current, - Widget request, + Widget UNUSED (request), Widget new, - ArgList args, - Cardinal *num_args) + ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { RadioWidget oldrw = (RadioWidget) current; RadioWidget newrw = (RadioWidget) new; @@ -452,9 +445,9 @@ static void RadioHighlight (Widget w, - XEvent *event, - String *params, - Cardinal *num_params) + XEvent *UNUSED (event), + String *UNUSED (params), + Cardinal *UNUSED (num_params)) { RadioWidget rw = (RadioWidget)w; DrawHighlight(w, rw->command.normal_GC) ; @@ -463,9 +456,9 @@ static void RadioUnhighlight (Widget w, - XEvent *event, - String *params, - Cardinal *num_params) + XEvent *UNUSED (event), + String *UNUSED (params), + Cardinal *UNUSED (num_params)) { RadioWidget rw = (RadioWidget)w; DrawHighlight(w, rw->command.inverse_GC) ; @@ -475,9 +468,9 @@ /* ARGSUSED */ void RadioSet (Widget w, - XEvent *event, - String *params, /* unused */ - Cardinal *num_params) /* unused */ + XEvent *UNUSED (event), + String *UNUSED (params), + Cardinal *UNUSED (num_params)) { RadioWidget rw = (RadioWidget)w; RadioWidgetClass class_ = (RadioWidgetClass) w->core.widget_class ; @@ -494,9 +487,9 @@ /* ARGSUSED */ void RadioUnset (Widget w, - XEvent *event, - String *params, /* unused */ - Cardinal *num_params) /* unused */ + XEvent *UNUSED (event), + String *UNUSED (params), + Cardinal *UNUSED (num_params)) { RadioWidget rw = (RadioWidget)w; RadioWidgetClass class_ = (RadioWidgetClass) w->core.widget_class ; diff --text -u 'xemacs-21.5.17/lwlib/xlwscrollbar.c' 'xemacs-21.5.18/lwlib/xlwscrollbar.c' Index: ./lwlib/xlwscrollbar.c --- ./lwlib/xlwscrollbar.c Thu Mar 27 21:57:46 2003 +++ ./lwlib/xlwscrollbar.c Tue Sep 21 04:19:18 2004 @@ -1286,7 +1286,8 @@ /*-------------------------- Method Functions ---------------------------*/ static void -Initialize (Widget treq, Widget tnew, ArgList args, Cardinal *num_args) +Initialize (Widget treq, Widget tnew, ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { XlwScrollBarWidget request = (XlwScrollBarWidget) treq; XlwScrollBarWidget w = (XlwScrollBarWidget) tnew; @@ -1398,7 +1399,7 @@ } static void -Redisplay (Widget widget, XEvent *event, Region region) +Redisplay (Widget widget, XEvent *UNUSED (event), Region region) { XlwScrollBarWidget w = (XlwScrollBarWidget) widget; @@ -1415,8 +1416,8 @@ } static Boolean -SetValues (Widget current, Widget request, Widget neww, - ArgList args, Cardinal *num_args) +SetValues (Widget current, Widget UNUSED (request), Widget neww, + ArgList UNUSED (args), Cardinal *UNUSED (num_args)) { XlwScrollBarWidget cur = (XlwScrollBarWidget) current; XlwScrollBarWidget w = (XlwScrollBarWidget) neww; @@ -1534,7 +1535,7 @@ /*-------------------------- Action Functions ---------------------------*/ static void -timer (XtPointer data, XtIntervalId *id) +timer (XtPointer data, XtIntervalId *UNUSED (id)) { XlwScrollBarWidget w = (XlwScrollBarWidget) data; w->sb.timerActive = False; @@ -1623,7 +1624,8 @@ } static void -Select (Widget widget, XEvent *event, String *parms, Cardinal *num_parms) +Select (Widget widget, XEvent *event, String *UNUSED (parms), + Cardinal *UNUSED (num_parms)) { XlwScrollBarWidget w = (XlwScrollBarWidget) widget; button_where sb_button; @@ -1757,7 +1759,8 @@ } static void -Drag (Widget widget, XEvent *event, String *parms, Cardinal *num_parms) +Drag (Widget widget, XEvent *event, String *UNUSED (parms), + Cardinal *UNUSED (num_parms)) { XlwScrollBarWidget w = (XlwScrollBarWidget) widget; @@ -1797,7 +1800,8 @@ } static void -Release (Widget widget, XEvent *event, String *parms, Cardinal *num_parms) +Release (Widget widget, XEvent *event, String *UNUSED (parms), + Cardinal *UNUSED (num_parms)) { XlwScrollBarWidget w = (XlwScrollBarWidget) widget; @@ -1824,7 +1828,8 @@ } static void -Jump (Widget widget, XEvent *event, String *parms, Cardinal *num_parms) +Jump (Widget widget, XEvent *event, String *UNUSED (parms), + Cardinal *UNUSED (num_parms)) { XlwScrollBarWidget w = (XlwScrollBarWidget) widget; int last_value; @@ -1883,7 +1888,8 @@ } static void -Abort (Widget widget, XEvent *event, String *parms, Cardinal *num_parms) +Abort (Widget widget, XEvent *event, String *UNUSED (parms), + Cardinal *UNUSED (num_parms)) { XlwScrollBarWidget w = (XlwScrollBarWidget) widget; diff --text -u 'xemacs-21.5.17/lwlib/xlwtabs.c' 'xemacs-21.5.18/lwlib/xlwtabs.c' Index: ./lwlib/xlwtabs.c --- ./lwlib/xlwtabs.c Mon Aug 13 13:45:58 2001 +++ ./lwlib/xlwtabs.c Tue Sep 21 04:19:18 2004 @@ -421,7 +421,8 @@ /* ARGSUSED */ static void -TabsInit(Widget request, Widget new, ArgList args, Cardinal *num_args) +TabsInit(Widget request, Widget new, ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { TabsWidget newTw = (TabsWidget)new; @@ -477,8 +478,8 @@ */ /* ARGSUSED */ static void -TabsConstraintInitialize(Widget request, Widget new, - ArgList args, Cardinal *num_args) +TabsConstraintInitialize(Widget UNUSED (request), Widget new, + ArgList UNUSED (args), Cardinal *UNUSED (num_args)) { TabsConstraints tab = (TabsConstraints) new->core.constraints ; tab->tabs.greyAlloc = False ; /* defer allocation of pixel */ @@ -527,7 +528,7 @@ int i ; int num_children = tw->composite.num_children ; Widget *childP ; - TabsConstraints tab ; /* #### unused */ + /* TabsConstraints tab ; */ /* #### unused */ Dimension cw,ch,bw ; /* Our size has now been dictated by the parent. Lay out the @@ -566,7 +567,7 @@ ++i, ++childP) if( XtIsManaged(*childP) ) { - tab = (TabsConstraints) (*childP)->core.constraints ; + /* tab = (TabsConstraints) (*childP)->core.constraints ; */ bw = (*childP)->core.border_width ; /* Don't do anything if we can't see any of the child. */ if (ch >= bw*2 && ch > 0 && cw >= bw*2 && cw > 0) @@ -589,7 +590,7 @@ /* ARGSUSED */ static void -TabsExpose(Widget w, XEvent *event, Region region) +TabsExpose(Widget w, XEvent *UNUSED (event), Region UNUSED (region)) { TabsWidget tw = (TabsWidget) w; @@ -604,8 +605,8 @@ /* ARGSUSED */ static Boolean -TabsSetValues(Widget current, Widget request, Widget new, - ArgList args, Cardinal *num_args) +TabsSetValues(Widget current, Widget UNUSED (request), Widget new, + ArgList UNUSED (args), Cardinal *UNUSED (num_args)) { TabsWidget curtw = (TabsWidget) current ; TabsWidget tw = (TabsWidget) new ; @@ -684,8 +685,8 @@ /* ARGSUSED */ static Boolean -TabsConstraintSetValues(Widget current, Widget request, Widget new, - ArgList args, Cardinal *num_args) +TabsConstraintSetValues(Widget current, Widget UNUSED (request), Widget new, + ArgList UNUSED (args), Cardinal *UNUSED (num_args)) { TabsWidget tw = (TabsWidget) XtParent(new) ; TabsConstraints ctab = (TabsConstraints) current->core.constraints ; @@ -737,7 +738,7 @@ static Boolean -TabsAcceptFocus(Widget w, Time *t) +TabsAcceptFocus(Widget w, Time *UNUSED (t)) { if( !w->core.being_destroyed && XtIsRealized(w) && XtIsSensitive(w) && XtIsManaged(w) && w->core.visible ) @@ -1038,7 +1039,8 @@ /* ARGSUSED */ static void -TabsSelect(Widget w, XEvent *event, String *params, Cardinal *num_params) +TabsSelect(Widget w, XEvent *event, String *UNUSED (params), + Cardinal *UNUSED (num_params)) { TabsWidget tw = (TabsWidget) w ; Widget *childP ; @@ -1086,7 +1088,8 @@ /* User hits a key */ static void -TabsPage(Widget w, XEvent *event, String *params, Cardinal *num_params) +TabsPage(Widget w, XEvent *UNUSED (event), String *params, + Cardinal *num_params) { TabsWidget tw = (TabsWidget) w ; Widget newtop = NULL; @@ -1150,7 +1153,8 @@ /* User hits up/down key */ static void -TabsHighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) +TabsHighlight(Widget w, XEvent *UNUSED (event), String *params, + Cardinal *num_params) { TabsWidget tw = (TabsWidget) w ; Widget newhl = NULL; @@ -1215,7 +1219,8 @@ static void -TabsUnhighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) +TabsUnhighlight(Widget w, XEvent *UNUSED (event), String *UNUSED (params), + Cardinal *UNUSED (num_params)) { TabsWidget tw = (TabsWidget) w ; int nc = tw->composite.num_children ; diff --text -u 'xemacs-21.5.17/man/ChangeLog' 'xemacs-21.5.18/man/ChangeLog' Index: ./man/ChangeLog --- ./man/ChangeLog Mon Mar 22 18:23:42 2004 +++ ./man/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,219 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + +2003-11-02 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/control.texi (Examples of Catch): Mention use of a cons + as a catch tag. + +2004-07-20 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/glyphs.texi (Image Instantiator Formats): Add a few + words about the tab control widget. + +2004-05-14 Darryl Okahata <darrylo@xemacs.org> + + * lispref/windows.texi. Added documentation for the functions, + ``current-pixel-row'' and ``current-pixel-column''. + +2004-09-13 Jerry James <james@xemacs.org> + + * internals/internals.texi (Modules for Interfacing with the + Operating System): The code formerly in callproc.c is now + implemented in Lisp in process.el. + +2004-08-30 Jerry James <james@xemacs.org> + + * lispref/text.texi: Document text fields. + +2004-09-08 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/searching.texi (Syntax of Regexps): Add example of use + of shy groups in variable subexpression, correct rumor that there + may be substantial performance gain. Document double-digit back- + references. + +2004-08-13 Stephen J. Turnbull <stephen@xemacs.org> + + * xemacs/help.texi (Misc Help): Info-goto-emacs-key-command-node + to function index. Document Info-goto-emacs-command-node. + + * lispref/positions.texi (Text Lines): makeinfo doesn't like Note:. + +2004-07-19 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/glyphs.texi: Complete reorganization, some content updated. + * lispref/lispref.texi (Top): Update menu to match. + * lispref/extents.texi (Extent Properties): Update xref. + +2004-06-29 Stephen J. Turnbull <stephen@xemacs.org> + + * internals/internals.texi (Modules for Other Aspects of the Lisp + Interpreter and Object System): Add description of Sextword syntax + class (now obsolete). + +2004-06-20 Stephen J. Turnbull <stephen@xemacs.org> + + * internals/internals.texi (Techniques for XEmacs Developers): Be + specific when discussing optimization. + (Techniques for XEmacs Developers): Fragments that are meaningless + by themselves or contain placeholders should be @samp, not @code. + (Modules for Internationalization): Add description of mule-coding.c + and further deprecate mule.c. + (Modules for Regression Testing): Add {tag,weak}-tests.el to list. + +2004-07-05 Stephen J. Turnbull <stephen@xemacs.org> + + * xemacs-faq.texi (Q3.10.2): Mention that `pending-delete' is in + the "pc" package. + +2004-06-15 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/specifiers.texi (Specifier Instancing): Add "neon + modeline" hack as an example. Thanks to Giacomo Boffi. + +2004-06-07 Jerry James <james@xemacs.org> + + * lispref/modes.texi (Major Modes): Document -mode functions, and + the use of a nil argument to defined-derived mode. + * lispref/modes.texi (Major Mode Conventions): Describe the use of + delay-mode-hooks and define-derived-mode. + * lispref/modes.texi (Derived Modes): Warn against the use of + interactive specs in derived mode definitions. + * lispref/modes.texi (Hooks): Document run-mode-hooks, + delay-mode-hooks, run-hook-with-args, + run-hook-with-args-until-failure, and0 + run-hook-with-args-until-success. + +2004-06-14 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/glyphs.texi (Creating Glyphs): Improve discussion, fix a + couple of typos. + + * lispref/faces.texi (Face Properties): Background pixmaps + can be used on GTK and MS Windows. + (Face Convenience Functions): Cross-reference glyph interface. + Background pixmap is an image specifier, not a glyph. + +2004-05-21 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/numbers.texi (Comparison of Numbers): Clarify bigfloat eql. + (Predicates on Numbers): Fix thinko in description of `bigfloatp'. + +2004-05-10 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/numbers.texi (Numbers): Remove reference to "fixed- + precision rationals," and fix description of floating-point + contagion. + (Integer Basics, Float Basics): Fix typos. + (Canonicalization and Contagion): Complete rewrite. + (Predicates on Numbers): Add fixnump, bignump, ratiop, rationalp, + bigfloatp, floatingp, realp, oddp and evenp. + (Rational Basics): Add numerator and denominator. + (Random Numbers): Fix description of range, and add paranoid + comment about how unpredictable `(random t)' is. + (Canonicalization and Contagion): Renamed from Contagion and + Canonicalization. + (The Bignum Extension): Fix it in menu. + +2004-05-10 Stephen J. Turnbull <stephen@xemacs.org> + + * internals/internals.texi (Object-Oriented Techniques for C): + Remove reference to "encouraging port to C++". + +2004-04-19 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/numbers.texi (The Bignum Extension): Mention the feature + symbols provided. + +2004-04-19 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/numbers.texi (Rational Basics): There's a reason why + this node is named "Rational" and not "Ratio" in the menu.... + +2004-04-18 Stephen J. Turnbull <stephen@xemacs.org> + + * internals/internals.texi (Object-Oriented Techniques in XEmacs): + New node. + (The XEmacs Object System (Abstractly Speaking)): + Reorder the list of objects somewhat. + Add brief descriptions of the arbitrary-precision number types. + (Writing Good Comments): Slight revision, recommend @xemacs alias. + (Character-Related Data Types): Add a few comments re Unicode. + (Working With Character and Byte Positions): Ditto. + (General Guidelines for Writing Mule-Aware Code): Query. + (Conversion to and from External Data): Ditto. + (Techniques for XEmacs Developers): Typo. + (Modules for Regression Testing): Add an xref. + (Overview): Note that dump file is now inside the executable. + (Remaining issues): Mention ExecShield vs. pdumper. + (Searching and Matching): Mention UTF-8 wrt Mule. + +2004-02-22 Stephen J. Turnbull <stephen@xemacs.org> + + * widget.texi (Introduction): Update historical references a bit. + Fix many typos and grammatical problems. + (User Interface): Fix typo. + +2004-04-09 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/numbers.texi (Numbers): Describe bignums, ratios, and + bigfloats briefly. + (Integer Basics): We've had 31-bit integers for a while. Fix the + statement of minimum available precision and the examples. + Document most-positive-fixnum and most-negative-fixnum. Add a + pointer to the node "The Bignum Extension". + (Float Basics): Document most-positive-float, most-negative-float, + least-positive-float, least-positive-normalized-float, + least-negative-float, and least-negative-normalized-float. Add a + pointer to the node "The Bignum Extension". + (Comparison of Numbers): Update for bignums. + + (The Bignum Extension): + (Bignum Basics): + (Ratio Basics): + (Bigfloat Basics): + (Contagion and Canonicalization): + (Compatibility Issues): + New nodes. + + * lispref/lispref.texi (Top): + * lispref/numbers.texi (Numbers): + Add nodes "Ratio Basics" and "The Bignum Extension" to menus. + +2004-01-26 Stephen J. Turnbull <stephen@xemacs.org> + + * lispref/specifiers.texi: Update FSF copyright. + (Specifier Compatibility Notes): New node. + + * lispref/glyphs.texi (Glyph Properties): Fix typo. + (Glyphs): + (Native GUI Widgets): New node. + + * lispref/gutter.texi (Gutter Descriptor Format): Node deleted. + (Gutter): + (Gutter Intro): + (Creating Gutter): + (Specifying a Gutter): + Pluralize node name to Creating Gutters. + (Creating Gutters): Improve explanation of gutter descriptors. + (Other Gutter Variables): Remove extraneous text. + (Common Gutter Widgets): In lieu of real documentation, at least + point to gutter-items.el. + +2004-04-06 Stephen J. Turnbull <stephen@xemacs.org> + + Lightly revised from <psr7v1j039.fsf@diannao.ittc.ku.edu>. + Thanks to Jerry James <james@xemacs.org>. + + * xemacs-faq.texi (Top, Miscellaneous): In menus, renumber Section + 5.3 and Q5.3.1-12 as 5.4.x, and add Mathematics and Q5.3.1-4 as + replacement section 5.3. + (Q5.3.1, Q5.3.2, Q5.3.3, Q5.3.4) New FAQs for bignums. + (Q5.2.1, Q8.0.1) Add @unnumberedsec headings. + (Q6.4.1) Correct @unnumberedsec heading. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. @@ -2163,7 +2379,7 @@ Document INLINE_HEADER and how to create macros and inline functions. Cleanup entire section. -2000-02-17 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> +2000-02-17 Stephen J. Turnbull <stephen@xemacs.org> * man/lispref/gutter.texi: New file describing gutter API. @@ -2171,14 +2387,14 @@ * man/lispref/toolbar.texi: Fixup links to new node Gutter. -2000-02-17 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> +2000-02-17 Stephen J. Turnbull <stephen@xemacs.org> * man/lispref/frames.texi, man/xemacs/custom.texi, man/xemacs/frame.texi, man/xemacs/glossary.texi: Mention menubars, toolbars, and gutters as optional components of frames, with pointers to descriptions. -2000-02-17 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> +2000-02-17 Stephen J. Turnbull <stephen@xemacs.org> * man/lispref/mule.texi: Substantial reorganization and revision for style of descriptions of character sets, @@ -2621,7 +2837,7 @@ Added info dir entries so install-info will add them to the common `dir' file. -1999-04-28 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> +1999-04-28 Stephen J. Turnbull <stephen@xemacs.org> * man/lispref/mule.texi: Document CCL - add sections: syntax, statements, expressions, and examples. @@ -3080,7 +3296,7 @@ Comment out w3 and vm info rules. Use paranoid cd ./$@ syntax to avoid losing with luser's CDPATH. -1998-03-27 Stephen Turnbull <turnbull@sk.tsukuba.ac.jp> +1998-03-27 Stephen Turnbull <stephen@xemacs.org> * xemacs/frame.texi: Document cursor appearance at end of line. diff --text -u 'xemacs-21.5.17/man/internals/internals.texi' 'xemacs-21.5.18/man/internals/internals.texi' Index: ./man/internals/internals.texi --- ./man/internals/internals.texi Fri Feb 20 16:29:23 2004 +++ ./man/internals/internals.texi Tue Sep 14 23:39:57 2004 @@ -1487,14 +1487,9 @@ @table @code @item integer -28 or 31 bits of precision, or 60 or 63 bits on 64-bit machines; the +31 bits of precision, or 63 bits on 64-bit machines; the reason for this is described below when the internal Lisp object representation is described. -@item float -Same precision as a double in C. -@item cons -A simple container for two Lisp objects, used to implement lists and -most other data structures in Lisp. @item char An object representing a single character of text; chars behave like integers in many ways but are logically considered text rather than @@ -1511,27 +1506,42 @@ different types @code{eq}. The reason for this monstrosity is compatibility with existing code; the separation of char from integer came fairly recently.) +@item float +Same precision as a double in C. +@item bignum +@itemx ratio +@itemx bigfloat +As build-time options, arbitrary-precision numbers are available. +Bignums are integers, and when available they remove the restriction on +buffer size. Ratios are non-integral rational numbers. Bigfloats are +arbitrary-precision floating point numbers, with precision specified at +runtime. @item symbol An object that contains Lisp objects and is referred to by name; symbols are used to implement variables and named functions and to provide the equivalent of preprocessor constants in C. -@item vector -A one-dimensional array of Lisp objects providing constant-time access -to any of the objects; access to an arbitrary object in a vector is -faster than for lists, but the operations that can be done on a vector -are more limited. @item string Self-explanatory; behaves much like a vector of chars but has a different read syntax and is stored and manipulated more compactly. @item bit-vector A vector of bits; similar to a string in spirit. +@item vector +A one-dimensional array of Lisp objects providing constant-time access +to any of the objects; access to an arbitrary object in a vector is +faster than for lists, but the operations that can be done on a vector +are more limited. @item compiled-function An object containing compiled Lisp code, known as @dfn{byte code}. @item subr A Lisp primitive, i.e. a Lisp-callable function implemented in C. +@item cons +A simple container for two Lisp objects, used to implement lists and +most other data structures in Lisp. @end table +Objects which are not conses are called atoms. + @cindex closure Note that there is no basic ``function'' type, as in more powerful versions of Lisp (where it's called a @dfn{closure}). XEmacs Lisp does @@ -1695,7 +1705,7 @@ deleted. (This happens as a result of restoring a window configuration.) @cindex read syntax - Note that many types of objects have a @dfn{read syntax}, i.e. a way of + Many types of objects have a @dfn{read syntax}, i.e. a way of specifying an object of that type in Lisp code. When you load a Lisp file, or type in code to be evaluated, what really happens is that the function @code{read} is called, which reads some text and creates an object @@ -1716,6 +1726,14 @@ converts to an integer whose value is 17297. @example +355/113 +@end example + +converts to a ratio commonly used to approximate @emph{pi} when ratios +are configured, and otherwise to a symbol whose name is ``355/113'' (for +backward compatibility). + +@example 1.983e-4 @end example @@ -2261,6 +2279,7 @@ @menu * A Reader's Guide to XEmacs Coding Conventions:: * General Coding Rules:: +* Object-Oriented Techniques for C:: * Writing Lisp Primitives:: * Writing Good Comments:: * Adding Global Lisp Variables:: @@ -2481,6 +2500,106 @@ @code{LIST_LOOP_DELETE_IF} delete elements from a lisp list satisfying some predicate. +@node Object-Oriented Techniques for C +@section Object-Oriented Techniques for C +@cindex coding rules, object-oriented +@cindex object-oriented techniques + +At the lowest levels, XEmacs makes heavy use of object-oriented +techniques to promote code-sharing and uniform interfaces for different +devices and platforms. Commonly, but not always, such objects are +``wrapped'' and exported to Lisp as Lisp objects. Usually they use +the internal structures developed for Lisp objects (the @samp{lrecord} +structure) in order to take advantage of Lisp memory management. +Unfortunately, XEmacs was originally written in C, so these techniques +are based on heavy use of C macros. + +@c You can't use @var{} for type below, because case is important. +A module defining a class is likely to use most of the following +declarations and macros. In the following, the notation @samp{<type>} +will stand for the full name of the class, and will be capitalized in +the way normal for its context. The notation @samp{<typ>} will stand +for the abbreviated form commonly used in macro names, while @samp{ty} +will be used as the typical name for instances of the class. (See the +entry for @samp{MAYBE_<TY>METH} below for an example using all three +notations.) + +In the interface (@file{.h} file), the following declarations are used +often. Others may be used in for particular modules. Since they're +quite short in most cases, the definitions are given as well. The +generic macros used are defined in @file{lisp.h} or @file{lrecord.h}. + +@c #### reorganize this table into stuff used in general code, and stuff +@c used only in declarations or initializations +@table @samp +@c #### declaration +@item typedef struct Lisp_<Type> Lisp_<Type> +This refers to the internal structure used by C code. The XEmacs coding +style now forbids passing pointers to @samp{Lisp_<Type>} structures into +or out of a function; instead, a @samp{Lisp_Object} should be passed or +returned (created using @samp{wrap_<type>}, if necessary). + +@c #### declaration +@item DECLARE_LRECORD (<type>, Lisp_<Type>) +Declares an @samp{lrecord} for @samp{<Type>}, which is the unit of +allocation. + +@item #define X<TYPE>(x) XRECORD (x, <type>, Lisp_<Type>) +Turns a @code{Lisp_Object} into a pointer to @samp{struct Lisp_<Type>}. + +@item #define wrap_<type>(p) wrap_record (p, <type>) +Turns a pointer to @samp{struct Lisp_<Type>} into a @code{Lisp_Object}. + +@item #define <TYPE>P(x) RECORDP (x, <type>) +Tests whether a given @code{Lisp_Object} is of type @samp{Lisp_<Type>}. +Returns a C int, not a Lisp Boolean value. + +@item #define CHECK_<TYPE>(x) CHECK_RECORD (x, <type>) +@itemx #define CONCHECK_<TYPE>(x) CONCHECK_RECORD (x, <type>) +Tests whether a given @code{Lisp_Object} is of type @samp{Lisp_<Type>}, +and signals a Lisp error if not. The @samp{CHECK} version of the macro +never returns if the type is wrong, while the @samp{CONCHECK} version +can return if the user catches it in the debugger and explicitly +requests a return. + +@item #define RAW_<TYP>METH(ty, m) ((ty)->methods->m##_method) +Return a function pointer for the method for an object @var{TY} of class +@samp{Lisp_<Type>}, or @samp{NULL} if there is none for this type. + +@item #define HAS_<TYP>METH_P(ty, m) (!!RAW_<TYP>METH (ty, m)) +Test whether the class that @var{TY} is an instance of has the method. + +@item #define <TYP>METH(ty, m, args) ((RAW_<TYP>METH (ty, m)) args) +Call the method on @samp{args}. @samp{args} must be enclosed in +parentheses in the call. It is the programmer's responsibility to +ensure that the method is available. The standard convenience macro +@samp{MAYBE_<TYP>METH} is often provided for the common case where a +void-returning method of @samp{Type} is called. + +@item #define MAYBE_<TYP>METH(ty, m, args) do @{ ... @} while (0) +Call a void-returning @samp{<Type>} method, if it exists. Note the use +of the @samp{do ... while (0)} idiom to give the macro call C statement +semantics. The full definition is equally idiomatic: + +@example +#define MAYBE_<TYP>METH(ty, m, args) do @{ \ + Lisp_<Type> *maybe_<typ>meth_ty = (ty); \ + if (HAS_<TYP>METH_P (maybe_<typ>meth_ty, m)) \ + <TYP>METH (maybe_<typ>meth_ty, m, args); \ +@} while (0) +@end example +@end table + +The use of macros for invoking an object's methods makes life a bit +difficult for the student or maintainer when browsing the code. In +particular, calls are of the form @samp{<TYP>METH (ty, some_method, (x, +y))}, but definitions typically are for @samp{<subtype>_some_method}. +Thus, when you are trying to find calls, you need to grep for +@samp{some_method}, but this will also catch calls and definitions of +that method for instances of other subtypes of @samp{<Type>}, and there +may be a rather large number of them. + + @node Writing Lisp Primitives @section Writing Lisp Primitives @cindex writing Lisp primitives @@ -2760,22 +2879,22 @@ later on lost or unavailable to the person doing the update.) When putting in an explicit opinion in a comment, you should -@emph{always} attribute it with your name, and optionally the date. -This also goes for long, complex comments explaining in detail the -workings of something -- by putting your name there, you make it -possible for someone who has questions about how that thing works to -determine who wrote the comment so they can write to them. Preferably, -use your actual name and not your initials, unless your initials are -generally recognized (e.g. @samp{jwz}). You can use only your first -name if it's obvious who you are; otherwise, give first and last name. -If you're not a regular contributor, you might consider putting your -email address in -- it may be in the ChangeLog, but after awhile -ChangeLogs have a tendency of disappearing or getting -muddled. (E.g. your comment may get copied somewhere else or even into -another program, and tracking down the proper ChangeLog may be very -difficult.) +@emph{always} attribute it with your name and the date. This also goes +for long, complex comments explaining in detail the workings of +something -- by putting your name there, you make it possible for +someone who has questions about how that thing works to determine who +wrote the comment so they can write to them. Use your actual name or +your alias at xemacs.org, and not your initials or nickname, unless that +is generally recognized (e.g. @samp{jwz}). Even then, please consider +requesting a virtual user at xemacs.org (forwarding address; we can't +provide an actual mailbox). Otherwise, give first and last name. If +you're not a regular contributor, you might consider putting your email +address in -- it may be in the ChangeLog, but after awhile ChangeLogs +have a tendency of disappearing or getting muddled. (E.g. your comment +may get copied somewhere else or even into another program, and tracking +down the proper ChangeLog may be very difficult.) -If you come across an opinion that is not or no longer valid, or you +If you come across an opinion that is not or is no longer valid, or you come across any comment that no longer applies but you want to keep it around, enclose it in @samp{[[ } and @samp{ ]]} marks and add a comment afterwards explaining why the preceding comment is no longer valid. Put @@ -2934,10 +3053,16 @@ Obviously, the equality between characters and bytes is lost in the Mule world. Characters can be represented by one or more bytes in the buffer, and @code{Ichar} is a C type large enough to hold any -character. +character. (This currently isn't quite true for ISO 10646, which +defines a character as a 31-bit non-negative quantity, while XEmacs +characters are only 30-bits. This is irrelevant, unless you are +considering using the ISO 10646 private groups to support really large +private character sets---in particular, the Mule character set!---in +a version of XEmacs using Unicode internally.) Without Mule support, an @code{Ichar} is equivalent to an -@code{unsigned char}. +@code{unsigned char}. [[This doesn't seem to be true; @file{lisp.h} +unconditionally @samp{typedef}s @code{Ichar} to @code{int}.]] @item Ibyte @cindex Ibyte @@ -2954,7 +3079,11 @@ One character can correspond to one or more @code{Ibyte}s. In the current Mule implementation, an ASCII character is represented by the same @code{Ibyte}, and other characters are represented by a sequence -of two or more @code{Ibyte}s. +of two or more @code{Ibyte}s. (This will also be true of an +implementation using UTF-8 as the internal encoding. In fact, only code +that implements character code conversions and a very few macros used to +implement motion by whole characters will notice the difference between +UTF-8 and the Mule encoding.) Without Mule support, there are exactly 256 characters, implicitly Latin-1, and each character is represented using one @code{Ibyte}, and @@ -3046,7 +3175,10 @@ a @code{Bytecount} value. In the current Mule implementation, @code{MAX_ICHAR_LEN} equals 4. -Without Mule, it is 1. +Without Mule, it is 1. In a mature Unicode-based XEmacs, it will also +be 4 (since all Unicode characters can be encoded in UTF-8 in 4 bytes or +less), but some versions may use up to 6, in order to use the large +private space provided by ISO 10646 to ``mirror'' the Mule code space. @item itext_ichar @itemx set_itext_ichar @@ -3184,6 +3316,9 @@ Format used for the external Unix environment---@code{argv[]}, stuff from @code{getenv()}, stuff from the @file{/etc/passwd} file, etc. This is encoded according to the encoding specified by the current locale. +[[This is dangerous; current locale is user preference, and the system +is probably going to be something else. Is there anything we can do +about it?]] @item Qfile_name Format used for filenames. This is normally the same as @code{Qnative}, @@ -3373,7 +3508,10 @@ prefix and have string arguments of type @code{Ibyte *}, and you can pass internally encoded data to them, often from a Lisp string using @code{XSTRING_DATA}. (A better design might be to provide versions that -accept Lisp strings directly.) +accept Lisp strings directly.) [[Really? Then they'd either take +@code{Lisp_Object}s and need to check type, or they'd take +@code{Lisp_String}s, and violate the rules about passing any of the +specific Lisp types.]] Also note that many internal functions, such as @code{make_string}, accept Ibytes, which removes the need for them to convert the data they @@ -3490,7 +3628,7 @@ You simply can't dump Quantified and Purified images (unless using the portable dumper). Purify gets confused when xemacs frees memory in one process that was allocated in a @emph{different} process on a different -machine!. Run it like so: +machine! Run it like so: @example temacs -batch -l loadup.el run-temacs @var{xemacs-args...} @end example @@ -3535,7 +3673,7 @@ @item Speed up syntax highlighting. It was suggested that ``maybe moving some of the syntax highlighting capabilities into C would make a -difference.'' Wrong idea, I think. When processing one large file a +difference.'' Wrong idea, I think. When processing one 400kB file a particular low-level routine was being called 40 @emph{million} times simply for @emph{one} call to @code{newline-and-indent}. Syntax highlighting needs to be rewritten to use a reliable, fast parser, then @@ -3674,21 +3812,24 @@ @file{.c} files should @code{#include "lisp.h"} second. @item -Generated header files should be included using the @code{#include <...>} syntax, -not the @code{#include "..."} syntax. The generated headers are: +Generated header files should be included using the @samp{#include <...>} +syntax, not the @samp{#include "..."} syntax. The generated headers are: @file{config.h sheap-adjust.h paths.h Emacs.ad.h} -The basic rule is that you should assume builds using @code{--srcdir} -and the @code{#include <...>} syntax needs to be used when the +The basic rule is that you should assume builds using @samp{--srcdir} +and the @samp{#include <...>} syntax needs to be used when the to-be-included generated file is in a potentially different directory -@emph{at compile time}. The non-obvious C rule is that @code{#include "..."} -means to search for the included file in the same directory as the -including file, @emph{not} in the current directory. +@emph{at compile time}. The non-obvious C rule is that +@samp{#include "..."} means to search for the included file in the same +directory as the including file, @emph{not} in the current directory. +Normally this is not a problem but when building with @samp{--srcdir}, +@file{make} will search the @samp{VPATH} for you, while the C compiler +knows nothing about it. @item -Header files should @emph{not} include @code{<config.h>} and -@code{"lisp.h"}. It is the responsibility of the @file{.c} files that +Header files should @emph{not} include @samp{<config.h>} and +@samp{"lisp.h"}. It is the responsibility of the @file{.c} files that use it to do so. @end itemize @@ -5202,6 +5343,37 @@ sequence'' @emph{flag}. The ``comment-end'' class allows the scanner to determine that no second character is needed to terminate the comment. +There used to be a syntax class @samp{Sextword}. A character of +@samp{Sextword} class is a word-constituent but a word boundary may +exist between two such characters. Ken'ichi HANDA <handa@@etl.go.jp> +explains the purpose of the Sextword syntax category: + +@quotation +Japanese words are not separated by spaces, which makes finding word +boundaries very difficult. Theoretically it's impossible without +using natural language processing techniques. But, by defining +pseudo-words as below (much simplified for letting you understand it +easily) for Japanese, we can have a convenient forward-word function +for Japanese. + +@display +A Japanese word is a sequence of characters that consists of +zero or more Kanji characters followed by zero or more +Hiragana characters. +@end display + +Then, the problem is that now we can't say that a sequence of +word-constituents makes up a word. For instance, both Hiragana "A" +and Kanji "KAN" are word-constituents but the sequence of these two +letters can't be a single word. + +So, we introduced Sextword for Japanese letters. +@end quotation + +There seems to have been some controversy about this category, as it has +been removed, readded, and removed again. Currently neither GNU Emacs +(21.3.99) nor XEmacs (21.5.17) seems to use it. + @example casefiddle.c @@ -5296,7 +5468,7 @@ @cindex operating system, modules for interfacing with the @example -callproc.c +process.el process.c process.h @end example @@ -5306,7 +5478,7 @@ @cindex synchronous subprocesses @cindex subprocesses, synchronous - @file{callproc.c} implements (through the @code{call-process} + @file{process.el} implements (through the @code{call-process} primitive) what are called @dfn{synchronous subprocesses}. This means that XEmacs runs a program, waits till it's done, and retrieves its output. A typical example might be calling the @file{ls} program to get @@ -5681,6 +5853,7 @@ mule-charset.h file-coding.c file-coding.h +mule-coding.c mule-mcpath.c mule-mcpath.h mule-wnnfns.c @@ -5706,7 +5879,10 @@ character sets, how the indices for a character are converted into bytes (sometimes this involves setting the high bit; sometimes complicated rearranging of the values takes place, as in the Shift-JIS encoding), -etc. +etc. It also contains some generic coding system implementations, such +as the binary (no-conversion) coding system and a sample gzip coding system. + +@file{mule-coding.c} contains the implementations of text coding systems. @file{mule-ccl.c} provides the CCL (Code Conversion Language) interpreter. CCL is similar in spirit to Lisp byte code and is used to @@ -5723,8 +5899,8 @@ C I/O functions like @samp{open()} are wrapped so that conversion occurs automatically. -@file{mule.c} provides a few miscellaneous things that should probably -be elsewhere. +@file{mule.c} contains a few miscellaneous things. It currently seems +to be unused and probably should be removed. @@ -5769,12 +5945,14 @@ regexp-tests.el symbol-tests.el syntax-tests.el +tag-tests.el +weak-tests.el @end example @file{test-harness.el} defines the macros @code{Assert}, @code{Check-Error}, @code{Check-Error-Message}, and @code{Check-Message}. The other files are test files, testing various -XEmacs facilities. +XEmacs facilities. @xref{Regression Testing XEmacs}. @@ -7124,6 +7302,9 @@ data. Also, rebuild all the quickly rebuildable data. @end enumerate +Note: As of 21.5.18, the dump file has been moved inside of the +executable, although there are still problems with this on some systems. + @node Data descriptions @section Data descriptions @cindex dumping data descriptions @@ -7427,7 +7608,8 @@ The build process will have to start a post-dump xemacs, ask it the loading address (which will, hopefully, be always the same between -different xemacs invocations) and relocate the file to the new address. +different xemacs invocations) [[unfortunately, not true on Linux with +the ExecShield feature]] and relocate the file to the new address. This way the object relocation phase will not have to be done, which means no writes in the objects and that, because of the use of mmap, the dumped data will be shared between all the xemacs running on the @@ -8698,6 +8880,9 @@ swallow whole characters. This is handled using the same basic macros that are used for buffer and string movements. +This will also be true if a UTF-8 representation is used for the +internal encoding. + The complex algorithms for searching are for simple string searches. In particular, the algorithm used for fast string searching is Boyer-Moore. This algorithm is based on the idea that if you have a mismatch at a @@ -10436,6 +10621,15 @@ image on-screen but the image need not exist at this stage, and multiple screen images can be instantiated from a single glyph. +@c #### find a place for this discussion +@c The decision to make image specifiers a separate type is debatable. +@c In fact, the design decision to create a separate image specifier +@c type, rather than make glyphs themselves be specifiers, is +@c debatable---the other properties of glyphs are rarely used and could +@c conceivably have been incorporated into the glyph's instantiator. +@c The rarely used glyph types (buffer, pointer, icon) could also have +@c been incorporated into the instantiator. + Glyphs are lazily instantiated by calling one of the glyph functions. This usually occurs within redisplay when @code{Fglyph_height} is called. Instantiation causes an image-instance diff --text -u 'xemacs-21.5.17/man/lispref/control.texi' 'xemacs-21.5.18/man/lispref/control.texi' Index: ./man/lispref/control.texi --- ./man/lispref/control.texi Sat Jul 6 05:35:52 2002 +++ ./man/lispref/control.texi Wed Sep 22 11:06:27 2004 @@ -621,6 +621,14 @@ @code{yes}. The function @code{print} is never called, and the body-form @code{'no} is never evaluated. +In most cases the formal tag for a catch is a quoted symbol or a +variable whose value is a symbol. Both styles are demonstrated above. +In definitions of derived control structures, an anonymous tag may be +desired. A gensym could be used, but since catch tags are compared +using @code{eq}, any Lisp object can be used. An occasionally +encountered idiom is to bind a local variable to @code{(cons nil nil)}, +and use the variable as the formal tag. + @node Errors @subsection Errors @cindex errors diff --text -u 'xemacs-21.5.17/man/lispref/extents.texi' 'xemacs-21.5.18/man/lispref/extents.texi' Index: ./man/lispref/extents.texi --- ./man/lispref/extents.texi Wed Aug 13 20:07:40 2003 +++ ./man/lispref/extents.texi Mon Jul 19 17:24:28 2004 @@ -555,7 +555,7 @@ the extent. This takes precedence over the @code{text-pointer-glyph} and @code{nontext-pointer-glyph} variables. If for any reason this glyph is an invalid pointer, the standard glyphs will be used as -fallbacks. @xref{Mouse Pointer}. +fallbacks. @xref{External Glyphs}. @item detachable (Boolean) Whether this extent becomes detached when all of the text it diff --text -u 'xemacs-21.5.17/man/lispref/faces.texi' 'xemacs-21.5.18/man/lispref/faces.texi' Index: ./man/lispref/faces.texi --- ./man/lispref/faces.texi Tue Dec 3 19:35:14 2002 +++ ./man/lispref/faces.texi Mon Jun 14 19:24:45 2004 @@ -164,7 +164,7 @@ @item background-pixmap The pixmap displayed in the background of the face. Only used by faces -on X devices. +on GUI devices, currently X11, GTK, and Microsoft Windows. @item underline Underline all text covered by this face. @@ -373,6 +373,14 @@ be a list of the form @code{(@var{width} @var{height} @var{data})} where @var{width} and @var{height} are the size in pixels, and @var{data} is a string, containing the raw bits of the bitmap. + +Similarly to how the glyph's image specifier works @xref{Creating +Glyphs}, you don't create your own image specifier, but rather add +specifications to the existing one. Note that the image instance that is +generated in order to actually display the background pixmap is of type +@code{mono-pixmap}, meaning that it's a two-color image and the +foreground and background of the image get filled in with the +corresponding colors from the face. (#### Is this still true?) @end deffn @deffn Command set-face-background-pixmap-file face file @@ -399,7 +407,7 @@ @end defun @defun face-background-pixmap face &optional locale tag-set exact-p -This function return the background-pixmap glyph object of face +This function returns the background-pixmap image specifier of face @var{face}. @end defun diff --text -u 'xemacs-21.5.17/man/lispref/glyphs.texi' 'xemacs-21.5.18/man/lispref/glyphs.texi' Index: ./man/lispref/glyphs.texi --- ./man/lispref/glyphs.texi Tue Dec 3 19:35:15 2002 +++ ./man/lispref/glyphs.texi Wed Sep 22 11:06:27 2004 @@ -7,735 +7,619 @@ @chapter Glyphs @cindex glyphs - A @dfn{glyph} is an object that is used for pixmaps, widgets and + A @dfn{glyph} is an object that is used for pixmaps, widgets, and images of all sorts, as well as for things that ``act'' like pixmaps, such as non-textual strings (@dfn{annotations}) displayed in a buffer or in the margins. It is used in begin-glyphs and end-glyphs attached to extents, marginal and textual annotations, overlay arrows (@code{overlay-arrow-*} variables), toolbar buttons, mouse pointers, frame icons, truncation and continuation markers, and the -like. (Basically, any place there is an image or something that acts -like an image, there will be a glyph object representing it.) - - The actual image that is displayed (as opposed to its position or -clipping) is defined by an @dfn{image specifier} object contained -within the glyph. The separation between an image specifier object -and a glyph object is made because the glyph includes other properties -than just the actual image: e.g. the face it is displayed in (for text -images), the alignment of the image (when it is in a buffer), etc. +like. Basically, any place there is an image or something that acts +like an image, there will be a glyph object representing it. @defun glyphp object This function returns @code{t} if @var{object} is a glyph. @end defun @menu -* Glyph Functions:: Functions for working with glyphs. -* Images:: Graphical images displayed in a frame. -* Glyph Types:: Each glyph has a particular type. -* Mouse Pointer:: Controlling the mouse pointer. -* Redisplay Glyphs:: Glyphs controlling various redisplay functions. -* Subwindows:: Inserting an externally-controlled subwindow - into a buffer. -* Glyph Examples:: Examples of how to work with glyphs. -@end menu - -@node Glyph Functions -@section Glyph Functions - -@menu -* Creating Glyphs:: Creating new glyphs. -* Glyph Properties:: Accessing and modifying a glyph's properties. -* Glyph Convenience Functions:: - Convenience functions for accessing particular - properties of a glyph. -* Glyph Dimensions:: Determining the height, width, etc. of a glyph. +* Glyph Intro:: Glyphs are abstract image specifications. +* Images:: Specifying the appearance of glyphs. +* Using Glyphs:: Creating and displaying glyphs. +* Manipulating Glyphs:: Getting and setting glyph properties. +* Glyph Examples:: Examples of how to work with glyphs. @end menu -@node Creating Glyphs -@subsection Creating Glyphs - -@defun make-glyph &optional spec-list type -This function creates a new glyph object of type @var{type}. -@var{spec-list} is used to initialize the glyph's image. It is -typically an image instantiator (a string or a vector; @ref{Image -Specifiers}), but can also be a list of such instantiators (each one in -turn is tried until an image is successfully produced), a cons of a -locale (frame, buffer, etc.) and an instantiator, a list of such conses, -or any other form accepted by @code{canonicalize-spec-list}. -@xref{Specifiers}, for more information about specifiers. - -@var{type} specifies the type of the glyph, which specifies in which -contexts the glyph can be used, and controls the allowable image types -into which the glyph's image can be instantiated. @var{type} should be -one of @code{buffer} (used for glyphs in an extent, the modeline, the -toolbar, or elsewhere in a buffer), @code{pointer} (used for the -mouse-pointer), or @code{icon} (used for a frame's icon), and defaults -to @code{buffer}. @xref{Glyph Types}. +@node Glyph Intro +@section Glyph Introduction -A glyph in XEmacs does @strong{NOT} refer to a single unit of textual -display (the XEmacs term for this is @dfn{rune}), but rather is an + In XEmacs, ``glyph'' does @strong{not} refer to a single unit of textual +display (the XEmacs term for that is @dfn{rune}, and runes are confined +to the internal implementation of redisplay), but rather is an object encapsulating a graphical element, such as an image or widget (an -element such as a button or text field; @dfn{widget} is the term for -this under X Windows, and it's called a @dfn{control} under MS Windows). +active GUI element such as a button or text entry field; X11 calls this a +@dfn{widget}, while MS Windows uses the term @dfn{control}). This graphical element could appear in a buffer, a margin, a gutter, or -a toolbar, or as a mouse pointer or an icon, for example. +a toolbar, or even externally to XEmacs as a mouse pointer or an icon, +for example. -Creating a glyph using @code{make-glyph} does not specify @emph{where} -the glyph will be used, but it does specify @emph{what} the glyph will -look like. In particular, @var{spec-list} is used to specify this, and it's -used to initialize the glyph's @code{image} property, which is an image -specifier. (Note that @dfn{image} as used in the context of a glyph's -@code{image} property or in the terms @dfn{image specifier}, @dfn{image -instantiator}, or @dfn{image instance} does not refer to what people -normally think of as an image (which in XEmacs is called a -@dfn{pixmap}), but to any graphical element---a pixmap, a widget, or -even a block of text, when used in the places that call for a glyph.) -The format of the @var{spec-list} is typically an image instantiator (a string -or a vector; @ref{Image Specifiers}), but can also be a list of such -instantiators (each one in turn is tried until an image is successfully -produced), a cons of a locale (frame, buffer, etc.) and an -instantiator, a list of such conses, or any other form accepted by -@code{canonicalize-spec-list}. @xref{Specifiers}, for more information -about specifiers. - -If you're not familiar with specifiers, you should be in order to -understand how glyphs work. The clearest introduction to specifiers -is in the Lispref manual, available under Info. (Choose -Help->Info->Info Contents on the menubar or type C-h i.) You can -also see @code{make-specifier} for a capsule summary. What's important to -keep in mind is that a specifier lets you set a different value for -any particular buffer, window, frame, device, or console. This allows -for a great deal of flexibility; in particular, only one global glyph -needs to exist for a particular purpose (e.g. the icon used to represent -an iconified frame, the mouse pointer used over particular areas of a -frame, etc.), and in these cases you do not create your own glyph, but -rather modify the existing one. + On the other hand, by contrast with GNU Emacs 21, an XEmacs glyph is +not ``just'' an image. The actual image that is displayed (as opposed +to its position or clipping) is defined by an ``image specifier'' object +contained within the glyph. The separation between an image specifier +object and a glyph object is made because the glyph includes other +properties than just the actual image: e.g. the face it is displayed in, +the alignment of the image, @emph{etc}. Also, an image specifier is +used in at least one place in XEmacs in lieu of a glyphs, namely the +backing pixmap of a face. + + An image specifier is used because glyphs often have locale-specific +semantics. The most important example is semantics determined by the +display device: you can't usefully display a JPEG on stdout, or a color +image on a monochrome display. But because the image property is a +specifier in XEmacs, you can specify that a given glyph appear as a +monochrome image on monochrome displays, a color image on color +displays, and as a string on TTYs. (Specifying a string for the +@code{tty} device locale would give behavior like the @code{ALT} +attribute of an @code{IMG} element in HTML.) Another is semantics +determined by the buffer or mode. (Unfortunately, currently there are +no compelling examples of this for glyphs.) + + All this means that only one global glyph needs to exist for a +particular purpose (e.g. the icon used to represent an iconified frame, +the mouse pointer used over particular areas of a frame, etc.). Often +you need not (and should not!) create your own glyph, but rather modify +an existing one. + + In working with glyphs it is important to keep in mind the distinction +between a locale and a domain. A @dfn{locale} is specified by the +programmer, and is an abstract link between a specification (for a +glyph, its visual appearance) and a displayable object. The displayable +object may be a buffer or a window, or an object containing buffers or +windows such as frame, device, or console. A @dfn{domain} is an actual +display context, which must be concrete enough to enable XEmacs to +identify the device type. (Buffers may be displayed in windows on +different devices, even simultaneously, so a buffer cannot be a domain. +Similarly, the global locale cannot be a domain.) @ref{Specifiers}, for +more information about specifier locales and domains. -As well as using @var{spec-list} to initialize the glyph, you can set -specifications using @code{set-glyph-image}. Note that, due to a -possibly questionable historical design decision, a glyph itself is not -actually a specifier, but rather is an object containing an image -specifier (as well as other, seldom-used properties). Therefore, you -cannot set or access specifications for the glyph's image by directly -using @code{set-specifier}, @code{specifier-instance} or the like on the -glyph; instead use them on @code{(glyph-image @var{glyph})} or use the -convenience functions @code{set-glyph-image}, -@code{glyph-image-instance}, and @code{glyph-image}. -Once you have created a glyph, you specify where it will be used as -follows: +@node Images +@section Images -@itemize @bullet -@item -To insert a glyph into a buffer, create an extent in the buffer and then -use @code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set -a glyph to be displayed at the corresponding edge of the extent. (It is -common to create zero-width extents for this purpose.) +@menu +* Image Specifiers:: Specifying an image's appearance. +* Image Instantiator Conversion:: Lazy realization of graphics. +* Image Instantiator Formats:: A catalog of image descriptors. +* Image Instances:: Classes of graphical objects. +@end menu -@item -To insert a glyph into the left or right margin of a buffer, first -make sure the margin is visible by setting a value for the specifiers -@code{left-margin-width} or @code{right-margin-width}. (Not strictly necessary -when using margin glyphs with layout policy @code{whitespace}.) Then follow -the same procedure above for inserting a glyph in a buffer, and then -set a non-default layout policy for the glyph using -@code{set-extent-begin-glyph-layout} or @code{set-extent-end-glyph-layout}. -Alternatively, use the high-level annotations API (see -@code{make-annotation}). (In point of fact, you can also use the annotations -API for glyphs in a buffer, by setting a layout policy of @code{text}.) -@item -To insert a glyph into the modeline, just put the glyph directly as one -of the modeline elements. (Unfortunately you can't currently put a begin -glyph or end glyph on one of the modeline extents---they're ignored.) +@node Image Specifiers +@subsection Image Specifiers +@cindex image specifiers -@item -To insert a glyph into a toolbar, specify it as part of a toolbar -instantiator (typically set on the specifier @code{default-toolbar}). -See @code{default-toolbar} for more information. (Note that it is -standard practice to use a symbol in place of the glyph list in the -toolbar instantiator; the symbol is evalled to get the glyph list. This -facilitates both creating the toolbar instantiator and modifying -individual glyphs in a toolbar later on. For example, you can change -the way that the Mail toolbar button looks by modifying the value of the -variable @code{toolbar-mail-icon} (in general, @code{toolbar-*-icon}) -and then calling @code{(set-specifier-dirty-flag default-toolbar)}. -(#### Unfortunately this doesn't quite work the way it should; the -change will appear in new frames, but not existing ones. + An image specifier is a description of the actual graphical +realization of a glyph. For example, a typical image description is +@emph{the file system path to a PNG file}. Since redisplay doesn't know +about files, and in any case the image may need to be manipulated +(@emph{e.g.}, a face's background pixmap must be clipped and tiled), the +PNG file must be converted internally to a window system bitmap or +pixmap object. We describe this process by writing that when XEmacs +displays the image, it @dfn{instantiates} the @dfn{image instantiator} +into an @dfn{image instance}. Image instances are an internal object +type (similar to font instances and color instances), describing how the +image appears in a particular domain. On the other hand, image +instantiators, which are just descriptions of how the image should +appear, are represented using Lisp strings or vectors. + +Furthermore the graphical realization will vary, and for some devices +may not even be a bitmapped graphic. These variations may be controlled +by the program by specifying different @dfn{image instantiators} in +different locales. This is implemented with an @dfn{image specifier}, +a specifier whose specifications are image instantiators. + +Image specifiers are rarely if ever found by themselves. However, an +image specifier results from calling @code{glyph-image} on a glyph, or +retrieving the @code{background-pixmap} property of a face, and you can +check if some random object is an image specifier. -@item -To insert a glyph into a gutter, create or modify a gutter instantiator -(typically set on the specifier @code{default-gutter}). Gutter -instantiators consist of strings or lists of strings, so to insert a -glyph, create an extent over the string, and use -@code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set a -glyph to be displayed at the corresponding edge of the extent, just like -for glyphs in a buffer. +@defun image-specifier-p object +This function returns non-@code{nil} if @var{object} is an image specifier. +@end defun -@item -To use a glyph as the icon for a frame, you do not actually create a new -glyph; rather, you change the specifications for the existing glyph -@code{frame-icon-glyph}. (Remember that, because of the specifier nature -of glyphs, you can set different values for any particular buffer or -frame.) +@defun make-image-specifier spec-list +This function creates a new image specifier object and initializes it +according to @var{spec-list}. @xref{Specifiers}. +@end defun -@item -To use a glyph as the mouse pointer, in general you do not create a new -glyph, but rather you change the specifications of various existing -glyphs, such as @code{text-pointer-glyph} for the pointer used over -text, @code{modeline-pointer-glyph} for the pointer used over the -modeline, etc. Do an apropos over @code{*-pointer-glyph} to find all of -them. (Note also that you can temporarily set the mouse pointer to some -specific shape by using @code{set-frame-pointer}, which takes an image -instance, as obtained from calling @code{glyph-image-instance} on a glyph -of type @code{pointer} -- either one of the above-mentioned variables or -one you created yourself. (See below for what it means to create a -glyph of type @code{pointer}.) This pointer will last only until the -next mouse motion event is processed or certain other things happen, -such as creating or deleting a window. (In fact, the above-mentioned -pointer glyph variables are implemented as part of the default handler -for mouse motion events. If you want to customize this behavior, take a -look at @code{mode-motion-hook}, or @code{mouse-motion-handler} if you -really want to get low-level.) +This function exists mainly for completeness. In practice, you rarely, +if ever, need to actually create an image specifier. Instead, they are +implicitly created by the initialization of glyphs and faces, and the +specifier member of these objects cannot be changed after +initialization; you may only set the specifications it contains. -@item -To use a glyph to control the shape of miscellaneous redisplay effects -such as the truncation and continuation markers, set the appropriate -existing glyph variables, as for icons and pointers above. See -@code{continuation-glyph}, @code{control-arrow-glyph}, -@code{hscroll-glyph}, @code{invisible-text-glyph}, -@code{octal-escape-glyph}, and @code{truncation-glyph}. See also -@code{overlay-arrow-string}, an odd redisplay leftover which can be set -to a glyph you created, and will cause the glyph to be displayed on top -of the text position specified in the marker stored in -@code{overlay-arrow-position}. +Image instantiators come in many formats: @code{xbm}, @code{xpm}, +@code{gif}, @code{jpeg}, etc. These denote the format of the data +describing the image. The resulting image instances also come in many +types---@code{mono-pixmap}, @code{color-pixmap}, @code{text}, +@code{pointer}, etc. This refers to the behavior of the image and the +sorts of places it can appear. (For example, a color-pixmap image has +fixed colors specified for it, while a mono-pixmap image comes in two +unspecified shades ``foreground'' and ``background'' that are determined +from the face of the glyph or surrounding text; a text image appears as +a string of text and has an unspecified foreground, background, and +font; a pointer image behaves like a mono-pixmap image but can only be +used as a mouse pointer [mono-pixmap images cannot be used as mouse +pointers]; etc.) -@item -To use a glyph in a display table (i.e. to control the appearance of any -individual character), create the appropriate character glyphs and then -set a specification for the specifier @code{current-display-table}, -which controls the appearance of characters. You can also set an -overriding display table for use with text displayed in a particular -face; see @code{set-face-display-table} and @code{make-display-table}. -#### Note: Display tables do not currently support general Mule -characters. They will be overhauled at some point to support this -and to provide other features required under Mule. +It is important to keep the distinction between image instantiator +format and image instance type in mind. Typically, a given image +instantiator format can result in many different image instance types. +For example, @code{xpm} can be instanced as @code{color-pixmap}, +@code{mono-pixmap}, or @code{pointer}; whereas @code{cursor-font} can be +instanced only as @code{pointer}. On the other hand, a particular image +instance type can be generated by many different image instantiator +formats (e.g. @code{color-pixmap} can be generated by @code{xpm}, +@code{gif}, @code{jpeg}, etc.). -@item -To use a glyph as the background pixmap of a face: Note that the -background pixmap of a face is actually an image specifier -- probably -the only place in XEmacs where an image specifier occurs outside of a -glyph. Similarly to how the glyph's image specifier works, you don't -create your own image specifier, but rather add specifications to the -existing one (using @code{set-face-background-pixmap-file} or -@code{set-face-background-pixmap}). Note that the image instance that is -generated in order to actually display the background pixmap is of type -@code{mono-pixmap}, meaning that it's a two-color image and the -foreground and background of the image get filled in with the -corresponding colors from the face. -@end itemize + @xref{Image Instances}, for a more detailed discussion of image +instance types. -It is extremely rare that you will ever have to specify a value for -@var{type}, which should be one of @code{buffer} (used for glyphs in an -extent, the modeline, the toolbar, or elsewhere in a buffer), -@code{pointer} (used for the mouse-pointer), or @code{icon} (used for a -frame's icon), and defaults to @code{buffer}. The only cases where it -needs to be specified is when creating icon or pointer glyphs, and in -both cases the necessary glyphs have already been created at startup and -are accessed through the appropriate variables, -e.g. @code{text-pointer-glyph} (or in general, @code{*-pointer-glyph}) -and @code{frame-icon-glyph}. @xref{Glyph Types}. -@end defun + An image instantiator should be a string or a vector of the form -@defun make-glyph-internal &optional type -This function creates a new, uninitialized glyph of type @var{type}. -@end defun +@example + @code{[@var{format} @var{:keyword} @var{value} ...]} +@end example -@defun make-pointer-glyph &optional spec-list +i.e. a format symbol followed by zero or more alternating keyword-value +pairs. -Return a new @code{pointer-glyph} object with the specification list -@var{spec-list}. This function is equivalent to calling -@code{make-glyph} with a @var{type} of @code{pointer}. +The form of an instantiator can be checked with +@code{valid-instantiator-p} with a @var{TYPE} of @code{image}, +@ref{Specifier Validation Functions}. + +For a complete list of the format symbols and their usage, +@ref{Image Instantiator Formats}. + +If the instantiator is a string, it will be converted into a vector by +looking it up according to the specs in the +@code{console-type-image-conversion-list} for the console type of the +domain (usually a window; sometimes a frame or device) over which the +image is being instantiated. -It is extremely unlikely that you will ever need to create a pointer -glyph. Instead, you probably want to be calling @code{set-glyph-image} -on an existing glyph, e.g. @code{text-pointer-glyph}. -@end defun +If the instantiator specifies data from a file, the data will be read in +at the time that the instantiator is added to the image specifier (which +may be well before the image is actually displayed), and the +instantiator will be converted into one of the inline-data forms, with +the filename retained using a @code{:file} keyword. This implies that +the file must exist when the instantiator is added to the image, but +does not need to exist at any other time (e.g. it may safely be a +temporary file). -@defun make-icon-glyph &optional spec-list +The available keywords are given below. Note that some keywords are +generally available (for example, the @code{:data} keyword may be used +with any format except @code{nothing}), while others are only available +for one format (@code{resource-id} is unique to the +@code{mswindows-resource} format). -Return a new @code{pointer-glyph} object with the specification list -@var{spec-list}. This function is equivalent to calling -@code{make-glyph} with a @var{type} of @code{icon}. +@table @code +@item :data +Inline image data. If available for a given format, it may be specified +directly by the program, or it may be a cache of file data previously +read. When present, it is used to instantiate the image in preference +to the file named by the @code{:file} property. + +The format of inline data is image-format-specific. For example, in +pixmap formats, the value should be a string, which is interpreted as an +octet-stream representing a bitmap or pixmap. But for text formats, +it's string containing the text to be displayed, and for resource +formats, it's a string containing the name of the resource. -It is extremely unlikely that you will ever need to create a pointer -glyph. Instead, you probably want to be calling @code{set-glyph-image} -on an existing glyph, e.g. @code{text-pointer-glyph}. -@end defun +@item :file +Data contained in a file. The value is the name of this file. If both +@code{:data} and @code{:file} are specified, the image is created from +what is specified in @code{:data} and the string in @code{:file} becomes +the value of the @code{image-instance-file-name} function when applied +to the resulting image-instance. Note that there is nothing to stop a +program from changing either the @code{:file} or the @code{:data} +property, and there is no way to detect such mischief. This means that +the data will @emph{not} be automatically reread if you change the +@code{file} property; you must force it by removing the @code{:data} +property. +@c #### If there are ways to do this in-place, describe them. +(One way to do this is replacing the whole specification with a new +vector.) This keyword is not valid for instantiator formats +@code{nothing}, @code{string}, @code{formatted-string}, +@code{cursor-font}, @code{font}, and @code{autodetect}. -@node Glyph Properties -@subsection Glyph Properties +@item :mask-data +Inline data for @code{xbm} and @code{xface}. This specifies a mask to +be used with the bitmap. Pixels which are not set in the mask will not +be written to the imaging device. The format is a list of width, +height, and bits, as for @code{:data}. -Each glyph has a list of properties, which control all of the aspects of -the glyph's appearance. The following symbols have predefined meanings: +@item :mask-file +For @code{xbm} and @code{xface}. This specifies a file containing the +mask data. If neither a mask file nor inline mask data is given for an +XBM image, and the XBM image comes from a file, XEmacs will look for a +mask file with the same name as the image file but with @samp{Mask} or +@samp{msk} appended. For example, if you specify the XBM file +@file{left_ptr} [usually located in @file{/usr/include/X11/bitmaps}], +the associated mask file @file{left_ptrmsk} will automatically be picked +up. -@table @code -@item image -The image used to display the glyph. +@item :resource-id +Only for @code{mswindows-resource}. This must be either an integer +(which directly specifies a resource number) or a string. See the +description of @code{mswindows-resource} for valid strings. @xref{Image +Instantiator Formats}. -@item baseline -Percent above baseline that glyph is to be displayed. Only for glyphs -displayed inside of a buffer. +@item :foreground +@itemx :background +For @code{xbm}, @code{xface}, @code{cursor-font}, and @code{font}. +These keywords allow you to explicitly specify foreground and background +colors. The value should be anything acceptable to +@code{make-color-instance}. This will cause an external format that +would by default be instantiated as a @code{mono-pixmap} to instead be +instantiated as a two-color color-pixmap. This can be used to override +the colors specified by a glyph's face, for example. If the image is +instantiated as a pointer, they specify its foreground and/or +background, instead of the defaults of black and white. -@item contrib-p -Whether the glyph contributes to the height of the line it's on. -Only for glyphs displayed inside of a buffer. +@item :hotspot-x +@itemx :hotspot-y +For @code{xbm} and @code{xface}. These keywords specify a hotspot if +the image is instantiated as a @code{pointer}. Note that if the XBM +image file specifies a hotspot, it will automatically be picked up if no +explicit hotspot is given. -@item face -Face of this glyph (@emph{not} a specifier). +@item :color-symbols +Only for @code{xpm}. This specifies an alist that maps strings that +specify symbolic color names to the actual color to be used for that +symbolic color (in the form of a string or a color-specifier object). +If this is not specified, the contents of @code{xpm-color-symbols} are +used to generate the alist. + +@item :resource-type +Only for @code{mswindows-resource}. This must be a symbol, either +@code{cursor}, @code{icon}, or @code{bitmap}, specifying the type of +resource to be retrieved. + +@item :face +For @code{inherit} and the widget formats. This specifies the face to +inherit from. For widgets this specifies the face to use for display. +It defaults to gui-element-face. + +@item :selected +@itemx :active +@itemx :suffix +@itemx :keys +@itemx :style +@itemx :filter +@itemx :config +@itemx :included +@itemx :key-sequence +@itemx :accelerator +@itemx :label +@itemx :callback +These keywords, accepted as menu item specs, are also accepted by images +instantiated as @code{widget}. For their semantics, @ref{Menu Format}. @end table -@defun set-glyph-property glyph property value &optional locale tag-set how-to-add -This function changes a property of a @var{glyph}. -For built-in properties, the actual value of the property is a specifier -and you cannot change this; but you can change the specifications within -the specifier, and that is what this function will do. For user-defined -properties, you can use this function to either change the actual value -of the property or, if this value is a specifier, change the -specifications within it. +@node Image Instantiator Conversion +@subsection Image Instantiator Conversion +@cindex image instantiator conversion +@cindex conversion of image instantiators -If @var{property} is a built-in property, the specifications to be added -to this property can be supplied in many different ways: +Conversion is applied to image instantiators at the time they are added +to an image specifier or at the time they are passed to +@code{make-image-instance}. -@itemize @bullet -@item -If @var{value} is a simple instantiator (e.g. a string naming a pixmap -filename) or a list of instantiators, then the instantiator(s) will be -added as a specification of the property for the given @var{locale} -(which defaults to @code{global} if omitted). +@defun set-console-type-image-conversion-list console-type list +This function sets the image-conversion-list for consoles of the given +@var{console-type}. The image-conversion-list specifies how image +instantiators that are strings should be interpreted. Each element of +the list should be a list of two elements (a regular expression string +and a vector) or a list of three elements (the preceding two plus an +integer index into the vector). The string is converted to the vector +associated with the first matching regular expression. If a vector +index is specified, the string itself is substituted into that position +in the vector. -@item -If @var{value} is a list of specifications (each of which is a cons of a -locale and a list of instantiators), then @var{locale} must be -@code{nil} (it does not make sense to explicitly specify a locale in -this case), and specifications will be added as given. +Note: The conversion above is applied when the image instantiator is +added to an image specifier, not when the specifier is actually +instantiated. Therefore, changing the image-conversion-list only affects +newly-added instantiators. Existing instantiators in glyphs and image +specifiers will not be affected. +@end defun -@item -If @var{value} is a specifier (as would be returned by -@code{glyph-property} if no @var{locale} argument is given), then some -or all of the specifications in the specifier will be added to the -property. In this case, the function is really equivalent to -@code{copy-specifier} and @var{locale} has the same semantics (if it is -a particular locale, the specification for the locale will be copied; if -a locale type, specifications for all locales of that type will be -copied; if @code{nil} or @code{all}, then all specifications will be -copied). -@end itemize +@defun console-type-image-conversion-list console-type +This function returns the image-conversion-list for consoles of the given +@var{console-type}. +@end defun -@var{how-to-add} should be either @code{nil} or one of the symbols -@code{prepend}, @code{append}, @code{remove-tag-set-prepend}, -@code{remove-tag-set-append}, @code{remove-locale}, -@code{remove-locale-type}, or @code{remove-all}. See -@code{copy-specifier} and @code{add-spec-to-specifier} for a description -of what each of these means. Most of the time, you do not need to worry -about this argument; the default behavior usually is fine. -In general, it is OK to pass an instance object (e.g. as returned by -@code{glyph-property-instance}) as an instantiator in place of an actual -instantiator. In such a case, the instantiator used to create that -instance object will be used (for example, if you set a font-instance -object as the value of the @code{font} property, then the font name used -to create that object will be used instead). If some cases, however, -doing this conversion does not make sense, and this will be noted in the -documentation for particular types of instance objects. +@node Image Instantiator Formats +@subsection Image Instantiator Formats +@cindex image instantiator formats + +The @dfn{format} field of an image instantiator should be a symbol +denoting a valid format. Which formats are valid will depend on the +features (such as image decoding libraries) available, on platform +support (MS Windows resource IDs make no sense on other platforms), and +on the locale. -If @var{property} is not a built-in property, then this function will -simply set its value if @var{locale} is @code{nil}. However, if -@var{locale} is given, then this function will attempt to add -@var{value} as the instantiator for the given @var{locale}, using -@code{add-spec-to-specifier}. If the value of the property is not a -specifier, it will automatically be converted into a @code{generic} -specifier. -@end defun +@defun valid-image-instantiator-format-p format &optional locale +This function returns non-@code{nil} if @var{format} is a valid image +instantiator format. -@defun glyph-property glyph property &optional locale -This function returns @var{glyph}'s value of the given @var{property}. +If @var{locale} is non-@code{nil} then the format is checked in that locale. +If @var{locale} is @code{nil} the current console is used. -If @var{locale} is omitted, the @var{glyph}'s actual value for -@var{property} will be returned. For built-in properties, this will be -a specifier object of a type appropriate to the property (e.g. a font or -color specifier). For other properties, this could be anything. +Note that the return value for many formats listed above depends on +whether XEmacs was compiled with support for that format. +@end defun -If @var{locale} is supplied, then instead of returning the actual value, -the specification(s) for the given locale or locale type will be -returned. This will only work if the actual value of @var{property} is -a specifier (this will always be the case for built-in properties, but -may or may not apply to user-defined properties). If the actual value -of @var{property} is not a specifier, this value will simply be returned -regardless of @var{locale}. +@defun image-instantiator-format-list +This function returns a list of valid image-instantiator formats. +@end defun -The return value will be a list of instantiators (e.g. vectors -specifying pixmap data), or a list of specifications, each of which is a -cons of a locale and a list of instantiators. Specifically, if -@var{locale} is a particular locale (a buffer, window, frame, device, or -@code{global}), a list of instantiators for that locale will be -returned. Otherwise, if @var{locale} is a locale type (one of the -symbols @code{buffer}, @code{window}, @code{frame}, or @code{device}), -the specifications for all locales of that type will be returned. -Finally, if @var{locale} is @code{all}, the specifications for all -locales of all types will be returned. +Here is a table of image-instantiator formats, giving the keywords that +are usable with each, and the kinds of instances that may result. -The specifications in a specifier determine what the value of -@var{property} will be in a particular @dfn{domain} or set of -circumstances, which is typically a particular Emacs window along with -the buffer it contains and the frame and device it lies within. The -value is derived from the instantiator associated with the most specific -locale (in the order buffer, window, frame, device, and @code{global}) -that matches the domain in question. In other words, given a domain -(i.e. an Emacs window, usually), the specifier for @var{property} will -first be searched for a specification whose locale is the buffer -contained within that window; then for a specification whose locale is -the window itself; then for a specification whose locale is the frame -that the window is contained within; etc. The first instantiator that -is valid for the domain (usually this means that the instantiator is -recognized by the device [i.e. the X server or TTY device] that the -domain is on). The function @code{glyph-property-instance} actually does -all this, and is used to determine how to display the glyph. -@end defun +@table @code +@item nothing +Don't display anything; no keywords are valid for this format. Can only be +instanced as @code{nothing}. -@defun glyph-property-instance glyph property &optional domain default no-fallback -This function returns the instance of @var{glyph}'s @var{property} in the -specified @var{domain}. +@item string +Display this image as a text string. Can only be instanced +as @code{text}, although support for instancing as @code{mono-pixmap} +should be added. The valid keyword is @code{:data}. The value should +be a string, and it is interpreted as a string of characters. -Under most circumstances, @var{domain} will be a particular window, and -the returned instance describes how the specified property actually is -displayed for that window and the particular buffer in it. Note that -this may not be the same as how the property appears when the buffer is -displayed in a different window or frame, or how the property appears in -the same window if you switch to another buffer in that window; and in -those cases, the returned instance would be different. +@item formatted-string +Display this image as a text string with replaceable fields, +similar to a modeline format string. The valid keyword is @code{:data}. +The value should be a string, and it is interpreted as a string of +characters containing format sequences. -The returned instance is an image-instance object, and you can query it -using the appropriate image instance functions. For example, you could use -@code{image-instance-depth} to find out the depth (number of color -planes) of a pixmap displayed in a particular window. The results might -be different from the results you would get for another window (perhaps -the user specified a different image for the frame that window is on; or -perhaps the same image was specified but the window is on a different X -server, and that X server has different color capabilities from this -one). +Not currently implemented. -@var{domain} defaults to the selected window if omitted. +@item xbm +An X bitmap; available only if X support was compiled into this XEmacs. -@var{domain} can be a frame or device, instead of a window. The value -returned for such a domain is used in special circumstances when a -more specific domain does not apply; for example, a frame value might be -used for coloring a toolbar, which is conceptually attached to a frame -rather than a particular window. The value is also useful in -determining what the value would be for a particular window within the -frame or device, if it is not overridden by a more specific -specification. +If used in a buffer glyph, icon glyph, or face background pixmap, it +will be instantiated as @code{mono-pixmap} unless the @code{:foreground} +or @code{:background} keywords are present. In the latter case it will +be instantiated as @code{color-pixmap} with the two specified colors. +@c #### Check this. +(Probably if @code{:foreground} or @code{:background} is omitted, it +defaults to black or white respectively.) If used in a pointer glyph, +it will be instantiated as an @code{pointer}. -If @var{property} does not name a built-in property, its value will -simply be returned unless it is a specifier object, in which case it -will be instanced using @code{specifier-instance}. +The valid keywords and their values are +@table @code +@item :data +A list containing the height and width of the bitmap as integers, and +a string interpreted as a bit vector according to the X11 standard XBM +bitmap format, in that order. +@item :file +The name of a file containing standard XBM-format data. If it contains +a hotspot specification, it will be parsed and used if the hotspot is +not explicitly specified. +@item :mask-data +A list containing the height and width of the bitmap as integers, and +a string interpreted as a bit vector according to the X11 standard XBM +bitmap format, in that order. This bitmap is interpreted as the +clipping region for the bitmap contained in the @code{:data} property. +@item :mask-file +The name of a file containing standard XBM-format data. Interpreted as +the clipping region for the bitmap contained in the @code{:data} property. +@item :foreground +@itemx :background +These keywords allow you to explicitly specify foreground and background +colors. The values should be acceptable to @code{make-color-instance}. +@item :hotspot-x +@itemx :hotspot-y +Integers denoting the hotspot (mouse pointer position), with (0,0) at +the top left corner. If given, these override any specification in the +XBM file. +@end table -Optional arguments @var{default} and @var{no-fallback} are the same as -in @code{specifier-instance}. @xref{Specifiers}. -@end defun +@item xpm +An XPM pixmap; only available if XPM support was compiled into this XEmacs. -@defun remove-glyph-property glyph property &optional locale tag-set exact-p -This function removes a property from a glyph. For built-in properties, -this is analogous to @code{remove-specifier}. @xref{Specifiers, -remove-specifier-p}, for the meaning of the @var{locale}, @var{tag-set}, -and @var{exact-p} arguments. -@end defun +Can be instanced as @code{color-pixmap}, @code{mono-pixmap}, or +@code{pointer}. -@node Glyph Convenience Functions -@subsection Glyph Convenience Functions +XPM is an add-on library for X that was designed to rectify the +shortcomings of the XBM format. Many icons and labels used in the +XEmacs GUI are still distributed in XPM format (although we are moving +to standardize on the PNG format). It is therefore highly desirable +that XPM be available in your XEmacs. + +Most implementations of X include the XPM library as a standard part. +If your vendor does not, it is highly recommended that you download it +and install it. You can get it from the XEmacs FTP site and mirrors, as +well as from most sites that distribute X11. - The following functions are provided for working with specific -properties of a glyph. Note that these are exactly like calling -the general functions described above and passing in the -appropriate value for @var{property}. +The valid keywords and their values are +@table @code +@item :data +A string interpreted as the contents of a standard XPM file. +@item :file +The name of a file containing standard XPM-format data. If it contains +a hotspot specification, it will be parsed and used if the hotspot is +not explicitly specified. +@c #### Does XPM provide for a hotspot? +@item :hotspot-x +@itemx :hotspot-y +Integers denoting the hotspot (mouse pointer position), with (0,0) at +the top left corner. If given, these override any specification in the +XBM file. +@c #### Check this. +(This may not be true. The original documentation doesn't mention them +in connection with XPM, but a pointer needs a hotspot.) +@item :color-symbols +An alist that maps the one- or two-character strings that specify +symbolic color names in the XPM file to the actual color to be used for +that symbolic color (in the form of a string acceptable as a color +instantiator, @ref{Color Specifiers}, or a color-specifier object). +If this is not specified, the contents of @code{xpm-color-symbols} are +used to generate the alist. +@end table - Remember that if you want to determine the ``value'' of a -specific glyph property, you probably want to use the @code{*-instance} -functions. For example, to determine whether a glyph contributes -to its line height, use @code{glyph-contrib-p-instance}, not -@code{glyph-contrib-p}. (The latter will return a boolean specifier -or a list of specifications, and you probably aren't concerned with -these.) +@item xface +An X-Face bitmap, used to encode people's faces in e-mail messages; +only available if X-Face support was compiled into this XEmacs. -@defun glyph-image glyph &optional locale -This function is equivalent to calling @code{glyph-property} with -a property of @code{image}. The return value will be an image -specifier if @var{locale} is @code{nil} or omitted; otherwise, -it will be a specification or list of specifications. -@end defun +Will be instanced as @code{mono-pixmap}, @code{color-pixmap}, or +@code{pointer}, depending on the target instance type and the presence +of color keywords. -@defun set-glyph-image glyph spec &optional locale tag-set how-to-add -This function is equivalent to calling @code{set-glyph-property} with -a property of @code{image}. -@end defun +The valid keywords and their values are +@table @code +@item :data +A list containing the height and width of the bitmap as integers, and +a string interpreted as a bit vector according to the X11 standard XBM +bitmap format, in that order. +@item :file +The name of a file containing standard XBM-format data. If it contains +a hotspot specification, it will be parsed and used if the hotspot is +not explicitly specified. +@item :mask-data +A list containing the height and width of the bitmap as integers, and +a string interpreted as a bit vector according to the X11 standard XBM +bitmap format, in that order. This bitmap is interpreted as the +clipping region for the bitmap contained in the @code{:data} property. +@item :mask-file +The name of a file containing standard XBM-format data. Interpreted as +the clipping region for the bitmap contained in the @code{:data} property. +@item :foreground +@itemx :background +These keywords allow you to explicitly specify foreground and background +colors. The values should be acceptable to @code{make-color-instance}. +@item :hotspot-x +@itemx :hotspot-y +Integers denoting the hotspot (mouse pointer position), with (0,0) at +the top left corner. If given, these override any specification in the +XBM file. +@end table -@defun glyph-image-instance glyph &optional domain default no-fallback -This function returns the instance of @var{glyph}'s image in the given -@var{domain}, and is equivalent to calling -@code{glyph-property-instance} with a property of @code{image}. The -return value will be an image instance. +@item gif +@itemx jpeg +@itemx png +@itemx tiff +These are GIF87- or GIF89-format, JPEG-format, PNG/GIF24-format, and +TIFF-format images, respectively. They are available only if +appropriate decoding support was built into XEmacs. XEmacs includes GIF +decoding functions as a standard part of it, so if you have X support, +you will normally have GIF support, unless you explicitly disable it at +configure time. If you have development support (both the libraries and +the relevant C header files) available when XEmacs is built, the JPEG, +PNG, and TIFF libraries will automatically be detected (in the ``usual +places'') and linked into the build. -Normally @var{domain} will be a window or @code{nil} (meaning the -selected window), and an instance object describing how the image -appears in that particular window and buffer will be returned. -@end defun +Note that PNG is the standard format for images distributed with XEmacs, +so it is highly recommended that PNG support be built in. -@defun glyph-contrib-p glyph &optional locale -This function is equivalent to calling @code{glyph-property} with -a property of @code{contrib-p}. The return value will be a boolean -specifier if @var{locale} is @code{nil} or omitted; otherwise, -it will be a specification or list of specifications. -@end defun +All of these instantiators will be instanced as @code{color-pixmap}. -@defun set-glyph-contrib-p glyph spec &optional locale tag-set how-to-add -This function is equivalent to calling @code{set-glyph-property} with -a property of @code{contrib-p}. -@end defun +The valid keywords and their values are +@table @code +@item :data +A string interpreted as the contents of a file containing data in the +appropriate standard format. +@item :file +The name of a file containing standard-format data. +@end table -@defun glyph-contrib-p-instance glyph &optional domain default no-fallback -This function returns whether the glyph contributes to its line height -in the given @var{domain}, and is equivalent to calling -@code{glyph-property-instance} with a property of @code{contrib-p}. The -return value will be either @code{nil} or @code{t}. (Normally @var{domain} -will be a window or @code{nil}, meaning the selected window.) -@end defun +@item cursor-font +Most window systems provide a set of standard cursors, which in X11 is +called a cursor font. Can only be instanced as @code{pointer}. This +should probably be fixed. + +The valid keyword is @code{:data}. Its value should be a string +containing one of the standard cursor-font names, such as @samp{watch} +or @samp{right_ptr} under X. More specifically, in the X Window System +it may be any of the standard cursor names from appendix B of the Xlib +manual, provided in the file @file{<X11/cursorfont.h>} by most +distributions, minus the @samp{XC_} prefix. For MS Windows, use +@code{mswindows-resource} instantiator format, not @code{cursor-font}. +Other window systems may have different lists. -@defun glyph-baseline glyph &optional locale -This function is equivalent to calling @code{glyph-property} with a -property of @code{baseline}. The return value will be a specifier if -@var{locale} is @code{nil} or omitted; otherwise, it will be a -specification or list of specifications. -@end defun +@item font +A glyph from a font; i.e. the name of a font, and glyph index into it +of the form @samp{@var{font} fontname index [[mask-font] mask-index]}. +Only if X support was compiled into this XEmacs. Currently can only be +instanced as @code{pointer}. This should probably be fixed. +@c #### The above description is not very helpful, so it's not obvious +@c how to instantiate a font image. -@defun set-glyph-baseline glyph spec &optional locale tag-set how-to-add -This function is equivalent to calling @code{set-glyph-property} with -a property of @code{baseline}. -@end defun +@item mswindows-resource +An MS Windows pointer resource. Specifies a resource to retrieve +directly from the system (an OEM resource) or from a file, particularly +an executable file. Can be instanced as @code{pointer} or +@code{color-pixmap}. -@defun glyph-baseline-instance glyph &optional domain default no-fallback -This function returns the instance of @var{glyph}'s baseline value in -the given @var{domain}, and is equivalent to calling -@code{glyph-property-instance} with a property of @code{baseline}. The -return value will be an integer or @code{nil}. +The valid keywords and their values are -Normally @var{domain} will be a window or @code{nil} (meaning the -selected window), and an instance object describing the baseline value -appears in that particular window and buffer will be returned. -@end defun +@table @code +@item :resource-type +A string naming the type (@code{cursor}, @code{bitmap}, or @code{icon}) +of the resource. Required. +@item :file +A string containing the name of the file containing the resource (often +an executable). If a system resource, @code{:file} should be omitted. +@item :resource-id +A string containing the name of a resource. Required if @code{:file} +is not specified. -@defun glyph-face glyph -This function returns the face of @var{glyph}. (Remember, this is -not a specifier, but a simple property.) -@end defun +This must be either an integer (which directly specifies a resource +number) or a string. Valid strings are -@defun set-glyph-face glyph face -This function changes the face of @var{glyph} to @var{face}. -@end defun +For bitmaps: -@node Glyph Dimensions -@subsection Glyph Dimensions +"close", "uparrow", "dnarrow", "rgarrow", "lfarrow", +"reduce", "zoom", "restore", "reduced", "zoomd", +"restored", "uparrowd", "dnarrowd", "rgarrowd", "lfarrowd", +"mnarrow", "combo", "uparrowi", "dnarrowi", "rgarrowi", +"lfarrowi", "size", "btsize", "check", "checkboxes", and +"btncorners". -@defun glyph-width glyph &optional window -This function returns the width of @var{glyph} on @var{window}. This -may not be exact as it does not take into account all of the context -that redisplay will. -@end defun +For cursors: -@defun glyph-ascent glyph &optional window -This function returns the ascent value of @var{glyph} on @var{window}. -This may not be exact as it does not take into account all of the -context that redisplay will. -@end defun - -@defun glyph-descent glyph &optional window -This function returns the descent value of @var{glyph} on @var{window}. -This may not be exact as it does not take into account all of the -context that redisplay will. -@end defun - -@defun glyph-height glyph &optional window -This function returns the height of @var{glyph} on @var{window}. (This -is equivalent to the sum of the ascent and descent values.) This may -not be exact as it does not take into account all of the context that -redisplay will. -@end defun - -@node Images -@section Images - -@menu -* Image Specifiers:: Specifying how an image will appear. -* Image Instantiator Conversion:: - Conversion is applied to image instantiators - at the time they are added to an - image specifier or at the time they - are passed to @code{make-image-instance}. -* Image Instances:: What an image specifier gets instanced as. -@end menu - -@node Image Specifiers -@subsection Image Specifiers -@cindex image specifiers - - An image specifier is used to describe the actual image of a glyph. -It works like other specifiers (@pxref{Specifiers}), in that it contains -a number of specifications describing how the image should appear in a -variety of circumstances. These specifications are called @dfn{image -instantiators}. When XEmacs wants to display the image, it instantiates -the image into an @dfn{image instance}. Image instances are their own -primitive object type (similar to font instances and color instances), -describing how the image appears in a particular domain. (On the other -hand, image instantiators, which are just descriptions of how the image -should appear, are represented using strings or vectors.) - -@defun image-specifier-p object -This function returns non-@code{nil} if @var{object} is an image specifier. -Usually, an image specifier results from calling @code{glyph-image} on -a glyph. -@end defun - -@defun make-image-specifier spec-list -This function creates a new image specifier object and initializes it -according to @var{spec-list}. @xref{Specifiers}. - -Note that, in practice, you rarely, if ever, need to actually create an -image specifier! (This function exists mainly for completeness.) Pretty -much the only use for image specifiers is to control how glyphs are -displayed, and the image specifier associated with a glyph (the -@code{image} property of a glyph) is created automatically when a glyph -is created and need not (and cannot, for that matter) ever be changed -(@pxref{Glyphs}). In fact, the design decision to create a separate -image specifier type, rather than make glyphs themselves be specifiers, -is debatable---the other properties of glyphs are rarely used and could -conceivably have been incorporated into the glyph's instantiator. The -rarely used glyph types (buffer, pointer, icon) could also have been -incorporated into the instantiator. -@end defun - - Image instantiators come in many formats: @code{xbm}, @code{xpm}, -@code{gif}, @code{jpeg}, etc. This describes the format of the data -describing the image. The resulting image instances also come in many -types---@code{mono-pixmap}, @code{color-pixmap}, @code{text}, -@code{pointer}, etc. This refers to the behavior of the image and the -sorts of places it can appear. (For example, a color-pixmap image has -fixed colors specified for it, while a mono-pixmap image comes in two -unspecified shades ``foreground'' and ``background'' that are determined -from the face of the glyph or surrounding text; a text image appears as -a string of text and has an unspecified foreground, background, and -font; a pointer image behaves like a mono-pixmap image but can only be -used as a mouse pointer [mono-pixmap images cannot be used as mouse -pointers]; etc.) It is important to keep the distinction between image -instantiator format and image instance type in mind. Typically, a given -image instantiator format can result in many different image instance -types (for example, @code{xpm} can be instanced as @code{color-pixmap}, -@code{mono-pixmap}, or @code{pointer}; whereas @code{cursor-font} can be -instanced only as @code{pointer}), and a particular image instance type -can be generated by many different image instantiator formats (e.g. -@code{color-pixmap} can be generated by @code{xpm}, @code{gif}, -@code{jpeg}, etc.). - - @xref{Image Instances}, for a more detailed discussion of image -instance types. - - An image instantiator should be a string or a vector of the form +"normal", "ibeam", "wait", "cross", "up", "sizenwse", +"sizenesw", "sizewe", "sizens", "sizeall", and "no". -@example - @code{[@var{format} @var{:keyword} @var{value} ...]} -@end example +For icons: -i.e. a format symbol followed by zero or more alternating keyword-value -pairs. The @dfn{format} field should be a symbol, one of +"sample", "hand", "ques", "bang", "note", and "winlogo". +@end table -@table @code -@item nothing -Don't display anything; no keywords are valid for this. Can only be -instanced as @code{nothing}. -@item string -Display this image as a text string. Can only be instanced -as @code{text}, although support for instancing as @code{mono-pixmap} -should be added. -@item formatted-string -Display this image as a text string with replaceable fields, -similar to a modeline format string; not currently implemented. -@item xbm -An X bitmap; only if X support was compiled into this XEmacs. Can be -instanced as @code{mono-pixmap}, @code{color-pixmap}, or -@code{pointer}. -@item xpm -An XPM pixmap; only if XPM support was compiled into this XEmacs. Can -be instanced as @code{color-pixmap}, @code{mono-pixmap}, or -@code{pointer}. XPM is an add-on library for X that was designed to -rectify the shortcomings of the XBM format. Most implementations of X -include the XPM library as a standard part. If your vendor does not, it -is highly recommended that you download it and install it. You can get -it from the standard XEmacs FTP site, among other places. -@item xface -An X-Face bitmap, used to encode people's faces in e-mail messages; -only if X-Face support was compiled into this XEmacs. Can be instanced -as @code{mono-pixmap}, @code{color-pixmap}, or @code{pointer}. -@item gif -A GIF87 or GIF89 image; only if GIF support was compiled into this -XEmacs. Can be instanced as @code{color-pixmap}. Note that XEmacs -includes GIF decoding functions as a standard part of it, so if you have -X support, you will normally have GIF support, unless you explicitly -disable it at configure time. -@item jpeg -A JPEG-format image; only if JPEG support was compiled into this -XEmacs. Can be instanced as @code{color-pixmap}. If you have the JPEG -libraries present on your system when XEmacs is built, XEmacs will -automatically detect this and use them, unless you explicitly disable it -at configure time. -@item png -A PNG/GIF24 image; only if PNG support was compiled into this XEmacs. -Can be instanced as @code{color-pixmap}. -@item tiff -A TIFF-format image; only if TIFF support was compiled into this XEmacs. -@item cursor-font -One of the standard cursor-font names, such as @samp{watch} or -@samp{right_ptr} under X. Under X, this is, more specifically, any of -the standard cursor names from appendix B of the Xlib manual [also known -as the file @file{<X11/cursorfont.h>}] minus the @samp{XC_} prefix. On -other window systems, the valid names will be specific to the type of -window system. Can only be instanced as @code{pointer}. -@item font -A glyph from a font; i.e. the name of a font, and glyph index into it -of the form @samp{@var{font} fontname index [[mask-font] mask-index]}. -Only if X support was compiled into this XEmacs. Currently can only be -instanced as @code{pointer}, although this should probably be fixed. -@item mswindows-resource -An MS Windows pointer resource. Specifies a resource to retrieve -directly from the system (an OEM resource) or from a file, particularly -an executable file. If the resource is to be retrieved from a file, use -:file and optionally :resource-id. Otherwise use :resource-id. Always -specify :resource-type to specify the type (cursor, bitmap or icon) of -the resource. Possible values for :resource-id are listed below. Can -be instanced as @code{pointer} or @code{color-pixmap}. @item subwindow An embedded windowing system window. Can only be instanced as -@code{subwindow}. +@code{subwindow}. Not implemented. +@c #### Check status of subwindows ... I thought Andy implemented them. + @item button A button widget; either a push button, radio button or toggle button. Can only be instanced as @code{widget}. + @item combo-box A drop list of selectable items in a widget, for editing text. Can only be instanced as @code{widget}. + @item edit-field A text editing widget. Can only be instanced as @code{widget}. + @item label A static, text-only, widget; for displaying text. Can only be instanced as @code{widget}. + @item layout A widget for controlling the positioning of children underneath it. Through the use of nested layouts, a widget hierarchy can be created @@ -743,20 +627,38 @@ arrangement; all of this is counted as one @dfn{glyph} and could appear in many of the places that expect a single glyph. Can only be instanced as @code{widget}. + @item native-layout -@c #### Document me better! The native version of a layout widget. Can only be instanced as @code{widget}. + @item progress-gauge A sliding widget, for showing progress. Can only be instanced as @code{widget}. + @item tab-control A tab widget; a series of user selectable tabs. Can only be instanced as @code{widget}. + +The required keyword is @code{:items}. Its value should be a list of +vectors, whose first element is a string, the second element is a +callback (a Lisp expression to be eval'ed), and the remaining elements +are key-value pairs. The most important keyword is @code{:selected} (a +Boolean); exactly one of the elements should have a value of @code{t} +for the @code{:selected} property. Other keywords accepted include +@code{:descriptor} (a string), @code{:face} (a symbol naming a face), +@code{:orientation} (a symbol, one of @code{top}, @code{center}, +@code{bottom}, @code{left}, or @code{right}), and @code{:pixel-width} +and @code{:pixel-height} (positive integers). + +(The above is incomplete and may be inaccurate.) + @item tree-view A folding widget. Can only be instanced as @code{widget}. + @item scrollbar A scrollbar widget. Can only be instanced as @code{widget}. + @item autodetect XEmacs tries to guess what format the data is in. If X support exists, the data string will be checked to see if it names a filename. If so, @@ -767,135 +669,14 @@ valid cursor-font name, the image will be created as a pointer. Otherwise, the image will be displayed as text. If no X support exists, the image will always be displayed as text. + @item inherit Inherit from the background-pixmap property of a face. Can only be instanced as @code{mono-pixmap}. @end table -The valid keywords are: - -@table @code -@item :data -Inline data. For most formats above, this should be a string. For -XBM images, this should be a list of three elements: width, height, and -a string of bit data. This keyword is not valid for instantiator -format @code{nothing}. - -@item :file -Data is contained in a file. The value is the name of this file. If -both @code{:data} and @code{:file} are specified, the image is created -from what is specified in @code{:data} and the string in @code{:file} -becomes the value of the @code{image-instance-file-name} function when -applied to the resulting image-instance. This keyword is not valid for -instantiator formats @code{nothing}, @code{string}, -@code{formatted-string}, @code{cursor-font}, @code{font}, and -@code{autodetect}. - -@item :foreground -@itemx :background -For @code{xbm}, @code{xface}, @code{cursor-font}, and @code{font}. -These keywords allow you to explicitly specify foreground and background -colors. The argument should be anything acceptable to -@code{make-color-instance}. This will cause what would be a -@code{mono-pixmap} to instead be colorized as a two-color color-pixmap, -and specifies the foreground and/or background colors for a pointer -instead of black and white. - -@item :mask-data -For @code{xbm} and @code{xface}. This specifies a mask to be used with the -bitmap. The format is a list of width, height, and bits, like for -@code{:data}. - -@item :mask-file -For @code{xbm} and @code{xface}. This specifies a file containing the -mask data. If neither a mask file nor inline mask data is given for an -XBM image, and the XBM image comes from a file, XEmacs will look for a -mask file with the same name as the image file but with @samp{Mask} or -@samp{msk} appended. For example, if you specify the XBM file -@file{left_ptr} [usually located in @file{/usr/include/X11/bitmaps}], -the associated mask file @file{left_ptrmsk} will automatically be picked -up. - -@item :hotspot-x -@itemx :hotspot-y -For @code{xbm} and @code{xface}. These keywords specify a hotspot if -the image is instantiated as a @code{pointer}. Note that if the XBM -image file specifies a hotspot, it will automatically be picked up if no -explicit hotspot is given. - -@item :color-symbols -Only for @code{xpm}. This specifies an alist that maps strings that -specify symbolic color names to the actual color to be used for that -symbolic color (in the form of a string or a color-specifier object). -If this is not specified, the contents of @code{xpm-color-symbols} are -used to generate the alist. -@item :resource-id -Only for @code{mswindows-resource}. This must be either an integer -(which directly specifies a resource number) or a string. Valid strings -are - -For bitmaps: - -"close", "uparrow", "dnarrow", "rgarrow", "lfarrow", -"reduce", "zoom", "restore", "reduced", "zoomd", -"restored", "uparrowd", "dnarrowd", "rgarrowd", "lfarrowd", -"mnarrow", "combo", "uparrowi", "dnarrowi", "rgarrowi", -"lfarrowi", "size", "btsize", "check", "checkboxes", and -"btncorners". - -For cursors: - -"normal", "ibeam", "wait", "cross", "up", "sizenwse", -"sizenesw", "sizewe", "sizens", "sizeall", and "no". - -For icons: - -"sample", "hand", "ques", "bang", "note", and "winlogo". -@item :resource-type -Only for @code{mswindows-resource}. This must be a symbol, either -@code{cursor}, @code{icon}, or @code{bitmap}, specifying the type of -resource to be retrieved. -@item :face -Only for @code{inherit}. This specifies the face to inherit from. For -widgets this also specifies the face to use for display. It defaults to -gui-element-face. -@end table - -Keywords accepted as menu item specs are also accepted by widgets. -These are @code{:selected}, @code{:active}, @code{:suffix}, -@code{:keys}, @code{:style}, @code{:filter}, @code{:config}, -@code{:included}, @code{:key-sequence}, @code{:accelerator}, -@code{:label} and @code{:callback}. - -If instead of a vector, the instantiator is a string, it will be -converted into a vector by looking it up according to the specs in the -@code{console-type-image-conversion-list} for the console type of -the domain (usually a window; sometimes a frame or device) over which -the image is being instantiated. - -If the instantiator specifies data from a file, the data will be read in -at the time that the instantiator is added to the image specifier (which -may be well before the image is actually displayed), and the -instantiator will be converted into one of the inline-data forms, with -the filename retained using a @code{:file} keyword. This implies that -the file must exist when the instantiator is added to the image, but -does not need to exist at any other time (e.g. it may safely be a -temporary file). - -@defun valid-image-instantiator-format-p format &optional locale -This function returns non-@code{nil} if @var{format} is a valid image -instantiator format. - -If @var{locale} is non-@code{nil} then the format is checked in that locale. -If @var{locale} is @code{nil} the current console is used. - -Note that the return value for many formats listed above depends on -whether XEmacs was compiled with support for that format. -@end defun - -@defun image-instantiator-format-list -This function return a list of valid image-instantiator formats. -@end defun +There are two convenience variables for use with the XBM and XPM image +formats. @defvar xpm-color-symbols This variable holds definitions of logical color-names used when reading @@ -920,293 +701,1280 @@ first). @end defvar -@node Image Instantiator Conversion -@subsection Image Instantiator Conversion -@cindex image instantiator conversion -@cindex conversion of image instantiators -@defun set-console-type-image-conversion-list console-type list -This function sets the image-conversion-list for consoles of the given -@var{console-type}. The image-conversion-list specifies how image -instantiators that are strings should be interpreted. Each element of -the list should be a list of two elements (a regular expression string -and a vector) or a list of three elements (the preceding two plus an -integer index into the vector). The string is converted to the vector -associated with the first matching regular expression. If a vector -index is specified, the string itself is substituted into that position -in the vector. +@node Image Instances +@subsection Image Instances +@cindex image instances -Note: The conversion above is applied when the image instantiator is -added to an image specifier, not when the specifier is actually -instantiated. Therefore, changing the image-conversion-list only affects -newly-added instantiators. Existing instantiators in glyphs and image -specifiers will not be affected. + Image-instance objects encapsulate the way a particular image (pixmap, +etc.) is displayed on a particular device. + + In most circumstances, you do not need to directly create image +instances; use a glyph instead. However, it may occasionally be useful +to explicitly create image instances, if you want more control over the +instantiation process. + +@defun image-instance-p object +This function returns non-@code{nil} if @var{object} is an image instance. @end defun -@defun console-type-image-conversion-list console-type -This function returns the image-conversion-list for consoles of the given -@var{console-type}. -@end defun +@menu +* Image Instance Types:: Each image instances has a particular type. +* Image Instance Functions:: Functions for working with image instances. +@end menu + + +@node Image Instance Types +@subsubsection Image Instance Types +@cindex image instance types + + Image instances come in a number of different types. The type +of an image instance specifies the nature of the image: Whether +it is a text string, a mono pixmap, a color pixmap, etc. + + The valid image instance types are + +@table @code +@item nothing +Nothing is displayed. + +@item text +Displayed as text. The foreground and background colors and the +font of the text are specified independent of the pixmap. Typically +these attributes will come from the face of the surrounding text, +unless a face is specified for the glyph in which the image appears. + +@item mono-pixmap +Displayed as a mono pixmap (a pixmap with only two colors where the +foreground and background can be specified independent of the pixmap; +typically the pixmap assumes the foreground and background colors of +the text around it, unless a face is specified for the glyph in which +the image appears). +@item color-pixmap + +Displayed as a color pixmap. + +@item pointer +Used as the mouse pointer for a window. + +@item subwindow +A child window that is treated as an image. This allows (e.g.) +another program to be responsible for drawing into the window. +Not currently implemented. +@c #### Check status of subwindows ... I thought Andy implemented them. + +@item widget +An active GUI element implemented as a ``widget'' or ``control'' of the +underlying window system. +@end table + +The following functions are used to check whether an image instance type +is valid in the running XEmacs. + +@defun valid-image-instance-type-p type +This function returns non-@code{nil} if @var{type} is a valid image +instance type. +@end defun + +@defun image-instance-type-list +This function returns a list of the valid image instance types. +@end defun + +The following functions are used to determine the type of an image +instance. + +@defun image-instance-type image-instance +Return the type of the given image instance. The return +value will be one of @code{nothing}, @code{text}, @code{mono-pixmap}, +@code{color-pixmap}, @code{pointer}, @code{subwindow}, or @code{widget}. +@c #### Check status of subwindows ... I thought Andy implemented them. +@end defun + +@defun text-image-instance-p object +Return non-@code{nil} if @var{object} is an image instance of type +@code{text}. +@end defun + +@defun mono-pixmap-image-instance-p object +Return non-@code{nil} if @var{object} is an image instance of type +@code{mono-pixmap}. +@end defun + +@defun color-pixmap-image-instance-p object +Return non-@code{nil} if @var{object} is an image instance of type +@code{color-pixmap}. +@end defun + +@defun pointer-image-instance-p object +Return non-@code{nil} if @var{object} is an image instance of type +@code{pointer}. +@end defun + +@defun subwindow-image-instance-p object +Return non-@code{nil} if @var{object} is an image instance of type +@code{subwindow}. +@c #### Check status of subwindows ... I thought Andy implemented them. +@end defun + +@defun nothing-image-instance-p object +Return non-@code{nil} if @var{object} is an image instance of type +@code{nothing}. +@end defun + +@defun widget-image-instance-p object +Return non-@code{nil} if @var{object} is an image instance of type +@code{widget}. +@end defun + + +@node Image Instance Functions +@subsubsection Image Instance Functions + +@defun make-image-instance data &optional domain dest-types noerror +This function creates a new image-instance object. + +@var{data} is an image instantiator, which describes the image +(@pxref{Image Specifiers}). + +@var{dest-types} should be a list of allowed image instance types that +can be generated. The @var{dest-types} list is unordered. If multiple +destination types are possible for a given instantiator, the ``most +natural'' type for the instantiator's format is chosen. These are + +@table @code +@item XBM +@c #### check xface +@itemx xface +@code{mono-pixmap}, then @code{color-pixmap}, then @code{pointer}. + +@item XPM +@itemx GIF +@itemx JPEG +@itemx PNG +@itemx TIFF +@code{color-pixmap}, then @code{mono-pixmap}, then @code{pointer}. + +@item string +@itemx formatted-string formats +@code{text}, then @code{mono-pixmap} (not currently implemented), then +@code{color-pixmap} (not currently implemented). + +@item mswindows-resource +For pointer resources, @code{pointer}. + +For the others, @code{color-pixmap}. +@end table + +@c #### So what? This is a reference manual, list them, you lazy bastard! +The other formats can only be instantiated as one type. + +If you want to control more specifically the order of the types into +which an image is instantiated, call @code{make-image-instance} +repeatedly until it succeeds, passing less and less preferred +destination types each time. + +If @var{dest-types} is omitted, all possible types are allowed. + +@var{domain} specifies the domain to which the image instance will be +attached. This domain is termed the @dfn{governing domain}. The type +of the governing domain depends on the image instantiator format. +(Although, more correctly, it should probably depend on the image +instance type.) For example, pixmap image instances are specific to a +device, but widget image instances are specific to a particular XEmacs +window because in order to display such a widget when two windows onto +the same buffer want to display the widget, two separate underlying +widgets must be created. (That's because a widget is actually a child +window-system window, and all window-system windows have a unique +existence on the screen.) This means that the governing domain for a +pixmap image instance will be some device (most likely, the only +existing device), whereas the governing domain for a widget image +instance will be some XEmacs window. + +If you specify an overly general @var{domain} (e.g. a frame when a +window was wanted), an error is signaled. If you specify an overly +specific @var{domain} (e.g. a window when a device was wanted), the +corresponding general domain is fetched and used instead. For +@code{make-image-instance}, it makes no difference whether you specify +an overly specific domain or the properly general domain derived from +it. However, it does matter when creating an image instance by +instantiating a specifier or glyph (e.g. with +@code{glyph-image-instance}), because the more specific domain causes +spec lookup to start there and proceed to more general domains. (It +would also matter when creating an image instance with an instantiator +format of @code{inherit}, but we currently disallow this.) +@c #### We should fix that. + +If omitted, @var{domain} defaults to the selected window. + +@var{noerror} controls what happens when the image cannot be generated. +If @code{nil}, an error message is generated. If @code{t}, no messages +are generated and this function returns @code{nil}. If anything else, a +warning message is generated and this function returns @code{nil}. +@end defun + +@defun colorize-image-instance image-instance foreground background +This function makes the image instance be displayed in the given +colors. Image instances come in two varieties: bitmaps, which are 1 +bit deep which are rendered in the prevailing foreground and background +colors; and pixmaps, which are of arbitrary depth (including 1) and +which have the colors explicitly specified. This function converts a +bitmap to a pixmap. If the image instance was a pixmap already, +nothing is done (and @code{nil} is returned). Otherwise @code{t} is +returned. +@end defun + +The following functions are + +@defun image-instance-name image-instance +This function returns the name of the given image instance. The name is +typically taken from the @code{:file} property of the instantiator if +present, otherwise from the @code{:data} property. +@end defun + +@defun image-instance-domain image-instance +Return the governing domain of the given @var{image-instance}. The +governing domain of an image instance is the domain that the image +instance is specific to. It is @emph{NOT} necessarily the domain that +was given to the call to @code{specifier-instance} that resulted in the +creation of this image instance. See @code{make-image-instance} for +more information on governing domains. +@end defun + +@defun image-instance-string image-instance +This function returns the string of the given image instance. This will +only be non-@code{nil} for text image instances. +@end defun + +@defun image-instance-file-name image-instance +This function returns the file name from which @var{image-instance} was +read, if known. +@end defun + +@defun image-instance-mask-file-name image-instance +This function returns the file name from which @var{image-instance}'s +mask was read, if known. +@end defun + +Pixmaps are considered to be three-dimensional. The height and width of +the pixel array that is displayed, and the color depth of its pixels, +are accessed with these functions. + +@defun image-instance-depth image-instance +This function returns the depth of the image instance. This is 0 for a +mono pixmap, or a positive integer for a color pixmap. +@end defun + +@defun image-instance-height image-instance +This function returns the height of the image instance, in pixels. +@end defun + +@defun image-instance-width image-instance +This function returns the width of the image instance, in pixels. +@end defun + +The hotspot is a point relative to the origin of the pixmap. When +an image is used as a mouse pointer, the hotspot is the point on the +image that sits over the location that the pointer points to. This is, +for example, the tip of the arrow or the center of the crosshairs. + +These functions access the coordinates of the hotspot. They simply +return @code{nil} for a non-pointer image instance. + +@defun image-instance-hotspot-x image-instance +This function returns the X coordinate of the image instance's hotspot, +if known. +@end defun + +@defun image-instance-hotspot-y image-instance +This function returns the Y coordinate of the image instance's hotspot, +if known. +@end defun + +Mono pixmaps and pointers may have their foreground and background +colors set when instanced. Use these functions to access color +information. + +@defun image-instance-foreground image-instance +This function returns the foreground color of @var{image-instance}, if +applicable. This will be a color instance or @code{nil}. (It will only +be non-@code{nil} for colorized mono pixmaps and for pointers.) +@end defun + +@defun image-instance-background image-instance +This function returns the background color of @var{image-instance}, if +applicable. This will be a color instance or @code{nil}. (It will only +be non-@code{nil} for colorized mono pixmaps and for pointers.) +@end defun + + +@node Using Glyphs +@section Using Glyphs + +Glyph usage is unfortunately somewhat arcane. (For discussion of +rationale, @ref{Glyphs,,,Internals}.) Because they are not ``text,'' +they cannot be inserted directly into a buffer. Instead, they are +values of properties of extents attached to buffers or strings, values +of global variables such as mouse pointers, or as a component of a +complex data structure such as a toolbar initializer. Although these +uses could probably streamlined, each structure has its own +requirements. Since glyphs are very flexible, it is possible to create +applications like the @file{edit-toolbar} and @file{xpm-mode} libraries +which display glyphs in a buffer (for reference while editing) that are +normally used in a different context. + +Usage of glyphs can roughly be categorized as follows: + +@table @strong +@item Buffer glyphs +Glyphs that are inserted in a buffer may be used for their own sake (for +example, image display in @file{w3}), as an accurate representation of +text that can't be displayed in usual fonts (equation display in +@file{preview-latex}), or as annotations (such as a marginal indication +of a bookmark). Glyphs are attached to buffers via extents. + +@item Redisplay glyphs +Glyphs can be used to create XEmacs-specific ``fonts''. For example, +the character that indicates truncation of lines is implemented as the +@code{truncation-glyph}. It is also possible to have XEmacs display a +certain character using a custom glyph, via display tables. + +@item Frame glyphs +Glyphs are used to control the appearance of various other components of +the frame. They can be inserted in the modeline, the favicons are used +in Web browsers. They are used to specify the labels on toolbar +buttons. Finally, they can be inserted in the gutters. (The difference +between a glyph inserted in a gutter and a marginal annotation is that +the marginal annotation is tied to the text in the buffer. If the +buffer line scrolls out of view, the marginal annotation will, as well. +A gutter glyph does not move with the text.) + +Unfortunately, all these uses are special cases, and have their own +APIs, in contrast to glyphs in a buffer. + +@item External glyphs +External glyphs simply allow a consistent API for images. The images +are then passed to external software such as the window system itself +(mouse cursor shapes) and the window manager (icons to represent +minimized windows). XEmacs has no role in managing their use. + +@item Subwindow and widget glyphs +These do not constitute a context of use, but rather an important class of +glyph types. The difference between these and other glyphs is that +while their geometry is determined by XEmacs, their behavior is managed +separately, by internal mechanisms in the case of widgets, and +(possibly) by another process in the case of subwindows. +@c #### Check status of subwindows ... I thought Andy implemented them. +@end table + +Some simple concrete examples showing how to insert a glyph in a +buffer are presented later. @ref{Glyph Examples}. + +``Creating Glyphs'' explains how to create glyphs. Creating a glyph +using @code{make-glyph} does not specify @emph{where} the glyph will be +used, it only specifies @emph{what} the glyph will look like. The next +four sections explain how to embed glyphs in different display +contexts. Finally, the last two sections explain the special +considerations of using glyphs whose behavior is not determined by the +code creating them, but by the glyph itself (a ``widget'' in X11 or +``control'' in MS Windows or Aqua), or even by a separate process. + +@menu +* Creating Glyphs:: Creating new glyphs. +* Buffer Glyphs:: Annotations are glyphs that appear in a buffer. +* Redisplay Glyphs:: Glyphs controlling various redisplay functions. +* Frame Glyphs:: Displaying glyphs in GUI components of the frame. +* External Glyphs:: Icons and mouse pointers for the window system. +* Native GUI Widgets:: Complex active elements treated as a single glyph. +* Subwindows:: Externally-controlled subwindows in buffers. +@c #### Check status of subwindows ... I thought Andy implemented them. +@end menu + +@node Creating Glyphs +@subsection Creating Glyphs + +@defun make-glyph &optional spec-list type +This function creates a new glyph object of type @var{type}. + +The optional @var{spec-list} is used to initialize the glyph's image. +It can be any spec-list of @dfn{image instantiator} accepted by +@code{canonicalize-spec-list}, @ref{Adding Specifications}. An +individual image instantiator may be a string, which is converted to a +vector according to @code{console-type-image-conversion-list}, or a +vector. The vector's first element specifies the @emph{external} format +of the data, such as a string, a PNG file, or an MS Windows resource. +This is followed by properties (keyword-value pairs) specifying such +information as the name of a file containing an image, or pixmap data +directly. @xref{Image Specifiers}. + +The optional @var{type} specifies the type of the glyph. @var{type} +should be one of @code{buffer} (used for glyphs in an extent, the +modeline, the toolbar, or elsewhere in a frame), @code{pointer} (used +for the mouse-pointer), or @code{icon} (used for a frame's icon), and +defaults to @code{buffer}. +@end defun + +@var{spec-list} is the initializer for the glyph's @code{image} +property, which is an image specifier. (Note that @dfn{image} as used +in the context of a glyph's @code{image} property or in the terms +@dfn{image specifier}, @dfn{image instantiator}, or @dfn{image instance} +does not refer to what people normally think of as an image (which in +XEmacs is called a @dfn{pixmap}), but to any graphical element---a +pixmap, a widget, or even a block of text, when used in the places that +call for a glyph.) + +The most common form of @var{spec-list} is a single image instantiator. +(@strong{Compatibility note:} in GNU Emacs 21, a string used to +instantiate an image is interpreted as the name of an image file, which +is searched for and instantiated.) The conversion controlled by +@code{console-type-image-conversion-list} typically attempts to look up +the string as a file name in XEmacs's data directory path, and if this +fails, defaults to displaying the string as a text image instance +(@emph{i.e.}. the string itself. + +Fine control of a particular specification is provided by using a vector +as the image instantiator. More complicated instantiators allow lists +of instantiators to be specified (which are tried in order), or mappings +from locales to lists of instantiators, @emph{etc}. @xref{Specifiers}, +for more information about specification formats. + +As well as using @var{spec-list} to initialize the glyph, you can set +specifications using @code{set-glyph-image}. The glyph itself is not +actually a specifier, but rather is an object containing an image +specifier (as well as other properties seldom set by user code). +Therefore, you cannot set or access specifications for the glyph's image +by directly using @code{set-specifier}, @code{specifier-instance} or the +like on the glyph; instead use them on @code{(glyph-image @var{glyph})} +or use the convenience functions @code{set-glyph-image}, +@code{glyph-image-instance}, and @code{glyph-image}. + +Glyph types reflect the fact that glyphs are used in contexts like +pointers and window manager icons, which are defined by external +programs such as the window system or window manager. These require +somewhat different @emph{internal} format, which is opaque to the user. + +It is extremely rare that you will ever have to specify a value for +@var{type}, which should be one of @code{buffer} (used for glyphs in an +extent, the modeline, the toolbar, or elsewhere in a buffer), +@code{pointer} (used for the mouse-pointer), or @code{icon} (used for a +frame's icon), and defaults to @code{buffer}. The only cases where it +needs to be specified is when creating icon or pointer glyphs, and in +both cases the necessary glyphs have already been created at startup and +are accessed through the appropriate variables, +e.g. @code{text-pointer-glyph} (or in general, any +@samp{*-pointer-glyph}) and @code{frame-icon-glyph}. User code should +never need to create @code{pointer} or @code{icon} glyphs. @xref{Glyph +Types}. + +There are a few other glyph creation functions, normally used only +internally or at XEmacs initialization. + +@defun make-glyph-internal &optional type +This function creates a new, uninitialized glyph of type @var{type}. +@end defun + +@defun make-pointer-glyph &optional spec-list + +Return a new @code{pointer-glyph} object with the specification list +@var{spec-list}. This function is equivalent to calling +@code{make-glyph} with a @var{type} of @code{pointer}. +@end defun + +@code{make-pointer-glyph} is normally used only by XEmacs initialization +code. It is extremely unlikely that you will ever need to create a +pointer glyph. Instead, you probably want to be calling +@code{set-glyph-image} on an existing glyph, +e.g. @code{text-pointer-glyph}. + +@defun make-icon-glyph &optional spec-list + +Return a new @code{icon-glyph} object with the specification list +@var{spec-list}. This function is equivalent to calling +@code{make-glyph} with a @var{type} of @code{icon}. +@end defun + +@code{make-icon-glyph} is normally used only by XEmacs initialization +code. It is extremely unlikely that you will ever need to create a icon +glyph. Instead, you probably want to be calling @code{set-glyph-image} +on the existing glyph, @code{frame-icon-glyph}. + + +@node Buffer Glyphs +@subsection Buffer Glyphs + +Creating a glyph using @code{make-glyph} does not specify @emph{where} +the glyph will be used, it only specifies @emph{what} the glyph will +look like. Once you have created a glyph, you specify where it will be +used by attaching it to an extent as a @emph{begin-glyph} or +@emph{end-glyph}. + +@table @code +@item buffer text +To insert a glyph into a buffer, create an extent in the buffer and then +use @code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set +a glyph to be displayed at the corresponding edge of the extent. (It is +common to create zero-width extents for this purpose.) + +@item margins +To insert a glyph into the left or right margin of a buffer, first +make sure the margin is visible by setting a value for the specifiers +@code{left-margin-width} or @code{right-margin-width}. (Not strictly necessary +when using margin glyphs with layout policy @code{whitespace}.) Follow +the same procedure above for inserting a glyph in a buffer, then +set a non-default layout policy for the glyph using +@code{set-extent-begin-glyph-layout} or @code{set-extent-end-glyph-layout}. +Alternatively, use the high-level annotations API (see +@code{make-annotation}). (In fact, you can also use the annotations +API for glyphs in a buffer, by setting a layout policy of @code{text}.) + +@end table + + +@node Redisplay Glyphs +@subsection Redisplay Glyphs + +To use a glyph to control the shape of miscellaneous redisplay effects +such as the truncation and continuation markers, set the appropriate +existing glyph variables with @code{set-glyph-image}. See +@code{continuation-glyph}, @code{control-arrow-glyph}, +@code{hscroll-glyph}, @code{invisible-text-glyph}, +@code{octal-escape-glyph}, and @code{truncation-glyph}. See also +@code{overlay-arrow-string}, an odd redisplay leftover which can be set +to a glyph you created, and will cause the glyph to be displayed on top +of the text position specified in the marker stored in +@code{overlay-arrow-position}. + +To use a glyph in a display table (i.e. to control the appearance of any +individual character), create the appropriate character glyphs and then +set a specification for the specifier @code{current-display-table}, +which controls the appearance of characters. You can also set an +overriding display table for use with text displayed in a particular +face; see @code{set-face-display-table} and @code{make-display-table}. +#### Note: Display tables do not currently support general Mule +characters. They will be overhauled at some point to support this +and to provide other features required under Mule. @ref{Display Tables}. + +Glyphs are not actually used as the background pixmaps of faces, but the +API is similar. The +background pixmap of a face is actually an image specifier -- probably +the only place in XEmacs where an image specifier occurs outside of a +glyph. If you would like to use a glyph's image as a background pixmap, +you can extract it with @code{glyph-image}, and then add it to a face. +@xref{Face Convenience Functions}. + +@defvr Glyph truncation-glyph +This variable specifies what is displayed at the end of truncated lines. +@end defvr + +@defvr Glyph continuation-glyph +This variable specifies what is displayed at the end of wrapped lines. +@end defvr + +@defvr Glyph octal-escape-glyph +This variable specifies what to prefix character codes displayed in octal +with. +@end defvr + +@defvr Glyph hscroll-glyph +This variable specifies what to display at the beginning of horizontally +scrolled lines. +@end defvr + +@defvr Glyph invisible-text-glyph +This variable specifies what to use to indicate the presence of +invisible text. This is the glyph that is displayed when an ellipsis is +called for, according to @code{selective-display-ellipses} or +@code{buffer-invisibility-spec}). Normally this is three dots (``...''). +@end defvr + +@defvr Glyph control-arrow-glyph +This variable specifies what to use as an arrow for control characters. +@end defvr + + +@node Frame Glyphs +@subsection Frame Glyphs + +There are also a number of special objects whose appearance is specified +by a glyph. Most of these a global objects that you update with +@code{set-glyph-image}, such as mouse pointers. Frame icons, toolbar +button icons, and the modeline are the main non-text objects which +accept glyphs as elements. + +@table @code +@item modeline +A glyph may be displayed in the modeline by inserting the glyph as one +of the elements of the modeline format. (Unfortunately you can't +currently put a begin glyph or end glyph on one of the modeline +extents---they're ignored.) + +@item toolbar +To insert a glyph into a toolbar, specify it as the icon part of a toolbar +button, which in turn must be part of a toolbar instantiator (typically +set on the specifier @code{default-toolbar}). +See @code{default-toolbar} for more information. (As a convenience, you +may use a symbol in place of the glyph list in the toolbar button +instantiator; the symbol is evalled to get the glyph list. This +facilitates both creating the toolbar instantiator and modifying +individual glyphs in a toolbar later on. For example, you can change +the way that the Mail toolbar button looks by modifying the value of the +variable @code{toolbar-mail-icon} (in general, @code{toolbar-*-icon}) +and then calling @code{(set-specifier-dirty-flag default-toolbar)}. +(#### Unfortunately this doesn't quite work the way it should; the +change will appear in new frames, but not existing ones, because once an +image has been displayed the pixmap replaces the symbol for those domains.) + +@item gutter +To insert a glyph into a gutter, use +@code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set a +glyph to be displayed at the corresponding edge of extent in a string, +similar to the way you insert glyphs in a buffer. Then insert the +string into the gutter @ref{Specifying a Gutter}. Glyphs that are +frequently used in this way are @code{tab control} and @code{progress +bar} glyphs. + +@end table + + +@node External Glyphs +@subsection External Glyphs +@cindex frame icon +@cindex icon, frame +@cindex mouse cursor +@cindex cursor (mouse) +@cindex pointer (mouse) +@cindex mouse pointer + +There are two special kinds of glyph that are not displayed by XEmacs. +Instead, they are used to set the appearance of iconified frames and the +mouse pointer. Because these uses are constrained by the window system, +icons and pointers have their own special types @xref{Glyph Types}. + +You may use a glyph as the icon for a frame. Do not create a new glyph; +instead, change the specifications for the existing glyph +@code{frame-icon-glyph} with @code{set-glyph-image}. This is a unique, +predefined object. Although the natural usage is to set specifications +for the global locale or a frame locale, you can also arrange for a +special icon when a frame's selected window displays a particular buffer +by using a buffer locale. + +The shape of the mouse pointer when over a particular section of a frame +is controlled using various glyph variables. Since the image of a glyph +is a specifier, it can be controlled on a per-buffer, per-frame, per-window, +or per-device basis. + +To use a glyph as the mouse pointer, in general you do not create a new +glyph, but rather you change the specifications of various existing +glyphs, such as @code{text-pointer-glyph} for the pointer used over +text, @code{modeline-pointer-glyph} for the pointer used over the +modeline, etc. Do an apropos over @samp{pointer-glyph} to find all of +them. (Note also that you can temporarily set the mouse pointer to some +specific shape by using @code{set-frame-pointer}, which takes an image +instance, as obtained from calling @code{glyph-image-instance} on a glyph +of type @code{pointer} -- either one of the above-mentioned variables or +one you created yourself. (See below for what it means to create a +glyph of type @code{pointer}.) This pointer will last only until the +next mouse motion event is processed or certain other things happen, +such as creating or deleting a window. (In fact, the above-mentioned +pointer glyph variables are implemented as part of the default handler +for mouse motion events. If you want to customize this behavior, take a +look at @code{mode-motion-hook}, or @code{mouse-motion-handler} if you +really want to get low-level.) + +You should use @code{set-glyph-image} to set the following variables, +@emph{not} @code{setq}. + +@defvr Glyph text-pointer-glyph +This variable specifies the shape of the mouse pointer when over text. +@end defvr + +@defvr Glyph nontext-pointer-glyph +This variable specifies the shape of the mouse pointer when over a +buffer, but not over text. If unspecified in a particular domain, +@code{text-pointer-glyph} is used. +@end defvr + +@defvr Glyph modeline-pointer-glyph +This variable specifies the shape of the mouse pointer when over the modeline. +If unspecified in a particular domain, @code{nontext-pointer-glyph} is used. +@end defvr + +@defvr Glyph selection-pointer-glyph +This variable specifies the shape of the mouse pointer when over a +selectable text region. If unspecified in a particular domain, +@code{text-pointer-glyph} is used. +@end defvr + +@defvr Glyph gc-pointer-glyph +This variable specifies the shape of the mouse pointer when a garbage +collection is in progress. If the selected window is on a window system +and this glyph specifies a value (i.e. a pointer image instance) in the +domain of the selected window, the pointer will be changed as specified +during garbage collection. Otherwise, a message will be printed in the +echo area, as controlled by @code{gc-message}. +@end defvr + +@defvr Glyph busy-pointer-glyph +This variable specifies the shape of the mouse pointer when XEmacs is busy. +If unspecified in a particular domain, the pointer is not changed +when XEmacs is busy. +@end defvr + +@defvr Glyph menubar-pointer-glyph +This variable specifies the shape of the mouse pointer when over the +menubar. If unspecified in a particular domain, the +window-system-provided default pointer is used. +@end defvr + +@defvr Glyph scrollbar-pointer-glyph +This variable specifies the shape of the mouse pointer when over a +scrollbar. If unspecified in a particular domain, the +window-system-provided default pointer is used. +@end defvr + +@defvr Glyph toolbar-pointer-glyph +This variable specifies the shape of the mouse pointer when over a +toolbar. If unspecified in a particular domain, +@code{nontext-pointer-glyph} is used. +@end defvr + +Internally, these variables are implemented in +@code{default-mouse-motion-handler}, and thus only take effect when the +mouse moves. That function calls @code{set-frame-pointer}, which sets +the current mouse pointer for a frame. + +@defun set-frame-pointer frame image-instance +This function sets the mouse pointer of @var{frame} to the given pointer +image instance. You should not call this function directly. +(If you do, the pointer will change again the next time the mouse moves.) +@end defun + + +@node Native GUI Widgets +@subsection Native GUI Widgets +@cindex native widget + +A ``native widget'' is a primitive GUI object defined either by the host +GUI platform or an external toolkit, and accessed from Lisp as a +``glyph.'' + +@menu +* Introduction to Widgets:: Native widgets provide tight integration of + GUI features with the platform GUI. +* Lisp API to Native Widgets:: Native widgets are glyphs. +* Layouts:: Specifying composite widgets from Lisp. +* Primitive Widgets:: Catalogue of available native widgets. +@end menu + +@node Introduction to Widgets +@subsubsection Introduction to Native Widgets and Subwindow Glyphs + +Traditionally Emacsen have hidden the GUI apparatus from the Lisp +programmer, but in XEmacs 21.4 the ability to embed autonomous GUI +objects, called @dfn{native widgets}, in text was added to Lisp. They +are handled as @emph{glyphs}. Unlike traditional XEmacs +glyphs such images and strings, native widgets are opaque to XEmacs, and +must be able to redraw themselves because they are implemented as +subwindows, not as graphics drawn by XEmacs into the text window. + +Primitive widgets are coded in C using the underlying GUI toolkit, and +thus are beyond the scope of the @emph{XEmacs Lisp Reference Manual}. +However, composite widgets can be created in Lisp using ``layouts,'' +which are horizontal or vertical arrays of subwidgets. For example, the +search dialog is formatted using layouts. + +@node Lisp API to Native Widgets +@subsubsection Lisp API to Native Widgets + +Native widgets are manipulated as @emph{glyphs} (@pxref{Glyphs}). Thus +they are created using @code{make-glyph}, with a format of one of the +widget types and a @code{:data} property specific to the widget being +instanced. + +However, there is a technical difference between widgets and other kinds +of glyphs that is theoretically important. Because widgets +are active (that is, they can respond to user input events themselves), +it is possible for the user to become aware that two appearances of the +``same'' glyph are actually separate instances. For example, if a user +changes an image glyph from red to blue, and the buffer containing the +glyph appears in more than one window, the user will perceive all the +appearances to change from red to blue simultaneously. However, suppose +the glyph is a button glyph (@emph{e.g.}, as used in the Customize +buffer for the Set, Save, and Done buttons). Then if the Customize +buffer appears in several windows at the same time, and the user clicks +on the button, she will only perceive the button to be depressed in the +window where she clicked the button. + +It seems from this example that it is unlikely to be a problem in +practice. When the user is faced with an active widget, it seems likely +that attention will focus on the widget being manipulated, and having +other instances of the widget respond simultaneously might be more +disconcerting than the actual case. + +@node Layouts +@subsubsection Layouts + +An XEmacs @dfn{layout} is a one-dimensional array of glyphs. It is a +widget for controlling the positioning of children underneath it. +Through the use of nested layouts, a widget hierarchy can be created +which can have the appearance of any standard dialog box or similar +arrangement; all of this is counted as one "glyph" and could appear in +many of the places that expect a single glyph. + +(There are also @dfn{native layouts}, but I don't know what these are or +how they are used.) + +A layout descriptor is an image instantiator, @emph{i.e.}, a vector of +the form @samp{[FORMAT KEY-1 VALUE-1 KEY-2 VALUE-2 ...]} with format +@code{layout}, and properties + +@c #### need defaults for these +@table @code +@item :orientation +Specifies the orientation of the contained array of glyphs. The value +must be one of the symbols @code{horizontal} or @code{vertical}. + +@item :horizontally-justify +Specifies the horizontal justification of the items in the array. The +value must be one of the symbols @code{:right}, @code{:center}, or +@code{:left}. + +@item :vertically-justify +Specifies the vertical justification of the items in the array. The +value must be one of the symbols @code{:top}, @code{:center}, or +@code{:bottom}. + +@item :justify +Specifies justification. #### not understood. + +@item :border +A glyph to place in the border. The value must be an image +instantiator. + +@item :items +The glyphs controlled by the layout. The value must be a list of image +instantiators. +@end table + +Here is the specification of the search dialog widget created by +@code{make-search-dialog} in the @file{dialog-items} library, which +makes use of recursive layouts. + +@example +(make-glyph + `[layout + :orientation horizontal + :vertically-justify top + :horizontally-justify center + :border [string :data "Search"] + :items + ([layout :orientation vertical + :justify top ; implies left also + :items + ([string :data "Search for:"] + [button :descriptor "Match Case" + :style toggle + :selected (not case-fold-search) + :callback (setq case-fold-search + (not case-fold-search))] + [button :descriptor "Regular Expression" + :style toggle + :selected search-dialog-regexp + :callback (setq search-dialog-regexp + (not search-dialog-regexp))] + [button :descriptor "Forwards" + :style radio + :selected search-dialog-direction + :callback (setq search-dialog-direction t)] + [button :descriptor "Backwards" + :style radio + :selected (not search-dialog-direction) + :callback (setq search-dialog-direction nil)] + )] + [layout :orientation vertical + :vertically-justify top + :horizontally-justify right + :items + ([edit-field :width 15 :descriptor "" :active t + :initial-focus t] + [button :width 10 :descriptor "Find Next" + :callback-ex + (lambda (image-instance event) + (search-dialog-callback ,parent + image-instance + event))] + [button :width 10 :descriptor "Cancel" + :callback-ex + (lambda (image-instance event) + (isearch-dehighlight) + (delete-frame + (event-channel event)))])])]) +@end example + +@node Primitive Widgets +@subsubsection Primitive Widgets + +@c #### the following table should be replaced with a menu of nodes +@table @code +@item button +A button widget; either a push button, radio button or toggle +button. + +@item combo-box +A drop list of selectable items in a widget, for editing text. + +@item edit-field +A text editing widget. + +@item label +A static, text-only, widget; for displaying text. + +@item progress-gauge +A sliding widget, for showing progress. + +@item tab-control +A tab widget; a series of user selectable tabs. -@node Image Instances -@subsection Image Instances -@cindex image instances +@item tree-view +A folding widget. - Image-instance objects encapsulate the way a particular image (pixmap, -etc.) is displayed on a particular device. +@item scrollbar +A scrollbar widget. (#### Probably not the same as the scrollbar +controlling an Emacs window.) +@end table - In most circumstances, you do not need to directly create image -instances; use a glyph instead. However, it may occasionally be useful -to explicitly create image instances, if you want more control over the -instantiation process. -@defun image-instance-p object -This function returns non-@code{nil} if @var{object} is an image instance. +@node Subwindows +@subsection Subwindows + +Subwindows are not currently implemented. +@c #### Check status of subwindows ... I thought Andy implemented them. + +@defun subwindowp object +This function returns non-@code{nil} if @var{object} is a subwindow. @end defun + +@node Manipulating Glyphs +@section Manipulating Glyphs + + Each glyphs has properties that may be accessed. Most of these can +also be set after the glyph is initialized, with the exception of the +glyph's type. This is not a real restriction, as it is almost never +useful to create glyphs of types other than @code{buffer}. + @menu -* Image Instance Types:: Each image instances has a particular type. -* Image Instance Functions:: Functions for working with image instances. +* Glyph Properties:: Accessing and modifying a glyph's properties. +* Glyph Convenience Functions:: Accessing particular properties of a glyph. +* Glyph Dimensions:: Determining the height, width, etc. of a glyph. +* Glyph Types:: Each glyph has a particular type. @end menu -@node Image Instance Types -@subsubsection Image Instance Types -@cindex image instance types - Image instances come in a number of different types. The type -of an image instance specifies the nature of the image: Whether -it is a text string, a mono pixmap, a color pixmap, etc. +@node Glyph Properties +@subsection Glyph Properties - The valid image instance types are +Each glyph has a list of properties, which control all of the aspects of +the glyph's appearance. The following symbols have predefined meanings: @table @code -@item nothing -Nothing is displayed. +@item image +The image used to display the glyph. -@item text -Displayed as text. The foreground and background colors and the -font of the text are specified independent of the pixmap. Typically -these attributes will come from the face of the surrounding text, -unless a face is specified for the glyph in which the image appears. +@item baseline +Percent above baseline that glyph is to be displayed. Only for glyphs +displayed inside of a buffer. -@item mono-pixmap -Displayed as a mono pixmap (a pixmap with only two colors where the -foreground and background can be specified independent of the pixmap; -typically the pixmap assumes the foreground and background colors of -the text around it, unless a face is specified for the glyph in which -the image appears). -@item color-pixmap +@item contrib-p +Whether the glyph contributes to the height of the line it's on. +Only for glyphs displayed inside of a buffer. -Displayed as a color pixmap. +@item face +Face of this glyph (@emph{not} a specifier). +@end table -@item pointer -Used as the mouse pointer for a window. +@defun set-glyph-property glyph property value &optional locale tag-set how-to-add +This function changes a property of a @var{glyph}. -@item subwindow -A child window that is treated as an image. This allows (e.g.) -another program to be responsible for drawing into the window. -Not currently implemented. -@end table +For built-in properties, the actual value of the property is a specifier +and you cannot change this; but you can change the specifications within +the specifier, and that is what this function will do. The glyph face +is an exception; it is a face name (a symbol) or a face object, not a +specifier. (The face properties themselves are typically specifiers.) +For user-defined properties, you can use this function to either change +the actual value of the property or, if this value is a specifier, +change the specifications within it. -@defun valid-image-instance-type-p type -This function returns non-@code{nil} if @var{type} is a valid image -instance type. -@end defun +If @var{property} is a built-in property, the specifications to be added +to this property can be supplied in many different ways: -@defun image-instance-type-list -This function returns a list of the valid image instance types. -@end defun +@itemize @bullet +@item +If @var{value} is a simple instantiator (e.g. a string naming a pixmap +filename) or a list of instantiators, then the instantiator(s) will be +added as a specification of the property for the given @var{locale} +(which defaults to @code{global} if omitted). -@defun image-instance-type image-instance -This function returns the type of the given image instance. The return -value will be one of @code{nothing}, @code{text}, @code{mono-pixmap}, -@code{color-pixmap}, @code{pointer}, or @code{subwindow}. -@end defun +@item +If @var{value} is a list of specifications (each of which is a cons of a +locale and a list of instantiators), then @var{locale} must be +@code{nil} (it does not make sense to explicitly specify a locale in +this case), and specifications will be added as given. -@defun text-image-instance-p object -This function returns non-@code{nil} if @var{object} is an image -instance of type @code{text}. -@end defun +@item +If @var{value} is a specifier (as would be returned by +@code{glyph-property} if no @var{locale} argument is given), then some +or all of the specifications in the specifier will be added to the +property. In this case, the function is really equivalent to +@code{copy-specifier} and @var{locale} has the same semantics (if it is +a particular locale, the specification for the locale will be copied; if +a locale type, specifications for all locales of that type will be +copied; if @code{nil} or @code{all}, then all specifications will be +copied). +@end itemize -@defun mono-pixmap-image-instance-p object -This function returns non-@code{nil} if @var{object} is an image -instance of type @code{mono-pixmap}. -@end defun +@var{how-to-add} should be either @code{nil} or one of the symbols +@code{prepend}, @code{append}, @code{remove-tag-set-prepend}, +@code{remove-tag-set-append}, @code{remove-locale}, +@code{remove-locale-type}, or @code{remove-all}. See +@code{copy-specifier} and @code{add-spec-to-specifier} for a description +of what each of these means. Most of the time, you do not need to worry +about this argument; the default behavior usually is fine. -@defun color-pixmap-image-instance-p object -This function returns non-@code{nil} if @var{object} is an image -instance of type @code{color-pixmap}. -@end defun +In general, it is OK to pass an instance object (e.g. as returned by +@code{glyph-property-instance}) as an instantiator in place of an actual +instantiator. In such a case, the instantiator used to create that +instance object will be used (for example, if you set a font-instance +object as the value of the @code{font} property, then the font name used +to create that object will be used instead). In some cases, however, +doing this conversion does not make sense, and this will be noted in the +documentation for particular types of instance objects. -@defun pointer-image-instance-p object -This function returns non-@code{nil} if @var{object} is an image -instance of type @code{pointer}. +If @var{property} is not a built-in property, then this function will +simply set its value if @var{locale} is @code{nil}. However, if +@var{locale} is given, then this function will attempt to add +@var{value} as the instantiator for the given @var{locale}, using +@code{add-spec-to-specifier}. If the value of the property is not a +specifier, it will automatically be converted into a @code{generic} +specifier. @end defun -@defun subwindow-image-instance-p object -This function returns non-@code{nil} if @var{object} is an image -instance of type @code{subwindow}. -@end defun +@defun glyph-property glyph property &optional locale +This function returns @var{glyph}'s value of the given @var{property}. -@defun nothing-image-instance-p object -This function returns non-@code{nil} if @var{object} is an image -instance of type @code{nothing}. -@end defun +If @var{locale} is omitted, the @var{glyph}'s actual value for +@var{property} will be returned. For built-in properties, this will be +a specifier object of a type appropriate to the property (e.g. a font or +color specifier). For other properties, this could be anything. -@defun widget-image-instance-p object -Return @code{t} if @var{object} is an image instance of type @code{widget}. +If @var{locale} is supplied, then instead of returning the actual value, +the specification(s) for the given locale or locale type will be +returned. This will only work if the actual value of @var{property} is +a specifier (this will always be the case for built-in properties, but +may or may not apply to user-defined properties). If the actual value +of @var{property} is not a specifier, this value will simply be returned +regardless of @var{locale}. + +The return value will be a list of instantiators (e.g. vectors +specifying pixmap data), or a list of specifications, each of which is a +cons of a locale and a list of instantiators. Specifically, if +@var{locale} is a particular locale (a buffer, window, frame, device, or +@code{global}), a list of instantiators for that locale will be +returned. Otherwise, if @var{locale} is a locale type (one of the +symbols @code{buffer}, @code{window}, @code{frame}, or @code{device}), +the specifications for all locales of that type will be returned. +Finally, if @var{locale} is @code{all}, the specifications for all +locales of all types will be returned. + +The specifications in a specifier determine what the value of +@var{property} will be in a particular @dfn{domain} or set of +circumstances, which is typically a particular Emacs window along with +the buffer it contains and the frame and device it lies within. The +value is derived from the instantiator associated with the most specific +locale (in the order buffer, window, frame, device, and @code{global}) +that matches the domain in question. In other words, given a domain +(i.e. an Emacs window, usually), the specifier for @var{property} will +first be searched for a specification whose locale is the buffer +contained within that window; then for a specification whose locale is +the window itself; then for a specification whose locale is the frame +that the window is contained within; etc. The first instantiator that +is valid for the domain (usually this means that the instantiator is +recognized by the device [i.e. the X server or TTY device] that the +domain is on). The function @code{glyph-property-instance} actually does +all this, and is used to determine how to display the glyph. @end defun -@node Image Instance Functions -@subsubsection Image Instance Functions +@defun glyph-property-instance glyph property &optional domain default no-fallback +This function returns the instance of @var{glyph}'s @var{property} in the +specified @var{domain}. -@defun make-image-instance data &optional domain dest-types noerror -This function creates a new image-instance object. +Under most circumstances, @var{domain} will be a particular window, and +the returned instance describes how the specified property actually is +displayed for that window and the particular buffer in it. Note that +this may not be the same as how the property appears when the buffer is +displayed in a different window or frame, or how the property appears in +the same window if you switch to another buffer in that window; and in +those cases, the returned instance would be different. -@var{data} is an image instantiator, which describes the image -(@pxref{Image Specifiers}). +The returned instance is an image-instance object, and you can query it +using the appropriate image instance functions. For example, you could use +@code{image-instance-depth} to find out the depth (number of color +planes) of a pixmap displayed in a particular window. The results might +be different from the results you would get for another window (perhaps +the user specified a different image for the frame that window is on; or +perhaps the same image was specified but the window is on a different X +server, and that X server has different color capabilities from this +one). -@var{dest-types} should be a list of allowed image instance types that -can be generated. The @var{dest-types} list is unordered. If multiple -destination types are possible for a given instantiator, the ``most -natural'' type for the instantiator's format is chosen. (For XBM, the -most natural types are @code{mono-pixmap}, followed by -@code{color-pixmap}, followed by @code{pointer}. For the other normal -image formats, the most natural types are @code{color-pixmap}, followed -by @code{mono-pixmap}, followed by @code{pointer}. For the string and -formatted-string formats, the most natural types are @code{text}, -followed by @code{mono-pixmap} (not currently implemented), followed by -@code{color-pixmap} (not currently implemented). For MS Windows -resources, the most natural type for pointer resources is -@code{pointer}, and for the others it's @code{color-pixmap}. The other -formats can only be instantiated as one type. (If you want to control -more specifically the order of the types into which an image is -instantiated, just call @code{make-image-instance} repeatedly until it -succeeds, passing less and less preferred destination types each time. +@var{domain} defaults to the selected window if omitted. -If @var{dest-types} is omitted, all possible types are allowed. +@var{domain} can be a frame or device, instead of a window. The value +returned for such a domain is used in special circumstances when a +more specific domain does not apply; for example, a frame value might be +used for coloring a toolbar, which is conceptually attached to a frame +rather than a particular window. The value is also useful in +determining what the value would be for a particular window within the +frame or device, if it is not overridden by a more specific +specification. -@var{domain} specifies the domain to which the image instance will be -attached. This domain is termed the @dfn{governing domain}. The type -of the governing domain depends on the image instantiator -format. (Although, more correctly, it should probably depend on the -image instance type.) For example, pixmap image instances are specific -to a device, but widget image instances are specific to a particular -XEmacs window because in order to display such a widget when two windows -onto the same buffer want to display the widget, two separate underlying -widgets must be created. (That's because a widget is actually a child -window-system window, and all window-system windows have a unique -existence on the screen.) This means that the governing domain for a -pixmap image instance will be some device (most likely, the only -existing device), whereas the governing domain for a widget image -instance will be some XEmacs window. +If @var{property} does not name a built-in property, its value will +simply be returned unless it is a specifier object, in which case it +will be instanced using @code{specifier-instance}. -If you specify an overly general @var{domain} (e.g. a frame when a -window was wanted), an error is signaled. If you specify an overly -specific @var{domain} (e.g. a window when a device was wanted), the -corresponding general domain is fetched and used instead. For -@code{make-image-instance}, it makes no difference whether you specify -an overly specific domain or the properly general domain derived from -it. However, it does matter when creating an image instance by -instantiating a specifier or glyph (e.g. with -@code{glyph-image-instance}), because the more specific domain causes -spec lookup to start there and proceed to more general domains. (It -would also matter when creating an image instance with an instantiator -format of @code{inherit}, but we currently disallow this. #### We should -fix this.) -n -If omitted, @var{domain} defaults to the selected window. +Optional arguments @var{default} and @var{no-fallback} are the same as +in @code{specifier-instance}. @xref{Specifiers}. +@end defun -@var{noerror} controls what happens when the image cannot be generated. -If @code{nil}, an error message is generated. If @code{t}, no messages -are generated and this function returns @code{nil}. If anything else, a -warning message is generated and this function returns @code{nil}. +@defun remove-glyph-property glyph property &optional locale tag-set exact-p +This function removes a property from a glyph. For built-in properties, +this is analogous to @code{remove-specifier}. @xref{Specifiers, +remove-specifier-p}, for the meaning of the @var{locale}, @var{tag-set}, +and @var{exact-p} arguments. @end defun -@defun colorize-image-instance image-instance foreground background -This function makes the image instance be displayed in the given -colors. Image instances come in two varieties: bitmaps, which are 1 -bit deep which are rendered in the prevailing foreground and background -colors; and pixmaps, which are of arbitrary depth (including 1) and -which have the colors explicitly specified. This function converts a -bitmap to a pixmap. If the image instance was a pixmap already, -nothing is done (and @code{nil} is returned). Otherwise @code{t} is -returned. + +@node Glyph Convenience Functions +@subsection Glyph Convenience Functions + + The following functions are provided for working with specific +properties of a glyph. Note that these are exactly like calling +the general functions described above and passing in the +appropriate value for @var{property}. + + Remember that if you want to determine the ``value'' of a +specific glyph property, you probably want to use the @code{*-instance} +functions. For example, to determine whether a glyph contributes +to its line height, use @code{glyph-contrib-p-instance}, not +@code{glyph-contrib-p}. (The latter will return a boolean specifier +or a list of specifications, and you probably aren't concerned with +these.) + +@defun glyph-image glyph &optional locale +This function is equivalent to calling @code{glyph-property} with +a property of @code{image}. The return value will be an image +specifier if @var{locale} is @code{nil} or omitted; otherwise, +it will be a specification or list of specifications. @end defun -@defun image-instance-name image-instance -This function returns the name of the given image instance. +@defun set-glyph-image glyph spec &optional locale tag-set how-to-add +This function is equivalent to calling @code{set-glyph-property} with +a property of @code{image}. @end defun -@defun image-instance-domain image-instance +@defun glyph-image-instance glyph &optional domain default no-fallback +This function returns the instance of @var{glyph}'s image in the given +@var{domain}, and is equivalent to calling +@code{glyph-property-instance} with a property of @code{image}. The +return value will be an image instance. -Return the governing domain of the given @var{image-instance}. The -governing domain of an image instance is the domain that the image -instance is specific to. It is @emph{NOT} necessarily the domain that -was given to the call to @code{specifier-instance} that resulted in the -creation of this image instance. See @code{make-image-instance} for -more information on governing domains. +Normally @var{domain} will be a window or @code{nil} (meaning the +selected window), and an instance object describing how the image +appears in that particular window and buffer will be returned. @end defun +@defun glyph-contrib-p glyph &optional locale +This function is equivalent to calling @code{glyph-property} with +a property of @code{contrib-p}. The return value will be a boolean +specifier if @var{locale} is @code{nil} or omitted; otherwise, +it will be a specification or list of specifications. +@end defun -@defun image-instance-string image-instance -This function returns the string of the given image instance. This will -only be non-@code{nil} for text image instances. +@defun set-glyph-contrib-p glyph spec &optional locale tag-set how-to-add +This function is equivalent to calling @code{set-glyph-property} with +a property of @code{contrib-p}. @end defun -@defun image-instance-file-name image-instance -This function returns the file name from which @var{image-instance} was -read, if known. +@defun glyph-contrib-p-instance glyph &optional domain default no-fallback +This function returns whether the glyph contributes to its line height +in the given @var{domain}, and is equivalent to calling +@code{glyph-property-instance} with a property of @code{contrib-p}. The +return value will be either @code{nil} or @code{t}. (Normally @var{domain} +will be a window or @code{nil}, meaning the selected window.) @end defun -@defun image-instance-mask-file-name image-instance -This function returns the file name from which @var{image-instance}'s -mask was read, if known. +@defun glyph-baseline glyph &optional locale +This function is equivalent to calling @code{glyph-property} with a +property of @code{baseline}. The return value will be a specifier if +@var{locale} is @code{nil} or omitted; otherwise, it will be a +specification or list of specifications. @end defun -@defun image-instance-depth image-instance -This function returns the depth of the image instance. This is 0 for a -mono pixmap, or a positive integer for a color pixmap. +@defun set-glyph-baseline glyph spec &optional locale tag-set how-to-add +This function is equivalent to calling @code{set-glyph-property} with +a property of @code{baseline}. @end defun -@defun image-instance-height image-instance -This function returns the height of the image instance, in pixels. +@defun glyph-baseline-instance glyph &optional domain default no-fallback +This function returns the instance of @var{glyph}'s baseline value in +the given @var{domain}, and is equivalent to calling +@code{glyph-property-instance} with a property of @code{baseline}. The +return value will be an integer or @code{nil}. + +Normally @var{domain} will be a window or @code{nil} (meaning the +selected window), and an instance object describing the baseline value +appears in that particular window and buffer will be returned. @end defun -@defun image-instance-width image-instance -This function returns the width of the image instance, in pixels. +@defun glyph-face glyph +This function returns the face of @var{glyph}. (Remember, this is +not a specifier, but a simple property.) @end defun -@defun image-instance-hotspot-x image-instance -This function returns the X coordinate of the image instance's hotspot, -if known. This is a point relative to the origin of the pixmap. When -an image is used as a mouse pointer, the hotspot is the point on the -image that sits over the location that the pointer points to. This is, -for example, the tip of the arrow or the center of the crosshairs. +@defun set-glyph-face glyph face +This function changes the face of @var{glyph} to @var{face}. +@end defun + + +@node Glyph Dimensions +@subsection Glyph Dimensions -This will always be @code{nil} for a non-pointer image instance. +@defun glyph-width glyph &optional window +This function returns the width of @var{glyph} on @var{window}. This +may not be exact as it does not take into account all of the context +that redisplay will. @end defun -@defun image-instance-hotspot-y image-instance -This function returns the Y coordinate of the image instance's hotspot, -if known. +@defun glyph-ascent glyph &optional window +This function returns the ascent value of @var{glyph} on @var{window}. +This may not be exact as it does not take into account all of the +context that redisplay will. @end defun -@defun image-instance-foreground image-instance -This function returns the foreground color of @var{image-instance}, if -applicable. This will be a color instance or @code{nil}. (It will only -be non-@code{nil} for colorized mono pixmaps and for pointers.) +@defun glyph-descent glyph &optional window +This function returns the descent value of @var{glyph} on @var{window}. +This may not be exact as it does not take into account all of the +context that redisplay will. @end defun -@defun image-instance-background image-instance -This function returns the background color of @var{image-instance}, if -applicable. This will be a color instance or @code{nil}. (It will only -be non-@code{nil} for colorized mono pixmaps and for pointers.) +@defun glyph-height glyph &optional window +This function returns the height of @var{glyph} on @var{window}. (This +is equivalent to the sum of the ascent and descent values.) This may +not be exact as it does not take into account all of the context that +redisplay will. @end defun @node Glyph Types -@section Glyph Types +@subsection Glyph Types Each glyph has a particular type, which controls how the glyph's image is generated. Each glyph type has a corresponding list of allowable @@ -1222,6 +1990,7 @@ extent, in the modeline, and in the toolbar. Their image can be instantiated as @code{nothing}, @code{mono-pixmap}, @code{color-pixmap}, @code{text}, and @code{subwindow}. +@c #### Check status of subwindows ... I thought Andy implemented them. @item @code{pointer} glyphs can be used to specify the mouse pointer. Their @@ -1262,126 +2031,6 @@ @code{pointer}. @end defun -@node Mouse Pointer -@section Mouse Pointer -@cindex mouse cursor -@cindex cursor (mouse) -@cindex pointer (mouse) -@cindex mouse pointer - -The shape of the mouse pointer when over a particular section of a frame -is controlled using various glyph variables. Since the image of a glyph -is a specifier, it can be controlled on a per-buffer, per-frame, per-window, -or per-device basis. - -You should use @code{set-glyph-image} to set the following variables, -@emph{not} @code{setq}. - -@defvr Glyph text-pointer-glyph -This variable specifies the shape of the mouse pointer when over text. -@end defvr - -@defvr Glyph nontext-pointer-glyph -This variable specifies the shape of the mouse pointer when over a -buffer, but not over text. If unspecified in a particular domain, -@code{text-pointer-glyph} is used. -@end defvr - -@defvr Glyph modeline-pointer-glyph -This variable specifies the shape of the mouse pointer when over the modeline. -If unspecified in a particular domain, @code{nontext-pointer-glyph} is used. -@end defvr - -@defvr Glyph selection-pointer-glyph -This variable specifies the shape of the mouse pointer when over a -selectable text region. If unspecified in a particular domain, -@code{text-pointer-glyph} is used. -@end defvr - -@defvr Glyph gc-pointer-glyph -This variable specifies the shape of the mouse pointer when a garbage -collection is in progress. If the selected window is on a window system -and this glyph specifies a value (i.e. a pointer image instance) in the -domain of the selected window, the pointer will be changed as specified -during garbage collection. Otherwise, a message will be printed in the -echo area, as controlled by @code{gc-message}. -@end defvr - -@defvr Glyph busy-pointer-glyph -This variable specifies the shape of the mouse pointer when XEmacs is busy. -If unspecified in a particular domain, the pointer is not changed -when XEmacs is busy. -@end defvr - -@defvr Glyph menubar-pointer-glyph -This variable specifies the shape of the mouse pointer when over the -menubar. If unspecified in a particular domain, the -window-system-provided default pointer is used. -@end defvr - -@defvr Glyph scrollbar-pointer-glyph -This variable specifies the shape of the mouse pointer when over a -scrollbar. If unspecified in a particular domain, the -window-system-provided default pointer is used. -@end defvr - -@defvr Glyph toolbar-pointer-glyph -This variable specifies the shape of the mouse pointer when over a -toolbar. If unspecified in a particular domain, -@code{nontext-pointer-glyph} is used. -@end defvr - -Internally, these variables are implemented in -@code{default-mouse-motion-handler}, and thus only take effect when the -mouse moves. That function calls @code{set-frame-pointer}, which sets -the current mouse pointer for a frame. - -@defun set-frame-pointer frame image-instance -This function sets the mouse pointer of @var{frame} to the given pointer -image instance. You should not call this function directly. -(If you do, the pointer will change again the next time the mouse moves.) -@end defun - -@node Redisplay Glyphs -@section Redisplay Glyphs - -@defvr Glyph truncation-glyph -This variable specifies what is displayed at the end of truncated lines. -@end defvr - -@defvr Glyph continuation-glyph -This variable specifies what is displayed at the end of wrapped lines. -@end defvr - -@defvr Glyph octal-escape-glyph -This variable specifies what to prefix character codes displayed in octal -with. -@end defvr - -@defvr Glyph hscroll-glyph -This variable specifies what to display at the beginning of horizontally -scrolled lines. -@end defvr - -@defvr Glyph invisible-text-glyph -This variable specifies what to use to indicate the presence of -invisible text. This is the glyph that is displayed when an ellipsis is -called for, according to @code{selective-display-ellipses} or -@code{buffer-invisibility-spec}). Normally this is three dots (``...''). -@end defvr - -@defvr Glyph control-arrow-glyph -This variable specifies what to use as an arrow for control characters. -@end defvr - -@node Subwindows -@section Subwindows - -Subwindows are not currently implemented. - -@defun subwindowp object -This function returns non-@code{nil} if @var{object} is a subwindow. -@end defun @node Glyph Examples @section Glyph Examples diff --text -u 'xemacs-21.5.17/man/lispref/gutter.texi' 'xemacs-21.5.18/man/lispref/gutter.texi' Index: ./man/lispref/gutter.texi --- ./man/lispref/gutter.texi Fri Apr 13 03:22:14 2001 +++ ./man/lispref/gutter.texi Mon Apr 19 17:02:38 2004 @@ -14,15 +14,13 @@ @menu * Gutter Intro:: An introduction. -* Creating Gutter:: How to create a gutter. -* Gutter Descriptor Format:: Accessing and modifying a gutter's - properties. +* Creating Gutters:: How to create a gutter. * Specifying a Gutter:: Setting a gutter's contents. * Other Gutter Variables:: Controlling the size of gutters. * Common Gutter Widgets:: Things to put in gutters. @end menu -@node Gutter Intro, Creating Gutter, Gutter, Gutter +@node Gutter Intro, Creating Gutters, Gutter, Gutter @section Gutter Intro A @dfn{gutter} is a rectangle displayed along one edge of a frame. It @@ -37,7 +35,7 @@ be per-buffer, per-frame, etc., using specifiers (@pxref{Specifiers}). Normally, there is one gutter displayed in a frame. Usually, this is -the default gutter, containing buffer tabs, but modes cab override this +the default gutter, containing buffer tabs, but modes can override this and substitute their own gutter. This default gutter is usually positioned along the top of the frame, but this can be changed using @code{set-default-gutter-position}. @@ -59,8 +57,8 @@ the user sets the default gutter to the same position, it will just not be visible. -@node Creating Gutter, Gutter Descriptor Format, Gutter Intro, Gutter -@section Creating Gutter +@node Creating Gutters, Specifying a Gutter, Gutter Intro, Gutter +@section Creating Gutters @defun make-gutter-specifier spec-list @@ -75,9 +73,15 @@ @code{left-gutter}, @code{right-gutter}, and @code{bottom-gutter} are always gutter specifiers. -Valid gutter instantiators are called "gutter descriptors" and are -either strings or property-lists of strings. See @code{default-gutter} -for a description of the exact format. +Valid gutter instantiators are called ``gutter descriptors.'' A gutter +descriptor may be a string, a property-list with symbol keys and string +values, or @code{nil}. If @code{nil}, nothing will be displayed in the +gutter. If a string, the string will be displayed, with text properties +such as faces and additional glyphs taken from the extents in the +string, if any. If a property-list of strings, the string values will +be conditionally concatenated according to the contents of the +corresponding @samp{gutter-visible} variable, and displayed according to +any text properties they contain. @end defun @defun make-gutter-size-specifier spec-list @@ -88,16 +92,19 @@ or a list of instantiators. @xref{Specifiers}, for more information about specifiers. -Gutter-size specifiers are used to specify the size of a gutter. The -values of the variables @code{default-gutter-size}, -@code{top-gutter-size}, @code{left-gutter-size}, -@code{right-gutter-size}, and @code{bottom-gutter-size} are always -gutter-size specifiers. +Gutter-size specifiers are used to specify the size of a gutter. +The width of top and bottom gutters and the height of left and right +gutters are always adjusted to the size of the frame, so ``size'' means +``thickness,'' @emph{i.e.}, height for top and bottom gutters and width +for left and right gutters. The values of the variables +@code{default-gutter-size}, @code{top-gutter-size}, +@code{left-gutter-size}, @code{right-gutter-size}, and +@code{bottom-gutter-size} are always gutter-size specifiers. Valid gutter-size instantiators are either integers or the special -symbol @code{autodetect}. If a gutter-size is set to @code{autodetect} +symbol @code{autodetect}. If a gutter-size is set to @code{autodetect} them the size of the gutter will be adjusted to just accommodate the -gutters contents. @code{autodetect} only works for top and bottom +gutter's contents. @code{autodetect} only works for top and bottom gutters. @end defun @@ -117,125 +124,12 @@ Valid gutter-visible instantiators are @code{t}, @code{nil} or a list of symbols. If a gutter-visible instantiator is set to a list of symbols, -and the corresponding gutter specification is a property-list strings, -then elements of the gutter specification will only be visible if the -corresponding symbol occurs in the gutter-visible instantiator. +and the corresponding gutter specification is a property-list of strings, +then property values of the gutter specification will only be visible if the +corresponding key occurs in the gutter-visible instantiator. @end defun -@node Gutter Descriptor Format, Specifying a Gutter, Creating Gutter, Gutter -@section Gutter Descriptor Format - - The contents of a gutter are specified using a @dfn{gutter descriptor}. -The format of a gutter descriptor is a list of @dfn{gutter button -descriptors}. Each gutter button descriptor is a vector in one of the -following formats: - -@itemize @bullet -@item -@code{[@var{glyph-list} @var{function} @var{enabled-p} @var{help}]} -@item -@code{[:style @var{2d-or-3d}]} -@item -@code{[:style @var{2d-or-3d} :size @var{width-or-height}]} -@item -@code{[:size @var{width-or-height} :style @var{2d-or-3d}]} -@end itemize - - Optionally, one of the gutter button descriptors may be @code{nil} -instead of a vector; this signifies the division between the gutter -buttons that are to be displayed flush-left, and the buttons to be -displayed flush-right. - - The first vector format above specifies a normal gutter button; -the others specify blank areas in the gutter. - - For the first vector format: - -@itemize @bullet -@item -@var{glyph-list} should be a list of one to six glyphs (as created by -@code{make-glyph}) or a symbol whose value is such a list. The first -glyph, which must be provided, is the glyph used to display the gutter -button when it is in the ``up'' (not pressed) state. The optional -second glyph is for displaying the button when it is in the ``down'' -(pressed) state. The optional third glyph is for when the button is -disabled. The last three glyphs are for displaying the button in the -``up'', ``down'', and ``disabled'' states, respectively, but are used -when the user has called for captioned gutter buttons (using -@code{gutter-buttons-captioned-p}). The function -@code{gutter-make-button-list} is useful in creating these glyph lists. - -@item -Even if you do not provide separate down-state and disabled-state -glyphs, the user will still get visual feedback to indicate which -state the button is in. Buttons in the up-state are displayed -with a shadowed border that gives a raised appearance to the -button. Buttons in the down-state are displayed with shadows that -give a recessed appearance. Buttons in the disabled state are -displayed with no shadows, giving a 2-d effect. - -@item -If some of the gutter glyphs are not provided, they inherit as follows: - -@example - UP: up - DOWN: down -> up - DISABLED: disabled -> up - CAP-UP: cap-up -> up - CAP-DOWN: cap-down -> cap-up -> down -> up - CAP-DISABLED: cap-disabled -> cap-up -> disabled -> up -@end example - -@item -The second element @var{function} is a function to be called when the -gutter button is activated (i.e. when the mouse is released over the -gutter button, if the press occurred in the gutter). It can be any -form accepted by @code{call-interactively}, since this is how it is -invoked. - -@item -The third element @var{enabled-p} specifies whether the gutter button -is enabled (disabled buttons do nothing when they are activated, and are -displayed differently; see above). It should be either a boolean or a -form that evaluates to a boolean. - -@item -The fourth element @var{help}, if non-@code{nil}, should be a string. -This string is displayed in the echo area when the mouse passes over the -gutter button. -@end itemize - - For the other vector formats (specifying blank areas of the gutter): - -@itemize @bullet -@item -@var{2d-or-3d} should be one of the symbols @code{2d} or @code{3d}, -indicating whether the area is displayed with shadows (giving it a -raised, 3-d appearance) or without shadows (giving it a flat -appearance). - -@item -@var{width-or-height} specifies the length, in pixels, of the blank -area. If omitted, it defaults to a device-specific value (8 pixels for -X devices). -@end itemize - -@defun gutter-make-button-list up &optional down disabled cap-up cap-down cap-disabled -This function calls @code{make-glyph} on each arg and returns a list of -the results. This is useful for setting the first argument of a gutter -button descriptor (typically, the result of this function is assigned -to a symbol, which is specified as the first argument of the gutter -button descriptor). -@end defun - -@defun check-gutter-button-syntax button &optional noerror -Verify the syntax of entry @var{button} in a gutter description list. -If you want to verify the syntax of a gutter description list as a -whole, use @code{check-valid-instantiator} with a specifier type of -@code{gutter}. -@end defun - -@node Specifying a Gutter, Other Gutter Variables, Gutter Descriptor Format, Gutter +@node Specifying a Gutter, Other Gutter Variables, Creating Gutters, Gutter @section Specifying a Gutter In order to specify the contents of a gutter, set one of the specifier @@ -315,7 +209,7 @@ This function returns non-@code{nil} if @var{object} is a gutter specifier. Gutter specifiers are the actual objects contained in the gutter variables described above, and their valid instantiators are -gutter descriptors (@pxref{Gutter Descriptor Format}). +gutter descriptors. @end defun @node Other Gutter Variables, Common Gutter Widgets, Specifying a Gutter, Gutter @@ -397,6 +291,7 @@ @code{default-gutter-visible-p} and all of the position-specific gutter visibility specifiers have a fallback value of true. +@c #### is this true? Internally, gutter thickness and visibility specifiers are instantiated in both window and frame domains, for different purposes. The value in the domain of a frame's selected window specifies the actual gutter @@ -415,18 +310,6 @@ selected window specifies that the left gutter is not visible, so it is expanded to take up the slack. -@defvr Specifier gutter-buttons-captioned-p -Whether gutter buttons are captioned. This affects which glyphs from a -gutter button descriptor are chosen. @xref{Gutter Descriptor Format}. -@end defvr - - You can also reset the gutter to what it was when XEmacs started up. - -@defvr Constant initial-gutter-spec -The gutter descriptor used to initialize @code{default-gutter} at -startup. -@end defvr - @node Common Gutter Widgets, , Other Gutter Variables, Gutter @section Common Gutter Widgets @@ -439,20 +322,26 @@ A more common use for the gutter is to hold some kind of active widget. The buffer-tab facility, available in all XEmacs frames, creates an array of file-folder-like tabs, which the user can click with -the mouse to switch buffers. W3 uses a progress-bar widget in the +the mouse to switch buffers. W3 and font-lock use progress-bar widgets in the bottom gutter to give a visual indication of the progress of -time-consuming operations like downloading. +time-consuming operations like downloading and syntax highlighting. + +@c #### Remove the following sentence when the subnodes are created. +These widgets are currently documented only in the library +@file{gutter-items}. @menu * Buffer Tabs:: Tabbed divider index metaphor for switching buffers. * Progress Bars:: Visual indication of operation progress. @end menu + @node Buffer Tabs, Progress Bars, ,Common Gutter Widgets @subsection Buffer Tabs Not documented yet. + @node Progress Bars, , Buffer Tabs, Common Gutter Widgets @subsection Progress Bars diff --text -u 'xemacs-21.5.17/man/lispref/lispref.texi' 'xemacs-21.5.18/man/lispref/lispref.texi' Index: ./man/lispref/lispref.texi --- ./man/lispref/lispref.texi Wed Jan 21 18:03:47 2004 +++ ./man/lispref/lispref.texi Mon Jul 19 17:24:28 2004 @@ -328,7 +328,9 @@ Numbers * Integer Basics:: Representation and range of integers. +* Ratio Basics:: Representation and range of rational numbers. * Float Basics:: Representation and range of floating point. +* The Bignum Extension:: Arbitrary precision integers, ratios, and floats. * Predicates on Numbers:: Testing for numbers. * Comparison of Numbers:: Equality and inequality predicates. * Arithmetic Operations:: How to add, subtract, multiply and divide. @@ -992,39 +994,57 @@ Glyphs -* Glyph Functions:: Functions for working with glyphs. -* Images:: Graphical images displayed in a frame. -* Glyph Types:: Each glyph has a particular type. -* Mouse Pointer:: Controlling the mouse pointer. -* Redisplay Glyphs:: Glyphs controlling various redisplay functions. -* Subwindows:: Inserting an externally-controlled subwindow - into a buffer. -* Glyph Examples:: Examples of how to work with glyphs. +* Glyph Intro:: Glyphs are abstract image specifications. +* Images:: Specifying the appearance of glyphs. +* Using Glyphs:: Creating and displaying glyphs. +* Manipulating Glyphs:: Getting and setting glyph properties. +* Glyph Examples:: Examples of how to work with glyphs. -Glyph Functions +Images -* Creating Glyphs:: Creating new glyphs. -* Glyph Properties:: Accessing and modifying a glyph's properties. -* Glyph Convenience Functions:: - Convenience functions for accessing particular - properties of a glyph. -* Glyph Dimensions:: Determining the height, width, etc. of a glyph. +* Image Specifiers:: Specifying an image's appearance. +* Image Instantiator Conversion:: Lazy realization of graphics. +* Image Instantiator Formats:: A catalog of image descriptors. +* Image Instances:: Classes of graphical objects. -Images +Image Instances + +* Image Instance Types:: Each image instances has a particular type. +* Image Instance Functions:: Functions for working with image instances. + +Using Glyphs -* Image Specifiers:: Specifying how an image will appear. -* Image Instantiator Conversion:: - Conversion is applied to image instantiators - at the time they are added to an - image specifier or at the time they - are passed to @code{make-image-instance}. -* Image Instances:: What an image specifier gets instanced as. Image Instances * Image Instance Types:: Each image instances has a particular type. * Image Instance Functions:: Functions for working with image instances. +Using Glyphs + +* Creating Glyphs:: Creating new glyphs. +* Buffer Glyphs:: Annotations are glyphs that appear in a buffer. +* Redisplay Glyphs:: Glyphs controlling various redisplay functions. +* Frame Glyphs:: Displaying glyphs in GUI components of the frame. +* External Glyphs:: Icons and mouse pointers for the window system. +* Native GUI Widgets:: Complex active elements treated as a single glyph. +* Subwindows:: Externally-controlled subwindows in buffers. + +Native GUI Widgets + +* Introduction to Widgets:: Native widgets provide tight integration of + GUI features with the platform GUI. +* Lisp API to Native Widgets:: Native widgets are glyphs. +* Layouts:: Specifying composite widgets from Lisp. +* Primitive Widgets:: Catalogue of available native widgets. + +Manipulating Glyphs + +* Glyph Properties:: Accessing and modifying a glyph's properties. +* Glyph Convenience Functions:: Accessing particular properties of a glyph. +* Glyph Dimensions:: Determining the height, width, etc. of a glyph. +* Glyph Types:: Each glyph has a particular type. + Annotations * Annotation Basics:: Introduction to annotations. diff --text -u 'xemacs-21.5.17/man/lispref/modes.texi' 'xemacs-21.5.18/man/lispref/modes.texi' Index: ./man/lispref/modes.texi --- ./man/lispref/modes.texi Fri Apr 13 03:22:17 2001 +++ ./man/lispref/modes.texi Thu Jun 17 12:01:17 2004 @@ -31,7 +31,12 @@ @cindex Fundamental mode Major modes specialize XEmacs for editing particular kinds of text. -Each buffer has only one major mode at a time. +Each buffer has only one major mode at a time. For each major mode +there is a function to switch to that mode in the current buffer; its +name should end in @samp{-mode}. These functions work by setting +buffer-local variable bindings and other data associated with the +buffer, such as a local keymap. The effect lasts until you switch +to another major mode in the same buffer. The least specialized major mode is called @dfn{Fundamental mode}. This mode has no mode-specific definitions or variable settings, so each @@ -55,6 +60,11 @@ Text mode except that it provides three additional commands. Its definition is distinct from that of Text mode, but was derived from it. + Even if the new mode is not an obvious derivative of any other mode, +it is convenient to use @code{define-derived-mode} with a @code{nil} +parent argument, since it automatically enforces the most important +coding conventions for you. + Rmail Edit mode is an example of a case where one piece of text is put temporarily into a different major mode so it can be edited in a different way (with ordinary XEmacs commands rather than Rmail). In such @@ -189,6 +199,16 @@ or it may run them earlier. @item +The major mode command may start by calling some other major mode +command (called the @dfn{parent mode}) and then alter some of its +settings. A mode that does this is called a @dfn{derived mode}. The +recommended way to define one is to use @code{define-derived-mode}, +but this is not required. Such a mode should use +@code{delay-mode-hooks} around its entire body, including the call to +the parent mode command and the final call to @code{run-mode-hooks}. +(Using @code{define-derived-mode} does this automatically.) + +@item If something special should be done if the user switches a buffer from this mode to any other major mode, the mode can set a local value for @code{change-major-mode-hook}. @@ -743,6 +763,9 @@ (define-key hypertext-mode-map [down-mouse-3] 'do-hyper-link) @end example + +Do not write an @code{interactive} spec in the definition; +@code{define-derived-mode} does that automatically. @end defmac @node Minor Modes @@ -1398,6 +1421,41 @@ @end example @end defun +@defun run-mode-hooks &rest hookvars +Like @code{run-hooks}, but is affected by the @code{delay-mode-hooks} +macro. +@end defun + +@defmac delay-mode-hooks body... +This macro executes the @var{body} forms but defers all calls to +@code{run-mode-hooks} within them until the end of @var{body}. +This macro enables a derived mode to arrange not to run +its parent modes' mode hooks until the end. +@end defmac + +@defun run-hook-with-args hook &rest args +This function is the way to run an abnormal hook and always call all +of the hook functions. It calls each of the hook functions one by +one, passing each of them the arguments @var{args}. +@end defun + +@defun run-hook-with-args-until-failure hook &rest args +This function is the way to run an abnormal hook until one of the hook +functions fails. It calls each of the hook functions, passing each of +them the arguments @var{args}, until some hook function returns +@code{nil}. It then stops and returns @code{nil}. If none of the +hook functions return @code{nil}, it returns a non-@code{nil} value. +@end defun + +@defun run-hook-with-args-until-success hook &rest args +This function is the way to run an abnormal hook until a hook function +succeeds. It calls each of the hook functions, passing each of them +the arguments @var{args}, until some hook function returns +non-@code{nil}. Then it stops, and returns whatever was returned by +the last hook function that was called. If all hook functions return +@code{nil}, it returns @code{nil} as well. +@end defun + @defun add-hook hook function &optional append local This function is the handy way to add function @var{function} to hook variable @var{hook}. The argument @var{function} may be any valid Lisp diff --text -u 'xemacs-21.5.17/man/lispref/numbers.texi' 'xemacs-21.5.18/man/lispref/numbers.texi' Index: ./man/lispref/numbers.texi --- ./man/lispref/numbers.texi Fri Oct 10 21:39:34 2003 +++ ./man/lispref/numbers.texi Mon Jul 19 17:24:28 2004 @@ -5,12 +5,18 @@ @setfilename ../../info/numbers.info @node Numbers, Strings and Characters, Lisp Data Types, Top @chapter Numbers +@c #### Improve the indexing in this file!!!! @cindex integers @cindex numbers - XEmacs supports two numeric data types: @dfn{integers} and -@dfn{floating point numbers}. Integers are whole numbers such as -@minus{}3, 0, #b0111, #xFEED, #o744. Their values are exact. The + XEmacs supports two to five numeric data types. @dfn{Integers} and +@dfn{floating point numbers} are always supported. As a build-time +option, @dfn{bignums}, @dfn{ratios}, and @dfn{bigfloats} may be +enabled on some platforms. + + Integers, which are what Common Lisp calls +@dfn{fixnums}, are whole numbers such as @minus{}3, 0, #b0111, #xFEED, +#o744. Their values are exact, and their range is limited. The number prefixes `#b', `#o', and `#x' are supported to represent numbers in binary, octal, and hexadecimal notation (or radix). Floating point numbers are numbers with fractional parts, such as @minus{}4.5, 0.0, or @@ -19,12 +25,50 @@ power, and is multiplied by 1.5. Floating point values are not exact; they have a fixed, limited amount of precision. + Bignums are arbitrary precision integers. When supported, XEmacs can +handle any integral calculations you have enough virtual memory to +store. (More precisely, on current architectures the representation +allows integers whose storage would exhaust the address space.) They +are notated in the same way as other integers (fixnums). XEmacs +automatically converts results of computations from fixnum to bignum, +and back, depending on the storage required to represent the number. +Thus use of bignums are entirely transparent to the user, except for a +few special applications that expect overflows. Ratios are rational +numbers with arbitrary precision. They are notated in the +usual way with the solidus, for example 5/3 or @minus{}22/7. + + Bigfloats are floating point numbers with arbitrary precision, which +may be specified by the user (and may be different for different +bigfloats at the same time). Unlike integers, which are always +infinitely precise if they can be represented, floating point numbers +are inherently imprecise. This means that choice of precision can be a +very delicate issue. XEmacs automatically converts @emph{from float to +bigfloat} when floats and bigfloats are mixed in an expression, but a +bigfloat will never be converted to a float unless the user explicitly +coerces the value. Nor will the result of a float operation be +converted to bigfloat, except for ``contagion'' from another operand +that is already a bigfloat. However, when bigfloats of differing +precision are mixed, the result will always have the larger precision. +The exact rules are more carefully explained elsewhere +(@pxref{Canonicalization and Contagion}). + + Note that the term ``integer'' is used throughout the XEmacs +documentation and code to mean ``fixnum''. This is inconsistent with +Common Lisp, and likely to cause confusion. Similarly, ``float'' is +used to mean ``fixed precision floating point number'', and the Common +Lisp distinctions among @dfn{short-floats}, @dfn{long-floats}, +@emph{etc.}, and bigfloats (which are not standardized in Common Lisp) +are not reflected in XEmacs terminology. (Volunteers to fix this in the +XEmacs manuals would be heartily welcomed.) + @menu * Integer Basics:: Representation and range of integers. -* Float Basics:: Representation and range of floating point. +* Rational Basics:: Representation and range of rational numbers. +* Float Basics:: Representation and range of floating point. +* The Bignum Extension:: Arbitrary precision integers, ratios, and floats. * Predicates on Numbers:: Testing for numbers. * Comparison of Numbers:: Equality and inequality predicates. -* Numeric Conversions:: Converting float to integer and vice versa. +* Numeric Conversions:: Converting float to integer and vice versa. * Arithmetic Operations:: How to add, subtract, multiply and divide. * Rounding Operations:: Explicitly rounding floating point numbers. * Bitwise Operations:: Logical and, or, not, shifting. @@ -35,25 +79,51 @@ @node Integer Basics @section Integer Basics - The range of values for an integer depends on the machine. The -minimum range is @minus{}134217728 to 134217727 (28 bits; i.e., + The range of values for an integer depends on the machine. If a +multiple-precision arithmetic library is available on your platform, +support for bignums, that is, integers with arbitrary precision, may be +compiled in to your XEmacs. The rest of this section assumes that the +bignum extension is @emph{not} available. The bignum extension and the +user-visible differences in normal integer arithmetic are discussed in a +separate section @ref{The Bignum Extension}. + +The minimum range is @minus{}1073741824 to 1073741823 (31 bits; i.e., @ifinfo --2**27 +-2**30 @end ifinfo @tex -$-2^{27}$ +$-2^{30}$ @end tex to @ifinfo -2**27 - 1), +2**30 - 1), @end ifinfo @tex -$2^{27}-1$), +$2^{30}-1$), @end tex but some machines may provide a wider range. Many examples in this -chapter assume an integer has 28 bits. +chapter assume an integer has 31 bits. @cindex overflow +The range of fixnums is available to Lisp programs: + +@defvar most-positive-fixnum +The fixed-precision integer closest in value to positive infinity. +@end defvar + +@defvar most-negative-fixnum +The fixed-precision integer closest in value to negative infinity. +@end defvar + +Here is a common idiom to temporarily suppress garbage collection: +@example +(garbage-collect) +(let ((gc-cons-threshold most-positive-fixnum)) + ;; allocation-intensive computation + ) +(garbage-collect) +@end example + The Lisp reader reads an integer as a sequence of digits with optional initial sign and optional final period. @@ -62,7 +132,7 @@ 1. ; @r{The integer 1.} +1 ; @r{Also the integer 1.} -1 ; @r{The integer @minus{}1.} - 268435457 ; @r{Also the integer 1, due to overflow.} + 2147483648 ; @r{Read error, due to overflow.} 0 ; @r{The integer 0.} -0 ; @r{The integer 0.} @end example @@ -71,10 +141,10 @@ bitwise operators (@pxref{Bitwise Operations}), it is often helpful to view the numbers in their binary form. - In 28-bit binary, the decimal integer 5 looks like this: + In 31-bit binary, the decimal integer 5 looks like this: @example -0000 0000 0000 0000 0000 0000 0101 +000 0000 0000 0000 0000 0000 0000 0101 @end example @noindent @@ -84,12 +154,12 @@ The integer @minus{}1 looks like this: @example -1111 1111 1111 1111 1111 1111 1111 +111 1111 1111 1111 1111 1111 1111 1111 @end example @noindent @cindex two's complement -@minus{}1 is represented as 28 ones. (This is called @dfn{two's +@minus{}1 is represented as 31 ones. (This is called @dfn{two's complement} notation.) The negative integer, @minus{}5, is creating by subtracting 4 from @@ -97,27 +167,27 @@ @minus{}5 looks like this: @example -1111 1111 1111 1111 1111 1111 1011 +111 1111 1111 1111 1111 1111 1111 1011 @end example - In this implementation, the largest 28-bit binary integer is the -decimal integer 134,217,727. In binary, it looks like this: + In this implementation, the largest 31-bit binary integer is the +decimal integer 1,073,741,823. In binary, it looks like this: @example -0111 1111 1111 1111 1111 1111 1111 +011 1111 1111 1111 1111 1111 1111 1111 @end example Since the arithmetic functions do not check whether integers go -outside their range, when you add 1 to 134,217,727, the value is the -negative integer @minus{}134,217,728: +outside their range, when you add 1 to 1,073,741,823, the value is the +negative integer @minus{}1,073,741,824: @example -(+ 1 134217727) - @result{} -134217728 - @result{} 1000 0000 0000 0000 0000 0000 0000 +(+ 1 1073741823) + @result{} -1073741824 + @result{} 100 0000 0000 0000 0000 0000 0000 0000 @end example - Many of the following functions accept markers for arguments as well + Many of the arithmetic functions accept markers for arguments as well as integers. (@xref{Markers}.) More precisely, the actual arguments to such functions may be either integers or markers, which is why we often give these arguments the name @var{int-or-marker}. When the argument @@ -129,12 +199,43 @@ floating point numbers. @end ignore + +@node Rational Basics +@section Rational Basics + +Ratios (built-in rational numbers) are available only when the bignum +extension is built into your XEmacs. This facility is new and +experimental. It is discussed in a separate section for convenience of +updating the documentation @ref{The Bignum Extension}. The following +functions are defined regardless of the presence of the extension, but +have trivial results for integers. + +@defun numerator rational +@cindex numbers +Return the numerator of the canonical form of @var{rational}. +If @var{rational} is an integer, @var{rational} is returned. +@var{rational} must be an integer or a ratio. +@end defun + +@defun denominator rational +Return the denominator of the canonical form of @var{rational}. +If @var{rational} is an integer, 1 is returned. @var{rational} must be +an integer or a ratio. +@end defun + + @node Float Basics @section Floating Point Basics XEmacs supports floating point numbers. The precise range of floating point numbers is machine-specific; it is the same as the range of the C -data type @code{double} on the machine in question. +data type @code{double} on the machine in question. If a +multiple-precision arithmetic library is available on your platform, +support for bigfloats, that is, floating point numbers with arbitrary +precision, may be compiled in to your XEmacs. The rest of this section +assumes that the bignum extension is @emph{not} available. The bigfloat +extension and the user-visible differences in normal float arithmetic +are discussed in a separate section @ref{The Bignum Extension}. The printed representation for floating point numbers requires either a decimal point (with at least one digit following), an exponent, or @@ -169,23 +270,338 @@ down to an integer. @end defun +The range of floats is available to Lisp programs: + +@defvar most-positive-float +The fixed-precision floating-point-number closest in value to positive +infinity. +@end defvar + +@defvar most-negative-float +The fixed-precision floating point number closest in value to negative +infinity. +@end defvar + +@defvar least-positive-float +The positive float closest in value to 0. May not be normalized. +@end defvar + +@defvar least-negative-float +The positive float closest in value to 0. Must be normalized. +@end defvar + +@defvar least-positive-normalized-float +The negative float closest in value to 0. May not be normalized. +@end defvar + +@defvar least-negative-normalized-float +The negative float closest in value to 0. Must be normalized. +@end defvar + +Note that for floating point numbers there is an interesting limit on +how small they can get, as well as a limit on how big they can get. In +some representations, a floating point number is @dfn{normalized} if the +leading digit is non-zero. This allows representing numbers smaller +than the most-negative exponent can express, by having fractional +mantissas. This means that the number is less precise than a normalized +floating point number, so Lisp programs can detect loss of precision due +to unnormalized floats by checking whether the number is between +@code{least-positive-float} and @code{least-positive-normalized-float}. + + +@node The Bignum Extension +@section The Bignum Extension + + In XEmacs 21.5.18, an extension was added by @email{james@@xemacs.org, +Jerry James} to allow linking with arbitrary-precision arithmetic +libraries if they are available on your platform. ``Arbitrary'' +precision means precisely what it says. Your ability to work with large +numbers is limited only by the amount of virtual memory (and time) you +can throw at them. + + As of 09 April 2004, support for the GNU Multiple Precision +arithmetic library (GMP) is nearly complete, and support for the BSD +Multiple Precision arithmetic library (MP) is being debugged. To enable +bignum support using GMP (respectively MP), invoke configure with your +usual options, and add @samp{--use-number-lib=gmp} (respectively +@samp{--use-number-lib=mp}). The default is to disable bignum support, +but if you are using a script to automate the build process, it may be +convenient to explicitly disable support by @emph{appending} +@samp{--use-number-lib=no} to your invocation of configure. GMP has an +MP compatibility mode, but it is not recommended, as there remain poorly +understood bugs (even more so than for other vendors' versions of MP). + + With GMP, exact arithmetic with integers and ratios of arbitrary +precision and approximate (``floating point'') arithmetic of arbitrary +precision are implemented efficiently in the library. (Note that +numerical implementations are quite delicate and sensitive to +optimization. If the library was poorly optimized for your hardware, as +is often the case with Linux distributions for 80x86, you may achieve +gains of @emph{several orders of magnitude} by rebuilding the MP +library. See @uref{http://www.swox.com/gmp/gmp-speed.html}.) The MP +implementation provides arbitrary precision integers. Ratios and arbitrary +precision floats are not available with MP. + + If your code needs to run correctly whether or not the feature is +provided, you may test for the features @code{bignum}, @code{ratio}, and +@code{bigfloat}. + + The XEmacs bignum facility implements the Common Lisp notions of +@dfn{canonicalization} and @dfn{contagion}. Canonicalization means that +in exact (integer and ratio) arithmetic, a result of an operation is +always converted to the ``smallest'' type that can represent it +exactly. For exact numbers, the user only cares if efficiency is +extremely important; Lisp does not try to determine an order of +computation that avoids conversion to bignum (or ratio) even if one is +available. (Note that integers are never silently converted to +ratios: the result of @code{(/ 1 2)} is the integer @code{0}. You can +@emph{request} that a ratio be used if needed with @code{(div 1 2)}.) + + Since floating point arithmetic is inherently imprecise, numbers are +implicitly coerced to bigfloats only if other operands in the expression +are bigfloat, and bigfloats are only coerced to other numerical types by +explicit calls to the function @code{coerce}. + + Bignum support is incomplete. If you would like to help with bignum +support, especially on BSD MP, please subscribe to the +@uref{http://www.xemacs.org/Lists/#xemacs-beta, XEmacs Beta mailing +list}, and book up on @file{number-gmp.h} and @file{number-mp.h}. Jerry +has promised to write internals documentation eventually, but if your +skills run more to analysis and documentation than to writing new code, +feel free to fill in the gap! + +@menu +* Bignum Basics:: Representation and range of integers. +* Ratio Basics:: Representation and range of rational numbers. +* Bigfloat Basics:: Representation and range of floating point. +* Canonicalization and Contagion:: Automatic coercion to other types. +* Compatibility Issues:: Changes in fixed-precision arithmetic. +@end menu + + +@node Bignum Basics +@subsection Bignum Basics + +In most cases, bignum support should be transparent to users and Lisp +programmers. A bignum-enabled XEmacs will automatically convert from +fixnums to bignums and back in pure integer arithmetic, and for GNU MP, +from floats to bigfloats. (Bigfloats must be explicitly coerced to +other types, even if they are exactly representable by less precise +types.) The Lisp reader and printer have been enhanced to handle +bignums, as have the mathematical functions. Rationals (fixnums, +bignums, and ratios) are printed using the @samp{%d}, @samp{%o}, +@samp{%x}, and @samp{%u} format conversions. + + +@node Ratio Basics +@subsection Ratio Basics + +Ratios, when available have the read syntax and print representation +@samp{3/5}. Like other rationals (fixnums and bignums), they are +printed using the @samp{%d}, @samp{%o}, @samp{%x}, and @samp{%u} format +conversions. + + +@node Bigfloat Basics +@subsection Bigfloat Basics + +Bigfloats, when available, have the same read syntax and print +representations as fixed-precision floats. + +It is possible to make bigfloat the default floating point format by +setting @code{default-float-precision} to a non-zero value. Precision +is given in bits, with a maximum precision of @code{bigfloat-max-prec}. +@c #### is this true? +Bigfloats are created automatically when a number with yes + + + +@node Canonicalization and Contagion +@subsection Canonicalization and Contagion + +@dfn{Canonicalization} is a rule intended to enhance the time and space +efficiency of exact arithmetic. Because bignums and ratios are +implemented as record objects, they take up much more space than +fixnums, which are implemented as an immediate object. Conversions and +calls to the MP library also take time. So the implementation always +converts the result of exact arithmetic to the smallest representation +that can exactly represent the quantity. + +@example +(+ 3/4 5) + @result{} 23/4 + +(+ 3/4 1/4 2) + @result{} 3 +@end example + +Conversely, if an integer (read or computed) cannot be represented as a +fixnum, a bignum will be used. Integer division is a somewhat +exceptional case. Because it is useful and is the historical meaning of +the function @code{/}, a separate function @code{div} is provided. +@code{div} is identical to @code{/} except that when the rational result +is not an integer, it is represented exactly as a ratio. In both cases +if a rational result is an integer, it is automatically converted to the +appropriate integral representation. + + Note that the efficiency gain from canonicalization is likely to be +less than you might think. Experience with numerical analysis shows that +in very precise calculations, the required precision tends to increase. +Thus it is typically wasted effort to attempt to convert to smaller +representations, as the number is often reused and requires a larger +representation. However, XEmacs Lisp presumes that calculations using +bignums are the exception, so it applies canonicalization. + +@dfn{Contagion} is one way to address the requirement that an arithmetic +operation should not fail because of differing types of the operands. +Contagion is the idea that less precise operands are converted to the +more precise type, and then the operation is performed. While changing +precision is a delicate issue, contagion is so useful that XEmacs +performs it automatically. + +In XEmacs, the following rules of contagion are used: + +@c #### this probably wants names for each rule +@enumerate +@item +If an expression mixes an integral type with a ratio, then the usual +rules of rational arithmetic apply. (If the result of the expression +happens to be an integer, it will be canonicalized to integer.) + +@item +If an expression mixes a rational type (fixnum, bignum, or ratio) with a +float, the rational operand is converted to a float and the operation +performed if the result would fit in a float, otherwise both operands +are promoted to bigfloat, and the operation performed. + +@item +If an expression mixes any other type with a bigfloat, the other operand +is converted to bigfloat and the operation performed. + +@item +If bigfloats of different precision are mixed, all are converted to the +@emph{highest} precision, and the operation performed. +@end enumerate + +Note that there are no rules to canonicalize floats or bigfloats. This +might seem surprising, but in both cases information will be lost. Any +floating point representation is implicitly approximate. A conversion +to a rational type, even if it seems exact, loses this information. +More subtly, demoting a bigfloat to a smaller bigfloat or to a float +would lose information about the precision of the result, and thus some +information about the accuracy. Thus floating point numbers are always +already in canonical form. + +Of course the programmer can explicitly request canonicalization, or +more coercion to another type. Coercion uses the Common Lisp +compatibility function @code{coerce} from the @file{cl-extra.el} +library. A number can be explicitly converted to canonical form +according to the above rules using + +@defun canonicalize-number number +Return the canonical form of @var{number}. +@end defun + +However, if we've done our job properly, this is always a no-op. That +is, if you find a number in un-canonicalized form, please report it as a +bug. + + +@node Compatibility Issues +@subsection Compatibility Issues + + @emph{Surgeon General's Warning}: The automatic conversions cannot be +disabled at runtime. Old functions will not produce ratios unless there +is a ratio operand, so there should be few surprises with type +conflicts (the contagion rules are quite natural for Lisp programmers +used to the behavior of integers and floats in pre-21.5.18 XEmacsen), +but they can't be ruled out. Also, if you work with extremely large +numbers, your machine may arbitrarily decide to hand you an unpleasant +surprise rather than a bignum. + +User-visible changes in behavior include (in probable order of annoyance) + +@itemize +@item +Arithmetic can cause a segfault, depending on your MP library. + +GMP by default allocates temporaries on the stack. If you run out of +stack space, you're dead; there is no way that we know of to reliably +detect this condition, because @samp{alloca} is typically implemented to +be @emph{fast} rather than robust. If you just need a little more +oomph, use a bigger stack (@emph{e.g.}, the @file{ulimit -s} command in +bash(1)). If you want robustness at the cost of speed, configure GMP +with @samp{--disable-alloca} and rebuild the GMP library. + +We do not know whether BSD MP uses @samp{alloca} or not. Please send +any information you have as a bug report (@kbd{M-x report-xemacs-bug +@key{RET}}), which will give us platform information. (We do know that +BSD MP implementations vary across vendors, but how much, we do not know +yet.) + +@item +Terminology is not Common-Lisp-conforming. For example, ``integer'' for +Emacs Lisp means what Common Lisp calls ``fixnum''. This issue is being +investigated, but the use of ``integer'' for fixnum is pervasive and may +cause backward-compatibility and GNU-Emacs-compatibility problems. +There are similar issues for floating point numbers. Since Emacs Lisp +has not had a ratio type before, there should be no problems there. + +@item +An atom with ratio read syntax now returns a number, not a symbol. + +@item +Many operations that used to cause a range error now succeed, with +intermediate results and return values coerced to bignums as needed. + +@item +The @samp{%u} format conversion will now give an error if its argument +is negative. (Without MP, it prints a number which Lisp can't read.) +@end itemize + + This is not a compatibility issue in the sense of specification, but +careless programmers who have taken advantage of the immediate +representation for numbers and written @code{(eq x y)} are in for a +surprise. This doesn't work with bignums, even if both arguments are +bignums! Arbitrary precision obviously requires consing new objects +because the objects are ``large'' and of variable size, and the +definition of @samp{eq} does not permit different objects to compare as +equal. Instead of @code{eq}, use @code{eql}, in which numbers of the +same type which have equal values compare equal, or @code{=}, which does +any necessary type coercions before comparing for equality +@ref{Comparison of Numbers}. + + @node Predicates on Numbers @section Type Predicates for Numbers The functions in this section test whether the argument is a number or -whether it is a certain sort of number. The functions @code{integerp} -and @code{floatp} can take any type of Lisp object as argument (the -predicates would not be of much use otherwise); but the @code{zerop} -predicate requires a number as its argument. See also -@code{integer-or-marker-p}, @code{integer-char-or-marker-p}, -@code{number-or-marker-p} and @code{number-char-or-marker-p}, in -@ref{Predicates on Markers}. +whether it is a certain sort of number. The functions which test for +type can take any type of Lisp object as argument (the more general +predicates would not be of much use otherwise). However, the +@code{zerop} predicate requires a number as its argument, and the +@code{evenp}, and @code{oddp} predicates require integers as their +arguments. See also @code{integer-or-marker-p}, +@code{integer-char-or-marker-p}, @code{number-or-marker-p} and +@code{number-char-or-marker-p}, in @ref{Predicates on Markers}. -@defun floatp object -This predicate tests whether its argument is a floating point -number and returns @code{t} if so, @code{nil} otherwise. +@defun numberp object +This predicate tests whether its argument is a number (either integer or +floating point), and returns @code{t} if so, @code{nil} otherwise. +@end defun + +@defun realp object +@cindex numbers +The @code{realp} predicate tests to see whether @var{object} is a +rational or floating point number, and returns @code{t} if so, +@code{nil} otherwise. Currently equivalent to @code{numberp}. +@end defun + +@defun zerop number +This predicate tests whether its argument is zero, and returns @code{t} +if so, @code{nil} otherwise. The argument must be a number. -@code{floatp} does not exist in Emacs versions 18 and earlier. +These two forms are equivalent: @code{(zerop x)} @equiv{} @code{(= x 0)}. @end defun @defun integerp object @@ -193,9 +609,18 @@ @code{t} if so, @code{nil} otherwise. @end defun -@defun numberp object -This predicate tests whether its argument is a number (either integer or -floating point), and returns @code{t} if so, @code{nil} otherwise. +@defun oddp integer +@cindex integers +The @code{oddp} predicate tests to see whether @var{integer} is odd, and +returns @code{t} if so, @code{nil} otherwise. @var{integer} must be an +integer. +@end defun + +@defun evenp integer +@cindex integers +The @code{evenp} predicate tests to see whether @var{integer} is even, +and returns @code{t} if so, @code{nil} otherwise. @var{integer} must be +an integer. @end defun @defun natnump object @@ -206,33 +631,113 @@ considered non-negative. @end defun -@defun zerop number -This predicate tests whether its argument is zero, and returns @code{t} -if so, @code{nil} otherwise. The argument must be a number. +@defun fixnump object +@cindex integers +The @code{} predicate tests to see whether its argument is an integer +represented as a fixnum, and returns @code{t} if so, @code{nil} +otherwise. +@end defun -These two forms are equivalent: @code{(zerop x)} @equiv{} @code{(= x 0)}. +@defun bignump object +@cindex integers +The @code{bignump} predicate tests to see whether @var{object} is an +integer represented as a bignum, and returns @code{t} if so, @code{nil} +otherwise. +@end defun + +@defun rationalp object +@cindex numbers +The @code{rationalp} predicate tests to see whether @var{object} is a +rational number, and returns @code{t} if so, @code{nil} otherwise. +@end defun + +@defun ratiop object +@cindex ratios +The @code{ratiop} predicate tests to see whether @var{object} is a +number represented as a ratio, and returns @code{t} if so, @code{nil} +otherwise. @end defun +@defun floatingp object +@cindex floats +The @code{floatingp} predicate tests to see whether @var{object} is a +floating point number represented as a float or a bigfloat, and returns +@code{t} if so, @code{nil} otherwise. +@end defun + +@defun floatp object +@cindex floats +This predicate tests whether its argument is a floating point +number and returns @code{t} if so, @code{nil} otherwise. + +@code{floatp} does not exist in Emacs versions 18 and earlier. If the +bignum extension is present, it returns @code{nil} for a bigfloat. +@end defun + +@defun bigfloatp object +@cindex floats +The @code{bigfloatp} predicate tests to see whether @var{object} is an +floating point number represented as a bigfloat, and returns @code{t} if +so, @code{nil} otherwise. +@end defun + + @node Comparison of Numbers @section Comparison of Numbers @cindex number equality To test numbers for numerical equality, you should normally use -@code{=}, not @code{eq}. There can be many distinct floating point -number objects with the same numeric value. If you use @code{eq} to -compare them, then you test whether two values are the same -@emph{object}. By contrast, @code{=} compares only the numeric values -of the objects. - - At present, each integer value has a unique Lisp object in XEmacs Lisp. -Therefore, @code{eq} is equivalent to @code{=} where integers are -concerned. It is sometimes convenient to use @code{eq} for comparing an -unknown value with an integer, because @code{eq} does not report an -error if the unknown value is not a number---it accepts arguments of any -type. By contrast, @code{=} signals an error if the arguments are not -numbers or markers. However, it is a good idea to use @code{=} if you -can, even for comparing integers, just in case we change the -representation of integers in a future XEmacs version. +@code{=}, not @code{eq}. There can be many distinct floating point, +bignum, and ratio number objects with the same numeric value. If you +use @code{eq} to compare them, then you test whether two values are the +same @emph{object}. By contrast, @code{=} compares only the numeric +values of the objects. + + In versions before 21.5.18, each integer value had a unique Lisp +object in XEmacs Lisp. Therefore, @code{eq} was equivalent to @code{=} +where integers are concerned. Even with the introduction of bignums, it +is sometimes convenient to use @code{eq} for comparing an unknown value +with an integer, because @code{eq} does not report an error if the +unknown value is not a number---it accepts arguments of any type. By +contrast, @code{=} signals an error if the arguments are not numbers or +markers. However, it is a good idea to use @code{=} if you can, even +for comparing exact values, because two bignums or ratios with the same +value will often not be the same object. + +On the other hand, some functions, such as the string- and +buffer-searching functions, will return an integer on success, but +something else (usually @code{nil}) on failure. If it is known what the +numerical subtype (float, bigfloat, or exact) of the returned object +will be if it is a number, then the predicate @code{eql} can be used for +comparison without signaling an error on some expected return values. +Because of canonicalization, @code{eql} can be used to compare a fixnum +value to something that might be a ratio; if the potential ratio value +is representable as a fixnum, it will be canonicalized to fixnum before +comparing. However, although floats and bigfloats are of different +types for the purpose of comparisons via @code{eql}, two bigfloats of +different @emph{precision} that are @code{=} will always be @code{eql}. + +@example +(eql 2 (string-match "ere" "there")) + @result{} t + +(eql 2 (string-match "ere" "three")) + @result{} nil + +(eql 2 2.0) + @result{} nil + +(= 2 (string-match "ere" "there")) + @result{} t + +(= 2 (string-match "ere" "three")) + @error{} Wrong type argument: number-char-or-marker-p, nil + +(= 2 2.0) + @result{} t +@end example + + There is another wrinkle: because floating point arithmetic is not exact, it is often a bad idea to check for equality of two floating @@ -1074,9 +1579,11 @@ -1457731, and the second one always returns -7692030. This repeatability is helpful for debugging. -If you want truly unpredictable random numbers, execute @code{(random -t)}. This chooses a new seed based on the current time of day and on -XEmacs's process @sc{id} number. +If you want reasonably unpredictable random numbers, execute +@code{(random t)}. This chooses a new seed based on the current time of +day and on XEmacs's process @sc{id} number. (This is not +cryptographically strong, it's just hard for a @emph{human} to +anticipate.) @defun random &optional limit This function returns a pseudo-random integer. Repeated calls return a @@ -1088,8 +1595,12 @@ If @var{limit} is @code{t}, it means to choose a new seed based on the current time of day and on XEmacs's process @sc{id} number. @c "XEmacs'" is incorrect usage! - -On some machines, any integer representable in Lisp may be the result -of @code{random}. On other machines, the result can never be larger -than a certain maximum or less than a certain (negative) minimum. @end defun + +The range of random is implementation-dependent. On any machine, the +result of @code{(random)} is an arbitrary fixnum, so on 32-bit +architectures it is normally in the range -2^30 (inclusive) to +2^30 +(exclusive). With the optional integer argument @var{limit}, the result +is in the range 0 (inclusive) to @var{limit} (exclusive). Note this is +regardless of the presence of the bignum extension. + diff --text -u 'xemacs-21.5.17/man/lispref/positions.texi' 'xemacs-21.5.18/man/lispref/positions.texi' Index: ./man/lispref/positions.texi --- ./man/lispref/positions.texi Fri Apr 13 03:22:19 2001 +++ ./man/lispref/positions.texi Fri Aug 13 18:28:23 2004 @@ -364,7 +364,7 @@ With optional @var{ignore-invisible-lines-flag} non-@code{nil}, lines collapsed with selective-display are excluded from the line count. -@strong{Note:} The expression to return the current line number is not +@strong{N.B.} The expression to return the current line number is not obvious: @example diff --text -u 'xemacs-21.5.17/man/lispref/searching.texi' 'xemacs-21.5.18/man/lispref/searching.texi' Index: ./man/lispref/searching.texi --- ./man/lispref/searching.texi Thu May 22 16:41:24 2003 +++ ./man/lispref/searching.texi Wed Sep 8 19:32:55 2004 @@ -446,7 +446,7 @@ matches the same text that matched the @var{digit}th occurrence of a @samp{\( @dots{} \)} construct. -In other words, after the end of a @samp{\( @dots{} \)} construct. the +In other words, after the end of a @samp{\( @dots{} \)} construct, the matcher remembers the beginning and end of the text matched by that construct. Then, later on in the regular expression, you can use @samp{\} followed by @var{digit} to match that same text, whatever it @@ -473,19 +473,28 @@ This is useful when you need a lot of grouping @samp{\( @dots{} \)} constructs, but only want to remember one or two -- or if you have more than nine groupings and need to use backreferences to refer to -the groupings at the end. +the groupings at the end. It also allows construction of regular +expressions from variable subexpressions that contain varying numbers of +non-capturing subexpressions, without disturbing the group counts for +the main expression. For example -Using @samp{\(?: @dots{} \)} rather than @samp{\( @dots{} \)} when you -don't need the captured substrings ought to speed up your programs some, -since it shortens the code path followed by the regular expression -engine, as well as the amount of memory allocation and string copying it -must do. The actual performance gain to be observed has not been -measured or quantified as of this writing. -@c This is used to good advantage by the font-locking code, and by -@c `regexp-opt.el'. +@example +(let ((sre (if foo "\\(?:bar\\|baz\\)" "quux"))) + (re-search-forward (format "a\\(b+ %s c+\\) d" sre) nil t) + (match-string 1)) +@end example + +It is very tedious to write this kind of code without shy groups, even +if you know what all the alternative subexpressions will look like. -The shy grouping operator has been borrowed from Perl, and has not been -available prior to XEmacs 20.3, nor is it available in FSF Emacs. +Using @samp{\(?: @dots{} \)} rather than @samp{\( @dots{} \)} should +give little performance gain, as the start of each group must be +recorded for the purpose of back-tracking in any case, and no string +copying is done until @code{match-string} is called. + +The shy grouping operator has been borrowed from Perl, and was not +available prior to XEmacs 20.3, and has only been available in GNU Emacs +since version 21. @item \w @cindex @samp{\w} in regexp diff --text -u 'xemacs-21.5.17/man/lispref/specifiers.texi' 'xemacs-21.5.18/man/lispref/specifiers.texi' Index: ./man/lispref/specifiers.texi --- ./man/lispref/specifiers.texi Tue Jan 27 22:00:42 2004 +++ ./man/lispref/specifiers.texi Fri Jun 18 16:18:40 2004 @@ -44,6 +44,8 @@ Validating the components of a specifier. * Other Specification Functions:: Other ways of working with specifications. +* Specifier Compatibility Notes:: + Backward compatibility and GNU Emacs. @end menu @node Introduction to Specifiers @@ -469,6 +471,162 @@ over a device domain looks only for device locales and the @code{global} locale. +Note that specifiers are instanced on @emph{every} redisplay. (This is +the concept; of course the implementation keeps track of changes and +doesn't reinstance unchanged specifiers.) That means that changes in +specifiers controlling appearance are reflected immediately in the UI. +Also, since specifiers are instanced completely, removing a +specification can be just as effective as adding one. + +@emph{E.g.}, Giacomo Boffi wanted a modeline that indicates whether the +frame containing it is selected or not. The first proposed implementation +is natural in a world of ``local'' variables. The later implementations +apply the power of specifiers. + +(The copyright notice and permission statement below apply to the code in +example format, up to the ``@code{;;; end of neon-modeline.el}'' +comment.) + +@example +;;; neon-modeline.el + +;; Copyright (c) 2004 Stephen J. Turnbull <stephen@@xemacs.org> + +;; Based on a suggestion by Giacomo Boffi + +;; This code may be used and redistributed under the GNU GPL, v.2 or any +;; later version as published by the FSF, or under the license used for +;; XEmacs Texinfo manuals, at your option. +@end example + +A few customizations: + +@example +;; Placate the specifier and Customize gods. + +(unless (valid-specifier-tag-p 'modeline-background) + (define-specifier-tag 'modeline-background)) + +(defgroup lisp-demos nil "Demos for Lisp programming techniques.") + +(defgroup neon-modeline nil "Neon modeline identifies selected frame." + :group 'lisp-demos) + +(defcustom neon-modeline-selected-background "LemonChiffon" + "Background color for modeline in selected frames." + :type 'color + :group 'neon-modeline) + +(defcustom neon-modeline-deselected-background "Wheat" + "Background color for modeline in unselected frames." + :type 'color + :group 'neon-modeline) + +@end example + +Our first try uses three functions, a setup and two hook functions. +Separate hooks are defined for entry into a frame and exit from it. +Since we're using hooks, it's a fairly natural approach: we operate on +the background on each event corresponding to an appearance change we +want to make. This doesn't depend on the specifier API, ``frame-local'' +variables would serve as well. + +@example +(defun select-modeline () + (set-face-background 'modeline neon-modeline-selected-background + (selected-frame))) + +(defun deselect-modeline () + (set-face-background 'modeline neon-modeline-deselected-background + (selected-frame))) +@end example + +Note that the initialization removes no specifications, and therefore is +not idempotent. Cruft will accumulate in the specifier if the +@samp{-setup} function is called repeatedly. This shouldn't cause a +performance problem; specifiers are quite efficient for their purpose. +But it's ugly, and wastes a small amount of space. + +@example +(defun neon-modeline-setup () + (interactive) + (set-face-background 'modeline neon-modeline-deselected-background) + ;; Add the distinguished background on pointer entry to the frame; + (add-hook 'select-frame-hook 'select-modeline) + ;; restore the ordinary background on pointer exit from the frame. + (add-hook 'deselect-frame-hook 'deselect-modeline) +@end example + +This approach causes a decided flicker on Boffi's platform, because the +two hook functions are executed in response to separate GUI events. + +The following code should be an improvement. First, the hook function. + +@example +(defun neon-modeline-reselect () + (set-face-background 'modeline neon-modeline-deselected-background + (selected-frame) '(modeline-background) + 'remove-locale-type)) +@end example + +Only one event triggers the configuration change, which should reduce +flicker. Because this is implemented as a specifier, we can use the +specifier API to reset all frame-local specifications (the +@code{remove-locale-type} argument). This leaves the @code{global} +specification alone, but removes all existing frame-local +specifications. Then it adds the selected-frame background +specification for the newly selected frame. @emph{I.e.}, this +effectively implements a ``move specification from frame to frame'' +operation. + +Why does it give the desired result? By ensuring that only one frame +has the selected-frame modeline background. Frame-local specifications +have precedence over global ones, so when the modeline background is +instantiated in the selected frame, it matches the specification set up +for it and gets the right color. On the other hand, in any other frame, +it does not match the selected frame, so it falls through the +frame-local specifications and picks up the global specification. Again +we get the desired color, in this case for unselected frames. + +Here the @code{modeline-background} tag is simply good practice +(identifying an application's specifications allows it to avoid +interfering with other applications, and other well-behaved applications +and Customize should not munge specifications with our tag on them). +However, an alternative implementation of this functionality would be + +@example +(defun neon-modeline-reselect-2 () + (set-face-background 'modeline neon-modeline-deselected-background + (selected-frame) '(modeline-background) + 'remove-tag-set-prepend)) +@end example + +@code{neon-modeline-reselect} may be a preferable implementation here, if we +really want only one frame to have a local specification. The +@code{neon-modeline-reselect-2} style would be useful if we had groups of +frames which have @emph{different} modeline backgrounds when deselected. + +Here's the initialization function, with different semantics from above. +Note that it is destructive, unless the user saves off the state of the +modeline face before invoking the function. This is only a problem if +you remove specifications and expect the older ones to persist. In this +example it should not be an issue. We use the customizations defined +above. + +@example +(defun neon-modeline-modified-setup () + (interactive) + (set-face-background 'modeline neon-modeline-selected-background + 'global nil 'remove-all) + (add-hook 'select-frame-hook 'neon-modeline-reselect) + +;;; end of neon-modeline.el +@end example + +Note the use of @code{'remove-all} to clear out stale specifications. +Thus it will be idempotent. + + @node Specifier Types @section Specifier Types @@ -1104,7 +1262,7 @@ @defun specifier-matching-instance specifier matchspec &optional domain default no-fallback This function returns an instance for @var{specifier} in @var{domain} that matches @var{matchspec}. If no instance can be generated for -@var{domain}, return @var{default}. +@var{domain}, return @var{default}. @xref{Specifier Compatibility Notes}. This function is identical to @code{specifier-instance} except that a specification will only be considered if it matches @var{matchspec}. @@ -1339,17 +1497,7 @@ Note that since specifiers generalize both frame-local and buffer-local variables in a sensible way, XEmacs is not likely to put a high priority -on implementing frame-local variables. -@c Thanks to Jerry James for the following explanation. He is not -@c responsible for its use here, Stephen Turnbull is. -In fact, some developers think that frame-local variables are evil for -the same reason that buffer-local variables are evil: the declaration is -both global and invisible. That is, you cannot tell whether a variable -is ``normal,'' buffer-local, or frame-local just by looking at it. So -if you have namespace management problems, and some other Lisp package -happens to use a variable name that you already declared frame- or -buffer-local, weird stuff happens, and it is extremely hard to track -down. +on implementing frame-local variables @ref{Specifier Compatibility Notes}. @node Creating Specifiers @@ -1603,3 +1751,88 @@ @defun specifier-locale-type-from-locale locale Given a specifier @var{locale}, this function returns its type. @end defun + +@node Specifier Compatibility Notes +@section Specifier Compatibility Notes + +This node describes compatibility issues in the use of specifiers known +as of 2004-01-22. +@c I considered basing the main text on 21.4, but then future +@c maintenance of this documentation would be a pain. +The main text refers to XEmacs 21.5.16. + +Effort will be made to describe changes in the API or semantics between +XEmacs versions accurately. Any inaccuracy or missing information about +backward and forward compatibility is a bug, and we greatly appreciate +your reports, whether you can provide a patch or not. + +A change is reported as @dfn{changed} when we believe that the new or +changed API will cause old code to malfunction. When old code is +believed to be upward compatible with the changed API, the change is +reported as @dfn{added}. + +We would like to also describe compatibility with GNU Emacs, but this is +not so high a priority. Inaccuracies or omissions will be addressed at +the priority of a feature request, and as such processing will be +greatly expedited if you can provide a patch. +@c #### xref here to bug reporting and patch submissions + +@c #### write and xref a file on compatibility policy + +@subsection Compatibility with GNU Emacs + +Specifiers are not used in GNU Emacs. If your program depends on +specifers, you will probably have to rewrite the functionality +completely for GNU Emacs. If you wish to maximize portability, you +should plan to encapsulate use of specifiers. + +GNU Emacs provides two features for context-sensitive variables, +buffer-local variables and frame-local variables. XEmacs implements +buffer-local variables 100%-compatibly with GNU Emacs. If buffer-local +variables will server your purpose and portability is a major concern, +consider using them instead of specifiers. + +XEmacs does not implement frame-local variables at all. In this case +specifiers must be used to provide equivalent functionality. + +It is not clear whether XEmacs will provide this feature in the future. +@c Thanks to Jerry James for the following explanation. He is not +@c responsible for its use here, Stephen Turnbull is. +In fact, some core XEmacs developers think that both frame-local +variables and buffer-local variables are evil, because the declaration +is both global and invisible. That is, you cannot tell whether a +variable is ``normal,'' buffer-local, or frame-local just by looking at +it. So if you have namespace management problems, and some other Lisp +package happens to use a variable name that you already declared frame- +or buffer-local, weird stuff happens, and it is extremely hard to track +down. +@c #### Direct comments to xemacs-design? + +@subsection Backwards Compatibility with XEmacs 21.4 + +Sorry, I'm unwilling to find out exactly when these changes were made. + +Changed by 21.5.16: the second argument of +@code{specifier-matching-instance} is now a cons of a charset and a +boolean value. Previously it was a charset or a symbol (a name of a +charset). It was not documented in Info. + +Changed by 21.5.16: the specifier-specific error symbols +@code{specifier_syntax_error}, @code{specifier_argument_error}, and +@code{specifier_change_error} were removed. (This probably only +affected internal code.) + +Added by 21.5.16: @code{map-specifier} got two new arguments, +@code{ms-tag-set} and @code{ms-exact-p}. + +Added by 21.5.16: when skipping instantiators, XEmacs warns at level +`debug'. + +Added by 21.5.16: new convenience APIs: +@code{instance-to-instantiator}, +@code{device-type-matches-spec}, +@code{add-tag-to-inst-list}, +@code{derive-domain-from-locale}, +@code{derive-device-type-from-tag-set}, +@code{derive-device-type-from-locale-and-tag-set}, and +@code{derive-specifier-specs-from-locale}. diff --text -u 'xemacs-21.5.17/man/lispref/text.texi' 'xemacs-21.5.18/man/lispref/text.texi' Index: ./man/lispref/text.texi --- ./man/lispref/text.texi Sat Jul 6 05:35:52 2002 +++ ./man/lispref/text.texi Thu Sep 9 02:40:20 2004 @@ -2127,6 +2127,7 @@ * Special Properties:: Particular properties with special meanings. * Saving Properties:: Saving text properties in files, and reading them back. +* Fields:: Emacs-compatible text fields. @end menu @node Examining Properties @@ -2459,6 +2460,126 @@ @xref{Format Conversion}, for a related feature. +@node Fields +@subsection Fields +@cindex text fields +@cindex fields + +Emacs supplies a notion of a @emph{text field}, which is a region of +text where every character has the same value of the @code{field} +property. It is used to identify regions of a buffer used for +communicating with an external process, for example. XEmacs supplies a +compatible interface. In XEmacs, the @code{field} property can be set +as either an extent property or a text property, mirroring the Emacs +capability of using either overlays or text properties. + +The field manipulating functions take a buffer position as the +field-identifying argument, defaulting to point. This really means the +field containing that buffer position. Consecutive buffer positions +with no @code{field} property are considered an ``empty'' field. There +is some ambiguity when a specified buffer position falls at the very +beginning or the very end of a field: does it belong to the preceding or +the following field? The answer depends on the openness or closedness +of the corresponding extents (@pxref{Extent Endpoints}). A buffer +position corresponds to the field whose property would be inherited by a +character inserted at that position. If the buffer position is between +an end-open and a start-open extent, then it corresponds to an empty +field at that position, since an inserted character will belong to +neither extent. + +@defvar inhibit-field-text-motion +This variable controls whether the text motion commands notice fields or +not. When it is nil (the default), commands such as beginning-of-line +will try to move only within fields. +@end defvar + +@defun make-field value from to &optional buffer +There is no Emacs counterpart to this function. The default open and +closedness of extents in XEmacs is opposite to the default for Emacs +overlays. Hence, fields based on extents in XEmacs behave differently +from the equivalent fields based on overlays in Emacs. This function +creates a field with value @var{value} over the region @var{from} to +@var{to} in @var{buffer}, which defaults to the current buffer, with the +default Emacs open and closedness. +@end defun + +@defun find-field &optional pos merge-at-boundary beg-limit end-limit +There is no (Lisp-visible) Emacs counterpart to this function. It is +the workhorse for the other functions. It returns a dotted pair +@code{(start . stop)} holding the endpoints of the field matching a +specification. If @var{pos} is non-@code{nil}, it specifies a buffer +position whose enclosing field should be found; otherwise, the value of +point is used. + +If @var{merge-at-boundary} is non-@code{nil}, then two changes are made +to the search algorithm. First, if @var{pos} is at the very first +position of a field, then the beginning of the previous field is +returned instead of the beginning of @var{pos}'s field. Second, if the +value of the @code{field} property at @var{pos} is the symbol +@code{boundary}, then the beginning of the field before the boundary +field and the end of the field after the boundary field are returned. + +If @var{beg-limit} is a buffer position, and the start position that +would be returned is less than @var{beg-limit}, then @var{beg-limit} is +returned instead. Likewise, if @var{end-limit} is a buffer position, +and the stop position that would be returned is greater than +@var{end-limit}, then @var{end-limit} is returned instead. +@end defun + +@defun delete-field &optional pos +Delete the text of the field at @var{pos}. +@end defun + +@defun field-string &optional pos +Return the contents of the field at @var{pos} as a string. +@end defun + +@defun field-string-no-properties &optional pos +Return the contents of the field at @var{pos} as a string, without text +properties. +@end defun + +@defun field-beginning &optional pos escape-from-edge limit +Return the beginning of the field at @var{pos}. If +@var{escape-from-edge} is non-nil and @var{pos} is at the beginning of a +field, then the beginning of the field that ends at @var{pos} is +returned instead. If @var{limit} is a buffer position and the returned +value would be less than @var{limit}, then @var{limit} is returned +instead. +@end defun + +@defun field-end &optional pos escape-from-edge limit +Return the end of the field at @var{pos}. If @var{escape-from-edge} is +non-nil and @var{pos} is at the end of a field, then the end of the +field that begins at @var{pos} is returned instead. If @var{limit} is a +buffer position and the returned value would be greater than +@var{limit}, then @var{limit} is returned instead. +@end defun + +@defun constrain-to-field new-pos old-pos &optional escape-from-edge only-in-line inhibit-capture-property +Return the position closest to @var{new-pos} that is in the same field +as @var{old-pos}. If @var{new-pos} is @code{nil}, then the value of +point is used instead @emph{and} point is set to the value that is +returned. + +If @var{escape-from-edge} is non-@code{nil} and @var{old-pos} is at the +boundary of two fields, then the two adjacent fields are considered one +field. Furthermore, if @var{new-pos} is in a field whose @code{field} +property is the symbol @code{boundary}, then the preceding field, the +boundary field, and the following field are considered one field. + +If @var{only-in-line} is non-@code{nil} and the returned position would +be on a different line than @var{new-pos}, return @var{new-pos} instead. + +If @var{inhibit-capture-property} is non-@code{nil} and the character at +@var{old-pos} has a property of the same name as the value of +@var{inhibit-capture-property}, then all field boundaries are ignored; +i.e., @var{new-pos} is returned. + +If @var{inhibit-field-text-motion} is non-@code{nil}, then all field +boundaries are ignored and this function always returns @var{new-pos}. +@end defun + @node Substitution @section Substituting for a Character Code diff --text -u 'xemacs-21.5.17/man/lispref/windows.texi' 'xemacs-21.5.18/man/lispref/windows.texi' Index: ./man/lispref/windows.texi --- ./man/lispref/windows.texi Tue Jul 3 05:45:08 2001 +++ ./man/lispref/windows.texi Tue Sep 21 12:00:12 2004 @@ -1049,6 +1049,7 @@ @cindex window point @cindex position in window @cindex point in window +@cindex cursor in window Each window has its own value of point, independent of the value of point in other windows displaying the same buffer. This makes it useful @@ -1099,6 +1100,74 @@ @var{position} in @var{window}'s buffer. @end defun +@defun current-pixel-row &optional window pos +@defunx current-pixel-column &optional window pos +@cindex cursor pixel row +@cindex window point pixel row +@cindex cursor pixel column +@cindex window point pixel column +The function, @code{current-pixel-row}, returns the vertical location, +in pixels, of the point @var{pos} within the specified @var{window}; +similarly, @code{current-pixel-column} returns the corresponding +horizontal location. The position returned is that of the upper-left +corner of the cursor, and is relative to the upper-left location of the +window. If @var{window} is @code{nil}, the function uses the selected +window. If @var{pos} is @code{nil}, the value of @code{window-point} is +used. + +Note that the coordinates are relative to the current XEmacs window, and +are not relative to the XEmacs X11 window. To obtain the coordinates +relative to the X11 window, you must also take into account the spacings +of any menubars, gutters, toolbars, margins, etc., as well as any window +offsets. The function, @code{window-pixel-edges} (@pxref{Position of +Window}), can be used to help calculate the location relative to the +frame. + +@emph{Important note}: in order for these functions to return a correct, +non-nil value, two criteria @emph{must} be satisfied: + +@itemize @bullet + +@item +The location of @code{pos} must be visible within the specified window. +If @var{pos} is outside the visible area, @code{nil} is returned. + +@item +As the pixel location is determined from the redisplay tables, the +redisplay tables must be up-to-date. In other words, the XEmacs +window(s), as seen by the user, must be correct (to improve performance, +XEmacs generally defers display updates until control returns back to +the idle loop). To insure that the redisplay tables are up-to-date, one +of the following must generally be done @emph{before} calling +@code{current-pixel-row} or @code{current-pixel-column}: + +@itemize @bullet + +@item +If the window in question is not in a new frame, you can force a +redisplay using @code{(sit-for 0)}. See @code{sit-for} in +@ref{Waiting}. + +@item +If the window in question is in a new frame, you must call code like the +following: + +@example +@group +(while (not (frame-visible-p frame)) + (sleep-for .5)) +@end group +@end example + +@end itemize + +@end itemize + +If one of these is not done, the return value may be incorrect, even if +it is non-nil. + +@end defun + @node Window Start @section The Window Start Position diff --text -u 'xemacs-21.5.17/man/widget.texi' 'xemacs-21.5.18/man/widget.texi' Index: ./man/widget.texi --- ./man/widget.texi Sun Mar 9 21:59:36 2003 +++ ./man/widget.texi Mon Apr 19 17:02:27 2004 @@ -40,15 +40,20 @@ @comment node-name, next, previous, up @section Introduction -Most graphical user interface toolkits, such as Motif and XView, provide +@c XEmacs changes to reflect history, native widgets, and GTK +Most graphical user interface toolkits, since Motif and XView, provide a number of standard user interface controls (sometimes known as -`widgets' or `gadgets'). Emacs doesn't really support anything like -this, except for an incredible powerful text ``widget''. On the other -hand, Emacs does provide the necessary primitives to implement many -other widgets within a text buffer. The @code{widget} package -simplifies this task. +`widgets' or `gadgets'). Historically, Emacs didn't support anything like +this, except for its incredible powerful text ``widget''. However, +since XEmacs 21.4, XEmacs has supported ``native'' widgets (GUI controls +implemented as Lisp APIs in C for the MS Windows, Motif, Athena, and GTK +toolkits) and libglade (GUI controls with an XML API for the GTK +toolkit). On the other hand, Emacs does provide the necessary +primitives to implement many other widgets within a text buffer, and of +course this is the only way to implement self-contained controls in a +text terminal. The @code{widget} package simplifies this task. -The basic widgets are: +Examples of some basic widgets include: @table @code @item link @@ -83,7 +88,7 @@ Now of what possible use can support for widgets be in a text editor? I'm glad you asked. The answer is that widgets are useful for -implementing forms. A @dfn{form} in emacs is a buffer where the user is +implementing forms. A @dfn{form} in Emacs is a buffer where the user is supposed to fill out a number of fields, each of which has a specific meaning. The user is not supposed to change or delete any of the text between the fields. Examples of forms in Emacs are the @file{forms} @@ -100,19 +105,22 @@ You can give the user immediate feedback if he enters invalid data in a text field, and sometimes prevent entering invalid data. @item -You can have fixed sized fields, thus allowing multiple field to be +You can have fixed sized fields, thus allowing multiple fields to be lined up in columns. @item It is simple to query or set the value of a field. @item -Editing happens in buffer, not in the mini-buffer. +Editing happens in a normal buffer, not in the mini-buffer. @item -Packages using the library get a uniform look, making them easier for +Packages using the library get a uniform look-and-feel, making them easier for the user to learn. @item -As support for embedded graphics improve, the widget library will +As support for embedded graphics has improved, the widget library will extended to support it. This means that your code using the widget -library will also use the new graphic features by automatic. +library will also use the new graphic features automatically. +@item +A widget specification is implemented as a class, and new subclasses can +be derived from any class, by restricting or extending the behavior. @end enumerate In order to minimize the code that is loaded by users who does not @@ -120,10 +128,10 @@ @table @file @item widget.el -This will declare the user variables, define the function -@code{define-widget}, and autoload the function @code{widget-create}. +This declares the user variables, defines the function +@code{define-widget}, and autoloads the function @code{widget-create}. @item wid-edit.el -Everything else is here, there is no reason to load it explicitly, as +Everything else is here. Do not load it explicitly, as it will be autoloaded when needed. @end table @@ -168,7 +176,7 @@ @b{[Apply Form]} @b{[Reset Form]} @end example -The top level widgets in is example are tagged @samp{Name}, +The top level widgets in this example are tagged @samp{Name}, @samp{Choose}, @samp{Address}, @samp{_other work_}, @samp{Numbers}, @samp{Select multiple}, @samp{Select one}, @samp{[Apply Form]}, and @samp{[Reset Form]}. There are basically two thing the user can do within diff --text -u 'xemacs-21.5.17/man/xemacs-faq.texi' 'xemacs-21.5.18/man/xemacs-faq.texi' Index: ./man/xemacs-faq.texi --- ./man/xemacs-faq.texi Wed Jan 21 18:03:42 2004 +++ ./man/xemacs-faq.texi Mon Jul 5 19:42:30 2004 @@ -7,7 +7,7 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2004/01/21 09:03:42 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2004/07/05 10:42:30 $ @sp 1 @author Tony Rossini <rossini@@u.washington.edu> @author Ben Wing <ben@@xemacs.org> @@ -380,6 +380,12 @@ * Q5.3.11:: How do I add new Info directories? * Q5.3.12:: What do I need to change to make printing work? +Mathematics: +* Q5.4.1:: What are bignums, ratios, and bigfloats in Lisp? +* Q5.4.2:: XEmacs segfaults when I use very big numbers! +* Q5.4.3:: Bignums are really slow! +* Q5.4.4:: Equal bignums don't compare as equal! What's going on? + XEmacs on MS Windows General Info: @@ -3955,7 +3961,9 @@ 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 lines to your @file{init.el}/@file{.emacs}: +To get this behavior, ensure that you have the @file{pc} package +installed, and add the following lines to your +@file{init.el}/@file{.emacs}: @lisp (cond @@ -5050,6 +5058,12 @@ * Q5.3.10:: How can I get those oh-so-neat X-Face lines? * Q5.3.11:: How do I add new Info directories? * Q5.3.12:: What do I need to change to make printing work? + +Mathematics: +* Q5.4.1:: What are bignums, ratios, and bigfloats in Lisp? +* Q5.4.2:: XEmacs segfaults when I use very big numbers! +* Q5.4.3:: Bignums are really slow! +* Q5.4.4:: Equal bignums don't compare as equal! What's going on? @end menu @node Q5.0.1, Q5.0.2, Miscellaneous, Miscellaneous @@ -5799,6 +5813,7 @@ @end quotation @node Q5.2.1, Q5.2.2, Q5.1.11, Miscellaneous +@unnumberedsec 5.2: Sound @unnumberedsubsec Q5.2.1: How do I turn off the sound? Add the following line to your @file{init.el}/@file{.emacs}: @@ -6168,7 +6183,7 @@ texi2html and read it from a web browser like Lynx or W3. @end quotation -@node Q5.3.12, , Q5.3.11, Miscellaneous +@node Q5.3.12, Q5.4.1, Q5.3.11, Miscellaneous @unnumberedsubsec Q5.3.12: What do I need to change to make printing work? For regular printing there are two variables that can be customized. @@ -6212,6 +6227,121 @@ printing (the @code{Pretty Print Buffer} menu item) @strong{requires} a window system environment. It cannot be used outside of X11. + +@node Q5.4.1, Q5.4.2, Q5.3.12, Miscellaneous +@unnumberedsec 5.4: Mathematics +@unnumberedsubsec Q5.4.1: What are bignums, ratios, and bigfloats in Lisp? + +Thanks to @email{james@@xemacs.org, Jerry James}, XEmacs 21.5.18 and +later can use the capabilities of multiple-precision libraries that may +be available for your platform. The GNU Multiple Precision (GMP) and +BSD Multiple Precision (MP) libraries are partially supported. GMP +gives you @dfn{bignums} (arbitrary precision integers), @dfn{ratios} +(arbitrary precision fractions), and @dfn{bigfloats} (arbitrary +precision floating point numbers). GNU MP is better-supported by XEmacs +at the time of writing (2004-04-06). BSD MP support does not include +ratios or bigfloats, and it throws errors that aren't understood. + +In most cases, bignum support should be transparent to users and Lisp +programmers. A bignum-enabled XEmacs will automatically convert from +fixnums to bignums and back in pure integer arithmetic, and for GNU MP, +from floats to bigfloats. (Bigfloats must be explicitly coerced to +other types, even if they are exactly representable by less precise +types.) The Lisp reader and printer have been enhanced to handle +bignums, as have the mathematical functions. Rationals (fixnums, +bignums, and ratios) are printed using the @samp{%d}, @samp{%o}, +@samp{%x}, and @samp{%u} format conversions. The read syntax for ratios +is @samp{3/5}. + +User-visible changes in behavior include (in probable order of annoyance) + +@itemize +@item +Arithmetic can cause a segfault, depending on your MP library +@ref{Q5.4.2}. + +@item +Terminology is not Common-Lisp-conforming. For example, ``integer'' for +Emacs Lisp means what Common Lisp calls ``fixnum''. This issue is being +investigated, but the use of ``integer'' for fixnum is pervasive and may +cause backward-compatibility and GNU-Emacs-compatibility problems. + +@item +Many operations that used to cause a range error now succeed, with +intermediate results and return values coerced to bignums as needed. + +@item +An atom with ratio read syntax now returns a number, not a symbol. + +@item +The @samp{%u} format conversion will now give an error if its argument +is negative. (Without MP, it prints a number which Lisp can't read.) +@end itemize + +@emph{Surgeon General's Warning}: The automatic conversions cannot be +disabled at runtime. New functions have been added which produce +ratios, so there should be few surprises with type conflicts, but they +can't be ruled out. ``Arbitrary'' precision means precisely what it +says. If you work with extremely large numbers, your machine may +arbitrarily decide to hand you an unpleasant surprise rather than a +bignum @ref{Q5.4.2}. + +To configure with GNU MP, add +@samp{--use-number-lib=gmp} +to your invocation of @file{configure}. For BSD MP, use +@samp{--use-number-lib=mp}. + +If you would like to help with bignum support, especially on BSD MP, +please subscribe to the @uref{http://www.xemacs.org/Lists/#xemacs-beta, +XEmacs Beta mailing list}, and book up on @file{number-gmp.h} and +@file{number-mp.h}. Jerry has promised to write internals documentation +eventually, but if your skills run more to analysis and documentation +than to writing new code, feel free to fill in the gap! + + +@node Q5.4.2, Q5.4.3, Q5.4.1, Miscellaneous +@unnumberedsubsec Q5.4.2: XEmacs segfaults when I use very big numbers! + +GMP by default allocates temporaries on the stack. If you run out of +stack space, you're dead; there is no way that we know of to reliably +detect this condition, because @samp{alloca} is typically implemented to +be @emph{fast} rather than robust. If you just need a little more +oomph, use a bigger stack (@emph{e.g.}, the @file{ulimit -s} command in +bash(1)). If you want robustness at the cost of speed, configure GMP +with @samp{--disable-alloca} and rebuild the GMP library. + +We do not know whether BSD MP uses @samp{alloca} or not. Please send +any information you have as a bug report (@kbd{M-x report-xemacs-bug +@key{RET}}), which will give us platform information. (We do know that +BSD MP implementations vary across vendors, but how much, we do not know +yet.) + + +@node Q5.4.3, Q5.4.4, Q5.4.2, Miscellaneous +@unnumberedsubsec Q5.4.3: Bignums are really slow! + +Many Linux distributions compile all their packages for the i386, and +this is costly. An optimized version can give you two or three orders +of magnitude better performance for a Pentium III or IV. (Yes, really. +See @uref{http://www.swox.com/gmp/gmp-speed.html}.) + + +@node Q5.4.4, , Q5.4.3, Miscellaneous +@unnumberedsubsec Q5.4.4: Equal bignums don't compare as equal! What gives? + +Ah, Grasshopper, I see you are using @code{(eq x y)}. The Bodhisattva +CLTL2 warned of the illusion that equal numbers would be @samp{eq}! +Meditate on the deeper truths of @samp{eql}, in which numbers of the same +type which have equal values compare equal, and @samp{=}, which does any +necessary type coercions before comparing for equality. + +Yeah, yeah, it has always worked for integer types, because fixnums and +characters have an immediate representation. Sorry about that; +arbitrary precision obviously requires consing new objects because the +objects are ``large'' and of variable size, and the definition of +@samp{eq} does not permit different objects to compare as equal. + + @node MS Windows, Current Events, Miscellaneous, Top @unnumbered 6 XEmacs on MS Windows @@ -6255,7 +6385,6 @@ * Q6.4.1:: XEmacs won't start on Windows. * Q6.4.2:: Why do I get a blank toolbar on Windows 95? * Q6.4.3:: XEmacs complains "No such file or directory, diff" - @end menu @node Q6.0.1, Q6.0.2, MS Windows, MS Windows @@ -6876,7 +7005,7 @@ @node Q6.4.1, Q6.4.2, Q6.3.4, MS Windows -@unnumberedsec 6.3: Troubleshooting +@unnumberedsec 6.4: Troubleshooting @unnumberedsubsec Q6.4.1 XEmacs won't start on Windows. XEmacs relies on a process called "dumping" to generate a working @@ -7272,6 +7401,7 @@ @end menu @node Q8.0.1, , , Legacy Versions +@unnumberedsec 8.0 XEmacs 21.1 @unnumberedsubsec Q8.0.1: Gnus 5.10 won't display smileys in XEmacs 21.1. @email{eeide@@cs.utah.edu, Eric Eide} wrote: diff --text -u 'xemacs-21.5.17/man/xemacs/help.texi' 'xemacs-21.5.18/man/xemacs/help.texi' Index: ./man/xemacs/help.texi --- ./man/xemacs/help.texi Fri Apr 13 03:22:28 2001 +++ ./man/xemacs/help.texi Fri Aug 13 18:47:57 2004 @@ -385,13 +385,16 @@ @kindex C-h C-k @findex Info-elisp-ref @findex Info-goto-emacs-command-node +@findex Info-goto-emacs-key-command-node There are two special help commands for accessing XEmacs documentation through Info. @kbd{C-h C-f @var{function} @key{RET}} enters Info and goes straight to the documentation of the XEmacs function @var{function}. @kbd{C-h C-k @var{key}} enters Info and goes straight to the documentation of the key @var{key}. These two keys run the commands @code{Info-elisp-ref} and -@code{Info-goto-emacs-key-command-node}. +@code{Info-goto-emacs-key-command-node}. (GNU Emacs binds @kbd{C-h C-f} +to @code{Info-goto-emacs-command-node}, but this is less helpful to +programmers.) @kindex C-h l @findex view-lossage diff --text -u 'xemacs-21.5.17/modules/ChangeLog' 'xemacs-21.5.18/modules/ChangeLog' Index: ./modules/ChangeLog --- ./modules/ChangeLog Mon Mar 22 18:23:53 2004 +++ ./modules/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,22 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + +2004-09-14 Jerry James <james@xemacs.org> + + * postgresql/postgresql.c: + * ldap/eldap.c: + Mark unused parameters with the UNUSED macro. + +2004-09-14 Jerry James <james@xemacs.org> + + * ldap/eldap.c (Fldap_open): Change ldap_passwd to ldap_password + to eliminate a gcc shadow warning. + +2004-09-13 Jerry James <james@xemacs.org> + + * ldap/eldap.c (signal_ldap_error): Mark as noreturn. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. diff --text -u 'xemacs-21.5.17/modules/ldap/eldap.c' 'xemacs-21.5.18/modules/ldap/eldap.c' Index: ./modules/ldap/eldap.c --- ./modules/ldap/eldap.c Mon Sep 22 12:21:15 2003 +++ ./modules/ldap/eldap.c Tue Sep 21 04:19:26 2004 @@ -68,8 +68,16 @@ /* Utility Functions */ /************************************************************************/ -static void -signal_ldap_error (LDAP *ld, LDAPMessage *res, int ldap_err) +static DECLARE_DOESNT_RETURN (signal_ldap_error (LDAP *, LDAPMessage *, int)); + +static DOESNT_RETURN +signal_ldap_error (LDAP *ld, +#if defined HAVE_LDAP_PARSE_RESULT || defined HAVE_LDAP_RESULT2ERROR + LDAPMessage *res, +#else + LDAPMessage *UNUSED (res), +#endif + int ldap_err) { if (ldap_err <= 0) { @@ -115,7 +123,7 @@ } static void -print_ldap (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_ldap (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) { Lisp_LDAP *ldap = XLDAP (obj); @@ -216,7 +224,7 @@ int ldap_port = 0; int ldap_auth = LDAP_AUTH_SIMPLE; char *ldap_binddn = NULL; - char *ldap_passwd = NULL; + char *ldap_password = NULL; int ldap_deref = LDAP_DEREF_NEVER; int ldap_timelimit = 0; int ldap_sizelimit = 0; @@ -259,7 +267,7 @@ else if (EQ (keyword, Qpasswd)) { CHECK_STRING (value); - LISP_STRING_TO_EXTERNAL (value, ldap_passwd, Qnative); + LISP_STRING_TO_EXTERNAL (value, ldap_password, Qnative); } /* Deref */ else if (EQ (keyword, Qderef)) @@ -332,7 +340,7 @@ ld->ld_options |= LDAP_OPT_RESTART; #endif /* not HAVE_LDAP_SET_OPTION */ - err = ldap_bind_s (ld, ldap_binddn, ldap_passwd, ldap_auth); + err = ldap_bind_s (ld, ldap_binddn, ldap_password, ldap_auth); if (err != LDAP_SUCCESS) { Ibyte *interrmess; diff --text -u 'xemacs-21.5.17/modules/postgresql/postgresql.c' 'xemacs-21.5.18/modules/postgresql/postgresql.c' Index: ./modules/postgresql/postgresql.c --- ./modules/postgresql/postgresql.c Mon Sep 22 12:21:16 2003 +++ ./modules/postgresql/postgresql.c Tue Sep 21 04:19:29 2004 @@ -187,16 +187,18 @@ static Lisp_Object #ifdef RUNNING_XEMACS_21_1 -mark_pgconn (Lisp_Object obj, void (*markobj) (Lisp_Object)) +mark_pgconn (Lisp_Object UNUSED (obj), + void (*UNUSED_ARG (markobj)) (Lisp_Object) ATTRIBUTE_UNUSED) #else -mark_pgconn (Lisp_Object obj) +mark_pgconn (Lisp_Object UNUSED (obj)) #endif { return Qnil; } static void -print_pgconn (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_pgconn (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { char buf[256]; PGconn *P; @@ -295,9 +297,10 @@ static Lisp_Object #ifdef RUNNING_XEMACS_21_1 -mark_pgresult (Lisp_Object obj, void (*markobj) (Lisp_Object)) +mark_pgresult (Lisp_Object UNUSED (obj), + void (*UNUSED_ARG (markobj)) (Lisp_Object) ATTRIBUTE_UNUSED) #else -mark_pgresult (Lisp_Object obj) +mark_pgresult (Lisp_Object UNUSED (obj)) #endif { return Qnil; @@ -307,7 +310,8 @@ #define RESULT_CMD_TUPLES_FMT "#<PGresult %s[%s] - %s>" #define RESULT_DEFAULT_FMT "#<PGresult %s - %s>" static void -print_pgresult (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_pgresult (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { char buf[1024]; PGresult *res; @@ -403,7 +407,7 @@ /* notices */ static void -xemacs_notice_processor (void *arg, const char *msg) +xemacs_notice_processor (void *UNUSED (arg), const char *msg) { warn_when_safe (Qpostgresql, Qnotice, "%s", msg); } diff --text -u 'xemacs-21.5.17/netinstall/ChangeLog' 'xemacs-21.5.18/netinstall/ChangeLog' Index: ./netinstall/ChangeLog Prereq: 1.30 --- ./netinstall/ChangeLog Mon Mar 22 18:24:03 2004 +++ ./netinstall/ChangeLog Fri Oct 22 14:18:37 2004 @@ -1,3 +1,7 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. @@ -495,6 +499,6 @@ * all: port from cygwin setup. -%%% $Id: ChangeLog,v 1.30 2004/03/22 09:24:03 stephent Exp $ -$Revision: 1.30 $ +%%% $Id: ChangeLog,v 1.31 2004/10/22 05:18:37 stephent Exp $ +$Revision: 1.31 $ diff --text -u 'xemacs-21.5.17/nt/ChangeLog' 'xemacs-21.5.18/nt/ChangeLog' Index: ./nt/ChangeLog --- ./nt/ChangeLog Mon Mar 22 18:24:16 2004 +++ ./nt/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,21 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + +2004-09-13 Jerry James <james@xemacs.org> + + * xemacs.dsp: Remove callproc.c as a source file. + +2004-06-01 Adrian Aichner <adrian@xemacs.org> + + * xemacs.mak: Don't echo DEL command. Use COPYCMD everywhere. + Remove /r switch from COPY and COPYDIR, as environment variable + COPYCMD takes care of this. + * xemacs.mak (COPYCMD): New. Used to initialize environment + variable by same name. + * xemacs.mak (TEMACS_CPP_FLAGS_NO_CFLAGS): Handle + xemacs_extra_name (CVS date stamp). + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. diff --text -u 'xemacs-21.5.17/nt/installer/Wise/ChangeLog' 'xemacs-21.5.18/nt/installer/Wise/ChangeLog' Index: ./nt/installer/Wise/ChangeLog --- ./nt/installer/Wise/ChangeLog Mon Mar 22 18:24:30 2004 +++ ./nt/installer/Wise/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,7 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. diff --text -u 'xemacs-21.5.17/nt/xemacs.dsp' 'xemacs-21.5.18/nt/xemacs.dsp' Index: ./nt/xemacs.dsp --- ./nt/xemacs.dsp Fri Feb 21 15:56:52 2003 +++ ./nt/xemacs.dsp Tue Sep 14 23:40:02 2004 @@ -147,10 +147,6 @@ # End Source File # Begin Source File -SOURCE=..\src\callproc.c -# End Source File -# Begin Source File - SOURCE=..\src\casefiddle.c # End Source File # Begin Source File diff --text -u 'xemacs-21.5.17/nt/xemacs.mak' 'xemacs-21.5.18/nt/xemacs.mak' Index: ./nt/xemacs.mak --- ./nt/xemacs.mak Thu Oct 16 05:24:34 2003 +++ ./nt/xemacs.mak Tue Jun 1 08:41:30 2004 @@ -42,18 +42,17 @@ # Put these before including config.inc so they can be overridden there. # Note that some versions of some commands are deficient. -# Define the 'del' command to use +# Define a variable for the 'del' command to use. # WinME's DEL command can only handle one argument and only has the /P flag. # So only delete one glob at a time. Override flags in config.inc. -DEL=del +DEL=-del # Tell COPY, MOVE, and XCOPY to suppress confirmation for overwriting # files. -# set COPYCMD=/y +COPYCMD=/y # Define the 'copy' command to use. -# Use /r (instead of /y), which exists on Windows NT 4 and 5. -COPY=xcopy /q /r -COPYDIR=xcopy /q /r /e +COPY=xcopy /q +COPYDIR=xcopy /q /e ########################### Includes, and source and build tree determination. @@ -631,6 +630,9 @@ -DEMACS_MINOR_VERSION=$(emacs_minor_version) \ $(EMACS_BETA_VERSION) $(EMACS_PATCH_LEVEL) \ -DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \ +!if defined(xemacs_extra_name) + -DXEMACS_EXTRA_NAME=\"$(xemacs_extra_name:"=)\" \ +!endif -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\" TEMACS_CPP_FLAGS=$(CFLAGS) $(TEMACS_CPP_FLAGS_NO_CFLAGS) @@ -822,6 +824,7 @@ # #### you use xcopy to copy a file from one name to another, it # #### PROMPTS you to see if you meant the second as a directory! and # #### no switch to mean "no of course, you idiots, it's a file!" + set COPYCMD=$(COPYCMD) @copy $(SRC)\config.h.in $(SRC)\config.h #$(SRC)\Emacs.ad.h: $(SRCROOT)\etc\Emacs.ad @@ -831,11 +834,11 @@ # !"cd $(SRC); cp paths.h.in paths.h" $(SRC)\Emacs.ad.h: $(NT)\Emacs.ad.h - set COPYCMD=/y + set COPYCMD=$(COPYCMD) @$(COPY) $(NT)\Emacs.ad.h $(SRC) $(SRC)\paths.h: $(NT)\paths.h - set COPYCMD=/y + set COPYCMD=$(COPYCMD) @$(COPY) $(NT)\paths.h $(SRC) @@ -1443,7 +1446,7 @@ # use this rule to install the system install: all cd $(NT) - set COPYCMD=/y + set COPYCMD=$(COPYCMD) @echo Installing in $(INSTALL_DIR) ... @echo PlaceHolder > PlaceHolder @$(COPY) $(SRCROOT)\PROBLEMS "$(INSTALL_DIR)\" diff --text -u 'xemacs-21.5.17/src/ChangeLog' 'xemacs-21.5.18/src/ChangeLog' Index: ./src/ChangeLog --- ./src/ChangeLog Mon Mar 22 18:24:47 2004 +++ ./src/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,999 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + +2004-10-19 Jerry James <james@xemacs.org> + + * console-stream.c (init_console_stream): Mark another unused param. + +2004-10-19 Jerry James <james@xemacs.org> + + * events.c: Define USED_IF_TTY and USED_IF_TOOLBARS. Use them to + mark more unused parameters. + * console.c: Define USED_IF_TTY and use it. + * sysdep.c: Define USED_IF_TTY. Mark more unused parameters. + Update a URL in a comment. + +2004-10-16 Malcolm Purvis <malcolmp@xemacs.org> + + * gtk-xemacs.c (gtk_xemacs_size_allocate): Cast pointer to right type. + +2004-10-14 Jerry James <james@xemacs.org> + + * compiler.h: New USED_IF_MULE and USED_IF_MULE_OR_CHECK_TEXT macros. + * glyphs-msw.c (charset_of_text): Use USED_IF_MULE. + * intl-x.c (init_x_locale): Ditto. + * intl-win32.c: Remove USED_IF_MULE definition. + * regex.h: Mark RE_LISP_SHORT_CONTEXT_ARGS_DECL arguments unused. + New RE_LISP_CONTEXT_ARGS_MULE_DECL macro for one unused case. + + * buffer.h: + * device-x.c: + * elhash.c: + * objects.c: + * regex.c: + * search.c: + * text.c: + * text.h: + * unicode.c: + Mark more unused parameters. + +2004-09-27 Jerry James <james@xemacs.org> + + * gmalloc.c (malloc): Change log to log2 to quiet gcc 3.3. + +2004-09-27 Jerry James <james@xemacs.org> + + * sysdep.c: Mark more unused parameters with the UNUSED macro. + +2004-09-21 Jerry James <james@xemacs.org> + + * ExternalClient.c: Include compiler.h. + * ExternalShell.c: Ditto. + +2004-09-19 Stephen J. Turnbull <stephen@xemacs.org> + + * file-coding.c: Improve explanatory comments, add diatribes. + Fix some typos in comments. + +2003-11-21 Stephen J. Turnbull <stephen@xemacs.org> + + * dired.c (Fdirectory_files): MATCH is only tried against basename. + +2003-11-02 Stephen J. Turnbull <stephen@xemacs.org> + + * eval.c (Fcatch, Fthrow): Document that tags are compared with `eq'. + +2003-10-31 Stephen J. Turnbull <stephen@xemacs.org> + + * procimpl.h (struct Lisp_Process): + * undo.c (Fprimitive_undo): + Remove obsolete references to ENERGIZE in comments. + +2004-07-18 Stephen J. Turnbull <stephen@xemacs.org> + + * glyphs.c (Fimage_instance_type): Add 'widget to docstring. + +2004-07-12 Stephen J. Turnbull <stephen@xemacs.org> + + * glyphs-widget.c (tab_control_query_geometry): + (logical_unit_height): + Typos in comments. + +2004-06-29 Stephen J. Turnbull <stephen@xemacs.org> + + * syntax.c (Sextword): Doesn't seem to exist. Move comment to + Internals manual. + +2004-09-21 Jerry James <james@xemacs.org> + + * sound.c (Fwait_for_sounds): Factor out test for unused parameter. + (Fconnected_to_nas_p): Ditto. + +2004-05-14 Darryl Okahata <darrylo@xemacs.org> + + * window.c (current-pixel-row, current-pixel-column). Added a + new function, ``current-pixel-row'', that returns the pixel row + of point. current-pixel-column was modified to share code with + current-pixel-row''. + +2004-09-14 Jerry James <james@xemacs.org> + + * compiler.h: Change old UNUSED_ARG into UNUSED_ARG and + ATTRIBUTE_UNUSED. Create a new UNUSED macro that works in the + common case. Define conservatively for the Intel compiler. + * dialog-x.c (dbox_descriptor_to_widget_value): Comment out + declaration and assignment of unused variable title. + (x_make_dialog_box_internal): Remove unused variable parent. + * emacs.c (Fkill_emacs): Uno doesn't grok typeof. + * file-coding.c (Fdefine_coding_system_alias): Remove unused + variable real_coding_system. + * glyphs.c (map_subwindow): Remove unused variable f. + * gui-x.c (button_item_to_widget_value): Rename intlen to + unused_intlen to quiet Uno. + * miscplay.c (UNUSED): Removed in favor of compiler.h version. + * mule-canna.c (Fcanna_touroku_string): Remove unused variable + len. + * mule-canna.c (Fcanna_henkan_next): Remove unused variable endp. + * mule-ccl.c (CCL_WRITE_STRING): Remove unused variable bytes and + fix some indentation problems. + * number-gmp.h: Turn off gcc extensions for Uno. + * redisplay-output.c (compare_display_blocks): #if 0 out + declaration and assignment of unused variable block_end. + * redisplay.c (regenerate_window_extents_only_changed): Remove + unused variable new_start. + (regenerate_window_incrementally): Ditto. + * scrollbar.c (update_scrollbar_instance): #if 0 out declaration + and assignment of unused variable new_window. + * specifier.c (specifier_instance): Remove unused variable tag. + * sysdep.c (tty_init_sys_modes_on_device): Define and assigne + variable output_fd only when it will be used. + (tty_reset_sys_modes_on_device): Ditto. + * sysproc.h: Define the FD_* macros conservatively for Uno. + * syssignal.h (SIG_ARG_MAYBE_UNUSED): New macro. + * syswait.h: Define the W* macros conservatively for Uno. + + * EmacsFrame.c: + * EmacsManager.c: + * ExternalClient.c: + * ExternalShell.c: + * alloc.c: + * balloon_help.c: + * bytecode.c: + * callint.c: + * casetab.c: + * chartab.c: + * cm.c: + * cmdloop.c: + * console-gtk.c: + * console-msw.c: + * console-stream.c: + * console-tty.c: + * console-x.c: + * console.c: + * data.c: + * database.c: + * device-gtk.c: + * device-msw.c: + * device-tty.c: + * device-x.c: + * device.c: + * dialog-gtk.c: + * dialog-msw.c: + * dired.c: + * dumper.c: + * editfns.c: + * elhash.c: + * emacs.c: + * esd.c: + * eval.c: + * event-Xt.c: + * event-gtk.c: + * event-msw.c: + * event-stream.c: + * event-tty.c: + * events.c: + * extents.c: + * faces.c: + * file-coding.c: + * fileio.c: + * filemode.c: + * floatfns.c: + * fns.c: + * frame-gtk.c: + * frame-msw.c: + * frame-tty.c: + * frame-x.c: + * frame.c: + * free-hook.c: + * glyphs-eimage.c: + * glyphs-gtk.c: + * glyphs-msw.c: + * glyphs-shared.c: + * glyphs-widget.c: + * glyphs-x.c: + * glyphs.c: + * gpmevent.c: + * gtk-xemacs.c: + * gui-msw.c: + * gui-x.c: + * gui.c: + * gutter.c: + * hpplay.c: + * input-method-motif.c: + * input-method-xlib.c: + * intl-win32.c: + * intl-x.c: + * keymap.c: + * lread.c: + * lstream.c: + * marker.c: + * menubar-gtk.c: + * menubar-msw.c: + * menubar-x.c: + * menubar.c: + * minibuf.c: + * miscplay.c: + * mule-charset.c: + * mule-coding.c: + * nas.c: + * native-gtk-toolbar.c: + * nt.c: + * ntplay.c: + * number-gmp.c: + * number.c: + * objects-gtk.c: + * objects-msw.c: + * objects-tty.c: + * objects-x.c: + * objects.c: + * opaque.c: + * print.c: + * process-nt.c: + * process-unix.c: + * profile.c: + * rangetab.c: + * redisplay-gtk.c: + * redisplay-msw.c: + * redisplay-output.c: + * redisplay-tty.c: + * redisplay-x.c: + * redisplay.c: + * regex.c: + * scrollbar-gtk.c: + * scrollbar-msw.c: + * scrollbar-x.c: + * scrollbar.c: + * search.c: + * select-gtk.c: + * select-msw.c: + * select-x.c: + * sgiplay.c: + * signal.c: + * sound.c: + * specifier.c: + * sunpro.c: + * symbols.c: + * syntax.c: + * sysdep.c: + * terminfo.c: + * tests.c: + * text.c: + * text.h: + * toolbar-gtk.c: + * toolbar-msw.c: + * toolbar-x.c: + * toolbar.c: + * tooltalk.c: + * ui-byhand.c: + * ui-gtk.c: + * unexaix.c: + * unexalpha.c: + * unexconvex.c: + * unexcw.c: + * unexec.c: + * unexelf.c: + * unexelfsgi.c: + * unexencap.c: + * unexenix.c: + * unexfreebsd.c: + * unexfx2800.c: + * unexhp9k3.c: + * unexhp9k800.c: + * unexmips.c: + * unexnt.c: + * unexsni.c: + * unexsol2-6.c: + * unexsol2.c: + * unexsunos4.c: + * unicode.c: + * vm-limit.c: + * win32.c: + * window.c: + Mark unused parameters with the UNUSED macro. + +2004-09-19 Jerry James <james@xemacs.org> + + * s/windowsnt.h (DECLARE_DOESNT_RETURN_TYPE): Remove extern so + that static funcions can be declared. + +2004-09-14 Jerry James <james@xemacs.org> + + * mule-canna.c (CANNA_NEW_WCHAR_AWARE): Define to use new wchar + interface. + * mule-canna.c (call_Fding): Return an int to match the jrBeepFunc + prototype. + * mule-canna.c (Fcanna_initialize): The jrBeepFunc prototype is + now given in the Canna headers. + +2004-09-14 Jerry James <james@xemacs.org> + + * gifrlib.h: Remove redundant extern declarations. + +2004-09-14 Jerry James <james@xemacs.org> + + * doprnt.c (emacs_doprnt_1): Change message to msg to eliminate a + gcc shadow warning. + * glyphs-gtk.c: + * glyphs.h: + Use enum image_instance_type and do not typedef the enum to + image_instance_type to eliminate a gcc shadow warning. + +2004-09-14 Jerry James <james@xemacs.org> + + * linuxplay.c (linux_play_data_or_file): Fix type punning + warning. + +2004-09-14 Jerry James <james@xemacs.org> + + * compiler.h: Change definition of RETURN_NOT_REACHED for icc. + * glyphs-eimage.c (tiff_memory_write): Quiet gcc warning. + +2004-09-13 Jerry James <james@xemacs.org> + + * callproc.c: Really remove. + +2004-09-13 Jerry James <james@xemacs.org> + + * s/windowsnt.h: Define (DECLARE_)DOESNT_RETURN_TYPE instead of + (DECLARE_)DOESNT_RETURN. + * buffer.c (nsberror): Mark as noreturn. + * cmdloop.c (Fcommand_loop_1): Mark as noreturn when + !LISP_COMMAND_LOOP. + * cmdloop.c (Freally_early_error_handler): Mark as noreturn. Use + RETURN_NOT_REACHED to quash compiler warnings. + * cmdloop.c (command_loop_3): Ditto. + * cmdloop.c (command_loop_2): Ditto. + * cmdloop.c (call_command_loop): Ditto, both versions. + * cmdloop.c (command_loop_1): Ditto, when !LISP_COMMAND_LOOP. + * cmdloop.c (Fcommand_loop_1): Ditto, when !LISP_COMMAND_LOOP. + * commands.h (call_command_loop): Declare as noreturn. + * compiler.h: Define (DECLARE_)DOESNT_RETURN_TYPE for functions + with non-void return types. Use them to define + (DECLARE_)DOESNT_RETURN. + * device-x.c (x_IO_error_handler): Use RETURN_NOT_REACHED. + * emacs.c (Frun_emacs_from_temacs): Mark as noreturn. + * emacs.c (Fkill_emacs): Ditto. Use RETURN_NOT_REACHED. + * eval.c (unwind_to_catch): Declare as noreturn. + * eval.c (throw_or_bomb_out): Ditto. Remove comments about + warnings that will now not be generated. + * eval.c (Fthrow): Mark as noreturn. Use RETURN_NOT_REACHED. + * eval.c (Fsignal): Use RETURN_NOT_REACHED. + * eval.c (flagged_a_squirmer): Mark as noreturn. Use + RETURN_NOT_REACHED. + * fns.c (base64_conversion_error): Declare as noreturn. + * frame-gtk.c (gtk_cant_notify_wm_error): Ditto. + * frame-x.c (x_cant_notify_wm_error): Ditto. + * gif_io.c (GifError): Mark as noreturn. + * gif_io.c (GifInternError): Ditto. + * gifrlib.h (GifInternError): Declare as noreturn. + * gifrlib.h (GifError): Ditto. + * lisp.h (EXFUN_NORETURN): New macro. + * lisp.h (DEFUN_NORETURN): New macro. + * lisp.h (Fkill_emacs): Declare as noreturn. + * lisp.h (Fthrow): Ditto. + * lread.c (read_syntax_error): Ditto. + * minibuf.c (Fread_minibuffer_internal): Mark as noreturn. Don't + bother calling specpdl_depth and unbind_to_1 since + call_command_loop never returns. + * objects.c (finalose): Mark as noreturn. + * objects.h (finalose): Declare as noreturn. + * process-unix.c (child_setup): Ditto. + * search.c (matcher_overflow): Ditto. + * search.c (signal_failure): Ditto. Make the return type void and + remove the return statement. + * search.c (search_command): Change the use of signal_failure to + match, using RETURN_NOT_REACHED. + +2004-08-18 Felix H. Gatzemeier <f.g@tzemeier.info> + + * doprnt.c (emacs_doprnt_1): Use sprintf to format error messages + from the formatting function. + * eval.c (syntax_error): Emphasize that `reason' is not processed + as a format string. + +2004-09-11 Malcolm Purvis <malcolmp@xemacs.org> + + * config.h.in: Added entries for sys/resource.h, sys/vlimit.h, + getrlimit() and vlimit(). + * mem-limits.h: Use configure to check for the presence of + OS-specific functions. General cleanup. + +2004-09-10 Jerry James <james@xemacs.org> + + * intl-encap-win32.c (qxeDocumentProperties): Conditionalize + Cygwin bug workaround on w32api header version. + +2004-08-18 Felix H. Gatzemeier <f.g@tzemeier.info> + + * alloc.c (malloced_storage_size): Renamed log to log2, twice, + to fix a shadow warning in gcc 3.3.4. + +2004-09-10 Malcolm Purvis <malcolmp@xemacs.org> + + * Makefile.in.in: Enable support for parallel builds. + +2004-08-26 Jerry James <james@xemacs.org> + + * device-x.c (x_init_device): Remove unused variable device. + * device-x.c (x_delete_device): Ditto. + +2004-08-26 Jerry James <james@xemacs.org> + + * eval.c (Ffuncall): Remove unused variable orig_fun. + +2004-08-26 Jerry James <james@xemacs.org> + + * event-Xt.c (emacs_Xt_unselect_console): Remove unused variable + console. + +2004-08-26 Jerry James <james@xemacs.org> + + * event-stream.c (munge_keymap_translate): Remove unused variable n. + +2004-08-26 Jerry James <james@xemacs.org> + + * glyphs-eimage.c (tiff_memory_write): Use RETURN_NOT_REACHED. + +2004-08-26 Jerry James <james@xemacs.org> + + * gutter.c (output_gutter): Removed unused variable frame. + +2004-08-25 Jerry James <james@xemacs.org> + + * redisplay-x.c (x_output_string): Remove unused variable device. + +2004-08-12 Jerry James <james@xemacs.org> + + * window.c (margin_width_internal): Remove unused variable b. + * toolbar-common.c (common_output_toolbar_button): Remove unused + variable frame. + +2004-08-10 Jerry James <james@xemacs.org> + + * emacs.c (really_abort): make its return type DOESNT_RETURN. + * lisp.h: declare really_abort with DECLARE_DOESNT_RETURN. + +2004-08-04 Jerry James <james@xemacs.org> + + * regex.c: Fix the previous patch by moving to the right place. + +2004-08-03 Jerry James <james@xemacs.org> + + * regex.c: Move #define gettext after #include "lisp.h" to avoid + breaking the C++ build on Fedora systems. + +2004-07-27 Malcolm Purvis <malcolmp@xemacs.org> + + * frame-gtk.c (gtk_make_frame_visible): + * frame-gtk.c (gtk_make_frame_invisible): Use map/unmap instead of + show/hide. This is what X uses and is prevents previously hidden + widgets from suddenly reappearing. + * gtk-xemacs.c (gtk_xemacs_paint): + * gtk-xemacs.c (gtk_xemacs_draw): + * gtk-xemacs.c (gtk_xemacs_expose): Only operate if the widget is + drawable. + * scrollbar-gtk.c (gtk_update_scrollbar_instance_status): Force + size and location changes so that they can be seen before the next + idle event. Without this rapid changes to scrollbar properties + are not seen. + +2004-07-07 Malcolm Purvis <malcolmp@xemacs.org> + + * console-gtk-impl.h: + * console-gtk-impl.h (struct gtk_frame): + * console-gtk-impl.h (FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE): + Add hash tables track tab_control callback data. + Added #defines for GTK object data names. + * console-gtk.h: Declaration of gtk_widget_to_frame(). + * frame-gtk.c (gtk_widget_to_frame): New. + * frame-gtk.c (gtk_create_widgets): + * frame-gtk.c (allocate_gtk_frame_struct): + * frame-gtk.c (gtk_mark_frame): + Manage frame callbakc hash tables. + * glyphs-gtk.c (gtk_map_subwindow): Fix size and moving bugs. + * glyphs-gtk.c (gtk_redisplay_widget): Use correct size for widgets. + * glyphs-gtk.c (gtk_widget_instantiate_1): Force reconsideration + of widget size. + * glyphs-gtk.c (gtk_widget_query_geometry): New + * glyphs-gtk.c (gtk_register_gui_item): New + * glyphs-gtk.c (gtk_add_tab_item): New + * glyphs-gtk.c (gtk_tab_control_callback): New + * glyphs-gtk.c (gtk_tab_control_instantiate): New + * glyphs-gtk.c (gtk_tab_control_redisplay): Set notebook page. + Use correct list when loading item. + * glyphs-gtk.c (image_instantiator_format_create_glyphs_gtk): + Register new methods. + * gtk-xemacs.c (gtk_xemacs_size_allocate): Use XEmacs size, not + default size, for widgets. + * gui-gtk.c: Improved comment. + * gui-x.c: Improved comment. + * menubar-gtk.c (__generic_button_callback): Use + gtk_widget_to_frame instead of __get_channel. + * scrollbar-gtk.c: + * ui-gtk.c: Use symbolic names for GTK object data. + +2004-07-06 Lutz Euler <lutz.euler@freenet.de> + + * syntax.c (setup_syntax_cache): Fix behavior for buffers + containing multibyte chars. + Fixes "Fatal error: assertion failed, file src/buffer.h, line 617, + (x) >= ((Charbpos) 1) && x <= ((buf)->text->bufz + 0)" + +2004-06-29 Jerry James <james@xemacs.org> + + * specifier.c (check_valid_inst_list): Change LIST_LOOP to + EXTERNAL_LIST_LOOP_2. + * specifier.c (check_valid_spec_list): Ditto. + +2004-06-16 Malcolm Purvis <malcolmp@xemacs.org> + + * malloc.c (morecore): siz is a long because in some architectures + (eg ia-64) an int cannot hold the address range. Additional patch + from the SuSe distribution. + +2004-06-15 Malcolm Purvis <malcolmp@xemacs.org> + + * emacs.c: + * malloc.c: lim_data is a long because in some architectures + (eg ia-64) an int cannot hold the address range. + * mem-limits.h: lim-data is a long. Linux uses getrlimit() instead + of ulimit() because ulimit() always returns -1. + * file-coding.h (struct Lisp_Coding_System): Moved a field to the + end of the structure to work around alignment problems on the ia-64. + * file-coding.c (struct convert_eol_coding_system): Added dummy + field to work around alignment problems on the ia-64. + +2004-06-08 Didier Verna <didier@xemacs.org> + + * config.h.in (EXTERN_C_BLOCK_BEGIN): Remove. + (EXTERN_C_BLOCK_END): Ditto. + * nas.c: Use BEGIN_C_DECLS and END_C_DECLS instead. + +2004-06-07 Adrian Aichner <adrian@xemacs.org> + + * device-x.c (x_IO_error_handler): Phrase duplication typo fixes + for typos found by + xemacs-builds/adrian/typology/phrase-duplication-typo.pl. + +2004-06-06 Ilya N. Golubev <gin@mo.msk.ru> + + * extw-Xt.c (_XT_WAIT_FOR_SOMETHING): Fix: complete macro + renaming: #define. + +2004-06-03 Didier Verna <didier@xemacs.org> + + * config.h.in (EXTERN_C_BLOCK_BEGIN): New macro. + (EXTERN_C_BLOCK_END): Ditto. + * nas.c: Use them around audio headers. + * extw-Xt.c: Fix EXTERN_C usage (see 2004-06-02 below). + +2004-06-02 Didier Verna <didier@xemacs.org> + + C++ related fixes. + + * ExternalClient-Xlib.c (window_has_focus_p): Fix nchild parameter + type. + * ExternalClient.c (ComputeWindowAttributes): Fix old K&R function + prototype. + * ExternalClient.c (Destroy): Ditto. + * ExternalClient.c (QueryGeometry): Ditto. + * ExternalShell.c (EventHandler): Ditto. + * ExternalShell.c (ExternalShellDestroy): Ditto. + * ExternalShell.c (ChangeManaged): Ditto. + * ExternalShell.c (ExternalShellRootGeometryManager): Ditto. + * extw-Xt.c: Wrap `fatal' and `_XtWaitForSomething' function + prototypes in EXTERN_C. + * extw-Xt.c (_XT_WAIT_FOR_SOMETHING): Rename macro (previously + _XtWaitForSomething). + * extw-Xt.c (extw_wait_for_response): Use it. + * nas.c (EXTERN_C): Wrap audio headers inclusion in EXTERN_C. + +2004-05-21 Jerry James <james@xemacs.org> + + * floatfns.c (Ffloat): Add missing return keyword. + * number.h: Declare Qbignump, Qratiop, and Qbigfloatp in every case. + * number.c: Ditto. + * number.c (syms_of_number): Ditto. Declare + Fbigfloat_get_precision and Fbigfloat_set_precision. + * number.c (Fbigfloat_get_precision): New function. + * number.c (Fbigfloat_set_precision): New function. + * number.c (vars_of_number): Clarify that default-float-precision + of 0 means to create normal floats. Change bigfloat-max-prec to + bigfloat-maximum-precision. + +2004-05-15 Malcolm Purvis <malcolmp@xemacs.org> + + * glyphs-gtk.c (gtk_xpm_instantiate): Rewrite the XPM data to + replace symbolic color entries with the real colors specified in + xpm-color-symbols, before passing the XPM to gtk. + * glyphs-gtk.h: Use the generic pixmap_image_instance.mask for masks, + instead of a GTK specific field, so that it is used in by generic + code. + +2004-05-15 Malcolm Purvis <malcolmp@xemacs.org> + + * event-gtk.c: + * event-gtk.c (gtk_event_to_emacs_event): + * menubar-gtk.c: + * menubar-gtk.c (gtk_xemacs_menubar_class_init): + * menubar-gtk.c (gtk_xemacs_menubar_size_request): + * menubar-gtk.c (gtk_xemacs_accel_label_get_type): + * menubar-gtk.c (gtk_xemacs_set_accel_keys): + * menubar-gtk.c (__activate_menu): + * menubar-gtk.c (convert_underscores): + * menubar-gtk.c (remove_underscores): + * menubar-gtk.c (menu_convert): + * menubar-gtk.c (menu_descriptor_to_widget_1): + * menubar-gtk.c (menu_descriptor_to_widget): + * menubar-gtk.c (menu_can_reuse_widget): + * menubar-gtk.c (menu_create_menubar): + * menubar-gtk.c (gtk_popup_menu): + * menubar-gtk.c (Fgtk_build_xemacs_menu): + + Added support for Gtk menu bar and menu item mnemonics. + +2004-05-10 Jerry James <james@xemacs.org> + + * config.h.in: Add HAVE_LTDL. + * emodules.c: Include LTDL headers, if needed. + * emodules.c (vars_of_module): Add LTDL initialization code. + * sysdll.c: Remove unused dll_init functions. Add LTDL support. + * sysdll.h: Remove dll_init declaration and adjust spacing. + +2004-05-05 Chuck Hines <chuck.hines@baesystems.com> + + * dgif_lib.c (DGifSlurp): Changed do-while to while to stop + coredump from deref of NULL ptr (ExtData) + +2004-05-05 Jerry James <james@xemacs.org> + + * number.c: Use DEFINE_BASIC_LRECORD_IMPLEMENTATION instead of + DEFINE_LRECORD_IMPLEMENTATION for bignum, ratio, and bigfloat. + * number.c (bignum_finalize): Remove; we already do this with an + ADDITIONAL_FREE macro in alloc.c. + * number.c (ratio_finalize): Ditto. + * number.c (bigfloat_finalize): Ditto. + * number.c (vars_of_number): Put all initialization of + Vbigfloat_max_prec here, but leave some commented until we can + dump bignums. + * number.c (init_number): Remove Vbigfloat_max_prec + initialization. + +2004-05-03 Jerry James <james@xemacs.org> + + * floatfns.c (Fexpt): Don't shadow the global symbol exp. + * number.c: Remove unused testing function string_to_bignum and + extraneous semicolon; thanks to Vin. + * number.h: Add make_floating prototype. + +2004-04-20 Malcolm Purvis <malcolmpurvis@optushome.com.au> + + * console-gtk-impl.h: Include X11.h. + * console-gtk-impl.h (struct gtk_device): Use X types for keysym data. + * data.c (Fstring_to_number): Cast Ibtye to char* for atoX arg. + * device-gtk.c (gtk_init_device): Convert gtkrc filename to extern + encoding before use by GTK. + * device-gtk.c (Fgtk_grab_pointer): Cast bitmask to expected type. + * emacs-marshals.c: INT return type is gint, not guint. + * event-gtk.c: Add args to gtk_keysym_to_emacs_keysym() prototype. + * event-gtk.c (gtk_event_to_emacs_event): Cast button posn from + double to int. + * event-gtk.c (gtk_reset_key_mapping): Avoid casts to void* for + keysym_map. + * frame-gtk.c (gtk_set_initial_frame_size): Avoid '|' of bitfield enum. + * frame-gtk.c (gtk_initialize_frame_size): Cast to right type. + * frame-gtk.c (gtk_get_frame_parent): Cast to right type. + * frame-gtk.c (gtk_set_frame_size): Avoid '|' of bitfield enum. + * gccache-gtk.c: mask type is unsigned long, not enum. + * gccache-gtk.c (gc_cache_lookup): mask type is unsigned long, not enum. + * gccache-gtk.h (gc_cache_lookup): mask type is unsigned long, not enum + * glade.c (Fglade_xml_signal_connect): Cast Ibtye to char*. + * glyphs-gtk.c: Remove extra definition of Qxface. + * glyphs-gtk.c (gtk_print_image_instance): #ifdef, not #if, HAVE_SUBWINDOWS. + * glyphs-gtk.c (gtk_finalize_image_instance): cast to right type. + * glyphs-gtk.c (gtk_image_instance_equal): #ifdef, not #if, HAVE_SUBWINDOWS. + * glyphs-gtk.c (gtk_image_instance_hash): #ifdef, not #if, HAVE_SUBWINDOWS. + * glyphs-gtk.c (xbm_instantiate_1): Use Extbyte*, not char*. + * glyphs-gtk.c (struct color_symbol): Use Ibyte, not char*. + * glyphs-gtk.c (extract_xpm_color_names): Pass correct data to free_cons(). + * glyphs-gtk.c (gtk_xpm_instantiate): width, height are gint, not + unsigned. Use proper internal strcasecmp function. + * glyphs-gtk.c (resource_name_to_resource): Expect + image_instance_type, not int. + * glyphs-gtk.c (resource_symbol_to_type): Return + image_instance_type, not int. + * glyphs-gtk.c (gtk_resource_instantiate): Use + image_instance_type, not int. + * glyphs-gtk.c (cursor_name_to_index): Return GdkCursorType, not + gint. + * glyphs-gtk.c (cursor_font_instantiate): Use GdkCursorType, not + gint. + * glyphs-gtk.c (gtk_redisplay_widget): Commented out unused var. + * glyphs-gtk.c (BUILD_GLYPH_INST): Use ExtByte, not char* + * glyphs-gtk.c (gtk_colorize_image_instance): Cast to enum + bitfield. + * glyphs.h: typedef image_instance_type. + * gtk-glue.c (xemacs_gtklist_to_list): Cast first arg of + g_list_foreach() to right type. + * gtk-glue.c (xemacs_list_to_array): Cast to cghar*. + * gtk-glue.c (gdk_event_to_emacs_event): Cast button posn from + double to int. + * gtk-xemacs.c (gtk_xemacs_new): Cast constructor return to right type. + * gtk-xemacs.c (gtk_xemacs_draw): Cast data to right type. + * gui-gtk.c: Removed double definition of Qmenu_no_selection_hook. + * menubar-gtk.c (gtk_xemacs_menubar_new): Cast constructor return to right type. + * menubar-gtk.c (menu_name_to_accelerator): Remove unnecessary + cast to unsigned char. + * menubar-gtk.c (remove_underscores): Use Ibyte, char char* + * menubar-gtk.c (menu_descriptor_to_widget_1): ditto + * menubar-gtk.c (menu_can_reuse_widget): ditto + * objects-gtk.c (gtk_initialize_font_instance): Cast to right type. + * objects-gtk.c (gtk_find_charset_font): Use Ibyte, not char*. + * objects-gtk.c (__get_gtk_font_truename): ditto. + * redisplay-gtk.c (gtk_get_gc): Cast mask to right type. + * redisplay-gtk.c (gtk_output_string):Font attibs are int, not + unsigned. + * scrollbar-gtk.c (scrollbar_cb): Cast to right type. + * select-gtk.c (gtk_own_selection): Removed unused var selection_time. + * sysdll.c (search_linked_libs): Count is unsigned. + * sysdll.c (dll_function): Cast function pointer to void*. + * ui-byhand.c (generic_toolbar_insert_item): Cast Ibyte to char*. + * ui-gtk.c: Macro to hide manipulation of fundamental types. + * ui-gtk.c (initialize_dll_cache): Type problems with literal + strings. + * ui-gtk.c (Fdll_load): Use Ibyte form of strdup. + * ui-gtk.c (__allocate_object_storage): Cast during fundamental type test. + * ui-gtk.c (type_to_marshaller_type): Cast during fundamental type test. + * ui-gtk.c (__dll_mapper): Use CIbyte, not char*. + * ui-gtk.c (Fgtk_import_function_internal): Cast during fundamental type test. + * ui-gtk.c (Fgtk_call_function): Cast during fundamental type test. + * ui-gtk.c (Fgtk_describe_type): Cast during fundamental type test. + * ui-gtk.c (gtk_type_to_lisp): Cast during fundamental type test. + * ui-gtk.c (lisp_to_gtk_type): Cast during fundamental type test. + * ui-gtk.c (lisp_to_gtk_ret_type): Cast during fundamental type test. + +2004-04-30 Jerry James <james@xemacs.org> + + * number.c (vars_of_number): Fix comment. Initialize + bigfloat-max-prec when it is possible to do so safely. + * number.c (init_number): If bigfloat-max-prec is a bignum, set it + only when initialized. + +2004-04-19 Jerry James <james@xemacs.org> + + * data.c (sign_extend_lisp_int): Use INT_VALBITS instead of + VALBITS to compute the location of the sign bit. + * event-stream.c (Fcurrent_event_timestamp): Replace incorrect use + of VALBITS with EMACS_INT_MAX. + * events.c (Fevent_timestamp): Ditto. + * events.c (TIMESTAMP_HALFSPACE): Change VALBITS to INT_VALBITS to + compute the halfway point to timestamp wraparound. + * floatfns.c (float_to_int): Compare against EMACS_INT_MAX and + EMACS_INT_MIN instead of using VALBITS. + * floatfns.c (Flogb): Use EMACS_INT_MIN instead of building an + incorrect number with VALBITS. + * fns.c (Frandom): Use INT_VALBITS instead of VALBITS to compute + the denominator. + * sysdep.c (get_random): Use INT_VALBITS instead of VALBITS to + build random numbers. + +2004-04-18 Jerry James <james@xemacs.org> + + * dump-data.c (dumped_data_get): Change return type to char *. + * dump-data.h (dumped_data_get): Ditto. + +2004-04-15 Jerry James <james@xemacs.org> + + * signal.c (check_what_happened): Remove check for proper + redisplay wrapping. + * signal.c (check_quit): Put the check here instead. + +2004-04-18 Stephen J. Turnbull <stephen@xemacs.org> + + * emacs.c (main_1): dumped_data_max_size and dumped_data_align_offset + return size_t, so need %u format conversion. + +2004-04-18 Stephen J. Turnbull <stephen@xemacs.org> + + * Makefile.in.in ($(LISP)/finder-inf.el): Force removal. + +2004-02-22 Stephen J. Turnbull <stephen@xemacs.org> + + * console.c (function_key_map): Reference `key-binding'. + + * keymap.c (Vkey_translation_map): Improve docstring. + +2004-04-18 Olivier Galibert <galibert@pobox.com> + + * emacs.c (main_1): Fix stupid logic error in -si handling. + +2004-04-15 Jerry James <james@xemacs.org> + + * number.c (Foddp): Lisp name should be oddp, not odd. Thanks to + Olivier Galibert. + +2003-12-07 Olivier Galibert <galibert@pobox.com> + + * Makefile.in.in: Add in-executable dump file support. + + * dump-data.h (dumped_data_get): Added. + + * dump-data.c: Added. + + * emacs.c (main_1): Add support for -si. + + * dumper.c (pdump_ram_try): Added. Tries getting the dump file + from within the executable itself. + (pdump_load): Call pdump_ram_try. + +2004-04-15 Jerry James <james@xemacs.org> + + * data.c (Fstring_to_number): Skip leading '-' when finding the + end of a number. + +2004-04-14 Jerry James <james@xemacs.org> + + * data.c (Fstring_to_number): Work around limitations of GMP + string to number converting functions. + * lread.c (read_atom): Comment fix: the behavior is not random. + * number.c (string_to_bignum): Ditto. + +2004-04-13 Jerry James <james@xemacs.org> + + * data.c (Fstring_to_number): Skip leading + sign to avoid + triggering random GMP behavior. + * lread.c (read_atom): Ditto. + * lread.c (isratio_string): Recognize ratio with leading + sign. + * number.c (string_to_bignum): Skip leading + sign. + +2004-01-30 Glynn Clements <glynn.clements@virgin.net> + + * device-x.c (x_error_handler): Don't call stderr_out + +2004-04-08 Jerry James <james@xemacs.org> + + * data.c: Use #ifndef for functions unused with new number types. + * data.c (digit_to_number): Unused when HAVE_BIGNUM. + * number.c: Remove multiply defined symbols Qintegerp & Qnumberp. + * number.c (syms_of_number): DEFSUBR(Ffloatingp) was omitted. + * print.c (print_internal): g++ thinks that specdepth might be + used undefined. It isn't, but the compiler can't tell. + +2004-04-07 Jerry James <james@xemacs.org> + + * number.c (Fevenp): Change the C boolean into Qnil/Qt. Thanks to + Robert Royar, Stephen Turnbull, and Hrvoje Niksic. + * number.c (Foddp): Ditto. + +2004-04-06 Jerry James <james@xemacs.org> + + * bytecode.c (bytecode_arithcompare): Provide a default case to + silence ICC. + * bytecode.c (bytecode_arithop): Ditto. + * data.c (Fstring_to_number): Use Ibyte instead of char. + * data.c (Fmax): Cast from Ibyte to char as needed. + * data.c (Flogand): REALLY commit the previous patch to data.c. + * doprnt.c (emacs_doprnt_1): Use Ibyte instead of char. + * floatfns.c (Ffloor): Provide a default case to silence ICC. + * lread.c (parse_integer): Cast from Ibyte to char. + * number-gmp.c: Get the qxe_getpid prototype. + * number.c (string_to_bignum): Cast from Ibyte to char. + * number.c (get_number_type): ICC does not know that abort does + not return. + * number.c (internal_coerce_number): Ditto. + * number.h: Declare get_number_type. + +2004-04-06 Jerry James <james@xemacs.org> + + * number-mp.c (bignum_set_string): Read negative numbers correctly. + +2004-04-06 Jerry James <james@xemacs.org> + + * data.c (Flogand): Fix for --use-union-type. + * data.c (Flogior): Ditto. + +2004-04-06 Jerry James <james@xemacs.org> + + * number-mp.c (bignum_to_double): Original algorithm was wrong. + +2004-04-06 Stephen J. Turnbull <stephen@xemacs.org> + + * lisp.h (Other numeric types): Band-aid: #define make_integer. + +2004-04-05 Jerry James <james@xemacs.org> + + * Makefile.in.in (number_objs): New. + * Makefile.in.in (objs): Use it. + * alloc.c: Make comment more precise. + * alloc.c (make_bignum): New function. + * alloc.c (make_bignum_bg): New function. + * alloc.c (make_ratio): New function. + * alloc.c (make_ratio_bg): New function. + * alloc.c (make_ratio_rt): New function. + * alloc.c (make_bigfloat): New function. + * alloc.c (make_bigfloat_bf): New function. + * alloc.c (sweep_bignums): New function. + * alloc.c (sweep_ratios): New function. + * alloc.c (sweep_bigfloats): New function. + * alloc.c (gc_sweep): Use the new sweep functions. + * alloc.c (Fgarbage_collect): Report collected number objects. + * alloc.c (common_init_alloc_early): Initialize number allocators. + * bytecode.c (bytecode_negate): Negate more number types. + * bytecode.c (bytecode_arithcompare): Compare more number types. + * bytecode.c (bytecode_arithop): Operate on more number types. + * bytecode.c (execute_optimized_program): Several changes in + support of the new number types. + * config.h.in: Add SIZEOF_DOUBLE, DOUBLE_BITS, WITH_NUMBER_TYPES, + WITH_GMP, WITH_MP, MP_PREFIX, and HAVE_MP_MOVE. + * data.c: Add symbol Qnonnegativep. + * data.c (Ffixnump): New function. + * data.c (Fnatnump): Work with bignums alos. + * data.c (Fnonnegativep): New function. + * data.c (Fnumberp): Return t for any number type. + * data.c (ARITHCOMPARE_MANY): Add cases for the new number types. + * data.c (Feqlsign): Work with the new number types. + * data.c (Flss): Ditto. + * data.c (Fgtr): Ditto. + * data.c (Fleq): Ditto. + * data.c (Fgeq): Ditto. + * data.c (Fneq): Ditto. + * data.c (Fzerop): Ditto. + * data.c (Fnumber_to_string): Ditto. + * data.c (Fstring_to_number): Ditto. + * data.c (Fplus): Ditto. + * data.c (Fminus): Ditto. + * data.c (Ftimes): Ditto. + * data.c (Fdiv): New function to produce ratios. + * data.c (Fquo): Work with the new number types. + * data.c (Fmax): Ditto. + * data.c (Fmin): Ditto. + * data.c (Flogand): Ditto. + * data.c (Flogior): Ditto. + * data.c (Flogxor): Ditto. + * data.c (Flognot): Ditto. + * data.c (Frem): Ditto. + * data.c (Fmod): Ditto. + * data.c (Fash): Ditto. + * data.c (Flsh): Ditto. + * data.c (Fadd1): Ditto. + * data.c (Fsub1): Ditto. + * data.c (syms_of_data): Declare new symbols and Lisp functions. + * depend: Regenerate. + * doprnt.c: Add converters for the new number types. + * doprnt.c (union printf_arg): Add new obj field. + * doprnt.c (get_doprnt_args): Use the new converters. + * doprnt.c (emacs_doprnt_1): Convert and print the new number types. + * emacs.c (main_1): Call syms_of_, vars_of_, and init_number. + * floatfns.c (float_to_int): Convert to bignums if necessary. + * floatfns.c (extract_float): Extract the new number types. + * floatfns.c (Fexpt): Work with bignums. + * floatfns.c (Fsqrt): Ditto. + * floatfns.c (Fabs): Work with the new number types. + * floatfns.c (Ffloat): Ditto. + * floatfns.c (Fceiling): Ditto. + * floatfns.c (Ffloor): Ditto. + * floatfns.c (Fround): Ditto. + * floatfns.c (Ftruncate): Ditto. + * fns.c (Frandom): Update docstring and accept bignum limits. + * fns.c (internal_equalp): Work with the new number types. + * general-slots.h: Add new type name symbols. + * lisp.h: Include number.h. Add isratio_string prototype. + Declare Qnonnegativep and Qnumberp. + * lread.c (read_atom): Read ratios. + * lread.c (parse_integer): Read bignums. + * lread.c (isratio_string): New functions. + * lrecord.h (lrecord_type): Add new number type values. + * symsinit.h: Declare syms_of_, vars_of_, and init_number. + * sysdep.c (seed_random): Set the bignum random seed. + +2004-03-30 Zajcev Evgeny <zevlg@yandex.ru> + + * window.c: Declare `allow_deletion_of_last_visible_frame' extern. + * window.c (window_loop): [fix] Take into account + `allow-deletion-of-last-visible-frame' variable. + * window.c (replace-buffer-in-windows): Ditto. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. @@ -149,7 +1145,7 @@ * ui-gtk.c (__internal_callback_marshal): Marshalling data to return to GTK requires a different API to marshalling data to use as GTK parameters. - * ui-gtk.c (lisp_to_gtk_ret_type): New. + * ui-gtk.c (lisp_to_gtk_ret_type): New. 2004-01-23 Stephen J. Turnbull <stephen@xemacs.org> @@ -207,7 +1203,7 @@ the iterative calls for marking weak data structures since the entries on the kkcc_stack need to be processed after every run to mark attached objects - + 2003-10-16 Jerry James <james@xemacs.org> * realpath.c (qxe_realpath): When a symbolic link to an absolute @@ -326,7 +1322,7 @@ * ui-gtk.c (CONVERT_RETVAL): Add type parameter to use of xfree, and fix some minor whitespace problems. * xemacs.def.in.in: Unconditionally export xfree_1 - + * alloc.c: * alloca.c: * buffer.c: @@ -585,7 +1581,7 @@ (kkcc_gc_stack_pop): Remove kkcc_gc_stack_count. (mark_object_maybe_checking_free): Push on stack instead of marking. (garbage_collect_1): Invoke kkcc_marking after finish_marking_*. - + 2003-08-21 Jerry James <james@xemacs.org> * lrecord.h (DECLARE_MODULE_API_LRECORD): Also define when not @@ -593,7 +1589,7 @@ 2003-08-19 René Kyllingstad <listmailxemacs@kyllingstad.com> - * alloc.c (kkcc_gc_stack_init): + * alloc.c (kkcc_gc_stack_init): (kkcc_gc_stack_realloc): Missing casts for the return value of malloc and realloc. @@ -654,15 +1650,15 @@ * README.kkcc: Aligned to the changes. * alloc.c: Implemented the kkcc_gc_stack. - (kkcc_gc_stack_init): - (kkcc_gc_stack_free): - (kkcc_gc_stack_realloc): - (kkcc_gc_stack_full): - (kkcc_gc_stack_empty): - (kkcc_gc_stack_push): - (kkcc_gc_stack_pop): - (kkcc_gc_stack_push_lisp_object): - (mark_object_maybe_checking_free): Push objects on kkcc stack instead + (kkcc_gc_stack_init): + (kkcc_gc_stack_free): + (kkcc_gc_stack_realloc): + (kkcc_gc_stack_full): + (kkcc_gc_stack_empty): + (kkcc_gc_stack_push): + (kkcc_gc_stack_pop): + (kkcc_gc_stack_push_lisp_object): + (mark_object_maybe_checking_free): Push objects on kkcc stack instead of marking. (mark_struct_contents): Push objects on kkcc stack instead of marking. (kkcc_marking): KKCC mark algorithm using the kkcc_gc_stack. @@ -670,17 +1666,17 @@ (garbage_collect_1): Push objects on kkcc stack instead of marking. * data.c: Added XD_FLAG_NO_KKCC to ephemeron_description and to weak_list_description. - * data.c (finish_marking_weak_lists): Push objects on kkcc stack + * data.c (finish_marking_weak_lists): Push objects on kkcc stack instead of marking. - (continue_marking_ephemerons): Push objects on kkcc stack instead + (continue_marking_ephemerons): Push objects on kkcc stack instead of marking. - (finish_marking_ephemerons): Push objects on kkcc stack instead + (finish_marking_ephemerons): Push objects on kkcc stack instead of marking. - * elhash.c (finish_marking_weak_hash_tables): Push objects on kkcc + * elhash.c (finish_marking_weak_hash_tables): Push objects on kkcc stack instead of marking. * eval.c: Added XD_FLAG_NO_KKCC to subr_description. * lisp.h: Added prototype for kkcc_gc_stack_push_lisp_object. - * profile.c (mark_profiling_info_maphash): Push keys on kkcc stack + * profile.c (mark_profiling_info_maphash): Push keys on kkcc stack instead of marking. 2003-07-30 Jerry James <james@xemacs.org> @@ -689,12 +1685,12 @@ 2003-07-24 Mike Sperber <mike@xemacs.org> - * lisp.h: - * data.c: - (init_marking_ephemerons): - (continue_marking_ephemerons): - (finish_marking_ephemerons): - (prune_ephemerons): + * lisp.h: + * data.c: + (init_marking_ephemerons): + (continue_marking_ephemerons): + (finish_marking_ephemerons): + (prune_ephemerons): * alloc.c (garbage_collect_1): Rewrite the ephemeron marker once again to allow ephemerons to be used for implementing simple object finalization. @@ -779,8 +1775,8 @@ (Fsearch_forward): (Fword_search_backward): (Fword_search_forward): - (Fre_search_backward): - (Fre_search_forward): + (Fre_search_backward): + (Fre_search_forward): (Fposix_search_backward): (Fposix_search_forward): Document that search/match failure preserves match data. @@ -806,7 +1802,7 @@ 2000-07-22 Ilya N. Golubev <gin@mo.msk.ru> * lisp.h (filemodestring): Remove - + * sysfile.h (filemodestring): Put it here * filemode.c (filemodestring): Note in comment where it is @@ -880,9 +1876,9 @@ * search.c (search_buffer): Don't find null string if repetition count is 0. - (string_match_1): - (looking_at_1): - (search_buffer): + (string_match_1): + (looking_at_1): + (search_buffer): (simple_search): (boyer_moore): Clear all search regs as start, not unused ones on success. @@ -994,11 +1990,11 @@ Fix up internal magic-cookie code to also check for `;;;###coding system', already handled by the (redundant) code in files.el. - + * regex.c (re_match_2_internal): Fix problem with ordering of initializations and statements -- OK in C++, not in C. - + * search.c (fast_string_match): Indentation. @@ -1022,7 +2018,7 @@ * alloc.c (disksave_object_finalization): Don't arbitrarily clear Vconfigure_info_directory since it messes up separate build/source dirs. - + * console.c (get_console_variant): * console.c (Fvalid_console_type_p): * console.c (Fconsole_type): @@ -1030,7 +2026,7 @@ * device-msw.c: * device.c: Add accidentally omitted msprinter console and data descriptions. - + * print.c: * print.c (write_string_to_stdio_stream_1): * print.c (write_string_to_stdio_stream): @@ -1050,11 +2046,11 @@ Add clear-left-side functionality to help keep stdio/stderr output from separate sources on separate lines. Generalize the different kinds of debugging output. Add dpa(). - + * profile.c: * profile.c (vars_of_profile): Add better docs on Unix/Windows differences. - + * regex.c: * regex.c (RE_TRANSLATE_1): * regex.c (REGEX_ALLOCATE_STACK): @@ -1067,7 +2063,7 @@ * emacs.c (assert_failed): Seg fault rather than abort on Cygwin, since gdb doesn't trap aborts properly. - + * console-gtk-impl.h: * console-gtk-impl.h (struct gtk_frame): * console-gtk.h: @@ -1210,7 +2206,7 @@ * dumper.c (pdump_reloc_one): * dumper.c (pdump_dump_root_struct_ptrs): Issue notes about incremental linking problems under Windows. - + * fileio.c: * fileio.c (barf_or_query_if_file_exists): * fileio.c (Fsysnetunam): @@ -1218,7 +2214,7 @@ * fileio.c (Fdecrypt_string): * fileio.c (Fdo_auto_save): Mule-ize encrypt/decrypt-string code. - + * text.h (DEC_IBYTEPTR): * text.h (EI_ALLOC): * text.h (eicpy_lstr): @@ -1442,7 +2438,7 @@ * alloc.c: * alloc.c (garbage_collect_1): Make gc_currently_forbidden static. - + * config.h.in: * lisp.h: Move some stuff to lisp.h. @@ -1484,17 +2480,17 @@ * event-stream.c (Fdiscard_input): * frame.c: Add comments about calling Lisp. - + * debug.c: * debug.c (FROB): * debug.c (syms_of_debug): * general-slots.h: Move generalish symbols to general-slots.h. - + * doprnt.c (get_doprnt_args): * doprnt.c (emacs_doprnt_1): reindent. - + * lisp.h (Dynarr_reset): * lisp.h (Dynarr_add): * lisp.h (Dynarr_increment): @@ -1507,7 +2503,7 @@ * dynarr.c (Dynarr_memory_usage): Add debug code for locking a dynarr to catch invalid mods. Use in redisplay.c. - + * eval.c: * eval.c (throw_or_bomb_out): * eval.c (Fsignal): @@ -1519,13 +2515,13 @@ * file-coding.c: * file-coding.c (complex_vars_of_file_coding): Define file-name as alias for native not vice-versa. - + * frame-gtk.c: * frame-gtk.c (syms_of_frame_gtk): * frame-x.c: * frame-x.c (syms_of_frame_x): Move Qwindow_id to general-slots. - + * dialog-msw.c (handle_question_dialog_box): * glyphs-gtk.c (gtk_tab_control_redisplay): * glyphs-msw.c: @@ -1563,7 +2559,7 @@ within redisplay, taking an in_redisplay parameter if it's possible for them to be called both inside and outside of redisplay. - + * gutter.c: * gutter.c (calculate_gutter_size): * gutter.c (redraw_exposed_gutters): @@ -1572,16 +2568,16 @@ * gutter.c (gutter_geometry_changed_in_window): Defer specifier-changed updating till after redisplay, if necessary, since we need to enter redisplay to do it. - + * gutter.c (Fredisplay_gutter_area): Do nothing if in redisplay. - + * lisp.h: Add version of alloca() for use in function calls. - + * lisp.h (XCADR): Add XCAD[D+]R up to 6 D's, and aliases X1ST, X2ND, etc. - + * frame.c (invalidate_vertical_divider_cache_in_frame): * frame.c (adjust_frame_size): * frame.c (store_minibuf_frame_prop): @@ -1624,7 +2620,7 @@ we enter redisplay reentrantly. Disable all quit checking in redisplay since it's too dangerous. Ensure that all calls to QUIT trigger an abort if unprotected. - + * redisplay.c: * scrollbar-gtk.c (gtk_update_frame_scrollbars): * scrollbar-x.c (x_update_frame_scrollbars): @@ -1633,11 +2629,11 @@ Create enter/exit_redisplay_critical_section_maybe() for code that needs to ensure it's in a critical section but doesn't interfere with an existing critical section. - + * sysdep.c: * sysdep.c (qxe_execve): Use _wexecve() when under Windows NT for Unicode correctness. - + * text.c: * text.c (new_dfc_convert_now_damn_it): * text.c (new_dfc_convert_malloc): @@ -1656,7 +2652,7 @@ Update the encoding aliases after involved scrutinization of the X manual. - + * unicode.c: * unicode.c (init_blank_unicode_tables): * unicode.c (init_charset_unicode_tables): @@ -1755,7 +2751,7 @@ * console.c (Fvalid_console_type_p): Update list of possibly valid console types. - + * emacs.c: * emacs.c (check_compatible_window_system): * emacs.c (main_1): @@ -1784,7 +2780,7 @@ must be running in batch mode. This also fixes an existing bug whereby compiling with no x, no mswin, no tty, when running non- interactively (e.g. to dump) I get "sorry, must have TTY support". - + * emacs.c (Frun_emacs_from_temacs): Turn on Vstack_trace_on_error so that errors are debuggable even when occurring extremely early in reinitialization. @@ -1798,24 +2794,24 @@ is noninteractive or interactive, whether raw, post-dump/pdump-load or run-temacs, whether we are dumping, whether pdump is in effect. - + * event-stream.c: It's "mommas are fat", not "momas are fat". Fix other typo. * event-stream.c (Fnext_event): Conditionalize in_menu_callback check on HAVE_MENUBARS, because it won't exist on w/o menubar support, - + * lisp.h: More hackery on RETURN_NOT_REACHED. Cygwin v3.2 DOES complain here if RETURN_NOT_REACHED() is blank, as it is for GCC 2.5+. So make it - blank only for GCC 2.5 through 2.999999999999999. - + blank only for GCC 2.5 through 2.999999999999999. + Declare Vstack_trace_on_error. - + * profile.c: Need to include "profile.h" to fix warnings. - + * sheap.c (report_sheap_usage): Don't fatal() when need to rerun Make, just stderr_out() and exit(0). That way we can distinguish between a dumping failing expectedly @@ -1837,7 +2833,7 @@ * xmotif.h: New file, to get around shadowing warnings. - + * EmacsManager.c: * event-Xt.c: * glyphs-x.c: @@ -1846,10 +2842,10 @@ * xmmanagerp.h: * xmprimitivep.h: Include xmotif.h. - + * alloc.c: Conditionalize in_malloc on ERROR_CHECK_MALLOC. - + * config.h.in: * file-coding.h: * fileio.c: @@ -1864,11 +2860,11 @@ * unicode.c (dfc_coding_system_is_unicode): Eliminate HAVE_WIN32_CODING_SYSTEMS, use WIN32_ANY instead. Replace defined (WIN32_NATIVE) || defined (CYGWIN) with WIN32_ANY. - + * lisp.h: More futile attempts to walk and chew gum at the same time when dealing with subr's that don't return. - + 2003-02-19 Ben Wing <ben@xemacs.org> * eval.c (unbind_to_hairy): @@ -1915,7 +2911,7 @@ * buffer.c: * syntax.c: Move syntax table description from buffer.c to syntax.c. - + * chartab.c: * chartab.c (set_char_table_dirty): * chartab.c (fill_char_table): @@ -1933,7 +2929,7 @@ away, just mark as dirty. Add various asserts to make sure we are dealing with the right type of table (mirror or non-mirror). - + * font-lock.c: * font-lock.c (find_context): * syntax.c (init_syntax_cache): @@ -1960,7 +2956,7 @@ When retrieving the syntax code, check the dirty flag and update the mirror tables as appropriate. Add some asserts, as above. - + 2003-02-14 Ben Wing <ben@xemacs.org> * scrollbar.c (specifier_vars_of_scrollbar): @@ -1972,7 +2968,7 @@ If, that is, you're using a slow X connection and MoveOpaque. Use compress_exposure = XtExposeCompressMaximal | XtExposeNoRegion. Use compress_motion = TRUE. - * EmacsFrame.c (emacsFrameClassRec): + * EmacsFrame.c (emacsFrameClassRec): * EmacsShell-sub.c (EMACS_SHELL_CLASS_REC): * EmacsManager.c (emacsManagerClassRec): * xintrinsicp.h: Make sure XtExposeNoRegion is defined. @@ -2030,7 +3026,7 @@ * profile.h: New file. Create macros for declaring internal profiling sections. - + * lisp.h: Move profile-related stuff to profile.h. @@ -2064,8 +3060,8 @@ * eval.c: * eval.c (unwind_to_catch): - When unwinding, - + When unwinding, + * eval.c (Fcommand_execute): * eval.c (Feval): * eval.c (Ffuncall): @@ -2110,7 +3106,7 @@ since the signal handler is the main grower but can't allow a realloc(). We make sure, at critical points, that the table is large enough.) - + * lread.c: * lread.c (Fload_internal): * lread.c (done): New. @@ -2141,7 +3137,7 @@ 2003-02-07 Mike Sperber <mike@xemacs.org> - * scrollbar.c (specifier_vars_of_scrollbar): + * scrollbar.c (specifier_vars_of_scrollbar): (specifier_vars_of_scrollbar): TTY devices don't have scrollbars. 2003-01-28 Martin Buchholz <martin@xemacs.org> @@ -2155,11 +3151,11 @@ * console-stream.c (console_type_create_stream): Abort when any attempts to output a stream console are made. Should be caught sooner. - + * event-msw.c (mswindows_wnd_proc): Don't redisplay() during sizing when the frame has not yet been initialized completely. - + * event-stream.c (Fnext_event): * menubar-msw.c (mswindows_handle_wm_initmenupopup): * menubar-x.c (protected_menu_item_descriptor_to_widget_value): @@ -2170,11 +3166,11 @@ in_modal_loop, when issuing error in `next-event', otherwise we bite the dust immediately -- event-msw.c purposely calls Fnext_event() in a modal loop, and knows what it's doing. - + * redisplay-output.c (redisplay_unmap_subwindows_maybe): * redisplay-output.c (redisplay_unmap_subwindows_except_us): Formatting fixes. - + * redisplay.c: * redisplay.c (redisplay_frame): * redisplay.c (Fredisplay_echo_area): @@ -2194,7 +3190,7 @@ Put in a check here (as well as redisplay_device()) for a stream frame. We can get here directly through Lisp fun `redisplay-frame'. Abort if frame not initialized. - + * redisplay.c (Fredisplay_echo_area): * redisplay.c (Fforce_cursor_redisplay): Check for stream frames/devices. @@ -2229,7 +3225,7 @@ They are related because they both touch on the code that retrieves events and handles the internal queues. - + * console-msw.h: * event-msw.c: * event-msw.c (mswindows_unmodalize_signal_maybe): @@ -2277,7 +3273,7 @@ If in_modal_loop, only retrieve process and timeout events. Don't retrieve any X events because processing them can lead to reentrancy in lwlib -> death. - + * event-stream.c: * event-stream.c (check_event_stream_ok): * event-stream.c (event_stream_handle_magic_event): @@ -2296,7 +3292,7 @@ * event-stream.c (event_stream_next_event): Remove unused parameter to check_event_stream_ok() and change all callers. - + * lisp.h: * event-stream.c (maybe_do_auto_save): * event-stream.c (emacs_handle_focus_change_preliminary): @@ -2321,7 +3317,7 @@ not just if any are. Add parameter to detect_input_pending() for this. Change recursive_sit_for from a Lisp_Object (which could only be Qt or Qnil) to an int, like it should be. - + * event-Xt.c: * event-Xt.c (THIS_IS_X): * event-gtk.c: @@ -2333,7 +3329,7 @@ * event-msw.c (emacs_mswindows_event_pending_p): Implement HOW_MANY and only process events when not in_modal_loop. - + * event-tty.c: * event-tty.c (tty_timeout_to_emacs_event): * event-tty.c (emacs_tty_event_pending_p): @@ -2351,10 +3347,10 @@ presence of a fast auto-repeat (usually the auto-repeating is generated dynamically as necessary), and you get much better display behavior with lazy-lock active. - + * event-unixoid.c: Comment changes. - + * event-stream.c (command_event_p_cb): * event-stream.c (Fdiscard_input): Rewrite discard-input much more simply and safely using the @@ -2363,15 +3359,15 @@ SEMI-UNRELATED CHANGES: ----------------------- - + * event-stream.c (run_pre_idle_hook): Turn QUIT-checking back on when running the pre-idle hook so it can be quit out of. - + * indent.c: Document exact functioning of `vertical-motion' better, and its differences from GNU Emacs. - + 2003-02-06 Ben Wing <ben@xemacs.org> * unicode.c: @@ -2406,7 +3402,7 @@ * esd.c (esd_play_sound_data): Warning fixes. - + * fns.c: * fns.c (mark_bit_vector): * fns.c (Frequire): @@ -2414,7 +3410,7 @@ Eliminate bogus require-prints-loading-message; use already existent load-always-display-messages instead. Make sure `load' knows we are coming from `require'. - + * lread.c: * lread.c (READCHARFUN_MAYBE): * lread.c (Fload_internal): @@ -2518,7 +3514,7 @@ * ui-gtk.c: Fix typo from Ben's patch: emacs_ffi_data is a typedef, not a struct. emacs_gtk_object_data is a typedef, not a struct. - + * gtk-glue.c (gdk_event_to_emacs_event): Fix typos from Ben's patch: le -> emacs_event + rearrange the code. @@ -2538,7 +3534,7 @@ Major cleanup of KKCC, etc. KKCC, pdump-related: - + -- descriptions are written for all objects. this required some changes in the format of some objects, e.g. extents, popup-data, coding system, lstream, lcrecord-list. @@ -2582,7 +3578,7 @@ -- factor out some code duplicated in kkcc and pdump. Other allocation/object-related: - + -- change various *slots.h so MARKED_SLOT() call no longer includes semicolon. -- free_marker() takes a Lisp_Object not a direct pointer. @@ -2602,7 +3598,7 @@ the end, instead of a separate block holding the array. Error-checking-related: - + -- now can compile with C++ under MS Windows. clean up compile errors discovered that way. (a few were real problems) -- add C++ error-checking code to verify problems with mismatched @@ -2617,9 +3613,9 @@ when crashing or from debug_print(), and tries as hard as it reasonably can in other situations. -- Correct the message output upon crashing to be more up-to-date. - + Event-related: - + -- document event-matches-key-specifier-p better. -- generalize the dispatch queues formerly duplicated in the various event implementations. add event methods to drain pending @@ -2634,7 +3630,7 @@ MS Windows but not quite there yet. Other: - + -- class -> class_ and no more C++ games with this item. new -> new_ in the lwlib code, so far not elsewhere. -- use `struct htentry' not `struct hentry' in elhash.c to avoid @@ -3397,7 +4393,7 @@ * window.h (Fcurrent_window_configuration): Don't export anymore. (Qcurrent_window_configuration): Declare. (Qset_window_configuration): Declare. - * event-stream.c (execute_help_form): + * event-stream.c (execute_help_form): * bytecode.c (execute_rare_opcode): Call out to Lisp to save window excursion. * window.c (Qcurrent_window_configuration): Declare. @@ -3405,28 +4401,28 @@ (Vwindow_configuration_free_list): (Qset_window_configuration): (Qtemp_buffer_show_hook): - (struct saved_window): - (struct window_config): - (SAVED_WINDOW_N): - (XWINDOW_CONFIGURATION): - (wrap_window_configuration): - (WINDOW_CONFIGURATIONP): - (CHECK_WINDOW_CONFIGURATION): - (mark_window_config): - (sizeof_window_config_for_n_windows): - (sizeof_window_config): - (print_window_config): - (saved_window_equal): - (window_config_equal): - (Fwindow_configuration_p): - (mark_windows_in_use_closure): - (mark_windows_in_use): - (free_window_configuration): - (Fset_window_configuration): - (count_windows): - (saved_window_index): - (save_window_save): - (Fcurrent_window_configuration): + (struct saved_window): + (struct window_config): + (SAVED_WINDOW_N): + (XWINDOW_CONFIGURATION): + (wrap_window_configuration): + (WINDOW_CONFIGURATIONP): + (CHECK_WINDOW_CONFIGURATION): + (mark_window_config): + (sizeof_window_config_for_n_windows): + (sizeof_window_config): + (print_window_config): + (saved_window_equal): + (window_config_equal): + (Fwindow_configuration_p): + (mark_windows_in_use_closure): + (mark_windows_in_use): + (free_window_configuration): + (Fset_window_configuration): + (count_windows): + (saved_window_index): + (save_window_save): + (Fcurrent_window_configuration): (Fsave_window_excursion): Remove. (mark_window_as_deleted): Rectify comment about `set-window-configuration'. @@ -3468,10 +4464,10 @@ * eval.c (signal_call_debugger): Fix up C debugger entrance -- first output the error message, then stack trace, then exiting message, then force debugger. - + * frame-msw.c (mswindows_init_frame_1): Use EQ not EQUAL to avoid QUIT tripping. - + * toolbar-msw.c (mswindows_clear_toolbar): Indentation fixes. 2002-11-27 Ben Wing <ben@xemacs.org> @@ -3479,9 +4475,9 @@ * alloc.c: * alloc.c (garbage_collect_1): Better redisplay-related assert. - + * elhash.c (xhash_table): Comment change. - + * eval.c: * eval.c (signal_call_debugger): * eval.c (throw_or_bomb_out): @@ -3503,7 +4499,7 @@ and we are --debug. Better redisplay-related asserts. - + * frame-msw.c (mswindows_init_frame_1): * frame.c (enter_redisplay_critical_section): * lisp.h: @@ -3516,7 +4512,7 @@ Fix up documentation related to QUIT (which CANNOT garbage-collect under any circumstances), and to redisplay critical sections. - + * lread.c: * lread.c (Fload_internal): * lread.c (PRINT_LOADING_MESSAGE_1): @@ -3526,7 +4522,7 @@ Add load-ignore-out-of-date-elc-files, load-always-display-messages, load-show-full-path-in-messages for more robust package compilation and debugging. - + * profile.c: * profile.c (create_call_count_profile_table): * profile.c (profile_increase_call_count): @@ -3544,7 +4540,7 @@ Add set-profiling-info. See related profile.el changes (which SHOULD ABSOLUTELY be in the core! Get rid of xemacs-devel and xemacs-base packages *yesterday*!). - + 2002-11-22 Ben Wing <ben@xemacs.org> * fileio.c: Fix crashes due to incorrectly ported code from @@ -3569,53 +4565,53 @@ * emodules.h: Fix warnings from redefining symbols. - + * eval.c: * eval.c (call_with_condition_handler): * eval.c (run_post_gc_hook): * eval.c (Ffuncall): Fix C++ errors -- no automatic casting between function pointers and void *, function declarations inside of functions not allowed. - + * event-Xt.c (emacs_Xt_enqueue_focus_event): Warning fixes. - + * fileio.c (Ffile_truename): Warning fixes. Use LOCAL_TO_WIN32_FILE_FORMAT rather than duplicating it. - + * glyphs-x.c: * glyphs-x.c (x_map_subwindow): Fix style. - + * intl-auto-encap-win32.c: * intl-auto-encap-win32.h: * intl-encap-win32.c: * intl-encap-win32.c (qxeRegConnectRegistry): * syswindows.h (RegConnectRegistry): DdeCreateStringHandle needs to be manual due to new Cygwin bug. - + * intl-win32.c: * intl-win32.c (wcscmp): * intl-win32.c (wcslen): wcslen/wcscmp don't seem to exist under G++ 3, Cygwin. - + * lisp.h: * lisp-union.h: * lisp-disunion.h: * process-unix.c (unix_send_process): Ugh, C needs volatile and C++ must not have volatile. Remove previous volatile hacks, which don't seem to be working any more. - + * sheap.c (STATIC_HEAP_SLOP): Try to get a working Cygwin build with old unexec. - + * sheap.c (more_static_core): No NL's in literals allowed. - + * symbols.c (Fset): Fix C++ errors. - + * syswindows.h: * syswindows.h (struct): * syswindows.h (tagNMDATETIMEFORMATW): @@ -3704,8 +4700,8 @@ 2002-09-09 Stephen J. Turnbull <stephen@xemacs.org> * search.c (clear_unused_search_regs): New static function. - (search_buffer): - (simple_search): + (search_buffer): + (simple_search): (boyer_moore): Use it. Fixes "stale match data" bug reported by Martin Stjernholm. Minor clarifications in comments. @@ -3812,7 +4808,7 @@ (big5_detect): It was made not to become the trouble of EUC. (iso2022_detector): Add member 'longest_even_high_byte'. (iso2022_detect): Fix checking for even/odd_high_byte_group. - The judgment of EUC is changed. + The judgment of EUC is changed. * unicode.c: Add DETECTOR_CATEGORY utf_8_bom. (utf_8_detector): Add member byteno, first_byte and second_byte. @@ -3946,7 +4942,7 @@ 2002-08-03 Brian A Palmer <bpalmer@rescomp.Stanford.EDU> * fns.c (Fsplit_string_by_char): Make 2nd arg SEPCHAR a required - argument. + argument. 2002-08-03 Steve Youngs <youngs@xemacs.org> @@ -3971,15 +4967,15 @@ 2002-07-31 David Bush <David.Bush@intel.com> - * eldap.c: Add the dumpable-flag to the USE_KKCC version of + * eldap.c: Add the dumpable-flag to the USE_KKCC version of DEFINE_LRECORD_IMPLEMENTATION for "ldap" 2002-08-01 Mike Sperber <mike@xemacs.org> * event-stream.c: - * event-Xt.c: - * events.h: - * events.c: + * event-Xt.c: + * events.h: + * events.c: * alloc.c: Fix various kkcc-related nits that show up in MULE and union-type builds. @@ -4002,7 +4998,7 @@ Mike Sperber <mike@xemacs.org> configure flag to turn these changes on: --use-kkcc - + First we added a dumpable flag to lrecord_implementation. It shows, if the object is dumpable and should be processed by the dumper. * lrecord.h (struct lrecord_implementation): added dumpable flag @@ -4011,17 +5007,17 @@ Then we changed mark_object, that it no longer needs a mark method for those types that have pdump descritions. - * alloc.c: + * alloc.c: (mark_object): If the object has a description, the new mark algorithm - is called, and the object is marked according to its description. + is called, and the object is marked according to its description. Otherwise it uses the mark method like before. - - These procedures mark objects according to their descriptions. They + + These procedures mark objects according to their descriptions. They are modeled on the corresponding pdumper procedures. - (mark_with_description): - (get_indirect_count): - (structure_size): - (mark_struct_contents): + (mark_with_description): + (get_indirect_count): + (structure_size): + (mark_struct_contents): These procedures still call mark_object, this is needed while there are Lisp_Objects without descriptions left. @@ -4050,22 +5046,22 @@ * event-gtk.c: * event-tty.c: To write a pdump description for Lisp_Event, we converted every struct - in the union event to a Lisp_Object. So we created nine new + in the union event to a Lisp_Object. So we created nine new Lisp_Objects: Lisp_Key_Data, Lisp_Button_Data, Lisp_Motion_Data, - Lisp_Process_Data, Lisp_Timeout_Data, Lisp_Eval_Data, + Lisp_Process_Data, Lisp_Timeout_Data, Lisp_Eval_Data, Lisp_Misc_User_Data, Lisp_Magic_Data, Lisp_Magic_Eval_Data. - We also wrote makro selectors and mutators for the fields of the new + We also wrote makro selectors and mutators for the fields of the new designed Lisp_Event and added everywhere these new abstractions. We implemented XD_UNION support in (mark_with_description), so we can describe exspecially console/device specific data with XD_UNION. - To describe with XD_UNION, we added a field to these objects, which - holds the variant type of the object. This field is initialized in - the appendant constructor. The variant is an integer, it has also to + To describe with XD_UNION, we added a field to these objects, which + holds the variant type of the object. This field is initialized in + the appendant constructor. The variant is an integer, it has also to be described in an description, if XD_UNION is used. - XD_UNION is used in following descriptions: + XD_UNION is used in following descriptions: * console.c: console_description (get_console_variant): returns the variant (create_console): added variant initialization @@ -4232,10 +5228,10 @@ * device-msw.c (mswindows_delete_device): Initialise extra DDE strings for remote execution, and change DDE initialisation to send ADVISE and REQUEST notifications. - + * emacs.c (main_1): Add symbols of event_mswindows. - + * event-msw.c: * event-msw.c (mswindows_dde_callback): * event-msw.c (reinit_vars_of_event_mswindows): @@ -4263,7 +5259,7 @@ appears to freeze after switching desktops with certain virtual window managers. (debug_output_mswin_message): Added code to output message - parameters for WM_WINDOWPOSCHANGED, + parameters for WM_WINDOWPOSCHANGED, WM_WINDOWPOSCHANGING, WM_MOVE, and WM_SIZE messages. 2002-07-05 Jonathan Harris <jonathan@xemacs.org> @@ -4271,7 +5267,7 @@ * emacs.c (main_1): Conditionalise calls to syms_of_dired_mswindows() and vars_of_dired_mswindows() on WIN32_NATIVE instead of redundant HAVE_MSW_C_DIRED - + 2002-07-03 Mike Sperber <mike@xemacs.org> * emacs.c (main_1): We need to call init_ralloc twice for PDUMP, @@ -4316,17 +5312,17 @@ * lrecord.h (lrecord_type): add lrecord_type_ephemeron to lrecord_type enumeration. - * lisp.h (XEPHEMERON): - (XEPHEMERON_REF): - (XEPHEMERON_NEXT): - (XEPHEMERON_FINALIZER): - (XSET_EPHEMERON_NEXT): - (XSET_EPHEMERON_VALUE): - (XSET_EPHEMERON_KEY): - (wrap_ephemeron): - (EPHEMERONP): - (CHECK_EPHEMERON): - (CONCHECK_EPHEMERON): + * lisp.h (XEPHEMERON): + (XEPHEMERON_REF): + (XEPHEMERON_NEXT): + (XEPHEMERON_FINALIZER): + (XSET_EPHEMERON_NEXT): + (XSET_EPHEMERON_VALUE): + (XSET_EPHEMERON_KEY): + (wrap_ephemeron): + (EPHEMERONP): + (CHECK_EPHEMERON): + (CONCHECK_EPHEMERON): (struct ephemeron): Add representation of ephemerons. * alloc.c (garbage_collect_1): @@ -4353,7 +5349,7 @@ and objects-impl.h to pick up some error_check_* functions. Remove console.h, extents.h, frame.h and objects.h because the *-impl.h files include them. - + 2002-06-17 Jerry James <james@xemacs.org> * sysdll.c: Remove RTLD_GLOBAL initialization. @@ -4374,7 +5370,7 @@ (Fparse_unicode_translation_table): Use right function name in error. (unicode_to_ichar): Renamed from unicode_to_char. - (Funicode_to_char): + (Funicode_to_char): (decode_unicode_char): Use new name. @@ -4418,7 +5414,7 @@ * console.h: Define opaque console_methods to unbreak the build. - * objects.c (initialize_charset_font_caches): + * objects.c (initialize_charset_font_caches): (invalidate_charset_font_caches): Only define if we're MULE. (font_instantiate): Unbreak for non-MULE. @@ -4427,7 +5423,7 @@ * s/cygwin32.h: Allow pdump to work under Cygwin (mmap is broken, so need to undefine HAVE_MMAP). - + * s/win32-common.h: * s/win32-common.h (NO_MATHERR): * s/windowsnt.h: @@ -4733,7 +5729,7 @@ * toolbar-msw.c: * unicode.c: Warning fixes. - + * config.h.in: #undefs meant to be frobbed by configure *MUST* go inside of #ifndef WIN32_NO_CONFIGURE, and everything else *MUST* go outside! @@ -4742,9 +5738,9 @@ Let detailed backtraces be detailed. * specifier.c: Don't override user's print-string-length/print-length settings. - + * glyphs.c: New function image-instance-instantiator. - + * config.h.in: * sysdep.c (set_descriptor_non_blocking): * sysdep.c (SIG_PARAM_TYPE): @@ -5629,23 +6625,23 @@ the pointer itself and when it refers to operations on text; and [b] use consistent naming for everything referring to internal format, i.e. - + Itext == text in internal format Ibyte == a byte in such text Ichar == a char as represented in internal character format - + thus e.g. - + set_charptr_emchar -> set_itext_ichar The pre and post tags on either side of this change are: - + pre-internal-format-textual-renaming post-internal-format-textual-renaming See the Internals Manual for details of exactly how this was done, how to handle the change in your workspace, etc. - + 2002-06-04 Andy Piper <andy@xemacs.org> * glyphs-widget.c (widget_logical_unit_height): don't try and @@ -5806,7 +6802,7 @@ * buffer.c (init_initial_directory): Fix bug noted by someone. - + * console-tty.h: * device.h (struct device): * emacs.c: @@ -5823,13 +6819,13 @@ -- rather than require one included before the other (error-prone), just include syssignal.h from sysproc.h where it's needed. - + * inline.c: Include sysfile.h due to inline funs in that header. - + * extents.c (Fset_extent_parent): Fix bug noted by Andrew Cohen <cohen@andy.bu.edu>. - + * process-unix.c (unix_open_network_stream): * process-unix.c (unix_open_multicast_group): Fix other bug noted by Andrew Cohen <cohen@andy.bu.edu>. @@ -5844,18 +6840,18 @@ * alloc.c (garbage_collect_1): Call prune_weak_boxes(). - * lisp.h (struct weak_box): - * data.c: - (prune_weak_boxes): - (mark_weak_box): - (print_weak_box): - (weak_box_equal): - (weak_box_hash): - (make_weak_box): - (Fmake_weak_box): - (Fweak_box_ref): - (Fweak_boxp): - (syms_of_data): + * lisp.h (struct weak_box): + * data.c: + (prune_weak_boxes): + (mark_weak_box): + (print_weak_box): + (weak_box_equal): + (weak_box_hash): + (make_weak_box): + (Fmake_weak_box): + (Fweak_box_ref): + (Fweak_boxp): + (syms_of_data): (vars_of_data): Add implementation of weak boxes. 2002-05-29 Ben Wing <ben@xemacs.org> @@ -7572,7 +8568,7 @@ * s/darwin.h: New file. Thanks to Greg Parker <gparker@cs.stanford.edu>. - + 2002-04-23 Andreas Jaeger <aj@suse.de> * s/linux.h (LIB_STANDARD): Define correctly for x86-64 and s390x @@ -7581,7 +8577,7 @@ 2002-02-11 Mike Sperber <mike@xemacs.org> - * device-x.c: + * device-x.c: (x_IO_error_handler): (x_init_device): Temporarily keep device in static variable `device_being_initialized' so we can recover gracefully from @@ -7629,7 +8625,7 @@ 2001-12-23 William M. Perry <wmperry@gnu.org> * menubar-gtk.c (gtk_popup_menu) Add sanity checks, fix crash. - + 2002-01-04 Martin Buchholz <martin@xemacs.org> * keymap.c (define_key_alternate_name): Parenthesize EQ. @@ -10851,7 +11847,7 @@ See the Internals Manual, under Major Type Changes, and also README.global-renaming. - + 2001-09-17 Ben Wing <ben@xemacs.org> diff --text -u 'xemacs-21.5.17/src/EmacsFrame.c' 'xemacs-21.5.18/src/EmacsFrame.c' Index: ./src/EmacsFrame.c --- ./src/EmacsFrame.c Fri Jun 21 06:18:20 2002 +++ ./src/EmacsFrame.c Tue Sep 21 04:19:34 2004 @@ -266,8 +266,8 @@ } static void -EmacsFrameInitialize (Widget request, Widget new, - ArgList dum1, Cardinal *dum2) +EmacsFrameInitialize (Widget UNUSED (request), Widget new, + ArgList UNUSED (unused1), Cardinal *UNUSED (unused2)) { EmacsFrame ew = (EmacsFrame)new; struct frame *f = ew->emacs_frame.frame; @@ -376,8 +376,8 @@ } static Boolean -EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, - ArgList argv, Cardinal *argc) +EmacsFrameSetValues (Widget cur_widget, Widget UNUSED (req_widget), + Widget new_widget, ArgList argv, Cardinal *argc) { EmacsFrame cur = (EmacsFrame) cur_widget; EmacsFrame new = (EmacsFrame) new_widget; @@ -558,10 +558,10 @@ /* ARGSUSED */ static void -Xt_StringToScrollBarPlacement (XrmValuePtr args, /* unused */ - Cardinal *num_args, /* unused */ - XrmValuePtr fromVal, - XrmValuePtr toVal) +Xt_StringToScrollBarPlacement (XrmValuePtr UNUSED (args), + Cardinal *UNUSED (num_args), + XrmValuePtr fromVal, + XrmValuePtr toVal) { XrmQuark q; char *lowerName = (char *) ALLOCA (strlen ((char *) fromVal->addr) + 1); diff --text -u 'xemacs-21.5.17/src/EmacsManager.c' 'xemacs-21.5.18/src/EmacsManager.c' Index: ./src/EmacsManager.c --- ./src/EmacsManager.c Thu Feb 20 17:19:40 2003 +++ ./src/EmacsManager.c Tue Sep 21 04:19:34 2004 @@ -31,6 +31,7 @@ #include "xmotif.h" #include <Xm/RowColumn.h> #endif /* LWLIB_MENUBARS_MOTIF */ +#include "compiler.h" /* For I, Emacs, am a kind god. Unlike the goddess Athena and the Titan Motif, I require no ritual sacrifices to placate the lesser @@ -178,7 +179,8 @@ } static XtGeometryResult -GeometryManager (Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) +GeometryManager (Widget w, XtWidgetGeometry *request, + XtWidgetGeometry *UNUSED (reply)) { /* Sure, any changes are fine. */ diff --text -u 'xemacs-21.5.17/src/ExternalClient-Xlib.c' 'xemacs-21.5.18/src/ExternalClient-Xlib.c' Index: ./src/ExternalClient-Xlib.c --- ./src/ExternalClient-Xlib.c Thu Dec 19 07:44:06 1996 +++ ./src/ExternalClient-Xlib.c Wed Jun 2 18:16:20 2004 @@ -59,10 +59,10 @@ Status st; Window root_win, parent_win; Window *child_win; - int nchild; + unsigned int nchild; - st = XQueryTree(display, win, &root_win, &parent_win, &child_win, - &nchild); + st = XQueryTree (display, win, &root_win, &parent_win, &child_win, + &nchild); if (!st) return False; XFree((XPointer)child_win); @@ -75,7 +75,7 @@ while (1); } - + /* External entry points when using XLib directly */ void ExternalClientInitialize (Display *display, Window win); @@ -100,7 +100,7 @@ { if (win != event->xany.window) return; - + if (event->type == ClientMessage && event->xclient.message_type == a_EXTW_NOTIFY && event->xclient.data.l[0] == extw_shell_send) @@ -109,11 +109,11 @@ /* for the moment, just refuse geometry requests. */ extw_send_notify_3(display, win, extw_notify_gm, XtGeometryNo, 0, 0); break; - + case extw_notify_init: extw_send_notify_3(display, win, extw_notify_init, EXTW_TYPE_XLIB, 0, 0); break; - + case extw_notify_end: XClearArea(display, win, 0, 0, 0, 0, True); break; diff --text -u 'xemacs-21.5.17/src/ExternalClient.c' 'xemacs-21.5.18/src/ExternalClient.c' Index: ./src/ExternalClient.c --- ./src/ExternalClient.c Tue Nov 12 00:34:13 2002 +++ ./src/ExternalClient.c Wed Sep 22 12:04:44 2004 @@ -42,6 +42,7 @@ # include <X11/StringDefs.h> #endif +#include "compiler.h" #include "ExternalClientP.h" #include "extw-Xt.h" @@ -173,8 +174,8 @@ WidgetClass externalClientWidgetClass = (WidgetClass) &externalClientClassRec; static void -externalClientInitialize (Widget req, Widget new, ArgList args, - Cardinal *num_args) +externalClientInitialize (Widget UNUSED (req), Widget new, + ArgList UNUSED (args), Cardinal *UNUSED (num_args)) { ExternalClientWidget ecw = (ExternalClientWidget) new; static int error_handler_added = 0; @@ -217,7 +218,7 @@ #ifdef TOOLTALK static Tt_callback_action -tt_callback(Tt_message m, Tt_pattern p) +tt_callback(Tt_message m, Tt_pattern UNUSED (p)) { ExternalClientWidget ecw = (ExternalClientWidget)tt_message_user (m, 0); @@ -337,10 +338,9 @@ /* stolen outright from Intrinsic.c */ -static void ComputeWindowAttributes(widget,value_mask,values) - Widget widget; - XtValueMask *value_mask; - XSetWindowAttributes *values; +static void +ComputeWindowAttributes (Widget widget, XtValueMask *value_mask, + XSetWindowAttributes *values) { *value_mask = CWEventMask | CWColormap; (*values).event_mask = XtBuildEventMask(widget); @@ -401,9 +401,8 @@ } static void -MaskableEventHandler (Widget wid, XtPointer closure, XEvent *event, - Boolean *continue_to_dispatch) - /* closure and continue_to_dispatch unused */ +MaskableEventHandler (Widget wid, XtPointer UNUSED (closure), XEvent *event, + Boolean *UNUSED (continue_to_dispatch)) { ExternalClientWidget w = (ExternalClientWidget) wid; @@ -433,9 +432,8 @@ } static void -EventHandler (Widget wid, XtPointer closure, XEvent *event, - Boolean *continue_to_dispatch) - /* closure and continue_to_dispatch unused */ +EventHandler (Widget wid, XtPointer UNUSED (closure), XEvent *event, + Boolean *UNUSED (continue_to_dispatch)) { ExternalClientWidget w = (ExternalClientWidget) wid; @@ -511,19 +509,17 @@ } } -static void Destroy(wid) - Widget wid; +static void Destroy (Widget wid) { ExternalClientWidget w = (ExternalClientWidget)wid; NOTIFY(w, extw_notify_end, 0, 0, 0); } -static XtGeometryResult QueryGeometry(gw, request, reply) - Widget gw; - XtWidgetGeometry *request, *reply; +static XtGeometryResult +QueryGeometry (Widget gw, XtWidgetGeometry *request, XtWidgetGeometry *reply) { - ExternalClientWidget w = (ExternalClientWidget)gw; + ExternalClientWidget w = (ExternalClientWidget) gw; XEvent event; unsigned long request_num; Display *display = XtDisplay(gw); @@ -557,8 +553,15 @@ } } -static void ExternalClientFocusIn (Widget w, XEvent *event, String *params, - Cardinal *num_params) +#ifdef EXTW_USES_MOTIF +# define USED_IF_MOTIF(decl) decl +#else +# define USED_IF_MOTIF(decl) UNUSED (decl) +#endif + +static void ExternalClientFocusIn (Widget w, XEvent *event, + String *USED_IF_MOTIF (params), + Cardinal *USED_IF_MOTIF (num_params)) { ExternalClientWidget ecw = (ExternalClientWidget) w; @@ -571,8 +574,9 @@ #endif } -static void ExternalClientFocusOut (Widget w, XEvent *event, String *params, - Cardinal *num_params) +static void ExternalClientFocusOut (Widget w, XEvent *event, + String *USED_IF_MOTIF (params), + Cardinal *USED_IF_MOTIF (num_params)) { ExternalClientWidget ecw = (ExternalClientWidget) w; @@ -585,8 +589,9 @@ #endif } -static void ExternalClientEnter (Widget w, XEvent *event, String *params, - Cardinal *num_params) +static void ExternalClientEnter (Widget w, XEvent *event, + String *USED_IF_MOTIF (params), + Cardinal *USED_IF_MOTIF (num_params)) { ExternalClientWidget ecw = (ExternalClientWidget) w; @@ -604,8 +609,9 @@ #endif } -static void ExternalClientLeave (Widget w, XEvent *event, String *params, - Cardinal *num_params) +static void ExternalClientLeave (Widget w, XEvent *event, + String *USED_IF_MOTIF (params), + Cardinal *USED_IF_MOTIF (num_params)) { ExternalClientWidget ecw = (ExternalClientWidget) w; diff --text -u 'xemacs-21.5.17/src/ExternalShell.c' 'xemacs-21.5.18/src/ExternalShell.c' Index: ./src/ExternalShell.c --- ./src/ExternalShell.c Sun Jun 23 18:54:40 2002 +++ ./src/ExternalShell.c Wed Sep 22 12:04:44 2004 @@ -56,6 +56,7 @@ #include <X11/ShellP.h> #include <X11/Vendor.h> #include <X11/VendorP.h> +#include "compiler.h" #include "ExternalShellP.h" #include "extw-Xt.h" @@ -158,8 +159,9 @@ *attr); static void ExternalShellDestroy (Widget w); static void ChangeManaged (Widget wid); -static XtGeometryResult ExternalShellRootGeometryManager (Widget gw, - XtWidgetGeometry *request, XtWidgetGeometry *reply); +static XtGeometryResult +ExternalShellRootGeometryManager (Widget gw, XtWidgetGeometry *request, + XtWidgetGeometry *reply); static void EventHandler (Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch); @@ -250,8 +252,8 @@ WidgetClass externalShellWidgetClass = (WidgetClass) &externalShellClassRec; static void -ExternalShellInitialize (Widget req, Widget new, ArgList args, - Cardinal *num_args) +ExternalShellInitialize (Widget req, Widget new, ArgList UNUSED (args), + Cardinal *UNUSED (num_args)) { XtAddEventHandler(new, 0, TRUE, EventHandler, (XtPointer) NULL); @@ -275,11 +277,9 @@ # define XtCXtToolkitError "XtToolkitError" #endif -static void EventHandler(wid, closure, event, continue_to_dispatch) - Widget wid; - XtPointer closure; /* unused */ - XEvent *event; - Boolean *continue_to_dispatch; /* unused */ +static void EventHandler (Widget wid, XtPointer UNUSED (closure), + XEvent *event, + Boolean *UNUSED (continue_to_dispatch)) { ExternalShellWidget w = (ExternalShellWidget) wid; @@ -365,7 +365,7 @@ /* Lifted almost entirely from GetGeometry() in Shell.c */ static void -GetGeometry (Widget W, Widget child) +GetGeometry (Widget W, Widget UNUSED (child)) { ExternalShellWidget w = (ExternalShellWidget)W; int x, y, win_gravity = -1, flag; @@ -498,8 +498,7 @@ } -static void ExternalShellDestroy(wid) - Widget wid; +static void ExternalShellDestroy (Widget wid) { ExternalShellWidget w = (ExternalShellWidget)wid; @@ -512,8 +511,7 @@ /* Invoke matching routine from superclass, but first override its geometry opinions with our own routine */ -static void ChangeManaged(wid) - Widget wid; +static void ChangeManaged (Widget wid) { if (!XtIsRealized (wid)) GetGeometry(wid, (Widget)NULL); @@ -523,9 +521,9 @@ /* Based on RootGeometryManager() in Shell.c */ -static XtGeometryResult ExternalShellRootGeometryManager(gw, request, reply) - Widget gw; - XtWidgetGeometry *request, *reply; +static XtGeometryResult +ExternalShellRootGeometryManager (Widget gw, XtWidgetGeometry *request, + XtWidgetGeometry *reply) { ExternalShellWidget w = (ExternalShellWidget)gw; unsigned int mask = request->request_mode; diff --text -u 'xemacs-21.5.17/src/Makefile.in.in' 'xemacs-21.5.18/src/Makefile.in.in' Index: ./src/Makefile.in.in --- ./src/Makefile.in.in Wed Jan 28 20:20:42 2004 +++ ./src/Makefile.in.in Fri Sep 10 20:58:33 2004 @@ -204,6 +204,13 @@ mule_wnn_objs=mule-wnnfns.o #endif +#ifdef WITH_GMP +number_objs=number-gmp.o number.o +#endif +#ifdef WITH_MP +number_objs=number-mp.o number.o +#endif + #if defined(HAVE_POSTGRESQL) && !defined(HAVE_SHLIB) postgresql_objs=$(BLDMODULES)/postgresql/postgresql.o #endif @@ -268,8 +275,8 @@ hash.o imgproc.o indent.o insdel.o intl.o\ keymap.o $(RTC_patch_objs) line-number.o $(ldap_objs) lread.o lstream.o\ macros.o marker.o md5.o minibuf.o $(mswindows_objs) $(mswindows_gui_objs)\ - $(mule_objs) $(mule_canna_objs) $(mule_wnn_objs) objects.o opaque.o\ - $(postgresql_objs) print.o process.o $(process_objs) $(profile_objs)\ + $(mule_objs) $(mule_canna_objs) $(mule_wnn_objs) $(number_objs) objects.o\ + opaque.o $(postgresql_objs) print.o process.o $(process_objs) $(profile_objs)\ rangetab.o realpath.o redisplay.o redisplay-output.o regex.o\ search.o select.o $(sheap_objs) $(shlib_objs) signal.o sound.o\ specifier.o strftime.o $(sunpro_objs) symbols.o syntax.o sysdep.o\ @@ -410,6 +417,10 @@ DUMP_TARGET = $(PROGNAME).dmp RAW_EXE = $(PROGNAME) DUMP_ID = dump-id.o +#ifndef WIN32_NATIVE +DUMP_TARGET = $(PROGNAME) +RAW_EXE = temacs +#endif #else DUMP_TARGET = $(PROGNAME) RAW_EXE = temacs @@ -510,33 +521,37 @@ #ifdef HAVE_X_WINDOWS lwlib_deps = $(lwlib_lib) $(lwlib_lib): - cd ../lwlib && $(RECURSIVE_MAKE) + +cd ../lwlib && $(RECURSIVE_MAKE) #endif /* HAVE_X_WINDOWS */ #ifdef DYNODUMP dynodump_deps = ../dynodump/dynodump.so ../dynodump/dynodump.so: - cd ../dynodump && $(RECURSIVE_MAKE) + +cd ../dynodump && $(RECURSIVE_MAKE) #endif /* DYNODUMP */ link_deps = $(start_files) $(objs) $(otherobjs) $(lwlib_deps) $(dynodump_deps) $(LIB_SRC)/make-dump-id: - cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-dump-id + +cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-dump-id dump-id.c: $(LIB_SRC)/make-dump-id $(link_deps) $(LIB_SRC)/make-dump-id ## (2) Link the XEmacs executable -temacs_deps = $(link_deps) $(DUMP_ID) - -temacs_link_args = \ - $(start_flags) $(ldflags) \ - -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) $(LIBES) - -$(RAW_EXE): $(temacs_deps) - $(LD) $(temacs_link_args) +#if !defined(PDUMP) || defined(WIN32_NATIVE) +$(RAW_EXE): $(link_deps) $(DUMP_ID) + $(LD) $(start_flags) $(ldflags) -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) $(LIBES) +#else +$(RAW_EXE): $(link_deps) $(DUMP_ID) + if test -f dump-size ; then \ + $(CC) -c $(cflags) -DMAX_SIZE=`cat dump-size` $(SRC)/dump-data.c ;\ + else \ + $(CC) -c $(cflags) -DMAX_SIZE=0 $(SRC)/dump-data.c ;\ + fi + $(LD) $(start_flags) $(ldflags) -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) dump-data.o $(LIBES) +#endif ## (3) Update the .elc's needed for dumping @@ -554,7 +569,7 @@ obj_src = $(objs:.o=.c) $(LIB_SRC)/make-docfile: - cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-docfile + +cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-docfile $(LIB_SRC)/DOC: $(LIB_SRC)/make-docfile $(BLDSRC)/NEEDTODUMP $(temacs_deps) #ifdef QUICK_BUILD @@ -579,6 +594,26 @@ @$(RM) $@ $(dump_temacs) #endif +#if defined(PDUMP) && !defined(WIN32_NATIVE) + if test -f dump-size; then \ + $(LIB_SRC)/insert-data-in-exec $(RAW_EXE) $(DUMP_TARGET).dmp $(DUMP_TARGET) `$(DO_TEMACS) -si`; \ + ret=$$? ; \ + if test $${ret} -eq 2; then \ + $(RM) dump-size ; \ + else \ + if test $${ret} -eq 1; then \ + exit 1; \ + else \ + chmod +x $(DUMP_TARGET) ; \ + fi ; \ + fi ; \ + fi + if ! test -f dump-size; then \ + $(LIB_SRC)/insert-data-in-exec -s $(DUMP_TARGET).dmp > dump-size ; \ + $(RM) dump-data.o $(DUMP_TARGET) $(DUMP_TARGET).dmp $(RAW_EXE);\ + $(RECURSIVE_MAKE) $@; \ + fi +#endif ## (6) Update the remaining .elc's, post-dumping @@ -590,6 +625,7 @@ $(LISP)/finder-inf.el: update-elc-2 @echo "Building finder database ..." + $(RM) $(LISP)/finder-inf.el $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \ -l finder -f finder-compile-keywords @echo "Building finder database ...(done)" @@ -618,7 +654,7 @@ .PHONY: all-elc all-elc: - cd .. && $(RECURSIVE_MAKE) + +cd .. && $(RECURSIVE_MAKE) ######################################################################### ## Subsidiary dependency rules ## @@ -646,10 +682,10 @@ cd $(LIB_SRC)/ && $(msgfmt) -o emacs.mo emacs.po $(LIB_SRC)/make-msgfile: - cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-msgfile + +cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-msgfile $(LIB_SRC)/make-po: - cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-po + +cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-po #endif /* I18N3 */ diff --text -u 'xemacs-21.5.17/src/alloc.c' 'xemacs-21.5.18/src/alloc.c' Index: ./src/alloc.c --- ./src/alloc.c Fri Mar 19 11:59:10 2004 +++ ./src/alloc.c Tue Sep 21 04:19:34 2004 @@ -645,8 +645,8 @@ may be more efficient when there are only a small number of them. The types that are stored in these large blocks (or "frob blocks") - are cons, float, compiled-function, symbol, marker, extent, event, - and string. + are cons, all number types except fixnum, compiled-function, symbol, + marker, extent, event, and string. Note that strings are special in that they are actually stored in two parts: a structure containing information about the string, and @@ -1163,6 +1163,8 @@ /* Float allocation */ /************************************************************************/ +/*** With enhanced number support, these are short floats */ + DECLARE_FIXED_TYPE_ALLOC (float, Lisp_Float); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_float 1000 @@ -1184,6 +1186,124 @@ /************************************************************************/ +/* Enhanced number allocation */ +/************************************************************************/ + +/*** Bignum ***/ +#ifdef HAVE_BIGNUM +DECLARE_FIXED_TYPE_ALLOC (bignum, Lisp_Bignum); +#define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_bignum 250 + +/* WARNING: This function returns a bignum even if its argument fits into a + fixnum. See Fcanonicalize_number(). */ +Lisp_Object +make_bignum (long bignum_value) +{ + Lisp_Bignum *b; + + ALLOCATE_FIXED_TYPE (bignum, Lisp_Bignum, b); + set_lheader_implementation (&b->lheader, &lrecord_bignum); + bignum_init (bignum_data (b)); + bignum_set_long (bignum_data (b), bignum_value); + return wrap_bignum (b); +} + +/* WARNING: This function returns a bignum even if its argument fits into a + fixnum. See Fcanonicalize_number(). */ +Lisp_Object +make_bignum_bg (bignum bg) +{ + Lisp_Bignum *b; + + ALLOCATE_FIXED_TYPE (bignum, Lisp_Bignum, b); + set_lheader_implementation (&b->lheader, &lrecord_bignum); + bignum_init (bignum_data (b)); + bignum_set (bignum_data (b), bg); + return wrap_bignum (b); +} +#endif /* HAVE_BIGNUM */ + +/*** Ratio ***/ +#ifdef HAVE_RATIO +DECLARE_FIXED_TYPE_ALLOC (ratio, Lisp_Ratio); +#define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_ratio 250 + +Lisp_Object +make_ratio (long numerator, unsigned long denominator) +{ + Lisp_Ratio *r; + + ALLOCATE_FIXED_TYPE (ratio, Lisp_Ratio, r); + set_lheader_implementation (&r->lheader, &lrecord_ratio); + ratio_init (ratio_data (r)); + ratio_set_long_ulong (ratio_data (r), numerator, denominator); + ratio_canonicalize (ratio_data (r)); + return wrap_ratio (r); +} + +Lisp_Object +make_ratio_bg (bignum numerator, bignum denominator) +{ + Lisp_Ratio *r; + + ALLOCATE_FIXED_TYPE (ratio, Lisp_Ratio, r); + set_lheader_implementation (&r->lheader, &lrecord_ratio); + ratio_init (ratio_data (r)); + ratio_set_bignum_bignum (ratio_data (r), numerator, denominator); + ratio_canonicalize (ratio_data (r)); + return wrap_ratio (r); +} + +Lisp_Object +make_ratio_rt (ratio rat) +{ + Lisp_Ratio *r; + + ALLOCATE_FIXED_TYPE (ratio, Lisp_Ratio, r); + set_lheader_implementation (&r->lheader, &lrecord_ratio); + ratio_init (ratio_data (r)); + ratio_set (ratio_data (r), rat); + return wrap_ratio (r); +} +#endif /* HAVE_RATIO */ + +/*** Bigfloat ***/ +#ifdef HAVE_BIGFLOAT +DECLARE_FIXED_TYPE_ALLOC (bigfloat, Lisp_Bigfloat); +#define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_bigfloat 250 + +/* This function creates a bigfloat with the default precision if the + PRECISION argument is zero. */ +Lisp_Object +make_bigfloat (double float_value, unsigned long precision) +{ + Lisp_Bigfloat *f; + + ALLOCATE_FIXED_TYPE (bigfloat, Lisp_Bigfloat, f); + set_lheader_implementation (&f->lheader, &lrecord_bigfloat); + if (precision == 0UL) + bigfloat_init (bigfloat_data (f)); + else + bigfloat_init_prec (bigfloat_data (f), precision); + bigfloat_set_double (bigfloat_data (f), float_value); + return wrap_bigfloat (f); +} + +/* This function creates a bigfloat with the precision of its argument */ +Lisp_Object +make_bigfloat_bf (bigfloat float_value) +{ + Lisp_Bigfloat *f; + + ALLOCATE_FIXED_TYPE (bigfloat, Lisp_Bigfloat, f); + set_lheader_implementation (&f->lheader, &lrecord_bigfloat); + bigfloat_init_prec (bigfloat_data (f), bigfloat_get_prec (float_value)); + bigfloat_set (bigfloat_data (f), float_value); + return wrap_bigfloat (f); +} +#endif /* HAVE_BIGFLOAT */ + +/************************************************************************/ /* Vector allocation */ /************************************************************************/ @@ -1916,7 +2036,7 @@ } static int -string_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +string_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) { Bytecount len; return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) && @@ -3412,7 +3532,13 @@ seen yet, recursively mark all the references contained in it. */ void -mark_object (Lisp_Object obj) +mark_object ( +#ifdef USE_KKCC + Lisp_Object UNUSED (obj) +#else + Lisp_Object obj +#endif + ) { #ifdef USE_KKCC /* this code should never be reached when configured for KKCC */ @@ -3786,6 +3912,39 @@ SWEEP_FIXED_TYPE_BLOCK (float, Lisp_Float); } +#ifdef HAVE_BIGNUM +static void +sweep_bignums (void) +{ +#define UNMARK_bignum(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) +#define ADDITIONAL_FREE_bignum(ptr) bignum_fini (ptr->data) + + SWEEP_FIXED_TYPE_BLOCK (bignum, Lisp_Bignum); +} +#endif /* HAVE_BIGNUM */ + +#ifdef HAVE_RATIO +static void +sweep_ratios (void) +{ +#define UNMARK_ratio(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) +#define ADDITIONAL_FREE_ratio(ptr) ratio_fini (ptr->data) + + SWEEP_FIXED_TYPE_BLOCK (ratio, Lisp_Ratio); +} +#endif /* HAVE_RATIO */ + +#ifdef HAVE_BIGFLOAT +static void +sweep_bigfloats (void) +{ +#define UNMARK_bigfloat(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) +#define ADDITIONAL_FREE_bigfloat(ptr) bigfloat_fini (ptr->bf) + + SWEEP_FIXED_TYPE_BLOCK (bigfloat, Lisp_Bigfloat); +} +#endif + static void sweep_symbols (void) { @@ -4237,6 +4396,21 @@ /* Put all unmarked floats on free list */ sweep_floats (); +#ifdef HAVE_BIGNUM + /* Put all unmarked bignums on free list */ + sweep_bignums (); +#endif + +#ifdef HAVE_RATIO + /* Put all unmarked ratios on free list */ + sweep_ratios (); +#endif + +#ifdef HAVE_BIGFLOAT + /* Put all unmarked bigfloats on free list */ + sweep_bigfloats (); +#endif + /* Put all unmarked symbols on free list */ sweep_symbols (); @@ -4796,6 +4970,21 @@ HACK_O_MATIC (float, "float-storage", pl); pl = gc_plist_hack ("floats-free", gc_count_num_float_freelist, pl); pl = gc_plist_hack ("floats-used", gc_count_num_float_in_use, pl); +#ifdef HAVE_BIGNUM + HACK_O_MATIC (bignum, "bignum-storage", pl); + pl = gc_plist_hack ("bignums-free", gc_count_num_bignum_freelist, pl); + pl = gc_plist_hack ("bignums-used", gc_count_num_bignum_in_use, pl); +#endif /* HAVE_BIGNUM */ +#ifdef HAVE_RATIO + HACK_O_MATIC (ratio, "ratio-storage", pl); + pl = gc_plist_hack ("ratios-free", gc_count_num_ratio_freelist, pl); + pl = gc_plist_hack ("ratios-used", gc_count_num_ratio_in_use, pl); +#endif /* HAVE_RATIO */ +#ifdef HAVE_BIGFLOAT + HACK_O_MATIC (bigfloat, "bigfloat-storage", pl); + pl = gc_plist_hack ("bigfloats-free", gc_count_num_bigfloat_freelist, pl); + pl = gc_plist_hack ("bigfloats-used", gc_count_num_bigfloat_in_use, pl); +#endif /* HAVE_BIGFLOAT */ HACK_O_MATIC (string, "string-header-storage", pl); pl = gc_plist_hack ("long-strings-total-length", gc_count_string_total_size @@ -4946,7 +5135,7 @@ that some minimum block size is imposed (e.g. 16 bytes). */ Bytecount -malloced_storage_size (void *ptr, Bytecount claimed_size, +malloced_storage_size (void *UNUSED (ptr), Bytecount claimed_size, struct overhead_stats *stats) { Bytecount orig_claimed_size = claimed_size; @@ -4960,20 +5149,21 @@ # endif if (claimed_size < 4096) { - int log = 1; + /* fxg: rename log->log2 to supress gcc3 shadow warning */ + int log2 = 1; /* compute the log base two, more or less, then use it to compute the block size needed. */ claimed_size--; /* It's big, it's heavy, it's wood! */ while ((claimed_size /= 2) != 0) - ++log; + ++log2; claimed_size = 1; /* It's better than bad, it's good! */ - while (log > 0) + while (log2 > 0) { claimed_size *= 2; - log--; + log2--; } /* We have to come up with some average about the amount of blocks used. */ @@ -5001,20 +5191,21 @@ claimed_size += 8; # endif { - int log = 1; + /* fxg: rename log->log2 to supress gcc3 shadow warning */ + int log2 = 1; /* compute the log base two, more or less, then use it to compute the block size needed. */ claimed_size--; /* It's big, it's heavy, it's wood! */ while ((claimed_size /= 2) != 0) - ++log; + ++log2; claimed_size = 1; /* It's better than bad, it's good! */ - while (log > 0) + while (log2 > 0) { claimed_size *= 2; - log--; + log2--; } } @@ -5079,6 +5270,15 @@ init_symbol_alloc (); init_compiled_function_alloc (); init_float_alloc (); +#ifdef HAVE_BIGNUM + init_bignum_alloc (); +#endif +#ifdef HAVE_RATIO + init_ratio_alloc (); +#endif +#ifdef HAVE_BIGFLOAT + init_bigfloat_alloc (); +#endif init_marker_alloc (); init_extent_alloc (); init_event_alloc (); diff --text -u 'xemacs-21.5.17/src/balloon_help.c' 'xemacs-21.5.18/src/balloon_help.c' Index: ./src/balloon_help.c --- ./src/balloon_help.c Wed Mar 13 17:52:32 2002 +++ ./src/balloon_help.c Tue Sep 21 04:19:35 2004 @@ -42,6 +42,7 @@ #include <X11/Xutil.h> #include <X11/extensions/shape.h> +#include "compiler.h" #include "xintrinsic.h" #include "balloon_help.h" @@ -229,8 +230,8 @@ } static void -get_text_size (Display* dpy, XFontStruct* fontStruct, const char* text, - int* max_width, int* max_height) +get_text_size (Display* UNUSED (dpy), XFontStruct* fontStruct, + const char* text, int* max_width, int* max_height) { int width; int height; @@ -307,7 +308,7 @@ } static void -make_mask (int shape, int x, int y, int width, int height) +make_mask (int shape, int UNUSED (x), int UNUSED (y), int width, int height) { XPoint cone[ 3 ]; @@ -336,7 +337,7 @@ } static void -show_help (XtPointer data, XtIntervalId* id) +show_help (XtPointer UNUSED (data), XtIntervalId* id) { int x, y; int shape; diff --text -u 'xemacs-21.5.17/src/buffer.c' 'xemacs-21.5.18/src/buffer.c' Index: ./src/buffer.c --- ./src/buffer.c Wed Oct 1 00:26:39 2003 +++ ./src/buffer.c Tue Sep 14 23:32:45 2004 @@ -341,7 +341,9 @@ return BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object)) ? Qt : Qnil; } -static void +static DECLARE_DOESNT_RETURN (nsberror (Lisp_Object)); + +static DOESNT_RETURN nsberror (Lisp_Object spec) { if (STRINGP (spec)) diff --text -u 'xemacs-21.5.17/src/buffer.h' 'xemacs-21.5.18/src/buffer.h' Index: ./src/buffer.h --- ./src/buffer.h Wed Oct 1 00:26:39 2003 +++ ./src/buffer.h Fri Oct 15 02:26:22 2004 @@ -511,7 +511,7 @@ DECLARE_INLINE_HEADER ( Bytebpos -prev_bytebpos (struct buffer *buf, Bytebpos x) +prev_bytebpos (struct buffer *USED_IF_MULE_OR_CHECK_TEXT (buf), Bytebpos x) ) { DEC_BYTEBPOS (buf, x); @@ -520,7 +520,7 @@ DECLARE_INLINE_HEADER ( Bytebpos -next_bytebpos (struct buffer *buf, Bytebpos x) +next_bytebpos (struct buffer *USED_IF_MULE_OR_CHECK_TEXT (buf), Bytebpos x) ) { INC_BYTEBPOS (buf, x); @@ -610,7 +610,8 @@ DECLARE_INLINE_HEADER ( Bytebpos -charbpos_to_bytebpos (struct buffer *buf, Charbpos x) +charbpos_to_bytebpos (struct buffer *USED_IF_MULE_OR_CHECK_TEXT (buf), + Charbpos x) ) { Bytebpos retval; @@ -640,7 +641,8 @@ DECLARE_INLINE_HEADER ( Charbpos -bytebpos_to_charbpos (struct buffer *buf, Bytebpos x) +bytebpos_to_charbpos (struct buffer *USED_IF_MULE_OR_CHECK_TEXT (buf), + Bytebpos x) ) { Charbpos retval; diff --text -u 'xemacs-21.5.17/src/bytecode.c' 'xemacs-21.5.18/src/bytecode.c' Index: ./src/bytecode.c --- ./src/bytecode.c Fri Feb 20 16:29:17 2004 +++ ./src/bytecode.c Tue Sep 21 04:19:35 2004 @@ -246,10 +246,19 @@ { retry: - if (INTP (obj)) return make_int (- XINT (obj)); + if (INTP (obj)) return make_integer (- XINT (obj)); if (FLOATP (obj)) return make_float (- XFLOAT_DATA (obj)); - if (CHARP (obj)) return make_int (- ((int) XCHAR (obj))); - if (MARKERP (obj)) return make_int (- ((int) marker_position (obj))); + if (CHARP (obj)) return make_integer (- ((int) XCHAR (obj))); + if (MARKERP (obj)) return make_integer (- ((int) marker_position (obj))); +#ifdef HAVE_BIGNUM + if (BIGNUMP (obj)) BIGNUM_ARITH_RETURN (obj, neg); +#endif +#ifdef HAVE_RATIO + if (RATIOP (obj)) RATIO_ARITH_RETURN (obj, neg); +#endif +#ifdef HAVE_BIG_FLOAT + if (BIGFLOAT_P (obj)) BIGFLOAT_ARITH_RETURN (obj, neg); +#endif obj = wrong_type_argument (Qnumber_char_or_marker_p, obj); goto retry; @@ -279,6 +288,33 @@ static int bytecode_arithcompare (Lisp_Object obj1, Lisp_Object obj2) { +#ifdef WITH_NUMBER_TYPES + switch (promote_args (&obj1, &obj2)) + { + case FIXNUM_T: + { + EMACS_INT ival1 = XREALINT (obj1), ival2 = XREALINT (obj2); + return ival1 < ival2 ? -1 : ival1 > ival2 ? 1 : 0; + } +#ifdef HAVE_BIGNUM + case BIGNUM_T: + return bignum_cmp (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2)); +#endif +#ifdef HAVE_RATIO + case RATIO_T: + return ratio_cmp (XRATIO_DATA (obj1), XRATIO_DATA (obj2)); +#endif +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + return bigfloat_cmp (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2)); +#endif + default: /* FLOAT_T */ + { + double dval1 = XFLOAT_DATA (obj1), dval2 = XFLOAT_DATA (obj2); + return dval1 < dval2 ? -1 : dval1 > dval2 ? 1 : 0; + } + } +#else /* !WITH_NUMBER_TYPES */ retry: { @@ -324,11 +360,151 @@ return dval1 < dval2 ? -1 : dval1 > dval2 ? 1 : 0; } +#endif /* WITH_NUMBER_TYPES */ } static Lisp_Object bytecode_arithop (Lisp_Object obj1, Lisp_Object obj2, Opcode opcode) { +#ifdef WITH_NUMBER_TYPES + switch (promote_args (&obj1, &obj2)) + { + case FIXNUM_T: + { + EMACS_INT ival1 = XREALINT (obj1), ival2 = XREALINT (obj2); + switch (opcode) + { + case Bplus: ival1 += ival2; break; + case Bdiff: ival1 -= ival2; break; + case Bmult: +#ifdef HAVE_BIGNUM + /* Due to potential overflow, we compute using bignums */ + bignum_set_long (scratch_bignum, ival1); + bignum_set_long (scratch_bignum2, ival2); + bignum_mul (scratch_bignum, scratch_bignum, scratch_bignum2); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#else + ival1 *= ival2; break; +#endif + case Bquo: + if (ival2 == 0) Fsignal (Qarith_error, Qnil); + ival1 /= ival2; + break; + case Bmax: if (ival1 < ival2) ival1 = ival2; break; + case Bmin: if (ival1 > ival2) ival1 = ival2; break; + } + return make_integer (ival1); + } +#ifdef HAVE_BIGNUM + case BIGNUM_T: + switch (opcode) + { + case Bplus: + bignum_add (scratch_bignum, XBIGNUM_DATA (obj1), + XBIGNUM_DATA (obj2)); + break; + case Bdiff: + bignum_sub (scratch_bignum, XBIGNUM_DATA (obj1), + XBIGNUM_DATA (obj2)); + break; + case Bmult: + bignum_mul (scratch_bignum, XBIGNUM_DATA (obj1), + XBIGNUM_DATA (obj2)); + break; + case Bquo: + if (bignum_sign (XBIGNUM_DATA (obj2)) == 0) + Fsignal (Qarith_error, Qnil); + bignum_div (scratch_bignum, XBIGNUM_DATA (obj1), + XBIGNUM_DATA (obj2)); + break; + case Bmax: + return bignum_gt (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2)) + ? obj1 : obj2; + case Bmin: + return bignum_lt (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2)) + ? obj1 : obj2; + } + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#endif +#ifdef HAVE_RATIO + case RATIO_T: + switch (opcode) + { + case Bplus: + ratio_add (scratch_ratio, XRATIO_DATA (obj1), XRATIO_DATA (obj2)); + break; + case Bdiff: + ratio_sub (scratch_ratio, XRATIO_DATA (obj1), XRATIO_DATA (obj2)); + break; + case Bmult: + ratio_mul (scratch_ratio, XRATIO_DATA (obj1), XRATIO_DATA (obj2)); + break; + case Bquo: + if (ratio_sign (XRATIO_DATA (obj2)) == 0) + Fsignal (Qarith_error, Qnil); + ratio_div (scratch_ratio, XRATIO_DATA (obj1), XRATIO_DATA (obj2)); + break; + case Bmax: + return ratio_gt (XRATIO_DATA (obj1), XRATIO_DATA (obj2)) + ? obj1 : obj2; + case Bmin: + return ratio_lt (XRATIO_DATA (obj1), XRATIO_DATA (obj2)) + ? obj1 : obj2; + } + return make_ratio_rt (scratch_ratio); +#endif +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + bigfloat_set_prec (scratch_bigfloat, max (XBIGFLOAT_GET_PREC (obj1), + XBIGFLOAT_GET_PREC (obj2))); + switch (opcode) + { + case Bplus: + bigfloat_add (scratch_bigfloat, XBIGFLOAT_DATA (obj1), + XBIGFLOAT_DATA (obj2)); + break; + case Bdiff: + bigfloat_sub (scratch_bigfloat, XBIGFLOAT_DATA (obj1), + XBIGFLOAT_DATA (obj2)); + break; + case Bmult: + bigfloat_mul (scratch_bigfloat, XBIGFLOAT_DATA (obj1), + XBIGFLOAT_DATA (obj2)); + break; + case Bquo: + if (bigfloat_sign (XBIGFLOAT_DATA (obj2)) == 0) + Fsignal (Qarith_error, Qnil); + bigfloat_div (scratch_bigfloat, XBIGFLOAT_DATA (obj1), + XBIGFLOAT_DATA (obj2)); + break; + case Bmax: + return bigfloat_gt (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2)) + ? obj1 : obj2; + case Bmin: + return bigfloat_lt (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2)) + ? obj1 : obj2; + } + return make_bigfloat_bf (scratch_bigfloat); +#endif + default: /* FLOAT_T */ + { + double dval1 = XFLOAT_DATA (obj1), dval2 = XFLOAT_DATA (obj2); + switch (opcode) + { + case Bplus: dval1 += dval2; break; + case Bdiff: dval1 -= dval2; break; + case Bmult: dval1 *= dval2; break; + case Bquo: + if (dval2 == 0.0) Fsignal (Qarith_error, Qnil); + dval1 /= dval2; + break; + case Bmax: if (dval1 < dval2) dval1 = dval2; break; + case Bmin: if (dval1 > dval2) dval1 = dval2; break; + } + return make_float (dval1); + } + } +#else /* !WITH_NUMBER_TYPES */ EMACS_INT ival1, ival2; int float_p; @@ -390,6 +566,7 @@ } return make_float (dval1); } +#endif /* WITH_NUMBER_TYPES */ } @@ -806,11 +983,19 @@ break; case Bnumberp: +#ifdef WITH_NUMBER_TYPES + TOP = NUMBERP (TOP) ? Qt : Qnil; +#else TOP = INT_OR_FLOATP (TOP) ? Qt : Qnil; +#endif break; case Bintegerp: +#ifdef HAVE_BIGNUM + TOP = INTEGERP (TOP) ? Qt : Qnil; +#else TOP = INTP (TOP) ? Qt : Qnil; +#endif break; case Beq: @@ -907,11 +1092,19 @@ } case Bsub1: +#ifdef HAVE_BIGNUM + TOP = Fsub1 (TOP); +#else TOP = INTP (TOP) ? INT_MINUS1 (TOP) : Fsub1 (TOP); +#endif break; case Badd1: +#ifdef HAVE_BIGNUM + TOP = Fadd1 (TOP); +#else TOP = INTP (TOP) ? INT_PLUS1 (TOP) : Fadd1 (TOP); +#endif break; @@ -966,9 +1159,13 @@ { Lisp_Object arg2 = POP; Lisp_Object arg1 = TOP; +#ifdef HAVE_BIGNUM + TOP = bytecode_arithop (arg1, arg2, opcode); +#else TOP = INTP (arg1) && INTP (arg2) ? INT_PLUS (arg1, arg2) : bytecode_arithop (arg1, arg2, opcode); +#endif break; } @@ -976,9 +1173,13 @@ { Lisp_Object arg2 = POP; Lisp_Object arg1 = TOP; +#ifdef HAVE_BIGNUM + TOP = bytecode_arithop (arg1, arg2, opcode); +#else TOP = INTP (arg1) && INTP (arg2) ? INT_MINUS (arg1, arg2) : bytecode_arithop (arg1, arg2, opcode); +#endif break; } @@ -1147,7 +1348,7 @@ Don't make this function static, since then the compiler might inline it. */ Lisp_Object * execute_rare_opcode (Lisp_Object *stack_ptr, - const Opbyte *program_ptr, + const Opbyte *UNUSED (program_ptr), Opcode opcode) { switch (opcode) diff --text -u 'xemacs-21.5.17/src/callint.c' 'xemacs-21.5.18/src/callint.c' Index: ./src/callint.c --- ./src/callint.c Sun Jan 12 20:08:08 2003 +++ ./src/callint.c Tue Sep 21 04:19:35 2004 @@ -206,7 +206,7 @@ `_' (setq zmacs-region-stays t) */ - (args)) + (UNUSED (args))) { return Qnil; } diff --text -u 'xemacs-21.5.17/src/casetab.c' 'xemacs-21.5.18/src/casetab.c' Index: ./src/casetab.c --- ./src/casetab.c Sun Jan 12 20:08:08 2003 +++ ./src/casetab.c Tue Sep 21 04:19:35 2004 @@ -85,7 +85,8 @@ } static void -print_case_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_case_table (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Case_Table *ct = XCASE_TABLE (obj); if (print_readably) @@ -286,7 +287,7 @@ static int compute_canon_mapper (struct chartab_range *range, - Lisp_Object table, Lisp_Object val, void *arg) + Lisp_Object UNUSED (table), Lisp_Object val, void *arg) { Lisp_Object casetab = VOID_TO_LISP (arg); if (range->type == CHARTAB_RANGE_CHAR) @@ -300,7 +301,8 @@ static int initialize_identity_mapper (struct chartab_range *range, - Lisp_Object table, Lisp_Object val, void *arg) + Lisp_Object UNUSED (table), + Lisp_Object UNUSED (val), void *arg) { Lisp_Object trt = VOID_TO_LISP (arg); if (range->type == CHARTAB_RANGE_CHAR) @@ -311,7 +313,8 @@ static int compute_up_or_eqv_mapper (struct chartab_range *range, - Lisp_Object table, Lisp_Object val, void *arg) + Lisp_Object UNUSED (table), + Lisp_Object val, void *arg) { Lisp_Object inverse = VOID_TO_LISP (arg); Ichar toch = XCHAR (val); diff --text -u 'xemacs-21.5.17/src/chartab.c' 'xemacs-21.5.18/src/chartab.c' Index: ./src/chartab.c --- ./src/chartab.c Sat Mar 1 16:25:35 2003 +++ ./src/chartab.c Tue Sep 21 04:19:35 2004 @@ -306,7 +306,7 @@ }; static int -print_table_entry (struct chartab_range *range, Lisp_Object table, +print_table_entry (struct chartab_range *range, Lisp_Object UNUSED (table), Lisp_Object val, void *arg) { struct ptemap *a = (struct ptemap *) arg; @@ -323,7 +323,8 @@ } static void -print_char_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_char_table (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Char_Table *ct = XCHAR_TABLE (obj); struct chartab_range range; @@ -779,7 +780,7 @@ } static int -copy_mapper (struct chartab_range *range, Lisp_Object table, +copy_mapper (struct chartab_range *range, Lisp_Object UNUSED (table), Lisp_Object val, void *arg) { put_char_table (VOID_TO_LISP (arg), range, val); @@ -1439,7 +1440,8 @@ static int slow_map_char_table_fun (struct chartab_range *range, - Lisp_Object table, Lisp_Object val, void *arg) + Lisp_Object UNUSED (table), Lisp_Object val, + void *arg) { struct slow_map_char_table_arg *closure = (struct slow_map_char_table_arg *) arg; @@ -1483,8 +1485,8 @@ /************************************************************************/ static int -chartab_type_validate (Lisp_Object keyword, Lisp_Object value, - Error_Behavior errb) +chartab_type_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, + Error_Behavior UNUSED (errb)) { /* #### should deal with ERRB */ symbol_to_char_table_type (value); @@ -1494,8 +1496,8 @@ /* #### Document the print/read format; esp. what's this cons element? */ static int -chartab_data_validate (Lisp_Object keyword, Lisp_Object value, - Error_Behavior errb) +chartab_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, + Error_Behavior UNUSED (errb)) { Lisp_Object rest; diff --text -u 'xemacs-21.5.17/src/cm.c' 'xemacs-21.5.18/src/cm.c' Index: ./src/cm.c --- ./src/cm.c Fri Jun 21 06:18:21 2002 +++ ./src/cm.c Tue Sep 21 04:19:35 2004 @@ -43,7 +43,7 @@ static int cm_cost_counter; /* sums up costs */ static void -evalcost (int c) +evalcost (int UNUSED (c)) { cm_cost_counter++; } diff --text -u 'xemacs-21.5.17/src/cmdloop.c' 'xemacs-21.5.18/src/cmdloop.c' Index: ./src/cmdloop.c --- ./src/cmdloop.c Sat Sep 20 10:47:03 2003 +++ ./src/cmdloop.c Tue Sep 21 04:19:35 2004 @@ -70,8 +70,14 @@ Lisp_Object Qtop_level; Lisp_Object Vminibuffer_echo_wait_function; +#ifdef LISP_COMMAND_LOOP static Lisp_Object command_loop_1 (Lisp_Object dummy); EXFUN (Fcommand_loop_1, 0); +#else +static DECLARE_DOESNT_RETURN_TYPE (Lisp_Object, + command_loop_1 (Lisp_Object dummy)); +EXFUN_NORETURN (Fcommand_loop_1, 0); +#endif /* There are two possible command loops -- one written entirely in C and one written mostly in Lisp, except stuff written in C for @@ -107,7 +113,8 @@ return (unbind_to_1 (speccount, Qt)); } -DEFUN ("really-early-error-handler", Freally_early_error_handler, 1, 1, 0, /* +DEFUN_NORETURN ("really-early-error-handler", Freally_early_error_handler, + 1, 1, 0, /* You should almost certainly not be using this. */ (x)) @@ -134,7 +141,8 @@ Fmswindows_message_box (build_msg_string ("Initialization error"), Qnil, Qnil); #endif - return Fkill_emacs (make_int (-1)); + Fkill_emacs (make_int (-1)); + RETURN_NOT_REACHED (Qnil); } @@ -192,7 +200,7 @@ static Lisp_Object -cmd_error (Lisp_Object data, Lisp_Object dummy) +cmd_error (Lisp_Object data, Lisp_Object UNUSED (dummy)) { /* This function can GC */ check_quit (); /* make Vquit_flag accurate */ @@ -207,7 +215,7 @@ } static Lisp_Object -top_level_1 (Lisp_Object dummy) +top_level_1 (Lisp_Object UNUSED (dummy)) { /* This function can GC */ /* On entry to the outer level, run the startup file */ @@ -236,6 +244,8 @@ to condition_case_1() returns. */ /* Avoid confusing the compiler. A helper function for command_loop_2 */ +static DECLARE_DOESNT_RETURN (command_loop_3 (void)); + static DOESNT_RETURN command_loop_3 (void) { @@ -257,11 +267,13 @@ } } -static Lisp_Object -command_loop_2 (Lisp_Object dummy) +static DECLARE_DOESNT_RETURN_TYPE (Lisp_Object, command_loop_2 (Lisp_Object)); + +static DOESNT_RETURN_TYPE (Lisp_Object) +command_loop_2 (Lisp_Object UNUSED (dummy)) { command_loop_3(); /* doesn't return */ - return Qnil; + RETURN_NOT_REACHED (Qnil); } /* This is called from emacs.c when it's done with initialization. */ @@ -314,14 +326,15 @@ Note that this function never returns (but may be thrown out of). */ -Lisp_Object +DOESNT_RETURN_TYPE (Lisp_Object) call_command_loop (Lisp_Object catch_errors) { /* This function can GC */ if (NILP (catch_errors)) - return (command_loop_1 (Qnil)); + command_loop_1 (Qnil); else - return (command_loop_2 (Qnil)); + command_loop_2 (Qnil); + RETURN_NOT_REACHED (Qnil); } static Lisp_Object @@ -406,7 +419,7 @@ cold_load_command_error, Qnil)); } -Lisp_Object +DOESNT_RETURN_TYPE (Lisp_Object) call_command_loop (Lisp_Object catch_errors) { /* This function can GC */ @@ -430,7 +443,7 @@ internal_catch (Qtop_level, cold_load_command_loop, Qnil, 0, 0); goto loop; - return Qnil; + RETURN_NOT_REACHED (Qnil); } static Lisp_Object @@ -480,13 +493,22 @@ /* Guts of command loop */ /**********************************************************************/ +#ifdef LISP_COMMAND_LOOP static Lisp_Object -command_loop_1 (Lisp_Object dummy) +#else +static DOESNT_RETURN_TYPE (Lisp_Object) +#endif +command_loop_1 (Lisp_Object UNUSED (dummy)) { /* This function can GC */ /* #### not correct with Vselected_console */ XCONSOLE (Vselected_console)->prefix_arg = Qnil; - return (Fcommand_loop_1 ()); + Fcommand_loop_1 (); +#ifdef LISP_COMMAND_LOOP + return Qnil; +#else + RETURN_NOT_REACHED (Qnil); +#endif } /* This is the actual command reading loop, sans error-handling @@ -499,7 +521,13 @@ command loop, this will return only when the user specifies a new command loop by changing the command-loop variable. */ -DEFUN ("command-loop-1", Fcommand_loop_1, 0, 0, 0, /* +#ifdef LISP_COMMAND_LOOP +#define DEFUN_COMMAND_LOOP(a,b,c,d,e,f) DEFUN (a, b, c, d, e, f) +#else +#define DEFUN_COMMAND_LOOP(a,b,c,d,e,f) DEFUN_NORETURN (a, b, c, d, e, f) +#endif + +DEFUN_COMMAND_LOOP ("command-loop-1", Fcommand_loop_1, 0, 0, 0, /* Invoke the internals of the canonical editor command loop. Don't call this unless you know what you're doing. */ diff --text -u 'xemacs-21.5.17/src/commands.h' 'xemacs-21.5.18/src/commands.h' Index: ./src/commands.h --- ./src/commands.h Fri Apr 13 03:23:29 2001 +++ ./src/commands.h Tue Sep 14 23:32:46 2004 @@ -109,7 +109,8 @@ extern Lisp_Object Vcommand_loop; /* #endif */ DECLARE_DOESNT_RETURN (initial_command_loop (Lisp_Object)); -Lisp_Object call_command_loop (Lisp_Object catch_errors); +DECLARE_DOESNT_RETURN_TYPE (Lisp_Object, + call_command_loop (Lisp_Object catch_errors)); extern Fixnum command_loop_level; extern Lisp_Object Vkeyboard_translate_table; diff --text -u 'xemacs-21.5.17/src/compiler.h' 'xemacs-21.5.18/src/compiler.h' Index: ./src/compiler.h --- ./src/compiler.h Wed Oct 15 02:01:15 2003 +++ ./src/compiler.h Fri Oct 15 02:26:22 2004 @@ -28,7 +28,7 @@ Many changes and improvements by Jerry James, 2003. Split out of lisp.h, reorganized, and modernized. {BEGIN,END}_C_DECLS, NEED_GCC, GCC_VERSION - ATTRIBUTE_MALLOC, ATTRIBUTE_CONST, ATTRIBUTE_PURE, UNUSED_ARG + ATTRIBUTE_MALLOC, ATTRIBUTE_CONST, ATTRIBUTE_PURE, UNUSED */ #ifndef INCLUDED_compiler_h @@ -110,24 +110,27 @@ # endif /* GNUC */ #endif -#ifndef DOESNT_RETURN +#ifndef DOESNT_RETURN_TYPE # if (GCC_VERSION > NEED_GCC (0, 0, 0)) # if (GCC_VERSION >= NEED_GCC (2, 5, 0)) -# if (GCC_VERSION < NEED_GCC (3, 0, 0)) - /* GCC 3.2 -O3 issues complaints in Fcommand_loop_1 about no return - statement if we have this definition */ +# ifndef __INTEL_COMPILER # define RETURN_NOT_REACHED(value) DO_NOTHING # endif -# define DOESNT_RETURN void -# define DECLARE_DOESNT_RETURN(decl) void decl __attribute__ ((noreturn)) +# define DOESNT_RETURN_TYPE(rettype) rettype +# define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype decl \ + __attribute__ ((noreturn)) # else /* GCC_VERSION < NEED_GCC (2, 5, 0) */ -# define DOESNT_RETURN void volatile -# define DECLARE_DOESNT_RETURN(decl) void volatile decl +# define DOESNT_RETURN_TYPE(rettype) rettype volatile +# define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype volatile decl # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */ # else /* not gcc */ -# define DOESNT_RETURN void -# define DECLARE_DOESNT_RETURN(decl) void decl +# define DOESNT_RETURN_TYPE(rettype) rettype +# define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype decl # endif /* GCC_VERSION > NEED_GCC (0, 0, 0) */ +#endif /* DOESNT_RETURN_TYPE */ +#ifndef DOESNT_RETURN +# define DOESNT_RETURN DOESNT_RETURN_TYPE (void) +# define DECLARE_DOESNT_RETURN(decl) DECLARE_DOESNT_RETURN_TYPE (void, decl) #endif /* DOESNT_RETURN */ /* Another try to fix SunPro C compiler warnings */ @@ -190,14 +193,28 @@ # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */ #endif /* ATTRIBUTE_CONST */ -/* Unused declarations; g++ doesn't support this. */ +/* Unused declarations; g++ and icc do not support this. */ #ifndef UNUSED_ARG -# if defined(__GNUC__) && !defined(__cplusplus) -# define UNUSED_ARG __attribute__ ((unused)) +# define UNUSED_ARG(decl) unused_##decl +#endif +#ifndef UNUSED +# if defined(__GNUC__) && !defined(__cplusplus) && !defined(__INTEL_COMPILER) +# define ATTRIBUTE_UNUSED __attribute__ ((unused)) +# else +# define ATTRIBUTE_UNUSED +# endif +# define UNUSED(decl) UNUSED_ARG (decl) ATTRIBUTE_UNUSED +# ifdef MULE +# define USED_IF_MULE(decl) decl +# else +# define USED_IF_MULE(decl) UNUSED (decl) +# endif +# if defined (MULE) || defined (ERROR_CHECK_TEXT) +# define USED_IF_MULE_OR_CHECK_TEXT(decl) decl # else -# define UNUSED_ARG +# define USED_IF_MULE_OR_CHECK_TEXT(decl) UNUSED (decl) # endif -#endif /* ATTRIBUTE_UNUSED */ +#endif /* UNUSED */ #ifdef DEBUG_XEMACS # define REGISTER diff --text -u 'xemacs-21.5.17/src/config.h.in' 'xemacs-21.5.18/src/config.h.in' Index: ./src/config.h.in --- ./src/config.h.in Fri Nov 21 01:04:47 2003 +++ ./src/config.h.in Sat Sep 11 14:28:41 2004 @@ -254,10 +254,12 @@ #undef HAVE_MACH_MACH_H #undef HAVE_SYS_PARAM_H #undef HAVE_SYS_PSTAT_H +#undef HAVE_SYS_RESOURCE_H #undef HAVE_SYS_TIME_H #undef HAVE_SYS_TIMEB_H #undef HAVE_SYS_TIMES_H #undef HAVE_SYS_UN_H +#undef HAVE_SYS_VLIMIT_H #undef HAVE_ULIMIT_H #undef HAVE_UNISTD_H @@ -306,6 +308,7 @@ #undef HAVE__DLERROR #undef HAVE_SHL_LOAD #undef HAVE_DYLD +#undef HAVE_LTDL #undef DLSYM_NEEDS_UNDERSCORE #undef HAVE_SHLIB @@ -359,6 +362,7 @@ #undef HAVE_GETHOSTNAME #undef HAVE_GETNAMEINFO #undef HAVE_GETPAGESIZE +#undef HAVE_GETRLIMIT #undef HAVE_GETTIMEOFDAY #undef HAVE_GETWD #undef HAVE_GETCWD @@ -398,6 +402,7 @@ #undef HAVE_UTIMES #undef HAVE_WAITPID #undef HAVE_VSNPRINTF +#undef HAVE_VLIMIT /* Many flavors of PTY support */ #undef HAVE_GETPT /* glibc's easy pty allocation function */ @@ -893,6 +898,7 @@ #undef SIZEOF_LONG #undef SIZEOF_LONG_LONG #undef SIZEOF_VOID_P +#undef SIZEOF_DOUBLE /* some systems (Cygwin) typedef u?intptr_t in <sys/types.h> but the standard is <inttypes.h> @@ -912,6 +918,14 @@ #define LONGBITS (SIZEOF_LONG * BITS_PER_CHAR) #define LONG_LONG_BITS (SIZEOF_LONG_LONG * BITS_PER_CHAR) #define VOID_P_BITS (SIZEOF_VOID_P * BITS_PER_CHAR) +#define DOUBLE_BITS (SIZEOF_DOUBLE * BITS_PER_CHAR) + +/* Enhanced numeric support */ +#undef WITH_NUMBER_TYPES +#undef WITH_GMP +#undef WITH_MP +#undef MP_PREFIX +#undef HAVE_MP_MOVE /* Use `INLINE_HEADER' to define inline functions in .h files. Use `inline static' to define inline functions in .c files. diff --text -u 'xemacs-21.5.17/src/console-gtk-impl.h' 'xemacs-21.5.18/src/console-gtk-impl.h' Index: ./src/console-gtk-impl.h --- ./src/console-gtk-impl.h Sun Mar 9 11:27:40 2003 +++ ./src/console-gtk-impl.h Wed Jul 7 21:01:06 2004 @@ -1,4 +1,4 @@ -/* Define X specific console, device, and frame object for XEmacs. +/* Define GTK specific console, device, and frame object for XEmacs. Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 2002 Ben Wing. @@ -28,6 +28,8 @@ Ultimately based on FSF, then later on JWZ work for Lemacs. Rewritten over time by Ben Wing and Chuck Thompson (original multi-device work by Chuck Thompson). + Gtk version by William M. Perry + */ #ifndef INCLUDED_console_gtk_impl_h_ @@ -37,6 +39,7 @@ #include "console-impl.h" #include "console-gtk.h" +#include <X11/Xlib.h> #define GDK_DRAWABLE(x) (GdkDrawable *) (x) #define GET_GTK_WIDGET_WINDOW(x) (GTK_WIDGET (x)->window) @@ -66,11 +69,11 @@ /* The following items are all used exclusively in event-gtk.c. */ int MetaMask, HyperMask, SuperMask, AltMask, ModeMask; - guint lock_interpretation; + KeySym lock_interpretation; - void *x_modifier_keymap; /* Really an (XModifierKeymap *)*/ + XModifierKeymap *x_modifier_keymap; - guint *x_keysym_map; + KeySym *x_keysym_map; int x_keysym_map_min_code; int x_keysym_map_max_code; int x_keysym_map_keysyms_per_code; @@ -171,6 +174,12 @@ /* Are we iconfied right now? */ unsigned int iconified_p :1; + /* Data for widget callbacks. It is impossible to pass all the necessary + data through the GTK signal API so instead it is registered here and the + hash key is passed instead. */ + Lisp_Object widget_instance_hash_table; + Lisp_Object widget_callback_hash_table; + Lisp_Object widget_callback_ex_hash_table; }; #define FRAME_GTK_DATA(f) FRAME_TYPE_DATA (f, gtk) @@ -194,8 +203,19 @@ #define FRAME_GTK_TOTALLY_VISIBLE_P(f) (FRAME_GTK_DATA (f)->totally_visible_p) #define FRAME_GTK_VISIBLE_P(f) (FRAME_GTK_DATA (f)->visible_p) #define FRAME_GTK_TOP_LEVEL_FRAME_P(f) (FRAME_GTK_DATA (f)->top_level_frame_p) +#define FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE(f) (FRAME_GTK_DATA (f)->widget_instance_hash_table) +#define FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE(f) (FRAME_GTK_DATA (f)->widget_callback_hash_table) +#define FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE(f) (FRAME_GTK_DATA (f)->widget_callback_ex_hash_table) extern struct console_type *gtk_console_type; +/* Special data used to quickly identify the frame that contains a widget. */ +#define GTK_DATA_FRAME_IDENTIFIER "xemacs::frame" + +/* The hashcode in the frame hash table of a tab_control tab's callback data. */ +#define GTK_DATA_TAB_HASHCODE_IDENTIFIER "xemacs::tab_hashcode" + +#define GTK_DATA_GUI_IDENTIFIER "xemacs::gui_id" + #endif /* HAVE_GTK */ #endif /* INCLUDED_console_gtk_impl_h_ */ diff --text -u 'xemacs-21.5.17/src/console-gtk.c' 'xemacs-21.5.18/src/console-gtk.c' Index: ./src/console-gtk.c --- ./src/console-gtk.c Fri Jun 21 06:18:22 2002 +++ ./src/console-gtk.c Tue Sep 21 04:19:36 2004 @@ -37,7 +37,7 @@ DEFINE_CONSOLE_TYPE (gtk); static int -gtk_initially_selected_for_input (struct console *con) +gtk_initially_selected_for_input (struct console *UNUSED (con)) { return 1; } @@ -46,7 +46,8 @@ the integrity of our input, because the generic functions don't. */ static Lisp_Object -gtk_device_to_console_connection (Lisp_Object connection, Error_Behavior errb) +gtk_device_to_console_connection (Lisp_Object connection, + Error_Behavior UNUSED (errb)) { /* Strip the trailing .# off of the connection, if it's there. */ @@ -61,7 +62,7 @@ static Lisp_Object gtk_semi_canonicalize_console_connection (Lisp_Object connection, - Error_Behavior errb) + Error_Behavior UNUSED (errb)) { struct gcpro gcpro1; @@ -73,7 +74,8 @@ } static Lisp_Object -gtk_canonicalize_console_connection (Lisp_Object connection, Error_Behavior errb) +gtk_canonicalize_console_connection (Lisp_Object connection, + Error_Behavior UNUSED (errb)) { Lisp_Object hostname = Qnil; struct gcpro gcpro1, gcpro2; @@ -87,7 +89,7 @@ static Lisp_Object gtk_semi_canonicalize_device_connection (Lisp_Object connection, - Error_Behavior errb) + Error_Behavior UNUSED (errb)) { struct gcpro gcpro1; @@ -99,7 +101,8 @@ } static Lisp_Object -gtk_canonicalize_device_connection (Lisp_Object connection, Error_Behavior errb) +gtk_canonicalize_device_connection (Lisp_Object connection, + Error_Behavior UNUSED (errb)) { struct gcpro gcpro1; diff --text -u 'xemacs-21.5.17/src/console-gtk.h' 'xemacs-21.5.18/src/console-gtk.h' Index: ./src/console-gtk.h --- ./src/console-gtk.h Sun Mar 9 11:27:40 2003 +++ ./src/console-gtk.h Wed Jul 7 21:01:06 2004 @@ -48,6 +48,7 @@ extern int gtk_selection_timeout; +struct frame *gtk_widget_to_frame (GtkWidget *); struct frame *gtk_any_window_to_frame (struct device *d, GdkWindow *); struct frame *gtk_window_to_frame (struct device *d, GdkWindow *); struct frame *gtk_any_widget_or_parent_to_frame (struct device *d, GtkWidget *widget); diff --text -u 'xemacs-21.5.17/src/console-msw.c' 'xemacs-21.5.18/src/console-msw.c' Index: ./src/console-msw.c --- ./src/console-msw.c Sun Mar 9 11:27:40 2003 +++ ./src/console-msw.c Tue Sep 21 04:19:36 2004 @@ -80,7 +80,7 @@ /************************************************************************/ static int -mswindows_initially_selected_for_input (struct console *con) +mswindows_initially_selected_for_input (struct console *UNUSED (con)) { return 1; } diff --text -u 'xemacs-21.5.17/src/console-stream.c' 'xemacs-21.5.18/src/console-stream.c' Index: ./src/console-stream.c --- ./src/console-stream.c Wed Oct 1 00:26:39 2003 +++ ./src/console-stream.c Wed Oct 20 12:43:00 2004 @@ -58,7 +58,7 @@ }; static void -stream_init_console (struct console *con, Lisp_Object params) +stream_init_console (struct console *con, Lisp_Object UNUSED (params)) { Lisp_Object tty = CONSOLE_CONNECTION (con); struct stream_console *stream_con; @@ -90,7 +90,7 @@ } static void -stream_init_device (struct device *d, Lisp_Object params) +stream_init_device (struct device *d, Lisp_Object UNUSED (params)) { struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); @@ -101,7 +101,7 @@ } static int -stream_initially_selected_for_input (struct console *con) +stream_initially_selected_for_input (struct console *UNUSED (con)) { return noninteractive && initialized; } @@ -130,7 +130,7 @@ Lisp_Object stream_semi_canonicalize_console_connection (Lisp_Object connection, - Error_Behavior errb) + Error_Behavior UNUSED (errb)) { return NILP (connection) ? Vstdio_str : connection; } @@ -169,7 +169,7 @@ static void -stream_init_frame_1 (struct frame *f, Lisp_Object props, +stream_init_frame_1 (struct frame *f, Lisp_Object UNUSED (props), int frame_name_is_defaulted) { #if 0 @@ -186,20 +186,21 @@ static int -stream_text_width (struct frame *f, struct face_cachel *cachel, - const Ichar *str, Charcount len) +stream_text_width (struct frame *UNUSED (f), + struct face_cachel *UNUSED (cachel), + const Ichar *UNUSED (str), Charcount len) { return len; } static int -stream_left_margin_width (struct window *w) +stream_left_margin_width (struct window *UNUSED (w)) { return 0; } static int -stream_right_margin_width (struct window *w) +stream_right_margin_width (struct window *UNUSED (w)) { return 0; } @@ -224,55 +225,61 @@ is a few changes to the redisplay critical-section handling. */ static void -stream_window_output_begin (struct window *w) +stream_window_output_begin (struct window *UNUSED (w)) { abort (); } static void -stream_window_output_end (struct window *w) +stream_window_output_end (struct window *UNUSED (w)) { abort (); } static void -stream_frame_output_begin (struct frame *f) +stream_frame_output_begin (struct frame *UNUSED (f)) { abort (); } static void -stream_frame_output_end (struct frame *f) +stream_frame_output_end (struct frame *UNUSED (f)) { abort (); } static void -stream_output_display_block (struct window *w, struct display_line *dl, - int block, int start, int end, - int start_pixpos, int cursor_start, - int cursor_width, int cursor_height) +stream_output_display_block (struct window *UNUSED (w), + struct display_line *UNUSED (dl), + int UNUSED (block), int UNUSED (start), + int UNUSED (end), int UNUSED (start_pixpos), + int UNUSED (cursor_start), + int UNUSED (cursor_width), + int UNUSED (cursor_height)) { abort (); } static void -stream_clear_region (Lisp_Object window, struct device* d, struct frame * f, - face_index findex, int x, int y, - int width, int height, Lisp_Object fcolor, - Lisp_Object bcolor, Lisp_Object background_pixmap) +stream_clear_region (Lisp_Object UNUSED (window), struct device* UNUSED (d), + struct frame *UNUSED (f), face_index UNUSED (findex), + int UNUSED (x), int UNUSED (y), int UNUSED (width), + int UNUSED (height), Lisp_Object UNUSED (fcolor), + Lisp_Object UNUSED (bcolor), + Lisp_Object UNUSED (background_pixmap)) { abort (); } static int -stream_flash (struct device *d) +stream_flash (struct device *UNUSED (d)) { return 0; /* sorry can't do it */ } static void -stream_ring_bell (struct device *d, int volume, int pitch, int duration) +stream_ring_bell (struct device *d, int UNUSED (volume), int UNUSED (pitch), + int UNUSED (duration)) { struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); /* Don't output ^G when not a TTY -- in particular, under MS Windows, ^G @@ -357,7 +364,7 @@ #ifndef PDUMP void -init_console_stream (int reinit) +init_console_stream (int UNUSED (reinit)) { /* This function can GC */ if (!initialized) diff --text -u 'xemacs-21.5.17/src/console-tty.c' 'xemacs-21.5.18/src/console-tty.c' Index: ./src/console-tty.c --- ./src/console-tty.c Wed Oct 1 00:26:40 2003 +++ ./src/console-tty.c Tue Sep 21 04:19:36 2004 @@ -183,7 +183,7 @@ } static int -tty_initially_selected_for_input (struct console *con) +tty_initially_selected_for_input (struct console *UNUSED (con)) { return 1; } diff --text -u 'xemacs-21.5.17/src/console-x.c' 'xemacs-21.5.18/src/console-x.c' Index: ./src/console-x.c --- ./src/console-x.c Fri Jun 21 06:18:24 2002 +++ ./src/console-x.c Tue Sep 21 04:19:36 2004 @@ -39,7 +39,7 @@ DEFINE_CONSOLE_TYPE (x); static int -x_initially_selected_for_input (struct console *con) +x_initially_selected_for_input (struct console *UNUSED (con)) { return 1; } diff --text -u 'xemacs-21.5.17/src/console.c' 'xemacs-21.5.18/src/console.c' Index: ./src/console.c --- ./src/console.c Sun Mar 9 11:27:40 2003 +++ ./src/console.c Wed Oct 20 02:19:07 2004 @@ -43,6 +43,12 @@ #include "console-tty-impl.h" #endif +#ifdef HAVE_TTY +#define USED_IF_TTY(decl) decl +#else +#define USED_IF_TTY(decl) UNUSED (decl) +#endif + Lisp_Object Vconsole_list, Vselected_console; Lisp_Object Vcreate_console_hook, Vdelete_console_hook; @@ -149,7 +155,8 @@ } static void -print_console (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_console (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { struct console *con = XCONSOLE (obj); @@ -974,7 +981,13 @@ Then in any case stuff anything Emacs has read ahead and not used. */ void -stuff_buffered_input (Lisp_Object stuffstring) +stuff_buffered_input ( +#ifdef BSD + Lisp_Object stuffstring +#else + Lisp_Object UNUSED (stuffstring) +#endif + ) { /* stuff_char works only in BSD, versions 4.2 and up. */ #if defined (BSD) @@ -1017,7 +1030,7 @@ Some operating systems cannot stop processes and resume them later. On such systems, who knows what will happen. */ - (console)) + (USED_IF_TTY (console))) { #ifdef HAVE_TTY struct console *con = decode_console (console); @@ -1054,7 +1067,7 @@ Re-initialize a previously suspended console. For tty consoles, do stuff to the tty to make it sane again. */ - (console)) + (USED_IF_TTY (console))) { #ifdef HAVE_TTY struct console *con = decode_console (console); @@ -1102,7 +1115,7 @@ the selected console. See also `current-input-mode'. */ - (ignored, flow, meta, quit, console)) + (UNUSED (ignored), USED_IF_TTY (flow), meta, quit, console)) { struct console *con = decode_console (console); int meta_key = (!CONSOLE_TTY_P (con) ? 1 : @@ -1479,7 +1492,7 @@ keymaps have no binding for the current key sequence but `function-key-map' binds a suffix of the sequence to a vector or string, `read-key-sequence' replaces the matching suffix with its binding, and -continues with the new sequence. +continues with the new sequence. See `key-binding'. The events that come from bindings in `function-key-map' are not themselves looked up in `function-key-map'. diff --text -u 'xemacs-21.5.17/src/data.c' 'xemacs-21.5.18/src/data.c' Index: ./src/data.c --- ./src/data.c Thu Jul 31 22:32:26 2003 +++ ./src/data.c Tue Sep 21 04:19:36 2004 @@ -53,7 +53,7 @@ Lisp_Object Qtext_conversion_error; Lisp_Object Qarith_error, Qrange_error, Qdomain_error; Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error; -Lisp_Object Qintegerp, Qnatnump, Qsymbolp; +Lisp_Object Qintegerp, Qnatnump, Qnonnegativep, Qsymbolp; Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp; Lisp_Object Qconsp, Qsubrp; Lisp_Object Qcharacterp, Qstringp, Qarrayp, Qsequencep, Qvectorp; @@ -171,10 +171,10 @@ EMACS_INT sign_extend_lisp_int (EMACS_INT num) { - if (num & (1L << (VALBITS - 1))) - return num | ((-1L) << VALBITS); + if (num & (1L << (INT_VALBITS - 1))) + return num | ((-1L) << INT_VALBITS); else - return num & ((1L << VALBITS) - 1); + return num & (EMACS_INT) ((1UL << INT_VALBITS) - 1); } @@ -460,6 +460,16 @@ return CHAR_OR_CHAR_INTP (object) || STRINGP (object) ? Qt : Qnil; } +#ifdef HAVE_BIGNUM +/* In this case, integerp is defined in number.c. */ +DEFUN ("fixnump", Ffixnump, 1, 1, 0, /* +Return t if OBJECT is a fixnum. +*/ + (object)) +{ + return INTP (object) ? Qt : Qnil; +} +#else DEFUN ("integerp", Fintegerp, 1, 1, 0, /* Return t if OBJECT is an integer. */ @@ -467,6 +477,7 @@ { return INTP (object) ? Qt : Qnil; } +#endif DEFUN ("integer-or-marker-p", Finteger_or_marker_p, 1, 1, 0, /* Return t if OBJECT is an integer or a marker (editor pointer). @@ -497,7 +508,29 @@ */ (object)) { - return NATNUMP (object) ? Qt : Qnil; + return NATNUMP (object) +#ifdef HAVE_BIGNUM + || (BIGNUMP (object) && bignum_sign (XBIGNUM_DATA (object)) >= 0) +#endif + ? Qt : Qnil; +} + +DEFUN ("nonnegativep", Fnonnegativep, 1, 1, 0, /* +Return t if OBJECT is a nonnegative number. +*/ + (object)) +{ + return NATNUMP (object) +#ifdef HAVE_BIGNUM + || (BIGNUMP (object) && bignum_sign (XBIGNUM_DATA (object)) >= 0) +#endif +#ifdef HAVE_RATIO + || (RATIOP (object) && ratio_sign (XRATIO_DATA (object)) >= 0) +#endif +#ifdef HAVE_BIGFLOAT + || (BIGFLOATP (object) && bigfloat_sign (XBIGFLOAT_DATA (object)) >= 0) +#endif + ? Qt : Qnil; } DEFUN ("bitp", Fbitp, 1, 1, 0, /* @@ -513,7 +546,11 @@ */ (object)) { +#ifdef WITH_NUMBER_TYPES + return NUMBERP (object) ? Qt : Qnil; +#else return INT_OR_FLOATP (object) ? Qt : Qnil; +#endif } DEFUN ("number-or-marker-p", Fnumber_or_marker_p, 1, 1, 0, /* @@ -799,6 +836,7 @@ /**********************************************************************/ /* Arithmetic functions */ /**********************************************************************/ +#ifndef WITH_NUMBER_TYPES typedef struct { int int_p; @@ -839,6 +877,7 @@ goto retry; } } +#endif /* WITH_NUMBER_TYPES */ static EMACS_INT integer_char_or_marker_to_int (Lisp_Object obj) @@ -854,7 +893,66 @@ } } -#define ARITHCOMPARE_MANY(op) \ +#ifdef WITH_NUMBER_TYPES + +#ifdef HAVE_BIGNUM +#define BIGNUM_CASE(op) \ + case BIGNUM_T: \ + if (!bignum_##op (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2))) \ + return Qnil; \ + break; +#else +#define BIGNUM_CASE(op) +#endif /* HAVE_BIGNUM */ + +#ifdef HAVE_RATIO +#define RATIO_CASE(op) \ + case RATIO_T: \ + if (!ratio_##op (XRATIO_DATA (obj1), XRATIO_DATA (obj2))) \ + return Qnil; \ + break; +#else +#define RATIO_CASE(op) +#endif /* HAVE_RATIO */ + +#ifdef HAVE_BIGFLOAT +#define BIGFLOAT_CASE(op) \ + case BIGFLOAT_T: \ + if (!bigfloat_##op (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2))) \ + return Qnil; \ + break; +#else +#define BIGFLOAT_CASE(op) +#endif /* HAVE_BIGFLOAT */ + +#define ARITHCOMPARE_MANY(c_op,op) \ +{ \ + REGISTER int i; \ + Lisp_Object obj1, obj2; \ + \ + for (i = 1; i < nargs; i++) \ + { \ + obj1 = args[i - 1]; \ + obj2 = args[i]; \ + switch (promote_args (&obj1, &obj2)) \ + { \ + case FIXNUM_T: \ + if (!(XREALINT (obj1) c_op XREALINT (obj2))) \ + return Qnil; \ + break; \ + BIGNUM_CASE (op) \ + RATIO_CASE (op) \ + case FLOAT_T: \ + if (!(XFLOAT_DATA (obj1) c_op XFLOAT_DATA (obj2))) \ + return Qnil; \ + break; \ + BIGFLOAT_CASE (op) \ + } \ + } \ + return Qt; \ +} +#else /* !WITH_NUMBER_TYPES */ +#define ARITHCOMPARE_MANY(c_op,op) \ { \ int_or_double iod1, iod2, *p = &iod1, *q = &iod2; \ Lisp_Object *args_end = args + nargs; \ @@ -866,8 +964,8 @@ number_char_or_marker_to_int_or_double (*args++, q); \ \ if (!((p->int_p && q->int_p) ? \ - (p->c.ival op q->c.ival) : \ - ((p->int_p ? (double) p->c.ival : p->c.dval) op \ + (p->c.ival c_op q->c.ival) : \ + ((p->int_p ? (double) p->c.ival : p->c.dval) c_op \ (q->int_p ? (double) q->c.ival : q->c.dval)))) \ return Qnil; \ \ @@ -875,6 +973,7 @@ } \ return Qt; \ } +#endif /* WITH_NUMBER_TYPES */ DEFUN ("=", Feqlsign, 1, MANY, 0, /* Return t if all the arguments are numerically equal. @@ -882,7 +981,7 @@ */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (==) + ARITHCOMPARE_MANY (==, eql) } DEFUN ("<", Flss, 1, MANY, 0, /* @@ -891,7 +990,7 @@ */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (<) + ARITHCOMPARE_MANY (<, lt) } DEFUN (">", Fgtr, 1, MANY, 0, /* @@ -900,7 +999,7 @@ */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (>) + ARITHCOMPARE_MANY (>, gt) } DEFUN ("<=", Fleq, 1, MANY, 0, /* @@ -909,7 +1008,7 @@ */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (<=) + ARITHCOMPARE_MANY (<=, le) } DEFUN (">=", Fgeq, 1, MANY, 0, /* @@ -918,15 +1017,64 @@ */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (>=) + ARITHCOMPARE_MANY (>=, ge) } +/* Unlike all the other comparisons, this is an O(N*N) algorithm. But who + cares? Inspection of all elisp code distributed by xemacs.org shows that + it is almost always called with 2 arguments, rarely with 3, and never with + more than 3. The constant factors of algorithms with better asymptotic + complexity are higher, which means that those algorithms will run SLOWER + than this one in the common case. Optimize the common case! */ DEFUN ("/=", Fneq, 1, MANY, 0, /* Return t if no two arguments are numerically equal. The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { +#ifdef WITH_NUMBER_TYPES + REGISTER int i, j; + Lisp_Object obj1, obj2; + + for (i = 0; i < nargs - 1; i++) + { + obj1 = args[i]; + for (j = i + 1; j < nargs; j++) + { + obj2 = args[j]; + switch (promote_args (&obj1, &obj2)) + { + case FIXNUM_T: + if (XREALINT (obj1) == XREALINT (obj2)) + return Qnil; + break; +#ifdef HAVE_BIGNUM + case BIGNUM_T: + if (bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2))) + return Qnil; + break; +#endif +#ifdef HAVE_RATIO + case RATIO_T: + if (ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2))) + return Qnil; + break; +#endif + case FLOAT_T: + if (XFLOAT_DATA (obj1) == XFLOAT_DATA (obj2)) + return Qnil; + break; +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + if (bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2))) + return Qnil; + break; +#endif + } + } + } + return Qt; +#else /* !WITH_NUMBER_TYPES */ Lisp_Object *args_end = args + nargs; Lisp_Object *p, *q; @@ -949,6 +1097,7 @@ } } return Qt; +#endif /* WITH_NUMBER_TYPES */ } DEFUN ("zerop", Fzerop, 1, 1, 0, /* @@ -959,8 +1108,20 @@ retry: if (INTP (number)) return EQ (number, Qzero) ? Qt : Qnil; +#ifdef HAVE_BIGNUM + else if (BIGNUMP (number)) + return bignum_sign (XBIGNUM_DATA (number)) == 0 ? Qt : Qnil; +#endif +#ifdef HAVE_RATIO + else if (RATIOP (number)) + return ratio_sign (XRATIO_DATA (number)) == 0 ? Qt : Qnil; +#endif else if (FLOATP (number)) return XFLOAT_DATA (number) == 0.0 ? Qt : Qnil; +#ifdef HAVE_BIGFLOAT + else if (BIGFLOATP (number)) + return bigfloat_sign (XBIGFLOAT_DATA (number)) == 0 ? Qt : Qnil; +#endif else { number = wrong_type_argument (Qnumberp, number); @@ -1001,10 +1162,15 @@ Convert NUMBER to a string by printing it in decimal. Uses a minus sign if negative. NUMBER may be an integer or a floating point number. +If supported, it may also be a ratio. */ (number)) { +#ifdef WITH_NUMBER_TYPES + CHECK_NUMBER (number); +#else CHECK_INT_OR_FLOAT (number); +#endif if (FLOATP (number)) { @@ -1013,6 +1179,33 @@ float_to_string (pigbuf, XFLOAT_DATA (number)); return build_string (pigbuf); } +#ifdef HAVE_BIGNUM + if (BIGNUMP (number)) + { + char *str = bignum_to_string (XBIGNUM_DATA (number), 10); + Lisp_Object retval = build_string (str); + xfree (str, char *); + return retval; + } +#endif +#ifdef HAVE_RATIO + if (RATIOP (number)) + { + char *str = ratio_to_string (XRATIO_DATA (number), 10); + Lisp_Object retval = build_string (str); + xfree (str, char *); + return retval; + } +#endif +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (number)) + { + char *str = bigfloat_to_string (XBIGFLOAT_DATA (number), 10); + Lisp_Object retval = build_string (str); + xfree (str, char *); + return retval; + } +#endif { char buffer[DECIMAL_PRINT_SIZE (long)]; @@ -1022,6 +1215,7 @@ } } +#ifndef HAVE_BIGNUM static int digit_to_number (int character, int base) { @@ -1033,10 +1227,12 @@ return digit >= base ? -1 : digit; } +#endif DEFUN ("string-to-number", Fstring_to_number, 1, 2, 0, /* Convert STRING to a number by parsing it as a number in base BASE. This parses both integers and floating point numbers. +If they are supported, it also reads ratios. It ignores leading spaces and tabs. If BASE is nil or omitted, base 10 is used. @@ -1045,7 +1241,7 @@ */ (string, base)) { - char *p; + Ibyte *p; int b; CHECK_STRING (string); @@ -1059,25 +1255,130 @@ check_int_range (b, 2, 16); } - p = (char *) XSTRING_DATA (string); + p = XSTRING_DATA (string); /* Skip any whitespace at the front of the number. Some versions of atoi do this anyway, so we might as well make Emacs lisp consistent. */ while (*p == ' ' || *p == '\t') p++; - if (isfloat_string (p) && b == 10) - return make_float (atof (p)); + if (isfloat_string ((const char *) p) && b == 10) + { +#ifdef HAVE_BIGFLOAT + if (ZEROP (Vdefault_float_precision)) +#endif + return make_float (atof ((const char *) p)); +#ifdef HAVE_BIGFLOAT + else + { + /* The GMP version of bigfloat_set_string (mpf_set_str) has the + following limitation: if p starts with a '+' sign, it does + nothing; i.e., it leaves its bigfloat argument untouched. + Therefore, move p past any leading '+' signs. */ + if (*p == '+') + p++; + bigfloat_set_prec (scratch_bigfloat, bigfloat_get_default_prec ()); + bigfloat_set_string (scratch_bigfloat, (const char *) p, b); + return make_bigfloat_bf (scratch_bigfloat); + } +#endif + } + +#ifdef HAVE_RATIO + if (qxestrchr (p, '/') != NULL) + { + /* The GMP version of ratio_set_string (mpq_set_str) has the following + limitations: + - If p starts with a '+' sign, it does nothing; i.e., it leaves its + ratio argument untouched. + - If p has a '+' sign after the '/' (e.g., 300/+400), it sets the + numerator from the string, but *leaves the denominator unchanged*. + - If p has trailing nonnumeric characters, it sets the numerator from + the string, but leaves the denominator unchanged. + - If p has more than one '/', (e.g., 1/2/3), then it sets the + numerator from the string, but leaves the denominator unchanged. + + Therefore, move p past any leading '+' signs, temporarily drop a null + after the numeric characters we are trying to convert, and then put + the nulled character back afterward. I am not going to fix problem + #2; just don't write ratios that look like that. */ + Ibyte *end, save; + if (*p == '+') + p++; + + end = p; + if (*end == '-') + end++; + while ((*end >= '0' && *end <= '9') || + (b > 10 && *end >= 'a' && *end <= 'a' + b - 11) || + (b > 10 && *end >= 'A' && *end <= 'A' + b - 11)) + end++; + if (*end == '/') + { + end++; + if (*end == '-') + end++; + while ((*end >= '0' && *end <= '9') || + (b > 10 && *end >= 'a' && *end <= 'a' + b - 11) || + (b > 10 && *end >= 'A' && *end <= 'A' + b - 11)) + end++; + } + save = *end; + *end = '\0'; + ratio_set_string (scratch_ratio, (const char *) p, b); + *end = save; + ratio_canonicalize (scratch_ratio); + return make_ratio_rt (scratch_ratio); + } +#endif /* HAVE_RATIO */ + +#ifdef HAVE_BIGNUM + { + /* The GMP version of bignum_set_string (mpz_set_str) has the following + limitations: + - If p starts with a '+' sign, it does nothing; i.e., it leaves its + bignum argument untouched. + - If p is the empty string, it does nothing. + - If p has trailing nonnumeric characters, it does nothing. + + Therefore, move p past any leading '+' signs, temporarily drop a null + after the numeric characters we are trying to convert, special case the + empty string, and then put the nulled character back afterward. */ + Ibyte *end, save; + Lisp_Object retval; + + if (*p == '+') + p++; + end = p; + if (*end == '-') + end++; + while ((*end >= '0' && *end <= '9') || + (b > 10 && *end >= 'a' && *end <= 'a' + b - 11) || + (b > 10 && *end >= 'A' && *end <= 'A' + b - 11)) + end++; + save = *end; + *end = '\0'; + if (*p == '\0') + retval = make_int (0); + else + { + bignum_set_string (scratch_bignum, (const char *) p, b); + retval = Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } + *end = save; + return retval; + } +#else if (b == 10) { /* Use the system-provided functions for base 10. */ #if SIZEOF_EMACS_INT == SIZEOF_INT - return make_int (atoi (p)); + return make_int (atoi ((char*) p)); #elif SIZEOF_EMACS_INT == SIZEOF_LONG - return make_int (atol (p)); + return make_int (atol ((char*) p)); #elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG - return make_int (atoll (p)); + return make_int (atoll ((char*) p)); #endif } else @@ -1101,6 +1402,7 @@ } return make_int (negative * v); } +#endif /* HAVE_BIGNUM */ } @@ -1110,6 +1412,49 @@ */ (int nargs, Lisp_Object *args)) { +#ifdef WITH_NUMBER_TYPES + REGISTER int i; + Lisp_Object accum = make_int (0), addend; + + for (i = 0; i < nargs; i++) + { + addend = args[i]; + switch (promote_args (&accum, &addend)) + { + case FIXNUM_T: + accum = make_integer (XREALINT (accum) + XREALINT (addend)); + break; +#ifdef HAVE_BIGNUM + case BIGNUM_T: + bignum_add (scratch_bignum, XBIGNUM_DATA (accum), + XBIGNUM_DATA (addend)); + accum = make_bignum_bg (scratch_bignum); + break; +#endif +#ifdef HAVE_RATIO + case RATIO_T: + ratio_add (scratch_ratio, XRATIO_DATA (accum), + XRATIO_DATA (addend)); + accum = make_ratio_rt (scratch_ratio); + break; +#endif + case FLOAT_T: + accum = make_float (XFLOAT_DATA (accum) + XFLOAT_DATA (addend)); + break; +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + bigfloat_set_prec (scratch_bigfloat, + max (XBIGFLOAT_GET_PREC (addend), + XBIGFLOAT_GET_PREC (accum))); + bigfloat_add (scratch_bigfloat, XBIGFLOAT_DATA (accum), + XBIGFLOAT_DATA (addend)); + accum = make_bigfloat_bf (scratch_bigfloat); + break; +#endif + } + } + return Fcanonicalize_number (accum); +#else /* !WITH_NUMBER_TYPES */ EMACS_INT iaccum = 0; Lisp_Object *args_end = args + nargs; @@ -1129,6 +1474,7 @@ } return make_int (iaccum); +#endif /* WITH_NUMBER_TYPES */ } DEFUN ("-", Fminus, 1, MANY, 0, /* @@ -1138,6 +1484,87 @@ */ (int nargs, Lisp_Object *args)) { +#ifdef WITH_NUMBER_TYPES + REGISTER int i; + Lisp_Object accum = args[0], subtrahend; + + if (nargs == 1) + { + if (CHARP (accum)) + accum = make_int (XCHAR (accum)); + else if (MARKERP (accum)) + accum = make_int (marker_position (accum)); + + /* Invert the sign of accum */ + CHECK_NUMBER (accum); + switch (get_number_type (accum)) + { + case FIXNUM_T: + return make_integer (-XREALINT (accum)); +#ifdef HAVE_BIGNUM + case BIGNUM_T: + bignum_neg (scratch_bignum, XBIGNUM_DATA (accum)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#endif +#ifdef HAVE_RATIO + case RATIO_T: + ratio_neg (scratch_ratio, XRATIO_DATA (accum)); + return make_ratio_rt (scratch_ratio); +#endif + case FLOAT_T: + return make_float (-XFLOAT_DATA (accum)); +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (accum)); + bigfloat_neg (scratch_bigfloat, XBIGFLOAT_DATA (accum)); + return make_bigfloat_bf (scratch_bigfloat); +#endif + } + } + else + { + /* Subtrace the remaining arguments from accum */ + for (i = 1; i < nargs; i++) + { + subtrahend = args[i]; + switch (promote_args (&accum, &subtrahend)) + { + case FIXNUM_T: + accum = make_integer (XREALINT (accum) - XREALINT (subtrahend)); + break; +#ifdef HAVE_BIGNUM + case BIGNUM_T: + bignum_sub (scratch_bignum, XBIGNUM_DATA (accum), + XBIGNUM_DATA (subtrahend)); + accum = make_bignum_bg (scratch_bignum); + break; +#endif +#ifdef HAVE_RATIO + case RATIO_T: + ratio_sub (scratch_ratio, XRATIO_DATA (accum), + XRATIO_DATA (subtrahend)); + accum = make_ratio_rt (scratch_ratio); + break; +#endif + case FLOAT_T: + accum = + make_float (XFLOAT_DATA (accum) - XFLOAT_DATA (subtrahend)); + break; +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + bigfloat_set_prec (scratch_bigfloat, + max (XBIGFLOAT_GET_PREC (subtrahend), + XBIGFLOAT_GET_PREC (accum))); + bigfloat_sub (scratch_bigfloat, XBIGFLOAT_DATA (accum), + XBIGFLOAT_DATA (subtrahend)); + accum = make_bigfloat_bf (scratch_bigfloat); + break; +#endif + } + } + } + return Fcanonicalize_number (accum); +#else /* !WITH_NUMBER_TYPES */ EMACS_INT iaccum; double daccum; Lisp_Object *args_end = args + nargs; @@ -1170,6 +1597,7 @@ for (; args < args_end; args++) daccum -= number_char_or_marker_to_double (*args); return make_float (daccum); +#endif /* WITH_NUMBER_TYPES */ } DEFUN ("*", Ftimes, 0, MANY, 0, /* @@ -1178,6 +1606,47 @@ */ (int nargs, Lisp_Object *args)) { +#ifdef WITH_NUMBER_TYPES + REGISTER int i; + /* Start with a bignum to avoid overflow */ + Lisp_Object accum = make_bignum (1L), multiplier; + + for (i = 0; i < nargs; i++) + { + multiplier = args[i]; + switch (promote_args (&accum, &multiplier)) + { +#ifdef HAVE_BIGNUM + case BIGNUM_T: + bignum_mul (scratch_bignum, XBIGNUM_DATA (accum), + XBIGNUM_DATA (multiplier)); + accum = make_bignum_bg (scratch_bignum); + break; +#endif +#ifdef HAVE_RATIO + case RATIO_T: + ratio_mul (scratch_ratio, XRATIO_DATA (accum), + XRATIO_DATA (multiplier)); + accum = make_ratio_rt (scratch_ratio); + break; +#endif + case FLOAT_T: + accum = make_float (XFLOAT_DATA (accum) * XFLOAT_DATA (multiplier)); + break; +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + bigfloat_set_prec (scratch_bigfloat, + max (XBIGFLOAT_GET_PREC (multiplier), + XBIGFLOAT_GET_PREC (accum))); + bigfloat_mul (scratch_bigfloat, XBIGFLOAT_DATA (accum), + XBIGFLOAT_DATA (multiplier)); + accum = make_bigfloat_bf (scratch_bigfloat); + break; +#endif + } + } + return Fcanonicalize_number (accum); +#else /* !WITH_NUMBER_TYPES */ EMACS_INT iaccum = 1; Lisp_Object *args_end = args + nargs; @@ -1197,7 +1666,77 @@ } return make_int (iaccum); +#endif /* WITH_NUMBER_TYPES */ +} + +#ifdef HAVE_RATIO +DEFUN ("div", Fdiv, 1, MANY, 0, /* +Same as `/', but dividing integers creates a ratio instead of truncating. +Note that this is a departure from Common Lisp, where / creates ratios when +dividing integers. Having a separate function lets us avoid breaking existing +Emacs Lisp code that expects / to do integer division. +*/ + (int nargs, Lisp_Object *args)) +{ + REGISTER int i; + Lisp_Object accum, divisor; + + if (nargs == 1) + { + i = 0; + accum = make_int (1); + } + else + { + i = 1; + accum = args[0]; + } + for (; i < nargs; i++) + { + divisor = args[i]; + switch (promote_args (&accum, &divisor)) + { + case FIXNUM_T: + if (XREALINT (divisor) == 0) goto divide_by_zero; + bignum_set_long (scratch_bignum, XREALINT (accum)); + bignum_set_long (scratch_bignum2, XREALINT (divisor)); + accum = make_ratio_bg (scratch_bignum, scratch_bignum2); + break; + case BIGNUM_T: + if (bignum_sign (XBIGNUM_DATA (divisor)) == 0) goto divide_by_zero; + accum = make_ratio_bg (XBIGNUM_DATA (accum), XBIGNUM_DATA (divisor)); + break; + case RATIO_T: + if (ratio_sign (XRATIO_DATA (divisor)) == 0) goto divide_by_zero; + ratio_div (scratch_ratio, XRATIO_DATA (accum), + XRATIO_DATA (divisor)); + accum = make_ratio_rt (scratch_ratio); + break; + case FLOAT_T: + if (XFLOAT_DATA (divisor) == 0.0) goto divide_by_zero; + accum = make_float (XFLOAT_DATA (accum) / XFLOAT_DATA (divisor)); + break; +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + if (bigfloat_sign (XBIGFLOAT_DATA (divisor)) == 0) + goto divide_by_zero; + bigfloat_set_prec (scratch_bigfloat, + max (XBIGFLOAT_GET_PREC (divisor), + XBIGFLOAT_GET_PREC (accum))); + bigfloat_div (scratch_bigfloat, XBIGFLOAT_DATA (accum), + XBIGFLOAT_DATA (divisor)); + accum = make_bigfloat_bf (scratch_bigfloat); + break; +#endif + } + } + return Fcanonicalize_number (accum); + + divide_by_zero: + Fsignal (Qarith_error, Qnil); + return Qnil; /* not (usually) reached */ } +#endif /* HAVE_RATIO */ DEFUN ("/", Fquo, 1, MANY, 0, /* Return first argument divided by all the remaining arguments. @@ -1206,6 +1745,65 @@ */ (int nargs, Lisp_Object *args)) { +#ifdef WITH_NUMBER_TYPES + REGISTER int i; + Lisp_Object accum, divisor; + + if (nargs == 1) + { + i = 0; + accum = make_int (1); + } + else + { + i = 1; + accum = args[0]; + } + for (; i < nargs; i++) + { + divisor = args[i]; + switch (promote_args (&accum, &divisor)) + { + case FIXNUM_T: + if (XREALINT (divisor) == 0) goto divide_by_zero; + accum = make_integer (XREALINT (accum) / XREALINT (divisor)); + break; +#ifdef HAVE_BIGNUM + case BIGNUM_T: + if (bignum_sign (XBIGNUM_DATA (divisor)) == 0) goto divide_by_zero; + bignum_div (scratch_bignum, XBIGNUM_DATA (accum), + XBIGNUM_DATA (divisor)); + accum = make_bignum_bg (scratch_bignum); + break; +#endif +#ifdef HAVE_RATIO + case RATIO_T: + if (ratio_sign (XRATIO_DATA (divisor)) == 0) goto divide_by_zero; + ratio_div (scratch_ratio, XRATIO_DATA (accum), + XRATIO_DATA (divisor)); + accum = make_ratio_rt (scratch_ratio); + break; +#endif + case FLOAT_T: + if (XFLOAT_DATA (divisor) == 0.0) goto divide_by_zero; + accum = make_float (XFLOAT_DATA (accum) / XFLOAT_DATA (divisor)); + break; +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + if (bigfloat_sign (XBIGFLOAT_DATA (divisor)) == 0) + goto divide_by_zero; + bigfloat_set_prec (scratch_bigfloat, + max (XBIGFLOAT_GET_PREC (divisor), + XBIGFLOAT_GET_PREC (accum))); + bigfloat_div (scratch_bigfloat, XBIGFLOAT_DATA (accum), + XBIGFLOAT_DATA (divisor)); + accum = make_bigfloat_bf (scratch_bigfloat); + break; +#endif + } + } + return Fcanonicalize_number (accum); +#else /* !WITH_NUMBER_TYPES */ EMACS_INT iaccum; double daccum; Lisp_Object *args_end = args + nargs; @@ -1251,6 +1849,7 @@ daccum /= dval; } return make_float (daccum); +#endif /* WITH_NUMBER_TYPES */ divide_by_zero: Fsignal (Qarith_error, Qnil); @@ -1259,12 +1858,58 @@ DEFUN ("max", Fmax, 1, MANY, 0, /* Return largest of all the arguments. -All arguments must be numbers, characters or markers. +All arguments must be real numbers, characters or markers. The value is always a number; markers and characters are converted to numbers. */ (int nargs, Lisp_Object *args)) { +#ifdef WITH_NUMBER_TYPES + REGISTER int i, maxindex = 0; + Lisp_Object comp1, comp2; + + while (!(CHARP (args[0]) || MARKERP (args[0]) || REALP (args[0]))) + args[0] = wrong_type_argument (Qnumber_char_or_marker_p, args[0]); + if (CHARP (args[0])) + args[0] = make_int (XCHAR (args[0])); + else if (MARKERP (args[0])) + args[0] = make_int (marker_position (args[0])); + for (i = 1; i < nargs; i++) + { + comp1 = args[maxindex]; + comp2 = args[i]; + switch (promote_args (&comp1, &comp2)) + { + case FIXNUM_T: + if (XREALINT (comp1) < XREALINT (comp2)) + maxindex = i; + break; +#ifdef HAVE_BIGNUM + case BIGNUM_T: + if (bignum_lt (XBIGNUM_DATA (comp1), XBIGNUM_DATA (comp2))) + maxindex = i; + break; +#endif +#ifdef HAVE_RATIO + case RATIO_T: + if (ratio_lt (XRATIO_DATA (comp1), XRATIO_DATA (comp2))) + maxindex = i; + break; +#endif + case FLOAT_T: + if (XFLOAT_DATA (comp1) < XFLOAT_DATA (comp2)) + maxindex = i; + break; +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + if (bigfloat_lt (XBIGFLOAT_DATA (comp1), XBIGFLOAT_DATA (comp2))) + maxindex = i; + break; +#endif + } + } + return args[maxindex]; +#else /* !WITH_NUMBER_TYPES */ EMACS_INT imax; double dmax; Lisp_Object *args_end = args + nargs; @@ -1303,6 +1948,7 @@ if (dmax < dval) dmax = dval; } return make_float (dmax); +#endif /* WITH_NUMBER_TYPES */ } DEFUN ("min", Fmin, 1, MANY, 0, /* @@ -1313,6 +1959,52 @@ */ (int nargs, Lisp_Object *args)) { +#ifdef WITH_NUMBER_TYPES + REGISTER int i, minindex = 0; + Lisp_Object comp1, comp2; + + while (!(CHARP (args[0]) || MARKERP (args[0]) || REALP (args[0]))) + args[0] = wrong_type_argument (Qnumber_char_or_marker_p, args[0]); + if (CHARP (args[0])) + args[0] = make_int (XCHAR (args[0])); + else if (MARKERP (args[0])) + args[0] = make_int (marker_position (args[0])); + for (i = 1; i < nargs; i++) + { + comp1 = args[minindex]; + comp2 = args[i]; + switch (promote_args (&comp1, &comp2)) + { + case FIXNUM_T: + if (XREALINT (comp1) > XREALINT (comp2)) + minindex = i; + break; +#ifdef HAVE_BIGNUM + case BIGNUM_T: + if (bignum_gt (XBIGNUM_DATA (comp1), XBIGNUM_DATA (comp2))) + minindex = i; + break; +#endif +#ifdef HAVE_RATIO + case RATIO_T: + if (ratio_gt (XRATIO_DATA (comp1), XRATIO_DATA (comp2))) + minindex = i; + break; +#endif + case FLOAT_T: + if (XFLOAT_DATA (comp1) > XFLOAT_DATA (comp2)) + minindex = i; + break; +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + if (bigfloat_gt (XBIGFLOAT_DATA (comp1), XBIGFLOAT_DATA (comp2))) + minindex = i; + break; +#endif + } + } + return args[minindex]; +#else /* !WITH_NUMBER_TYPES */ EMACS_INT imin; double dmin; Lisp_Object *args_end = args + nargs; @@ -1351,6 +2043,7 @@ if (dmin > dval) dmin = dval; } return make_float (dmin); +#endif /* WITH_NUMBER_TYPES */ } DEFUN ("logand", Flogand, 0, MANY, 0, /* @@ -1359,6 +2052,40 @@ */ (int nargs, Lisp_Object *args)) { +#ifdef HAVE_BIGNUM + REGISTER int i; + Lisp_Object result, other; + + if (nargs == 0) + return make_int (~0); + + while (!(CHARP (args[0]) || MARKERP (args[0]) || INTEGERP (args[0]))) + args[0] = wrong_type_argument (Qnumber_char_or_marker_p, args[0]); + + result = args[0]; + if (CHARP (result)) + result = make_int (XCHAR (result)); + else if (MARKERP (result)) + result = make_int (marker_position (result)); + for (i = 1; i < nargs; i++) + { + while (!(CHARP (args[i]) || MARKERP (args[i]) || INTEGERP (args[i]))) + args[i] = wrong_type_argument (Qnumber_char_or_marker_p, args[i]); + other = args[i]; + switch (promote_args (&result, &other)) + { + case FIXNUM_T: + result = make_int (XREALINT (result) & XREALINT (other)); + break; + case BIGNUM_T: + bignum_and (scratch_bignum, XBIGNUM_DATA (result), + XBIGNUM_DATA (other)); + result = make_bignum_bg (scratch_bignum); + break; + } + } + return Fcanonicalize_number (result); +#else /* !HAVE_BIGNUM */ EMACS_INT bits = ~0; Lisp_Object *args_end = args + nargs; @@ -1366,6 +2093,7 @@ bits &= integer_char_or_marker_to_int (*args++); return make_int (bits); +#endif /* HAVE_BIGNUM */ } DEFUN ("logior", Flogior, 0, MANY, 0, /* @@ -1374,6 +2102,40 @@ */ (int nargs, Lisp_Object *args)) { +#ifdef HAVE_BIGNUM + REGISTER int i; + Lisp_Object result, other; + + if (nargs == 0) + return make_int (0); + + while (!(CHARP (args[0]) || MARKERP (args[0]) || INTEGERP (args[0]))) + args[0] = wrong_type_argument (Qnumber_char_or_marker_p, args[0]); + + result = args[0]; + if (CHARP (result)) + result = make_int (XCHAR (result)); + else if (MARKERP (result)) + result = make_int (marker_position (result)); + for (i = 1; i < nargs; i++) + { + while (!(CHARP (args[i]) || MARKERP (args[i]) || INTEGERP (args[i]))) + args[i] = wrong_type_argument (Qnumber_char_or_marker_p, args[i]); + other = args[i]; + switch (promote_args (&result, &other)) + { + case FIXNUM_T: + result = make_int (XREALINT (result) | XREALINT (other)); + break; + case BIGNUM_T: + bignum_ior (scratch_bignum, XBIGNUM_DATA (result), + XBIGNUM_DATA (other)); + result = make_bignum_bg (scratch_bignum); + break; + } + } + return Fcanonicalize_number (result); +#else /* !HAVE_BIGNUM */ EMACS_INT bits = 0; Lisp_Object *args_end = args + nargs; @@ -1381,6 +2143,7 @@ bits |= integer_char_or_marker_to_int (*args++); return make_int (bits); +#endif /* HAVE_BIGNUM */ } DEFUN ("logxor", Flogxor, 0, MANY, 0, /* @@ -1389,6 +2152,39 @@ */ (int nargs, Lisp_Object *args)) { +#ifdef HAVE_BIGNUM + REGISTER int i; + Lisp_Object result, other; + + if (nargs == 0) + return make_int (0); + + while (!(CHARP (args[0]) || MARKERP (args[0]) || INTEGERP (args[0]))) + args[0] = wrong_type_argument (Qnumber_char_or_marker_p, args[0]); + + result = args[0]; + if (CHARP (result)) + result = make_int (XCHAR (result)); + else if (MARKERP (result)) + result = make_int (marker_position (result)); + for (i = 1; i < nargs; i++) + { + while (!(CHARP (args[i]) || MARKERP (args[i]) || INTEGERP (args[i]))) + args[i] = wrong_type_argument (Qnumber_char_or_marker_p, args[i]); + other = args[i]; + if (promote_args (&result, &other) == FIXNUM_T) + { + result = make_int (XREALINT (result) ^ XREALINT (other)); + } + else + { + bignum_xor (scratch_bignum, XBIGNUM_DATA (result), + XBIGNUM_DATA (other)); + result = make_bignum_bg (scratch_bignum); + } + } + return Fcanonicalize_number (result); +#else /* !HAVE_BIGNUM */ EMACS_INT bits = 0; Lisp_Object *args_end = args + nargs; @@ -1396,6 +2192,7 @@ bits ^= integer_char_or_marker_to_int (*args++); return make_int (bits); +#endif /* !HAVE_BIGNUM */ } DEFUN ("lognot", Flognot, 1, 1, 0, /* @@ -1404,6 +2201,13 @@ */ (number)) { +#ifdef HAVE_BIGNUM + if (BIGNUMP (number)) + { + bignum_not (scratch_bignum, XBIGNUM_DATA (number)); + return make_bignum_bg (scratch_bignum); + } +#endif /* HAVE_BIGNUM */ return make_int (~ integer_char_or_marker_to_int (number)); } @@ -1413,6 +2217,27 @@ */ (number1, number2)) { +#ifdef HAVE_BIGNUM + while (!(CHARP (number1) || MARKERP (number1) || INTEGERP (number1))) + number1 = wrong_type_argument (Qnumber_char_or_marker_p, number1); + while (!(CHARP (number2) || MARKERP (number2) || INTEGERP (number2))) + number2 = wrong_type_argument (Qnumber_char_or_marker_p, number2); + + if (promote_args (&number1, &number2) == FIXNUM_T) + { + if (XREALINT (number2) == 0) + Fsignal (Qarith_error, Qnil); + return make_int (XREALINT (number1) % XREALINT (number2)); + } + else + { + if (bignum_sign (XBIGNUM_DATA (number2)) == 0) + Fsignal (Qarith_error, Qnil); + bignum_mod (scratch_bignum, XBIGNUM_DATA (number1), + XBIGNUM_DATA (number2)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } +#else /* !HAVE_BIGNUM */ EMACS_INT ival1 = integer_char_or_marker_to_int (number1); EMACS_INT ival2 = integer_char_or_marker_to_int (number2); @@ -1420,6 +2245,7 @@ Fsignal (Qarith_error, Qnil); return make_int (ival1 % ival2); +#endif /* HAVE_BIGNUM */ } /* Note, ANSI *requires* the presence of the fmod() library routine. @@ -1445,6 +2271,62 @@ */ (x, y)) { +#ifdef WITH_NUMBER_TYPES + while (!(CHARP (x) || MARKERP (x) || REALP (x))) + x = wrong_type_argument (Qnumber_char_or_marker_p, x); + while (!(CHARP (y) || MARKERP (y) || REALP (y))) + y = wrong_type_argument (Qnumber_char_or_marker_p, y); + switch (promote_args (&x, &y)) + { + case FIXNUM_T: + { + EMACS_INT ival; + if (XREALINT (y) == 0) goto divide_by_zero; + ival = XREALINT (x) % XREALINT (y); + /* If the "remainder" comes out with the wrong sign, fix it. */ + if (XREALINT (y) < 0 ? ival > 0 : ival < 0) + ival += XREALINT (y); + return make_int (ival); + } +#ifdef HAVE_BIGNUM + case BIGNUM_T: + if (bignum_sign (XBIGNUM_DATA (y)) == 0) goto divide_by_zero; + bignum_mod (scratch_bignum, XBIGNUM_DATA (x), XBIGNUM_DATA (y)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#endif +#ifdef HAVE_RATIO + case RATIO_T: + if (ratio_sign (XRATIO_DATA (y)) == 0) goto divide_by_zero; + ratio_div (scratch_ratio, XRATIO_DATA (x), XRATIO_DATA (y)); + bignum_div (scratch_bignum, ratio_numerator (scratch_ratio), + ratio_denominator (scratch_ratio)); + ratio_set_bignum (scratch_ratio, scratch_bignum); + ratio_mul (scratch_ratio, scratch_ratio, XRATIO_DATA (y)); + ratio_sub (scratch_ratio, XRATIO_DATA (x), scratch_ratio); + return Fcanonicalize_number (make_ratio_rt (scratch_ratio)); +#endif + case FLOAT_T: + { + double dval; + if (XFLOAT_DATA (y) == 0.0) goto divide_by_zero; + dval = fmod (XFLOAT_DATA (x), XFLOAT_DATA (y)); + /* If the "remainder" comes out with the wrong sign, fix it. */ + if (XFLOAT_DATA (y) < 0 ? dval > 0 : dval < 0) + dval += XFLOAT_DATA (y); + return make_float (dval); + } +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + bigfloat_set_prec (scratch_bigfloat, + max (XBIGFLOAT_GET_PREC (x), XBIGFLOAT_GET_PREC (y))); + bigfloat_div (scratch_bigfloat, XBIGFLOAT_DATA (x), XBIGFLOAT_DATA (y)); + bigfloat_trunc (scratch_bigfloat, scratch_bigfloat); + bigfloat_mul (scratch_bigfloat, scratch_bigfloat, XBIGFLOAT_DATA (y)); + bigfloat_sub (scratch_bigfloat, XBIGFLOAT_DATA (x), scratch_bigfloat); + return make_bigfloat_bf (scratch_bigfloat); +#endif + } +#else /* !WITH_NUMBER_TYPES */ int_or_double iod1, iod2; number_char_or_marker_to_int_or_double (x, &iod1); number_char_or_marker_to_int_or_double (y, &iod2); @@ -1475,6 +2357,7 @@ return make_int (ival); } +#endif /* WITH_NUMBER_TYPES */ divide_by_zero: Fsignal (Qarith_error, Qnil); @@ -1485,6 +2368,8 @@ Return VALUE with its bits shifted left by COUNT. If COUNT is negative, shifting is actually to the right. In this case, the sign bit is duplicated. +This function cannot be applied to bignums, as there is no leftmost sign bit +to be duplicated. Use `lsh' instead. */ (value, count)) { @@ -1503,12 +2388,47 @@ */ (value, count)) { +#ifdef HAVE_BIGNUM + while (!(CHARP (value) || MARKERP (value) || INTEGERP (value))) + wrong_type_argument (Qnumber_char_or_marker_p, value); + CONCHECK_INTEGER (count); + + if (promote_args (&value, &count) == FIXNUM_T) + { + if (XREALINT (count) <= 0) + return make_int (XREALINT (value) >> -XREALINT (count)); + /* Use bignums to avoid overflow */ + bignum_set_long (scratch_bignum2, XREALINT (value)); + bignum_lshift (scratch_bignum, scratch_bignum2, XREALINT (count)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } + else + { + if (bignum_sign (XBIGNUM_DATA (count)) <= 0) + { + bignum_neg (scratch_bignum, XBIGNUM_DATA (count)); + if (!bignum_fits_ulong_p (scratch_bignum)) + args_out_of_range (Qnumber_char_or_marker_p, count); + bignum_rshift (scratch_bignum2, XBIGNUM_DATA (value), + bignum_to_ulong (scratch_bignum)); + } + else + { + if (!bignum_fits_ulong_p (XBIGNUM_DATA (count))) + args_out_of_range (Qnumber_char_or_marker_p, count); + bignum_lshift (scratch_bignum2, XBIGNUM_DATA (value), + bignum_to_ulong (XBIGNUM_DATA (count))); + } + return Fcanonicalize_number (make_bignum_bg (scratch_bignum2)); + } +#else /* !HAVE_BIGNUM */ CHECK_INT_COERCE_CHAR (value); CONCHECK_INT (count); return make_int (XINT (count) > 0 ? XUINT (value) << XINT (count) : XUINT (value) >> -XINT (count)); +#endif /* HAVE_BIGNUM */ } DEFUN ("1+", Fadd1, 1, 1, 0, /* @@ -1519,10 +2439,37 @@ { retry: - if (INTP (number)) return make_int (XINT (number) + 1); - if (CHARP (number)) return make_int (XCHAR (number) + 1); - if (MARKERP (number)) return make_int (marker_position (number) + 1); + if (INTP (number)) return make_integer (XINT (number) + 1); + if (CHARP (number)) return make_integer (XCHAR (number) + 1); + if (MARKERP (number)) return make_integer (marker_position (number) + 1); if (FLOATP (number)) return make_float (XFLOAT_DATA (number) + 1.0); +#ifdef HAVE_BIGNUM + if (BIGNUMP (number)) + { + bignum_set_long (scratch_bignum, 1L); + bignum_add (scratch_bignum2, XBIGNUM_DATA (number), scratch_bignum); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum2)); + } +#endif +#ifdef HAVE_RATIO + if (RATIOP (number)) + { + ratio_set_long (scratch_ratio, 1L); + ratio_add (scratch_ratio, XRATIO_DATA (number), scratch_ratio); + /* No need to canonicalize after adding 1 */ + return make_ratio_rt (scratch_ratio); + } +#endif +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (number)) + { + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number)); + bigfloat_set_long (scratch_bigfloat, 1L); + bigfloat_add (scratch_bigfloat, XBIGFLOAT_DATA (number), + scratch_bigfloat); + return make_bigfloat_bf (scratch_bigfloat); + } +#endif number = wrong_type_argument (Qnumber_char_or_marker_p, number); goto retry; @@ -1536,10 +2483,37 @@ { retry: - if (INTP (number)) return make_int (XINT (number) - 1); - if (CHARP (number)) return make_int (XCHAR (number) - 1); - if (MARKERP (number)) return make_int (marker_position (number) - 1); + if (INTP (number)) return make_integer (XINT (number) - 1); + if (CHARP (number)) return make_integer (XCHAR (number) - 1); + if (MARKERP (number)) return make_integer (marker_position (number) - 1); if (FLOATP (number)) return make_float (XFLOAT_DATA (number) - 1.0); +#ifdef HAVE_BIGNUM + if (BIGNUMP (number)) + { + bignum_set_long (scratch_bignum, 1L); + bignum_sub (scratch_bignum2, XBIGNUM_DATA (number), scratch_bignum); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum2)); + } +#endif +#ifdef HAVE_RATIO + if (RATIOP (number)) + { + ratio_set_long (scratch_ratio, 1L); + ratio_sub (scratch_ratio, XRATIO_DATA (number), scratch_ratio); + /* No need to canonicalize after subtracting 1 */ + return make_ratio_rt (scratch_ratio); + } +#endif +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (number)) + { + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number)); + bigfloat_set_long (scratch_bigfloat, 1L); + bigfloat_sub (scratch_bigfloat, XBIGFLOAT_DATA (number), + scratch_bigfloat); + return make_bigfloat_bf (scratch_bigfloat); + } +#endif number = wrong_type_argument (Qnumber_char_or_marker_p, number); goto retry; @@ -1562,13 +2536,14 @@ static Lisp_Object encode_weak_list_type (enum weak_list_type type); static Lisp_Object -mark_weak_list (Lisp_Object obj) +mark_weak_list (Lisp_Object UNUSED (obj)) { return Qnil; /* nichts ist gemarkt */ } static void -print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { if (print_readably) printing_unreadable_object ("#<weak-list>"); @@ -2040,13 +3015,14 @@ } static Lisp_Object -mark_weak_box (Lisp_Object obj) +mark_weak_box (Lisp_Object UNUSED (obj)) { return Qnil; } static void -print_weak_box (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_weak_box (Lisp_Object UNUSED (obj), Lisp_Object printcharfun, + int UNUSED (escapeflag)) { if (print_readably) printing_unreadable_object ("#<weak_box>"); @@ -2265,13 +3241,14 @@ } static Lisp_Object -mark_ephemeron (Lisp_Object obj) +mark_ephemeron (Lisp_Object UNUSED (obj)) { return Qnil; } static void -print_ephemeron (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_ephemeron (Lisp_Object UNUSED (obj), Lisp_Object printcharfun, + int UNUSED (escapeflag)) { if (print_readably) printing_unreadable_object ("#<ephemeron>"); @@ -2487,6 +3464,7 @@ DEFSYMBOL (Qintegerp); DEFSYMBOL (Qcharacterp); DEFSYMBOL (Qnatnump); + DEFSYMBOL (Qnonnegativep); DEFSYMBOL (Qstringp); DEFSYMBOL (Qarrayp); DEFSYMBOL (Qsequencep); @@ -2508,6 +3486,9 @@ DEFSUBR (Fwrong_type_argument); +#ifdef HAVE_RATIO + DEFSUBR (Fdiv); +#endif DEFSUBR (Feq); DEFSUBR (Fold_eq); DEFSUBR (Fnull); @@ -2523,7 +3504,11 @@ DEFSUBR (Fchar_to_int); DEFSUBR (Fint_to_char); DEFSUBR (Fchar_or_char_int_p); +#ifdef HAVE_BIGNUM + DEFSUBR (Ffixnump); +#else DEFSUBR (Fintegerp); +#endif DEFSUBR (Finteger_or_marker_p); DEFSUBR (Finteger_or_char_p); DEFSUBR (Finteger_char_or_marker_p); @@ -2532,6 +3517,7 @@ DEFSUBR (Fnumber_char_or_marker_p); DEFSUBR (Ffloatp); DEFSUBR (Fnatnump); + DEFSUBR (Fnonnegativep); DEFSUBR (Fsymbolp); DEFSUBR (Fkeywordp); DEFSUBR (Fstringp); diff --text -u 'xemacs-21.5.17/src/database.c' 'xemacs-21.5.18/src/database.c' Index: ./src/database.c --- ./src/database.c Tue Aug 26 23:04:00 2003 +++ ./src/database.c Tue Sep 21 04:19:37 2004 @@ -161,7 +161,8 @@ } static void -print_database (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_database (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Database *db = XDATABASE (obj); @@ -368,7 +369,7 @@ #ifdef HAVE_BERKELEY_DB static Lisp_Object -berkdb_type (Lisp_Database *db) +berkdb_type (Lisp_Database *UNUSED (db)) { return Qberkeley_db; } diff --text -u 'xemacs-21.5.17/src/depend' 'xemacs-21.5.18/src/depend' Index: ./src/depend --- ./src/depend Tue Oct 14 23:40:27 2003 +++ ./src/depend Thu Sep 23 06:54:47 2004 @@ -11,7 +11,7 @@ LISP_H= #else CONFIG_H=config.h -LISP_H=lisp.h compiler.h config.h dumper.h general-slots.h lrecord.h symeval.h symsinit.h text.h $(LISP_UNION_H) +LISP_H=lisp.h compiler.h config.h dumper.h general-slots.h lrecord.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h $(LISP_UNION_H) #endif #if defined(HAVE_MS_WINDOWS) @@ -35,11 +35,11 @@ #endif #if defined(HAVE_X_WINDOWS) EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h xmu.h -EmacsManager.o: $(CONFIG_H) EmacsManager.h EmacsManagerP.h xintrinsicp.h xmmanagerp.h xmotif.h xmprimitivep.h +EmacsManager.o: $(CONFIG_H) EmacsManager.h EmacsManagerP.h compiler.h xintrinsicp.h xmmanagerp.h xmotif.h xmprimitivep.h EmacsShell-sub.o: $(CONFIG_H) EmacsShell.h EmacsShellP.h xintrinsic.h xintrinsicp.h EmacsShell.o: $(CONFIG_H) EmacsShell.h ExternalShell.h xintrinsicp.h balloon-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h balloon_help.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h xintrinsic.h -balloon_help.o: $(CONFIG_H) balloon_help.h xintrinsic.h +balloon_help.o: $(CONFIG_H) balloon_help.h compiler.h xintrinsic.h console-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h process.h redisplay.h xintrinsic.h device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h systime.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h events.h frame-impl.h frame.h frameslots.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h xintrinsic.h @@ -69,11 +69,11 @@ dialog-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h events.h frame.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h emacs-marshals.o: hash.h emacs-widget-accessors.o: -event-gtk.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h event-gtk.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gtk-xemacs.h lstream.h objects-gtk.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h sysproc.h syssignal.h systime.h systty.h window.h xintrinsic.h -frame-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h +event-gtk.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h event-gtk.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gtk-xemacs.h gui.h lstream.h menubar.h objects-gtk.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h sysproc.h syssignal.h systime.h systty.h window.h xintrinsic.h +frame-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h gccache-gtk.o: $(LISP_H) gccache-gtk.h hash.h glade.o: bytecode.h -glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui.h imgproc.h insdel.h lstream.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h ui-gtk.h window-impl.h window.h winslots.h +glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui.h imgproc.h insdel.h lstream.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h systime.h ui-gtk.h window-impl.h window.h winslots.h gtk-glue.o: objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h gtk-xemacs.o: $(LISP_H) charset.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h event-gtk.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h gui-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h frame.h gui.h opaque.h redisplay.h @@ -85,7 +85,7 @@ select-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame.h opaque.h redisplay.h select-common.h select.h systime.h toolbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame.h redisplay.h toolbar-common.h ui-byhand.o: gui.h -ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console-gtk.h console.h device.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window-impl.h window.h winslots.h +ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window-impl.h window.h winslots.h #endif #if defined(HAVE_DATABASE) database.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h database.h sysfile.h @@ -99,8 +99,8 @@ #endif #if defined(EXTERNAL_WIDGET) ExternalClient-Xlib.o: extw-Xlib.h -ExternalClient.o: $(CONFIG_H) ExternalClient.h ExternalClientP.h extw-Xlib.h extw-Xt.h xintrinsicp.h -ExternalShell.o: $(CONFIG_H) ExternalShell.h ExternalShellP.h extw-Xlib.h extw-Xt.h xintrinsic.h xintrinsicp.h +ExternalClient.o: $(CONFIG_H) ExternalClient.h ExternalClientP.h compiler.h extw-Xlib.h extw-Xt.h xintrinsicp.h +ExternalShell.o: $(CONFIG_H) ExternalShell.h ExternalShellP.h compiler.h extw-Xlib.h extw-Xt.h xintrinsic.h xintrinsicp.h extw-Xlib.o: $(CONFIG_H) extw-Xlib.h extw-Xt.o: $(CONFIG_H) extw-Xlib.h extw-Xt.h #endif @@ -128,12 +128,13 @@ doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h file-coding.h insdel.h keymap.h lstream.h sysfile.h doprnt.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h lstream.h dragdrop.o: $(LISP_H) dragdrop.h -dumper.o: $(LISP_H) coding-system-slots.h console-stream.h console.h elhash.h file-coding.h intl-auto-encap-win32.h lstream.h specifier.h sysfile.h syswindows.h +dump-data.o: $(LISP_H) dump-data.h +dumper.o: $(LISP_H) coding-system-slots.h console-stream.h console.h dump-data.h elhash.h file-coding.h intl-auto-encap-win32.h lstream.h specifier.h sysfile.h syswindows.h dynarr.o: $(LISP_H) ecrt0.o: $(CONFIG_H) editfns.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console.h device.h events.h frame.h insdel.h line-number.h ndir.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h window.h elhash.o: $(LISP_H) bytecode.h elhash.h opaque.h -emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console-msw.h console.h frame.h intl-auto-encap-win32.h paths.h process.h redisplay.h sysdep.h sysdll.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h +emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console-msw.h console.h dump-data.h frame.h intl-auto-encap-win32.h paths.h process.h redisplay.h sysdep.h sysdll.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h emodules.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h console.h emodules.h file-coding.h frame.h insdel.h lstream.h redisplay.h scrollbar.h sysdep.h sysdll.h window.h esd.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h miscplay.h sound.h sysfile.h eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device.h frame.h lstream.h opaque.h profile.h redisplay.h scrollbar.h window.h @@ -195,6 +196,9 @@ nt.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h intl-auto-encap-win32.h ndir.h process.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h ntheap.o: $(LISP_H) intl-auto-encap-win32.h sysdep.h syswindows.h ntplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h intl-auto-encap-win32.h sound.h sysfile.h syswindows.h +number-gmp.o: $(LISP_H) sysproc.h syssignal.h systime.h +number-mp.o: $(LISP_H) +number.o: $(LISP_H) objects.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h elhash.h faces.h frame.h glyphs.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h systty.h window-impl.h window.h winslots.h offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h opaque.o: $(LISP_H) opaque.h @@ -237,20 +241,25 @@ tparam.o: $(LISP_H) undo.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h extents.h unexaix.o: $(LISP_H) getpagesize.h -unexalpha.o: $(CONFIG_H) +unexalpha.o: $(CONFIG_H) compiler.h unexapollo.o: $(CONFIG_H) -unexconvex.o: $(CONFIG_H) getpagesize.h +unexconvex.o: $(CONFIG_H) compiler.h getpagesize.h unexcw.o: $(LISP_H) sysfile.h unexec.o: $(LISP_H) getpagesize.h -unexelf.o: $(CONFIG_H) -unexelfsgi.o: $(CONFIG_H) -unexenix.o: $(CONFIG_H) -unexfreebsd.o: $(CONFIG_H) -unexhp9k3.o: $(CONFIG_H) sysdep.h syssignal.h +unexelf.o: $(CONFIG_H) compiler.h +unexelfsgi.o: $(CONFIG_H) compiler.h +unexencap.o: compiler.h +unexenix.o: $(CONFIG_H) compiler.h +unexfreebsd.o: $(CONFIG_H) compiler.h +unexfx2800.o: compiler.h +unexhp9k3.o: $(CONFIG_H) compiler.h sysdep.h syssignal.h unexhp9k800.o: $(LISP_H) -unexmips.o: $(CONFIG_H) getpagesize.h +unexmips.o: $(CONFIG_H) compiler.h getpagesize.h unexnt.o: $(LISP_H) intl-auto-encap-win32.h sysfile.h syswindows.h -unexsunos4.o: $(CONFIG_H) +unexsni.o: compiler.h +unexsol2-6.o: compiler.h +unexsol2.o: compiler.h +unexsunos4.o: $(CONFIG_H) compiler.h unicode.o: $(LISP_H) charset.h coding-system-slots.h file-coding.h opaque.h sysfile.h vm-limit.o: $(LISP_H) mem-limits.h widget.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h diff --text -u 'xemacs-21.5.17/src/device-gtk.c' 'xemacs-21.5.18/src/device-gtk.c' Index: ./src/device-gtk.c --- ./src/device-gtk.c Wed Oct 1 00:26:40 2003 +++ ./src/device-gtk.c Tue Sep 21 04:19:37 2004 @@ -199,16 +199,13 @@ } static void -gtk_init_device (struct device *d, Lisp_Object props) +gtk_init_device (struct device *d, Lisp_Object UNUSED (props)) { - Lisp_Object device; Lisp_Object display; GtkWidget *app_shell = NULL; GdkVisual *visual = NULL; GdkColormap *cmap = NULL; - device = wrap_device (d); - /* gtk_init() and even gtk_check_init() are so brain dead that getting an empty argv array causes them to abort. */ if (NILP (Vgtk_initial_argv_list)) @@ -236,7 +233,8 @@ new_rc_files = xnew_array_and_zero (gchar *, num_files + 3); - new_rc_files[0] = XSTRING_DATA (gtkrc); + LISP_STRING_TO_EXTERNAL (gtkrc, new_rc_files[0], Qfile_name); + for (ctr = 1; default_files[ctr-1]; ctr++) new_rc_files[ctr] = g_strdup (default_files[ctr-1]); @@ -330,7 +328,7 @@ } static void -gtk_finish_init_device (struct device *d, Lisp_Object props) +gtk_finish_init_device (struct device *UNUSED (d), Lisp_Object UNUSED (props)) { call0 (Qinit_post_gtk_win); } @@ -356,14 +354,11 @@ static void gtk_delete_device (struct device *d) { - Lisp_Object device; - #ifdef FREE_CHECKING extern void (*__free_hook)(); int checking_free; #endif - device = wrap_device (d); if (1) { #ifdef FREE_CHECKING @@ -537,7 +532,7 @@ keyboard events during the grab. Returns t if the grab is successful, nil otherwise. */ - (device, cursor, ignore_keyboard)) + (device, cursor, UNUSED (ignore_keyboard))) { GdkWindow *w; int result; @@ -553,13 +548,13 @@ w = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (device_selected_frame (d))); result = gdk_pointer_grab (w, FALSE, - GDK_POINTER_MOTION_MASK | - GDK_POINTER_MOTION_HINT_MASK | - GDK_BUTTON1_MOTION_MASK | - GDK_BUTTON2_MOTION_MASK | - GDK_BUTTON3_MOTION_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK, + (GdkEventMask) (GDK_POINTER_MOTION_MASK | + GDK_POINTER_MOTION_HINT_MASK | + GDK_BUTTON1_MOTION_MASK | + GDK_BUTTON2_MOTION_MASK | + GDK_BUTTON3_MOTION_MASK | + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK), w, NULL, /* #### BILL!!! Need to create a GdkCursor * as necessary! */ GDK_CURRENT_TIME); @@ -613,7 +608,7 @@ DEFUN ("gtk-ungrab-keyboard", Fgtk_ungrab_keyboard, 0, 1, 0, /* Release a keyboard grab made with `gtk-grab-keyboard'. */ - (device)) + (UNUSED (device))) { gdk_keyboard_ungrab (GDK_CURRENT_TIME); return Qnil; diff --text -u 'xemacs-21.5.17/src/device-msw.c' 'xemacs-21.5.18/src/device-msw.c' Index: ./src/device-msw.c --- ./src/device-msw.c Wed Oct 1 00:26:40 2003 +++ ./src/device-msw.c Tue Sep 21 04:19:37 2004 @@ -136,7 +136,7 @@ /************************************************************************/ static void -mswindows_init_device (struct device *d, Lisp_Object props) +mswindows_init_device (struct device *d, Lisp_Object UNUSED (props)) { HDC hdc; WNDCLASSEXW wc; @@ -252,7 +252,8 @@ } static void -mswindows_finish_init_device (struct device *d, Lisp_Object props) +mswindows_finish_init_device (struct device *UNUSED (d), + Lisp_Object UNUSED (props)) { #ifdef HAVE_DRAGNDROP /* Tell pending clients we are ready. */ @@ -488,7 +489,7 @@ /************************************************************************/ static void -msprinter_init_device (struct device *d, Lisp_Object props) +msprinter_init_device (struct device *d, Lisp_Object UNUSED (props)) { DEVMODEW *pdm; LONG dm_size; @@ -790,7 +791,7 @@ } Lisp_Object -mswindows_handle_print_dialog_box (struct frame *f, Lisp_Object keys) +mswindows_handle_print_dialog_box (struct frame *UNUSED (f), Lisp_Object keys) { Lisp_Object device = Qunbound, settings = Qunbound; DWORD flags = PD_NOSELECTION; @@ -870,7 +871,8 @@ } Lisp_Object -mswindows_handle_page_setup_dialog_box (struct frame *f, Lisp_Object keys) +mswindows_handle_page_setup_dialog_box (struct frame *UNUSED (f), + Lisp_Object keys) { Lisp_Object device = Qunbound, settings = Qunbound; Lisp_Object plist = Qnil; @@ -1114,7 +1116,7 @@ static void print_devmode (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { Lisp_Devmode *dm = XDEVMODE (obj); if (print_readably) @@ -1146,7 +1148,7 @@ } static int -equal_devmode (Lisp_Object obj1, Lisp_Object obj2, int depth) +equal_devmode (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) { Lisp_Devmode *dm1 = XDEVMODE (obj1); Lisp_Devmode *dm2 = XDEVMODE (obj2); diff --text -u 'xemacs-21.5.17/src/device-tty.c' 'xemacs-21.5.18/src/device-tty.c' Index: ./src/device-tty.c --- ./src/device-tty.c Wed Oct 1 00:26:40 2003 +++ ./src/device-tty.c Tue Sep 21 04:19:37 2004 @@ -51,7 +51,7 @@ } static void -tty_init_device (struct device *d, Lisp_Object props) +tty_init_device (struct device *d, Lisp_Object UNUSED (props)) { struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); Lisp_Object terminal_type = CONSOLE_TTY_DATA (con)->terminal_type; @@ -113,7 +113,7 @@ #ifdef SIGWINCH static SIGTYPE -tty_device_size_change_signal (int signo) +tty_device_size_change_signal (int UNUSED (signo)) { int old_errno = errno; asynch_device_change_pending++; diff --text -u 'xemacs-21.5.17/src/device-x.c' 'xemacs-21.5.18/src/device-x.c' Index: ./src/device-x.c --- ./src/device-x.c Tue Mar 9 00:23:03 2004 +++ ./src/device-x.c Fri Oct 15 02:26:23 2004 @@ -180,7 +180,7 @@ } static Lisp_Object -coding_system_of_xrm_database (XrmDatabase db) +coding_system_of_xrm_database (XrmDatabase USED_IF_MULE (db)) { #ifdef MULE const Extbyte *locale = XrmLocaleOfDatabase (db); @@ -492,10 +492,9 @@ static void -x_init_device (struct device *d, Lisp_Object props) +x_init_device (struct device *d, Lisp_Object UNUSED (props)) { Lisp_Object display; - Lisp_Object device; Display *dpy; Widget app_shell; int argc; @@ -581,8 +580,6 @@ } #endif /* HAVE_SHLIB and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */ - - device = wrap_device (d); display = DEVICE_CONNECTION (d); allocate_x_device_struct (d); @@ -786,6 +783,8 @@ validify_resource_component ((char *) XSTRING_DATA (DEVICE_NAME (d)), XSTRING_LENGTH (DEVICE_NAME (d))); + /* #### If we're going to implement X session management, this would + be the place. Make sure it doesn't conflict with GNOME. */ { Arg al[3]; XtSetArg (al[0], XtNvisual, visual); @@ -858,7 +857,7 @@ } static void -x_finish_init_device (struct device *d, Lisp_Object props) +x_finish_init_device (struct device *UNUSED (d), Lisp_Object UNUSED (props)) { call0 (Qinit_post_x_win); } @@ -884,14 +883,12 @@ static void x_delete_device (struct device *d) { - Lisp_Object device; Display *display; #ifdef FREE_CHECKING extern void (*__free_hook) (void *); int checking_free; #endif - device = wrap_device (d); display = DEVICE_X_DISPLAY (d); if (display) @@ -1025,7 +1022,7 @@ } static Lisp_Object -x_error_handler_error (Lisp_Object data, Lisp_Object dummy) +x_error_handler_error (Lisp_Object UNUSED (data), Lisp_Object UNUSED (dummy)) { return Qnil; } @@ -1081,10 +1078,14 @@ /* #### this should issue a warning instead of outputting to stderr */ depth = begin_dont_check_for_quit (); +#if 0 + /* This ends up calling X, which isn't allowed in an X error handler + */ stderr_out ("\n%s: ", (STRINGP (Vinvocation_name) ? (char *) XSTRING_DATA (Vinvocation_name) : "xemacs")); +#endif XmuPrintDefaultErrorMessage (disp, event, stderr); unbind_to (depth); } @@ -1178,7 +1179,7 @@ warn_when_safe (Qx, Qcritical, "I/O Error %d (%s) on display connection\n" - " \"%s\" after after %lu requests (%lu known processed)\n" + " \"%s\" after %lu requests (%lu known processed)\n" " with %d events remaining.\n" " Throwing to top level.\n", errno, errmess, DisplayString (disp), @@ -1194,7 +1195,7 @@ DEVICE_X_BEING_DELETED (d) = 1; Fthrow (Qtop_level, Qnil); - return 0; /* not reached */ + RETURN_NOT_REACHED (0); } DEFUN ("x-debug-mode", Fx_debug_mode, 1, 2, 0, /* diff --text -u 'xemacs-21.5.17/src/device.c' 'xemacs-21.5.18/src/device.c' Index: ./src/device.c --- ./src/device.c Tue Mar 9 00:23:03 2004 +++ ./src/device.c Tue Sep 21 04:19:38 2004 @@ -139,7 +139,8 @@ } static void -print_device (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_device (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { struct device *d = XDEVICE (obj); diff --text -u 'xemacs-21.5.17/src/dgif_lib.c' 'xemacs-21.5.18/src/dgif_lib.c' Index: ./src/dgif_lib.c --- ./src/dgif_lib.c Fri Apr 13 03:23:33 2001 +++ ./src/dgif_lib.c Thu May 6 21:12:13 2004 @@ -740,11 +740,11 @@ case EXTENSION_RECORD_TYPE: DGifGetExtension(GifFile,&sp->Function,&ExtData); - do { + while (ExtData != NULL) { if (AddExtensionBlock(sp, ExtData[0], ExtData+1) == GIF_ERROR) GifInternError(GifFile, D_GIF_ERR_NOT_ENOUGH_MEM); DGifGetExtensionNext(GifFile, &ExtData); - } while (ExtData != NULL); + } break; case TERMINATE_RECORD_TYPE: diff --text -u 'xemacs-21.5.17/src/dialog-gtk.c' 'xemacs-21.5.18/src/dialog-gtk.c' Index: ./src/dialog-gtk.c --- ./src/dialog-gtk.c Sun Mar 9 11:27:41 2003 +++ ./src/dialog-gtk.c Tue Sep 21 04:19:38 2004 @@ -39,7 +39,8 @@ /* We just bounce up into lisp here... see $(srcdir)/lisp/dialog-gtk.el */ static Lisp_Object -gtk_make_dialog_box_internal (struct frame* f, Lisp_Object type, Lisp_Object keys) +gtk_make_dialog_box_internal (struct frame* UNUSED (f), Lisp_Object type, + Lisp_Object keys) { return (call2 (Qgtk_make_dialog_box_internal, type, keys)); } diff --text -u 'xemacs-21.5.17/src/dialog-msw.c' 'xemacs-21.5.18/src/dialog-msw.c' Index: ./src/dialog-msw.c --- ./src/dialog-msw.c Wed Feb 18 00:20:52 2004 +++ ./src/dialog-msw.c Tue Sep 21 04:19:38 2004 @@ -280,7 +280,7 @@ /* Unwind protection decrements dialog count */ static Lisp_Object -dialog_popped_down (Lisp_Object arg) +dialog_popped_down (Lisp_Object UNUSED (arg)) { popup_up_p--; return Qnil; diff --text -u 'xemacs-21.5.17/src/dialog-x.c' 'xemacs-21.5.18/src/dialog-x.c' Index: ./src/dialog-x.c --- ./src/dialog-x.c Wed Oct 1 00:26:40 2003 +++ ./src/dialog-x.c Tue Sep 21 04:19:38 2004 @@ -128,8 +128,8 @@ int count; Lisp_Object wv_closure, gui_item; Lisp_Object question = Qnil; - Lisp_Object title = Qnil; /* #### currently unused */ Lisp_Object buttons = Qnil; + /* Lisp_Object title = Qnil; #### currently unused */ { EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) @@ -142,7 +142,7 @@ else if (EQ (key, Q_title)) { CHECK_STRING (value); - title = value; + /* title = value; */ } else if (EQ (key, Q_buttons)) { @@ -253,7 +253,7 @@ { int dbox_id; widget_value *data; - Widget parent, dbox; + Widget parent; if (!EQ (type, Qquestion)) signal_error (Qunimplemented, "Dialog box type", type); @@ -263,7 +263,7 @@ parent = FRAME_X_SHELL_WIDGET (f); dbox_id = new_lwlib_id (); - dbox = lw_create_widget (data->name, "dialog", dbox_id, data, parent, 1, 0, + (void) lw_create_widget (data->name, "dialog", dbox_id, data, parent, 1, 0, dbox_selection_callback, 0); lw_modify_all_widgets (dbox_id, data, True); lw_modify_all_widgets (dbox_id, data->contents, True); diff --text -u 'xemacs-21.5.17/src/dired.c' 'xemacs-21.5.18/src/dired.c' Index: ./src/dired.c --- ./src/dired.c Wed Oct 1 00:26:40 2003 +++ ./src/dired.c Wed Sep 22 11:06:44 2004 @@ -60,7 +60,8 @@ Return a list of names of files in DIRECTORY. There are four optional arguments: If FULL is non-nil, absolute pathnames of the files are returned. -If MATCH is non-nil, only pathnames containing that regexp are returned. +If MATCH is non-nil, only pathnames whose basename contain that regexp are + returned. If NOSORT is non-nil, the list is not sorted--its order is unpredictable. NOSORT is useful if you plan to sort the result yourself. If FILES-ONLY is the symbol t, then only the "files" in the directory @@ -290,7 +291,7 @@ static Lisp_Object file_name_completion (Lisp_Object file, Lisp_Object directory, int all_flag, - int ver_flag) + int UNUSED (ver_flag)) { /* This function can GC */ DIR *d = 0; diff --text -u 'xemacs-21.5.17/src/doprnt.c' 'xemacs-21.5.18/src/doprnt.c' Index: ./src/doprnt.c --- ./src/doprnt.c Fri Feb 21 15:56:56 2003 +++ ./src/doprnt.c Wed Sep 15 05:54:36 2004 @@ -6,6 +6,7 @@ Rewritten by mly to use varargs.h. Rewritten from scratch by Ben Wing (February 1995) for Mule; expanded to full printf spec. + Support for bignums, ratios, and bigfloats added April 2004 by Jerry James. This file is part of XEmacs. @@ -33,11 +34,24 @@ #include "lstream.h" static const char * const valid_flags = "-+ #0"; -static const char * const valid_converters = "dic" "ouxX" "feEgG" "sS"; +static const char * const valid_converters = "dic" "ouxX" "feEgG" "sS" +#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO) + "npyY" +#endif +#ifdef HAVE_BIGFLOAT + "FhHkK" +#endif + ; static const char * const int_converters = "dic"; static const char * const unsigned_int_converters = "ouxX"; static const char * const double_converters = "feEgG"; static const char * const string_converters = "sS"; +#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO) +static const char * const bignum_converters = "npyY"; +#endif +#ifdef HAVE_BIGFLOAT +static const char * const bigfloat_converters = "FhHkK"; +#endif typedef struct printf_spec printf_spec; struct printf_spec @@ -70,6 +84,7 @@ unsigned long ul; double d; Ibyte *bp; + Lisp_Object obj; }; /* We maintain a list of all the % specs in the specification, @@ -385,6 +400,14 @@ arg.d = va_arg (vargs, double); else if (strchr (string_converters, ch)) arg.bp = va_arg (vargs, Ibyte *); +#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO) + else if (strchr (bignum_converters, ch)) + arg.obj = va_arg (vargs, Lisp_Object); +#endif +#ifdef HAVE_BIGFLOAT + else if (strchr (bigfloat_converters, ch)) + arg.obj = va_arg (vargs, Lisp_Object); +#endif else abort (); Dynarr_add (args, arg); @@ -568,27 +591,124 @@ Lisp_Object obj = largs[spec->argnum - 1]; if (CHARP (obj)) obj = make_int (XCHAR (obj)); +#ifdef WITH_NUMBER_TYPES + if (!NUMBERP (obj)) +#else if (!INT_OR_FLOATP (obj)) +#endif { - syntax_error - ("format specifier %%%c doesn't match argument type", - make_char (ch)); + /* WARNING! This MUST be big enough for the sprintf below */ + CIbyte msg[48]; + sprintf (msg, + "format specifier %%%c doesn't match argument type", + ch); + syntax_error (msg, Qnil); } else if (strchr (double_converters, ch)) - arg.d = XFLOATINT (obj); + { +#ifdef WITH_NUMBER_TYPES + if (INTP (obj) || FLOATP (obj)) + arg.d = XFLOATINT (obj); +#ifdef HAVE_BIGNUM + else if (BIGNUMP (obj)) + arg.d = bignum_to_double (XBIGNUM_DATA (obj)); +#endif +#ifdef HAVE_RATIO + else if (RATIOP (obj)) + arg.d = ratio_to_double (XRATIO_DATA (obj)); +#endif +#ifdef HAVE_BIGFLOAT + else if (BIGFLOATP (obj)) + { + arg.obj = obj; + switch (ch) + { + case 'f': ch = 'F'; break; + case 'e': ch = 'h'; break; + case 'E': ch = 'H'; break; + case 'g': ch = 'k'; break; + case 'G': ch = 'K'; break; + } + } +#endif +#else /* !WITH_NUMBER_TYPES */ + arg.d = XFLOATINT (obj); +#endif /* WITH_NUMBER_TYPES */ + } else { if (FLOATP (obj)) obj = Ftruncate (obj); - - if (strchr (unsigned_int_converters, ch)) - arg.ul = (unsigned long) XINT (obj); - else - arg.l = XINT (obj); +#ifdef HAVE_BIGFLOAT + else if (BIGFLOATP (obj)) + { +#ifdef HAVE_BIGNUM + bignum_set_bigfloat (scratch_bignum, + XBIGFLOAT_DATA (obj)); + if (strchr (unsigned_int_converters, ch) && + bignum_sign (scratch_bignum) < 0) + dead_wrong_type_argument (Qnonnegativep, obj); + obj = + Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#else /* !HAVE_BIGNUM */ + obj = make_int (bigfloat_to_long (XBIGFLOAT_DATA (obj))); +#endif /* HAVE_BIGNUM */ + } +#endif /* HAVE_BIGFLOAT */ +#ifdef HAVE_RATIO + else if (RATIOP (obj)) + { + arg.obj = obj; + switch (ch) + { + case 'i': case 'd': ch = 'n'; break; + case 'o': ch = 'p'; break; + case 'x': ch = 'y'; break; + case 'X': ch = 'Y'; break; + default: /* ch == 'u' */ + if (strchr (unsigned_int_converters, ch) && + ratio_sign (XRATIO_DATA (obj)) < 0) + dead_wrong_type_argument (Qnonnegativep, obj); + else + ch = 'n'; + } + } +#endif +#ifdef HAVE_BIGNUM + if (BIGNUMP (obj)) + { + arg.obj = obj; + switch (ch) + { + case 'i': case 'd': ch = 'n'; break; + case 'o': ch = 'p'; break; + case 'x': ch = 'y'; break; + case 'X': ch = 'Y'; break; + default: /* ch == 'u' */ + if (strchr (unsigned_int_converters, ch) && + bignum_sign (XBIGNUM_DATA (obj)) < 0) + dead_wrong_type_argument (Qnatnump, obj); + else + ch = 'n'; + } + } +#endif + if (INTP (obj)) + { + if (strchr (unsigned_int_converters, ch)) + { +#ifdef HAVE_BIGNUM + if (XINT (obj) < 0) + dead_wrong_type_argument (Qnatnump, obj); +#endif + arg.ul = (unsigned long) XUINT (obj); + } + else + arg.l = XINT (obj); + } } } - if (ch == 'c') { Ichar a; @@ -598,13 +718,62 @@ a = (Ichar) arg.l; if (!valid_ichar_p (a)) - syntax_error ("invalid character value %d to %%c spec", - make_int (a)); + { + /* WARNING! This MUST be big enough for the sprintf below */ + CIbyte msg[60]; + sprintf (msg, "invalid character value %d to %%c spec", + a); + syntax_error (msg, Qnil); + } charlen = set_itext_ichar (charbuf, a); doprnt_2 (stream, charbuf, charlen, spec->minwidth, -1, spec->minus_flag, spec->zero_flag); } +#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO) + else if (strchr (bignum_converters, ch)) + { +#ifdef HAVE_BIGNUM + if (BIGNUMP (arg.obj)) + { + Ibyte *text_to_print = + (Ibyte *) bignum_to_string (XBIGNUM_DATA (arg.obj), + ch == 'n' ? 10 : + (ch == 'p' ? 8 : 16)); + doprnt_2 (stream, text_to_print, + strlen ((const char *) text_to_print), + spec->minwidth, -1, spec->minus_flag, + spec->zero_flag); + xfree (text_to_print, Ibyte *); + } +#endif +#ifdef HAVE_RATIO + if (RATIOP (arg.obj)) + { + Ibyte *text_to_print = + (Ibyte *) ratio_to_string (XRATIO_DATA (arg.obj), + ch == 'n' ? 10 : + (ch == 'p' ? 8 : 16)); + doprnt_2 (stream, text_to_print, + strlen ((const char *) text_to_print), + spec->minwidth, -1, spec->minus_flag, + spec->zero_flag); + xfree (text_to_print, Ibyte *); + } +#endif + } +#endif /* HAVE_BIGNUM || HAVE_RATIO */ +#ifdef HAVE_BIGFLOAT + else if (strchr (bigfloat_converters, ch)) + { + Ibyte *text_to_print = + (Ibyte *) bigfloat_to_string (XBIGFLOAT_DATA (arg.obj), 10); + doprnt_2 (stream, text_to_print, + strlen ((const char *) text_to_print), + spec->minwidth, -1, spec->minus_flag, spec->zero_flag); + xfree (text_to_print, Ibyte *); + } +#endif /* HAVE_BIGFLOAT */ else { /* ASCII Decimal representation uses 2.4 times as many diff --text -u /dev/null 'xemacs-21.5.18/src/dump-data.c' Index: ./src/dump-data.c --- ./src/dump-data.c Thu Jan 1 09:00:00 1970 +++ ./src/dump-data.c Mon Apr 19 23:49:07 2004 @@ -0,0 +1,83 @@ +/* Static array to put the dumped data in and its management + Copyright (C) 2003 Olivier Galibert + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* Mule-ized? Mwahahahahahaha */ + +/* Magic values by Larry McVoy to prevent every known compiler, including + an especially perverse HP-UX one, from putting the array in BSS. +*/ + + +#include <config.h> +#include "lisp.h" +#include "dump-data.h" + +/* 4 bytes for the data size, 4096 for alignment */ + +static unsigned char dumped_data[MAX_SIZE+4096+4] = { + 255, + 6, + 1, + 2, + 3, + 4, + 255, + 3, + 9, + 62, + 255, + 10, + 4, + 61, + 255 +}; + +size_t +dumped_data_size(void) +{ + return dumped_data[0] | (dumped_data[1] << 8) | (dumped_data[2] << 16) | (dumped_data[3] << 24); +} + +size_t +dumped_data_max_size(void) +{ + return MAX_SIZE; +} + +size_t +dumped_data_align_offset(void) +{ + EMACS_INT iptr = (EMACS_INT)dumped_data; + EMACS_INT iptr2; + iptr2 = (iptr+4+4095) & ~(EMACS_INT)4095; + + return iptr2-iptr; +} + +char * +dumped_data_get(void) +{ + EMACS_INT iptr = (EMACS_INT)dumped_data; + iptr = (iptr+4+4095) & ~(EMACS_INT)4095; + return (char *)iptr; +} + diff --text -u /dev/null 'xemacs-21.5.18/src/dump-data.h' Index: ./src/dump-data.h --- ./src/dump-data.h Thu Jan 1 09:00:00 1970 +++ ./src/dump-data.h Mon Apr 19 23:49:07 2004 @@ -0,0 +1,38 @@ +/* Static array to put the dumped data in and its management + Copyright (C) 2003 Olivier Galibert + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef INCLUDED_dump_data_h_ +#define INCLUDED_dump_data_h_ + +/* inline dumped data size */ +size_t dumped_data_size(void); + +/* maximum space available for inline data */ +size_t dumped_data_max_size(void); + +/* alignment offset for data inclusion */ +size_t dumped_data_align_offset(void); + +/* inline data */ +char *dumped_data_get(void); + +#endif diff --text -u 'xemacs-21.5.17/src/dumper.c' 'xemacs-21.5.18/src/dumper.c' Index: ./src/dumper.c --- ./src/dumper.c Wed Oct 1 00:26:40 2003 +++ ./src/dumper.c Tue Sep 21 04:19:38 2004 @@ -40,6 +40,7 @@ #ifdef HAVE_MMAP #include <sys/mman.h> #endif +#include "dump-data.h" #endif typedef struct @@ -960,7 +961,7 @@ static void pdump_allocate_offset (pdump_entry_list_elt *elt, - const struct memory_description *desc) + const struct memory_description *UNUSED (desc)) { Bytecount size = elt->count * elt->size; elt->save_offset = cur_offset; @@ -1507,6 +1508,16 @@ retry_close (fd); return 1; } + +static int +pdump_ram_try (void) +{ + pdump_start = dumped_data_get(); + pdump_length = dumped_data_size(); + + return pdump_load_check(); +} + #endif /* !WIN32_NATIVE */ @@ -1553,12 +1564,19 @@ pdump_load (const Extbyte *argv0) { Extbyte exe_path[PATH_MAX]; + #ifdef WIN32_NATIVE GetModuleFileNameA (NULL, exe_path, PATH_MAX); #else /* !WIN32_NATIVE */ Extbyte *w; const Extbyte *dir, *p; + if(pdump_ram_try()) { + pdump_load_finish(); + in_pdump = 0; + return 1; + } + in_pdump = 1; dir = argv0; if (dir[0] == '-') diff --text -u 'xemacs-21.5.17/src/editfns.c' 'xemacs-21.5.18/src/editfns.c' Index: ./src/editfns.c --- ./src/editfns.c Wed Oct 1 00:26:41 2003 +++ ./src/editfns.c Tue Sep 21 04:19:39 2004 @@ -1553,7 +1553,7 @@ The optional fourth arg BUFFER specifies the buffer to insert the text into. If BUFFER is nil, the current buffer is assumed. */ - (character, count, ignored, buffer)) + (character, count, UNUSED (ignored), buffer)) { /* This function can GC */ REGISTER Ibyte *string; @@ -2329,7 +2329,7 @@ Transposing beyond buffer boundaries is an error. */ - (start1, end1, start2, end2, leave_markers)) + (start1, end1, start2, end2, UNUSED (leave_markers))) { Charbpos startr1, endr1, startr2, endr2; Charcount len1, len2; diff --text -u 'xemacs-21.5.17/src/elhash.c' 'xemacs-21.5.18/src/elhash.c' Index: ./src/elhash.c --- ./src/elhash.c Wed Oct 1 00:26:41 2003 +++ ./src/elhash.c Fri Oct 15 02:26:23 2004 @@ -297,7 +297,7 @@ Examining all entries is too expensive, and examining a random subset does not yield a correct hash function. */ static Hashcode -hash_table_hash (Lisp_Object hash_table, int depth) +hash_table_hash (Lisp_Object hash_table, int UNUSED (depth)) { return XHASH_TABLE (hash_table)->count; } @@ -356,7 +356,8 @@ } static void -print_hash_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_hash_table (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Hash_Table *ht = XHASH_TABLE (obj); @@ -407,7 +408,13 @@ } static void -free_hentries (htentry *hentries, size_t size) +free_hentries (htentry *hentries, +#ifdef ERROR_CHECK_STRUCTURES + size_t size +#else + size_t UNUSED (size) +#endif + ) { #ifdef ERROR_CHECK_STRUCTURES /* Ensure a crash if other code uses the discarded entries afterwards. */ @@ -599,14 +606,14 @@ function. The errors should maybe be continuable, but it is unclear how this would cope with ERRB. */ static int -hash_table_size_validate (Lisp_Object keyword, Lisp_Object value, - Error_Behavior errb) +hash_table_size_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, + Error_Behavior errb) { if (NATNUMP (value)) return 1; maybe_signal_error_1 (Qwrong_type_argument, list2 (Qnatnump, value), - Qhash_table, errb); + Qhash_table, errb); return 0; } @@ -617,7 +624,7 @@ } static int -hash_table_weakness_validate (Lisp_Object keyword, Lisp_Object value, +hash_table_weakness_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, Error_Behavior errb) { if (EQ (value, Qnil)) return 1; @@ -661,8 +668,8 @@ } static int -hash_table_test_validate (Lisp_Object keyword, Lisp_Object value, - Error_Behavior errb) +hash_table_test_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, + Error_Behavior errb) { if (EQ (value, Qnil)) return 1; if (EQ (value, Qeq)) return 1; @@ -670,7 +677,7 @@ if (EQ (value, Qeql)) return 1; maybe_invalid_constant ("Invalid hash table test", - value, Qhash_table, errb); + value, Qhash_table, errb); return 0; } @@ -687,8 +694,8 @@ } static int -hash_table_rehash_size_validate (Lisp_Object keyword, Lisp_Object value, - Error_Behavior errb) +hash_table_rehash_size_validate (Lisp_Object UNUSED (keyword), + Lisp_Object value, Error_Behavior errb) { if (!FLOATP (value)) { @@ -718,8 +725,8 @@ } static int -hash_table_rehash_threshold_validate (Lisp_Object keyword, Lisp_Object value, - Error_Behavior errb) +hash_table_rehash_threshold_validate (Lisp_Object UNUSED (keyword), + Lisp_Object value, Error_Behavior errb) { if (!FLOATP (value)) { @@ -749,8 +756,8 @@ } static int -hash_table_data_validate (Lisp_Object keyword, Lisp_Object value, - Error_Behavior errb) +hash_table_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, + Error_Behavior errb) { int len; diff --text -u 'xemacs-21.5.17/src/emacs-marshals.c' 'xemacs-21.5.18/src/emacs-marshals.c' Index: ./src/emacs-marshals.c --- ./src/emacs-marshals.c Thu May 9 22:49:42 2002 +++ ./src/emacs-marshals.c Sun May 2 13:06:58 2004 @@ -120,7 +120,7 @@ emacs_gtk_marshal_INT__BOOL (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[1]); *return_val = (*rfunc) (GTK_VALUE_BOOL (args[0])); @@ -130,7 +130,7 @@ emacs_gtk_marshal_INT__OBJECT_ARRAY (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[2]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_ARRAY (args[1])); @@ -140,7 +140,7 @@ emacs_gtk_marshal_INT__OBJECT_INT_ARRAY (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[3]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_ARRAY (args[2])); @@ -150,7 +150,7 @@ emacs_gtk_marshal_INT__OBJECT_INT_INT (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[3]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_INT (args[2])); @@ -160,7 +160,7 @@ emacs_gtk_marshal_INT__OBJECT_INT_STRING (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[3]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_STRING (args[2])); @@ -170,7 +170,7 @@ emacs_gtk_marshal_INT__OBJECT_INT (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[2]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_INT (args[1])); @@ -180,7 +180,7 @@ emacs_gtk_marshal_INT__OBJECT_OBJECT (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[2]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_OBJECT (args[1])); @@ -190,7 +190,7 @@ emacs_gtk_marshal_INT__OBJECT_POINTER_INT_INT (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[4]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_POINTER (args[1]), GTK_VALUE_INT (args[2]), GTK_VALUE_INT (args[3])); @@ -200,7 +200,7 @@ emacs_gtk_marshal_INT__OBJECT_POINTER_INT (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[3]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_POINTER (args[1]), GTK_VALUE_INT (args[2])); @@ -210,7 +210,7 @@ emacs_gtk_marshal_INT__OBJECT_POINTER (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[2]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_POINTER (args[1])); @@ -220,7 +220,7 @@ emacs_gtk_marshal_INT__OBJECT_STRING (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[2]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_STRING (args[1])); @@ -230,7 +230,7 @@ emacs_gtk_marshal_INT__OBJECT (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[1]); *return_val = (*rfunc) (GTK_VALUE_OBJECT (args[0])); @@ -240,7 +240,7 @@ emacs_gtk_marshal_INT__POINTER_INT (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[2]); *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_INT (args[1])); @@ -250,7 +250,7 @@ emacs_gtk_marshal_INT__POINTER_STRING_INT (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[3]); *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_INT (args[2])); @@ -260,7 +260,7 @@ emacs_gtk_marshal_INT__POINTER_STRING_STRING (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[3]); *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_STRING (args[2])); @@ -270,7 +270,7 @@ emacs_gtk_marshal_INT__POINTER_STRING (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[2]); *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1])); @@ -280,7 +280,7 @@ emacs_gtk_marshal_INT__POINTER (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[1]); *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0])); @@ -290,7 +290,7 @@ emacs_gtk_marshal_INT__STRING_STRING_INT_ARRAY (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[4]); *return_val = (*rfunc) (GTK_VALUE_STRING (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_INT (args[2]), GTK_VALUE_ARRAY (args[3])); @@ -300,7 +300,7 @@ emacs_gtk_marshal_INT__STRING (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[1]); *return_val = (*rfunc) (GTK_VALUE_STRING (args[0])); @@ -310,7 +310,7 @@ emacs_gtk_marshal_INT__NONE (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; - guint *return_val; + gint *return_val; return_val = GTK_RETLOC_INT (args[0]); *return_val = (*rfunc) (); @@ -424,7 +424,7 @@ __NONE_fn rfunc = (__NONE_fn) func; (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_BOOL (args[2])); } -typedef void (*__NONE__OBJECT_INT_FLOAT_BOOL_fn)(GtkObject *, guint, gfloat, gboolean); +typedef void (*__NONE__OBJECT_INT_FLOAT_BOOL_fn)(GtkObject *, gint, gfloat, gboolean); static void emacs_gtk_marshal_NONE__OBJECT_INT_FLOAT_BOOL (ffi_actual_function func, GtkArg *args) @@ -432,7 +432,7 @@ __NONE__OBJECT_INT_FLOAT_BOOL_fn rfunc = (__NONE__OBJECT_INT_FLOAT_BOOL_fn) func; (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_FLOAT (args[2]), GTK_VALUE_BOOL (args[3])); } -typedef void (*__NONE__OBJECT_INT_FLOAT_fn)(GtkObject *, guint, gfloat); +typedef void (*__NONE__OBJECT_INT_FLOAT_fn)(GtkObject *, gint, gfloat); static void emacs_gtk_marshal_NONE__OBJECT_INT_FLOAT (ffi_actual_function func, GtkArg *args) @@ -454,7 +454,7 @@ __NONE_fn rfunc = (__NONE_fn) func; (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_INT (args[2]), GTK_VALUE_ARRAY (args[3])); } -typedef void (*__NONE__OBJECT_INT_INT_FLOAT_FLOAT_fn)(GtkObject *, guint, guint, gfloat, gfloat); +typedef void (*__NONE__OBJECT_INT_INT_FLOAT_FLOAT_fn)(GtkObject *, gint, gint, gfloat, gfloat); static void emacs_gtk_marshal_NONE__OBJECT_INT_INT_FLOAT_FLOAT (ffi_actual_function func, GtkArg *args) @@ -574,7 +574,7 @@ __NONE_fn rfunc = (__NONE_fn) func; (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_OBJECT (args[1]), GTK_VALUE_BOOL (args[2]), GTK_VALUE_BOOL (args[3])); } -typedef void (*__NONE__OBJECT_OBJECT_FLOAT_INT_fn)(GtkObject *, GtkObject *, gfloat, guint); +typedef void (*__NONE__OBJECT_OBJECT_FLOAT_INT_fn)(GtkObject *, GtkObject *, gfloat, gint); static void emacs_gtk_marshal_NONE__OBJECT_OBJECT_FLOAT_INT (ffi_actual_function func, GtkArg *args) @@ -701,7 +701,7 @@ __NONE_fn rfunc = (__NONE_fn) func; (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_POINTER (args[1]), GTK_VALUE_BOOL (args[2])); } -typedef void (*__NONE__OBJECT_POINTER_INT_FLOAT_FLOAT_fn)(GtkObject *, void *, guint, gfloat, gfloat); +typedef void (*__NONE__OBJECT_POINTER_INT_FLOAT_FLOAT_fn)(GtkObject *, void *, gint, gfloat, gfloat); static void emacs_gtk_marshal_NONE__OBJECT_POINTER_INT_FLOAT_FLOAT (ffi_actual_function func, GtkArg *args) @@ -1070,7 +1070,7 @@ return_val = GTK_RETLOC_OBJECT (args[1]); *return_val = (*rfunc) (GTK_VALUE_INT (args[0])); } -typedef GtkObject * (*__OBJECT__OBJECT_FLOAT_INT_fn)(GtkObject *, gfloat, guint); +typedef GtkObject * (*__OBJECT__OBJECT_FLOAT_INT_fn)(GtkObject *, gfloat, gint); static void emacs_gtk_marshal_OBJECT__OBJECT_FLOAT_INT (ffi_actual_function func, GtkArg *args) diff --text -u 'xemacs-21.5.17/src/emacs.c' 'xemacs-21.5.18/src/emacs.c' Index: ./src/emacs.c --- ./src/emacs.c Fri Nov 21 01:04:47 2003 +++ ./src/emacs.c Tue Sep 21 04:19:39 2004 @@ -272,6 +272,10 @@ #include "console-msw.h" #endif +#ifndef WIN32_NATIVE +#include "dump-data.h" +#endif + /* For PATH_EXEC */ #include <paths.h> @@ -398,7 +402,7 @@ /* Number of bytes of writable memory we can expect to be able to get: Leave this as an unsigned int because it could potentially be 4G */ -unsigned int lim_data; +unsigned long lim_data; /* WARNING! @@ -698,7 +702,13 @@ */ DECLARE_DOESNT_RETURN (main_1 (int, Extbyte **, Extbyte **, int)); DOESNT_RETURN -main_1 (int argc, Extbyte **argv, Extbyte **envp, int restart) +main_1 (int argc, Extbyte **argv, +#if defined (WIN32_NATIVE) || defined (_SCO_DS) + Extbyte **envp, +#else + Extbyte **UNUSED (envp), +#endif + int restart) { char stack_bottom_variable; int skip_args = 0; @@ -820,6 +830,18 @@ exit (0); } + /* Handle the -si/--show-inline-info switch, which means show the + alignment and max size of the inline data and quit */ + if (argmatch (argv, argc, "-si", "--show-inline-info", 0, NULL, &skip_args)) + { +#if defined(PDUMP) && !defined(WIN32_NATIVE) + printf ("%u %u\n", dumped_data_max_size(), dumped_data_align_offset()); +#else + printf ("Portable dumper not configured or windows native; -si just forces exit.\n"); +#endif + exit (0); + } + /* Handle the --no-dump-file/-nd switch, which means don't load the dump file (ignored when not using pdump) */ if (argmatch (argv, argc, "-nd", "--no-dump-file", 0, NULL, &skip_args)) @@ -1301,6 +1323,9 @@ #ifdef HAVE_SHLIB syms_of_module (); #endif +#ifdef WITH_NUMBER_TYPES + syms_of_number (); +#endif syms_of_objects (); syms_of_print (); #if !defined (NO_SUBPROCESSES) @@ -1816,6 +1841,9 @@ vars_of_dired_mswindows (); vars_of_nt (); #endif +#ifdef WITH_NUMBER_TYPES + vars_of_number (); +#endif vars_of_objects (); vars_of_print (); @@ -2275,6 +2303,12 @@ init_initial_directory (); /* get the directory to use for the "*scratch*" buffer, etc. */ +#ifdef WITH_NUMBER_TYPES + /* Set up bignums, ratios, bigfloats, complex numbers. + This must be done before the Lisp reader is set up. */ + init_number (); +#endif + init_lread (); /* Set up the Lisp reader. */ init_cmdargs (argc, (Extbyte **) argv, skip_args); /* Create list Vcommand_line_args */ @@ -2654,7 +2688,7 @@ return Fnreverse (plist); } -DEFUN ("run-emacs-from-temacs", Frun_emacs_from_temacs, 0, MANY, 0, /* +DEFUN_NORETURN ("run-emacs-from-temacs", Frun_emacs_from_temacs, 0, MANY, 0, /* Do not call this. It will reinitialize your XEmacs. You'll be sorry. */ /* If this function is called from startup.el, it will be possible to run @@ -3333,12 +3367,12 @@ /* GCC >= 2.8. -slb */ #if defined (GNU_MALLOC) static void -voodoo_free_hook (void *mem) +voodoo_free_hook (void *UNUSED (mem)) { /* Disable all calls to free() when XEmacs is exiting and it doesn't */ /* matter. */ __free_hook = -#ifdef TYPEOF +#if defined (TYPEOF) && !defined (UNO) /* prototype of __free_hook varies with glibc version */ (TYPEOF (__free_hook)) #endif @@ -3346,7 +3380,7 @@ } #endif /* GNU_MALLOC */ -DEFUN ("kill-emacs", Fkill_emacs, 0, 1, "P", /* +DEFUN_NORETURN ("kill-emacs", Fkill_emacs, 0, 1, "P", /* Exit the XEmacs job and kill it. Ask for confirmation, without argument. If ARG is an integer, return ARG as the exit program code. If ARG is a string, stuff it as keyboard input. @@ -3404,7 +3438,7 @@ #if defined (GNU_MALLOC) __free_hook = -#ifdef TYPEOF +#if defined (TYPEOF) && !defined (UNO) /* prototype of __free_hook varies with glibc version */ (TYPEOF (__free_hook)) #endif @@ -3412,8 +3446,7 @@ #endif exit (INTP (arg) ? XINT (arg) : 0); - /* NOTREACHED */ - return Qnil; /* I'm sick of the compiler warning */ + RETURN_NOT_REACHED (Qnil); } /* -------------------------------- */ @@ -4359,7 +4392,7 @@ the way at the end to make sure that all calls to abort() anywhere in the above code go through assert_failed(). */ -void +DOESNT_RETURN really_abort (void) { abort (); diff --text -u 'xemacs-21.5.17/src/emodules.c' 'xemacs-21.5.18/src/emodules.c' Index: ./src/emodules.c --- ./src/emodules.c Sun Nov 30 07:11:48 2003 +++ ./src/emodules.c Sat May 15 00:34:40 2004 @@ -20,6 +20,9 @@ #include "emodules.h" #include "sysdll.h" +#ifdef HAVE_LTDL +#include <ltdl.h> +#endif /* Load path */ static Lisp_Object Vmodule_load_path; @@ -587,6 +590,13 @@ reinit_vars_of_module (); +#ifdef HAVE_LTDL + lt_dlinit (); + lt_dlmalloc = (lt_ptr (*) (size_t)) xmalloc; + lt_dlrealloc = (lt_ptr (*) (lt_ptr, size_t)) xrealloc; + lt_dlfree = (void (*) (lt_ptr)) xfree_1; +#endif + DEFVAR_LISP ("module-version", &Vmodule_version /* Emacs dynamic loading mechanism version, as a string. diff --text -u 'xemacs-21.5.17/src/esd.c' 'xemacs-21.5.18/src/esd.c' Index: ./src/esd.c --- ./src/esd.c Thu Feb 6 15:36:03 2003 +++ ./src/esd.c Tue Sep 21 04:19:40 2004 @@ -37,14 +37,14 @@ int esd_play_sound_file (Extbyte *file, int vol); int -esd_play_sound_file (Extbyte *file, int vol) +esd_play_sound_file (Extbyte *file, int UNUSED (vol)) { /* #### FIXME: vol is ignored */ return esd_play_file(ESD_NAME, file, 0); } int esd_play_sound_data (UChar_Binary *data, size_t length, int vol); int -esd_play_sound_data (UChar_Binary *data, size_t length, int vol) +esd_play_sound_data (UChar_Binary *data, size_t length, int UNUSED (vol)) { /* #### FIXME: vol is ignored */ size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf); size_t (*sndcnv)(void **dayta,size_t *sz,void **); diff --text -u 'xemacs-21.5.17/src/eval.c' 'xemacs-21.5.18/src/eval.c' Index: ./src/eval.c --- ./src/eval.c Sat Mar 20 22:05:56 2004 +++ ./src/eval.c Wed Sep 22 11:06:45 2004 @@ -411,7 +411,7 @@ /************************************************************************/ static void -print_subr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_subr (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) { Lisp_Subr *subr = XSUBR (obj); const CIbyte *header = @@ -1472,7 +1472,7 @@ DEFUN ("catch", Fcatch, 1, UNEVALLED, 0, /* \(catch TAG BODY...): eval BODY allowing nonlocal exits using `throw'. TAG is evalled to get the tag to use. Then the BODY is executed. -Within BODY, (throw TAG) with same tag exits BODY and exits this `catch'. +Within BODY, (throw TAG) with same (`eq') tag exits BODY and this `catch'. If no throw happens, `catch' returns the value of the last BODY form. If a throw happens, it specifies the value to return from `catch'. */ @@ -1536,8 +1536,8 @@ /* Unwind the specbind, catch, and handler stacks back to CATCH, and jump to that CATCH, returning VALUE as the value of that catch. - This is the guts Fthrow and Fsignal; they differ only in the way - they choose the catch tag to throw to. A catch tag for a + This is the guts of Fthrow and Fsignal; they differ only in the + way they choose the catch tag to throw to. A catch tag for a condition-case form has a TAG of Qnil. Before each catch is discarded, unbind all special bindings and @@ -1549,7 +1549,10 @@ This is used for correct unwinding in Fthrow and Fsignal. */ -static void +static DECLARE_DOESNT_RETURN (unwind_to_catch (struct catchtag *, Lisp_Object, + Lisp_Object)); + +static DOESNT_RETURN unwind_to_catch (struct catchtag *c, Lisp_Object val, Lisp_Object tag) { REGISTER int last_time; @@ -1630,6 +1633,9 @@ LONGJMP (c->jmp, 1); } +static DECLARE_DOESNT_RETURN (throw_or_bomb_out (Lisp_Object, Lisp_Object, int, + Lisp_Object, Lisp_Object)); + static DOESNT_RETURN throw_or_bomb_out (Lisp_Object tag, Lisp_Object val, int bomb_out_p, Lisp_Object sig, Lisp_Object data) @@ -1680,11 +1686,6 @@ else call1 (Qreally_early_error_handler, Fcons (sig, data)); } - - /* can't happen. who cares? - (Sun's compiler does) */ - /* throw_level--; */ - /* getting tired of compilation warnings */ - /* return Qnil; */ } /* See above, where CATCHLIST is defined, for a description of how @@ -1706,14 +1707,14 @@ condition_case_1). See below for more info. */ -DEFUN ("throw", Fthrow, 2, 2, 0, /* +DEFUN_NORETURN ("throw", Fthrow, 2, 2, 0, /* Throw to the catch for TAG and return VALUE from it. -Both TAG and VALUE are evalled. +Both TAG and VALUE are evalled. Tags are the same iff they are `eq'. */ (tag, value)) { throw_or_bomb_out (tag, value, 0, Qnil, Qnil); /* Doesn't return */ - return Qnil; + RETURN_NOT_REACHED (Qnil); } DEFUN ("unwind-protect", Funwind_protect, 1, UNEVALLED, 0, /* @@ -2391,7 +2392,7 @@ UNGCPRO; throw_or_bomb_out (Qtop_level, Qt, 1, error_symbol, data); /* Doesn't return */ - return Qnil; + RETURN_NOT_REACHED (Qnil); } /****************** Error functions class 1 ******************/ @@ -2833,6 +2834,7 @@ signal_error (Qcircular_property_list, 0, list); } +/* Called from within emacs_doprnt_1, so REASON is not formatted. */ DOESNT_RETURN syntax_error (const CIbyte *reason, Lisp_Object frob) { @@ -3762,7 +3764,6 @@ struct backtrace backtrace; int fun_nargs = nargs - 1; Lisp_Object *fun_args = args + 1; - Lisp_Object orig_fun; /* QUIT will check for proper redisplay wrapping */ @@ -3810,8 +3811,6 @@ if (debug_on_next_call) do_debug_on_call (Qlambda); - orig_fun = args[0]; - retry: fun = args[0]; @@ -4748,7 +4747,7 @@ } void -check_allowed_operation (int what, Lisp_Object obj, Lisp_Object prop) +check_allowed_operation (int what, Lisp_Object obj, Lisp_Object UNUSED (prop)) { if (inhibit_flags & INHIBIT_EXISTING_BUFFER_TEXT_MODIFICATION) { @@ -4815,7 +4814,10 @@ void *arg; }; -static Lisp_Object +static DECLARE_DOESNT_RETURN_TYPE + (Lisp_Object, flagged_a_squirmer (Lisp_Object, Lisp_Object, Lisp_Object)); + +static DOESNT_RETURN_TYPE (Lisp_Object) flagged_a_squirmer (Lisp_Object error_conditions, Lisp_Object data, Lisp_Object opaque) { @@ -4853,7 +4855,7 @@ p->data = data; Fthrow (p->catchtag, Qnil); - return Qnil; /* not reached */ + RETURN_NOT_REACHED (Qnil); } static Lisp_Object diff --text -u 'xemacs-21.5.17/src/event-Xt.c' 'xemacs-21.5.18/src/event-Xt.c' Index: ./src/event-Xt.c --- ./src/event-Xt.c Wed Oct 1 00:26:43 2003 +++ ./src/event-Xt.c Tue Sep 21 04:19:40 2004 @@ -851,7 +851,7 @@ Of course, we DO worry about it, so we need a special translation. */ void -emacs_Xt_mapping_action (Widget w, XEvent *event) +emacs_Xt_mapping_action (Widget UNUSED (w), XEvent *event) { struct device *d = get_device_from_display (event->xany.display); @@ -2086,7 +2086,7 @@ /* called by XtAppNextEvent() */ static void -Xt_timeout_callback (XtPointer closure, XtIntervalId *id) +Xt_timeout_callback (XtPointer closure, XtIntervalId *UNUSED (id)) { struct Xt_timeout *timeout = (struct Xt_timeout *) closure; struct Xt_timeout *t2 = pending_timeouts; @@ -2271,7 +2271,7 @@ } static void -Xt_what_callback (void *closure, int *source, XtInputId *id) +Xt_what_callback (void *closure, int *UNUSED (source), XtInputId *UNUSED (id)) { /* If closure is 0, then we got a fake event from a signal handler. The only purpose of this is to make XtAppProcessEvent() stop @@ -2415,7 +2415,7 @@ If we've still got pointers to it in this file, we're gonna lose hard. */ void -debug_process_finalization (Lisp_Process *p) +debug_process_finalization (Lisp_Process *UNUSED (p)) { #if 0 /* #### */ int i; @@ -2476,14 +2476,12 @@ static void emacs_Xt_unselect_console (struct console *con) { - Lisp_Object console; int infd; if (CONSOLE_X_P (con)) return; /* X consoles are automatically selected for when we initialize them in Xt */ infd = event_stream_unixoid_unselect_console (con); - console = wrap_console (con); unselect_filedesc (infd); } @@ -2881,10 +2879,10 @@ } void -emacs_Xt_event_handler (Widget wid /* unused */, - XtPointer closure /* unused */, +emacs_Xt_event_handler (Widget UNUSED (wid), + XtPointer UNUSED (closure), XEvent *event, - Boolean *continue_to_dispatch /* unused */) + Boolean *UNUSED (continue_to_dispatch)) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); @@ -3140,8 +3138,8 @@ static void emacs_Xt_event_widget_focus_in (Widget w, XEvent *event, - String *params, - Cardinal *num_params) + String *UNUSED (params), + Cardinal *UNUSED (num_params)) { struct frame *f = x_any_widget_or_parent_to_frame (get_device_from_display (event->xany.display), w); @@ -3150,10 +3148,10 @@ } static void -emacs_Xt_event_widget_focus_out (Widget w, - XEvent *event, - String *params, - Cardinal *num_params) +emacs_Xt_event_widget_focus_out (Widget UNUSED (w), + XEvent *UNUSED (event), + String *UNUSED (params), + Cardinal *UNUSED (num_params)) { } diff --text -u 'xemacs-21.5.17/src/event-gtk.c' 'xemacs-21.5.18/src/event-gtk.c' Index: ./src/event-gtk.c --- ./src/event-gtk.c Wed Oct 1 00:26:43 2003 +++ ./src/event-gtk.c Tue Sep 21 04:19:41 2004 @@ -58,6 +58,10 @@ #include "dragdrop.h" #endif +#ifdef HAVE_MENUBARS +# include "menubar.h" +#endif + #if defined (HAVE_OFFIX_DND) #include "offix.h" #endif @@ -82,7 +86,7 @@ extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask; extern SELECT_TYPE process_only_mask, tty_only_mask; -static Lisp_Object gtk_keysym_to_emacs_keysym (); +static Lisp_Object gtk_keysym_to_emacs_keysym (guint keysym, int simple_p); void debug_process_finalization (struct Lisp_Process *p); gboolean emacs_gtk_event_handler (GtkWidget *wid /* unused */, GdkEvent *event, @@ -704,7 +708,8 @@ } static void -gtk_what_callback (gpointer closure, gint source, GdkInputCondition why) +gtk_what_callback (gpointer closure, gint UNUSED (source), + GdkInputCondition UNUSED (why)) { /* If closure is 0, then we got a fake event from a signal handler. The only purpose of this is to make XtAppProcessEvent() stop @@ -846,7 +851,7 @@ If we've still got pointers to it in this file, we're gonna lose hard. */ void -debug_process_finalization (struct Lisp_Process *p) +debug_process_finalization (struct Lisp_Process *UNUSED (p)) { #if 0 /* #### */ int i; @@ -964,7 +969,7 @@ gint x, gint y, GtkSelectionData *data, - guint info, + guint UNUSED (info), guint time) { Lisp_Object event = Fmake_event (Qnil, Qnil); @@ -1052,10 +1057,10 @@ } gboolean -dragndrop_dropped (GtkWidget *widget, +dragndrop_dropped (GtkWidget *UNUSED (widget), GdkDragContext *drag_context, - gint x, - gint y, + gint UNUSED (x), + gint UNUSED (y), guint time, gpointer user_data) { @@ -1326,6 +1331,22 @@ GdkEventKey *key_event = &gdk_event->key; Lisp_Object keysym; +#ifdef HAVE_MENUBARS + /* If the user wants see if the event is a menu bar accelerator. + The process of checking absorbs the event and starts menu + processing so send a null event into XEmacs to make sure it + does nothing. + */ + if (!NILP (Vmenu_accelerator_enabled) + && gtk_accel_groups_activate(GTK_OBJECT (FRAME_GTK_SHELL_WIDGET(frame)), + key_event->keyval, + (GdkModifierType) *state)) + { + zero_event(emacs_event); + return 1; + } +#endif + /* This used to compute the frame from the given X window and store it here, but we really don't care about the frame. */ emacs_event->channel = DEVICE_CONSOLE (d); @@ -1392,8 +1413,8 @@ SET_EVENT_BUTTON_MODIFIERS (emacs_event, modifiers); SET_EVENT_TIMESTAMP (emacs_event, button_event->time); SET_EVENT_BUTTON_BUTTON (emacs_event, button_event->button); - SET_EVENT_BUTTON_X (emacs_event, button_event->x); - SET_EVENT_BUTTON_Y (emacs_event, button_event->y); + SET_EVENT_BUTTON_X (emacs_event, (int) button_event->x); + SET_EVENT_BUTTON_Y (emacs_event, (int) button_event->y); } } break; @@ -1495,7 +1516,7 @@ } gboolean -emacs_shell_event_handler (GtkWidget *wid /* unused */, +emacs_shell_event_handler (GtkWidget *UNUSED (wid), GdkEvent *event, gpointer closure) { @@ -1578,7 +1599,7 @@ } static void -emacs_gtk_force_event_pending (struct frame* f) +emacs_gtk_force_event_pending (struct frame* UNUSED (f)) { #if 0 stderr_out ("Force event pending called on frame %p!\n", f); @@ -1720,22 +1741,20 @@ { Display *display = GDK_DISPLAY (); struct gtk_device *xd = DEVICE_GTK_DATA (d); - XModifierKeymap *map = (XModifierKeymap *) xd->x_keysym_map; KeySym *keysym, *keysym_end; Lisp_Object hashtable; int key_code_count, keysyms_per_code; - if (map) - XFree ((char *) map); + if (xd->x_keysym_map) + XFree ((char *) xd->x_keysym_map); XDisplayKeycodes (display, &xd->x_keysym_map_min_code, &xd->x_keysym_map_max_code); key_code_count = xd->x_keysym_map_max_code - xd->x_keysym_map_min_code + 1; - map = (XModifierKeymap *) + xd->x_keysym_map = XGetKeyboardMapping (display, xd->x_keysym_map_min_code, key_code_count, &xd->x_keysym_map_keysyms_per_code); - xd->x_keysym_map = (void *)map; hashtable = xd->x_keysym_map_hashtable; if (HASH_TABLEP (hashtable)) { @@ -1747,7 +1766,7 @@ make_lisp_hash_table (128, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); } - for (keysym = (KeySym *) map, + for (keysym = xd->x_keysym_map, keysyms_per_code = xd->x_keysym_map_keysyms_per_code, keysym_end = keysym + (key_code_count * keysyms_per_code); keysym < keysym_end; diff --text -u 'xemacs-21.5.17/src/event-msw.c' 'xemacs-21.5.18/src/event-msw.c' Index: ./src/event-msw.c --- ./src/event-msw.c Wed Oct 1 00:26:44 2003 +++ ./src/event-msw.c Tue Sep 21 04:19:41 2004 @@ -39,6 +39,14 @@ #include <config.h> #include "lisp.h" +#ifdef CYGWIN +# define USED_IF_CYGWIN(decl) decl +# define UNUSED_IF_CYGWIN(decl) UNUSED (decl) +#else +# define USED_IF_CYGWIN(decl) UNUSED (decl) +# define UNUSED_IF_CYGWIN(decl) decl +#endif + #if defined (CYGWIN) && !defined (HAVE_MSG_SELECT) #error We do not support non-select() versions (i.e. very old) of Cygwin. #endif @@ -1107,7 +1115,7 @@ * handle since it will be invalid and will cause the wait to fail */ void -mswindows_unwait_process (Lisp_Process *p) +mswindows_unwait_process (Lisp_Process *UNUSED_IF_CYGWIN (p)) { #ifndef CYGWIN remove_waitable_handle (get_nt_process_handle (p)); @@ -1145,7 +1153,7 @@ * condition_case. See mswindows_pump_outstanding_events */ static Lisp_Object -mswindows_unsafe_pump_events (void *arg) +mswindows_unsafe_pump_events (void *UNUSED (arg)) { /* This function can call lisp */ Lisp_Object event = Fmake_event (Qnil, Qnil); @@ -1669,7 +1677,8 @@ * Callback procedure for synchronous timer messages */ static void CALLBACK -mswindows_wm_timer_callback (HWND hwnd, UINT umsg, UINT id_timer, DWORD dwtime) +mswindows_wm_timer_callback (HWND UNUSED (hwnd), UINT UNUSED (umsg), + UINT id_timer, DWORD dwtime) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); @@ -1712,7 +1721,7 @@ static Lisp_Object dde_eval_error; static Lisp_Object -dde_error (Lisp_Object err, Lisp_Object obj) +dde_error (Lisp_Object err, Lisp_Object UNUSED (obj)) { dde_eval_error = err; return Qnil; @@ -1881,9 +1890,9 @@ } HDDEDATA CALLBACK -mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, +mswindows_dde_callback (UINT uType, UINT uFmt, HCONV UNUSED (hconv), HSZ hszTopic, HSZ hszItem, HDDEDATA hdata, - DWORD dwData1, DWORD dwData2) + DWORD UNUSED (dwData1), DWORD UNUSED (dwData2)) { switch (uType) { @@ -4054,8 +4063,8 @@ * Only returns non-Qnil for keys that don't generate WM_CHAR messages * or whose ASCII codes (like space) xemacs doesn't like. */ -Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods, - int extendedp) +Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, + int UNUSED (mods), int extendedp) { if (extendedp) /* Keys not present on a 82 key keyboard */ { @@ -4269,7 +4278,7 @@ * Find the console that matches the supplied mswindows window handle */ Lisp_Object -mswindows_find_console (HWND hwnd) +mswindows_find_console (HWND UNUSED (hwnd)) { /* We only support one console */ return XCAR (Vconsole_list); @@ -4614,7 +4623,7 @@ } static void -emacs_mswindows_select_console (struct console *con) +emacs_mswindows_select_console (struct console *USED_IF_CYGWIN (con)) { #ifdef CYGWIN if (CONSOLE_MSWINDOWS_P (con)) @@ -4649,7 +4658,7 @@ } static void -emacs_mswindows_unselect_console (struct console *con) +emacs_mswindows_unselect_console (struct console *USED_IF_CYGWIN (con)) { #ifdef CYGWIN if (CONSOLE_MSWINDOWS_P (con)) @@ -4739,7 +4748,7 @@ static void emacs_mswindows_delete_io_streams (Lisp_Object instream, - Lisp_Object outstream, + Lisp_Object USED_IF_CYGWIN (outstream), Lisp_Object errstream, USID *in_usid, USID *err_usid) @@ -4765,7 +4774,7 @@ } static int -emacs_mswindows_current_event_timestamp (struct console *c) +emacs_mswindows_current_event_timestamp (struct console *UNUSED (c)) { return GetTickCount (); } @@ -4776,7 +4785,7 @@ */ void debug_process_finalization (Lisp_Process *p); void -debug_process_finalization (Lisp_Process *p) +debug_process_finalization (Lisp_Process *UNUSED (p)) { #if 0 /* #### */ Lisp_Object instr, outstr, errstr; diff --text -u 'xemacs-21.5.17/src/event-stream.c' 'xemacs-21.5.18/src/event-stream.c' Index: ./src/event-stream.c --- ./src/event-stream.c Wed Oct 1 00:26:44 2003 +++ ./src/event-stream.c Tue Sep 21 04:19:41 2004 @@ -2606,7 +2606,7 @@ } static int -command_event_p_cb (Lisp_Object ev, void *the_data) +command_event_p_cb (Lisp_Object ev, void *UNUSED (the_data)) { return command_event_p (ev); } @@ -3357,7 +3357,6 @@ { Lisp_Object new_chain = key_sequence_to_event_chain (result); Lisp_Object tempev; - int n; /* If the first_mungeable_event of the other munger is within the events we're munging, then it will point to @@ -3375,7 +3374,6 @@ } /* Now munge the current event chain in the command builder. */ - n = event_chain_count (suffix); command_builder_replace_suffix (builder, suffix, new_chain); builder->first_mungeable_event[munge] = Qnil; @@ -4782,7 +4780,7 @@ /* This junk is so that timestamps don't get to be negative, but contain as many bits as this particular emacs will allow. */ - return make_int (((1L << (VALBITS - 1)) - 1) & tiempo); + return make_int (EMACS_INT_MAX & tiempo); } diff --text -u 'xemacs-21.5.17/src/event-tty.c' 'xemacs-21.5.18/src/event-tty.c' Index: ./src/event-tty.c --- ./src/event-tty.c Thu Feb 13 18:57:07 2003 +++ ./src/event-tty.c Tue Sep 21 04:19:41 2004 @@ -184,25 +184,27 @@ } static void -emacs_tty_format_magic_event (Lisp_Event *emacs_event, Lisp_Object pstream) +emacs_tty_format_magic_event (Lisp_Event *UNUSED (emacs_event), + Lisp_Object UNUSED (pstream)) { /* Nothing to do currently */ } static int -emacs_tty_compare_magic_event (Lisp_Event *e1, Lisp_Event *e2) +emacs_tty_compare_magic_event (Lisp_Event *UNUSED (e1), + Lisp_Event *UNUSED (e2)) { return 1; } static Hashcode -emacs_tty_hash_magic_event (Lisp_Event *e) +emacs_tty_hash_magic_event (Lisp_Event *UNUSED (e)) { return 0; } static void -emacs_tty_handle_magic_event (Lisp_Event *emacs_event) +emacs_tty_handle_magic_event (Lisp_Event *UNUSED (emacs_event)) { /* Nothing to do currently */ } diff --text -u 'xemacs-21.5.17/src/events.c' 'xemacs-21.5.18/src/events.c' Index: ./src/events.c --- ./src/events.c Sun Jan 12 20:08:14 2003 +++ ./src/events.c Wed Oct 20 02:19:06 2004 @@ -41,6 +41,18 @@ #include "console-tty-impl.h" /* for stuff in character_to_event */ +#ifdef HAVE_TTY +#define USED_IF_TTY(decl) decl +#else +#define USED_IF_TTY(decl) UNUSED (decl) +#endif + +#ifdef HAVE_TOOLBARS +#define USED_IF_TOOLBARS(decl) decl +#else +#define USED_IF_TOOLBARS(decl) UNUSED (decl) +#endif + /* Where old events go when they are explicitly deallocated. The event chain here is cut loose before GC, so these will be freed eventually. @@ -311,7 +323,8 @@ } static void -print_event (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_event (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { if (print_readably) printing_unreadable_object ("#<event>"); @@ -376,7 +389,7 @@ } static int -event_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +event_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) { Lisp_Event *e1 = XEVENT (obj1); Lisp_Event *e2 = XEVENT (obj2); @@ -1209,7 +1222,8 @@ void character_to_event (Ichar c, Lisp_Event *event, struct console *con, - int use_console_meta_flag, int do_backspace_mapping) + int use_console_meta_flag, + int USED_IF_TTY (do_backspace_mapping)) { Lisp_Object k = Qnil; int m = 0; @@ -1744,11 +1758,10 @@ /* This junk is so that timestamps don't get to be negative, but contain as many bits as this particular emacs will allow. */ - return make_int (((1L << (VALBITS - 1)) - 1) & - XEVENT_TIMESTAMP (event)); + return make_int (EMACS_INT_MAX & XEVENT_TIMESTAMP (event)); } -#define TIMESTAMP_HALFSPACE (1L << (VALBITS - 2)) +#define TIMESTAMP_HALFSPACE (1L << (INT_VALBITS - 2)) DEFUN ("event-timestamp<", Fevent_timestamp_lessp, 2, 2, 0, /* Return true if timestamp TIME1 is earlier than timestamp TIME2. @@ -2383,7 +2396,7 @@ Return the toolbar button that the mouse event EVENT occurred over. If the event did not occur over a toolbar button, nil is returned. */ - (event)) + (USED_IF_TOOLBARS (event))) { #ifdef HAVE_TOOLBARS Lisp_Object button; diff --text -u 'xemacs-21.5.17/src/extents.c' 'xemacs-21.5.18/src/extents.c' Index: ./src/extents.c --- ./src/extents.c Wed Oct 1 00:26:45 2003 +++ ./src/extents.c Tue Sep 21 04:19:42 2004 @@ -1702,7 +1702,8 @@ static void signal_single_extent_changed (EXTENT extent, Lisp_Object property, - Bytexpos old_start, Bytexpos old_end) + Bytexpos UNUSED (old_start), + Bytexpos UNUSED (old_end)) { EXTENT anc = extent_ancestor (extent); /* Redisplay checks */ @@ -3109,7 +3110,8 @@ } static void -print_extent_1 (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_extent_1 (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { EXTENT ext = XEXTENT (obj); EXTENT anc = extent_ancestor (ext); @@ -7236,7 +7238,8 @@ #ifdef MEMORY_USAGE_STATS int -compute_buffer_extent_usage (struct buffer *b, struct overhead_stats *ovstats) +compute_buffer_extent_usage (struct buffer *UNUSED (b), + struct overhead_stats *UNUSED (ovstats)) { /* #### not yet written */ return 0; diff --text -u 'xemacs-21.5.17/src/extw-Xt.c' 'xemacs-21.5.18/src/extw-Xt.c' Index: ./src/extw-Xt.c --- ./src/extw-Xt.c Tue Nov 12 00:34:13 2002 +++ ./src/extw-Xt.c Sun Jun 6 21:35:45 2004 @@ -28,7 +28,7 @@ ERROR! This ought not be getting compiled if EXTERNAL_WIDGET is undefined #endif -void fatal (const char *fmt, ...); +EXTERN_C void fatal (const char *fmt, ...); #else /* not emacs */ static void fatal (char *msg); #endif @@ -45,34 +45,29 @@ for real? */ #if (XT_REVISION > 5) -int _XtWaitForSomething( - XtAppContext app, - _XtBoolean ignoreEvents, - _XtBoolean ignoreTimers, - _XtBoolean ignoreInputs, - _XtBoolean ignoreSignals, - _XtBoolean block, +EXTERN_C int +_XtWaitForSomething (XtAppContext app, _XtBoolean ignoreEvents, + _XtBoolean ignoreTimers, _XtBoolean ignoreInputs, + _XtBoolean ignoreSignals, _XtBoolean block, #ifdef XTHREADS - _XtBoolean drop_lock, + _XtBoolean drop_lock, #endif - unsigned long *howlong); + unsigned long *howlong); # ifndef XTHREADS -# define _XtwaitForSomething(timers,inputs,events,block,howlong,appCtx) \ - _XtWaitForSomething(appCtx,events,timers,inputs,0,block,howlong) +# define _XT_WAIT_FOR_SOMETHING(timers,inputs,events,block,howlong,appCtx) \ + _XtWaitForSomething (appCtx,events,timers,inputs,0,block,howlong) # else -# define _XtwaitForSomething(timers,inputs,events,block,howlong,appCtx) \ - _XtWaitForSomething(appCtx,events,timers,inputs,0,block,1,howlong) +# define _XT_WAIT_FOR_SOMETHING(timers,inputs,events,block,howlong,appCtx) \ + _XtWaitForSomething (appCtx,events,timers,inputs,0,block,1,howlong) # endif #else -int _XtwaitForSomething( - Boolean ignoreTimers, - Boolean ignoreInputs, - Boolean ignoreEvents, - Boolean block, - unsigned long *howlong, - XtAppContext app - ); +EXTERN_C int +_XtwaitForSomething (Boolean ignoreTimers, Boolean ignoreInputs, + Boolean ignoreEvents, Boolean block, + unsigned long *howlong, XtAppContext app); +# define _XT_WAIT_FOR_SOMETHING(timers,inputs,events,block,howlong,appCtx) \ + _XtwaitForSomething (timers,inputs,events,block,howlong,appCtx) #endif #ifdef DEBUG_WIDGET @@ -93,7 +88,7 @@ { int num = sizeof(geom_masks)/sizeof(int); int i; - + printf (" masks:"); for (i=0; i<num; i++) if (xwg->request_mode & geom_masks[i]) @@ -163,7 +158,7 @@ int format; unsigned long nitems, bytes_after; unsigned char *prop; - + if (XGetWindowProperty(display, win, property, 0, sizeof(*xwg)/4, False, a_EXTW_WIDGET_GEOMETRY, &dummy, &format, &nitems, &bytes_after, @@ -199,7 +194,7 @@ { QueryStruct *q = (QueryStruct *) arg; Widget w = q->w; - + if ( (dpy != XtDisplay(w)) || (event->xany.window != XtWindow(w)) ) { return FALSE; } @@ -218,26 +213,28 @@ Shell.c. */ Bool -extw_wait_for_response(Widget w, XEvent *event, unsigned long request_num, - en_extw_notify type, unsigned long timeout) +extw_wait_for_response (Widget w, XEvent *event, unsigned long request_num, + en_extw_notify type, unsigned long timeout) { - XtAppContext app = XtWidgetToApplicationContext(w); - QueryStruct q; + XtAppContext app = XtWidgetToApplicationContext(w); + QueryStruct q; - XFlush(XtDisplay(w)); - q.w = w; - q.request_num = request_num; - q.type = type; - - for(;;) { - /* - * look for match event - */ - if (XCheckIfEvent( XtDisplay(w), event, isMine, (char*)&q)) - return TRUE; - if (_XtwaitForSomething(TRUE, TRUE, FALSE, TRUE, &timeout, app) - != -1) continue; - if (timeout == 0) - return FALSE; - } + XFlush(XtDisplay(w)); + q.w = w; + q.request_num = request_num; + q.type = type; + + for(;;) + { + /* + * look for match event + */ + if (XCheckIfEvent (XtDisplay(w), event, isMine, (char*)&q)) + return TRUE; + if (_XT_WAIT_FOR_SOMETHING (TRUE, TRUE, FALSE, TRUE, &timeout, app) + != -1) + continue; + if (timeout == 0) + return FALSE; + } } diff --text -u 'xemacs-21.5.17/src/faces.c' 'xemacs-21.5.18/src/faces.c' Index: ./src/faces.c --- ./src/faces.c Mon Jun 30 19:05:44 2003 +++ ./src/faces.c Tue Sep 21 04:19:42 2004 @@ -97,7 +97,7 @@ } static void -print_face (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_face (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) { Lisp_Face *face = XFACE (obj); @@ -289,7 +289,7 @@ /************************************************************************/ static int -face_name_validate (Lisp_Object keyword, Lisp_Object value, +face_name_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, Error_Behavior errb) { if (ERRB_EQ (errb, ERROR_ME)) @@ -387,7 +387,7 @@ }; static int -add_face_to_list_mapper (Lisp_Object key, Lisp_Object value, +add_face_to_list_mapper (Lisp_Object UNUSED (key), Lisp_Object value, void *face_list_closure) { /* This function can GC */ @@ -427,7 +427,7 @@ static int -mark_face_as_clean_mapper (Lisp_Object key, Lisp_Object value, +mark_face_as_clean_mapper (Lisp_Object UNUSED (key), Lisp_Object value, void *flag_closure) { /* This function can GC */ diff --text -u 'xemacs-21.5.17/src/file-coding.c' 'xemacs-21.5.18/src/file-coding.c' Index: ./src/file-coding.c --- ./src/file-coding.c Wed Oct 1 00:26:45 2003 +++ ./src/file-coding.c Wed Sep 22 11:06:46 2004 @@ -69,6 +69,27 @@ Removed the conditionals. */ +/* sjt sez: + +There should be no elementary coding systems in the Lisp API, only chains. +Chains should be declared, not computed, as a sequence of coding formats. +(Probably the internal representation can be a vector for efficiency but +programmers would probably rather work with lists.) A stream has a token +type. Most streams are octet streams. Text is a stream of characters (in +_internal_ format; a file on disk is not text!) An octet-stream has no +implicit semantics, so its format must always be specified. The only type +currently having semantics is characters. This means that the chain [euc-jp +-> internal -> shift_jis) may be specified (euc-jp, shift_jis), and if no +euc-jp -> shift_jis converter is available, then the chain is automatically +constructed. (N.B. I f we have fixed width buffers in the future, then we +could have ASCII -> 8-bit char -> 16-bit char -> ISO-2022-JP (with escape +sequences). + +EOL handling is a char <-> char coding. It should not be part of another +coding system except as a convenience for users. For text coding, +automatically insert EOL handlers between char <-> octet boundaries. +*/ + /* Comments about future work ------------------------------------------------------------------ @@ -157,7 +178,7 @@ results until the text file is reached, whereas the base64, gzip or euc-jp decoders will return higher. Once the text file is reached, the EOL detector will return 0 or higher for the CRLF encoding, and - all other decoders will return 0 or lower; thus, we will successfully + all other detectors will return 0 or lower; thus, we will successfully proceed through CRLF decoding, or at worst prompt the user. (The only external-vs-internal distinction that might make sense here is to favor coding systems of the correct source type over those that @@ -171,6 +192,18 @@ before or after decoding of euc-jp, base64, iso2022, or similar, without any difference in the final results.) + #### What are we trying to say? In base64, the CRLF decoding before + base64 decoding is irrelevant, they will be thrown out as whitespace + is not significant in base64. + + [sjt considers all of this to be rather bogus. Ideas like "greater + certainty" and "distinctive" can and should be quantified. The issue + of proper table organization should be a question of optimization.] + + [sjt wonders if it might not be a good idea to use Unicode's newline + character as the internal representation so that (for non-Unicode + coding systems) we can catch EOL bugs on Unix too.] + -- There need to be two priority lists and two category->coding-system lists. Once is general, the other category->langenv-specific. The user sets the former, the langenv @@ -221,10 +254,32 @@ -- Clearly some of these are more important than others. at the very least, the "better means of presentation" should be - implementation as soon as possibl, along with a very simple means + implemented as soon as possible, along with a very simple means of fail-safe whenever the data is readibly available, e.g. it's coming from a file, which is the most common scenario. +--ben [at least that's what sjt thinks] + +***** + +While this is clearly something of an improvement over earlier designs, +it doesn't deal with the most important issue: to do better than categories +(which in the medium term is mostly going to mean "which flavor of Unicode +is this?"), we need to look at statistical behavior rather than ruling out +categories via presence of specific sequences. This means the stream +processor should + + (1) keep octet distributions (octet, 2-, 3-, 4- octet sequences) + (2) in some kind of compressed form + (3) look for "skip features" (eg, characteristic behavior of leading + bytes for UTF-7, UTF-8, UTF-16, Mule code) + (4) pick up certain "simple" regexps + (5) provide "triggers" to determine when statistical detectors should be + invoked, such as octet count + (6) and "magic" like Unicode signatures or file(1) magic. + +--sjt + ------------------------------------------------------------------ ABOUT FORMATS @@ -309,20 +364,62 @@ checked at all when doing safe-checking?). safe-checking should work something like this: compile a list of all charsets used in the buffer, along with a count of chars - used. that way, "slightly unsafe" charsets can perhaps be - presented at the end, which will lose only a few characters + used. that way, "slightly unsafe" coding systems can perhaps + be presented at the end, which will lose only a few characters and are perhaps what the users were looking for. + [sjt sez this whole step is a crock. If a universal coding system + is unacceptable, the user had better know what he/she is doing, + and explicitly specify a lossy encoding. + In principle, we can simply check for characters being writable as + we go along. Eg, via an "unrepresentable character handler." We + still have the buffer contents. If we can't successfully save, + then ask the user what to do. (Do we ever simply destroy previous + file version before completing a write?)] + 2. when actually writing out, we need error checking in case an individual char in a charset can't be written even though the charsets are safe. again, the user gets the choice of other reasonable coding systems. + [sjt -- something is very confused, here; safe charsets should be + defined as those charsets all of whose characters can be encoded.] + 3. same thing (error checking, list of alternatives, etc.) needs to happen when reading! all of this will be a lot of work! --ben + + I don't much like Ben's scheme. First, this isn't an issue of I/O, + it's a coding issue. It can happen in many places, not just on stream + I/O. Error checking should take place on all translations. Second, + the two-pass algorithm should be avoided if possible. In some cases + (eg, output to a tty) we won't be able to go back and change the + previously output data. Third, the whole idea of having a buffer full + of arbitrary characters which we're going to somehow shoehorn into a + file based on some twit user's less than informed idea of a coding system + is kind of laughable from the start. If we're going to say that a buffer + has a coding system, shouldn't we enforce restrictions on what you can + put into it? Fourth, what's the point of having safe charsets if some + of the characters in them are unsafe? Fifth, what makes you think we're + going to have a list of charsets? It seems to me that there might be + reasons to have user-defined charsets (eg, "German" vs "French" subsets + of ISO 8859/15). Sixth, the idea of having language environment determine + precedence doesn't seem very useful to me. Users who are working with a + language that corresponds to the language environment are not going to + run into safe charsets problems. It's users who are outside of their + usual language environment who run into trouble. Also, the reason for + specifying anything other than a universal coding system is normally + restrictions imposed by other users or applications. Seventh, the + statistical feedback isn't terribly useful. Users rarely "want" a + coding system, they want their file saved in a useful way. We could + add a FORCE argument to conversions for those who really want a specific + coding system. But mostly, a user might want to edit out a few unsafe + characters. So (up to some maximum) we should keep a list of unsafe + text positions, and provide a convenient function for traversing them. + + --sjt */ #include <config.h> @@ -497,8 +594,8 @@ Lisp_Object Qgzip; #endif -/* Maps coding system names to either coding system objects or (for - aliases) other names. */ +/* Maps symbols (coding system names) to either coding system objects or + (for aliases) other names. */ static Lisp_Object Vcoding_system_hash_table; int enable_multibyte_characters; @@ -536,7 +633,7 @@ static void print_coding_system (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { Lisp_Coding_System *c = XCODING_SYSTEM (obj); if (print_readably) @@ -553,7 +650,7 @@ static void print_coding_system_in_print_method (Lisp_Object cs, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { write_fmt_string_lisp (printcharfun, "%s[", 1, XCODING_SYSTEM_NAME (cs)); print_coding_system_properties (cs, printcharfun); @@ -894,7 +991,7 @@ }; static int -add_coding_system_to_list_mapper (Lisp_Object key, Lisp_Object value, +add_coding_system_to_list_mapper (Lisp_Object key, Lisp_Object UNUSED (value), void *coding_system_list_closure) { /* This function can GC */ @@ -910,6 +1007,7 @@ return 0; } +/* #### should we specify a conventional for "all coding systems"? */ DEFUN ("coding-system-list", Fcoding_system_list, 0, 1, 0, /* Return a list of the names of all defined coding systems. If INTERNAL is nil, only the normal (non-internal) coding systems are @@ -1558,6 +1656,8 @@ `ucs-4' is the four-byte encoding; `utf-8' is an ASCII-compatible variable-width 8-bit encoding; `utf-7' is a 7-bit encoding using only characters that will safely pass through all mail gateways. + [[ This should be \"transformation format\". There should also be + `ucs-2' (or `bmp' -- no surrogates) and `utf-32' (range checked). ]] 'little-endian If non-nil, `utf-16' and `ucs-4' will write out the groups of two @@ -1569,7 +1669,8 @@ written out at the beginning of the data. This serves both to identify the endianness of the following data and to mark the data as Unicode (at least, this is how Windows uses it). - + [[ The correct term is \"signature\", since this technique may also + be used with UTF-8. That is the term used in the standard. ]] The following additional properties are recognized if TYPE is @@ -1596,6 +1697,7 @@ The following additional properties are recognized if TYPE is 'undecided: +[[ Doesn't GNU use \"detect-*\" for the following two? ]] 'do-eol Do EOL detection. @@ -1670,6 +1772,8 @@ ? Qt : Qnil; } +/* #### Shouldn't this really be a find/get pair? */ + DEFUN ("coding-system-alias-p", Fcoding_system_alias_p, 1, 1, 0, /* Return t if OBJECT is a coding system alias. All coding system aliases are created by `define-coding-system-alias'. @@ -1695,7 +1799,7 @@ /* A maphash function, for removing dangling coding system aliases. */ static int -dangling_coding_system_alias_p (Lisp_Object alias, +dangling_coding_system_alias_p (Lisp_Object UNUSED (alias), Lisp_Object aliasee, void *dangling_aliases) { @@ -1729,7 +1833,7 @@ */ (alias, aliasee)) { - Lisp_Object real_coding_system, probe; + Lisp_Object probe; CHECK_SYMBOL (alias); @@ -1776,7 +1880,7 @@ aliasee = XCODING_SYSTEM_NAME (aliasee); /* Checks that aliasee names a coding-system */ - real_coding_system = Fget_coding_system (aliasee); + (void) Fget_coding_system (aliasee); /* Check for coding system alias loops */ if (EQ (alias, aliasee)) @@ -1794,7 +1898,8 @@ Fputhash (alias, aliasee, Vcoding_system_hash_table); /* Set up aliases for subsidiaries. - #### There must be a better way to handle subsidiary coding systems. */ + #### There must be a better way to handle subsidiary coding systems. + Inquiring Minds Want To Know: shouldn't they always be chains? */ { static const char *suffixes[] = { "-unix", "-dos", "-mac" }; int i; @@ -1869,8 +1974,8 @@ 1, 1, 0, /* Return the coding system actually used for I/O. In some cases (e.g. when a particular EOL type is specified) this won't be -the coding system itself. This can be useful when trying to track down -more closely how exactly data is decoded. +the coding system itself. This can be useful when trying to determine +precisely how data was decoded. */ (coding_system)) { @@ -2002,6 +2107,8 @@ definition of decoding as converting from external- to internal-formatted data. + [[ REWRITE ME! ]] + #### We really need to abstract out the concept of "data formats" and define "converters" that convert from and to specified formats, eliminating the idea of decoding and encoding. When specifying a @@ -2052,7 +2159,7 @@ /* #### 1024 is arbitrary; we really need to separate 0 from EOF, and when we get 0, keep taking more data until we don't get 0 -- we don't know how much data the conversion routine might need - before it can generate any data of its own */ + before it can generate any data of its own (eg, bzip2). */ Bytecount readmore = str->one_byte_at_a_time ? (Bytecount) 1 : max (size, (Bytecount) 1024); @@ -2462,7 +2569,7 @@ /* The chain of streams looks like this: - [BUFFER] <----- send through + [BUFFER] <----- (( read from/send to loop )) ------> [CHAR->BYTE i.e. ENCODE AS BINARY if source is in bytes] ------> [ENCODE/DECODE AS SPECIFIED] @@ -2474,6 +2581,49 @@ for this] ------> [BUFFER] */ + /* Of course, this is just horrible. BYTE<->CHAR should only be available + to I/O routines. It should not be visible to Mule proper. + + A comment on the implementation. Hrvoje and Kyle worry about the + inefficiency of repeated copying among buffers that chained coding + systems entail. But this may not be as time inefficient as it appears + in the Mule ("house rules") context. The issue is how do you do chain + coding systems without copying? In theory you could have + + IChar external_to_raw (ExtChar *cp, State *s); + IChar decode_utf16 (IChar c, State *s); + IChar decode_crlf (ExtChar *cp, State *s); + + typedef Ichar (*Converter[]) (Ichar, State*); + + Converter utf16[2] = { &decode_utf16, &decode_crlf }; + + void convert (ExtChar *inbuf, IChar *outbuf, Converter cvtr) + { + int i; + ExtChar c; + State s; + + while (c = external_to_raw (*inbuf++, &s)) + { + for (i = 0; i < sizeof(cvtr)/sizeof(Converter); ++i) + if (s.ready) + c = (*cvtr[i]) (c, &s); + } + if (s.ready) + *outbuf++ = c; + } + + But this is a lot of function calls; what Ben is doing is basically + reducing this to one call per buffer-full. The only way to avoid this + is to hardcode all the "interesting" coding systems, maybe using + inline or macros to give structure. But this is still a huge amount + of work, and code. + + One advantage to the call-per-char approach is that we might be able + to do something about the marker/extent destruction that coding + normally entails. + */ while (1) { char tempbuf[1024]; /* some random amount */ @@ -2797,20 +2947,19 @@ { if (data->lstreams) { - /* Order of deletion is important here! Delete from the head of the - chain and work your way towards the tail. In general, when you - delete an object, there should be *NO* pointers to it anywhere. - Deleting back-to-front would be a problem because there are - pointers going forward. If there were pointers in both - directions, you'd have to disconnect the pointers to a particular - object before deleting it. */ + /* During GC, these objects are unmarked, and are about to be freed. + We do NOT want them on the free list, and that will cause lots of + nastiness including crashes. Just let them be freed normally. */ if (!gc_in_progress) { int i; - /* During GC, these objects are unmarked, and are about to be - freed. We do NOT want them on the free list, and that will - cause lots of nastiness including crashes. Just let them be - freed normally. */ + /* Order of deletion is important here! Delete from the head of + the chain and work your way towards the tail. In general, + when you delete an object, there should be *NO* pointers to it + anywhere. Deleting back-to-front would be a problem because + there are pointers going forward. If there were pointers in + both directions, you'd have to disconnect the pointers to a + particular object before deleting it. */ for (i = 0; i < data->lstream_count; i++) Lstream_delete (XLSTREAM ((data->lstreams)[i])); } @@ -2927,7 +3076,10 @@ /* "No conversion"; used for binary files. We use quotes because there really is some conversion being applied (it does byte<->char conversion), but it appears to the user as if the text is read in - without conversion. */ + without conversion. + + #### Shouldn't we _call_ it that, then? And while we're at it, + separate it into "to_internal" and "to_external"? */ DEFINE_CODING_SYSTEM_TYPE (no_conversion); /* This is used when reading in "binary" files -- i.e. files that may @@ -2973,6 +3125,7 @@ c == LEADING_BYTE_CONTROL_1) ch = c; else + /* #### This is just plain unacceptable. */ Dynarr_add (dst, '~'); /* untranslatable character */ } else @@ -3006,8 +3159,8 @@ }; static void -no_conversion_detect (struct detection_state *st, const UExtbyte *src, - Bytecount n) +no_conversion_detect (struct detection_state *st, const UExtbyte *UNUSED (src), + Bytecount UNUSED (n)) { /* Hack until we get better handling of this stuff! */ DET_RESULT (st, no_conversion) = DET_SLIGHTLY_LIKELY; @@ -3024,7 +3177,8 @@ different EOL types itself if it does line-oriented type processing. This is unavoidable because we don't know whether the output of the main encoding routine is ASCII compatible (Unicode is definitely not, -for example). +for example). [[ sjt sez this is bogus. There should be _no_ EOL +processing (or processing of any kind) after conversion to external. ]] There is one parameter: `subtype', either `cr', `lf', `crlf', or nil. */ @@ -3032,6 +3186,10 @@ struct convert_eol_coding_system { enum eol_type subtype; + int dummy; /* On some architectures (eg ia64) the portable dumper can + produce unaligned access errors without this field. Probably + because the combined structure of this structure and + Lisp_Coding_System is not properly aligned. */ }; #define CODING_SYSTEM_CONVERT_EOL_SUBTYPE(codesys) \ @@ -3052,7 +3210,8 @@ DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (convert_eol); static void -convert_eol_print (Lisp_Object cs, Lisp_Object printcharfun, int escapeflag) +convert_eol_print (Lisp_Object cs, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { struct convert_eol_coding_system *data = XCODING_SYSTEM_TYPE_DATA (cs, convert_eol); @@ -3066,7 +3225,7 @@ } static enum source_sink_type -convert_eol_conversion_end_type (Lisp_Object codesys) +convert_eol_conversion_end_type (Lisp_Object UNUSED (codesys)) { return DECODES_CHARACTER_TO_CHARACTER; } @@ -4308,7 +4467,7 @@ DEFINE_CODING_SYSTEM_TYPE (internal); static Bytecount -internal_convert (struct coding_stream *str, const UExtbyte *src, +internal_convert (struct coding_stream *UNUSED (str), const UExtbyte *src, unsigned_char_dynarr *dst, Bytecount n) { Bytecount orign = n; @@ -4805,7 +4964,8 @@ staticpro (&QScoding_system_cookie); #ifdef HAVE_DEFAULT_EOL_DETECTION - /* WARNING: The existing categories are intimately tied to the function + /* #### Find a more appropriate place for this comment. + WARNING: The existing categories are intimately tied to the function `coding-system-category' in coding.el. If you change a category, or change the layout of any coding system associated with a category, you need to check that function and make sure it's written properly. */ @@ -4869,6 +5029,8 @@ #endif } +/* #### reformat this for consistent appearance? */ + void complex_vars_of_file_coding (void) { diff --text -u 'xemacs-21.5.17/src/file-coding.h' 'xemacs-21.5.18/src/file-coding.h' Index: ./src/file-coding.h --- ./src/file-coding.h Thu Apr 24 14:33:44 2003 +++ ./src/file-coding.h Wed Sep 22 11:06:47 2004 @@ -41,14 +41,16 @@ /* Capsule description of the different structures, what their purpose is, how they fit together, and where various bits of data are stored. - A "coding system" is an algorithm for converting data in one format into - data in another format. Currently most of the coding systems we have - created concern internationalized text, and convert between the XEmacs - internal format for multilingual text, and various external + A "coding system" is an algorithm for converting stream data in one format + into stream data in another format. Currently most of the coding systems + we have created concern internationalized text, and convert between the + XEmacs internal format for multilingual text, and various external representations of such text. However, any such conversion is possible, for example, compressing or uncompressing text using the gzip algorithm. All coding systems provide both encode and decode routines, so that the - conversion can go both ways. + conversion can go both ways. Unfortunately encoding and decoding may not + be exact inverses, even for a specific instance of a coding system. Care + must be taken when this is not the case. The way we handle this is by dividing the various potential coding systems into types, analogous to classes in C++. Each coding system @@ -121,7 +123,9 @@ the Lisp primitives `set-process-input-coding-system' and `set-console-tty-input-coding-system', as well as getting set when a conversion operation was started with coding system `undecided' and the - correct coding system was then detected.) + correct coding system was then detected.) #### This suggests implementing + compound text extended segments by saving the state of the ctext stream, + and installing an appropriate for the duration of the segment. IMPORTANT NOTE: There are at least two ancillary data structures associated with a coding system type. (There may also be detection data; @@ -187,10 +191,6 @@ struct lcrecord_header header; struct coding_system_methods *methods; - /* If true, this is an internal coding system, which will not show up in - coding-system-list unless a special parameter is given to it. */ - int internal_p; - #define CODING_SYSTEM_SLOT_DECLARATION #define MARKED_SLOT(x) Lisp_Object x; #include "coding-system-slots.h" @@ -199,6 +199,10 @@ coding-system-slots.h. */ enum eol_type eol_type; + /* If true, this is an internal coding system, which will not show up in + coding-system-list unless a special parameter is given to it. */ + int internal_p; + /* type-specific extra data attached to a coding_system */ char data[1]; }; @@ -868,7 +872,7 @@ because the write method is forced to take only what it's given but the read method can read more data from the other end if necessary. On the other hand, the write method is free to generate all the data - it wants (and just write it to the other end), but the the read method + it wants (and just write it to the other end), but the read method can return only as much as was asked for, so we need to implement our own buffering. */ diff --text -u 'xemacs-21.5.17/src/fileio.c' 'xemacs-21.5.18/src/fileio.c' Index: ./src/fileio.c --- ./src/fileio.c Wed Oct 1 00:26:46 2003 +++ ./src/fileio.c Tue Sep 21 04:19:43 2004 @@ -1975,7 +1975,8 @@ } static Lisp_Object -internal_delete_file_1 (Lisp_Object ignore, Lisp_Object ignore2) +internal_delete_file_1 (Lisp_Object UNUSED (ignore), + Lisp_Object UNUSED (ignore2)) { return Qt; } @@ -3829,7 +3830,8 @@ } static Lisp_Object -auto_save_error (Lisp_Object condition_object, Lisp_Object ignored) +auto_save_error (Lisp_Object UNUSED (condition_object), + Lisp_Object UNUSED (ignored)) { /* This function can call lisp */ if (gc_in_progress) @@ -3849,7 +3851,7 @@ } static Lisp_Object -auto_save_1 (Lisp_Object ignored) +auto_save_1 (Lisp_Object UNUSED (ignored)) { /* This function can call lisp */ /* #### I think caller is protecting current_buffer? */ @@ -3883,7 +3885,8 @@ } static Lisp_Object -auto_save_expand_name_error (Lisp_Object condition_object, Lisp_Object ignored) +auto_save_expand_name_error (Lisp_Object condition_object, + Lisp_Object UNUSED (ignored)) { warn_when_safe_lispobj (Qfile, Qerror, diff --text -u 'xemacs-21.5.17/src/filemode.c' 'xemacs-21.5.18/src/filemode.c' Index: ./src/filemode.c --- ./src/filemode.c Fri May 9 18:50:42 2003 +++ ./src/filemode.c Tue Sep 21 04:19:43 2004 @@ -150,7 +150,13 @@ according to the file mode BITS. */ static void -setst (unsigned short bits, char *chars) +setst ( +#if defined(S_ISUID) || defined(S_ISGID) || defined(S_ISVTX) + unsigned short bits, char *chars +#else + unsigned short UNUSED (bits), char *UNUSED (chars) +#endif + ) { #ifdef S_ISUID if (bits & S_ISUID) diff --text -u 'xemacs-21.5.17/src/floatfns.c' 'xemacs-21.5.18/src/floatfns.c' Index: ./src/floatfns.c --- ./src/floatfns.c Sun Jan 12 20:08:15 2003 +++ ./src/floatfns.c Tue Sep 21 04:19:43 2004 @@ -119,19 +119,33 @@ /* Convert float to Lisp Integer if it fits, else signal a range - error using the given arguments. */ + error using the given arguments. If bignums are available, range errors + are never signaled. */ static Lisp_Object -float_to_int (double x, const char *name, Lisp_Object num, Lisp_Object num2) +float_to_int (double x, +#ifdef HAVE_BIGNUM + const char *UNUSED (name), Lisp_Object UNUSED (num), + Lisp_Object UNUSED (num2) +#else + const char *name, Lisp_Object num, Lisp_Object num2 +#endif + ) { - if (x >= ((EMACS_INT) 1 << (VALBITS-1)) - || x <= - ((EMACS_INT) 1 << (VALBITS-1)) - (EMACS_INT) 1) - { - if (!UNBOUNDP (num2)) - range_error2 (name, num, num2); - else - range_error (name, num); - } - return (make_int ((EMACS_INT) x)); +#ifdef HAVE_BIGNUM + bignum_set_double (scratch_bignum, x); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#else + REGISTER EMACS_INT result = (EMACS_INT) x; + + if (result > EMACS_INT_MAX || result < EMACS_INT_MIN) + { + if (!UNBOUNDP (num2)) + range_error2 (name, num, num2); + else + range_error (name, num); + } + return make_int (result); +#endif /* HAVE_BIGNUM */ } @@ -159,19 +173,19 @@ static Lisp_Object -mark_float (Lisp_Object obj) +mark_float (Lisp_Object UNUSED (obj)) { return Qnil; } static int -float_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +float_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) { return (extract_float (obj1) == extract_float (obj2)); } static Hashcode -float_hash (Lisp_Object obj, int depth) +float_hash (Lisp_Object obj, int UNUSED (depth)) { /* mod the value down to 32-bit range */ /* #### change for 64-bit machines */ @@ -199,6 +213,21 @@ if (INTP (num)) return (double) XINT (num); +#ifdef HAVE_BIGNUM + if (BIGNUMP (num)) + return bignum_to_double (XBIGNUM_DATA (num)); +#endif + +#ifdef HAVE_RATIO + if (RATIOP (num)) + return ratio_to_double (XRATIO_DATA (num)); +#endif + +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (num)) + return bigfloat_to_double (XBIGFLOAT_DATA (num)); +#endif + return extract_float (wrong_type_argument (Qnumberp, num)); } @@ -421,6 +450,21 @@ */ (number1, number2)) { +#ifdef HAVE_BIGNUM + if (INTEGERP (number1) && INTP (number2)) + { + if (INTP (number1)) + { + bignum_set_long (scratch_bignum2, XREALINT (number1)); + bignum_pow (scratch_bignum, scratch_bignum2, XREALINT (number2)); + } + else + bignum_pow (scratch_bignum, XBIGNUM_DATA (number1), + XREALINT (number2)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } +#endif + if (INTP (number1) && /* common lisp spec */ INTP (number2)) /* don't promote, if both are ints */ { @@ -451,6 +495,23 @@ return make_int (retval); } +#if defined(HAVE_BIGFLOAT) && defined(bigfloat_pow) + if (BIGFLOATP (number1) && INTEGERP (number2)) + { + unsigned long exponent; + +#ifdef HAVE_BIGNUM + if (BIGNUMP (number2)) + exponent = bignum_to_ulong (XBIGNUM_DATA (number2)); + else +#endif + exponent = XUINT (number2); + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number1)); + bigfloat_pow (scratch_bigfloat, XBIGFLOAT_DATA (number1), exponent); + return make_bigfloat_bf (scratch_bigfloat); + } +#endif + { double f1 = extract_float (number1); double f2 = extract_float (number2); @@ -516,7 +577,17 @@ */ (number)) { - double d = extract_float (number); + double d; + +#if defined(HAVE_BIGFLOAT) && defined(bigfloat_sqrt) + if (BIGFLOATP (number)) + { + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number)); + bigfloat_sqrt (scratch_bigfloat, XBIGFLOAT_DATA (number)); + return make_bigfloat_bf (scratch_bigfloat); + } +#endif /* HAVE_BIGFLOAT */ + d = extract_float (number); #ifdef FLOAT_CHECK_DOMAIN if (d < 0.0) domain_error ("sqrt", number); @@ -648,7 +719,43 @@ } if (INTP (number)) +#ifdef HAVE_BIGNUM + /* The most negative Lisp fixnum will overflow */ + return (XINT (number) >= 0) ? number : make_integer (- XINT (number)); +#else return (XINT (number) >= 0) ? number : make_int (- XINT (number)); +#endif + +#ifdef HAVE_BIGNUM + if (BIGNUMP (number)) + { + if (bignum_sign (XBIGNUM_DATA (number)) >= 0) + return number; + bignum_abs (scratch_bignum, XBIGNUM_DATA (number)); + return make_bignum_bg (scratch_bignum); + } +#endif + +#ifdef HAVE_RATIO + if (RATIOP (number)) + { + if (ratio_sign (XRATIO_DATA (number)) >= 0) + return number; + ratio_abs (scratch_ratio, XRATIO_DATA (number)); + return make_ratio_rt (scratch_ratio); + } +#endif + +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (number)) + { + if (bigfloat_sign (XBIGFLOAT_DATA (number)) >= 0) + return number; + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number)); + bigfloat_abs (scratch_bigfloat, XBIGFLOAT_DATA (number)); + return make_bigfloat_bf (scratch_bigfloat); + } +#endif return Fabs (wrong_type_argument (Qnumberp, number)); } @@ -661,6 +768,29 @@ if (INTP (number)) return make_float ((double) XINT (number)); +#ifdef HAVE_BIGNUM + if (BIGFLOATP (number)) + { +#ifdef HAVE_BIGFLOAT + if (ZEROP (Vdefault_float_precision)) +#endif + return make_float (bignum_to_double (XBIGNUM_DATA (number))); +#ifdef HAVE_BIGFLOAT + else + { + bigfloat_set_prec (scratch_bigfloat, bigfloat_get_default_prec ()); + bigfloat_set_bignum (scratch_bigfloat, XBIGNUM_DATA (number)); + return make_bigfloat_bf (scratch_bigfloat); + } +#endif /* HAVE_BIGFLOAT */ + } +#endif /* HAVE_BIGNUM */ + +#ifdef HAVE_RATIO + if (RATIOP (number)) + return make_float (ratio_to_double (XRATIO_DATA (number))); +#endif + if (FLOATP (number)) /* give 'em the same float back */ return number; @@ -676,7 +806,7 @@ double f = extract_float (number); if (f == 0.0) - return make_int (- (EMACS_INT)(((EMACS_UINT) 1) << (VALBITS - 1))); /* most-negative-fixnum */ + return make_int (EMACS_INT_MIN); #ifdef HAVE_LOGB { Lisp_Object val; @@ -730,9 +860,36 @@ return (float_to_int (d, "ceiling", number, Qunbound)); } +#ifdef HAVE_BIGNUM + if (INTEGERP (number)) +#else if (INTP (number)) +#endif return number; +#ifdef HAVE_RATIO + if (RATIOP (number)) + { + bignum_ceil (scratch_bignum, XRATIO_NUMERATOR (number), + XRATIO_DENOMINATOR (number)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } +#endif + +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (number)) + { + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number)); + bigfloat_ceil (scratch_bigfloat, XBIGFLOAT_DATA (number)); +#ifdef HAVE_BIGNUM + bignum_set_bigfloat (scratch_bignum, scratch_bigfloat); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#else + return make_int ((EMACS_INT) bigfloat_to_long (scratch_bigfloat)); +#endif /* HAVE_BIGNUM */ + } +#endif /* HAVE_BIGFLOAT */ + return Fceiling (wrong_type_argument (Qnumberp, number)); } @@ -744,6 +901,99 @@ */ (number, divisor)) { +#ifdef WITH_NUMBER_TYPES + CHECK_REAL (number); + if (NILP (divisor)) + { + if (FLOATP (number)) + { + double d; + IN_FLOAT ((d = floor (XFLOAT_DATA (number))), "floor", number); + return (float_to_int (d, "floor", number, Qunbound)); + } +#ifdef HAVE_RATIO + else if (RATIOP (number)) + { + bignum_floor (scratch_bignum, XRATIO_NUMERATOR (number), + XRATIO_DENOMINATOR (number)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } +#endif +#ifdef HAVE_BIGFLOAT + else if (BIGFLOATP (number)) + { + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number)); + bigfloat_floor (scratch_bigfloat, XBIGFLOAT_DATA (number)); + return make_bigfloat_bf (scratch_bigfloat); + } +#endif + return number; + } + else + { + CHECK_REAL (divisor); + switch (promote_args (&number, &divisor)) + { + case FIXNUM_T: + { + EMACS_INT i1 = XREALINT (number); + EMACS_INT i2 = XREALINT (divisor); + + if (i2 == 0) + Fsignal (Qarith_error, Qnil); + + /* With C's /, the result is implementation-defined if either + operand is negative, so use only nonnegative operands. */ + i1 = (i2 < 0 + ? (i1 <= 0 ? -i1 / -i2 : -1 - ((i1 - 1) / -i2)) + : (i1 < 0 ? -1 - ((-1 - i1) / i2) : i1 / i2)); + + return make_int (i1); + } +#ifdef HAVE_BIGNUM + case BIGNUM_T: + if (bignum_sign (XBIGNUM_DATA (divisor)) == 0) + Fsignal (Qarith_error, Qnil); + bignum_floor (scratch_bignum, XBIGNUM_DATA (number), + XBIGNUM_DATA (divisor)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#endif +#ifdef HAVE_RATIO + case RATIO_T: + if (ratio_sign (XRATIO_DATA (divisor)) == 0) + Fsignal (Qarith_error, Qnil); + ratio_div (scratch_ratio, XRATIO_DATA (number), + XRATIO_DATA (divisor)); + bignum_floor (scratch_bignum, ratio_numerator (scratch_ratio), + ratio_denominator (scratch_ratio)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#endif +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + if (bigfloat_sign (XBIGFLOAT_DATA (divisor)) == 0) + Fsignal (Qarith_error, Qnil); + bigfloat_set_prec (scratch_bigfloat, + max (XBIGFLOAT_GET_PREC (number), + XBIGFLOAT_GET_PREC (divisor))); + bigfloat_div (scratch_bigfloat, XBIGFLOAT_DATA (number), + XBIGFLOAT_DATA (divisor)); + bigfloat_floor (scratch_bigfloat, scratch_bigfloat); + return make_bigfloat_bf (scratch_bigfloat); +#endif + default: /* FLOAT_T */ + { + double f1 = extract_float (number); + double f2 = extract_float (divisor); + + if (f2 == 0.0) + Fsignal (Qarith_error, Qnil); + + IN_FLOAT2 (f1 = floor (f1 / f2), "floor", number, divisor); + return float_to_int (f1, "floor", number, divisor); + } + } + } +#else /* !WITH_NUMBER_TYPES */ CHECK_INT_OR_FLOAT (number); if (! NILP (divisor)) @@ -787,6 +1037,7 @@ } return number; +#endif /* WITH_NUMBER_TYPES */ } DEFUN ("round", Fround, 1, 1, 0, /* @@ -802,9 +1053,51 @@ return (float_to_int (d, "round", number, Qunbound)); } +#ifdef HAVE_BIGNUM + if (INTEGERP (number)) +#else if (INTP (number)) +#endif return number; +#ifdef HAVE_RATIO + if (RATIOP (number)) + { + if (bignum_divisible_p (XRATIO_NUMERATOR (number), + XRATIO_DENOMINATOR (number))) + { + bignum_div (scratch_bignum, XRATIO_NUMERATOR (number), + XRATIO_DENOMINATOR (number)); + } + else + { + bignum_add (scratch_bignum2, XRATIO_NUMERATOR (number), + XRATIO_DENOMINATOR (number)); + bignum_div (scratch_bignum, scratch_bignum2, + XRATIO_DENOMINATOR (number)); + } + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } +#endif + +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (number)) + { + unsigned long prec = XBIGFLOAT_GET_PREC (number); + bigfloat_set_prec (scratch_bigfloat, prec); + bigfloat_set_prec (scratch_bigfloat2, prec); + bigfloat_set_double (scratch_bigfloat2, + bigfloat_sign (XBIGFLOAT_DATA (number)) * 0.5); + bigfloat_floor (scratch_bigfloat, scratch_bigfloat2); +#ifdef HAVE_BIGNUM + bignum_set_bigfloat (scratch_bignum, scratch_bigfloat); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#else + return make_int ((EMACS_INT) bigfloat_to_long (scratch_bigfloat)); +#endif /* HAVE_BIGNUM */ + } +#endif /* HAVE_BIGFLOAT */ + return Fround (wrong_type_argument (Qnumberp, number)); } @@ -817,9 +1110,36 @@ if (FLOATP (number)) return float_to_int (XFLOAT_DATA (number), "truncate", number, Qunbound); +#ifdef HAVE_BIGNUM + if (INTEGERP (number)) +#else if (INTP (number)) +#endif return number; +#ifdef HAVE_RATIO + if (RATIOP (number)) + { + bignum_div (scratch_bignum, XRATIO_NUMERATOR (number), + XRATIO_DENOMINATOR (number)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } +#endif + +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (number)) + { + bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number)); + bigfloat_trunc (scratch_bigfloat, XBIGFLOAT_DATA (number)); +#ifdef HAVE_BIGNUM + bignum_set_bigfloat (scratch_bignum, scratch_bigfloat); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#else + return make_int ((EMACS_INT) bigfloat_to_long (scratch_bigfloat)); +#endif /* HAVE_BIGNUM */ + } +#endif /* HAVE_BIGFLOAT */ + return Ftruncate (wrong_type_argument (Qnumberp, number)); } diff --text -u 'xemacs-21.5.17/src/fns.c' 'xemacs-21.5.18/src/fns.c' Index: ./src/fns.c --- ./src/fns.c Fri Feb 20 16:29:17 2004 +++ ./src/fns.c Tue Sep 21 04:19:43 2004 @@ -65,13 +65,14 @@ Lisp_Object safe_copy_tree (Lisp_Object arg, Lisp_Object vecp, int depth); static Lisp_Object -mark_bit_vector (Lisp_Object obj) +mark_bit_vector (Lisp_Object UNUSED (obj)) { return Qnil; } static void -print_bit_vector (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_bit_vector (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Elemcount i; Lisp_Bit_Vector *v = XBIT_VECTOR (obj); @@ -94,7 +95,7 @@ } static int -bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) { Lisp_Bit_Vector *v1 = XBIT_VECTOR (obj1); Lisp_Bit_Vector *v2 = XBIT_VECTOR (obj2); @@ -106,7 +107,7 @@ } static Hashcode -bit_vector_hash (Lisp_Object obj, int depth) +bit_vector_hash (Lisp_Object obj, int UNUSED (depth)) { Lisp_Bit_Vector *v = XBIT_VECTOR (obj); return HASH2 (bit_vector_length (v), @@ -149,9 +150,9 @@ DEFUN ("random", Frandom, 0, 1, 0, /* Return a pseudo-random number. -All integers representable in Lisp are equally likely. - On most systems, this is 28 bits' worth. +All fixnums are equally likely. On most systems, this is 31 bits' worth. With positive integer argument N, return random number in interval [0,N). +N can be a bignum, in which case the range of possible values is extended. With argument t, set the random number seed from the current time and pid. */ (limit)) @@ -170,11 +171,18 @@ it's possible to get a quotient larger than limit; discarding these values eliminates the bias that would otherwise appear when using a large limit. */ - denominator = ((unsigned long)1 << VALBITS) / XINT (limit); + denominator = ((unsigned long)1 << INT_VALBITS) / XINT (limit); do val = get_random () / denominator; while (val >= XINT (limit)); } +#ifdef HAVE_BIGNUM + else if (BIGNUMP (limit)) + { + bignum_random (scratch_bignum, XBIGNUM_DATA (limit)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); + } +#endif else val = get_random (); @@ -2840,8 +2848,33 @@ QUIT; if (EQ_WITH_EBOLA_NOTICE (obj1, obj2)) return 1; +#ifdef WITH_NUMBER_TYPES + if (NUMBERP (obj1) && NUMBERP (obj2)) + { + switch (promote_args (&obj1, &obj2)) + { + case FIXNUM_T: + return XREALINT (obj1) == XREALINT (obj2); +#ifdef HAVE_BIGNUM + case BIGNUM_T: + return bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2)); +#endif +#ifdef HAVE_RATIO + case RATIO_T: + return ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2)); +#endif + case FLOAT_T: + return XFLOAT_DATA (obj1) == XFLOAT_DATA (obj2); +#ifdef HAVE_BIGFLOAT + case BIGFLOAT_T: + return bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2)); +#endif + } + } +#else if ((INTP (obj1) && FLOATP (obj2)) || (FLOATP (obj1) && INTP (obj2))) return extract_float (obj1) == extract_float (obj2); +#endif if (CHARP (obj1) && CHARP (obj2)) return DOWNCASE (0, XCHAR (obj1)) == DOWNCASE (0, XCHAR (obj2)); if (XTYPE (obj1) != XTYPE (obj2)) @@ -3643,6 +3676,9 @@ The octets are divided into 6 bit chunks, which are then encoded into base64 characters. */ +static DECLARE_DOESNT_RETURN (base64_conversion_error (const char *, + Lisp_Object)); + static DOESNT_RETURN base64_conversion_error (const char *reason, Lisp_Object frob) { diff --text -u 'xemacs-21.5.17/src/frame-gtk.c' 'xemacs-21.5.18/src/frame-gtk.c' Index: ./src/frame-gtk.c --- ./src/frame-gtk.c Wed Oct 1 00:26:47 2003 +++ ./src/frame-gtk.c Tue Sep 21 04:19:44 2004 @@ -1,4 +1,4 @@ -/* Functions for the X window system. +/* Functions for the GTK toolkit. Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. @@ -39,6 +39,7 @@ #include "dragdrop.h" #endif +#include "elhash.h" #include "console-gtk-impl.h" #include "glyphs-gtk.h" #include "objects-gtk-impl.h" @@ -55,7 +56,6 @@ #define INTERNAL_BORDER_WIDTH 0 #define TRANSIENT_DATA_IDENTIFIER "xemacs::transient_for" -#define FRAME_DATA_IDENTIFIER "xemacs::frame" #define UNMAPPED_DATA_IDENTIFIER "xemacs::initially_unmapped" #define STUPID_X_SPECIFIC_GTK_STUFF @@ -113,6 +113,23 @@ /* helper functions */ /************************************************************************/ +/* Return the Emacs frame-object which contains the given widget. */ +struct frame * +gtk_widget_to_frame (GtkWidget *w) +{ + struct frame *f = NULL; + + for (; w; w = w->parent) + { + if ((f = (struct frame *) gtk_object_get_data (GTK_OBJECT (w), + GTK_DATA_FRAME_IDENTIFIER))) + return (f); + } + + return (selected_frame()); +} + + /* Return the Emacs frame-object corresponding to an X window */ struct frame * gtk_window_to_frame (struct device *d, GdkWindow *wdesc) @@ -290,7 +307,7 @@ individual properties. */ static void -gtk_set_frame_text_value (struct frame *f, Ibyte *value, +gtk_set_frame_text_value (struct frame *UNUSED (f), Ibyte *value, void (*func) (gpointer, gchar *), gpointer arg) { @@ -344,13 +361,12 @@ { GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f); GdkGeometry geometry; - GdkWindowHints geometry_mask = 0x00; if (GTK_IS_WINDOW (shell)) { + GdkWindowHints geometry_mask = GDK_HINT_RESIZE_INC; /* Deal with the cell size */ default_face_height_and_width (wrap_frame (f), &geometry.height_inc, &geometry.width_inc); - geometry_mask |= GDK_HINT_RESIZE_INC; gtk_window_set_geometry_hints (GTK_WINDOW (shell), FRAME_GTK_TEXT_WIDGET (f), &geometry, geometry_mask); @@ -599,7 +615,7 @@ if (STRINGP (Vgtk_initial_geometry)) { - if (!gnome_parse_geometry (XSTRING_DATA (Vgtk_initial_geometry), &x,&y,&w,&h)) + if (!gnome_parse_geometry ((char*) XSTRING_DATA (Vgtk_initial_geometry), &x,&y,&w,&h)) { x = y = 10; w = 80; @@ -626,7 +642,8 @@ } static gboolean -resize_event_cb (GtkWidget *w, GtkAllocation *allocation, gpointer user_data) +resize_event_cb (GtkWidget *UNUSED (w), GtkAllocation *allocation, + gpointer user_data) { struct frame *f = (struct frame *) user_data; @@ -644,7 +661,8 @@ } static gboolean -delete_event_cb (GtkWidget *w, GdkEvent *ev, gpointer user_data) +delete_event_cb (GtkWidget *UNUSED (w), GdkEvent *UNUSED (ev), + gpointer user_data) { struct frame *f = (struct frame *) user_data; Lisp_Object frame = wrap_frame (f); @@ -697,12 +715,12 @@ #define DRAG_SELECTION_DATA_ERROR "Error converting drag data to external format" static void -dragndrop_get_drag (GtkWidget *widget, - GdkDragContext *drag_context, +dragndrop_get_drag (GtkWidget *UNUSED (widget), + GdkDragContext *UNUSED (drag_context), GtkSelectionData *data, guint info, - guint time, - gpointer user_data) + guint UNUSED (time), + gpointer UNUSED (user_data)) { gtk_selection_data_set (data, GDK_SELECTION_TYPE_STRING, 8, DRAG_SELECTION_DATA_ERROR, @@ -825,7 +843,9 @@ gtk_container_set_border_width (GTK_CONTAINER (shell), 0); - gtk_object_set_data (GTK_OBJECT (shell), FRAME_DATA_IDENTIFIER, f); + /* Add a mapping from widget to frame to help widget callbacks quickly find + their corresponding frame. */ + gtk_object_set_data (GTK_OBJECT (shell), GTK_DATA_FRAME_IDENTIFIER, f); FRAME_GTK_SHELL_WIDGET (f) = shell; @@ -954,6 +974,18 @@ FRAME_GTK_MENUBAR_DATA (f) = Qnil; for (i = 0; i < 3; i++) FRAME_GTK_LISP_WIDGETS (f)[i] = Qnil; + + /* + Hashtables of callback data for glyphs on the frame. Make them EQ because + we only use ints as keys. Otherwise we run into stickiness in redisplay + because internal_equal() can QUIT. See enter_redisplay_critical_section(). +*/ + FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE (f) = + make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ); + FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE (f) = + make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ); + FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE (f) = + make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ); } @@ -963,7 +995,7 @@ static void gtk_init_frame_1 (struct frame *f, Lisp_Object props, - int frame_name_is_defaulted) + int UNUSED (frame_name_is_defaulted)) { /* This function can GC */ Lisp_Object initially_unmapped; @@ -1006,7 +1038,7 @@ } static void -gtk_init_frame_2 (struct frame *f, Lisp_Object props) +gtk_init_frame_2 (struct frame *f, Lisp_Object UNUSED (props)) { /* Set up the values of the widget/frame. A case could be made for putting this inside of the widget's initialize method. */ @@ -1041,6 +1073,9 @@ mark_object (FRAME_GTK_LISP_WIDGETS (f)[0]); mark_object (FRAME_GTK_LISP_WIDGETS (f)[1]); mark_object (FRAME_GTK_LISP_WIDGETS (f)[2]); + mark_object (FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE (f)); + mark_object (FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE (f)); + mark_object (FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE (f)); } static void @@ -1084,8 +1119,8 @@ static Lisp_Object gtk_get_frame_parent (struct frame *f) { - GtkWidget *parentwid = gtk_object_get_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)), - TRANSIENT_DATA_IDENTIFIER); + GtkWidget *parentwid = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)), + TRANSIENT_DATA_IDENTIFIER); /* find the frame whose wid is parentwid */ if (parentwid) @@ -1137,13 +1172,13 @@ { GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f); GdkGeometry geometry; - GdkWindowHints geometry_mask = 0x00; if (GTK_IS_WINDOW (shell)) { + GdkWindowHints geometry_mask = GDK_HINT_RESIZE_INC; + /* Update the cell size */ default_face_height_and_width (wrap_frame (f), &geometry.height_inc, &geometry.width_inc); - geometry_mask |= GDK_HINT_RESIZE_INC; gtk_window_set_geometry_hints (GTK_WINDOW (shell), FRAME_GTK_TEXT_WIDGET (f), &geometry, geometry_mask); @@ -1200,8 +1235,10 @@ return (1); } -static void -gtk_cant_notify_wm_error (void) +static DECLARE_DOESNT_RETURN (gtk_cant_notify_wm_error (void)); + +static DOESNT_RETURN +gtk_cant_notify_wm_error () { signal_error (Qgui_error, "Can't notify window manager of iconification", Qunbound); } @@ -1238,7 +1275,7 @@ static void gtk_make_frame_visible (struct frame *f) { - gtk_widget_show_all (FRAME_GTK_SHELL_WIDGET (f)); + gtk_widget_map (FRAME_GTK_SHELL_WIDGET (f)); gtk_raise_frame_1 (f, 0); } @@ -1246,7 +1283,7 @@ static void gtk_make_frame_invisible (struct frame *f) { - gtk_widget_hide (FRAME_GTK_SHELL_WIDGET (f)); + gtk_widget_unmap(FRAME_GTK_SHELL_WIDGET (f)); } static int diff --text -u 'xemacs-21.5.17/src/frame-msw.c' 'xemacs-21.5.18/src/frame-msw.c' Index: ./src/frame-msw.c --- ./src/frame-msw.c Wed Oct 1 00:26:47 2003 +++ ./src/frame-msw.c Tue Sep 21 04:19:44 2004 @@ -119,7 +119,7 @@ static void mswindows_init_frame_1 (struct frame *f, Lisp_Object props, - int frame_name_is_defaulted) + int UNUSED (frame_name_is_defaulted)) { Lisp_Object initially_unmapped; Lisp_Object name, height, width, popup, top, left; @@ -261,7 +261,7 @@ } static void -mswindows_init_frame_2 (struct frame *f, Lisp_Object props) +mswindows_init_frame_2 (struct frame *f, Lisp_Object UNUSED (props)) { if (NILP (Vmswindows_use_system_frame_size_defaults)) { @@ -286,8 +286,8 @@ } static void -mswindows_after_init_frame (struct frame *f, int first_on_device, - int first_on_console) +mswindows_after_init_frame (struct frame *UNUSED (f), + int UNUSED (first_on_device), int first_on_console) { /* Windows, unlike X, is very synchronous. After the initial frame is created, it will never be displayed, except for @@ -488,7 +488,8 @@ } static int -mswindows_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y) +mswindows_get_mouse_position (struct device *UNUSED (d), Lisp_Object *frame, + int *x, int *y) { POINT pt; HWND hwnd; @@ -575,7 +576,8 @@ } static int -mswindows_internal_frame_property_p (struct frame *f, Lisp_Object property) +mswindows_internal_frame_property_p (struct frame *UNUSED (f), + Lisp_Object property) { return EQ (property, Qleft) || EQ (property, Qtop); @@ -778,7 +780,8 @@ } static void -mswindows_update_frame_external_traits (struct frame *frm, Lisp_Object name) +mswindows_update_frame_external_traits (struct frame *UNUSED (frm), + Lisp_Object UNUSED (name)) { } @@ -835,8 +838,8 @@ } static void -msprinter_init_frame_1 (struct frame *f, Lisp_Object props, - int frame_name_is_defaulted) +msprinter_init_frame_1 (struct frame *f, Lisp_Object UNUSED (props), + int UNUSED (frame_name_is_defaulted)) { /* Make sure this is the only frame on device. Windows printer can handle only one job at a time. */ @@ -964,7 +967,7 @@ } static void -msprinter_mark_frame (struct frame *f) +msprinter_mark_frame (struct frame *UNUSED (f)) { } @@ -1000,7 +1003,8 @@ } static int -msprinter_internal_frame_property_p (struct frame *f, Lisp_Object property) +msprinter_internal_frame_property_p (struct frame *UNUSED (f), + Lisp_Object property) { return (EQ (Qleft_margin, property) || EQ (Qtop_margin, property) || EQ (Qright_margin, property) || EQ (Qbottom_margin, property)); @@ -1081,7 +1085,8 @@ } static void -msprinter_set_frame_size (struct frame *f, int width, int height) +msprinter_set_frame_size (struct frame *f, int UNUSED (width), + int UNUSED (height)) { /* We're absolutely unsizeable */ error_frame_unsizable (f); diff --text -u 'xemacs-21.5.17/src/frame-tty.c' 'xemacs-21.5.18/src/frame-tty.c' Index: ./src/frame-tty.c --- ./src/frame-tty.c Fri Jun 21 06:18:32 2002 +++ ./src/frame-tty.c Tue Sep 21 04:19:44 2004 @@ -43,7 +43,7 @@ static void -tty_init_frame_1 (struct frame *f, Lisp_Object props, +tty_init_frame_1 (struct frame *f, Lisp_Object UNUSED (props), int frame_name_is_defaulted) { struct device *d = XDEVICE (FRAME_DEVICE (f)); @@ -79,7 +79,7 @@ } static void -tty_after_init_frame (struct frame *f, int first_on_device, +tty_after_init_frame (struct frame *f, int UNUSED (first_on_device), int first_on_console) { if (first_on_console) @@ -195,7 +195,7 @@ } static int -tty_internal_frame_property_p (struct frame *f, Lisp_Object property) +tty_internal_frame_property_p (struct frame *UNUSED (f), Lisp_Object property) { return EQ (property, Qframe_number); } diff --text -u 'xemacs-21.5.17/src/frame-x.c' 'xemacs-21.5.18/src/frame-x.c' Index: ./src/frame-x.c --- ./src/frame-x.c Tue Jan 27 22:33:21 2004 +++ ./src/frame-x.c Tue Sep 21 04:19:44 2004 @@ -583,7 +583,7 @@ } static int -x_internal_frame_property_p (struct frame *f, Lisp_Object property) +x_internal_frame_property_p (struct frame *UNUSED (f), Lisp_Object property) { return EQ (property, Qleft) || EQ (property, Qtop) @@ -1472,7 +1472,7 @@ before the user moves the mouse for the first time. */ static void -x_send_synthetic_mouse_event (struct frame *f) +x_send_synthetic_mouse_event (struct frame *UNUSED (f)) { /* #### write this function. */ } @@ -1759,7 +1759,8 @@ } static void -x_layout_widgets (Widget w, XtPointer client_data, XtPointer call_data) +x_layout_widgets (Widget UNUSED (w), XtPointer client_data, + XtPointer call_data) { struct frame *f = (struct frame *) client_data; EmacsManagerResizeStruct *emst = (EmacsManagerResizeStruct *) call_data; @@ -1799,7 +1800,8 @@ } static void -x_do_query_geometry (Widget w, XtPointer client_data, XtPointer call_data) +x_do_query_geometry (Widget UNUSED (w), XtPointer client_data, + XtPointer call_data) { struct frame *f = (struct frame *) client_data; EmacsManagerQueryGeometryStruct *emst = @@ -2135,7 +2137,7 @@ static void x_init_frame_1 (struct frame *f, Lisp_Object props, - int frame_name_is_defaulted) + int UNUSED (frame_name_is_defaulted)) { /* This function can GC */ Lisp_Object device = FRAME_DEVICE (f); @@ -2169,7 +2171,7 @@ } static void -x_init_frame_2 (struct frame *f, Lisp_Object props) +x_init_frame_2 (struct frame *f, Lisp_Object UNUSED (props)) { /* Set up the values of the widget/frame. A case could be made for putting this inside of the widget's initialize method. */ @@ -2408,8 +2410,10 @@ return 1; } -static void -x_cant_notify_wm_error (void) +static DECLARE_DOESNT_RETURN (x_cant_notify_wm_error (void)); + +static DOESNT_RETURN +x_cant_notify_wm_error () { signal_error (Qgui_error, "Can't notify window manager of iconification", Qunbound); } diff --text -u 'xemacs-21.5.17/src/frame.c' 'xemacs-21.5.18/src/frame.c' Index: ./src/frame.c --- ./src/frame.c Wed Oct 1 00:26:48 2003 +++ ./src/frame.c Tue Sep 21 04:19:45 2004 @@ -234,7 +234,8 @@ } static void -print_frame (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_frame (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { struct frame *frm = XFRAME (obj); @@ -773,8 +774,8 @@ * changing which causes frame size adjustment */ void -frame_size_slipped (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) +frame_size_slipped (Lisp_Object UNUSED (specifier), struct frame *f, + Lisp_Object UNUSED (oldval)) { MARK_FRAME_SIZE_SLIPPED(f); } @@ -3527,8 +3528,8 @@ } static void -icon_glyph_changed (Lisp_Object glyph, Lisp_Object property, - Lisp_Object locale) +icon_glyph_changed (Lisp_Object UNUSED (glyph), Lisp_Object UNUSED (property), + Lisp_Object UNUSED (locale)) { MARK_ICON_CHANGED; } diff --text -u 'xemacs-21.5.17/src/free-hook.c' 'xemacs-21.5.18/src/free-hook.c' Index: ./src/free-hook.c --- ./src/free-hook.c Sun Jan 12 20:08:16 2003 +++ ./src/free-hook.c Tue Sep 21 04:19:45 2004 @@ -361,7 +361,7 @@ Actually free the storage held by the free() debug hook. A no-op if the free hook is disabled. */ - (arg)) + (UNUSED (arg))) { int count[2]; Lisp_Object lisp_count[2]; diff --text -u 'xemacs-21.5.17/src/gccache-gtk.c' 'xemacs-21.5.18/src/gccache-gtk.c' Index: ./src/gccache-gtk.c --- ./src/gccache-gtk.c Wed Oct 1 00:26:48 2003 +++ ./src/gccache-gtk.c Sun May 2 13:06:59 2004 @@ -68,7 +68,7 @@ struct gcv_and_mask { GdkGCValues gcv; - GdkGCValuesMask mask; + unsigned long mask; /* contains a GdkGCValuesMask bitmask. */ }; struct gc_cache_cell { @@ -155,7 +155,7 @@ } GdkGC * -gc_cache_lookup (struct gc_cache *cache, GdkGCValues *gcv, GdkGCValuesMask mask) +gc_cache_lookup (struct gc_cache *cache, GdkGCValues *gcv, unsigned long mask) { struct gc_cache_cell *cell, *next, *prev; struct gcv_and_mask gcvm; @@ -267,7 +267,7 @@ #endif /* Now make and return the GC. */ - cell->gc = gdk_gc_new_with_values (cache->window, gcv, mask); + cell->gc = gdk_gc_new_with_values (cache->window, gcv, (GdkGCValuesMask) mask); /* debug */ assert (cell->gc == gc_cache_lookup (cache, gcv, mask)); diff --text -u 'xemacs-21.5.17/src/gccache-gtk.h' 'xemacs-21.5.18/src/gccache-gtk.h' Index: ./src/gccache-gtk.h --- ./src/gccache-gtk.h Fri Apr 13 03:23:48 2001 +++ ./src/gccache-gtk.h Sun May 2 13:06:59 2004 @@ -30,6 +30,6 @@ struct gc_cache; struct gc_cache *make_gc_cache (GtkWidget *); void free_gc_cache (struct gc_cache *cache); -GdkGC *gc_cache_lookup (struct gc_cache *, GdkGCValues *, GdkGCValuesMask mask); +GdkGC *gc_cache_lookup (struct gc_cache *, GdkGCValues *, unsigned long mask); #endif /* _XGCCACHE_H_ */ diff --text -u 'xemacs-21.5.17/src/general-slots.h' 'xemacs-21.5.18/src/general-slots.h' Index: ./src/general-slots.h --- ./src/general-slots.h Thu Feb 26 02:42:36 2004 +++ ./src/general-slots.h Tue Apr 6 07:49:54 2004 @@ -57,6 +57,7 @@ SYMBOL (Qautodetect); SYMBOL (Qbad_variable); SYMBOL (Qbefore); +SYMBOL (Qbigfloat); SYMBOL (Qbinary); SYMBOL (Qbitmap); SYMBOL (Qboolean); @@ -127,6 +128,8 @@ SYMBOL (Qfile); SYMBOL_MODULE_API (Qfile_name); SYMBOL_KEYWORD (Q_filter); +SYMBOL (Qfixnum); +SYMBOL (Qfloat); SYMBOL (Qfont); SYMBOL (Qframe); SYMBOL (Qframes); @@ -232,6 +235,7 @@ SYMBOL (Qradio); SYMBOL (Qrassoc); SYMBOL (Qrassq); +SYMBOL (Qratio); SYMBOL (Qredisplay); SYMBOL (Qremove_all); SYMBOL (Qrequire); diff --text -u 'xemacs-21.5.17/src/gif_io.c' 'xemacs-21.5.18/src/gif_io.c' Index: ./src/gif_io.c --- ./src/gif_io.c Wed Mar 13 17:52:44 2002 +++ ./src/gif_io.c Tue Sep 14 23:32:50 2004 @@ -216,7 +216,7 @@ /****************************** * These are called internally * ******************************/ -void GifError(GifFileType *GifFile, const char *err_str) +DOESNT_RETURN GifError(GifFileType *GifFile, const char *err_str) { GifIODataType *GifIO = (GifIODataType*)GifFile->GifIO; if (GifIO->ErrorFunc) @@ -233,7 +233,7 @@ (*(GifIO->WarningFunc))(err_str, GifIO->WarningFunc_data); } -void GifInternError(GifFileType *GifFile, int error_num) +DOESNT_RETURN GifInternError(GifFileType *GifFile, int error_num) { const char *ErrStr = GetGifError(error_num); GifError(GifFile, ErrStr); diff --text -u 'xemacs-21.5.17/src/gifrlib.h' 'xemacs-21.5.18/src/gifrlib.h' Index: ./src/gifrlib.h --- ./src/gifrlib.h Thu Sep 20 15:29:00 2001 +++ ./src/gifrlib.h Wed Sep 15 13:26:16 2004 @@ -145,9 +145,9 @@ ******************************************************************************/ extern void GifSetErrorFunc(GifFileType *GifFile, Gif_error_func func, VoidPtr data); extern void GifSetWarningFunc(GifFileType *GifFile, Gif_error_func func, VoidPtr data); -extern void GifInternError(GifFileType *GifFile, int errnum); +DECLARE_DOESNT_RETURN (GifInternError(GifFileType *GifFile, int errnum)); extern void GifInternWarning(GifFileType *GifFile, int errnum); -extern void GifError(GifFileType *GifFile, const char *err_str); +DECLARE_DOESNT_RETURN (GifError(GifFileType *GifFile, const char *err_str)); extern void GifWarning(GifFileType *GifFile, const char *err_str); /***************************************************************************** diff --text -u 'xemacs-21.5.17/src/glade.c' 'xemacs-21.5.18/src/glade.c' Index: ./src/glade.c --- ./src/glade.c Sun May 5 20:31:34 2002 +++ ./src/glade.c Sun May 2 13:06:59 2004 @@ -79,7 +79,7 @@ } glade_xml_signal_connect_full (GLADE_XML (XGTK_OBJECT (xml)->object), - XSTRING_DATA (handler_name), + (char*) XSTRING_DATA (handler_name), connector, LISP_TO_VOID (func)); return (Qt); } diff --text -u 'xemacs-21.5.17/src/glyphs-eimage.c' 'xemacs-21.5.18/src/glyphs-eimage.c' Index: ./src/glyphs-eimage.c --- ./src/glyphs-eimage.c Tue Oct 14 14:03:03 2003 +++ ./src/glyphs-eimage.c Tue Sep 21 04:19:45 2004 @@ -118,7 +118,7 @@ static Lisp_Object jpeg_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { return simple_image_type_normalize (inst, console_type, Qjpeg); } @@ -196,7 +196,7 @@ #else METHODDEF void #endif -our_init_source (j_decompress_ptr cinfo) +our_init_source (j_decompress_ptr UNUSED (cinfo)) { } @@ -247,7 +247,7 @@ #else METHODDEF void #endif -our_term_source (j_decompress_ptr cinfo) +our_term_source (j_decompress_ptr UNUSED (cinfo)) { } @@ -313,7 +313,8 @@ source code and from gif_instantiate() */ static void jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -517,7 +518,7 @@ static Lisp_Object gif_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { return simple_image_type_normalize (inst, console_type, Qgif); } @@ -577,7 +578,7 @@ } static int -gif_memory_close (VoidPtr data) +gif_memory_close (VoidPtr UNUSED (data)) { return 0; } @@ -600,7 +601,8 @@ static void gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -763,7 +765,7 @@ static Lisp_Object png_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { return simple_image_type_normalize (inst, console_type, Qpng); } @@ -809,14 +811,14 @@ static struct png_error_struct png_err_stct; static void -png_error_func (png_structp png_ptr, png_const_charp msg) +png_error_func (png_structp UNUSED (png_ptr), png_const_charp msg) { png_err_stct.err_str = msg; longjmp (png_err_stct.setjmp_buffer, 1); } static void -png_warning_func (png_structp png_ptr, png_const_charp msg) +png_warning_func (png_structp UNUSED (png_ptr), png_const_charp msg) { warn_when_safe (Qpng, Qinfo, "%s", msg); } @@ -849,7 +851,8 @@ static void png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -1053,7 +1056,7 @@ static Lisp_Object tiff_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { return simple_image_type_normalize (inst, console_type, Qtiff); } @@ -1108,10 +1111,11 @@ } static size_t -tiff_memory_write (thandle_t data, tdata_t buf, tsize_t size) +tiff_memory_write (thandle_t UNUSED (data), tdata_t UNUSED (buf), + tsize_t UNUSED (size)) { abort(); - return 0; /* Shut up warnings. */ + return 0; } static toff_t @@ -1143,19 +1147,21 @@ } static int -tiff_memory_close (thandle_t data) +tiff_memory_close (thandle_t UNUSED (data)) { return 0; } static int -tiff_map_noop (thandle_t data, tdata_t* pbase, toff_t* psize) +tiff_map_noop (thandle_t UNUSED (data), tdata_t* UNUSED (pbase), + toff_t* UNUSED (psize)) { return 0; } static void -tiff_unmap_noop (thandle_t data, tdata_t pbase, toff_t psize) +tiff_unmap_noop (thandle_t UNUSED (data), tdata_t UNUSED (pbase), + toff_t UNUSED (psize)) { return; } @@ -1184,7 +1190,7 @@ static struct tiff_error_struct tiff_err_data; static void -tiff_error_func (const char *module, const char *fmt, ...) +tiff_error_func (const char *UNUSED (module), const char *fmt, ...) { va_list vargs; @@ -1223,7 +1229,8 @@ static void tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); diff --text -u 'xemacs-21.5.17/src/glyphs-gtk.c' 'xemacs-21.5.18/src/glyphs-gtk.c' Index: ./src/glyphs-gtk.c --- ./src/glyphs-gtk.c Wed Feb 18 00:20:53 2004 +++ ./src/glyphs-gtk.c Tue Sep 21 04:19:45 2004 @@ -62,6 +62,8 @@ #include "lstream.h" #include "opaque.h" #include "window.h" +#include "elhash.h" +#include "events.h" #include "console-gtk-impl.h" #include "glyphs-gtk.h" @@ -72,6 +74,13 @@ #include <setjmp.h> +#if defined (HAVE_XPM) +#include <X11/xpm.h> +#endif + +/* Widget callback hash table callback slot. */ +#define WIDGET_GLYPH_SLOT 0 + DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); @@ -91,7 +100,6 @@ #ifdef HAVE_XFACE DEFINE_DEVICE_IIFORMAT (gtk, xface); -Lisp_Object Qxface; #endif #ifdef HAVE_XPM @@ -129,7 +137,7 @@ int dest_mask, Lisp_Object domain); -static gint cursor_name_to_index (const char *name); +static GdkCursorType cursor_name_to_index (const char *name); #ifndef BitmapSuccess #define BitmapSuccess 0 @@ -342,7 +350,7 @@ static void gtk_print_image_instance (struct Lisp_Image_Instance *p, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { switch (IMAGE_INSTANCE_TYPE (p)) { @@ -356,7 +364,7 @@ (unsigned long) IMAGE_INSTANCE_GTK_MASK (p)); write_c_string (printcharfun, ")"); break; -#if HAVE_SUBWINDOWS +#ifdef HAVE_SUBWINDOWS case IMAGE_SUBWINDOW: /* #### implement me */ #endif @@ -380,7 +388,7 @@ { if (IMAGE_INSTANCE_SUBWINDOW_ID (p)) { - gtk_widget_destroy (IMAGE_INSTANCE_SUBWINDOW_ID (p)); + gtk_widget_destroy ((GtkWidget*) IMAGE_INSTANCE_SUBWINDOW_ID (p)); /* We can release the callbacks again. */ /* #### FIXME! */ @@ -452,7 +460,7 @@ static int gtk_image_instance_equal (struct Lisp_Image_Instance *p1, - struct Lisp_Image_Instance *p2, int depth) + struct Lisp_Image_Instance *p2, int UNUSED (depth)) { switch (IMAGE_INSTANCE_TYPE (p1)) { @@ -462,7 +470,7 @@ if (IMAGE_INSTANCE_GTK_COLORMAP (p1) != IMAGE_INSTANCE_GTK_COLORMAP (p2) || IMAGE_INSTANCE_GTK_NPIXELS (p1) != IMAGE_INSTANCE_GTK_NPIXELS (p2)) return 0; -#if HAVE_SUBWINDOWS +#ifdef HAVE_SUBWINDOWS case IMAGE_SUBWINDOW: /* #### implement me */ #endif @@ -475,7 +483,7 @@ } static unsigned long -gtk_image_instance_hash (struct Lisp_Image_Instance *p, int depth) +gtk_image_instance_hash (struct Lisp_Image_Instance *p, int UNUSED (depth)) { switch (IMAGE_INSTANCE_TYPE (p)) { @@ -483,7 +491,7 @@ case IMAGE_COLOR_PIXMAP: case IMAGE_POINTER: return IMAGE_INSTANCE_GTK_NPIXELS (p); -#if HAVE_SUBWINDOWS +#ifdef HAVE_SUBWINDOWS case IMAGE_SUBWINDOW: /* #### implement me */ return 0; @@ -591,8 +599,8 @@ message. */ static void -check_pointer_sizes (unsigned int width, unsigned int height, - Lisp_Object instantiator) +check_pointer_sizes (unsigned int UNUSED (width), unsigned int UNUSED (height), + Lisp_Object UNUSED (instantiator)) { /* #### BILL!!! There is no way to call XQueryBestCursor from Gdk! */ #if 0 @@ -641,8 +649,9 @@ } static void -maybe_recolor_cursor (Lisp_Object image_instance, Lisp_Object foreground, - Lisp_Object background) +maybe_recolor_cursor (Lisp_Object UNUSED (image_instance), + Lisp_Object UNUSED (foreground), + Lisp_Object UNUSED (background)) { #if 0 /* #### BILL!!! */ @@ -822,7 +831,7 @@ unsigned char *eimage, int dest_mask, Lisp_Object instantiator, - Lisp_Object domain) + Lisp_Object UNUSED (domain)) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); GdkColormap *cmap = DEVICE_GTK_COLORMAP (XDEVICE(device)); @@ -884,7 +893,7 @@ Lisp_Object pointer_bg, int dest_mask, GdkPixmap *mask, - Lisp_Object mask_filename) + Lisp_Object UNUSED (mask_filename)) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Lisp_Object foreground = find_keyword_in_vector (instantiator, Q_foreground); @@ -1016,7 +1025,7 @@ Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file); struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); GdkPixmap *mask = 0; - const char *gcc_may_you_rot_in_hell; + const Extbyte *gcc_may_you_rot_in_hell; if (!NILP (mask_data)) { @@ -1027,7 +1036,6 @@ pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii), XINT (XCAR (mask_data)), XINT (XCAR (XCDR (mask_data))), - (const unsigned char *) gcc_may_you_rot_in_hell); } @@ -1041,7 +1049,7 @@ static void gtk_xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); const char *gcc_go_home; @@ -1062,97 +1070,10 @@ /********************************************************************** * XPM * **********************************************************************/ -static Lisp_Object -write_lisp_string_to_temp_file (Lisp_Object string) -{ - Lisp_Object instream, outstream; - Lstream *istr, *ostr; - Char_Binary tempbuf[1024]; /* some random amount */ - int fubar = 0; - FILE *tmpfil; - static Extbyte_dynarr *conversion_out_dynarr; - Bytecount bstart, bend; - Lisp_Object tempfile; - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - Lisp_Object conv_out_stream; - Lstream *costr; - - /* This function can GC */ - if (!conversion_out_dynarr) - conversion_out_dynarr = Dynarr_new (Extbyte); - else - Dynarr_reset (conversion_out_dynarr); - - /* Create the temporary file ... */ - tempfile = Fmake_temp_name (build_string ("/tmp/emacs")); - tmpfil = qxe_fopen (XSTRING_DATA (tempfile), "w"); - if (!tmpfil) - { - if (tmpfil) - { - int old_errno = errno; - retry_fclose (tmpfil); - qxe_unlink (XSTRING_DATA (tempfile)); - errno = old_errno; - } - report_file_error ("Creating temp file", tempfile); - } - - CHECK_STRING (string); - get_string_range_byte (string, Qnil, Qnil, &bstart, &bend, - GB_HISTORICAL_STRING_BEHAVIOR); - instream = make_lisp_string_input_stream (string, bstart, bend); - istr = XLSTREAM (instream); - /* setup the out stream */ - outstream = - make_dynarr_output_stream ((unsigned_char_dynarr *) conversion_out_dynarr); - ostr = XLSTREAM (outstream); - /* setup the conversion stream */ - conv_out_stream = - make_coding_output_stream (ostr, Qbinary, CODING_ENCODE, 0); - costr = XLSTREAM (conv_out_stream); - GCPRO4 (tempfile, instream, outstream, conv_out_stream); - - /* Get the data while doing the conversion */ - while (1) - { - int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); - if (!size_in_bytes) - break; - /* It does seem the flushes are necessary... */ - Lstream_write (costr, tempbuf, size_in_bytes); - Lstream_flush (costr); - Lstream_flush (ostr); - if (retry_fwrite ((unsigned char *)Dynarr_atp(conversion_out_dynarr, 0), - Dynarr_length(conversion_out_dynarr), 1, tmpfil) != 1) - { - fubar = 1; - break; - } - /* reset the dynarr */ - Lstream_rewind(ostr); - } - - if (retry_fclose (tmpfil) != 0) - fubar = 1; - Lstream_close (istr); - Lstream_close (costr); - Lstream_close (ostr); - - Lstream_delete (istr); - Lstream_delete (ostr); - Lstream_delete (costr); - - if (fubar) - report_file_error ("Writing temp file", tempfile); - - UNGCPRO; - return tempfile; -} struct color_symbol { - char* name; + Ibyte* name; GdkColor color; }; @@ -1210,11 +1131,11 @@ colortbl[j].color = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (XCDR (cons))); - colortbl[j].name = (char *) XSTRING_DATA (XCAR (cons)); - free_cons (XCONS (cons)); + colortbl[j].name = XSTRING_DATA (XCAR (cons)); + free_cons (cons); cons = results; results = XCDR (results); - free_cons (XCONS (cons)); + free_cons (cons); } return colortbl; } @@ -1236,14 +1157,13 @@ GdkWindow *window = 0; int nsymbols = 0, i = 0; struct color_symbol *color_symbols = NULL; - GdkColor *transparent_color = NULL; Lisp_Object color_symbol_alist = find_keyword_in_vector (instantiator, Q_color_symbols); enum image_instance_type type; int force_mono; - unsigned int w, h; - Lisp_Object tempfile = Qnil; - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; + gint w, h; + struct gcpro gcpro1, gcpro2, gcpro3; + const UChar_Binary * volatile dstring; if (!DEVICE_GTK_P (XDEVICE (device))) gui_error ("Not a Gtk device", device); @@ -1260,7 +1180,7 @@ | IMAGE_POINTER_MASK); force_mono = (type != IMAGE_COLOR_PIXMAP); - GCPRO4 (device, data, color_symbol_alist, tempfile); + GCPRO3 (device, data, color_symbol_alist); window = GET_GTK_WIDGET_WINDOW (DEVICE_GTK_APP_SHELL (XDEVICE (device))); cmap = DEVICE_GTK_COLORMAP (XDEVICE (device)); @@ -1271,27 +1191,55 @@ assert (!NILP (data)); - /* Need to get the transparent color here */ + /* Extract all the entries from xpm-color-symbols */ color_symbols = extract_xpm_color_names (device, domain, color_symbol_alist, &nsymbols); - for (i = 0; i < nsymbols; i++) - { - if (!qxestrcasecmp ("BgColor", color_symbols[i].name) || - !qxestrcasecmp ("None", color_symbols[i].name)) - { - transparent_color = &color_symbols[i].color; - } - } + assert (!NILP (data)); - tempfile = write_lisp_string_to_temp_file (data); + LISP_STRING_TO_EXTERNAL(data, dstring, Qbinary); + + /* + * GTK only uses the 'c' color entry of an XPM and doesn't use the symbolic + * color names at all. This is unfortunate because the way to change the + * colors from lisp is by adding the symbolic names, and the new colors, to + * the variable xpm-color-symbols. + * + * To get around this decode the XPM, add a 'c' entry of the desired color + * for each matching symbolic color, recode the XPM and pass it to GTK. The + * decode and recode stages aren't too bad because this also performs the + * external to internal format translation, which avoids contortions like + * writing the XPM back to disk in order to get it processed. + */ { - Extbyte *tempfileout; + XpmImage image; + XpmInfo info; + char** data; + + XpmCreateXpmImageFromBuffer ((char*) dstring, &image, &info); + + for (i = 0; i < nsymbols; i++) + { + unsigned j; + + for (j = 0; j < image.ncolors; j++) + { + if (image.colorTable[j].symbolic != NULL && + !qxestrcasecmp_c(color_symbols[i].name, image.colorTable[j].symbolic)) + { + image.colorTable[j].c_color = (char*) xmalloc(16); + + sprintf(image.colorTable[j].c_color, "#%.4x%.4x%.4x", + color_symbols[i].color.red, color_symbols[i].color.green, + color_symbols[i].color.blue); + } + } + } + + XpmCreateDataFromXpmImage (&data, &image, &info); - LISP_STRING_TO_EXTERNAL (tempfile, tempfileout, Qfile_name); - pixmap = gdk_pixmap_create_from_xpm (window, &mask, transparent_color, - tempfileout); + pixmap = gdk_pixmap_create_from_xpm_d (window, &mask, NULL, + data); } - qxe_unlink (XSTRING_DATA (tempfile)); if (color_symbols) xfree (color_symbols, struct color_symbol *); @@ -1302,7 +1250,7 @@ gdk_window_get_geometry (pixmap, NULL, NULL, &w, &h, &depth); IMAGE_INSTANCE_GTK_PIXMAP (ii) = pixmap; - IMAGE_INSTANCE_GTK_MASK (ii) = mask; + IMAGE_INSTANCE_PIXMAP_MASK (ii) = (void*)mask; IMAGE_INSTANCE_GTK_COLORMAP (ii) = cmap; IMAGE_INSTANCE_GTK_PIXELS (ii) = 0; IMAGE_INSTANCE_GTK_NPIXELS (ii) = 0; @@ -1388,8 +1336,8 @@ static void gtk_xface_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 UNUSED (domain)) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); int i, stattis; @@ -1482,7 +1430,8 @@ extern guint symbol_to_enum (Lisp_Object, GtkType); -static guint resource_name_to_resource (Lisp_Object name, int type) +static guint resource_name_to_resource (Lisp_Object name, + enum image_instance_type type) { if (type == IMAGE_POINTER) return (symbol_to_enum (name, GTK_TYPE_GDK_CURSOR_TYPE)); @@ -1490,7 +1439,7 @@ return (0); } -static int +static enum image_instance_type resource_symbol_to_type (Lisp_Object data) { if (EQ (data, Qcursor)) @@ -1502,17 +1451,18 @@ return IMAGE_BITMAP; #endif else - return 0; + return IMAGE_UNKNOWN; } static void gtk_resource_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int UNUSED (dest_mask), Lisp_Object UNUSED (domain)) { struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); GdkCursor *c = NULL; - unsigned int type = 0; + enum image_instance_type type; Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Lisp_Object resource_type = find_keyword_in_vector (instantiator, Q_resource_type); Lisp_Object resource_id = find_keyword_in_vector (instantiator, Q_resource_id); @@ -1534,7 +1484,7 @@ /* mess with the keyword info we were provided with */ gtk_initialize_pixmap_image_instance (ii, 1, type); - c = gdk_cursor_new (resource_name_to_resource (resource_id, type)); + c = gdk_cursor_new ((GdkCursorType) resource_name_to_resource (resource_id, type)); IMAGE_INSTANCE_GTK_CURSOR (ii) = c; IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = resource_id; IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = 10; @@ -1589,7 +1539,7 @@ static Lisp_Object autodetect_normalize (Lisp_Object instantiator, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { Lisp_Object file = find_keyword_in_vector (instantiator, Q_data); Lisp_Object filename = Qnil; @@ -1743,7 +1693,7 @@ static void font_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { /* This function can GC */ Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); @@ -1855,7 +1805,7 @@ } /* This is basically the equivalent of XmuCursorNameToIndex */ -static gint +static GdkCursorType cursor_name_to_index (const char *name) { int i; @@ -1919,22 +1869,22 @@ if (!the_gdk_cursors[i]) continue; if (!strcmp (the_gdk_cursors[i], name)) { - return (i); + return (GdkCursorType) i; } } - return(-1); + return (GdkCursorType) -1; } static void cursor_font_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { /* This function can GC */ Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - int i; + GdkCursorType i; const char *name_ext; Lisp_Object foreground, background; @@ -2009,6 +1959,7 @@ struct frame *f = XFRAME (IMAGE_INSTANCE_FRAME (p)); GtkWidget *wid = IMAGE_INSTANCE_GTK_CLIPWIDGET (p); GtkAllocation a; + int moving; if (!wid) return; @@ -2017,36 +1968,41 @@ a.width = dga->width; a.height = dga->height; + /* Is the widget cganging position? */ + moving = (a.x != wid->allocation.x) || + (a.y != wid->allocation.y); + if ((a.width != wid->allocation.width) || - (a.height != wid->allocation.height)) + (a.height != wid->allocation.height) || + moving) { gtk_widget_size_allocate (IMAGE_INSTANCE_GTK_CLIPWIDGET (p), &a); } - /* #### FIXME DAMMIT */ - if ((wid->allocation.x != -dga->xoffset) || - (wid->allocation.y != -dga->yoffset)) + if (moving) { guint32 old_flags = GTK_WIDGET_FLAGS (FRAME_GTK_TEXT_WIDGET (f)); - /* Fucking GtkFixed widget queues a resize when you add a widget. + /* GtkFixed widget queues a resize when you add a widget. ** But only if it is visible. ** losers. */ GTK_WIDGET_FLAGS(FRAME_GTK_TEXT_WIDGET (f)) &= ~GTK_VISIBLE; + if (IMAGE_INSTANCE_GTK_ALREADY_PUT(p)) { gtk_fixed_move (GTK_FIXED (FRAME_GTK_TEXT_WIDGET (f)), wid, - -dga->xoffset, -dga->yoffset); + a.x, a.y); } else { IMAGE_INSTANCE_GTK_ALREADY_PUT(p) = TRUE; gtk_fixed_put (GTK_FIXED (FRAME_GTK_TEXT_WIDGET (f)), wid, - -dga->xoffset, -dga->yoffset); + a.x, a.y); } + GTK_WIDGET_FLAGS(FRAME_GTK_TEXT_WIDGET (f)) = old_flags; } else @@ -2061,7 +2017,7 @@ IMAGE_INSTANCE_GTK_ALREADY_PUT(p) = TRUE; gtk_fixed_put (GTK_FIXED (FRAME_GTK_TEXT_WIDGET (f)), wid, - -dga->xoffset, -dga->yoffset); + a.x, a.y); } } @@ -2107,11 +2063,9 @@ gtk_widget_show_all (IMAGE_INSTANCE_GTK_CLIPWIDGET (p)); if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { - Lisp_Object image_instance = wrap_image_instance (p); - - /* Need to update GtkArgs that might have changed... */ /* #### FIXME!!! */ + /*Lisp_Object image_instance = wrap_image_instance (p); */ } else { @@ -2153,11 +2107,19 @@ || IMAGE_INSTANCE_TEXT_CHANGED (p)) { + GtkRequisition r; + GtkAllocation a = IMAGE_INSTANCE_GTK_CLIPWIDGET (p)->allocation; + assert (IMAGE_INSTANCE_GTK_WIDGET_ID (p) && IMAGE_INSTANCE_GTK_CLIPWIDGET (p)) ; - /* #### Resize the widget! */ - /* gtk_widget_size_allocate () */ + a.width = r.width = IMAGE_INSTANCE_WIDTH (p); + a.height = r.height = IMAGE_INSTANCE_HEIGHT (p); + + /* Force the widget's preferred and actual size to what we say it shall + be. */ + gtk_widget_size_request (IMAGE_INSTANCE_GTK_CLIPWIDGET (p), &r); + gtk_widget_size_allocate (IMAGE_INSTANCE_GTK_CLIPWIDGET (p), &a); } /* Adjust offsets within the frame. */ @@ -2172,9 +2134,11 @@ /* instantiate and gtk type subwindow */ static void -gtk_subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) +gtk_subwindow_instantiate (Lisp_Object image_instance, + Lisp_Object UNUSED (instantiator), + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int UNUSED (dest_mask), Lisp_Object UNUSED (domain)) { /* This function can GC */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -2315,13 +2279,17 @@ */ IMAGE_INSTANCE_GTK_CLIPWIDGET (ii) = w; + /* The current theme may produce a widget of a different size that what we + expect so force reconsideration of the widget's size. */ + IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1; + return (Qt); } static void gtk_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int UNUSED (dest_mask), Lisp_Object domain) { call_with_suspended_errors ((lisp_fn_t) gtk_widget_instantiate_1, Qnil, Qimage, @@ -2334,7 +2302,7 @@ /* get properties of a control */ static Lisp_Object -gtk_widget_property (Lisp_Object image_instance, Lisp_Object prop) +gtk_widget_property (Lisp_Object UNUSED (image_instance), Lisp_Object prop) { /* Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); */ @@ -2363,8 +2331,45 @@ FAKE_GTK_WIDGET_INSTANTIATOR(progress_gauge); FAKE_GTK_WIDGET_INSTANTIATOR(edit_field); FAKE_GTK_WIDGET_INSTANTIATOR(combo_box); -FAKE_GTK_WIDGET_INSTANTIATOR(tab_control); FAKE_GTK_WIDGET_INSTANTIATOR(label); +/* Note: tab_control has a custom instantiator (see below) */ + +/* + Ask the widget to return it's preferred size. This device method must + defined for all widgets that also have format specific version of + query_geometry defined in glyphs-widget.c. This is because those format + specific versions return sizes that are appropriate for the X widgets. For + GTK, the size of a widget can change at runtime due to the user changing + their theme. + + This method can be called before the widget is instantiated. This is + because instantiate_image_instantiator() is tying to be helpful to other + toolkits and supply sane geometry values to them. This is not appropriate + for GTK and can be ignored. + + This method can be used by all widgets. +*/ +static void +gtk_widget_query_geometry (Lisp_Object image_instance, + int* width, int* height, + enum image_instance_geometry UNUSED (disp), + Lisp_Object UNUSED (domain)) +{ + Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); + + if (p->data != NULL) + { + GtkWidget *w = IMAGE_INSTANCE_GTK_CLIPWIDGET (p); + GtkRequisition r; + + gtk_widget_size_request(w, &r); + *height= r.height; + *width = r.width; + } +} + + +/* Button functions. */ /* Update a button's clicked state. */ static void @@ -2407,6 +2412,9 @@ return Qunbound; } + +/* Progress gauge functions. */ + /* set the properties of a progress gauge */ static void gtk_progress_gauge_redisplay (Lisp_Object image_instance) @@ -2426,6 +2434,202 @@ } } + +/* Tab Control functions. */ + +/* + Register a widget's callbacks with the frame's hashtable. The hashtable is + weak so deregistration is handled automatically. Tab controls have per-tab + callback list functions and the GTK callback architecture is not + sufficiently flexible to deal with this. Instead, the functions are + registered here and the id is passed through the callback loop. + */ +static int +gtk_register_gui_item (Lisp_Object image_instance, Lisp_Object gui, + Lisp_Object domain) +{ + struct frame *f = XFRAME(DOMAIN_FRAME(domain)); + int id = gui_item_id_hash(FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE(f), + gui, WIDGET_GLYPH_SLOT); + + Fputhash(make_int(id), image_instance, + FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE (f)); + Fputhash(make_int(id), XGUI_ITEM (gui)->callback, + FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE (f)); + Fputhash(make_int(id), XGUI_ITEM (gui)->callback_ex, + FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE (f)); + return id; +} + +/* + Append the given item as a tab to the notebook. Callbacks, etc are all + setup. + */ +static void +gtk_add_tab_item(Lisp_Object image_instance, + GtkNotebook* nb, Lisp_Object item, + Lisp_Object domain, int UNUSED (i)) +{ + Lisp_Object name; + int hash_id = 0; + char *c_name = NULL; + GtkWidget* box; + + if (GUI_ITEMP (item)) + { + Lisp_Gui_Item *pgui = XGUI_ITEM (item); + + if (!STRINGP (pgui->name)) + pgui->name = eval_within_redisplay (pgui->name); + + if (!STRINGP (pgui->name)) { + warn_when_safe (Qredisplay, Qwarning, + "Name does not evaluate to string"); + + return; + } + + hash_id = gtk_register_gui_item (image_instance, item, domain); + name = pgui->name; + } + else + { + CHECK_STRING (item); + name = item; + } + + TO_EXTERNAL_FORMAT (LISP_STRING, name, + C_STRING_ALLOCA, c_name, + Qctext); + + /* Dummy widget that the notbook wants to display when a tab is selected. */ + box = gtk_vbox_new (FALSE, 3); + + /* + Store the per-tab callback data id in the tab. The callback functions + themselves could have been stored in the widget but this avoids having to + worry about the garbage collector running between here and the callback + function. + */ + gtk_object_set_data(GTK_OBJECT(box), GTK_DATA_TAB_HASHCODE_IDENTIFIER, + (gpointer) hash_id); + + gtk_notebook_append_page (nb, box, gtk_label_new (c_name)); +} + +/* Signal handler for the switch-page signal. */ +static void gtk_tab_control_callback(GtkNotebook *notebook, + GtkNotebookPage *page, + gint UNUSED (page_num), + gpointer UNUSED (user_data)) +{ + /* + This callback is called for every selection, not just user selection. + We're only interested in user selection, which occurs outside of + redisplay. + */ + + if (!in_display) + { + Lisp_Object image_instance, callback, callback_ex; + Lisp_Object frame, event; + int update_subwindows_p = 0; + struct frame *f = gtk_widget_to_frame(GTK_WIDGET(notebook)); + int id; + + if (!f) + return; + frame = wrap_frame (f); + + id = (int) gtk_object_get_data(GTK_OBJECT(page->child), + GTK_DATA_TAB_HASHCODE_IDENTIFIER); + image_instance = Fgethash(make_int_verify(id), + FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE(f), Qnil); + callback = Fgethash(make_int(id), + FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE(f), Qnil); + callback_ex = Fgethash(make_int(id), + FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE(f), Qnil); + update_subwindows_p = 1; + + /* It is possible for a widget action to cause it to get out of + sync with its instantiator. Thus it is necessary to signal + this possibility. */ + if (IMAGE_INSTANCEP (image_instance)) + XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (image_instance) = 1; + + if (!NILP (callback_ex) && !UNBOUNDP (callback_ex)) + { + event = Fmake_event (Qnil, Qnil); + + XSET_EVENT_TYPE (event, misc_user_event); + XSET_EVENT_CHANNEL (event, frame); + XSET_EVENT_MISC_USER_FUNCTION (event, Qeval); + XSET_EVENT_MISC_USER_OBJECT (event, list4 (Qfuncall, callback_ex, image_instance, event)); + } + else if (NILP (callback) || UNBOUNDP (callback)) + event = Qnil; + else + { + Lisp_Object fn, arg; + + event = Fmake_event (Qnil, Qnil); + + get_gui_callback (callback, &fn, &arg); + XSET_EVENT_TYPE (event, misc_user_event); + XSET_EVENT_CHANNEL (event, frame); + XSET_EVENT_MISC_USER_FUNCTION (event, fn); + XSET_EVENT_MISC_USER_OBJECT (event, arg); + } + + if (!NILP (event)) + enqueue_dispatch_event (event); + + /* The result of this evaluation could cause other instances to change so + enqueue an update callback to check this. */ + if (update_subwindows_p && !NILP (event)) + enqueue_magic_eval_event (update_widget_instances, frame); + } +} + +/* Create a tab_control widget. The special handling of the individual tabs + means that the normal instantiation code cannot be used. */ +static void +gtk_tab_control_instantiate (Lisp_Object image_instance, + Lisp_Object instantiator, + Lisp_Object pointer_fg, + Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) +{ + Lisp_Object rest; + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + int i = 0; + int selected = 0; + GtkNotebook *nb; + + /* The normal instantiation is still needed. */ + gtk_widget_instantiate (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain); + + nb = GTK_NOTEBOOK (IMAGE_INSTANCE_GTK_CLIPWIDGET (ii)); + + /* Add items to the tab, find the current selection */ + LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) + { + gtk_add_tab_item (image_instance, nb, XCAR (rest), domain, i); + + if (gui_item_selected_p (XCAR (rest))) + selected = i; + + i++; + } + + gtk_notebook_set_page(nb, selected); + + /* Call per-tab lisp callback when a tab is pressed. */ + gtk_signal_connect (GTK_OBJECT (nb), "switch-page", + GTK_SIGNAL_FUNC (gtk_tab_control_callback), NULL); +} + /* Set the properties of a tab control */ static void gtk_tab_control_redisplay (Lisp_Object image_instance) @@ -2442,6 +2646,7 @@ one. */ if (tab_control_order_only_changed (image_instance)) { + int i = 0; Lisp_Object rest, selected = gui_item_list_find_selected (NILP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)) ? @@ -2455,9 +2660,6 @@ Lisp_Object old_selected =gui_item_list_find_selected (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); - /* Need to focus on the widget... */ - stderr_out ("Hey, change the tab-focus you boob...\n"); - /* Pick up the new selected item. */ XGUI_ITEM (old_selected)->selected = XGUI_ITEM (XCAR (rest))->selected; @@ -2466,8 +2668,13 @@ /* We're not actually changing the items anymore. */ IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0; IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; + + gtk_notebook_set_page(GTK_NOTEBOOK (IMAGE_INSTANCE_GTK_CLIPWIDGET (ii)), + i); break; } + + i++; } } else @@ -2476,37 +2683,23 @@ GtkNotebook *nb = GTK_NOTEBOOK (IMAGE_INSTANCE_GTK_CLIPWIDGET (ii)); guint num_pages = g_list_length (nb->children); Lisp_Object rest; + int i; + /* Why is there no API to remove everything from a notebook? */ if (num_pages >= 0) { - int i; for (i = num_pages; i >= 0; --i) { gtk_notebook_remove_page (nb, i); } } - LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) - { - Lisp_Gui_Item *pgui = XGUI_ITEM (XCAR (rest)); - char *c_name = NULL; + i = 0; - if (!STRINGP (pgui->name)) - pgui->name = eval_within_redisplay (pgui->name); - - if (!STRINGP (pgui->name)) - warn_when_safe (Qredisplay, Qwarning, - "Name does not evaluate to string"); - else - { - TO_EXTERNAL_FORMAT (LISP_STRING, pgui->name, - C_STRING_ALLOCA, c_name, - Qctext); - - gtk_notebook_append_page (nb, - gtk_vbox_new (FALSE, 3), - gtk_label_new (c_name)); - } + LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) + { + gtk_add_tab_item(image_instance, nb, XCAR(rest), + IMAGE_INSTANCE_FRAME(ii), i); } /* Show all the new widgets we just added... */ @@ -2601,14 +2794,17 @@ IIFORMAT_HAS_DEVMETHOD (gtk, button, property); IIFORMAT_HAS_DEVMETHOD (gtk, button, instantiate); IIFORMAT_HAS_DEVMETHOD (gtk, button, redisplay); + IIFORMAT_HAS_SHARED_DEVMETHOD (gtk, button, query_geometry, widget); /* general widget methods. */ INITIALIZE_DEVICE_IIFORMAT (gtk, widget); IIFORMAT_HAS_DEVMETHOD (gtk, widget, property); + IIFORMAT_HAS_DEVMETHOD (gtk, widget, query_geometry); /* progress gauge */ INITIALIZE_DEVICE_IIFORMAT (gtk, progress_gauge); IIFORMAT_HAS_DEVMETHOD (gtk, progress_gauge, redisplay); IIFORMAT_HAS_DEVMETHOD (gtk, progress_gauge, instantiate); + IIFORMAT_HAS_SHARED_DEVMETHOD (gtk, progress_gauge, query_geometry, widget); /* text field */ INITIALIZE_DEVICE_IIFORMAT (gtk, edit_field); IIFORMAT_HAS_DEVMETHOD (gtk, edit_field, instantiate); @@ -2619,6 +2815,7 @@ INITIALIZE_DEVICE_IIFORMAT (gtk, tab_control); IIFORMAT_HAS_DEVMETHOD (gtk, tab_control, instantiate); IIFORMAT_HAS_DEVMETHOD (gtk, tab_control, redisplay); + IIFORMAT_HAS_SHARED_DEVMETHOD (gtk, tab_control, query_geometry, widget); /* label */ INITIALIZE_DEVICE_IIFORMAT (gtk, label); IIFORMAT_HAS_DEVMETHOD (gtk, label, instantiate); @@ -2708,7 +2905,7 @@ vector3 (Qxbm, Q_data, \ list3 (make_int (name##_width), \ make_int (name##_height), \ - make_ext_string (name##_bits, \ + make_ext_string ((Extbyte*) name##_bits, \ sizeof (name##_bits), \ Qbinary))), \ Qglobal, Qgtk, Qnil) @@ -2757,7 +2954,8 @@ gcv.foreground = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (foreground)); gcv.background = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (background)); - gc = gdk_gc_new_with_values (new_pxmp, &gcv, GDK_GC_BACKGROUND | GDK_GC_FOREGROUND); + gc = gdk_gc_new_with_values (new_pxmp, &gcv, + (GdkGCValuesMask) (GDK_GC_BACKGROUND | GDK_GC_FOREGROUND)); XCopyPlane (GDK_WINDOW_XDISPLAY (draw), GDK_WINDOW_XWINDOW (IMAGE_INSTANCE_GTK_PIXMAP (p)), diff --text -u 'xemacs-21.5.17/src/glyphs-gtk.h' 'xemacs-21.5.18/src/glyphs-gtk.h' Index: ./src/glyphs-gtk.h --- ./src/glyphs-gtk.h Fri Apr 13 03:23:50 2001 +++ ./src/glyphs-gtk.h Sat May 15 16:43:09 2004 @@ -40,7 +40,6 @@ struct gtk_image_instance_data { GdkPixmap **pixmaps; - GdkPixmap *mask; GdkCursor *cursor; /* If depth>0, then that means that other colors were allocated when @@ -87,7 +86,7 @@ (GTK_IMAGE_INSTANCE_DATA (i)->pixmaps[slice]) #define IMAGE_INSTANCE_GTK_PIXMAP_SLICES(i) \ (GTK_IMAGE_INSTANCE_DATA (i)->pixmaps) -#define IMAGE_INSTANCE_GTK_MASK(i) (GTK_IMAGE_INSTANCE_DATA (i)->mask) +#define IMAGE_INSTANCE_GTK_MASK(i) (GdkPixmap*)(IMAGE_INSTANCE_PIXMAP_MASK (i)) #define IMAGE_INSTANCE_GTK_CURSOR(i) (GTK_IMAGE_INSTANCE_DATA (i)->cursor) #define IMAGE_INSTANCE_GTK_COLORMAP(i) (GTK_IMAGE_INSTANCE_DATA (i)->colormap) #define IMAGE_INSTANCE_GTK_PIXELS(i) (GTK_IMAGE_INSTANCE_DATA (i)->pixels) diff --text -u 'xemacs-21.5.17/src/glyphs-msw.c' 'xemacs-21.5.18/src/glyphs-msw.c' Index: ./src/glyphs-msw.c --- ./src/glyphs-msw.c Wed Feb 18 00:20:54 2004 +++ ./src/glyphs-msw.c Fri Oct 15 02:26:23 2004 @@ -939,7 +939,8 @@ static void mswindows_xpm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -1018,7 +1019,7 @@ static Lisp_Object bmp_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { return simple_image_type_normalize (inst, console_type, Qbmp); } @@ -1031,8 +1032,9 @@ static void bmp_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); @@ -1198,8 +1200,9 @@ static void mswindows_resource_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); int type = 0; @@ -1431,7 +1434,7 @@ Lisp_Object pointer_bg, int dest_mask, HBITMAP mask, - Lisp_Object mask_filename) + Lisp_Object UNUSED (mask_filename)) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Lisp_Object foreground = find_keyword_in_vector (instantiator, Q_foreground); @@ -1588,7 +1591,7 @@ mswindows_xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); const UChar_Binary *ext_data; @@ -1629,7 +1632,7 @@ mswindows_xface_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); int i, stattis; @@ -1699,7 +1702,7 @@ static void mswindows_print_image_instance (Lisp_Image_Instance *p, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { switch (IMAGE_INSTANCE_TYPE (p)) { @@ -1797,7 +1800,7 @@ /************************************************************************/ static Lisp_Object -charset_of_text (Lisp_Object text) +charset_of_text (Lisp_Object USED_IF_MULE (text)) { #ifdef MULE Ibyte *p; @@ -2085,10 +2088,10 @@ static void mswindows_subwindow_instantiate (Lisp_Object image_instance, - Lisp_Object instantiator, - Lisp_Object pointer_fg, - Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + Lisp_Object UNUSED (instantiator), + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int UNUSED (dest_mask), Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); @@ -2143,7 +2146,7 @@ static int mswindows_image_instance_equal (Lisp_Image_Instance *p1, - Lisp_Image_Instance *p2, int depth) + Lisp_Image_Instance *p2, int UNUSED (depth)) { switch (IMAGE_INSTANCE_TYPE (p1)) { @@ -2163,7 +2166,7 @@ } static Hashcode -mswindows_image_instance_hash (Lisp_Image_Instance *p, int depth) +mswindows_image_instance_hash (Lisp_Image_Instance *p, int UNUSED (depth)) { switch (IMAGE_INSTANCE_TYPE (p)) { @@ -2209,9 +2212,10 @@ /************************************************************************/ static void mswindows_widget_instantiate (Lisp_Object image_instance, - Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain, + Lisp_Object UNUSED (instantiator), + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int UNUSED (dest_mask), Lisp_Object domain, const CIbyte *class_, int flags, int exflags) { /* this function can call lisp */ diff --text -u 'xemacs-21.5.17/src/glyphs-shared.c' 'xemacs-21.5.18/src/glyphs-shared.c' Index: ./src/glyphs-shared.c --- ./src/glyphs-shared.c Sun Mar 31 17:28:26 2002 +++ ./src/glyphs-shared.c Tue Sep 21 04:19:46 2004 @@ -63,7 +63,7 @@ Lisp_Object shared_resource_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask, Lisp_Object tag) + Lisp_Object UNUSED (dest_mask), Lisp_Object tag) { /* This function can call lisp */ Lisp_Object file = Qnil; diff --text -u 'xemacs-21.5.17/src/glyphs-widget.c' 'xemacs-21.5.18/src/glyphs-widget.c' Index: ./src/glyphs-widget.c --- ./src/glyphs-widget.c Wed Feb 18 00:20:55 2004 +++ ./src/glyphs-widget.c Wed Sep 22 11:06:48 2004 @@ -149,7 +149,7 @@ } static void -check_valid_anything (Lisp_Object data) +check_valid_anything (Lisp_Object UNUSED (data)) { } @@ -274,12 +274,12 @@ return widget_border_width (IMAGE_INSTANCE_DOMAIN (ii)); } -/* #### Its not clear to me what the value of logical_unit_height should - be, or whether it should even depend on the current - image_instance. It really should probably only depend on the - default widget face and the domain, however you can envisage users - wanting different logical units for nested layouts - so using the - properties of the current lahyout is probably not so dumb. */ +/* #### It's not clear to me what the value of logical_unit_height should + be, or whether it should even depend on the current image_instance. It + really should probably only depend on the default widget face and the + domain, however you can envisage users wanting different logical units + for nested layouts - so using the properties of the current layout is + probably not so dumb. */ static int logical_unit_height (Lisp_Object text, Lisp_Object face, Lisp_Object domain) { @@ -287,7 +287,7 @@ widget_query_string_geometry (text, face, 0, &charheight, domain); /* For the returned value to be useful it needs to be big enough to - accomodate the largest single-height widget. This is currently + accomodate the largest single-height widget. This is currently the edit-field. */ return charheight + 2 * widget_spacing (domain) + 4 * widget_border_width (domain); @@ -659,8 +659,8 @@ /* we need to convert things like glyphs to images, eval expressions etc.*/ static Lisp_Object -widget_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +widget_normalize (Lisp_Object inst, Lisp_Object UNUSED (console_type), + Lisp_Object UNUSED (dest_mask)) { /* This function can call lisp */ Lisp_Object glyph = find_keyword_in_vector (inst, Q_image); @@ -870,8 +870,13 @@ } static void -widget_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object domain) +widget_post_instantiate (Lisp_Object UNUSED (image_instance), +#ifdef DEBUG_WIDGETS + Lisp_Object instantiator, +#else + Lisp_Object UNUSED (instantiator), +#endif + Lisp_Object UNUSED (domain)) { #ifdef DEBUG_WIDGETS debug_widget_instances++; @@ -886,7 +891,8 @@ static void button_query_geometry (Lisp_Object image_instance, int* width, int* height, - enum image_instance_geometry disp, Lisp_Object domain) + enum image_instance_geometry UNUSED (disp), + Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); int w, h; @@ -911,8 +917,9 @@ /* Get the geometry of an edit field. */ static void edit_field_query_geometry (Lisp_Object image_instance, - int* width, int* height, - enum image_instance_geometry disp, Lisp_Object domain) + int* width, int* height, + enum image_instance_geometry UNUSED (disp), + Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); int w, h; @@ -930,7 +937,8 @@ static void tree_view_query_geometry (Lisp_Object image_instance, int* width, int* height, - enum image_instance_geometry disp, Lisp_Object domain) + enum image_instance_geometry UNUSED (disp), + Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii); @@ -953,12 +961,13 @@ } } -/* Get the geometry of a tab control. This is based on the number of - items and text therin in the tab control. */ +/* Get the geometry of a tab control. This is based on the number of + items and text therein in the tab control. */ static void tab_control_query_geometry (Lisp_Object image_instance, int* width, int* height, - enum image_instance_geometry disp, Lisp_Object domain) + enum image_instance_geometry UNUSED (disp), + Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object items = XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); @@ -969,6 +978,11 @@ { int h, w; + /* #### Maybe we should allow items to be a list of strings? + Ie, autoconvert "label" -> ["label" "label" :selected maybe-t]. + Maybe there's a better place (or several places) to do this? + If so, change image_instantiator_tab_control back to use + check_valid_item_list for checking Q_items. -- sjt */ widget_query_string_geometry (XGUI_ITEM (XCAR (rest))->name, IMAGE_INSTANCE_WIDGET_FACE (ii), &w, &h, domain); @@ -1232,8 +1246,9 @@ } static void -layout_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object domain) +layout_post_instantiate (Lisp_Object UNUSED (image_instance), + Lisp_Object UNUSED (instantiator), + Lisp_Object UNUSED (domain)) { } @@ -1310,7 +1325,7 @@ static void layout_query_geometry (Lisp_Object image_instance, int* width, int* height, enum image_instance_geometry disp, - Lisp_Object domain) + Lisp_Object UNUSED (domain)) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii), rest; @@ -1419,8 +1434,8 @@ int layout_layout (Lisp_Object image_instance, - int width, int height, int xoffset, int yoffset, - Lisp_Object domain) + int width, int height, int UNUSED (xoffset), int yoffset, + Lisp_Object UNUSED (domain)) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object rest; @@ -1636,7 +1651,7 @@ Logical widget units do not take into account adjusments made for layout borders, so this adjusment is approximated. */ - (width, face, domain)) + (width, UNUSED (face), domain)) { int w, neww, charwidth; int border_width = DEFAULT_WIDGET_BORDER_WIDTH; @@ -1674,7 +1689,7 @@ Since frame sizes are measured in characters, this function allows you to do appropriate conversion between logical units and characters. */ - (height, face, domain)) + (height, UNUSED (face), domain)) { int h, newh, charheight; diff --text -u 'xemacs-21.5.17/src/glyphs-x.c' 'xemacs-21.5.18/src/glyphs-x.c' Index: ./src/glyphs-x.c --- ./src/glyphs-x.c Wed Feb 18 00:20:55 2004 +++ ./src/glyphs-x.c Tue Sep 21 04:19:46 2004 @@ -356,7 +356,7 @@ static void x_print_image_instance (Lisp_Image_Instance *p, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { switch (IMAGE_INSTANCE_TYPE (p)) { @@ -476,7 +476,7 @@ static int x_image_instance_equal (Lisp_Image_Instance *p1, - Lisp_Image_Instance *p2, int depth) + Lisp_Image_Instance *p2, int UNUSED (depth)) { switch (IMAGE_INSTANCE_TYPE (p1)) { @@ -495,7 +495,7 @@ } static Hashcode -x_image_instance_hash (Lisp_Image_Instance *p, int depth) +x_image_instance_hash (Lisp_Image_Instance *p, int UNUSED (depth)) { switch (IMAGE_INSTANCE_TYPE (p)) { @@ -846,7 +846,7 @@ UChar_Binary *eimage, int dest_mask, Lisp_Object instantiator, - Lisp_Object domain) + Lisp_Object UNUSED (domain)) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Colormap cmap = DEVICE_X_COLORMAP (XDEVICE(device)); @@ -914,7 +914,7 @@ Lisp_Object pointer_bg, int dest_mask, Pixmap mask, - Lisp_Object mask_filename) + Lisp_Object UNUSED (mask_filename)) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Lisp_Object foreground = find_keyword_in_vector (instantiator, Q_foreground); @@ -1074,7 +1074,7 @@ static void x_xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); Char_Binary *ext_data; @@ -1558,7 +1558,7 @@ static void x_xface_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); int i, stattis; @@ -1635,7 +1635,7 @@ static Lisp_Object autodetect_normalize (Lisp_Object instantiator, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { Lisp_Object file = find_keyword_in_vector (instantiator, Q_data); Lisp_Object filename = Qnil; @@ -1796,7 +1796,7 @@ static int XLoadFont_got_error; static int -XLoadFont_error_handler (Display *dpy, XErrorEvent *xerror) +XLoadFont_error_handler (Display *UNUSED (dpy), XErrorEvent *UNUSED (xerror)) { XLoadFont_got_error = 1; return 0; @@ -1829,7 +1829,7 @@ static void font_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { /* This function can GC */ Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); @@ -1927,7 +1927,7 @@ static void cursor_font_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + int dest_mask, Lisp_Object UNUSED (domain)) { /* This function can GC */ Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); @@ -2205,9 +2205,11 @@ /* instantiate and x type subwindow */ static void -x_subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) +x_subwindow_instantiate (Lisp_Object image_instance, + Lisp_Object UNUSED (instantiator), + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int UNUSED (dest_mask), Lisp_Object domain) { /* This function can GC */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -2374,9 +2376,11 @@ } static void -x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain, +x_widget_instantiate (Lisp_Object image_instance, + Lisp_Object UNUSED (instantiator), + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int UNUSED (dest_mask), Lisp_Object domain, const char* type, widget_value* wv) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); diff --text -u 'xemacs-21.5.17/src/glyphs.c' 'xemacs-21.5.18/src/glyphs.c' Index: ./src/glyphs.c --- ./src/glyphs.c Tue Jan 27 22:33:21 2004 +++ ./src/glyphs.c Wed Sep 22 11:06:48 2004 @@ -638,7 +638,7 @@ #ifdef ERROR_CHECK_GLYPHS static int -check_instance_cache_mapper (Lisp_Object key, Lisp_Object value, +check_instance_cache_mapper (Lisp_Object UNUSED (key), Lisp_Object value, void *flag_closure) { /* This function can GC */ @@ -1647,7 +1647,7 @@ DEFUN ("image-instance-type", Fimage_instance_type, 1, 1, 0, /* Return the type of the given image instance. The return value will be one of 'nothing, 'text, 'mono-pixmap, -'color-pixmap, 'pointer, or 'subwindow. +'color-pixmap, 'pointer, 'subwindow, or 'widget. */ (image_instance)) { @@ -2247,8 +2247,9 @@ static void nothing_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -2274,8 +2275,8 @@ } static Lisp_Object -inherit_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +inherit_normalize (Lisp_Object inst, Lisp_Object UNUSED (console_type), + Lisp_Object UNUSED (dest_mask)) { Lisp_Object face; @@ -2293,9 +2294,11 @@ } static void -inherit_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) +inherit_instantiate (Lisp_Object UNUSED (image_instance), + Lisp_Object UNUSED (instantiator), + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), + int UNUSED (dest_mask), Lisp_Object UNUSED (domain)) { /* handled specially in image_instantiate */ abort (); @@ -2321,7 +2324,8 @@ /* Called from autodetect_instantiate() */ void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), int dest_mask, Lisp_Object domain) { Lisp_Object string = find_keyword_in_vector (instantiator, Q_data); @@ -2446,7 +2450,8 @@ static void text_query_geometry (Lisp_Object image_instance, int* width, int* height, - enum image_instance_geometry disp, Lisp_Object domain) + enum image_instance_geometry UNUSED (disp), + Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); int descent = 0; @@ -2751,7 +2756,7 @@ static Lisp_Object xbm_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { Lisp_Object file = Qnil, mask_file = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; @@ -2835,7 +2840,7 @@ static Lisp_Object xface_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { /* This function can call lisp */ Lisp_Object file = Qnil, mask_file = Qnil; @@ -3052,7 +3057,7 @@ static Lisp_Object xpm_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) + Lisp_Object UNUSED (dest_mask)) { Lisp_Object file = Qnil; Lisp_Object color_symbols; @@ -3212,7 +3217,7 @@ displayed in the given domain. */ static Lisp_Object -image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, +image_instantiate (Lisp_Object specifier, Lisp_Object UNUSED (matchspec), Lisp_Object domain, Lisp_Object instantiator, Lisp_Object depth) { @@ -3506,7 +3511,7 @@ } static Lisp_Object -image_going_to_add (Lisp_Object specifier, Lisp_Object locale, +image_going_to_add (Lisp_Object specifier, Lisp_Object UNUSED (locale), Lisp_Object tag_set, Lisp_Object instantiator) { Lisp_Object possible_console_types = Qnil; @@ -3652,7 +3657,8 @@ } static void -print_glyph (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_glyph (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Glyph *glyph = XGLYPH (obj); @@ -4184,7 +4190,7 @@ } Lisp_Object -glyph_face (Lisp_Object glyph, Lisp_Object domain) +glyph_face (Lisp_Object glyph, Lisp_Object UNUSED (domain)) { /* #### Domain parameter not currently used but it will be */ return GLYPHP (glyph) ? GLYPH_FACE (XGLYPH (glyph)) : Qnil; @@ -4452,8 +4458,8 @@ system windows before deleting XEmacs windows, and hence subwindows. */ int -unmap_subwindow_instance_cache_mapper (Lisp_Object key, Lisp_Object value, - void* finalize) +unmap_subwindow_instance_cache_mapper (Lisp_Object UNUSED (key), + Lisp_Object value, void* finalize) { /* value can be nil; we cache failures as well as successes */ if (!NILP (value)) @@ -4784,7 +4790,6 @@ struct display_glyph_area *dga) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - struct frame* f; ERROR_CHECK_IMAGE_INSTANCE (subwindow); @@ -4797,7 +4802,8 @@ IMAGE_INSTANCE_SUBWINDOW_ID (ii), dga->width, dga->height, x, y); #endif - f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); + /* Error check by side effect */ + (void) XFRAME (IMAGE_INSTANCE_FRAME (ii)); IMAGE_INSTANCE_DISPLAY_X (ii) = x; IMAGE_INSTANCE_DISPLAY_Y (ii) = y; IMAGE_INSTANCE_DISPLAY_WIDTH (ii) = dga->width; @@ -4823,7 +4829,8 @@ /* Partially instantiate a subwindow. */ void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, + Lisp_Object UNUSED (pointer_fg), + Lisp_Object UNUSED (pointer_bg), int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -4864,9 +4871,10 @@ /* This is just a backup in case no-one has assigned a suitable geometry. #### It should really query the enclose window for geometry. */ static void -subwindow_query_geometry (Lisp_Object image_instance, int* width, - int* height, enum image_instance_geometry disp, - Lisp_Object domain) +subwindow_query_geometry (Lisp_Object UNUSED (image_instance), + int* width, int* height, + enum image_instance_geometry UNUSED (disp), + Lisp_Object UNUSED (domain)) { if (width) *width = 20; if (height) *height = 20; diff --text -u 'xemacs-21.5.17/src/gmalloc.c' 'xemacs-21.5.18/src/gmalloc.c' Index: ./src/gmalloc.c --- ./src/gmalloc.c Sun Jan 12 20:08:16 2003 +++ ./src/gmalloc.c Tue Sep 28 03:51:22 2004 @@ -574,14 +574,14 @@ { /* Small allocation to receive a fragment of a block. Determine the logarithm to base two of the fragment size. */ - __malloc_size_t log = 1; + __malloc_size_t log2 = 1; --size; while ((size /= 2) != 0) - ++log; + ++log2; /* Look in the fragment lists for a free fragment of the desired size. */ - next = _fraghead[log].next; + next = _fraghead[log2].next; if (next != NULL) { /* There are free fragments of this size. @@ -595,13 +595,13 @@ if (--_heapinfo[block].busy.info.frag.nfree != 0) _heapinfo[block].busy.info.frag.first = (unsigned long int) ((unsigned long int) ((char *) next->next - (char *) NULL) - % BLOCKSIZE) >> log; + % BLOCKSIZE) >> log2; /* Update the statistics. */ ++_chunks_used; - _bytes_used += 1 << log; + _bytes_used += 1 << log2; --_chunks_free; - _bytes_free -= 1 << log; + _bytes_free -= 1 << log2; } else { @@ -612,11 +612,11 @@ return NULL; /* Link all fragments but the first into the free list. */ - for (i = 1; i < (__malloc_size_t) (BLOCKSIZE >> log); ++i) + for (i = 1; i < (__malloc_size_t) (BLOCKSIZE >> log2); ++i) { - next = (struct list *) ((char *) result + (i << log)); - next->next = _fraghead[log].next; - next->prev = &_fraghead[log]; + next = (struct list *) ((char *) result + (i << log2)); + next->next = _fraghead[log2].next; + next->prev = &_fraghead[log2]; next->prev->next = next; if (next->next != NULL) next->next->prev = next; @@ -624,13 +624,13 @@ /* Initialize the nfree and first counters for this block. */ block = BLOCK (result); - _heapinfo[block].busy.type = log; + _heapinfo[block].busy.type = log2; _heapinfo[block].busy.info.frag.nfree = i - 1; _heapinfo[block].busy.info.frag.first = i - 1; - _chunks_free += (BLOCKSIZE >> log) - 1; - _bytes_free += BLOCKSIZE - (1 << log); - _bytes_used -= BLOCKSIZE - (1 << log); + _chunks_free += (BLOCKSIZE >> log2) - 1; + _bytes_free += BLOCKSIZE - (1 << log2); + _bytes_used -= BLOCKSIZE - (1 << log2); } } else diff --text -u 'xemacs-21.5.17/src/gpmevent.c' 'xemacs-21.5.18/src/gpmevent.c' Index: ./src/gpmevent.c --- ./src/gpmevent.c Sun Jan 12 20:08:16 2003 +++ ./src/gpmevent.c Tue Sep 21 04:19:47 2004 @@ -108,7 +108,7 @@ Run GPM_GetEvent(). This function is the process handler for the GPM connection. */ - (process, string)) + (process, UNUSED (string))) { Gpm_Event ev; int modifiers = 0; @@ -206,8 +206,8 @@ #ifdef TIOCLINUX static Lisp_Object -tty_get_foreign_selection (Lisp_Object selection_symbol, - Lisp_Object target_type) +tty_get_foreign_selection (Lisp_Object UNUSED (selection_symbol), + Lisp_Object UNUSED (target_type)) { /* This function can GC */ struct device *d = decode_device (Qnil); @@ -300,7 +300,8 @@ } static Lisp_Object -tty_selection_exists_p (Lisp_Object selection, Lisp_Object selection_type) +tty_selection_exists_p (Lisp_Object UNUSED (selection), + Lisp_Object UNUSED (selection_type)) { return (Qt); } @@ -357,7 +358,8 @@ } static void -tty_set_mouse_position (struct window *w, int x, int y) +tty_set_mouse_position (struct window *UNUSED (w), int UNUSED (x), + int UNUSED (y)) { /* #### I couldn't find any GPM functions that set the mouse position. diff --text -u 'xemacs-21.5.17/src/gtk-glue.c' 'xemacs-21.5.18/src/gtk-glue.c' Index: ./src/gtk-glue.c --- ./src/gtk-glue.c Sun Jan 12 20:08:17 2003 +++ ./src/gtk-glue.c Sun May 2 13:07:00 2004 @@ -122,11 +122,11 @@ { if (arg->type == GTK_TYPE_STRING_LIST) { - g_list_foreach (GTK_VALUE_POINTER (*arg), __make_string_mapper, &rval); + g_list_foreach ((GList*) GTK_VALUE_POINTER (*arg), __make_string_mapper, &rval); } else if (arg->type == GTK_TYPE_OBJECT_LIST) { - g_list_foreach (GTK_VALUE_POINTER (*arg), __make_gtk_object_mapper, &rval); + g_list_foreach ((GList*) GTK_VALUE_POINTER (*arg), __make_gtk_object_mapper, &rval); } else { @@ -169,7 +169,7 @@ if (arg->type == GTK_TYPE_STRING_ARRAY) { - FROB(gchar *, CHECK_STRING, XSTRING_DATA); + FROB(gchar *, CHECK_STRING, (gchar*) XSTRING_DATA); } else if (arg->type == GTK_TYPE_FLOAT_ARRAY) { @@ -249,8 +249,8 @@ set_event_type (emacs_event, misc_user_event); SET_EVENT_MISC_USER_BUTTON (emacs_event, ev->button.button); SET_EVENT_MISC_USER_MODIFIERS (emacs_event, 0); - SET_EVENT_MISC_USER_X (emacs_event, ev->button.x); - SET_EVENT_MISC_USER_Y (emacs_event, ev->button.y); + SET_EVENT_MISC_USER_X (emacs_event, (int) ev->button.x); + SET_EVENT_MISC_USER_Y (emacs_event, (int) ev->button.y); if (ev->type == GDK_2BUTTON_PRESS) SET_EVENT_MISC_USER_FUNCTION (emacs_event, intern ("double-click")); else diff --text -u 'xemacs-21.5.17/src/gtk-xemacs.c' 'xemacs-21.5.18/src/gtk-xemacs.c' Index: ./src/gtk-xemacs.c --- ./src/gtk-xemacs.c Fri Feb 21 15:56:58 2003 +++ ./src/gtk-xemacs.c Sat Oct 16 22:08:58 2004 @@ -96,7 +96,7 @@ { GtkXEmacs *xemacs; - xemacs = gtk_type_new (gtk_xemacs_get_type ()); + xemacs = (GtkXEmacs*) gtk_type_new (gtk_xemacs_get_type ()); xemacs->f = f; return GTK_WIDGET (xemacs); @@ -271,14 +271,58 @@ } } +/* Assign a size and position to the child widgets. This differs from the + super class method in that for all widgets except the scrollbars the size + and position are not caclulated here. This is because these widgets have + this function performed for them by the redisplay code (see + gtk_map_subwindow()). If the superclass method is called then the widgets + can change size and position as the two pieces of code move the widgets at + random. +*/ static void gtk_xemacs_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkXEmacs *x = GTK_XEMACS (widget); + GtkFixed *fixed = GTK_FIXED (widget); struct frame *f = GTK_XEMACS_FRAME (x); int columns, rows; + GList *children; + guint16 border_width; - parent_class->size_allocate(widget, allocation); + widget->allocation = *allocation; + if (GTK_WIDGET_REALIZED (widget)) + gdk_window_move_resize (widget->window, + allocation->x, + allocation->y, + allocation->width, + allocation->height); + + border_width = GTK_CONTAINER (fixed)->border_width; + + children = fixed->children; + while (children) + { + GtkFixedChild* child = (GtkFixedChild*) children->data; + children = children->next; + + /* + Scrollbars are the only widget that is managed by GTK. See + comments in gtk_create_scrollbar_instance(). + */ + if (GTK_WIDGET_VISIBLE (child->widget) && + gtk_type_is_a(GTK_OBJECT_TYPE(child->widget), GTK_TYPE_SCROLLBAR)) + { + GtkAllocation child_allocation; + GtkRequisition child_requisition; + + gtk_widget_get_child_requisition (child->widget, &child_requisition); + child_allocation.x = child->x + border_width; + child_allocation.y = child->y + border_width; + child_allocation.width = child_requisition.width; + child_allocation.height = child_requisition.height; + gtk_widget_size_allocate (child->widget, &child_allocation); + } + } if (f) { @@ -298,8 +342,10 @@ { GtkXEmacs *x = GTK_XEMACS (widget); struct frame *f = GTK_XEMACS_FRAME (x); - redisplay_redraw_exposed_area (f, area->x, area->y, area->width, - area->height); + + if (GTK_WIDGET_DRAWABLE (widget)) + redisplay_redraw_exposed_area (f, area->x, area->y, area->width, + area->height); } static void @@ -315,32 +361,35 @@ gtk_fixed_paint() directly, which clears the background window, which causes A LOT of flashing. */ - gtk_xemacs_paint (widget, area); + if (GTK_WIDGET_DRAWABLE (widget)) + { + gtk_xemacs_paint (widget, area); - children = fixed->children; + children = fixed->children; - while (children) - { - child = children->data; - children = children->next; - /* #### This is what causes the scrollbar flickering! - Evidently the scrollbars pretty much take care of drawing - themselves in most cases. Then we come along and tell them - to redraw again! - - But if we just leave it out, then they do not get drawn - correctly the first time! - - Scrollbar flickering has been greatly helped by the - optimizations in scrollbar-gtk.c / - gtk_update_scrollbar_instance_status (), so this is not that - big a deal anymore. - */ - if (gtk_widget_intersect (child->widget, area, &child_area)) - { - gtk_widget_draw (child->widget, &child_area); - } - } + while (children) + { + child = (GtkFixedChild*) children->data; + children = children->next; + /* #### This is what causes the scrollbar flickering! + Evidently the scrollbars pretty much take care of drawing + themselves in most cases. Then we come along and tell them + to redraw again! + + But if we just leave it out, then they do not get drawn + correctly the first time! + + Scrollbar flickering has been greatly helped by the + optimizations in scrollbar-gtk.c / + gtk_update_scrollbar_instance_status (), so this is not that + big a deal anymore. + */ + if (gtk_widget_intersect (child->widget, area, &child_area)) + { + gtk_widget_draw (child->widget, &child_area); + } + } + } } static gint @@ -350,18 +399,21 @@ struct frame *f = GTK_XEMACS_FRAME (x); GdkRectangle *a = &event->area; - /* This takes care of drawing the scrollbars, etc */ - parent_class->expose_event (widget, event); + if (GTK_WIDGET_DRAWABLE (widget)) + { + /* This takes care of drawing the scrollbars, etc */ + parent_class->expose_event (widget, event); - /* Now draw the actual frame data */ - if (!check_for_ignored_expose (f, a->x, a->y, a->width, a->height) && - !find_matching_subwindow (f, a->x, a->y, a->width, a->height)) - redisplay_redraw_exposed_area (f, a->x, a->y, a->width, a->height); - return (TRUE); + /* Now draw the actual frame data */ + if (!check_for_ignored_expose (f, a->x, a->y, a->width, a->height) && + !find_matching_subwindow (f, a->x, a->y, a->width, a->height)) + redisplay_redraw_exposed_area (f, a->x, a->y, a->width, a->height); + return (TRUE); + } } Lisp_Object -xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w) +xemacs_gtk_convert_color(GdkColor *c, GtkWidget *UNUSED (w)) { char color_buf[255]; diff --text -u 'xemacs-21.5.17/src/gui-gtk.c' 'xemacs-21.5.18/src/gui-gtk.c' Index: ./src/gui-gtk.c --- ./src/gui-gtk.c Sun Mar 9 11:27:43 2003 +++ ./src/gui-gtk.c Wed Jul 7 21:01:07 2004 @@ -1,4 +1,4 @@ -/* General GUI code -- X-specific. (menubars, scrollbars, toolbars, dialogs) +/* General GUI code -- GTK-specific. (menubars, scrollbars, toolbars, dialogs) Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995, 1996, 2002 Ben Wing. Copyright (C) 1995 Sun Microsystems, Inc. @@ -34,10 +34,6 @@ #include "console-gtk-impl.h" -#ifdef HAVE_POPUPS -Lisp_Object Qmenu_no_selection_hook; -#endif - static GUI_ID gui_id_ctr = 0; GUI_ID diff --text -u 'xemacs-21.5.17/src/gui-msw.c' 'xemacs-21.5.18/src/gui-msw.c' Index: ./src/gui-msw.c --- ./src/gui-msw.c Sun Jan 12 20:08:17 2003 +++ ./src/gui-msw.c Tue Sep 21 04:19:47 2004 @@ -42,7 +42,8 @@ * command if we return nil */ Lisp_Object -mswindows_handle_gui_wm_command (struct frame *f, HWND ctrl, LPARAM id) +mswindows_handle_gui_wm_command (struct frame *f, HWND UNUSED (ctrl), + LPARAM id) { /* Try to map the command id through the proper hash table */ Lisp_Object callback, callback_ex, image_instance, frame, event; diff --text -u 'xemacs-21.5.17/src/gui-x.c' 'xemacs-21.5.18/src/gui-x.c' Index: ./src/gui-x.c --- ./src/gui-x.c Wed Feb 18 00:22:09 2004 +++ ./src/gui-x.c Tue Sep 21 04:19:47 2004 @@ -218,10 +218,13 @@ } /* The following is actually called from somewhere within XtDispatchEvent(), - called from XtAppProcessEvent() in event-Xt.c */ + called from XtAppProcessEvent() in event-Xt.c. + + Callback function for widgets and menus. +*/ void -popup_selection_callback (Widget widget, LWLIB_ID ignored_id, +popup_selection_callback (Widget widget, LWLIB_ID UNUSED (id), XtPointer client_data) { Lisp_Object data, image_instance, callback, callback_ex; @@ -502,13 +505,13 @@ if (NILP (pgui->style)) { Ibyte *intname; - Bytecount intlen; + Bytecount unused_intlen; /* If the callback is nil, treat this item like unselectable text. This way, dashes will show up as a separator. */ if (!wv->enabled) wv->type = BUTTON_TYPE; TO_INTERNAL_FORMAT (C_STRING, wv->name, - ALLOCA, (intname, intlen), + ALLOCA, (intname, unused_intlen), Qlwlib_encoding); if (separator_string_p (intname)) { diff --text -u 'xemacs-21.5.17/src/gui.c' 'xemacs-21.5.18/src/gui.c' Index: ./src/gui.c --- ./src/gui.c Wed Feb 18 00:20:56 2004 +++ ./src/gui.c Tue Sep 21 04:19:47 2004 @@ -688,7 +688,8 @@ } static void -print_gui_item (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_gui_item (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Gui_Item *g = XGUI_ITEM (obj); @@ -804,7 +805,7 @@ } static void -finalize_gui_item (void *header, int for_disksave) +finalize_gui_item (void *UNUSED (header), int UNUSED (for_disksave)) { } diff --text -u 'xemacs-21.5.17/src/gutter.c' 'xemacs-21.5.18/src/gutter.c' Index: ./src/gutter.c --- ./src/gutter.c Fri Feb 21 15:56:58 2003 +++ ./src/gutter.c Tue Sep 21 04:19:48 2004 @@ -380,7 +380,6 @@ static void output_gutter (struct frame *f, enum gutter_pos pos, int force) { - Lisp_Object frame; Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); struct device *d = XDEVICE (f->device); struct window* w = XWINDOW (window); @@ -406,8 +405,6 @@ cdla = f->current_display_lines[pos]; cdla_len = Dynarr_length (cdla); - frame = wrap_frame (f); - get_gutter_coords (f, pos, &x, &y, &width, &height); /* generate some display lines */ generate_displayable_area (w, WINDOW_GUTTER (w, pos), @@ -555,7 +552,8 @@ knows exactly what extents have changed. */ void gutter_extent_signal_changed_region_maybe (Lisp_Object obj, - Charbpos start, Charbpos end) + Charbpos UNUSED (start), + Charbpos UNUSED (end)) { /* #### Start and end are currently ignored but could be used by a more optimal gutter redisplay. We currently loop over all frames @@ -835,7 +833,8 @@ DEFINE_SPECIFIER_TYPE (gutter); static void -gutter_after_change (Lisp_Object specifier, Lisp_Object locale) +gutter_after_change (Lisp_Object UNUSED (specifier), + Lisp_Object UNUSED (locale)) { MARK_GUTTER_CHANGED; } @@ -951,8 +950,9 @@ } static void -default_gutter_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +default_gutter_specs_changed (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vgutter); } @@ -997,24 +997,25 @@ } static void -default_gutter_size_changed_in_window (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +default_gutter_size_changed_in_window (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vgutter_size); } static void -default_gutter_border_width_changed_in_window (Lisp_Object specifier, - struct window *w, - Lisp_Object oldval) +default_gutter_border_width_changed_in_window (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vgutter_border_width); } static void -default_gutter_visible_p_changed_in_window (Lisp_Object specifier, - struct window *w, - Lisp_Object oldval) +default_gutter_visible_p_changed_in_window (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vgutter_visible_p); /* Need to reconstruct the gutter specifier as it is affected by the diff --text -u 'xemacs-21.5.17/src/hpplay.c' 'xemacs-21.5.18/src/hpplay.c' Index: ./src/hpplay.c --- ./src/hpplay.c Wed Jun 5 18:56:04 2002 +++ ./src/hpplay.c Tue Sep 21 04:19:48 2004 @@ -92,7 +92,7 @@ /* Playing */ void -play_bucket_internal( Audio *audio, SBucket *pSBucket, long volume) +play_bucket_internal( Audio *audio, SBucket *pSBucket, long UNUSED (volume)) { SBPlayParams playParams; AGainEntry gainEntry; @@ -186,7 +186,7 @@ int -play_sound_data (UChar_Binary * data, int length, int volume) +play_sound_data (UChar_Binary * data, int UNUSED (length), int volume) { SBucket *pSBucket; Audio *audio; diff --text -u 'xemacs-21.5.17/src/input-method-motif.c' 'xemacs-21.5.18/src/input-method-motif.c' Index: ./src/input-method-motif.c --- ./src/input-method-motif.c Thu Feb 20 17:19:42 2003 +++ ./src/input-method-motif.c Tue Sep 21 04:19:49 2004 @@ -40,14 +40,15 @@ /* Create X input method for device */ void -XIM_init_device (struct device *d) +XIM_init_device (struct device *UNUSED (d)) { /* Nothing to do */ } /* Callback for the deleting frame. */ static void -XIM_delete_frame (Widget w, XtPointer client_data, XtPointer call_data) +XIM_delete_frame (Widget UNUSED (w), XtPointer client_data, + XtPointer UNUSED (call_data)) { XmImUnregister ((Widget) client_data); } @@ -115,7 +116,7 @@ } void -XIM_SetGeometry (struct frame *f) +XIM_SetGeometry (struct frame *UNUSED (f)) { } diff --text -u 'xemacs-21.5.17/src/input-method-xlib.c' 'xemacs-21.5.18/src/input-method-xlib.c' Index: ./src/input-method-xlib.c --- ./src/input-method-xlib.c Sun Jan 12 20:08:17 2003 +++ ./src/input-method-xlib.c Tue Sep 21 04:19:49 2004 @@ -137,7 +137,8 @@ /* Called from when XIM is destroying. Clear all the XIC when the XIM was destroying... */ static void -IMDestroyCallback (XIM im, XPointer client_data, XPointer call_data) +IMDestroyCallback (XIM UNUSED (im), XPointer client_data, + XPointer UNUSED (call_data)) { struct device *d = (struct device *)client_data; Lisp_Object tail; @@ -160,7 +161,8 @@ /* This is registered in XIM_init_device (when DEVICE is initializing). This activates XIM when XIM becomes available. */ static void -IMInstantiateCallback (Display *dpy, XPointer client_data, XPointer call_data) +IMInstantiateCallback (Display *dpy, XPointer client_data, + XPointer UNUSED (call_data)) { struct device *d = (struct device *)client_data; XIM xim; @@ -243,7 +245,8 @@ /* Callback for the deleting frame. */ static void -XIM_delete_frame (Widget w, XtPointer client_data, XtPointer call_data) +XIM_delete_frame (Widget UNUSED (w), XtPointer client_data, + XtPointer UNUSED (call_data)) { struct frame *f = (struct frame *) client_data; struct device *d = XDEVICE (FRAME_DEVICE (f)); @@ -686,7 +689,7 @@ XtAppContext app, XrmValuePtr toVal, XtPointer converter_data, - XrmValuePtr args, + XrmValuePtr UNUSED (args), Cardinal *num_args) { #ifdef DEBUG_XIM diff --text -u 'xemacs-21.5.17/src/intl-encap-win32.c' 'xemacs-21.5.18/src/intl-encap-win32.c' Index: ./src/intl-encap-win32.c --- ./src/intl-encap-win32.c Tue Sep 16 05:21:46 2003 +++ ./src/intl-encap-win32.c Sat Sep 11 13:00:41 2004 @@ -1795,8 +1795,8 @@ DWORD fMode) { if (XEUNICODE_P) -#ifdef CYGWIN_HEADERS - /* Cygwin mistakenly declares the fourth and fifth arguments as +#if defined (CYGWIN_HEADERS) && W32API_INSTALLED_VER < W32API_VER(3,1) + /* Cygwin used to mistakenly declare the fourth and fifth arguments as PDEVMODEA. */ return DocumentPropertiesW (hWnd, hPrinter, (LPWSTR) pDeviceName, (DEVMODEA *) pDevModeOutput, diff --text -u 'xemacs-21.5.17/src/intl-win32.c' 'xemacs-21.5.18/src/intl-win32.c' Index: ./src/intl-win32.c --- ./src/intl-win32.c Wed Oct 1 00:26:50 2003 +++ ./src/intl-win32.c Fri Oct 15 02:26:24 2004 @@ -1604,7 +1604,7 @@ #else /* not MULE */ int -mswindows_locale_to_code_page (LCID lcid) +mswindows_locale_to_code_page (LCID UNUSED (lcid)) { return CP_ACP; } @@ -1745,7 +1745,7 @@ } static Lisp_Object -lcid_to_locale_mule_or_no (LCID lcid) +lcid_to_locale_mule_or_no (LCID USED_IF_MULE (lcid)) { #ifdef MULE return lcid_to_locale (lcid); @@ -1755,7 +1755,7 @@ } static int -determine_code_page (Lisp_Object codesys) +determine_code_page (Lisp_Object USED_IF_MULE (codesys)) { #ifdef MULE LCID locale; @@ -1907,8 +1907,8 @@ } static void -mswindows_multibyte_to_unicode_print (Lisp_Object cs, - Lisp_Object printcharfun, int escapeflag) +mswindows_multibyte_to_unicode_print (Lisp_Object cs, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { struct mswindows_multibyte_to_unicode_coding_system *data = XCODING_SYSTEM_TYPE_DATA (cs, mswindows_multibyte_to_unicode); @@ -2073,7 +2073,7 @@ } static enum source_sink_type -mswindows_multibyte_to_unicode_conversion_end_type (Lisp_Object codesys) +mswindows_multibyte_to_unicode_conversion_end_type (Lisp_Object UNUSED (codesys)) { return DECODES_BYTE_TO_BYTE; } @@ -2106,9 +2106,9 @@ DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (mswindows_multibyte); static Bytecount -mswindows_multibyte_convert (struct coding_stream *str, - const UExtbyte *src, - unsigned_char_dynarr *dst, Bytecount n) +mswindows_multibyte_convert (struct coding_stream *UNUSED (str), + const UExtbyte *UNUSED (src), + unsigned_char_dynarr *UNUSED (dst), Bytecount n) { Bytecount orign = n; /* should never be called; is preprocessed away in the diff --text -u 'xemacs-21.5.17/src/intl-x.c' 'xemacs-21.5.18/src/intl-x.c' Index: ./src/intl-x.c --- ./src/intl-x.c Wed Mar 13 17:52:49 2002 +++ ./src/intl-x.c Fri Oct 15 02:26:24 2004 @@ -30,7 +30,7 @@ int init_x_locale (Lisp_Object locale); int -init_x_locale (Lisp_Object locale) +init_x_locale (Lisp_Object USED_IF_MULE (locale)) { #ifdef MULE /* dverna - Nov. 98: #### DON'T DO THIS !!! The default XtLanguageProc diff --text -u 'xemacs-21.5.17/src/keymap.c' 'xemacs-21.5.18/src/keymap.c' Index: ./src/keymap.c --- ./src/keymap.c Wed Oct 1 00:26:50 2003 +++ ./src/keymap.c Tue Sep 21 04:19:50 2004 @@ -254,7 +254,8 @@ } static void -print_keymap (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_keymap (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { /* This function can GC */ Lisp_Keymap *keymap = XKEYMAP (obj); @@ -690,8 +691,8 @@ }; static int -keymap_submaps_mapper_0 (Lisp_Object key, Lisp_Object value, - void *keymap_submaps_closure) +keymap_submaps_mapper_0 (Lisp_Object UNUSED (key), Lisp_Object value, + void *UNUSED (keymap_submaps_closure)) { /* This function can GC */ /* Perform any autoloads, etc */ @@ -830,7 +831,7 @@ static Lisp_Object -traverse_keymaps_noop (Lisp_Object keymap, void *arg) +traverse_keymaps_noop (Lisp_Object UNUSED (keymap), void *UNUSED (arg)) { return Qnil; } @@ -917,7 +918,7 @@ } static Lisp_Object -keymap_prompt_mapper (Lisp_Object keymap, void *arg) +keymap_prompt_mapper (Lisp_Object keymap, void *UNUSED (arg)) { return XKEYMAP (keymap)->prompt; } @@ -2896,7 +2897,7 @@ */ static int map_keymap_sort_predicate (Lisp_Object obj1, Lisp_Object obj2, - Lisp_Object pred) + Lisp_Object UNUSED (pred)) { /* obj1 and obj2 are conses with keysyms in their cars. Cdrs are ignored. */ @@ -3469,7 +3470,7 @@ to other keymaps or slots. This makes it possible to search for an indirect definition itself. */ - (definition, keymaps, firstonly, noindirect, event_or_keys)) + (definition, keymaps, firstonly, UNUSED (noindirect), event_or_keys)) { /* This function can GC */ Lisp_Object maps[100]; @@ -4423,8 +4424,28 @@ DEFVAR_LISP ("key-translation-map", &Vkey_translation_map /* Keymap of key translations that can override keymaps. -This keymap works like `function-key-map', but comes after that, + +This keymap works like `function-key-map', but is searched before it, and applies even for keys that have ordinary bindings. + +The `read-key-sequence' function replaces any subsequence bound by +`key-translation-map' with its binding. More precisely, when the active +keymaps have no binding for the current key sequence but +`key-translation-map' binds a suffix of the sequence to a vector or string, +`read-key-sequence' replaces the matching suffix with its binding, and +continues with the new sequence. See `key-binding' for details. + +The events that come from bindings in `key-translation-map' are not +themselves looked up in `key-translation-map'. + +#### FIXME: stolen from `function-key-map'; need better example. +#### I guess you could implement a Dvorak keyboard with this? +For example, suppose `key-translation-map' binds `ESC O P' to [f1]. +Typing `ESC O P' to `read-key-sequence' would return +\[#<keypress-event f1>]. Typing `C-x ESC O P' would return +\[#<keypress-event control-X> #<keypress-event f1>]. If [f1] +were a prefix key, typing `ESC O P x' would return +\[#<keypress-event f1> #<keypress-event x>]. */ ); Vkey_translation_map = Qnil; diff --text -u 'xemacs-21.5.17/src/linuxplay.c' 'xemacs-21.5.18/src/linuxplay.c' Index: ./src/linuxplay.c --- ./src/linuxplay.c Wed Mar 13 17:52:50 2002 +++ ./src/linuxplay.c Wed Sep 15 05:26:46 2004 @@ -274,7 +274,7 @@ size_t (*sndcnv)(void **dayta,size_t *sz,void **); fmtType ffmt; int fmt,speed,tracks; - UChar_Binary *pptr,*optr,*cptr,*sptr; + void *pptr, *optr, *cptr, *sptr; int wrtn,rrtn,crtn,prtn; UChar_Binary sndbuf[SNDBUFSZ]; @@ -323,10 +323,8 @@ device; repeat until all data has been processed */ rrtn = length; do { - for (pptr = data; (prtn = parsesndfile((void **)&pptr,(size_t *)&rrtn, - (void **)&optr)) > 0; ) - for (cptr = optr; (crtn = sndcnv((void **)&cptr,(size_t *) &prtn, - (void **)&sptr)) > 0; ) { + for (pptr = data; (prtn = parsesndfile(&pptr,(size_t *)&rrtn,&optr)) > 0; ) + for (cptr = optr; (crtn = sndcnv(&cptr,(size_t *) &prtn,&sptr)) > 0; ) { for (;;) { if ((wrtn = write(audio_fd,sptr,crtn)) < 0) { sound_perror("write"); goto END_OF_PLAY; } diff --text -u 'xemacs-21.5.17/src/lisp.h' 'xemacs-21.5.18/src/lisp.h' Index: ./src/lisp.h --- ./src/lisp.h Fri Mar 19 11:59:10 2004 +++ ./src/lisp.h Tue Sep 14 23:32:50 2004 @@ -2767,6 +2767,8 @@ #define EXFUN_MANY int, Lisp_Object* #define EXFUN_UNEVALLED Lisp_Object #define EXFUN(sym, max_args) Lisp_Object sym (EXFUN_##max_args) +#define EXFUN_NORETURN(sym, max_args) \ + DECLARE_DOESNT_RETURN_TYPE (Lisp_Object, sym (EXFUN_##max_args)) #define SUBR_MAX_ARGS 8 #define MANY -2 @@ -2795,6 +2797,26 @@ }; \ Lisp_Object Fname (DEFUN_##max_args arglist) +#define DEFUN_NORETURN(lname, Fname, min_args, max_args, prompt, arglist) \ + DECLARE_DOESNT_RETURN_TYPE (Lisp_Object, Fname (EXFUN_##max_args)); \ + static struct Lisp_Subr S##Fname = \ + { \ + { /* struct lrecord_header */ \ + lrecord_type_subr, /* lrecord_type_index */ \ + 1, /* mark bit */ \ + 1, /* c_readonly bit */ \ + 1, /* lisp_readonly bit */ \ + 0 /* unused */ \ + }, \ + min_args, \ + max_args, \ + prompt, \ + 0, /* doc string */ \ + lname, \ + (lisp_fn_t) Fname \ + }; \ + DOESNT_RETURN_TYPE (Lisp_Object) Fname (DEFUN_##max_args arglist) + /* Heavy ANSI C preprocessor hackery to get DEFUN to declare a prototype that matches max_args, and add the obligatory `Lisp_Object' type declaration to the formal C arguments. */ @@ -3377,6 +3399,16 @@ /************************************************************************/ /************************************************************************/ +/* Other numeric types */ +/************************************************************************/ +#ifdef WITH_NUMBER_TYPES +#include "number.h" +#else +#define make_integer(x) make_int(x) +#endif + + +/************************************************************************/ /* prototypes */ /************************************************************************/ @@ -3710,7 +3742,7 @@ Lisp_Object save_current_buffer_restore (Lisp_Object); /* Defined in emacs.c */ -EXFUN (Fkill_emacs, 1); +EXFUN_NORETURN (Fkill_emacs, 1); EXFUN (Frunning_temacs_p, 0); EXFUN (Fforce_debugging_signal, 1); @@ -3729,7 +3761,7 @@ extern int suppress_early_error_handler_backtrace; void debug_break (void); int debug_can_access_memory (void *ptr, Bytecount len); -void really_abort (void); +DECLARE_DOESNT_RETURN (really_abort (void)); void zero_out_command_line_status_vars (void); /* Defined in emodules.c */ @@ -3750,7 +3782,7 @@ EXFUN (Finteractive_p, 0); EXFUN (Fprogn, UNEVALLED); MODULE_API EXFUN (Fsignal, 2); -MODULE_API EXFUN (Fthrow, 2); +MODULE_API EXFUN_NORETURN (Fthrow, 2); MODULE_API EXFUN (Fcall_with_condition_handler, MANY); EXFUN (Ffunction_max_args, 1); EXFUN (Ffunction_min_args, 1); @@ -4333,6 +4365,9 @@ int locate_file (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object *, int); EXFUN (Flocate_file_clear_hashing, 1); int isfloat_string (const char *); +#ifdef HAVE_RATIO +int isratio_string (const char *); +#endif /* Well, I've decided to enable this. -- ben */ /* And I've decided to make it work right. -- sb */ @@ -5062,8 +5097,8 @@ extern Lisp_Object Qmalformed_property_list, Qmark, Qmodule; extern Lisp_Object Qmono_pixmap_image_instance_p, Qmouse_leave_buffer_hook; extern Lisp_Object Qnative_layout, Qnatnump, Qnetwork_error, Qno_catch; -extern Lisp_Object Qnothing_image_instance_p, Qnumber_char_or_marker_p; -extern Lisp_Object Qnumberp, Qout_of_memory; +extern Lisp_Object Qnonnegativep, Qnothing_image_instance_p; +extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp, Qout_of_memory; extern Lisp_Object Qoverflow_error, Qpoint, Qpointer_glyph_p; extern Lisp_Object Qpointer_image_instance_p, Qprint_length; extern Lisp_Object Qprint_string_length, Qprinting_unreadable_object; diff --text -u 'xemacs-21.5.17/src/lread.c' 'xemacs-21.5.18/src/lread.c' Index: ./src/lread.c --- ./src/lread.c Sun Jan 4 06:54:42 2004 +++ ./src/lread.c Tue Sep 21 04:19:50 2004 @@ -218,6 +218,8 @@ : (x)) +static DECLARE_DOESNT_RETURN (read_syntax_error (const char *)); + static DOESNT_RETURN read_syntax_error (const char *string) { @@ -1848,6 +1850,17 @@ #endif } } +#ifdef HAVE_RATIO + if (isratio_string (read_ptr)) + { + /* GMP ratio_set_string has no effect with initial + sign */ + if (*read_ptr == '+') + read_ptr++; + ratio_set_string (scratch_ratio, read_ptr, 0); + ratio_canonicalize (scratch_ratio); + return Fcanonicalize_number (make_ratio_rt (scratch_ratio)); + } +#endif if (isfloat_string (read_ptr)) return make_float (atof (read_ptr)); } @@ -1920,11 +1933,18 @@ return result; } overflow: +#ifdef HAVE_BIGNUM + { + bignum_set_string (scratch_bignum, (const char *) buf, 0); + return make_bignum_bg (scratch_bignum); + } +#else return Fsignal (Qinvalid_read_syntax, list3 (build_msg_string ("Integer constant overflow in reader"), make_string (buf, len), make_int (base))); +#endif /* HAVE_BIGNUM */ loser: return Fsignal (Qinvalid_read_syntax, list3 (build_msg_string @@ -2653,6 +2673,39 @@ || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT) || state == (DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT))); } + +#ifdef HAVE_RATIO +int +isratio_string (const char *cp) +{ + /* Possible minus/plus sign */ + if (*cp == '-' || *cp == '+') + cp++; + + /* Numerator */ + if (*cp < '0' || *cp > '9') + return 0; + + do { + cp++; + } while (*cp >= '0' && *cp <= '9'); + + /* Slash */ + if (*cp++ != '/') + return 0; + + /* Denominator */ + if (*cp < '0' || *cp > '9') + return 0; + + do { + cp++; + } while (*cp >= '0' && *cp <= '9'); + + return *cp == '\0' || *cp == ' ' || *cp =='\t' || *cp == '\n' || + *cp == '\r' || *cp == '\f'; +} +#endif static void * sequence_reader (Lisp_Object readcharfun, @@ -2695,7 +2748,7 @@ }; static void * -read_list_conser (Lisp_Object readcharfun, void *state, Charcount len) +read_list_conser (Lisp_Object readcharfun, void *state, Charcount UNUSED (len)) { struct read_list_state *s = (struct read_list_state *) state; Lisp_Object elt; diff --text -u 'xemacs-21.5.17/src/lrecord.h' 'xemacs-21.5.18/src/lrecord.h' Index: ./src/lrecord.h --- ./src/lrecord.h Tue Oct 14 14:03:06 2003 +++ ./src/lrecord.h Tue Apr 6 07:49:56 2004 @@ -215,6 +215,9 @@ lrecord_type_emacs_gtk_boxed, lrecord_type_weak_box, lrecord_type_ephemeron, + lrecord_type_bignum, + lrecord_type_ratio, + lrecord_type_bigfloat, lrecord_type_free, /* only used for "free" lrecords */ lrecord_type_undefined, /* only used for debugging */ lrecord_type_last_built_in_type /* must be last */ diff --text -u 'xemacs-21.5.17/src/lstream.c' 'xemacs-21.5.18/src/lstream.c' Index: ./src/lstream.c --- ./src/lstream.c Tue Mar 9 00:41:36 2004 +++ ./src/lstream.c Tue Sep 21 04:19:50 2004 @@ -58,7 +58,8 @@ } static void -print_lstream (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_lstream (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lstream *lstr = XLSTREAM (obj); @@ -1601,7 +1602,7 @@ } static int -dynarr_closer (Lstream *stream) +dynarr_closer (Lstream *UNUSED (stream)) { return 0; } diff --text -u 'xemacs-21.5.17/src/malloc.c' 'xemacs-21.5.18/src/malloc.c' Index: ./src/malloc.c Prereq: 1 --- ./src/malloc.c Fri Aug 30 04:45:30 2002 +++ ./src/malloc.c Wed Jun 16 21:49:26 2004 @@ -285,7 +285,7 @@ static char busy[30]; /* Number of bytes of writable memory we can expect to be able to get */ -extern unsigned int lim_data; +extern unsigned long lim_data; /* Level number of warnings already issued. 0 -- no warnings issued. @@ -339,7 +339,7 @@ { char *cp; int nblks; - unsigned int siz; + unsigned long siz; int oldmask; #ifdef BSD diff --text -u 'xemacs-21.5.17/src/marker.c' 'xemacs-21.5.18/src/marker.c' Index: ./src/marker.c --- ./src/marker.c Sun Jan 12 20:08:18 2003 +++ ./src/marker.c Tue Sep 21 04:19:51 2004 @@ -54,7 +54,8 @@ } static void -print_marker (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_marker (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Marker *marker = XMARKER (obj); @@ -76,7 +77,7 @@ } static int -marker_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +marker_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) { Lisp_Marker *marker1 = XMARKER (obj1); Lisp_Marker *marker2 = XMARKER (obj2); @@ -88,7 +89,7 @@ } static unsigned long -marker_hash (Lisp_Object obj, int depth) +marker_hash (Lisp_Object obj, int UNUSED (depth)) { unsigned long hash = (unsigned long) XMARKER (obj)->buffer; if (hash) diff --text -u 'xemacs-21.5.17/src/mem-limits.h' 'xemacs-21.5.18/src/mem-limits.h' Index: ./src/mem-limits.h --- ./src/mem-limits.h Tue Aug 19 11:07:16 2003 +++ ./src/mem-limits.h Sat Sep 11 14:28:41 2004 @@ -20,12 +20,7 @@ /* Synched up with: FSF 19.30. */ -/* #### This ancient code really sucks. - configure should check for: - HAVE_SYS_RESOURCE_H, HAVE_ULIMIT_H, HAVE_GETRLIMIT, HAVE_ULIMIT, - and select action based on those values. - getrlimit() should be preferred to ulimit(). - On Linux, ulimit() is deprecated and always returns -1. */ +/* Subsequently cleaned up and reorganised, made to use configure. */ #ifndef INCLUDED_mem_limits_h_ #define INCLUDED_mem_limits_h_ @@ -38,13 +33,18 @@ #include <ulimit.h> #endif -/* Some systems need this before <sys/resource.h>. */ +#ifdef HAVE_SYS_RESOURCE_H +/* Some systems need either sys/types.h or sys/time.h before <sys/resource.h>. */ #include <sys/types.h> +#include <sys/time.h> +#include <sys/resource.h> +#endif -#ifdef _LIBC +#ifdef HAVE_SYS_VLIMIT_H +#include <sys/vlimit.h> +#endif -#include <sys/resource.h> -#define BSD4_2 /* Tell code below to use getrlimit. */ +#ifdef _LIBC /* Old Linux startup code won't define __data_start. */ extern int etext, __data_start; weak_symbol (__data_start) @@ -52,34 +52,6 @@ #else /* not GNU libc */ -#if defined (__osf__) && (defined (__mips) || defined (mips) || defined (__alpha)) -#include <sys/time.h> -#include <sys/resource.h> -#endif - -#if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__) || defined(__OpenBSD__) -#if defined(__linux__) && defined (powerpc) /*Added by Fukui*/ -#else /*Added by Fukui*/ -#define BSD4_2 -#endif /*Added by Fukui*/ -#endif - -#ifndef BSD4_2 -#ifndef USG -#ifndef WIN32_NATIVE -#ifndef CYGWIN -#if defined(__linux__) && defined(powerpc) /*Added Kaoru Fukui*/ -#else /*Added Kaoru Fukui*/ -#include <sys/vlimit.h> -#endif /*Added by Fukui*/ -#endif /* not CYGWIN */ -#endif /* not WIN32_NATIVE */ -#endif /* not USG */ -#else /* if BSD4_2 */ -#include <sys/time.h> -#include <sys/resource.h> -#endif /* BSD4_2 */ - #ifdef emacs typedef void *POINTER; @@ -108,55 +80,72 @@ static POINTER data_space_start; /* Number of bytes of writable memory we can expect to be able to get */ -extern unsigned int lim_data; +extern unsigned long lim_data; + +/* The implementation of get_lim_data() is very machine dependent. */ #if defined (HEAP_IN_DATA) && !defined(PDUMP) extern unsigned long static_heap_size; extern MODULE_API int initialized; + static void get_lim_data (void) { if (!initialized) { - lim_data = (unsigned int) -1; /* static_heap_size; */ + lim_data = (unsigned long) -1; /* static_heap_size; */ } else { - lim_data = (unsigned int) -1; + lim_data = (unsigned long) -1; } } -#else -#ifdef NO_LIM_DATA + +#elif defined(NO_LIM_DATA) + static void get_lim_data (void) { - lim_data = (unsigned int) -1; + lim_data = (unsigned long) -1; } -#else /* not NO_LIM_DATA */ -#ifdef USG +#elif defined(HAVE_GETRLIMIT) static void get_lim_data (void) { - lim_data = (unsigned int) -1; + struct rlimit XXrlimit; + + getrlimit (RLIMIT_DATA, &XXrlimit); +#ifdef RLIM_INFINITY + lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */ +#else + lim_data = XXrlimit.rlim_cur; /* soft limit */ +#endif +} + +#elif defined(HAVE_ULIMIT) + +static void +get_lim_data (void) +{ + lim_data = (unsigned long) -1; /* Use the ulimit call, if we seem to have it. */ -#if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX) +#if !defined (ULIMIT_BREAK_VALUE) lim_data = ulimit (3, 0); #endif /* If that didn't work, just use the macro's value. */ #ifdef ULIMIT_BREAK_VALUE - if (lim_data == (unsigned int) -1) + if (lim_data == (unsigned long) -1) lim_data = ULIMIT_BREAK_VALUE; #endif lim_data -= (long) data_space_start; } -#else /* not USG */ -#if defined( WIN32_NATIVE ) +#elif defined(WIN32_NATIVE) static void get_lim_data (void) @@ -165,8 +154,7 @@ lim_data = data_region_size; } -#else -#if !defined (BSD4_2) && !defined (__osf__) +#elif defined(HAVE_VLIMIT) static void get_lim_data (void) @@ -174,24 +162,8 @@ lim_data = vlimit (LIM_DATA, -1); } -#else /* BSD4_2 */ - -static void -get_lim_data (void) -{ - struct rlimit XXrlimit; - - getrlimit (RLIMIT_DATA, &XXrlimit); -#ifdef RLIM_INFINITY - lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */ #else - lim_data = XXrlimit.rlim_cur; /* soft limit */ -#endif -} -#endif /* BSD4_2 */ -#endif /* not WIN32_NATIVE */ -#endif /* not USG */ -#endif /* not NO_LIM_DATA */ -#endif /* not HEAP_IN_DATA */ +#error Cannot determine an implementation of get_lim_data(). +#endif /* not HAVE_VLIMIT */ #endif /* INCLUDED_mem_limits_h_ */ diff --text -u 'xemacs-21.5.17/src/menubar-gtk.c' 'xemacs-21.5.18/src/menubar-gtk.c' Index: ./src/menubar-gtk.c --- ./src/menubar-gtk.c Wed Apr 16 02:21:36 2003 +++ ./src/menubar-gtk.c Tue Sep 21 04:19:51 2004 @@ -1,4 +1,4 @@ -/* Implements an elisp-programmable menubar -- X interface. +/* Implements an elisp-programmable menubar -- Gtk interface. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. Copyright (C) 2002, 2003 Ben Wing. @@ -49,7 +49,7 @@ #define SUBMENU_TYPE 1 #define POPUP_TYPE 2 -static GtkWidget *menu_descriptor_to_widget_1 (Lisp_Object descr); +static GtkWidget *menu_descriptor_to_widget_1 (Lisp_Object descr, GtkAccelGroup* accel_group); #define FRAME_GTK_MENUBAR_DATA(f) (FRAME_GTK_DATA (f)->menubar_data) #define XFRAME_GTK_MENUBAR_DATA_LASTBUFF(f) XCAR (FRAME_GTK_MENUBAR_DATA (f)) @@ -113,7 +113,7 @@ return xemacs_menubar_type; } -static GtkWidgetClass *parent_class; +static GtkWidgetClass *menubar_parent_class; static void gtk_xemacs_menubar_class_init (GtkXEmacsMenubarClass *klass) @@ -121,13 +121,13 @@ GtkWidgetClass *widget_class; widget_class = (GtkWidgetClass*) klass; - parent_class = (GtkWidgetClass *) gtk_type_class (gtk_menu_bar_get_type ()); + menubar_parent_class = (GtkWidgetClass *) gtk_type_class (gtk_menu_bar_get_type ()); widget_class->size_request = gtk_xemacs_menubar_size_request; } static void -gtk_xemacs_menubar_init (GtkXEmacsMenubar *xemacs) +gtk_xemacs_menubar_init (GtkXEmacsMenubar *UNUSED (xemacs)) { } @@ -137,7 +137,7 @@ GtkXEmacsMenubar *x = GTK_XEMACS_MENUBAR (widget); GtkRequisition frame_size; - parent_class->size_request (widget, requisition); + menubar_parent_class->size_request (widget, requisition); /* #### BILL! ** We should really only do this if the menu has not been detached! @@ -153,13 +153,124 @@ GtkWidget * gtk_xemacs_menubar_new (struct frame *f) { - GtkXEmacsMenubar *menubar = gtk_type_new (gtk_xemacs_menubar_get_type ()); + GtkXEmacsMenubar *menubar = (GtkXEmacsMenubar*) gtk_type_new (gtk_xemacs_menubar_get_type ()); menubar->frame = f; return (GTK_WIDGET (menubar)); } +/* + * Label with XEmacs accelerator character support. + * + * The default interfaces to GtkAccelLabel does not understand XEmacs + * keystroke printing conventions, nor is it convenient in the places where is + * it needed. This subclass provides an alternative interface more suited to + * XEmacs needs but does not add new functionality. + */ +#define GTK_TYPE_XEMACS_ACCEL_LABEL (gtk_xemacs_accel_label_get_type ()) +#define GTK_XEMACS_ACCEL_LABEL(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_ACCEL_LABEL, GtkXEmacsAccelLabel)) +#define GTK_XEMACS_ACCEL_LABEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_LABEL, GtkXEmacsAccelLabelClass)) +#define GTK_IS_XEMACS_ACCEL_LABEL(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_XEMACS_ACCEL_LABEL)) +#define GTK_IS_XEMACS_ACCEL_LABEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_XEMACS_ACCEL_LABEL)) + +typedef struct _GtkXEmacsAccelLabel GtkXEmacsAccelLabel; +typedef struct _GtkXEmacsAccelLabelClass GtkXEmacsAccelLabelClass; + +/* Instance structure. No additional fields required. */ +struct _GtkXEmacsAccelLabel +{ + GtkAccelLabel label; +}; + +/* Class structure. No additional fields required. */ +struct _GtkXEmacsAccelLabelClass +{ + GtkAccelLabelClass parent_class; +}; + +static GtkType gtk_xemacs_accel_label_get_type(void); +static GtkWidget* gtk_xemacs_accel_label_new(const gchar *string); +static void gtk_xemacs_set_accel_keys(GtkXEmacsAccelLabel* l, + Lisp_Object keys); +static void gtk_xemacs_accel_label_class_init(GtkXEmacsAccelLabelClass *klass); +static void gtk_xemacs_accel_label_init(GtkXEmacsAccelLabel *xemacs); + +static GtkType +gtk_xemacs_accel_label_get_type(void) +{ + static GtkType xemacs_accel_label_type = 0; + + if (!xemacs_accel_label_type) + { + static const GtkTypeInfo xemacs_accel_label_info = + { + "GtkXEmacsAccelLabel", + sizeof (GtkXEmacsAccelLabel), + sizeof (GtkXEmacsAccelLabelClass), + (GtkClassInitFunc) gtk_xemacs_accel_label_class_init, + (GtkObjectInitFunc) gtk_xemacs_accel_label_init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + xemacs_accel_label_type = gtk_type_unique (gtk_accel_label_get_type(), &xemacs_accel_label_info); + } + + return xemacs_accel_label_type; +} + +static void +gtk_xemacs_accel_label_class_init(GtkXEmacsAccelLabelClass *UNUSED (klass)) +{ + /* Nothing to do. */ +} + +static void +gtk_xemacs_accel_label_init(GtkXEmacsAccelLabel *UNUSED (xemacs)) +{ + /* Nothing to do. */ +} + +static GtkWidget* +gtk_xemacs_accel_label_new (const gchar *string) +{ + GtkXEmacsAccelLabel *xemacs_accel_label; + + xemacs_accel_label = (GtkXEmacsAccelLabel*) gtk_type_new (GTK_TYPE_XEMACS_ACCEL_LABEL); + + if (string && *string) + gtk_label_set_text (GTK_LABEL (xemacs_accel_label), string); + + return GTK_WIDGET (xemacs_accel_label); +} + +/* Make the string <keys> the accelerator string for the label. */ +static void +gtk_xemacs_set_accel_keys(GtkXEmacsAccelLabel* l, Lisp_Object keys) +{ + g_return_if_fail (l != NULL); + g_return_if_fail (GTK_IS_XEMACS_ACCEL_LABEL (l)); + + /* Disable the standard way of finding the accelerator string for the + label. */ + gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL(l), NULL); + + /* Set the string straight from the object. */ + if (STRINGP (keys) && XSTRING_LENGTH (keys)) + { + C_STRING_TO_EXTERNAL_MALLOC(XSTRING_DATA (keys), + l->label.accel_string, + Qctext); + } + else + { + /* l->label.accel_string = NULL;*/ + } +} + + /* We now return you to your regularly scheduled menus... */ int dockable_menubar; @@ -173,7 +284,7 @@ /* Converting from XEmacs to GTK representation */ static Lisp_Object -menu_name_to_accelerator (char *name) +menu_name_to_accelerator (Ibyte *name) { while (*name) { if (*name=='%') { @@ -182,7 +293,7 @@ return Qnil; if (*name=='_' && *(name+1)) { - int accelerator = (int) (unsigned char) (*(name+1)); + int accelerator = (int) (*(name+1)); return make_char (tolower (accelerator)); } } @@ -200,7 +311,7 @@ #ifdef TEAR_OFF_MENUS static void -__torn_off_sir(GtkMenuItem *item, gpointer user_data) +__torn_off_sir(GtkMenuItem *UNUSED (item), gpointer user_data) { GtkWidget *menu_item = GTK_WIDGET (user_data); @@ -231,7 +342,7 @@ does the delayed creation of the menu items. We populate the submenu and away we go. */ static void -__maybe_destroy (GtkWidget *child, GtkWidget *precious) +__maybe_destroy (GtkWidget *child, GtkWidget *UNUSED (precious)) { if (GTK_IS_MENU_ITEM (child) && !GTK_IS_TEAROFF_MENU_ITEM (child)) { @@ -320,7 +431,8 @@ } else { - next = menu_descriptor_to_widget_1 (child); + next = menu_descriptor_to_widget_1 (child, + gtk_menu_ensure_uline_accel_group (GTK_MENU (item->submenu))); } if (!next) @@ -344,7 +456,7 @@ } static void -__kill_stupid_gtk_timer (GtkObject *obj, gpointer user_data) +__kill_stupid_gtk_timer (GtkObject *obj, gpointer UNUSED (user_data)) { GtkMenuItem *mi = GTK_MENU_ITEM (obj); @@ -355,10 +467,66 @@ } } +/* Convert the XEmacs menu accelerator representation to Gtk mnemonic form. If + no accelerator has been provided, put one at the start of the string (this + mirrors the behaviour under X). This algorithm is also found in + dialog-gtk.el:gtk-popup-convert-underscores. +*/ +static char * +convert_underscores(const Ibyte *name) +{ + char *rval; + int i,j; + int found_accel = FALSE; + int underscores = 0; + + for (i = 0; name[i]; ++i) + if (name[i] == '%' && name[i+1] == '_') + { + found_accel = TRUE; + } + else if (name[i] == '_') + { + underscores++; + } + + /* Allocate space for the original string, plus zero byte plus extra space + for all quoted underscores plus possible additional leading accelerator. */ + rval = (char*) xmalloc_and_zero (qxestrlen(name) + 1 + underscores + + (found_accel ? 0 : 1)); + + if (!found_accel) + rval[0] = '_'; + + for (i = 0, j = (found_accel ? 0 : 1); name[i]; i++) + { + if (name[i]=='%') + { + i++; + if (!(name[i])) + continue; + + if ((name[i] != '_') && (name[i] != '%')) + i--; + + found_accel = TRUE; + } + else if (name[i] == '_') + { + rval[j++] = '_'; + } + + rval[j++] = name[i]; + } + + return rval; +} + +/* Remove the XEmacs menu accellerator representation from a string. */ static char * -remove_underscores(const char *name) +remove_underscores(const Ibyte *name) { - char *rval = xmalloc_and_zero (strlen(name) + 1); + char *rval = (char*) xmalloc_and_zero (qxestrlen(name) + 1); int i,j; for (i = 0, j = 0; name[i]; i++) @@ -368,7 +536,9 @@ if (!(name[i])) continue; - if ((name[i] == '_')) + if ((name[i] != '_') && (name[i] != '%')) + i--; + else continue; } rval[j++] = name[i]; @@ -381,7 +551,8 @@ DESCR is either a list (meaning a submenu), a vector, or nil (if you include a :filter keyword) */ static GtkWidget * -menu_convert (Lisp_Object desc, GtkWidget *reuse) +menu_convert (Lisp_Object desc, GtkWidget *reuse, + GtkAccelGroup* menubar_accel_group) { GtkWidget *menu_item = NULL; GtkWidget *submenu = NULL; @@ -398,8 +569,23 @@ if (!reuse) { - char *temp_menu_name = remove_underscores (XSTRING_DATA (XCAR (desc))); - menu_item = gtk_menu_item_new_with_label (temp_menu_name); + char *temp_menu_name = convert_underscores (XSTRING_DATA (XCAR (desc))); + GtkWidget* accel_label = gtk_xemacs_accel_label_new(NULL); + guint accel_key; + + gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5); + accel_key = gtk_label_parse_uline (GTK_LABEL (accel_label), temp_menu_name); + + menu_item = gtk_menu_item_new (); + gtk_container_add (GTK_CONTAINER (menu_item), accel_label); + gtk_widget_show (accel_label); + + if (menubar_accel_group) + gtk_widget_add_accelerator (menu_item, + "activate_item", + menubar_accel_group, + accel_key, GDK_MOD1_MASK, + GTK_ACCEL_LOCKED); free (temp_menu_name); } else @@ -548,28 +734,13 @@ return (menu_item); } -static struct frame * -__get_channel (GtkWidget *w) -{ - struct frame *f = NULL; - - for (; w; w = w->parent) - { - if ((f = (struct frame *) gtk_object_get_data (GTK_OBJECT (w), "xemacs::frame"))) - return (f); - } - - return (selected_frame()); -} - - /* Called whenever a button, radio, or toggle is selected in the menu */ static void __generic_button_callback (GtkMenuItem *item, gpointer user_data) { Lisp_Object callback, function, data, channel; - channel = wrap_frame (__get_channel (GTK_WIDGET (item))); + channel = wrap_frame (gtk_widget_to_frame (GTK_WIDGET (item))); callback = VOID_TO_LISP (user_data); @@ -583,7 +754,7 @@ It is only called from menu_item_descriptor_to_widget_value, which prohibits GC. */ static GtkWidget * -menu_descriptor_to_widget_1 (Lisp_Object descr) +menu_descriptor_to_widget_1 (Lisp_Object descr, GtkAccelGroup* accel_group) { if (STRINGP (descr)) { @@ -596,7 +767,7 @@ else if (LISTP (descr)) { /* It is a submenu */ - return (menu_convert (descr, NULL)); + return (menu_convert (descr, NULL, accel_group)); } else if (VECTORP (descr)) { @@ -617,6 +788,7 @@ int plist_p; int selected_spec = 0, included_spec = 0; GtkWidget *widget = NULL; + guint accel_key; if (length < 2) sferror ("button descriptors must be at least 2 long", descr); @@ -698,22 +870,23 @@ if (!separator_string_p (XSTRING_DATA (name))) { - char *label_buffer = NULL; + Ibyte *label_buffer = NULL; char *temp_label = NULL; if (STRINGP (suffix) && XSTRING_LENGTH (suffix)) { - label_buffer = ALLOCA (XSTRING_LENGTH (name) + 15 + XSTRING_LENGTH (suffix)); - sprintf (label_buffer, "%s %s ", XSTRING_DATA (name), XSTRING_DATA (suffix)); + label_buffer = (Ibyte*) ALLOCA (XSTRING_LENGTH (name) + 15 + XSTRING_LENGTH (suffix)); + sprintf ((char*) label_buffer, "%s %s ", XSTRING_DATA (name), XSTRING_DATA (suffix)); } else { - label_buffer = ALLOCA (XSTRING_LENGTH (name) + 15); - sprintf (label_buffer, "%s ", XSTRING_DATA (name)); + label_buffer = (Ibyte*) ALLOCA (XSTRING_LENGTH (name) + 15); + sprintf ((char*) label_buffer, "%s ", XSTRING_DATA (name)); } - temp_label = remove_underscores (label_buffer); - main_label = gtk_accel_label_new (temp_label); + temp_label = convert_underscores (label_buffer); + main_label = gtk_xemacs_accel_label_new (NULL); + accel_key = gtk_label_parse_uline (GTK_LABEL (main_label), temp_label); free (temp_label); } @@ -837,42 +1010,23 @@ GTK_SIGNAL_FUNC (__generic_button_callback), LISP_TO_VOID (callback)); - /* We cheat here... GtkAccelLabel usually builds its - `accel_string' from the widget it is attached to, but we do - not want to go thru the overhead of converting our nice - string back into the modifier + key format that requires, - just so that they can convert it back into a (possibly - different/wrong) string - - We set the label string manually, and things should 'just - work' - - In an ideal world we would just subclass GtkLabel ourselves, - but I have known for a very long time that this is not an - ideal world. - - #### Should do menu shortcuts `correctly' one of these days. + /* Now that all the information about the menu item is know, set the + remaining properties. */ if (main_label) { - GtkAccelLabel *l = GTK_ACCEL_LABEL (main_label); - gtk_container_add (GTK_CONTAINER (widget), main_label); - gtk_accel_label_set_accel_widget (l, NULL); - gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5); + gtk_misc_set_alignment (GTK_MISC (main_label), 0.0, 0.5); + gtk_xemacs_set_accel_keys(GTK_XEMACS_ACCEL_LABEL(main_label), keys); - if (STRINGP (keys) && XSTRING_LENGTH (keys)) - { - C_STRING_TO_EXTERNAL_MALLOC (XSTRING_DATA (keys), l->accel_string, - Qctext); - stderr_out ("accel: %s\n", l->accel_string); - } - else - { - /* l->accel_string = ""; */ - } + if (accel_group) + gtk_widget_add_accelerator (widget, + "activate_item", + accel_group, + accel_key, 0, + GTK_ACCEL_LOCKED); } return (widget); @@ -885,39 +1039,40 @@ } static GtkWidget * -menu_descriptor_to_widget (Lisp_Object descr) +menu_descriptor_to_widget (Lisp_Object descr, GtkAccelGroup* accel_group) { GtkWidget *rval = NULL; int count = begin_gc_forbidden (); /* Cannot GC from here on out... */ - rval = menu_descriptor_to_widget_1 (descr); + rval = menu_descriptor_to_widget_1 (descr, accel_group); unbind_to (count); return (rval); } static gboolean -menu_can_reuse_widget (GtkWidget *child, const char *label) +menu_can_reuse_widget (GtkWidget *child, const Ibyte *label) { /* Everything up at the top level was done using - ** gtk_menu_item_new_with_label(), but we still double check to make + ** gtk_xemacs_accel_label_new(), but we still double check to make ** sure we don't seriously foobar ourselves. */ - char *temp_label = NULL; - gpointer possible_child = g_list_nth_data (gtk_container_children (GTK_CONTAINER (child)), 0); + gpointer possible_child = + g_list_nth_data (gtk_container_children (GTK_CONTAINER (child)), 0); + gboolean ret_val = FALSE; if (possible_child && GTK_IS_LABEL (possible_child)) { - if (!temp_label) temp_label = remove_underscores (label); + char *temp_label = remove_underscores (label); + if (!strcmp (GTK_LABEL (possible_child)->label, temp_label)) - { - free (temp_label); - return (TRUE); - } + ret_val = TRUE; + + free (temp_label); } - if (temp_label) free (temp_label); - return (FALSE); + + return ret_val; } /* Converts a menubar description into a GtkMenuBar... a menubar is a @@ -933,6 +1088,7 @@ GtkWidget *menubar = FRAME_GTK_MENUBAR_WIDGET (f); GUI_ID id = (GUI_ID) gtk_object_get_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG); guint menu_position = 0; + GtkAccelGroup *menubar_accel_group; /* Remove any existing protection for old menu items */ ungcpro_popup_callbacks (id); @@ -940,6 +1096,8 @@ /* GCPRO the whole damn thing */ gcpro_popup_callbacks (id, descr); + menubar_accel_group = gtk_accel_group_new(); + EXTERNAL_LIST_LOOP (tail, value) { gpointer current_child = g_list_nth_data (GTK_MENU_SHELL (menubar)->children, menu_position); @@ -957,7 +1115,7 @@ /* It is a button description */ GtkWidget *item; - item = menu_descriptor_to_widget (item_descr); + item = menu_descriptor_to_widget (item_descr, menubar_accel_group); gtk_widget_set_name (item, "XEmacsMenuButton"); if (!item) @@ -979,12 +1137,13 @@ if (current_child && menu_can_reuse_widget (GTK_WIDGET (current_child), XSTRING_DATA (XCAR (item_descr)))) { - widget = menu_convert (item_descr, GTK_WIDGET (current_child)); + widget = menu_convert (item_descr, GTK_WIDGET (current_child), + menubar_accel_group); reused_p = TRUE; } else { - widget = menu_convert (item_descr, NULL); + widget = menu_convert (item_descr, NULL, menubar_accel_group); if (current_child) gtk_widget_destroy (GTK_WIDGET (current_child)); gtk_menu_bar_insert (GTK_MENU_BAR (menubar), widget, menu_position); } @@ -1023,6 +1182,10 @@ } } } + + /* Attach the new accelerator group to the frame. */ + gtk_window_add_accel_group (GTK_WINDOW (FRAME_GTK_SHELL_WIDGET(f)), + menubar_accel_group); } @@ -1033,7 +1196,8 @@ #endif static gboolean -run_menubar_hook (GtkWidget *widget, GdkEventButton *event, gpointer user_data) +run_menubar_hook (GtkWidget *widget, GdkEventButton *UNUSED (event), + gpointer UNUSED (user_data)) { if (!GTK_MENU_SHELL(widget)->active) { @@ -1226,7 +1390,7 @@ } static void -popdown_menu_cb (GtkMenuShell *menu, gpointer user_data) +popdown_menu_cb (GtkMenuShell *UNUSED (menu), gpointer UNUSED (user_data)) { popup_up_p--; } @@ -1246,7 +1410,7 @@ CHECK_STRING (XCAR (menu_desc)); /* Now lets get down to business... */ - widget = menu_descriptor_to_widget (menu_desc); + widget = menu_descriptor_to_widget (menu_desc, NULL); menu = GTK_MENU_ITEM (widget)->submenu; gtk_widget_set_name (widget, "XEmacsPopupMenu"); id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG); @@ -1290,7 +1454,7 @@ */ (menu)) { - GtkWidget *w = menu_descriptor_to_widget (menu); + GtkWidget *w = menu_descriptor_to_widget (menu, NULL); return (w ? build_gtk_object (GTK_OBJECT (w)) : Qnil); } @@ -1333,3 +1497,6 @@ #endif reinit_vars_of_menubar_gtk (); } + +/*---------------------------------------------------------------------------*/ + diff --text -u 'xemacs-21.5.17/src/menubar-msw.c' 'xemacs-21.5.18/src/menubar-msw.c' Index: ./src/menubar-msw.c --- ./src/menubar-msw.c Wed Feb 18 00:20:57 2004 +++ ./src/menubar-msw.c Tue Sep 21 04:19:51 2004 @@ -609,7 +609,7 @@ /* Message handlers */ /*------------------------------------------------------------------------*/ static Lisp_Object -unsafe_handle_wm_initmenupopup_1 (HMENU menu, struct frame *f) +unsafe_handle_wm_initmenupopup_1 (HMENU menu, struct frame *UNUSED (f)) { /* This function can call lisp, beat dogs and stick chewing gum to everything! */ diff --text -u 'xemacs-21.5.17/src/menubar-x.c' 'xemacs-21.5.18/src/menubar-x.c' Index: ./src/menubar-x.c --- ./src/menubar-x.c Thu Feb 19 11:49:20 2004 +++ ./src/menubar-x.c Tue Sep 21 04:19:51 2004 @@ -442,7 +442,8 @@ */ static void -pre_activate_callback (Widget widget, LWLIB_ID id, XtPointer client_data) +pre_activate_callback (Widget widget, LWLIB_ID UNUSED (id), + XtPointer client_data) { /* This function can GC */ struct device *d = get_device_from_display (XtDisplay (widget)); @@ -647,7 +648,8 @@ } static void -popup_menu_down_callback (Widget widget, LWLIB_ID id, XtPointer client_data) +popup_menu_down_callback (Widget widget, LWLIB_ID id, + XtPointer UNUSED (client_data)) { if (popup_handled_p (id)) return; @@ -1147,7 +1149,8 @@ } static Lisp_Object -menu_accelerator_junk_on_error (Lisp_Object errordata, Lisp_Object ignored) +menu_accelerator_junk_on_error (Lisp_Object errordata, + Lisp_Object UNUSED (ignored)) { Vmenu_accelerator_prefix = Qnil; Vmenu_accelerator_modifiers = Qnil; diff --text -u 'xemacs-21.5.17/src/menubar.c' 'xemacs-21.5.18/src/menubar.c' Index: ./src/menubar.c --- ./src/menubar.c Wed Feb 18 00:20:57 2004 +++ ./src/menubar.c Tue Sep 21 04:19:51 2004 @@ -88,8 +88,8 @@ Lisp_Object Qmenu_escape; static int -menubar_variable_changed (Lisp_Object sym, Lisp_Object *val, - Lisp_Object in_object, int flags) +menubar_variable_changed (Lisp_Object UNUSED (sym), Lisp_Object *UNUSED (val), + Lisp_Object UNUSED (in_object), int UNUSED (flags)) { MARK_MENUBAR_CHANGED; return 0; @@ -114,15 +114,17 @@ } static void -menubar_visible_p_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +menubar_visible_p_changed (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { MARK_MENUBAR_CHANGED; } static void -menubar_visible_p_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) +menubar_visible_p_changed_in_frame (Lisp_Object UNUSED (specifier), + struct frame *f, + Lisp_Object UNUSED (oldval)) { update_frame_menubars (f); } diff --text -u 'xemacs-21.5.17/src/minibuf.c' 'xemacs-21.5.18/src/minibuf.c' Index: ./src/minibuf.c --- ./src/minibuf.c Fri Jun 21 06:18:38 2002 +++ ./src/minibuf.c Tue Sep 21 04:19:51 2004 @@ -134,14 +134,17 @@ return Qnil; } -DEFUN ("read-minibuffer-internal", Fread_minibuffer_internal, 1, 1, 0, /* +DEFUN_NORETURN ("read-minibuffer-internal", Fread_minibuffer_internal, + 1, 1, 0, /* Lowest-level interface to minibuffers. Don't call this. */ (prompt)) { /* This function can GC */ - int speccount = specpdl_depth (); - Lisp_Object val; + + /* We used to record the specpdl_depth here, but since call_command_loop + never returns, we can never call unbind_to_1. Since we exit via a throw, + we let whoever catches unbind for us. */ CHECK_STRING (prompt); @@ -186,9 +189,9 @@ minibuf_level++; clear_echo_area (selected_frame (), Qnil, 0); - val = call_command_loop (Qt); + call_command_loop (Qt); - return unbind_to_1 (speccount, val); + RETURN_NOT_REACHED (Qnil); } @@ -771,7 +774,7 @@ } int -echo_area_active (struct frame *f) +echo_area_active (struct frame *UNUSED (f)) { /* By definition, the echo area is active if the echo-area buffer is not empty. No need to call Lisp code. (Anyway, this function @@ -795,7 +798,7 @@ } Lisp_Object -echo_area_contents (struct frame *f) +echo_area_contents (struct frame *UNUSED (f)) { /* See above. By definition, the contents of the echo-area buffer are the contents of the echo area. */ diff --text -u 'xemacs-21.5.17/src/miscplay.c' 'xemacs-21.5.18/src/miscplay.c' Index: ./src/miscplay.c --- ./src/miscplay.c Wed Mar 13 17:52:52 2002 +++ ./src/miscplay.c Tue Sep 21 04:19:51 2004 @@ -29,12 +29,6 @@ #include "syssignal.h" #include "sysfile.h" -#ifdef __GNUC__ -#define UNUSED(x) ((void)(x)) -#else -#define UNUSED(x) -#endif - /* Maintain global variable for keeping parser state information; this struct is set to zero before the first invocation of the parser. The use of a global variable prevents multiple concurrent executions of this code, but @@ -102,11 +96,9 @@ /* Currently we cannot cope with files in VOC format; if you really need to play these files, they should be converted by using SOX */ -static size_t parsevoc(void **data,size_t *sz,void **outbuf) +static size_t parsevoc(void **UNUSED (data), size_t *UNUSED (sz), + void **UNUSED (outbuf)) { - UNUSED(data); - UNUSED(sz); - UNUSED(outbuf); return(0); } diff --text -u 'xemacs-21.5.17/src/mule-canna.c' 'xemacs-21.5.18/src/mule-canna.c' Index: ./src/mule-canna.c --- ./src/mule-canna.c Fri Aug 29 00:44:29 2003 +++ ./src/mule-canna.c Tue Sep 21 04:19:52 2004 @@ -159,11 +159,13 @@ #ifdef CANNA2 #define IROHA_BC +#define CANNA_NEW_WCHAR_AWARE #include "canna/jrkanji.h" #include "canna/RK.h" #else /* !CANNA2 */ #include "iroha/jrkanji.h" #include "iroha/RK.h" +extern int (*jrBeepFunc) (void); #endif /* !CANNA2 */ extern char *jrKanjiError; @@ -339,10 +341,11 @@ } /* For whatever reason, calling Fding directly from libCanna loses */ -static void +static int call_Fding (void) { Fding (Qnil, Qnil, Qnil); + return 0; } DEFUN ("canna-initialize", Fcanna_initialize, 0, 3, 0, /* @@ -435,8 +438,6 @@ } else { - extern void (*jrBeepFunc) (void); - jrBeepFunc = call_Fding; #ifdef KC_SETAPPNAME @@ -496,7 +497,6 @@ { jrKanjiStatusWithValue ksv; jrKanjiStatus ks; - int len; #ifdef CANNA_MULE unsigned char cbuf[4096]; #endif @@ -513,7 +513,7 @@ ks.length = strlen ((const char *) cbuf); #endif /* CANNA_MULE */ ksv.ks = &ks; - len = jrKanjiControl (0, KC_DEFINEKANJI, (char *)&ksv); + jrKanjiControl (0, KC_DEFINEKANJI, (char *)&ksv); return storeResults (key_buffer, ksv.val, ksv.ks); } @@ -793,7 +793,7 @@ { int i, slen, len; unsigned char *p, RkBuf[RKBUFSIZE]; - Lisp_Object res = Qnil, endp; + Lisp_Object res = Qnil; CHECK_INT (bunsetsu); if (confirmContext () == 0) @@ -808,11 +808,11 @@ slen = strlen ((const char *) p); if (NILP(res)) { - endp = res = Fcons (make_string (p, slen), Qnil); + res = Fcons (make_string (p, slen), Qnil); } else { - endp = XCDR (res) = Fcons (make_string (p, slen), Qnil); + XCDR (res) = Fcons (make_string (p, slen), Qnil); } p += slen + 1; } diff --text -u 'xemacs-21.5.17/src/mule-ccl.c' 'xemacs-21.5.18/src/mule-ccl.c' Index: ./src/mule-ccl.c --- ./src/mule-ccl.c Wed Jun 5 18:56:31 2002 +++ ./src/mule-ccl.c Tue Sep 21 04:19:52 2004 @@ -728,9 +728,9 @@ } \ else \ { \ - Ibyte work[MAX_ICHAR_LEN]; \ + Ibyte work[MAX_ICHAR_LEN]; \ int len; \ - len = non_ascii_set_itext_ichar (work, ch); \ + len = non_ascii_set_itext_ichar (work, ch); \ Dynarr_add_many (destination, work, len); \ } \ } \ @@ -742,9 +742,9 @@ } \ else \ { \ - Ibyte work[MAX_ICHAR_LEN]; \ + Ibyte work[MAX_ICHAR_LEN]; \ int len; \ - len = non_ascii_set_itext_ichar (work, ch); \ + len = non_ascii_set_itext_ichar (work, ch); \ Dynarr_add_many (destination, work, len); \ } \ } \ @@ -755,8 +755,8 @@ cannot handle a multibyte string except for Control-1 characters. */ #define CCL_WRITE_STRING(len) \ do { \ - Ibyte work[MAX_ICHAR_LEN]; \ - int ch, bytes; \ + Ibyte work[MAX_ICHAR_LEN]; \ + int ch; \ if (!destination) \ CCL_INVALID_CMD; \ else if (conversion_mode == CCL_MODE_ENCODING) \ @@ -783,7 +783,7 @@ } \ else \ { \ - bytes = non_ascii_set_itext_ichar (work, ch); \ + non_ascii_set_itext_ichar (work, ch); \ Dynarr_add_many (destination, work, len); \ } \ } \ @@ -800,7 +800,7 @@ } \ else \ { \ - bytes = non_ascii_set_itext_ichar (work, ch); \ + non_ascii_set_itext_ichar (work, ch); \ Dynarr_add_many (destination, work, len); \ } \ } \ diff --text -u 'xemacs-21.5.17/src/mule-charset.c' 'xemacs-21.5.18/src/mule-charset.c' Index: ./src/mule-charset.c --- ./src/mule-charset.c Wed Oct 15 02:27:54 2003 +++ ./src/mule-charset.c Tue Sep 21 04:19:52 2004 @@ -134,7 +134,8 @@ } static void -print_charset (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_charset (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Charset *cs = XCHARSET (obj); @@ -382,7 +383,7 @@ }; static int -add_charset_to_list_mapper (Lisp_Object key, Lisp_Object value, +add_charset_to_list_mapper (Lisp_Object UNUSED (key), Lisp_Object value, void *charset_list_closure) { /* This function can GC */ @@ -1014,8 +1015,8 @@ } static int -init_charset_unicode_tables_mapper (Lisp_Object key, Lisp_Object value, - void *closure) +init_charset_unicode_tables_mapper (Lisp_Object UNUSED (key), + Lisp_Object value, void *UNUSED (closure)) { init_charset_unicode_tables (value); return 0; diff --text -u 'xemacs-21.5.17/src/mule-coding.c' 'xemacs-21.5.18/src/mule-coding.c' Index: ./src/mule-coding.c --- ./src/mule-coding.c Wed Oct 1 00:26:52 2003 +++ ./src/mule-coding.c Tue Sep 21 04:19:52 2004 @@ -2585,7 +2585,13 @@ } static void -iso2022_finalize_coding_stream (struct coding_stream *str) +iso2022_finalize_coding_stream ( +#ifdef ENABLE_COMPOSITE_CHARS + struct coding_stream *str +#else + struct coding_stream *UNUSED (str) +#endif + ) { #ifdef ENABLE_COMPOSITE_CHARS struct iso2022_coding_stream *data = @@ -2662,7 +2668,8 @@ } static void -iso2022_print (Lisp_Object cs, Lisp_Object printcharfun, int escapeflag) +iso2022_print (Lisp_Object cs, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { int i; diff --text -u 'xemacs-21.5.17/src/nas.c' 'xemacs-21.5.18/src/nas.c' Index: ./src/nas.c --- ./src/nas.c Wed Oct 15 01:34:57 2003 +++ ./src/nas.c Tue Sep 21 04:19:52 2004 @@ -10,9 +10,9 @@ * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name Network Computing Devices, Inc. not be - * used in advertising or publicity pertaining to distribution of this + * used in advertising or publicity pertaining to distribution of this * software without specific, written prior permission. - * + * * THIS SOFTWARE IS PROVIDED 'AS-IS'. NETWORK COMPUTING DEVICES, INC., * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A @@ -31,10 +31,10 @@ /* There are four compile-time options. * * XTOOLKIT This will be part of an Xt program. - * + * * XTEVENTS The playing will be supervised asynchronously by the Xt event * loop. If not set, playing will be completed within the call - * to play_file etc. + * to play_file etc. * * ROBUST_PLAY Causes errors in nas to be caught. This means that the * program will attempt not to die if the nas server does. @@ -80,11 +80,14 @@ #undef LITTLE_ENDIAN #undef BIG_ENDIAN +BEGIN_C_DECLS #include <audio/audiolib.h> #include <audio/soundlib.h> #include <audio/snd.h> #include <audio/wave.h> #include <audio/fileutil.h> +END_C_DECLS + /* NAS <= 1.2p5 <audio/fileutil.h> doesn't define the NAS_ versions */ #ifndef NAS_LITTLE_ENDIAN @@ -218,7 +221,7 @@ #endif #ifdef XTEVENTS - input_id = AuXtAppAddAudioHandler (app_context, aud); + input_id = AuXtAppAddAudioHandler (app_context, aud); #endif #ifdef CACHE_SOUNDS @@ -249,9 +252,9 @@ \********************************************************************/ static void -doneCB (AuServer *auserver, - AuEventHandlerRec *handler, - AuEvent *ev, +doneCB (AuServer *UNUSED (auserver), + AuEventHandlerRec *UNUSED (handler), + AuEvent *UNUSED (ev), AuPointer data) { int *in_play_p = (int *) data; @@ -303,10 +306,10 @@ else my_buf = (AuPointer) buf; - id = AuSoundCreateBucketFromData (aud, + id = AuSoundCreateBucketFromData (aud, s, my_buf, - AuAccessAllMasks, + AuAccessAllMasks, NULL, NULL); if (buf == NULL) @@ -320,10 +323,10 @@ sounds_in_play++; - AuSoundPlayFromBucket (aud, - id, + AuSoundPlayFromBucket (aud, + id, AuNone, - AuFixedPointFromFraction (volume, 100), + AuFixedPointFromFraction (volume, 100), doneCB, (AuPointer) &sounds_in_play, 1, NULL, NULL, @@ -334,7 +337,7 @@ void nas_wait_for_sounds (void); -void +void nas_wait_for_sounds (void) { @@ -371,7 +374,7 @@ /* attempt to reconect */ if ((m = nas_init_play (aud_server)) != NULL) { - + #ifdef ROBUST_PLAY EMACS_SIGNAL (SIGPIPE, old_sigpipe); #endif @@ -538,7 +541,7 @@ nas_wait_for_sounds (); #endif - SoundCloseFile (s); + SoundCloseFile (s); #ifdef ROBUST_PLAY EMACS_SIGNAL (SIGPIPE, old_sigpipe); @@ -561,13 +564,13 @@ CatchIoErrorAndJump (AuServer *old_aud) { if (old_aud) - sound_warn ("Audio Server connection broken"); + sound_warn ("Audio Server connection broken"); else sound_warn ("Audio Server connection broken because of signal"); #ifdef XTEVENTS #ifdef XTOOLKIT - AuXtAppRemoveAudioHandler (aud, input_id); + AuXtAppRemoveAudioHandler (aud, input_id); #endif if (aud) @@ -584,20 +587,20 @@ aud = NULL; sounds_in_play = 0; longjmp (AuXtErrorJump, 1); - + #endif /* XTEVENTS */ return 0; } SIGTYPE -sigpipe_handle (int signo) +sigpipe_handle (int UNUSED (signo)) { CatchIoErrorAndJump (NULL); } static AuBool CatchErrorAndJump (AuServer *old_aud, - AuErrorEvent *event) + AuErrorEvent *UNUSED (event)) { return CatchIoErrorAndJump (old_aud); } @@ -649,7 +652,7 @@ { strcpy (s = (Extbyte *) malloc (10), name); } - else + else { strcpy (s = (Extbyte *) malloc (15), "short sound"); } @@ -658,7 +661,7 @@ } /* Code to do a pseudo-open on a data buffer. Only for snd files at the - moment. + moment. */ static SndInfo * @@ -680,7 +683,7 @@ if (NAS_LITTLE_ENDIAN) { Char_Binary n; - + swapl (&si->h.magic, n); swapl (&si->h.dataOffset, n); swapl (&si->h.dataSize, n); @@ -754,7 +757,7 @@ dread (void* buf, size_t size, size_t nitems) { size_t nread = size * nitems; - + if (file_posn + nread <= file_len) { memcpy(buf, (Char_Binary *) file_data + file_posn, size * nitems); @@ -847,7 +850,7 @@ AuInt32 fileSize; WaveInfo *wi; - + if (!(wi = (WaveInfo *) malloc(sizeof(WaveInfo)))) return NULL; @@ -855,7 +858,7 @@ wi->dataOffset = wi->format = wi->writing = 0; dopen(data, length); - + if (!readChunk(&ck) || cmpID(&ck.ckID, RIFF_RiffID) || !readFourcc(&fourcc) || @@ -967,7 +970,7 @@ length - wi->dataOffset); wi->fp = NULL; - + return wi; } @@ -988,7 +991,7 @@ if ((s->formatInfo = SndOpenDataForReading ((Char_Binary *) data, length)) != NULL) { #if (AudioLibraryVersionMajor >= 2 ) && (AudioLibraryVersionMinor >= 3) - if ((toProc = SoundFileGetProc(SoundFileFormatSnd, + if ((toProc = SoundFileGetProc(SoundFileFormatSnd, SoundFileInfoProcTo)) == NULL) { SndCloseFile ((SndInfo *) (s->formatInfo)); @@ -1009,7 +1012,7 @@ else if ((s->formatInfo = WaveOpenDataForReading ((Char_Binary *) data, length)) != NULL) { #if (AudioLibraryVersionMajor >= 2 ) && (AudioLibraryVersionMinor >= 3) - if ((toProc = SoundFileGetProc(SoundFileFormatWave, + if ((toProc = SoundFileGetProc(SoundFileFormatWave, SoundFileInfoProcTo)) == NULL) { WaveCloseFile ((WaveInfo *) (s->formatInfo)); diff --text -u 'xemacs-21.5.17/src/native-gtk-toolbar.c' 'xemacs-21.5.18/src/native-gtk-toolbar.c' Index: ./src/native-gtk-toolbar.c --- ./src/native-gtk-toolbar.c Fri Mar 29 13:48:13 2002 +++ ./src/native-gtk-toolbar.c Tue Sep 21 04:19:52 2004 @@ -57,7 +57,7 @@ gtk_clear_toolbar (struct frame *f, enum toolbar_pos pos); static void -gtk_toolbar_callback (GtkWidget *w, gpointer user_data) +gtk_toolbar_callback (GtkWidget *UNUSED (w), gpointer user_data) { struct toolbar_button *tb = (struct toolbar_button *) user_data; @@ -226,7 +226,7 @@ } static void -gtk_initialize_frame_toolbars (struct frame *f) +gtk_initialize_frame_toolbars (struct frame *UNUSED (f)) { stderr_out ("We should draw toolbars\n"); } diff --text -u 'xemacs-21.5.17/src/nt.c' 'xemacs-21.5.18/src/nt.c' Index: ./src/nt.c --- ./src/nt.c Wed Oct 1 00:26:53 2003 +++ ./src/nt.c Tue Sep 21 04:19:53 2004 @@ -856,7 +856,7 @@ } struct direct * -mswindows_readdir (DIR *dirp) +mswindows_readdir (DIR *UNUSED (dirp)) { Ibyte *val; int need_to_free = 0; @@ -947,7 +947,7 @@ } static Ibyte * -read_unc_volume (HANDLE henum) +read_unc_volume (HANDLE UNUSED (henum)) { DWORD count; int result; diff --text -u 'xemacs-21.5.17/src/ntplay.c' 'xemacs-21.5.18/src/ntplay.c' Index: ./src/ntplay.c --- ./src/ntplay.c Wed Oct 1 00:26:53 2003 +++ ./src/ntplay.c Tue Sep 21 04:19:53 2004 @@ -35,7 +35,7 @@ int volume, int convert); void -play_sound_file (Extbyte *sound_file, int volume) +play_sound_file (Extbyte *sound_file, int UNUSED (volume)) { DWORD flags = SND_ASYNC | SND_NODEFAULT | SND_FILENAME; Lisp_Object fname = @@ -82,7 +82,7 @@ /* mswindows can't cope with playing a sound from alloca space so we have to convert if necessary */ static int -play_sound_data_1 (UChar_Binary *data, int length, int volume, +play_sound_data_1 (UChar_Binary *data, int length, int UNUSED (volume), int convert_to_malloc) { DWORD flags = SND_ASYNC | SND_MEMORY | SND_NODEFAULT; diff --text -u /dev/null 'xemacs-21.5.18/src/number-gmp.c' Index: ./src/number-gmp.c --- ./src/number-gmp.c Thu Jan 1 09:00:00 1970 +++ ./src/number-gmp.c Tue Sep 21 04:19:53 2004 @@ -0,0 +1,105 @@ +/* Numeric types for XEmacs using the GNU MP library. + Copyright (C) 2004 Jerry James. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#include <config.h> +#include <limits.h> +#include <math.h> +#include "lisp.h" +#include "sysproc.h" /* For qxe_getpid */ + +static mpf_t float_print_min, float_print_max; +gmp_randstate_t random_state; + +CIbyte * +bigfloat_to_string(mpf_t f, int base) +{ + mp_exp_t expt; + CIbyte *str = mpf_get_str (NULL, &expt, base, 0, f); + const int sign = mpf_sgn (f); + const int neg = (sign < 0) ? 1 : 0; + int len = strlen (str) + 1; /* Count the null terminator */ + + if (sign == 0 || (mpf_cmp (float_print_min, f) <= 0 && + mpf_cmp (f, float_print_max) <= 0)) + { + /* Move digits down to insert a radix point */ + if (expt <= 0) + { + /* We need room for a radix point and leading zeroes */ + const int space = -expt + 2; + XREALLOC_ARRAY (str, CIbyte, len + space); + memmove (&str[space + neg], &str[neg], len - neg); + memset (&str[neg], '0', space); + str[neg + 1] = '.'; + len += space; + } + else + { + /* We just need room for a radix point */ + XREALLOC_ARRAY (str, CIbyte, len + 1); + memmove (&str[expt + neg + 1], &str[expt + neg], len - (expt + neg)); + str[expt + neg] = '.'; + len++; + } + } + else + { + /* Computerized scientific notation */ + /* We need room for a radix point, format identifier, and exponent */ + const int space = (expt < 0) + ? (int)(log (-expt) / log (base)) + 3 + : (int)(log (expt) / log (base)) + 2; + XREALLOC_ARRAY (str, CIbyte, len + space); + memmove (&str[neg + 2], &str[neg + 1], len - neg); + str[len + 1] = 'l'; + sprintf (&str[len + 2], "%ld", expt); + } + return str; +} + +/* We need the next two functions since GNU MP insists on giving us an extra + parameter. */ +static void *gmp_realloc (void *ptr, size_t UNUSED (old_size), size_t new_size) +{ + return xrealloc (ptr, new_size); +} + +static void gmp_free (void *ptr, size_t UNUSED (size)) +{ + xfree (ptr, void *); +} + +void +init_number_gmp () +{ + mp_set_memory_functions ((void *(*) (size_t))xmalloc, gmp_realloc, gmp_free); + + /* The smallest number that is printed without exponents */ + mpf_init_set_d (float_print_min, 0.001); + + /* The largest number that is printed without exponents */ + mpf_init_set_ui (float_print_max, 10000000UL); + + /* Prepare the bignum/bigfloat random number generator */ + gmp_randinit_default (random_state); + gmp_randseed_ui (random_state, qxe_getpid () + time (NULL)); +} diff --text -u /dev/null 'xemacs-21.5.18/src/number-gmp.h' Index: ./src/number-gmp.h --- ./src/number-gmp.h Thu Jan 1 09:00:00 1970 +++ ./src/number-gmp.h Tue Sep 21 04:19:53 2004 @@ -0,0 +1,233 @@ +/* Definitions of numeric types for XEmacs using the GNU MP library. + Copyright (C) 2004 Jerry James. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* This library defines the following types: + bignum = mpz_t + ratio = mpq_t + bigfloat = mpf_t +*/ + +#ifndef INCLUDED_number_gmp_h_ +#define INCLUDED_number_gmp_h_ + +#ifdef UNO +/* Uno complains about several inline functions that include conditions with + assignments and side effects if we don't do this */ +#undef __GNUC__ +#endif + +#include <gmp.h> + +typedef mpz_t bignum; +typedef mpq_t ratio; +typedef mpf_t bigfloat; + +extern void init_number_gmp(void); + + +/********************************* Bignums **********************************/ + +#define HAVE_BIGNUM 1 + +extern gmp_randstate_t random_state; + +/***** Bignum: basic functions *****/ +#define bignum_init(b) mpz_init (b) +#define bignum_fini(b) mpz_clear (b) +#define bignum_hashcode(b) mpz_get_ui (b) +#define bignum_sign(b) mpz_sgn (b) +#define bignum_evenp(b) mpz_even_p (b) +#define bignum_oddp(b) mpz_odd_p (b) + +/***** Bignum: size *****/ +#define bignum_fits_int_p(b) mpz_fits_sint_p (b) +#define bignum_fits_uint_p(b) mpz_fits_uint_p (b) +#define bignum_fits_long_p(b) mpz_fits_slong_p (b) +#define bignum_fits_ulong_p(b) mpz_fits_ulong_p (b) + +/***** Bignum: conversions *****/ +#define bignum_to_string(b,base) mpz_get_str (NULL, base, b) +#define bignum_to_int(b) ((int) mpz_get_si (b)) +#define bignum_to_uint(b) ((unsigned int) mpz_get_ui (b)) +#define bignum_to_long(b) mpz_get_si (b) +#define bignum_to_ulong(b) mpz_get_ui (b) +#define bignum_to_double(b) mpz_get_d (b) + +/***** Bignum: converting assignments *****/ +#define bignum_set(b1,b2) mpz_set (b1, b2) +#define bignum_set_string(b,s,base) mpz_set_str (b, s, base) +#define bignum_set_long(b,l) mpz_set_si (b, l) +#define bignum_set_ulong(b,l) mpz_set_ui (b, l) +#define bignum_set_double(b,f) mpz_set_d (b, f) +#define bignum_set_ratio(b,r) mpz_set_q (b, r) +#define bignum_set_bigfloat(b,f) mpz_set_f (b, f) + +/***** Bignum: comparisons *****/ +#define bignum_cmp(b1,b2) mpz_cmp (b1, b2) +#define bignum_lt(b1,b2) (mpz_cmp (b1, b2) < 0) +#define bignum_le(b1,b2) (mpz_cmp (b1, b2) <= 0) +#define bignum_eql(b1,b2) (mpz_cmp (b1, b2) == 0) +#define bignum_ge(b1,b2) (mpz_cmp (b1, b2) >= 0) +#define bignum_gt(b1,b2) (mpz_cmp (b1, b2) > 0) + +/***** Bignum: arithmetic *****/ +#define bignum_neg(b,b2) mpz_neg (b, b2) +#define bignum_abs(b,b2) mpz_abs (b, b2) +#define bignum_add(b,b1,b2) mpz_add (b, b1, b2) +#define bignum_sub(b,b1,b2) mpz_sub (b, b1, b2) +#define bignum_mul(b,b1,b2) mpz_mul (b, b1, b2) +#define bignum_divisible_p(b1,b2) mpz_divisible_p (b1, b2) +#define bignum_div(b,b1,b2) mpz_tdiv_q (b, b1, b2) +#define bignum_ceil(b,b1,b2) mpz_cdiv_q (b, b1, b2) +#define bignum_floor(b,b1,b2) mpz_fdiv_q (b, b1, b2) +#define bignum_mod(b,b1,b2) mpz_mod (b, b1, b2) +#define bignum_pow(res,b,pow) mpz_pow_ui (res, b, pow) +#define bignum_gcd(res,b1,b2) mpz_gcd (res, b1, b2) +#define bignum_lcm(res,b1,b2) mpz_lcm (res, b1, b2) + +/***** Bignum: bit manipulations *****/ +#define bignum_and(res,b1,b2) mpz_and (res, b1, b2) +#define bignum_ior(res,b1,b2) mpz_ior (res, b1, b2) +#define bignum_xor(res,b1,b2) mpz_xor (res, b1, b2) +#define bignum_not(res,b) mpz_com (res, b) +#define bignum_setbit(b,bit) mpz_setbit (b, bit) +#define bignum_clrbit(b,bit) mpz_clrbit (b, bit) +#define bignum_testbit(b,bit) mpz_tstbit (b, bit) +#define bignum_lshift(res,b,bits) mpz_mul_2exp (res, b, bits) +#define bignum_rshift(res,b,bits) mpz_fdiv_q_2exp (res, b, bits) + +/***** Bignum: random numbers *****/ +#define bignum_random_seed(seed) gmp_randseed_ui (random_state, seed) +#define bignum_random(res,limit) mpz_urandomm (res, random_state, limit) + + +/********************************** Ratios **********************************/ + +#define HAVE_RATIO 1 + +/***** Ratio: basic functions *****/ +#define ratio_init(r) mpq_init (r) +#define ratio_fini(r) mpq_clear (r) +#define ratio_hashcode(r) \ + (mpz_get_ui (mpq_denref (r)) * mpz_get_ui (mpq_numref (r))) +#define ratio_sign(r) mpq_sgn (r) +#define ratio_numerator(r) mpq_numref (r) +#define ratio_denominator(r) mpq_denref (r) +#define ratio_canonicalize(r) mpq_canonicalize (r) + +/***** Ratio: conversions *****/ +#define ratio_to_string(r,base) mpq_get_str (NULL, base, r) +#define ratio_to_int(r) ((int) (mpq_get_d (r))) +#define ratio_to_uint(r) ((unsigned int) (mpq_get_d (r))) +#define ratio_to_long(r) ((long) (mpq_get_d (r))) +#define ratio_to_ulong(r) ((unsigned long) (mpq_get_d (r))) +#define ratio_to_double(r) mpq_get_d (r) + +/***** Ratio: converting assignments *****/ +#define ratio_set(r1,r2) mpq_set (r1, r2) +#define ratio_set_string(r,s,base) mpq_set_str (r, s, base) +#define ratio_set_long(r,l) mpq_set_si (r, l, 1UL) +#define ratio_set_ulong(r,l) mpq_set_ui (r, l, 1UL) +#define ratio_set_double(r,f) mpq_set_d (r, f) +#define ratio_set_bignum(r,b) mpq_set_z (r, b) +#define ratio_set_bigfloat(r,f) mpq_set_f (r, f) +#define ratio_set_long_ulong(r,num,den) mpq_set_si (r, num, den) +#define ratio_set_ulong_ulong(r,num,den) mpq_set_ui (r, num, den) +#define ratio_set_bignum_bignum(r,num,den) do { \ + mpz_set (mpq_numref (r), num); \ + mpz_set (mpq_denref (r), den); \ + mpq_canonicalize (r); \ + } while (0) + +/***** Ratio: comparisons *****/ +#define ratio_cmp(r1,r2) mpq_cmp (r1, r2) +#define ratio_lt(r1,r2) (mpq_cmp (r1, r2) < 0) +#define ratio_le(r1,r2) (mpq_cmp (r1, r2) <= 0) +#define ratio_eql(r1,r2) mpq_equal (r1, r2) +#define ratio_ge(r1,r2) (mpq_cmp (r1, r2) >= 0) +#define ratio_gt(r1,r2) (mpq_cmp (r1, r2) > 0) + +/***** Ratio: arithmetic *****/ +#define ratio_neg(q,q2) mpq_neg (q, q2) +#define ratio_abs(q,q2) mpq_abs (q, q2) +#define ratio_inv(q,q2) mpq_inv (q, q2) +#define ratio_add(res,q1,q2) mpq_add (res, q1, q2) +#define ratio_sub(res,q1,q2) mpq_sub (res, q1, q2) +#define ratio_mul(res,q1,q2) mpq_mul (res, q1, q2) +#define ratio_div(res,q1,q2) mpq_div (res, q1, q2) + + +/******************************** Bigfloats *********************************/ + +#define HAVE_BIGFLOAT 1 + +/***** Bigfloat: basic functions *****/ +#define bigfloat_init(f) mpf_init (f) +#define bigfloat_init_prec(f,prec) mpf_init2 (f, prec) +#define bigfloat_fini(f) mpf_clear (f) +#define bigfloat_hashcode(f) mpf_get_ui (f) +#define bigfloat_sign(f) mpf_sgn (f) +#define bigfloat_get_prec(f) mpf_get_prec (f) +#define bigfloat_set_prec(f, prec) mpf_set_prec (f, prec) +#define bigfloat_set_default_prec(prec) mpf_set_default_prec(prec) +#define bigfloat_get_default_prec() mpf_get_default_prec () + +/***** Bigfloat: conversions *****/ +extern CIbyte *bigfloat_to_string (bigfloat f, int base); +#define bigfloat_to_int(f) ((int) mpf_get_si (f)) +#define bigfloat_to_uint(f) ((unsigned int) mpf_get_ui (f)) +#define bigfloat_to_long(f) mpf_get_si (f) +#define bigfloat_to_ulong(f) mpf_get_ui (f) +#define bigfloat_to_double(f) mpf_get_d (f) + +/***** Bigfloat: converting assignments *****/ +#define bigfloat_set(f1,f2) mpf_set (f1, f2) +#define bigfloat_set_string(f,str,base) mpf_set_str (f, str, base) +#define bigfloat_set_long(f,l) mpf_set_si (f, l) +#define bigfloat_set_ulong(f,l) mpf_set_ui (f, l) +#define bigfloat_set_double(d,f) mpf_set_d (d, f) +#define bigfloat_set_bignum(f,b) mpf_set_z (f, b) +#define bigfloat_set_ratio(f,r) mpf_set_q (f, r) + +/***** Bigfloat: comparisons *****/ +#define bigfloat_cmp(f1,f2) mpf_cmp (f1, f2) +#define bigfloat_lt(f1,f2) (mpf_cmp (f1, f2) < 0) +#define bigfloat_le(f1,f2) (mpf_cmp (f1, f2) <= 0) +#define bigfloat_eql(f1,f2) (mpf_cmp (f1, f2) == 0) +#define bigfloat_eql_bits(f1,f2,bits) mpf_eq (f1, f2, bits) +#define bigfloat_ge(f1,f2) (mpf_cmp (f1, f2) >= 0) +#define bigfloat_gt(f1,f2) (mpf_cmp (f1, f2) > 0) + +/***** Bigfloat: arithmetic *****/ +#define bigfloat_neg(f,f2) mpf_neg (f, f2) +#define bigfloat_abs(f,f2) mpf_abs (f, f2) +#define bigfloat_add(res,f1,f2) mpf_add (res, f1, f2) +#define bigfloat_sub(res,f1,f2) mpf_sub (res, f1, f2) +#define bigfloat_mul(res,f1,f2) mpf_mul (res, f1, f2) +#define bigfloat_div(res,f1,f2) mpf_div (res, f1, f2) +#define bigfloat_ceil(res,f) mpf_ceil (res, f) +#define bigfloat_floor(res,f) mpf_floor (res, f) +#define bigfloat_trunc(res,f) mpf_trunc (res, f) +#define bigfloat_sqrt(res,f) mpf_sqrt (res, f) +#define bigfloat_pow(res,f,exp) mpf_pow_ui (res, f, exp) + +#endif /* INCLUDED_number_gmp_h_ */ diff --text -u /dev/null 'xemacs-21.5.18/src/number-mp.c' Index: ./src/number-mp.c --- ./src/number-mp.c Thu Jan 1 09:00:00 1970 +++ ./src/number-mp.c Wed Apr 7 11:41:30 2004 @@ -0,0 +1,520 @@ +/* Numeric types for XEmacs using the MP library. + Copyright (C) 2004 Jerry James. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#include <config.h> +#include <limits.h> +#include <math.h> +#include "lisp.h" + +static MINT *bignum_bytesize, *bignum_long_sign_bit, *bignum_one, *bignum_two; +MINT *bignum_zero, *intern_bignum; +MINT *bignum_min_int, *bignum_max_int, *bignum_max_uint; +MINT *bignum_min_long, *bignum_max_long, *bignum_max_ulong; +short div_rem; + +char * +bignum_to_string (bignum b, int base) +{ + REGISTER unsigned int i; + unsigned int bufsize = 128U, index = 0U; + int sign; + char *buffer = xnew_array (char, 128), *retval; + MINT *quo = MP_ITOM (0); + short rem; + + /* FIXME: signal something if base is < 2 or doesn't fit into a short. */ + + /* Save the sign for later */ + sign = MP_MCMP (b, bignum_zero); + + if (sign == 0) + { + XREALLOC_ARRAY (buffer, char, 2); + buffer[0] = '0'; + buffer[1] = '\0'; + return buffer; + } + /* Copy abs(b) into quo for destructive modification */ + else if (sign < 0) + MP_MSUB (bignum_zero, b, quo); + else + MP_MOVE (b, quo); + + quo = MP_ITOM (0); + + /* Loop over the digits of b (in BASE) and place each one into buffer */ + for (i = 0U; MP_MCMP(quo, bignum_zero) > 0; i++) + { + MP_SDIV (quo, base, quo, &rem); + if (index == bufsize) + { + bufsize <<= 1; + XREALLOC_ARRAY (buffer, char, bufsize); + } + buffer[index++] = rem < 10 ? rem + '0' : rem - 10 + 'a'; + } + MP_MFREE (quo); + + /* Reverse the digits, maybe add a minus sign, and add a null terminator */ + bufsize = index + (sign < 0 ? 1 : 0) + 1; + retval = xnew_array (char, bufsize); + if (sign < 0) + { + retval[0] = '-'; + i = 1; + } + else + i = 0; + for (; i < bufsize - 1; i++) + retval[i] = buffer[--index]; + retval[bufsize - 1] = '\0'; + xfree (buffer, char *); + return retval; +} + +#define BIGNUM_TO_TYPE(type,accumtype) do { \ + MP_MULT (b, quo, quo); \ + for (i = 0U; i < sizeof(type); i++) \ + { \ + MP_SDIV (quo, 256, quo, &rem); \ + retval |= ((accumtype) rem) << (8 * i); \ + } \ + MP_MFREE (quo); \ +} while (0) + +int +bignum_to_int (bignum b) +{ + short rem, sign; + unsigned int retval = 0; + REGISTER unsigned int i; + MINT *quo; + + sign = MP_MCMP (b, bignum_zero) < 0 ? -1 : 1; + quo = MP_ITOM (sign); + BIGNUM_TO_TYPE (int, unsigned int); + return ((int) retval) * sign; +} + +unsigned int +bignum_to_uint (bignum b) +{ + short rem; + unsigned int retval = 0U; + REGISTER unsigned int i; + MINT *quo; + + quo = MP_ITOM (MP_MCMP (b, bignum_zero) < 0 ? -1 : 1); + BIGNUM_TO_TYPE (unsigned int, unsigned int); + return retval; +} + +long +bignum_to_long (bignum b) +{ + short rem, sign; + unsigned long retval = 0L; + REGISTER unsigned int i; + MINT *quo; + + sign = MP_MCMP (b, bignum_zero) < 0 ? -1 : 1; + quo = MP_ITOM (sign); + BIGNUM_TO_TYPE (long, unsigned long); + return ((long) retval) * sign; +} + +unsigned long +bignum_to_ulong (bignum b) +{ + short rem; + unsigned long retval = 0UL; + REGISTER unsigned int i; + MINT *quo; + + quo = MP_ITOM (MP_MCMP (b, bignum_zero) < 0 ? -1 : 1); + BIGNUM_TO_TYPE (unsigned long, unsigned long); + return retval; +} + +double +bignum_to_double (bignum b) +{ + short rem, sign; + double retval = 0.0, factor = 1.0; + REGISTER unsigned int i; + MINT *quo; + + sign = MP_MCMP (b, bignum_zero) < 0 ? -1 : 1; + quo = MP_ITOM (sign); + MP_MULT (b, quo, quo); + for (i = 0U; MP_MCMP (quo, bignum_zero) > 0; i++) + { + MP_SDIV (quo, 256, quo, &rem); + retval += rem * factor; + factor *= 256.0; + } + MP_MFREE (quo); + return retval * sign; +} + +static short +char_to_number (char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + if (c >= 'a' && c <= 'z') + return c - 'a' + 10; + if (c >= 'A' && c <= 'Z') + return c - 'A' + 10; + return -1; +} + +int +bignum_set_string (bignum b, const char *s, int base) +{ + MINT *mbase; + short digit; + int neg = 0; + + if (base == 0) + { + if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) + { + base = 16; + s += 2; + } + else if (*s == '0') + { + base = 8; + s++; + } + else + base = 10; + } + + /* FIXME: signal something if base is < 2 or doesn't fit into a short. */ + + if (*s == '-') + { + s++; + neg = 1; + } + + mbase = MP_ITOM ((short) base); + MP_MOVE (bignum_zero, b); + + for (digit = char_to_number (*s); digit >= 0 && digit < base; + digit = char_to_number (*++s)) + { + MINT *temp; + + MP_MULT (b, mbase, b); + temp = MP_ITOM (digit); + MP_MADD (b, temp, b); + MP_MFREE (temp); + } + + if (neg) + MP_MSUB (bignum_zero, b, b); + + return (digit >= 0) ? -1 : 0; +} + +void +bignum_set_long (MINT *b, long l) +{ + /* Negative l is hard, not least because -LONG_MIN == LONG_MIN. We pretend + that l is unsigned, then subtract off the amount equal to the sign bit. */ + bignum_set_ulong (b, (unsigned long) l); + if (l < 0L) + MP_MSUB (b, bignum_long_sign_bit, b); +} + +void +bignum_set_ulong (bignum b, unsigned long l) +{ + REGISTER unsigned int i; + MINT *multiplier = MP_ITOM (1); + + MP_MOVE (bignum_zero, b); + for (i = 0UL; l > 0UL; l >>= 8, i++) + { + MINT *temp = MP_ITOM ((short) (l & 255)); + MP_MULT (multiplier, temp, temp); + MP_MADD (b, temp, b); + MP_MULT (multiplier, bignum_bytesize, multiplier); + MP_MFREE (temp); + } + MP_MFREE (multiplier); +} + +void +bignum_set_double (bignum b, double d) +{ + REGISTER unsigned int i; + int negative = (d < 0) ? 1 : 0; + MINT *multiplier = MP_ITOM (1); + + MP_MOVE (bignum_zero, b); + if (negative) + d = -d; + for (i = 0UL; d > 0.0; d /= 256, i++) + { + MINT *temp = MP_ITOM ((short) fmod (d, 256.0)); + MP_MULT (multiplier, temp, temp); + MP_MADD (b, temp, b); + MP_MULT (multiplier, bignum_bytesize, multiplier); + MP_MFREE (temp); + } + MP_MFREE (multiplier); + if (negative) + MP_MSUB (bignum_zero, b, b); +} + +/* Return nonzero if b1 is exactly divisible by b2 */ +int +bignum_divisible_p (bignum b1, bignum b2) +{ + int retval; + MINT *rem = MP_ITOM (0); + MP_MDIV (b1, b2, intern_bignum, rem); + retval = (MP_MCMP (rem, bignum_zero) == 0); + MP_MFREE (rem); + return retval; +} + +void bignum_ceil (bignum quotient, bignum N, bignum D) +{ + MP_MDIV (N, D, quotient, intern_bignum); + if (MP_MCMP (intern_bignum, bignum_zero) > 0 && + MP_MCMP (quotient, bignum_zero) > 0) + MP_MADD (quotient, bignum_one, quotient); +} + +void bignum_floor (bignum quotient, bignum N, bignum D) +{ + MP_MDIV (N, D, quotient, intern_bignum); + if (MP_MCMP (intern_bignum, bignum_zero) > 0 && + MP_MCMP (quotient, bignum_zero) < 0) + MP_MSUB (quotient, bignum_one, quotient); +} + +/* RESULT = N to the POWth power */ +void +bignum_pow (bignum result, bignum n, unsigned long pow) +{ + MP_MOVE (bignum_one, result); + for ( ; pow > 0UL; pow--) + MP_MULT (result, n, result); +} + +/* lcm(b1,b2) = b1 * b2 / gcd(b1, b2) */ +void +bignum_lcm (bignum result, bignum b1, bignum b2) +{ + MP_MULT (b1, b2, result); + MP_GCD (b1, b2, intern_bignum); + MP_MDIV (result, intern_bignum, result, intern_bignum); +} + +/* FIXME: We can't handle negative args, so right now we just make them + positive before doing anything else. How should we really handle negative + args? */ +#define bignum_bit_op(result, b1, b2, op) \ + REGISTER unsigned int i; \ + MINT *multiplier = MP_ITOM (1), *n1 = MP_ITOM (0), *n2 = MP_ITOM (0); \ + \ + if (MP_MCMP (bignum_zero, b1) > 0) \ + MP_MSUB (bignum_zero, b1, n1); \ + else \ + MP_MOVE (b1, n1); \ + if (MP_MCMP (bignum_zero, b2) > 0) \ + MP_MSUB (bignum_zero, b2, n2); \ + else \ + MP_MOVE (b2, n2); \ + \ + MP_MOVE (bignum_zero, result); \ + \ + for (i = 0UL; MP_MCMP (bignum_zero, n1) < 0 && \ + MP_MCMP (bignum_zero, n2) < 0; i++) \ + { \ + short byte1, byte2; \ + MINT *temp; \ + \ + MP_SDIV (n1, 256, n1, &byte1); \ + MP_SDIV (n2, 256, n2, &byte2); \ + temp = MP_ITOM (byte1 op byte2); \ + MP_MULT (multiplier, temp, temp); \ + MP_MADD (result, temp, result); \ + MP_MULT (multiplier, bignum_bytesize, multiplier); \ + MP_MFREE (temp); \ + } \ + MP_MFREE (n2); \ + MP_MFREE (n1); \ + MP_MFREE (multiplier) + +void +bignum_and (bignum result, bignum b1, bignum b2) +{ + bignum_bit_op (result, b1, b2, &); +} + +void +bignum_ior (bignum result, bignum b1, bignum b2) +{ + bignum_bit_op (result, b1, b2, |); +} + +void +bignum_xor (bignum result, bignum b1, bignum b2) +{ + bignum_bit_op (result, b1, b2, ^); +} + +/* NOT is not well-defined for bignums ... where do you stop flipping bits? + We just flip until we see the last one. This is probably a bad idea. */ +void +bignum_not (bignum result, bignum b) +{ + REGISTER unsigned int i; + MINT *multiplier = MP_ITOM (1), *n = MP_ITOM (0); + + if (MP_MCMP (bignum_zero, b) > 0) + MP_MSUB (bignum_zero, b, n); + else + MP_MOVE (b, n); + + MP_MOVE (bignum_zero, result); + + for (i = 0UL; MP_MCMP (bignum_zero, n) < 0; i++) + { + short byte; + MINT *temp; + + MP_SDIV (n, 256, n, &byte); + temp = MP_ITOM (~byte); + MP_MULT (multiplier, temp, temp); + MP_MADD (result, temp, result); + MP_MULT (multiplier, bignum_bytesize, multiplier); + MP_MFREE (temp); + } + MP_MFREE (n); + MP_MFREE (multiplier); +} + +void +bignum_setbit (bignum b, unsigned long bit) +{ + bignum_pow (intern_bignum, bignum_two, bit); + bignum_ior (b, b, intern_bignum); +} + +/* This is so evil, even I feel queasy. */ +void +bignum_clrbit (bignum b, unsigned long bit) +{ + MINT *num = MP_ITOM (0); + + /* See if the bit is already set, and subtract it off if not */ + MP_MOVE (b, intern_bignum); + bignum_pow (num, bignum_two, bit); + bignum_ior (intern_bignum, intern_bignum, num); + if (MP_MCMP (b, intern_bignum) == 0) + MP_MSUB (b, num, b); + MP_MFREE (num); +} + +int +bignum_testbit (bignum b, unsigned long bit) +{ + bignum_pow (intern_bignum, bignum_two, bit); + bignum_and (intern_bignum, b, intern_bignum); + return MP_MCMP (intern_bignum, bignum_zero); +} + +void +bignum_lshift (bignum result, bignum b, unsigned long bits) +{ + bignum_pow (intern_bignum, bignum_two, bits); + MP_MULT (b, intern_bignum, result); +} + +void +bignum_rshift (bignum result, bignum b, unsigned long bits) +{ + bignum_pow (intern_bignum, bignum_two, bits); + MP_MDIV (b, intern_bignum, result, intern_bignum); +} + +void bignum_random_seed(unsigned long seed) +{ + /* FIXME: Implement me */ +} + +void bignum_random(bignum result, bignum limit) +{ + /* FIXME: Implement me */ + MP_MOVE (bignum_zero, result); +} + +void +init_number_mp () +{ + REGISTER unsigned int i; + + bignum_zero = MP_ITOM (0); + bignum_one = MP_ITOM (1); + bignum_two = MP_ITOM (2); + + /* intern_bignum holds throwaway values from macro expansions in + number-mp.h. Its value is immaterial. */ + intern_bignum = MP_ITOM (0); + + /* bignum_bytesize holds the number of bits in a byte. */ + bignum_bytesize = MP_ITOM (256); + + /* bignum_long_sign_bit holds an adjustment for negative longs. */ + bignum_long_sign_bit = MP_ITOM (256); + for (i = 1UL; i < sizeof (long); i++) + MP_MULT (bignum_bytesize, bignum_long_sign_bit, bignum_long_sign_bit); + + /* The MP interface only supports turning short ints into MINTs, so we have + to set these the hard way. */ + + bignum_min_int = MP_ITOM (0); + bignum_set_long (bignum_min_int, INT_MIN); + + bignum_max_int = MP_ITOM (0); + bignum_set_long (bignum_max_int, INT_MAX); + + bignum_max_uint = MP_ITOM (0); + bignum_set_ulong (bignum_max_uint, UINT_MAX); + + bignum_min_long = MP_ITOM (0); + bignum_set_long (bignum_min_long, LONG_MIN); + + bignum_max_long = MP_ITOM (0); + bignum_set_long (bignum_max_long, LONG_MAX); + + bignum_max_ulong = MP_ITOM (0); + bignum_set_ulong (bignum_max_ulong, ULONG_MAX); +} diff --text -u /dev/null 'xemacs-21.5.18/src/number-mp.h' Index: ./src/number-mp.h --- ./src/number-mp.h Thu Jan 1 09:00:00 1970 +++ ./src/number-mp.h Tue Apr 6 07:49:56 2004 @@ -0,0 +1,161 @@ +/* Definitions of numeric types for XEmacs using the MP library. + Copyright (C) 2004 Jerry James. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* This library defines the following types: + bignum = MINT + + The MP library does not include support for ratios or bigfloats. +*/ + +#ifndef INCLUDED_number_mp_h_ +#define INCLUDED_number_mp_h_ + +/* BSD MP libraries without MP_PREFIX define a function named pow in mp.h that + has a different prototype from the one in math.h. We don't use that + function anyway, so we do this for safety purposes. However, this means + that number-mp.h must always be included before math.h. */ +#define pow mp_pow +#include <mp.h> +#undef pow + +#ifdef MP_PREFIX +#define MP_GCD mp_gcd +#define MP_ITOM mp_itom +#define MP_MADD mp_madd +#define MP_MCMP mp_mcmp +#define MP_MDIV mp_mdiv +#define MP_MFREE mp_mfree +#define MP_MSUB mp_msub +#define MP_MULT mp_mult +#define MP_SDIV mp_sdiv +#ifdef HAVE_MP_MOVE +#define MP_MOVE(x,y) mp_move (x, y) +#else +#define MP_MOVE(x,y) mp_madd (x, bignum_zero, y) +#endif +#else +#define MP_GCD gcd +#define MP_ITOM itom +#define MP_MADD madd +#define MP_MCMP mcmp +#define MP_MDIV mdiv +#define MP_MFREE mfree +#define MP_MSUB msub +#define MP_MULT mult +#define MP_SDIV sdiv +#ifdef HAVE_MP_MOVE +#define MP_MOVE(x,y) move (x, y) +#else +#define MP_MOVE(x,y) madd (x, bignum_zero, y) +#endif +#endif + +typedef MINT *bignum; + +extern void init_number_mp(void); + + +/********************************* Bignums **********************************/ + +#define HAVE_BIGNUM 1 + +extern MINT *bignum_zero, *intern_bignum; +extern MINT *bignum_min_int, *bignum_max_int, *bignum_max_uint; +extern MINT *bignum_min_long, *bignum_max_long, *bignum_max_ulong; +extern short div_rem; + +/***** Bignum: basic functions *****/ +#define bignum_init(b) (b = MP_ITOM (0)) +#define bignum_fini(b) MP_MFREE (b) +#define bignum_hashcode(b) bignum_to_uint (b) +#define bignum_sign(b) MP_MCMP (b, bignum_zero) +#define bignum_evenp(b) (MP_SDIV (b, 2, intern_bignum, &div_rem), \ + div_rem == 0) +#define bignum_oddp(b) (MP_SDIV (b, 2, intern_bignum, &div_rem), \ + div_rem != 0) + +/***** Bignum: size *****/ +#define bignum_fits_int_p(b) (MP_MCMP (b, bignum_min_int) >= 0 && \ + MP_MCMP (b, bignum_max_int) <= 0) +#define bignum_fits_uint_p(b) (MP_MCMP (b, bignum_zero) >= 0 && \ + MP_MCMP (b, bignum_max_uint) <= 0) +#define bignum_fits_long_p(b) (MP_MCMP (b, bignum_min_long) >= 0 && \ + MP_MCMP (b, bignum_max_long) <= 0) +#define bignum_fits_ulong_p(b) (MP_MCMP (b, bignum_zero) >= 0 && \ + MP_MCMP (b, bignum_max_ulong) <= 0) + +/***** Bignum: conversions *****/ +extern char *bignum_to_string(bignum, int); +extern int bignum_to_int(bignum); +extern unsigned int bignum_to_uint(bignum); +extern long bignum_to_long(bignum); +extern unsigned long bignum_to_ulong(bignum); +extern double bignum_to_double(bignum); + +/***** Bignum: converting assignments *****/ +#define bignum_set(b1, b2) MP_MOVE (b2, b1) +extern int bignum_set_string(bignum, const char *, int); +extern void bignum_set_long(bignum, long); +extern void bignum_set_ulong(bignum, unsigned long); +extern void bignum_set_double(bignum, double); + +/***** Bignum: comparisons *****/ +#define bignum_cmp(b1,b2) MP_MCMP (b1, b2) +#define bignum_lt(b1,b2) (MP_MCMP (b1, b2) < 0) +#define bignum_le(b1,b2) (MP_MCMP (b1, b2) <= 0) +#define bignum_eql(b1,b2) (MP_MCMP (b1, b2) == 0) +#define bignum_ge(b1,b2) (MP_MCMP (b1, b2) >= 0) +#define bignum_gt(b1,b2) (MP_MCMP (b1, b2) > 0) + +/***** Bignum: arithmetic *****/ +#define bignum_neg(b,b2) MP_MSUB (bignum_zero, b2, b) +#define bignum_abs(b,b2) (MP_MCMP (b2, bignum_zero) < 0 \ + ? MP_MSUB (bignum_zero, b2, b) \ + : MP_MADD (bignum_zero, b2, b)) +#define bignum_add(b,b1,b2) MP_MADD (b1, b2, b) +#define bignum_sub(b,b1,b2) MP_MSUB (b1, b2, b) +#define bignum_mul(b,b1,b2) MP_MULT (b1, b2, b) +extern int bignum_divisible_p(bignum, bignum); +#define bignum_div(b,b1,b2) MP_MDIV (b1, b2, b, intern_bignum) +extern void bignum_ceil(bignum, bignum, bignum); +extern void bignum_floor(bignum, bignum, bignum); +#define bignum_mod(b,b1,b2) MP_MDIV (b1, b2, intern_bignum, b) +extern void bignum_pow(bignum, bignum, unsigned long); +#define bignum_gcd(res,b1,b2) MP_GCD (b1, b2, res) +extern void bignum_lcm(bignum, bignum, bignum); + +/***** Bignum: bit manipulations *****/ +extern void bignum_and(bignum, bignum, bignum); +extern void bignum_ior(bignum, bignum, bignum); +extern void bignum_xor(bignum, bignum, bignum); +extern void bignum_not(bignum, bignum); +extern void bignum_setbit(bignum, unsigned long); +extern void bignum_clrbit(bignum, unsigned long); +extern int bignum_testbit(bignum, unsigned long); +extern void bignum_lshift(bignum, bignum, unsigned long); +extern void bignum_rshift(bignum, bignum, unsigned long); + +/***** Bignum: random numbers *****/ +extern void bignum_random_seed(unsigned long); +extern void bignum_random(bignum, bignum); + +#endif /* INCLUDED_number_mp_h_ */ diff --text -u /dev/null 'xemacs-21.5.18/src/number.c' Index: ./src/number.c --- ./src/number.c Thu Jan 1 09:00:00 1970 +++ ./src/number.c Tue Sep 21 04:19:54 2004 @@ -0,0 +1,837 @@ +/* Numeric types for XEmacs. + Copyright (C) 2004 Jerry James. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#include <config.h> +#include <limits.h> +#include "lisp.h" + +Lisp_Object Qrationalp, Qfloatingp, Qrealp; +Lisp_Object Vdefault_float_precision; +Fixnum Vmost_negative_fixnum, Vmost_positive_fixnum; +static Lisp_Object Qunsupported_type; +static Lisp_Object Vbigfloat_max_prec; +static int number_initialized; + +#ifdef HAVE_BIGNUM +bignum scratch_bignum, scratch_bignum2; +#endif +#ifdef HAVE_RATIO +ratio scratch_ratio; +#endif +#ifdef HAVE_BIGFLOAT +bigfloat scratch_bigfloat, scratch_bigfloat2; +#endif + +/********************************* Bignums **********************************/ +#ifdef HAVE_BIGNUM +static void +bignum_print (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) +{ + CIbyte *bstr = bignum_to_string (XBIGNUM_DATA (obj), 10); + write_c_string (printcharfun, bstr); + xfree (bstr, CIbyte *); +} + +static int +bignum_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) +{ + return bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2)); +} + +static Hashcode +bignum_hash (Lisp_Object obj, int UNUSED (depth)) +{ + return bignum_hashcode (XBIGNUM_DATA (obj)); +} + +static const struct memory_description bignum_description[] = { + { XD_OPAQUE_PTR, offsetof (Lisp_Bignum, data) }, + { XD_END } +}; + +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("bignum", bignum, 0, 0, bignum_print, + 0, bignum_equal, bignum_hash, + bignum_description, Lisp_Bignum); + +#endif /* HAVE_BIGNUM */ + +Lisp_Object Qbignump; + +DEFUN ("bignump", Fbignump, 1, 1, 0, /* +Return t if OBJECT is a bignum, nil otherwise. +*/ + (object)) +{ + return BIGNUMP (object) ? Qt : Qnil; +} + + +/********************************* Integers *********************************/ +DEFUN ("integerp", Fintegerp, 1, 1, 0, /* +Return t if OBJECT is an integer, nil otherwise. +*/ + (object)) +{ + return INTEGERP (object) ? Qt : Qnil; +} + +DEFUN ("evenp", Fevenp, 1, 1, 0, /* +Return t if INTEGER is even, nil otherwise. +*/ + (integer)) +{ + CONCHECK_INTEGER (integer); + return (BIGNUMP (integer) + ? bignum_evenp (XBIGNUM_DATA (integer)) + : XTYPE (integer) == Lisp_Type_Int_Even) ? Qt : Qnil; +} + +DEFUN ("oddp", Foddp, 1, 1, 0, /* +Return t if INTEGER is odd, nil otherwise. +*/ + (integer)) +{ + CONCHECK_INTEGER (integer); + return (BIGNUMP (integer) + ? bignum_oddp (XBIGNUM_DATA (integer)) + : XTYPE (integer) == Lisp_Type_Int_Odd) ? Qt : Qnil; +} + + +/********************************** Ratios **********************************/ +#ifdef HAVE_RATIO +static void +ratio_print (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) +{ + CIbyte *rstr = ratio_to_string (XRATIO_DATA (obj), 10); + write_c_string (printcharfun, rstr); + xfree (rstr, CIbyte *); +} + +static int +ratio_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) +{ + return ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2)); +} + +static Hashcode +ratio_hash (Lisp_Object obj, int UNUSED (depth)) +{ + return ratio_hashcode (XRATIO_DATA (obj)); +} + +static const struct memory_description ratio_description[] = { + { XD_OPAQUE_PTR, offsetof (Lisp_Ratio, data) }, + { XD_END } +}; + +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("ratio", ratio, 0, 0, ratio_print, + 0, ratio_equal, ratio_hash, + ratio_description, Lisp_Ratio); + +#endif /* HAVE_RATIO */ + +Lisp_Object Qratiop; + +DEFUN ("ratiop", Fratiop, 1, 1, 0, /* +Return t if OBJECT is a ratio, nil otherwise. +*/ + (object)) +{ + return RATIOP (object) ? Qt : Qnil; +} + + +/******************************** Rationals *********************************/ +DEFUN ("rationalp", Frationalp, 1, 1, 0, /* +Return t if OBJECT is a rational, nil otherwise. +*/ + (object)) +{ + return RATIONALP (object) ? Qt : Qnil; +} + +DEFUN ("numerator", Fnumerator, 1, 1, 0, /* +Return the numerator of the canonical form of RATIONAL. +If RATIONAL is an integer, RATIONAL is returned. +*/ + (rational)) +{ + CONCHECK_RATIONAL (rational); +#ifdef HAVE_RATIO + return RATIOP (rational) + ? make_bignum_bg (XRATIO_NUMERATOR (rational)) + : rational; +#else + return rational; +#endif +} + +DEFUN ("denominator", Fdenominator, 1, 1, 0, /* +Return the denominator of the canonical form of RATIONAL. +If RATIONAL is an integer, 1 is returned. +*/ + (rational)) +{ + CONCHECK_RATIONAL (rational); +#ifdef HAVE_RATIO + return RATIOP (rational) + ? make_bignum_bg (XRATIO_DENOMINATOR (rational)) + : make_int (1); +#else + return rational; +#endif +} + + +/******************************** Bigfloats *********************************/ +#ifdef HAVE_BIGFLOAT +static void +bigfloat_print (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) +{ + CIbyte *fstr = bigfloat_to_string (XBIGFLOAT_DATA (obj), 10); + write_c_string (printcharfun, fstr); + xfree (fstr, CIbyte *); +} + +static int +bigfloat_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) +{ + return bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2)); +} + +static Hashcode +bigfloat_hash (Lisp_Object obj, int UNUSED (depth)) +{ + return bigfloat_hashcode (XBIGFLOAT_DATA (obj)); +} + +static const struct memory_description bigfloat_description[] = { + { XD_OPAQUE_PTR, offsetof (Lisp_Bigfloat, bf) }, + { XD_END } +}; + +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("bigfloat", bigfloat, 1, 0, + bigfloat_print, 0, + bigfloat_equal, bigfloat_hash, + bigfloat_description, Lisp_Bigfloat); + +#endif /* HAVE_BIGFLOAT */ + +Lisp_Object Qbigfloatp; + +DEFUN ("bigfloatp", Fbigfloatp, 1, 1, 0, /* +Return t if OBJECT is a bigfloat, nil otherwise. +*/ + (object)) +{ + return BIGFLOATP (object) ? Qt : Qnil; +} + +DEFUN ("bigfloat-get-precision", Fbigfloat_get_precision, 1, 1, 0, /* +Return the precision of bigfloat F as an integer. +*/ + (f)) +{ + CHECK_BIGFLOAT (f); +#ifdef HAVE_BIGNUM + bignum_set_ulong (scratch_bignum, XBIGFLOAT_GET_PREC (f)); + return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); +#else + return make_int ((int) XBIGFLOAT_GET_PREC (f)); +#endif +} + +DEFUN ("bigfloat-set-precision", Fbigfloat_set_precision, 2, 2, 0, /* +Set the precision of F, a bigfloat, to PRECISION, a nonnegative integer. +The new precision of F is returned. Note that the return value may differ +from PRECISION if the underlying library is unable to support exactly +PRECISION bits of precision. +*/ + (f, precision)) +{ + unsigned long prec; + + CHECK_BIGFLOAT (f); + if (INTP (precision)) + { + prec = (XINT (precision) <= 0) ? 1UL : (unsigned long) XINT (precision); + } +#ifdef HAVE_BIGNUM + else if (BIGNUMP (precision)) + { + prec = bignum_fits_ulong_p (XBIGNUM_DATA (precision)) + ? bignum_to_ulong (XBIGNUM_DATA (precision)) + : UINT_MAX; + } +#endif + else + { + dead_wrong_type_argument (Qintegerp, f); + return Qnil; + } + + XBIGFLOAT_SET_PREC (f, prec); + return Fbigfloat_get_precision (f); +} + +static int +default_float_precision_changed (Lisp_Object UNUSED (sym), Lisp_Object *val, + Lisp_Object UNUSED (in_object), + int UNUSED (flags)) +{ + unsigned long prec; + + CONCHECK_INTEGER (*val); +#ifdef HAVE_BIGFLOAT + if (INTP (*val)) + prec = XINT (*val); + else + { + if (!bignum_fits_ulong_p (XBIGNUM_DATA (*val))) + args_out_of_range_3 (*val, Qzero, Vbigfloat_max_prec); + prec = bignum_to_ulong (XBIGNUM_DATA (*val)); + } + if (prec != 0UL) + bigfloat_set_default_prec (prec); +#endif + return 0; +} + + +/********************************* Floating *********************************/ +Lisp_Object +make_floating (double d) +{ +#ifdef HAVE_BIGFLOAT + if (ZEROP (Vdefault_float_precision)) +#endif + return make_float (d); +#ifdef HAVE_BIGFLOAT + else + return make_bigfloat (d, 0UL); +#endif +} + +DEFUN ("floatingp", Ffloatingp, 1, 1, 0, /* +Return t if OBJECT is a floating point number of any kind, nil otherwise. +*/ + (object)) +{ + return FLOATINGP (object) ? Qt : Qnil; +} + + +/********************************** Reals ***********************************/ +DEFUN ("realp", Frealp, 1, 1, 0, /* +Return t if OBJECT is a real, nil otherwise. +*/ + (object)) +{ + return REALP (object) ? Qt : Qnil; +} + + +/********************************* Numbers **********************************/ +DEFUN ("canonicalize-number", Fcanonicalize_number, 1, 1, 0, /* +Return the canonical form of NUMBER. +*/ + (number)) +{ + /* The tests should go in order from larger, more expressive, or more + complex types to smaller, less expressive, or simpler types so that a + number can cascade all the way down to the simplest type if + appropriate. */ +#ifdef HAVE_RATIO + if (RATIOP (number) && + bignum_fits_long_p (XRATIO_DENOMINATOR (number)) && + bignum_to_long (XRATIO_DENOMINATOR (number)) == 1L) + number = make_bignum_bg (XRATIO_NUMERATOR (number)); +#endif +#ifdef HAVE_BIGNUM + if (BIGNUMP (number) && bignum_fits_int_p (XBIGNUM_DATA (number))) + { + int n = bignum_to_int (XBIGNUM_DATA (number)); + if (NUMBER_FITS_IN_AN_EMACS_INT (n)) + number = make_int (n); + } +#endif + return number; +} + +enum number_type +get_number_type (Lisp_Object arg) +{ + if (INTP (arg)) + return FIXNUM_T; +#ifdef HAVE_BIGNUM + if (BIGNUMP (arg)) + return BIGNUM_T; +#endif +#ifdef HAVE_RATIO + if (RATIOP (arg)) + return RATIO_T; +#endif + if (FLOATP (arg)) + return FLOAT_T; +#ifdef HAVE_BIGFLOAT + if (BIGFLOATP (arg)) + return BIGFLOAT_T; +#endif + /* Catch unintentional bad uses of this function */ + abort (); + /* NOTREACHED */ + return FIXNUM_T; +} + +/* Convert NUMBER to type TYPE. If TYPE is BIGFLOAT_T then use the indicated + PRECISION; otherwise, PRECISION is ignored. */ +static Lisp_Object +internal_coerce_number (Lisp_Object number, enum number_type type, +#ifdef HAVE_BIGFLOAT + unsigned long precision +#else + unsigned long UNUSED (precision) +#endif + ) +{ + enum number_type current_type; + + if (CHARP (number)) + number = make_int (XCHAR (number)); + else if (MARKERP (number)) + number = make_int (marker_position (number)); + + /* Note that CHECK_NUMBER ensures that NUMBER is a supported type. Hence, + we abort() in the #else sections below, because it shouldn't be possible + to arrive there. */ + CHECK_NUMBER (number); + current_type = get_number_type (number); + switch (current_type) + { + case FIXNUM_T: + switch (type) + { + case FIXNUM_T: + return number; + case BIGNUM_T: +#ifdef HAVE_BIGNUM + return make_bignum (XREALINT (number)); +#else + abort (); +#endif /* HAVE_BIGNUM */ + case RATIO_T: +#ifdef HAVE_RATIO + return make_ratio (XREALINT (number), 1UL); +#else + abort (); +#endif /* HAVE_RATIO */ + case FLOAT_T: + return make_float (XREALINT (number)); + case BIGFLOAT_T: +#ifdef HAVE_BIGFLOAT + return make_bigfloat (XREALINT (number), precision); +#else + abort (); +#endif /* HAVE_BIGFLOAT */ + } + case BIGNUM_T: +#ifdef HAVE_BIGNUM + switch (type) + { + case FIXNUM_T: + return make_int (bignum_to_long (XBIGNUM_DATA (number))); + case BIGNUM_T: + return number; + case RATIO_T: +#ifdef HAVE_RATIO + bignum_set_long (scratch_bignum, 1L); + return make_ratio_bg (XBIGNUM_DATA (number), scratch_bignum); +#else + abort (); +#endif /* HAVE_RATIO */ + case FLOAT_T: + return make_float (bignum_to_double (XBIGNUM_DATA (number))); + case BIGFLOAT_T: +#ifdef HAVE_BIGFLOAT + { + Lisp_Object temp; + temp = make_bigfloat (0.0, precision); + bigfloat_set_bignum (XBIGFLOAT_DATA (temp), XBIGNUM_DATA (number)); + return temp; + } +#else + abort (); +#endif /* HAVE_BIGFLOAT */ + } +#else + abort (); +#endif /* HAVE_BIGNUM */ + case RATIO_T: +#ifdef HAVE_RATIO + switch (type) + { + case FIXNUM_T: + bignum_div (scratch_bignum, XRATIO_NUMERATOR (number), + XRATIO_DENOMINATOR (number)); + return make_int (bignum_to_long (scratch_bignum)); + case BIGNUM_T: + bignum_div (scratch_bignum, XRATIO_NUMERATOR (number), + XRATIO_DENOMINATOR (number)); + return make_bignum_bg (scratch_bignum); + case RATIO_T: + return number; + case FLOAT_T: + return make_float (ratio_to_double (XRATIO_DATA (number))); + case BIGFLOAT_T: +#ifdef HAVE_BIGFLOAT + { + Lisp_Object temp; + temp = make_bigfloat (0.0, precision); + bigfloat_set_ratio (XBIGFLOAT_DATA (temp), XRATIO_DATA (number)); + return temp; + } +#else + abort (); +#endif /* HAVE_BIGFLOAT */ + } +#else + abort (); +#endif /* HAVE_RATIO */ + case FLOAT_T: + switch (type) + { + case FIXNUM_T: + return Ftruncate (number); + case BIGNUM_T: +#ifdef HAVE_BIGNUM + bignum_set_double (scratch_bignum, XFLOAT_DATA (number)); + return make_bignum_bg (scratch_bignum); +#else + abort (); +#endif /* HAVE_BIGNUM */ + case RATIO_T: +#ifdef HAVE_RATIO + ratio_set_double (scratch_ratio, XFLOAT_DATA (number)); + return make_ratio_rt (scratch_ratio); +#else + abort (); +#endif /* HAVE_RATIO */ + case FLOAT_T: + return number; + case BIGFLOAT_T: +#ifdef HAVE_BIGFLOAT + bigfloat_set_prec (scratch_bigfloat, precision); + bigfloat_set_double (scratch_bigfloat, XFLOAT_DATA (number)); + return make_bigfloat_bf (scratch_bigfloat); +#else + abort (); +#endif /* HAVE_BIGFLOAT */ + } + case BIGFLOAT_T: +#ifdef HAVE_BIGFLOAT + switch (type) + { + case FIXNUM_T: + return make_int (bigfloat_to_long (XBIGFLOAT_DATA (number))); + case BIGNUM_T: +#ifdef HAVE_BIGNUM + bignum_set_bigfloat (scratch_bignum, XBIGFLOAT_DATA (number)); + return make_bignum_bg (scratch_bignum); +#else + abort (); +#endif /* HAVE_BIGNUM */ + case RATIO_T: +#ifdef HAVE_RATIO + ratio_set_bigfloat (scratch_ratio, XBIGFLOAT_DATA (number)); + return make_ratio_rt (scratch_ratio); +#else + abort (); +#endif + case FLOAT_T: + return make_float (bigfloat_to_double (XBIGFLOAT_DATA (number))); + case BIGFLOAT_T: + /* FIXME: Do we need to change the precision? */ + return number; + } +#else + abort (); +#endif /* HAVE_BIGFLOAT */ + } + abort (); + /* NOTREACHED */ + return Qzero; +} + +/* This function promotes its arguments as necessary to make them both the + same type. It destructively modifies its arguments to do so. Characters + and markers are ALWAYS converted to integers. */ +enum number_type +promote_args (Lisp_Object *arg1, Lisp_Object *arg2) +{ + enum number_type type1, type2; + + if (CHARP (*arg1)) + *arg1 = make_int (XCHAR (*arg1)); + else if (MARKERP (*arg1)) + *arg1 = make_int (marker_position (*arg1)); + if (CHARP (*arg2)) + *arg2 = make_int (XCHAR (*arg2)); + else if (MARKERP (*arg2)) + *arg2 = make_int (marker_position (*arg2)); + + CHECK_NUMBER (*arg1); + CHECK_NUMBER (*arg2); + + type1 = get_number_type (*arg1); + type2 = get_number_type (*arg2); + + if (type1 < type2) + { + *arg1 = internal_coerce_number (*arg1, type2, +#ifdef HAVE_BIGFLOAT + type2 == BIGFLOAT_T + ? XBIGFLOAT_GET_PREC (*arg2) : +#endif + 0UL); + return type2; + } + + if (type2 < type1) + { + *arg2 = internal_coerce_number (*arg2, type1, +#ifdef HAVE_BIGFLOAT + type1 == BIGFLOAT_T + ? XBIGFLOAT_GET_PREC (*arg1) : +#endif + 0UL); + return type1; + } + + /* No conversion necessary */ + return type1; +} + +DEFUN ("coerce-number", Fcoerce_number, 2, 3, 0, /* +Convert NUMBER to the indicated type, possibly losing information. +Do not call this function. Use `coerce' instead. + +TYPE is one of the symbols 'fixnum, 'integer, 'ratio, 'float, or 'bigfloat. +Not all of these types may be supported. + +PRECISION is the number of bits of precision to use when converting to +bigfloat; it is ignored otherwise. If nil, the default precision is used. + +Note that some conversions lose information. No error is signaled in such +cases; the information is silently lost. +*/ + (number, type, +#ifdef HAVE_BIGFLOAT + precision +#else + UNUSED (precision) +#endif + )) +{ + CHECK_SYMBOL (type); + if (EQ (type, Qfixnum)) + return internal_coerce_number (number, FIXNUM_T, 0UL); + else if (EQ (type, Qinteger)) + { + /* If bignums are available, we always convert to one first, then + downgrade to a fixnum if possible. */ +#ifdef HAVE_BIGNUM + return Fcanonicalize_number + (internal_coerce_number (number, BIGNUM_T, 0UL)); +#else + return internal_coerce_number (number, FIXNUM_T, 0UL); +#endif + } +#ifdef HAVE_RATIO + else if (EQ (type, Qratio)) + return internal_coerce_number (number, RATIO_T, 0UL); +#endif + else if (EQ (type, Qfloat)) + return internal_coerce_number (number, FLOAT_T, 0UL); +#ifdef HAVE_BIGFLOAT + else if (EQ (type, Qbigfloat)) + { + unsigned long prec; + + if (NILP (precision)) + prec = bigfloat_get_default_prec (); + else + { + CHECK_INTEGER (precision); +#ifdef HAVE_BIGNUM + if (INTP (precision)) +#endif /* HAVE_BIGNUM */ + prec = (unsigned long) XREALINT (precision); +#ifdef HAVE_BIGNUM + else + { + if (!bignum_fits_ulong_p (XBIGNUM_DATA (precision))) + args_out_of_range (precision, Vbigfloat_max_prec); + prec = bignum_to_ulong (XBIGNUM_DATA (precision)); + } +#endif /* HAVE_BIGNUM */ + } + return internal_coerce_number (number, BIGFLOAT_T, prec); + } +#endif /* HAVE_BIGFLOAT */ + + Fsignal (Qunsupported_type, type); + /* NOTREACHED */ + return Qnil; +} + + +void +syms_of_number (void) +{ +#ifdef HAVE_BIGNUM + INIT_LRECORD_IMPLEMENTATION (bignum); +#endif +#ifdef HAVE_RATIO + INIT_LRECORD_IMPLEMENTATION (ratio); +#endif +#ifdef HAVE_BIGFLOAT + INIT_LRECORD_IMPLEMENTATION (bigfloat); +#endif + + /* Type predicates */ + DEFSYMBOL (Qrationalp); + DEFSYMBOL (Qfloatingp); + DEFSYMBOL (Qrealp); + DEFSYMBOL (Qbignump); + DEFSYMBOL (Qratiop); + DEFSYMBOL (Qbigfloatp); + + /* Functions */ + DEFSUBR (Fbignump); + DEFSUBR (Fintegerp); + DEFSUBR (Fevenp); + DEFSUBR (Foddp); + DEFSUBR (Fratiop); + DEFSUBR (Frationalp); + DEFSUBR (Fnumerator); + DEFSUBR (Fdenominator); + DEFSUBR (Fbigfloatp); + DEFSUBR (Fbigfloat_get_precision); + DEFSUBR (Fbigfloat_set_precision); + DEFSUBR (Ffloatingp); + DEFSUBR (Frealp); + DEFSUBR (Fcanonicalize_number); + DEFSUBR (Fcoerce_number); + + /* Errors */ + DEFERROR_STANDARD (Qunsupported_type, Qwrong_type_argument); +} + +void +vars_of_number (void) +{ + /* These variables are Lisp variables rather than number variables so that + we can put bignums in them. */ + DEFVAR_LISP_MAGIC ("default-float-precision", &Vdefault_float_precision, /* +The default floating-point precision for newly created floating point values. +This should be 0 to create Lisp float types, or an unsigned integer no greater +than `bigfloat-maximum-precision' to create Lisp bigfloat types with the +indicated precision. +*/ default_float_precision_changed); + Vdefault_float_precision = make_int (0); + + DEFVAR_CONST_LISP ("bigfloat-maximum-precision", &Vbigfloat_max_prec /* +The maximum number of bits of precision a bigfloat can have. +This is determined by the underlying library used to implement bigfloats. +*/); + +#ifdef HAVE_BIGFLOAT +#ifdef HAVE_BIGNUM + /* Uncomment the next two lines and remove the line below them when dumping + bignums becomes possible. */ + /* + Vbigfloat_max_prec = make_bignum (0L); + bignum_set_ulong (XBIGNUM_DATA (Vbigfloat_max_prec), ULONG_MAX); + */ + Vbigfloat_max_prec = make_int (EMACS_INT_MAX); +#else + Vbigfloat_max_prec = make_int (EMACS_INT_MAX); +#endif +#else + Vbigfloat_max_prec = make_int (0); +#endif /* HAVE_BIGFLOAT */ + + DEFVAR_CONST_INT ("most-negative-fixnum", &Vmost_negative_fixnum /* +The fixnum closest in value to negative infinity. +*/); + Vmost_negative_fixnum = EMACS_INT_MIN; + + DEFVAR_CONST_INT ("most-positive-fixnum", &Vmost_positive_fixnum /* +The fixnum closest in value to positive infinity. +*/); + Vmost_positive_fixnum = EMACS_INT_MAX; + + Fprovide (intern ("number-types")); +#ifdef HAVE_BIGNUM + Fprovide (intern ("bignum")); +#endif +#ifdef HAVE_RATIO + Fprovide (intern ("ratio")); +#endif +#ifdef HAVE_BIGFLOAT + Fprovide (intern ("bigfloat")); +#endif +} + +void +init_number (void) +{ + if (!number_initialized) + { + number_initialized = 1; + +#ifdef WITH_GMP + init_number_gmp (); +#endif +#ifdef WITH_MP + init_number_mp (); +#endif + +#ifdef HAVE_BIGNUM + bignum_init (scratch_bignum); + bignum_init (scratch_bignum2); +#endif + +#ifdef HAVE_RATIO + ratio_init (scratch_ratio); +#endif + +#ifdef HAVE_BIGFLOAT + bigfloat_init (scratch_bigfloat); + bigfloat_init (scratch_bigfloat2); +#endif + } +} diff --text -u /dev/null 'xemacs-21.5.18/src/number.h' Index: ./src/number.h --- ./src/number.h Thu Jan 1 09:00:00 1970 +++ ./src/number.h Sat May 22 05:56:32 2004 @@ -0,0 +1,331 @@ +/* Definitions of numeric types for XEmacs. + Copyright (C) 2004 Jerry James. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef INCLUDED_number_h_ +#define INCLUDED_number_h_ + +/* The following types are always defined in the same manner: + fixnum = whatever fits in the Lisp_Object type + integer = union (fixnum, bignum) + rational = union (integer, ratio) + float = C double + floating = union(float, bigfloat) Anybody got a better name? + real = union (rational, floating) + number = real (should be union(real, complex) but no complex yet) + + It is up to the library-specific code to define the remaining types, + namely: bignum, ratio, and bigfloat. Not all of these types may be + available. The top-level configure script should define the symbols + HAVE_BIGNUM, HAVE_RATIO, and HAVE_BIGFLOAT to indicate which it provides. + If some type is not defined by the library, this is what happens: + + - bignum: bignump(x) is false for all x; any attempt to create a bignum + causes an error to be raised. + + - ratio: we define our own structure consisting of two Lisp_Objects, which + are presumed to be integers (i.e., either fixnums or bignums). We do our + own GCD calculation, which is bound to be slow, to keep the ratios + reduced to canonical form. (FIXME: Not yet implemented.) + + - bigfloat: bigfloat(x) is false for all x; any attempt to create a + bigfloat causes an error to be raised. + + We (provide) the following symbols, so that Lisp code has some hope of + using this correctly: + + - (provide 'bignum) if HAVE_BIGNUM + - (provde 'ratio) if HAVE_RATIO + - (provide 'bigfloat) if HAVE_BIGFLOAT +*/ + +/* Load the library definitions */ +#ifdef WITH_GMP +#include "number-gmp.h" +#endif +#ifdef WITH_MP +#include "number-mp.h" +#endif + + +/********************************* Bignums **********************************/ +#ifdef HAVE_BIGNUM + +struct Lisp_Bignum +{ + struct lrecord_header lheader; + bignum data; +}; +typedef struct Lisp_Bignum Lisp_Bignum; + +DECLARE_LRECORD (bignum, Lisp_Bignum); +#define XBIGNUM(x) XRECORD (x, bignum, Lisp_Bignum) +#define wrap_bignum(p) wrap_record (p, bignum) +#define BIGNUMP(x) RECORDP (x, bignum) +#define CHECK_BIGNUM(x) CHECK_RECORD (x, bignum) +#define CONCHECK_BIGNUM(x) CONCHECK_RECORD (x, bignum) + +#define bignum_data(b) (b)->data +#define XBIGNUM_DATA(x) bignum_data (XBIGNUM (x)) + +#define BIGNUM_ARITH_RETURN(b,op) do \ +{ \ + Lisp_Object retval = make_bignum (0); \ + bignum_##op (XBIGNUM_DATA (retval), XBIGNUM_DATA (b)); \ + return Fcanonicalize_number (retval); \ +} while (0) + +#define BIGNUM_ARITH_RETURN1(b,op,arg) do \ +{ \ + Lisp_Object retval = make_bignum(0); \ + bignum_##op (XBIGNUM_DATA (retval), XBIGNUM_DATA (b), arg); \ + return Fcanonicalize_number (retval); \ +} while (0) + +extern Lisp_Object make_bignum (long); +extern Lisp_Object make_bignum_bg (bignum); +extern bignum scratch_bignum, scratch_bignum2; + +#else /* !HAVE_BIGNUM */ + +#define BIGNUMP(x) 0 +#define CHECK_BIGNUM(x) dead_wrong_type_argument (Qbignump, x) +#define CONCHECK_BIGNUM(x) dead_wrong_type_argument (Qbignump, x) +typedef void bignum; +#define make_bignum(l) This XEmacs does not support bignums +#define make_bignum_bg(b) This XEmacs does not support bignums + +#endif /* HAVE_BIGNUM */ + +extern Lisp_Object Qbignump; +EXFUN (Fbignump, 1); + + +/********************************* Integers *********************************/ +extern Lisp_Object Qintegerp; + +#define INTEGERP(x) (INTP(x) || BIGNUMP(x)) +#define CHECK_INTEGER(x) do { \ + if (!INTEGERP (x)) \ + dead_wrong_type_argument (Qintegerp, x); \ + } while (0) +#define CONCHECK_INTEGER(x) do { \ + if (!INTEGERP (x)) \ + x = wrong_type_argument (Qintegerp, x); \ +} while (0) + +#ifdef HAVE_BIGNUM +#define make_integer(x) \ + (NUMBER_FITS_IN_AN_EMACS_INT (x) ? make_int (x) : make_bignum (x)) +#else +#define make_integer(x) make_int (x) +#endif + +extern Fixnum Vmost_negative_fixnum, Vmost_positive_fixnum; +EXFUN (Fintegerp, 1); +EXFUN (Fevenp, 1); +EXFUN (Foddp, 1); + + +/********************************** Ratios **********************************/ +#ifdef HAVE_RATIO + +struct Lisp_Ratio +{ + struct lrecord_header lheader; + ratio data; +}; +typedef struct Lisp_Ratio Lisp_Ratio; + +DECLARE_LRECORD (ratio, Lisp_Ratio); +#define XRATIO(x) XRECORD (x, ratio, Lisp_Ratio) +#define wrap_ratio(p) wrap_record (p, ratio) +#define RATIOP(x) RECORDP (x, ratio) +#define CHECK_RATIO(x) CHECK_RECORD (x, ratio) +#define CONCHECK_RATIO(x) CONCHECK_RECORD (x, ratio) + +#define ratio_data(r) (r)->data + +#define XRATIO_DATA(r) ratio_data (XRATIO (r)) +#define XRATIO_NUMERATOR(r) ratio_numerator (XRATIO_DATA (r)) +#define XRATIO_DENOMINATOR(r) ratio_denominator (XRATIO_DATA (r)) + +#define RATIO_ARITH_RETURN(r,op) do \ +{ \ + Lisp_Object retval = make_ratio (0L, 1UL); \ + ratio_##op (XRATIO_DATA (retval), XRATIO_DATA (r)); \ + return Fcanonicalize_number (retval); \ +} while (0) + +#define RATIO_ARITH_RETURN1(r,op,arg) do \ +{ \ + Lisp_Object retval = make_ratio (0L, 1UL); \ + ratio_##op (XRATIO_DATA (retval), XRATIO_DATA (r), arg); \ + return Fcanonicalize_number (retval); \ +} while (0) + +extern Lisp_Object make_ratio (long, unsigned long); +extern Lisp_Object make_ratio_bg (bignum, bignum); +extern Lisp_Object make_ratio_rt (ratio); +extern ratio scratch_ratio; + +#else /* !HAVE_RATIO */ + +#define RATIOP(x) 0 +#define CHECK_RATIO(x) dead_wrong_type_argument (Qratiop, x) +#define CONCHECK_RATIO(x) dead_wrong_type_argument (Qratiop, x) +typedef void ratio; +#define make_ratio(n,d) This XEmacs does not support ratios +#define make_ratio_bg(n,d) This XEmacs does not support ratios + +#endif /* HAVE_RATIO */ + +extern Lisp_Object Qratiop; +EXFUN (Fratiop, 1); + + +/******************************** Rationals *********************************/ +extern Lisp_Object Qrationalp; + +#define RATIONALP(x) (INTEGERP(x) || RATIOP(x)) +#define CHECK_RATIONAL(x) do { \ + if (!RATIONALP (x)) \ + dead_wrong_type_argument (Qrationalp, x); \ + } while (0) +#define CONCHECK_RATIONAL(x) do { \ + if (!RATIONALP (x)) \ + x = wrong_type_argument (Qrationalp, x); \ +} while (0) + +EXFUN (Frationalp, 1); +EXFUN (Fnumerator, 1); +EXFUN (Fdenominator, 1); + + +/******************************** Bigfloats *********************************/ +#ifdef HAVE_BIGFLOAT +struct Lisp_Bigfloat +{ + struct lrecord_header lheader; + bigfloat bf; +}; +typedef struct Lisp_Bigfloat Lisp_Bigfloat; + +DECLARE_LRECORD (bigfloat, Lisp_Bigfloat); +#define XBIGFLOAT(x) XRECORD (x, bigfloat, Lisp_Bigfloat) +#define wrap_bigfloat(p) wrap_record (p, bigfloat) +#define BIGFLOATP(x) RECORDP (x, bigfloat) +#define CHECK_BIGFLOAT(x) CHECK_RECORD (x, bigfloat) +#define CONCHECK_BIGFLOAT(x) CONCHECK_RECORD (x, bigfloat) + +#define bigfloat_data(f) ((f)->bf) +#define XBIGFLOAT_DATA(x) bigfloat_data (XBIGFLOAT (x)) +#define XBIGFLOAT_GET_PREC(x) bigfloat_get_prec (XBIGFLOAT_DATA (x)) +#define XBIGFLOAT_SET_PREC(x,p) bigfloat_set_prec (XBIGFLOAT_DATA (x), p) + +#define BIGFLOAT_ARITH_RETURN(f,op) do \ +{ \ + Lisp_Object retval = make_bigfloat_bf (f); \ + bigfloat_##op (XBIGFLOAT_DATA (retval), XBIGFLOAT_DATA (f)); \ + return retval; \ +} while (0) + +#define BIGFLOAT_ARITH_RETURN1(f,op,arg) do \ +{ \ + Lisp_Object retval = make_bigfloat_bf (f); \ + bigfloat_##op (XBIGFLOAT_DATA (retval), XBIGFLOAT_DATA (f), arg); \ + return retval; \ +} while (0) + +extern Lisp_Object make_bigfloat (double, unsigned long); +extern Lisp_Object make_bigfloat_bf (bigfloat); +extern Lisp_Object Vdefault_float_precision; +extern bigfloat scratch_bigfloat, scratch_bigfloat2; + +#else /* !HAVE_BIGFLOAT */ + +#define BIGFLOATP(x) 0 +#define CHECK_BIGFLOAT(x) dead_wrong_type_argument (Qbigfloatp, x) +#define CONCHECK_BIGFLOAT(x) dead_wrong_type_argument (Qbigfloatp, x) +typedef void bigfloat; +#define make_bigfloat(f) This XEmacs does not support bigfloats +#define make_bigfloat_bf(f) This XEmacs does not support bigfloast + +#endif /* HAVE_BIGFLOAT */ + +extern Lisp_Object Qbigfloatp; +EXFUN (Fbigfloatp, 1); + +/********************************* Floating *********************************/ +extern Lisp_Object Qfloatingp, Qbigfloat; +extern Lisp_Object Qread_default_float_format, Vread_default_float_format; + +#define FLOATINGP(x) (FLOATP (x) || BIGFLOATP (x)) +#define CHECK_FLOATING(x) do { \ + if (!FLOATINGP (x)) \ + dead_wrong_type_argument (Qfloatingp, x); \ + } while (0) +#define CONCHECK_FLOATING(x) do { \ + if (!FLOATINGP (x)) \ + x = wrong_type_argument (Qfloating, x); \ +} while (0) + +extern Lisp_Object make_floating (double); +EXFUN (Ffloatp, 1); + + +/********************************** Reals ***********************************/ +extern Lisp_Object Qrealp; + +#define REALP(x) (RATIONALP (x) || FLOATINGP (x)) +#define CHECK_REAL(x) do { \ + if (!REALP (x)) \ + dead_wrong_type_argument (Qrealp, x); \ + } while (0) +#define CONCHECK_REAL(x) do { \ + if (!REALP (x)) \ + x = wrong_type_argument (Qrealp, x); \ +} while (0) + +EXFUN (Frealp, 1); + + +/********************************* Numbers **********************************/ +extern Lisp_Object Qnumberp; + +#define NUMBERP(x) REALP (x) +#define CHECK_NUMBER(x) do { \ + if (!NUMBERP (x)) \ + dead_wrong_type_argument (Qnumberp, x); \ +} while (0) +#define CONCHECK_NUMBER(x) do { \ + if (!NUMBERP (x)) \ + x = wrong_type_argument (Qnumberp, x); \ +} while (0) + +EXFUN (Fcanonicalize_number, 1); + +enum number_type {FIXNUM_T, BIGNUM_T, RATIO_T, FLOAT_T, BIGFLOAT_T}; + +extern enum number_type get_number_type (Lisp_Object); +extern enum number_type promote_args (Lisp_Object *, Lisp_Object *); + +#endif /* INCLUDED_number_h_ */ diff --text -u 'xemacs-21.5.17/src/objects-gtk.c' 'xemacs-21.5.18/src/objects-gtk.c' Index: ./src/objects-gtk.c --- ./src/objects-gtk.c Wed Oct 1 00:26:53 2003 +++ ./src/objects-gtk.c Tue Sep 21 04:19:54 2004 @@ -58,7 +58,7 @@ Return value is 1 for normal success, 2 for nearest color success, 3 for Non-deallocable sucess. */ int -allocate_nearest_color (GdkColormap *colormap, GdkVisual *visual, +allocate_nearest_color (GdkColormap *colormap, GdkVisual *UNUSED (visual), GdkColor *color_def) { int rc; @@ -138,7 +138,7 @@ static void gtk_print_color_instance (struct Lisp_Color_Instance *c, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { GdkColor *color = COLOR_INSTANCE_GTK_COLOR (c); write_fmt_string (printcharfun, " %ld=(%X,%X,%X)", @@ -172,14 +172,14 @@ static int gtk_color_instance_equal (struct Lisp_Color_Instance *c1, struct Lisp_Color_Instance *c2, - int depth) + int UNUSED (depth)) { return (gdk_color_equal (COLOR_INSTANCE_GTK_COLOR (c1), COLOR_INSTANCE_GTK_COLOR (c2))); } static unsigned long -gtk_color_instance_hash (struct Lisp_Color_Instance *c, int depth) +gtk_color_instance_hash (struct Lisp_Color_Instance *c, int UNUSED (depth)) { return (gdk_color_hash (COLOR_INSTANCE_GTK_COLOR (c), NULL)); } @@ -194,7 +194,7 @@ } static int -gtk_valid_color_name_p (struct device *d, Lisp_Object color) +gtk_valid_color_name_p (struct device *UNUSED (d), Lisp_Object color) { GdkColor c; const char *extname; @@ -212,8 +212,9 @@ /************************************************************************/ static int -gtk_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object name, - Lisp_Object device, Error_Behavior errb) +gtk_initialize_font_instance (struct Lisp_Font_Instance *f, + Lisp_Object UNUSED (name), + Lisp_Object UNUSED (device), Error_Behavior errb) { GdkFont *gf; XFontStruct *xf; @@ -230,7 +231,7 @@ return 0; } - xf = GDK_FONT_XFONT (gf); + xf = (XFontStruct*) GDK_FONT_XFONT (gf); /* Don't allocate the data until we're sure that we will succeed, or the finalize method may get fucked. */ @@ -307,7 +308,7 @@ static void gtk_print_font_instance (struct Lisp_Font_Instance *f, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { write_fmt_string (printcharfun, " 0x%lx", (unsigned long) gdk_font_id (FONT_INSTANCE_GTK_FONT (f))); @@ -332,7 +333,8 @@ static Lisp_Object __gtk_list_fonts_internal (const char *pattern); static Lisp_Object -gtk_font_instance_truename (struct Lisp_Font_Instance *f, Error_Behavior errb) +gtk_font_instance_truename (struct Lisp_Font_Instance *f, + Error_Behavior UNUSED (errb)) { if (NILP (FONT_INSTANCE_TRUENAME (f))) { @@ -349,7 +351,7 @@ } static Lisp_Object -gtk_font_instance_properties (struct Lisp_Font_Instance *f) +gtk_font_instance_properties (struct Lisp_Font_Instance *UNUSED (f)) { Lisp_Object result = Qnil; @@ -359,7 +361,8 @@ } static Lisp_Object -gtk_list_fonts (Lisp_Object pattern, Lisp_Object device, Lisp_Object maxnumber) +gtk_list_fonts (Lisp_Object pattern, Lisp_Object UNUSED (device), + Lisp_Object UNUSED (maxnumber)) { const char *patternext; @@ -371,7 +374,7 @@ #ifdef MULE static int -gtk_font_spec_matches_charset (struct device *d, Lisp_Object charset, +gtk_font_spec_matches_charset (struct device *UNUSED (d), Lisp_Object charset, const Ibyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, int stage) @@ -507,7 +510,7 @@ if (gtk_font_spec_matches_charset (XDEVICE (device), charset, intname, Qnil, 0, -1, 0)) { - result = make_string ((char *) intname, intlen); + result = make_string (intname, intlen); break; } } @@ -556,12 +559,12 @@ { if (names->data) { - if (valid_font_name_p (dpy, names->data)) + if (valid_font_name_p (dpy, (char*) names->data)) { if (!expandp) { /* They want the wildcarded version */ - font_name = build_string (names->data); + font_name = build_string ((char*) names->data); } else { @@ -569,7 +572,7 @@ int nnames = 0; char **x_font_names = 0; - x_font_names = XListFonts (dpy, names->data, 1, &nnames); + x_font_names = XListFonts (dpy, (char*) names->data, 1, &nnames); if (x_font_names) { font_name = build_string (x_font_names[0]); diff --text -u 'xemacs-21.5.17/src/objects-msw.c' 'xemacs-21.5.18/src/objects-msw.c' Index: ./src/objects-msw.c --- ./src/objects-msw.c Wed Oct 1 00:26:53 2003 +++ ./src/objects-msw.c Tue Sep 21 04:19:54 2004 @@ -1155,8 +1155,9 @@ } static int CALLBACK -font_enum_callback_1 (ENUMLOGFONTEXW *lpelfe, NEWTEXTMETRICEXW *lpntme, - int FontType, struct font_enum_t *font_enum) +font_enum_callback_1 (ENUMLOGFONTEXW *lpelfe, + NEWTEXTMETRICEXW *UNUSED (lpntme), + int UNUSED (FontType), struct font_enum_t *font_enum) { /* This function gets called once per facename per character set. * We call a second callback to enumerate the fonts in each facename */ @@ -1172,7 +1173,7 @@ static int sort_font_list_function (Lisp_Object obj1, Lisp_Object obj2, - Lisp_Object pred) + Lisp_Object UNUSED (pred)) { Ibyte *font1, *font2; Ibyte *c1, *c2; @@ -1334,7 +1335,8 @@ static int mswindows_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, - Lisp_Object device, Error_Behavior errb) + Lisp_Object UNUSED (device), + Error_Behavior errb) { COLORREF color; @@ -1360,7 +1362,7 @@ static void mswindows_print_color_instance (Lisp_Color_Instance *c, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c); write_fmt_string (printcharfun, @@ -1382,14 +1384,14 @@ static int mswindows_color_instance_equal (Lisp_Color_Instance *c1, Lisp_Color_Instance *c2, - int depth) + int UNUSED (depth)) { return (COLOR_INSTANCE_MSWINDOWS_COLOR (c1) == COLOR_INSTANCE_MSWINDOWS_COLOR (c2)); } static unsigned long -mswindows_color_instance_hash (Lisp_Color_Instance *c, int depth) +mswindows_color_instance_hash (Lisp_Color_Instance *c, int UNUSED (depth)) { return (unsigned long) COLOR_INSTANCE_MSWINDOWS_COLOR (c); } @@ -1404,7 +1406,7 @@ } static int -mswindows_valid_color_name_p (struct device *d, Lisp_Object color) +mswindows_valid_color_name_p (struct device *UNUSED (d), Lisp_Object color) { return (mswindows_string_to_color (XSTRING_DATA (color)) != (COLORREF) -1); } @@ -1915,7 +1917,7 @@ static void mswindows_print_font_instance (Lisp_Font_Instance *f, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { write_fmt_string (printcharfun, " 0x%lx", (unsigned long) @@ -1925,7 +1927,7 @@ static Lisp_Object mswindows_list_fonts (Lisp_Object pattern, Lisp_Object device, - Lisp_Object maxnumber) + Lisp_Object UNUSED (maxnumber)) { struct device *d = XDEVICE (device); Lisp_Object font_list = Qnil, fonttail, result = Qnil; @@ -1951,7 +1953,8 @@ } static Lisp_Object -mswindows_font_instance_truename (Lisp_Font_Instance *f, Error_Behavior errb) +mswindows_font_instance_truename (Lisp_Font_Instance *f, + Error_Behavior UNUSED (errb)) { return f->truename; } @@ -1959,7 +1962,7 @@ #ifdef MULE static int -mswindows_font_spec_matches_charset_stage_1 (struct device *d, +mswindows_font_spec_matches_charset_stage_1 (struct device *UNUSED (d), Lisp_Object charset, const Ibyte *nonreloc, Lisp_Object reloc, diff --text -u 'xemacs-21.5.17/src/objects-tty.c' 'xemacs-21.5.18/src/objects-tty.c' Index: ./src/objects-tty.c --- ./src/objects-tty.c Wed Oct 1 00:26:53 2003 +++ ./src/objects-tty.c Tue Sep 21 04:19:54 2004 @@ -160,7 +160,8 @@ static int tty_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, - Lisp_Object device, Error_Behavior errb) + Lisp_Object UNUSED (device), + Error_Behavior UNUSED (errb)) { Lisp_Object result; @@ -190,9 +191,9 @@ } static void -tty_print_color_instance (Lisp_Color_Instance *c, - Lisp_Object printcharfun, - int escapeflag) +tty_print_color_instance (Lisp_Color_Instance *UNUSED (c), + Lisp_Object UNUSED (printcharfun), + int UNUSED (escapeflag)) { } @@ -206,20 +207,20 @@ static int tty_color_instance_equal (Lisp_Color_Instance *c1, Lisp_Color_Instance *c2, - int depth) + int UNUSED (depth)) { return (EQ (COLOR_INSTANCE_TTY_SYMBOL (c1), COLOR_INSTANCE_TTY_SYMBOL (c2))); } static unsigned long -tty_color_instance_hash (Lisp_Color_Instance *c, int depth) +tty_color_instance_hash (Lisp_Color_Instance *c, int UNUSED (depth)) { return LISP_HASH (COLOR_INSTANCE_TTY_SYMBOL (c)); } static int -tty_valid_color_name_p (struct device *d, Lisp_Object color) +tty_valid_color_name_p (struct device *UNUSED (d), Lisp_Object color) { return (!NILP (assoc_no_quit (Fintern (color, Qnil), Vtty_color_alist))); #if 0 @@ -231,7 +232,8 @@ static int tty_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, - Lisp_Object device, Error_Behavior errb) + Lisp_Object UNUSED (device), + Error_Behavior UNUSED (errb)) { Ibyte *str = XSTRING_DATA (name); Lisp_Object charset = Qnil; @@ -277,9 +279,9 @@ } static void -tty_print_font_instance (Lisp_Font_Instance *f, - Lisp_Object printcharfun, - int escapeflag) +tty_print_font_instance (Lisp_Font_Instance *UNUSED (f), + Lisp_Object UNUSED (printcharfun), + int UNUSED (escapeflag)) { } @@ -291,7 +293,8 @@ } static Lisp_Object -tty_list_fonts (Lisp_Object pattern, Lisp_Object device, Lisp_Object maxnumber) +tty_list_fonts (Lisp_Object UNUSED (pattern), Lisp_Object UNUSED (device), + Lisp_Object UNUSED (maxnumber)) { return list1 (build_string ("normal")); } @@ -299,7 +302,7 @@ #ifdef MULE static int -tty_font_spec_matches_charset (struct device *d, Lisp_Object charset, +tty_font_spec_matches_charset (struct device *UNUSED (d), Lisp_Object charset, const Ibyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, int stage) diff --text -u 'xemacs-21.5.17/src/objects-x.c' 'xemacs-21.5.18/src/objects-x.c' Index: ./src/objects-x.c --- ./src/objects-x.c Wed Oct 1 00:26:54 2003 +++ ./src/objects-x.c Tue Sep 21 04:19:55 2004 @@ -283,7 +283,7 @@ static void x_print_color_instance (Lisp_Color_Instance *c, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { XColor color = COLOR_INSTANCE_X_COLOR (c); write_fmt_string (printcharfun, " %ld=(%X,%X,%X)", @@ -317,7 +317,7 @@ static int x_color_instance_equal (Lisp_Color_Instance *c1, Lisp_Color_Instance *c2, - int depth) + int UNUSED (depth)) { XColor color1 = COLOR_INSTANCE_X_COLOR (c1); XColor color2 = COLOR_INSTANCE_X_COLOR (c2); @@ -327,7 +327,7 @@ } static unsigned long -x_color_instance_hash (Lisp_Color_Instance *c, int depth) +x_color_instance_hash (Lisp_Color_Instance *c, int UNUSED (depth)) { XColor color = COLOR_INSTANCE_X_COLOR (c); return HASH3 (color.red, color.green, color.blue); @@ -361,7 +361,7 @@ /************************************************************************/ static int -x_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, +x_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object UNUSED (name), Lisp_Object device, Error_Behavior errb) { Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device)); @@ -456,7 +456,7 @@ static void x_print_font_instance (Lisp_Font_Instance *f, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { write_fmt_string (printcharfun, " 0x%lx", (unsigned long) FONT_INSTANCE_X_FONT (f)->fid); @@ -881,7 +881,7 @@ #ifdef MULE static int -x_font_spec_matches_charset (struct device *d, Lisp_Object charset, +x_font_spec_matches_charset (struct device *UNUSED (d), Lisp_Object charset, const Ibyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, int stage) diff --text -u 'xemacs-21.5.17/src/objects.c' 'xemacs-21.5.18/src/objects.c' Index: ./src/objects.c --- ./src/objects.c Sat Sep 20 10:14:30 2003 +++ ./src/objects.c Fri Oct 15 02:26:24 2004 @@ -45,12 +45,11 @@ /* Authors: Ben Wing, Chuck Thompson */ -void +DOESNT_RETURN finalose (void *ptr) { Lisp_Object obj = wrap_pointer_1 (ptr); - invalid_operation ("Can't dump an emacs containing window system objects", obj); } @@ -557,7 +556,7 @@ of for `equal' */ static Lisp_Object -color_instantiate (Lisp_Object specifier, Lisp_Object matchspec, +color_instantiate (Lisp_Object specifier, Lisp_Object UNUSED (matchspec), Lisp_Object domain, Lisp_Object instantiator, Lisp_Object depth) { @@ -790,7 +789,8 @@ static Lisp_Object -font_instantiate (Lisp_Object specifier, Lisp_Object matchspec, +font_instantiate (Lisp_Object UNUSED (specifier), + Lisp_Object USED_IF_MULE (matchspec), Lisp_Object domain, Lisp_Object instantiator, Lisp_Object depth) { @@ -987,7 +987,8 @@ of for `equal' */ static Lisp_Object -face_boolean_instantiate (Lisp_Object specifier, Lisp_Object matchspec, +face_boolean_instantiate (Lisp_Object specifier, + Lisp_Object UNUSED (matchspec), Lisp_Object domain, Lisp_Object instantiator, Lisp_Object depth) { diff --text -u 'xemacs-21.5.17/src/objects.h' 'xemacs-21.5.18/src/objects.h' Index: ./src/objects.h --- ./src/objects.h Fri Jun 21 06:18:40 2002 +++ ./src/objects.h Tue Sep 14 23:32:52 2004 @@ -24,7 +24,7 @@ #ifndef INCLUDED_objects_h_ #define INCLUDED_objects_h_ -void finalose (void *ptr); +DECLARE_DOESNT_RETURN (finalose (void *ptr)); /**************************************************************************** * Color Instance Object * diff --text -u 'xemacs-21.5.17/src/opaque.c' 'xemacs-21.5.18/src/opaque.c' Index: ./src/opaque.c --- ./src/opaque.c Thu Jul 17 22:10:49 2003 +++ ./src/opaque.c Tue Sep 21 04:19:55 2004 @@ -42,7 +42,8 @@ /* Should never, ever be called. (except by an external debugger) */ static void -print_opaque (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_opaque (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { const Lisp_Opaque *p = XOPAQUE (obj); @@ -90,7 +91,7 @@ /* This will not work correctly for opaques with subobjects! */ static int -equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int depth) +equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) { Bytecount size; return ((size = XOPAQUE_SIZE (obj1)) == XOPAQUE_SIZE (obj2) && @@ -100,7 +101,7 @@ /* This will not work correctly for opaques with subobjects! */ static unsigned long -hash_opaque (Lisp_Object obj, int depth) +hash_opaque (Lisp_Object obj, int UNUSED (depth)) { if (XOPAQUE_SIZE (obj) == sizeof (unsigned long)) return *((unsigned long *) XOPAQUE_DATA (obj)); @@ -123,7 +124,8 @@ /* Should never, ever be called. (except by an external debugger) */ static void -print_opaque_ptr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_opaque_ptr (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { const Lisp_Opaque_Ptr *p = XOPAQUE_PTR (obj); @@ -134,13 +136,13 @@ } static int -equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int depth) +equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) { return (XOPAQUE_PTR (obj1)->ptr == XOPAQUE_PTR (obj2)->ptr); } static unsigned long -hash_opaque_ptr (Lisp_Object obj, int depth) +hash_opaque_ptr (Lisp_Object obj, int UNUSED (depth)) { return (unsigned long) XOPAQUE_PTR (obj)->ptr; } diff --text -u 'xemacs-21.5.17/src/print.c' 'xemacs-21.5.18/src/print.c' Index: ./src/print.c --- ./src/print.c Fri Mar 19 11:59:10 2004 +++ ./src/print.c Tue Sep 21 04:19:55 2004 @@ -1438,7 +1438,7 @@ static void default_object_printer (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { struct lcrecord_header *header = (struct lcrecord_header *) XPNTR (obj); @@ -1456,7 +1456,7 @@ void internal_object_printer (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { write_fmt_string (printcharfun, "#<INTERNAL OBJECT (XEmacs bug?) (%s) 0x%lx>", @@ -1514,7 +1514,7 @@ print_internal (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { /* This function can GC */ - int specdepth; + int specdepth = 0; struct gcpro gcpro1, gcpro2; QUIT; @@ -1746,7 +1746,8 @@ } void -print_float (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_float (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { char pigbuf[350]; /* see comments in float_to_string */ @@ -2057,7 +2058,7 @@ avoid consing in debug_prin1. That is verboten, since debug_prin1 can be called by cons debugging code. */ static Lisp_Object -debug_prin1_exit (Lisp_Object ignored UNUSED_ARG) +debug_prin1_exit (Lisp_Object UNUSED (ignored)) { struct debug_bindings *bindings = (struct debug_bindings *) XOPAQUE (debug_prin1_bindings)->data; diff --text -u 'xemacs-21.5.17/src/process-nt.c' 'xemacs-21.5.18/src/process-nt.c' Index: ./src/process-nt.c --- ./src/process-nt.c Sun Jan 12 20:08:19 2003 +++ ./src/process-nt.c Tue Sep 21 04:19:55 2004 @@ -1151,7 +1151,7 @@ static void nt_kill_child_process (Lisp_Object proc, int signo, - int current_group, int nomsg) + int UNUSED (current_group), int UNUSED (nomsg)) { Lisp_Process *p = XPROCESS (proc); diff --text -u 'xemacs-21.5.17/src/process-unix.c' 'xemacs-21.5.18/src/process-unix.c' Index: ./src/process-unix.c --- ./src/process-unix.c Sat Mar 1 16:25:36 2003 +++ ./src/process-unix.c Tue Sep 21 04:19:56 2004 @@ -96,7 +96,7 @@ /**********************************************************************/ static SIGTYPE -close_safely_handler (int signo) +close_safely_handler (int SIG_ARG_MAYBE_UNUSED (signo)) { EMACS_REESTABLISH_SIGNAL (signo, close_safely_handler); SIGRETURN; @@ -127,7 +127,8 @@ to get rid of irrelevant descriptors. */ static int -close_process_descs_mapfun (const void *key, void *contents, void *arg) +close_process_descs_mapfun (const void *UNUSED (key), void *contents, + void *UNUSED (arg)) { Lisp_Object proc = VOID_TO_LISP (contents); USID vaffan, culo; @@ -516,7 +517,13 @@ #endif /* !USE_GETADDRINFO */ static void -set_socket_nonblocking_maybe (int fd, int port, const char *proto) +set_socket_nonblocking_maybe (int fd, +#ifdef PROCESS_IO_BLOCKING + int port, const char *proto +#else + int UNUSED (port), const char *UNUSED (proto) +#endif + ) { #ifdef PROCESS_IO_BLOCKING Lisp_Object tail; @@ -696,7 +703,7 @@ behavior when we use sigaction(), which we do use.) */ static SIGTYPE -sigchld_handler (int signo) +sigchld_handler (int SIG_ARG_MAYBE_UNUSED (signo)) { #ifdef OBNOXIOUS_SYSV_SIGCLD_BEHAVIOR int old_errno = errno; @@ -836,8 +843,8 @@ */ static void -unix_init_process_io_handles (Lisp_Process *p, void *in, void *out, void *err, - int flags) +unix_init_process_io_handles (Lisp_Process *p, void *in, void *UNUSED (out), + void *err, int UNUSED (flags)) { UNIX_DATA(p)->infd = (int) in; UNIX_DATA(p)->errfd = (int) err; @@ -879,7 +886,10 @@ XEmacs?), this should be verified as an executable directory by the parent. */ -static void +static DECLARE_DOESNT_RETURN (child_setup (int, int, int, Ibyte **, + Lisp_Object)); + +static DOESNT_RETURN child_setup (int in, int out, int err, Ibyte **new_argv, Lisp_Object current_dir) { diff --text -u 'xemacs-21.5.17/src/process.c' 'xemacs-21.5.18/src/process.c' Index: ./src/process.c --- ./src/process.c Wed Oct 1 00:26:54 2003 +++ ./src/process.c Wed Sep 22 11:06:49 2004 @@ -1197,6 +1197,7 @@ DEFUN ("set-process-buffer", Fset_process_buffer, 2, 2, 0, /* Set buffer associated with PROCESS to BUFFER (a buffer, or nil). +Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */ (process, buffer)) { @@ -1209,8 +1210,8 @@ DEFUN ("process-buffer", Fprocess_buffer, 1, 1, 0, /* Return the buffer PROCESS is associated with. -Output from PROCESS is inserted in this buffer -unless PROCESS has a filter. +Output from PROCESS is inserted in this buffer unless PROCESS has a filter. +Set the buffer with `set-process-buffer'. */ (process)) { @@ -1219,6 +1220,8 @@ } DEFUN ("set-process-stderr-buffer", Fset_process_stderr_buffer, 2, 2, 0, /* +Output from the stderr of PROCESS is inserted in this buffer unless +PROCESS has a stderr filter. Set stderr buffer associated with PROCESS to BUFFER (a buffer, or nil). */ (process, buffer)) @@ -1234,8 +1237,8 @@ DEFUN ("process-stderr-buffer", Fprocess_stderr_buffer, 1, 1, 0, /* Return the stderr buffer PROCESS is associated with. -Output from the stderr of PROCESS is inserted in this buffer -unless PROCESS has a stderr filter. +Output from the stderr of PROCESS is inserted in this buffer unless PROCESS +has a stderr filter. Set the buffer with `set-process-stderr-buffer'. */ (process)) { diff --text -u 'xemacs-21.5.17/src/procimpl.h' 'xemacs-21.5.18/src/procimpl.h' Index: ./src/procimpl.h --- ./src/procimpl.h Sun Jan 12 20:08:20 2003 +++ ./src/procimpl.h Wed Sep 22 11:06:50 2004 @@ -103,7 +103,7 @@ /* Non-false if process has exited and "dumped core" on its way down */ char core_dumped; - /* This next field is only actually used #ifdef ENERGIZE */ + /* #### Is this field unused? */ /* if this flag is not NIL, then filter will do the read on the channel, rather than having a call to make_string. This only works if the filter is a subr. */ diff --text -u 'xemacs-21.5.17/src/profile.c' 'xemacs-21.5.18/src/profile.c' Index: ./src/profile.c --- ./src/profile.c Thu Jul 31 22:32:26 2003 +++ ./src/profile.c Tue Sep 21 04:19:56 2004 @@ -349,7 +349,7 @@ } static SIGTYPE -sigprof_handler (int signo) +sigprof_handler (int UNUSED (signo)) { #ifdef WIN32_ANY /* Windows unfortunately does not have any such thing as setitimer @@ -613,7 +613,7 @@ static int set_profiling_info_timing_maphash (Lisp_Object key, Lisp_Object val, - void *void_closure) + void *UNUSED (void_closure)) { /* This function does not GC */ if (!INTP (val)) @@ -669,8 +669,8 @@ static int mark_profiling_info_maphash (const void *void_key, - void *void_val, - void *void_closure) + void *UNUSED (void_val), + void *UNUSED (void_closure)) { #ifdef USE_KKCC kkcc_gc_stack_push_lisp_object (VOID_TO_LISP (void_key)); diff --text -u 'xemacs-21.5.17/src/rangetab.c' 'xemacs-21.5.18/src/rangetab.c' Index: ./src/rangetab.c --- ./src/rangetab.c Sun Jan 12 20:08:20 2003 +++ ./src/rangetab.c Tue Sep 21 04:19:56 2004 @@ -52,7 +52,8 @@ } static void -print_range_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_range_table (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Range_Table *rt = XRANGE_TABLE (obj); int i; @@ -490,8 +491,8 @@ /************************************************************************/ static int -rangetab_data_validate (Lisp_Object keyword, Lisp_Object value, - Error_Behavior errb) +rangetab_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, + Error_Behavior UNUSED (errb)) { Lisp_Object rest; diff --text -u 'xemacs-21.5.17/src/redisplay-gtk.c' 'xemacs-21.5.18/src/redisplay-gtk.c' Index: ./src/redisplay-gtk.c --- ./src/redisplay-gtk.c Fri Feb 21 15:56:59 2003 +++ ./src/redisplay-gtk.c Tue Sep 21 04:19:56 2004 @@ -236,8 +236,8 @@ */ static int -gtk_text_width (struct frame *f, struct face_cachel *cachel, CONST Ichar *str, - Charcount len) +gtk_text_width (struct frame *UNUSED (f), struct face_cachel *cachel, + CONST Ichar *str, Charcount len) { int width_so_far = 0; unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); @@ -608,7 +608,7 @@ mask |= GDK_GC_LINE_WIDTH; } - return gc_cache_lookup (DEVICE_GTK_GC_CACHE (d), &gcv, mask); + return gc_cache_lookup (DEVICE_GTK_GC_CACHE (d), &gcv, (GdkGCValuesMask) mask); } /***************************************************************************** @@ -848,7 +848,7 @@ /* We draw underlines in the same color as the text. */ if (cachel->underline) { - unsigned long upos, uthick; + int upos, uthick; /* Cannot get at font properties in Gtk, so we resort to guessing */ @@ -874,7 +874,7 @@ } if (cachel->strikethru) { - unsigned long ascent,descent,upos, uthick; + gint ascent,descent,upos, uthick; GdkFont *gfont = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font)); /* Cannot get at font properties in Gtk, so we resort to @@ -1118,7 +1118,7 @@ int cursor_start, int cursor_width, int cursor_height, - int bg_pixmap) + int UNUSED (bg_pixmap)) { struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); @@ -1472,8 +1472,8 @@ given face. ****************************************************************************/ static void -gtk_clear_region (Lisp_Object locale, struct device* d, struct frame* f, face_index findex, - int x, int y, +gtk_clear_region (Lisp_Object UNUSED (locale), struct device* d, + struct frame* f, face_index UNUSED (findex), int x, int y, int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, Lisp_Object background_pixmap) { @@ -1683,9 +1683,10 @@ } static void -gtk_bevel_area (struct window *w, face_index findex, +gtk_bevel_area (struct window *w, face_index UNUSED (findex), int x, int y, int width, int height, - int shadow_thickness, int edges, enum edge_style style) + int shadow_thickness, int UNUSED (edges), + enum edge_style UNUSED (style)) { struct frame *f = XFRAME (w->frame); @@ -1696,7 +1697,8 @@ /* Make audible bell. */ static void -gtk_ring_bell (struct device *d, int volume, int pitch, int duration) +gtk_ring_bell (struct device *UNUSED (d), int volume, int UNUSED (pitch), + int UNUSED (duration)) { /* Gdk does not allow us to control the duration / pitch / volume */ if (volume > 0) diff --text -u 'xemacs-21.5.17/src/redisplay-msw.c' 'xemacs-21.5.18/src/redisplay-msw.c' Index: ./src/redisplay-msw.c --- ./src/redisplay-msw.c Fri Feb 21 15:56:59 2003 +++ ./src/redisplay-msw.c Tue Sep 21 04:19:56 2004 @@ -210,7 +210,7 @@ ****************************************************************************/ static void mswindows_update_dc (HDC hdc, Lisp_Object fg, Lisp_Object bg, - Lisp_Object bg_pmap) + Lisp_Object UNUSED (bg_pmap)) { if (!NILP (fg)) { @@ -242,7 +242,9 @@ Output a horizontal line in the foreground of its face. ****************************************************************************/ static void -mswindows_output_hline (struct window *w, struct display_line *dl, struct rune *rb) +mswindows_output_hline (struct window *UNUSED (w), + struct display_line *UNUSED (dl), + struct rune *UNUSED (rb)) { /* #### Implement me */ } @@ -436,10 +438,10 @@ ****************************************************************************/ static void mswindows_output_string (struct window *w, struct display_line *dl, - Ichar_dynarr *buf, int xpos, int xoffset, int clip_start, - int width, face_index findex, - int cursor, int cursor_start, int cursor_width, - int cursor_height) + Ichar_dynarr *buf, int xpos, int xoffset, + int clip_start, int width, face_index findex, + int UNUSED (cursor), int UNUSED (cursor_start), + int UNUSED (cursor_width), int UNUSED (cursor_height)) { struct frame *f = XFRAME (w->frame); /* struct device *d = XDEVICE (f->device);*/ @@ -682,9 +684,10 @@ DGA normalized display_glyph_area. */ static void mswindows_output_pixmap (struct window *w, Lisp_Object image_instance, - struct display_box *db, struct display_glyph_area *dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height, int bg_pixmap) + struct display_box *db, + struct display_glyph_area *dga, face_index findex, + int UNUSED (cursor_start), int UNUSED (cursor_width), + int UNUSED (cursor_height), int bg_pixmap) { struct frame *f = XFRAME (w->frame); HDC hdc = get_frame_dc (f, 1); @@ -829,7 +832,7 @@ Perform any necessary initialization prior to an update. ****************************************************************************/ static void -mswindows_frame_output_begin (struct frame *f) +mswindows_frame_output_begin (struct frame *UNUSED (f)) { } @@ -839,7 +842,13 @@ Perform any necessary flushing of queues when an update has completed. ****************************************************************************/ static void -mswindows_frame_output_end (struct frame *f) +mswindows_frame_output_end (struct frame * +#ifdef DEFER_WINDOW_POS + f +#else + UNUSED (f) +#endif + ) { #ifdef DEFER_WINDOW_POS HDWP hdwp = FRAME_MSWINDOWS_DATA (f)->hdwp; @@ -855,7 +864,7 @@ /* Printer version is more lightweight. */ static void -msprinter_frame_output_end (struct frame *f) +msprinter_frame_output_end (struct frame *UNUSED (f)) { GdiFlush(); } @@ -877,7 +886,8 @@ } static void -mswindows_ring_bell (struct device *d, int volume, int pitch, int duration) +mswindows_ring_bell (struct device *UNUSED (d), int UNUSED (volume), + int UNUSED (pitch), int UNUSED (duration)) { /* Beep does not work at all, anyways! -kkm */ MessageBeep (MB_OK); @@ -1103,7 +1113,7 @@ Draw a vertical divider down the right side of the given window. ****************************************************************************/ static void -mswindows_output_vertical_divider (struct window *w, int clear_unused) +mswindows_output_vertical_divider (struct window *w, int UNUSED (clear_unused)) { struct frame *f = XFRAME (w->frame); HDC hdc = get_frame_dc (f, 1); @@ -1187,10 +1197,16 @@ given face. ****************************************************************************/ static void -mswindows_clear_region (Lisp_Object locale, struct device *d, struct frame *f, - face_index findex, int x, int y, - int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, - Lisp_Object background_pixmap) +mswindows_clear_region ( +#ifdef HAVE_SCROLLBARS + Lisp_Object locale, +#else + Lisp_Object UNUSED (locale), +#endif + struct device *UNUSED (d), struct frame *f, + face_index UNUSED (findex), int x, int y, + int width, int height, Lisp_Object fcolor, + Lisp_Object bcolor, Lisp_Object background_pixmap) { RECT rect = { x, y, x+width, y+height }; HDC hdc = get_frame_dc (f, 1); @@ -1217,7 +1233,7 @@ /* #### Implement me! */ static void -mswindows_clear_frame (struct frame *f) +mswindows_clear_frame (struct frame *UNUSED (f)) { GdiFlush (); } diff --text -u 'xemacs-21.5.17/src/redisplay-output.c' 'xemacs-21.5.18/src/redisplay-output.c' Index: ./src/redisplay-output.c --- ./src/redisplay-output.c Fri Feb 21 15:56:59 2003 +++ ./src/redisplay-output.c Tue Sep 21 04:19:57 2004 @@ -68,7 +68,8 @@ Synchronize the given rune blocks. ****************************************************************************/ static void -sync_rune_structs (struct window *w, rune_dynarr *cra, rune_dynarr *dra) +sync_rune_structs (struct window *UNUSED (w), rune_dynarr *cra, + rune_dynarr *dra) { int rune_elt; int max_move = ((Dynarr_length (dra) > Dynarr_largest (cra)) @@ -493,7 +494,9 @@ int start_pos; int stop_pos; int force = 0; +#if 0 int block_end; +#endif cdb = Dynarr_atp (cdl->display_blocks, c_block); ddb = Dynarr_atp (ddl->display_blocks, d_block); @@ -503,11 +506,13 @@ start_pos = -1; stop_pos = min (Dynarr_length (cdb->runes), Dynarr_length (ddb->runes)); +#if 0 block_end = (!Dynarr_length (ddb->runes) ? 0 : (Dynarr_atp (ddb->runes, Dynarr_length (ddb->runes) - 1)->xpos + Dynarr_atp (ddb->runes, Dynarr_length (ddb->runes) - 1)->width)); +#endif /* If the new block type is not text and the cursor status is changing and it overlaps the position of this block then force a @@ -1311,8 +1316,9 @@ redisplay_output_subwindow (struct window *w, Lisp_Object image_instance, struct display_box* db, struct display_glyph_area* dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height) + face_index findex, int UNUSED (cursor_start), + int UNUSED (cursor_width), + int UNUSED (cursor_height)) { Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); Lisp_Object window; @@ -1396,8 +1402,8 @@ redisplay_output_layout (Lisp_Object domain, Lisp_Object image_instance, struct display_box* db, struct display_glyph_area* dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height) + face_index findex, int UNUSED (cursor_start), + int UNUSED (cursor_width), int UNUSED (cursor_height)) { Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); Lisp_Object rest, window = DOMAIN_WINDOW (domain); diff --text -u 'xemacs-21.5.17/src/redisplay-tty.c' 'xemacs-21.5.18/src/redisplay-tty.c' Index: ./src/redisplay-tty.c --- ./src/redisplay-tty.c Fri Jun 21 06:18:42 2002 +++ ./src/redisplay-tty.c Tue Sep 21 04:19:57 2004 @@ -106,8 +106,8 @@ column, so we use ichar_string_displayed_columns(). ****************************************************************************/ static int -tty_text_width (struct frame *f, struct face_cachel *cachel, const Ichar *str, - Charcount len) +tty_text_width (struct frame *UNUSED (f), struct face_cachel *UNUSED (cachel), + const Ichar *str, Charcount len) { return ichar_string_displayed_columns (str, len); } @@ -141,13 +141,19 @@ Perform any necessary initialization prior to an update. ****************************************************************************/ +#ifdef HAVE_TERMIOS +#define TERMIOS_MAYBE_UNUSED(decl) UNUSED(decl) +#else +#define TERMIOS_MAYBE_UNUSED(decl) decl +#endif + #ifdef DEBUG_XEMACS -void tty_frame_output_begin (struct frame *f); +void tty_frame_output_begin (struct frame *TERMIOS_MAYBE_UNUSED(f)); void #else static void #endif -tty_frame_output_begin (struct frame *f) +tty_frame_output_begin (struct frame *TERMIOS_MAYBE_UNUSED(f)) { #ifndef HAVE_TERMIOS /* Termcap requires `ospeed' to be a global variable so we have to @@ -196,8 +202,8 @@ static void tty_output_display_block (struct window *w, struct display_line *dl, int block, int start, int end, int start_pixpos, - int cursor_start, int cursor_width, - int cursor_height) + int cursor_start, int UNUSED (cursor_width), + int UNUSED (cursor_height)) { struct frame *f = XFRAME (w->frame); Ichar_dynarr *buf = Dynarr_new (Ichar); @@ -377,7 +383,7 @@ Draw a vertical divider down the right side of the given window. ****************************************************************************/ static void -tty_output_vertical_divider (struct window *w, int clear) +tty_output_vertical_divider (struct window *w, int UNUSED (clear)) { /* Divider width can either be 0 or 1 on TTYs */ if (window_divider_width (w)) @@ -411,10 +417,11 @@ Clear the area in the box defined by the given parameters. ****************************************************************************/ static void -tty_clear_region (Lisp_Object window, struct device* d, struct frame * f, - face_index findex, int x, int y, - int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, - Lisp_Object background_pixmap) +tty_clear_region (Lisp_Object window, struct device* UNUSED (d), + struct frame * f, face_index findex, int x, int y, + int width, int height, Lisp_Object UNUSED (fcolor), + Lisp_Object UNUSED (bcolor), + Lisp_Object UNUSED (background_pixmap)) { struct console *c = XCONSOLE (FRAME_CONSOLE (f)); int line; @@ -521,8 +528,8 @@ static void tty_output_ibyte_string (struct window *w, struct display_line *dl, - Ibyte *str, Bytecount len, int xpos, - face_index findex, int cursor) + Ibyte *str, Bytecount len, int xpos, + face_index findex, int UNUSED (cursor)) { struct frame *f = XFRAME (w->frame); struct console *c = XCONSOLE (FRAME_CONSOLE (f)); @@ -1034,7 +1041,8 @@ * tty_ring_bell - sound an audio beep. */ static void -tty_ring_bell (struct device *d, int volume, int pitch, int duration) +tty_ring_bell (struct device *d, int volume, int UNUSED (pitch), + int UNUSED (duration)) { struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); @@ -1376,7 +1384,7 @@ } static Lisp_Object -term_get_fkeys_error (Lisp_Object err, Lisp_Object arg) +term_get_fkeys_error (Lisp_Object UNUSED (err), Lisp_Object arg) { return arg; } diff --text -u 'xemacs-21.5.17/src/redisplay-x.c' 'xemacs-21.5.18/src/redisplay-x.c' Index: ./src/redisplay-x.c --- ./src/redisplay-x.c Fri Feb 21 15:56:59 2003 +++ ./src/redisplay-x.c Tue Sep 21 04:19:57 2004 @@ -241,8 +241,8 @@ */ static int -x_text_width (struct frame *f, struct face_cachel *cachel, const Ichar *str, - Charcount len) +x_text_width (struct frame *UNUSED (f), struct face_cachel *cachel, + const Ichar *str, Charcount len) { int width_so_far = 0; unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); @@ -291,7 +291,7 @@ Perform any necessary initialization prior to an update. ****************************************************************************/ static void -x_window_output_begin (struct window *w) +x_window_output_begin (struct window *UNUSED (w)) { } @@ -773,7 +773,6 @@ /* General variables */ struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); - Lisp_Object device; Lisp_Object window; Display *dpy = DEVICE_X_DISPLAY (d); Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); @@ -798,7 +797,6 @@ int i; struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex); - device = wrap_device (d); window = wrap_window (w); if (width < 0) @@ -1237,7 +1235,7 @@ x_output_pixmap (struct window *w, Lisp_Object image_instance, struct display_box *db, struct display_glyph_area *dga, face_index findex, int cursor_start, int cursor_width, - int cursor_height, int bg_pixmap) + int cursor_height, int UNUSED (bg_pixmap)) { struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); @@ -1528,8 +1526,8 @@ ****************************************************************************/ void x_output_shadows (struct frame *f, int x, int y, int width, int height, - GC top_shadow_gc, GC bottom_shadow_gc, GC background_gc, - int shadow_thickness, int edges) + GC top_shadow_gc, GC bottom_shadow_gc, + GC UNUSED (background_gc), int shadow_thickness, int edges) { struct device *d = XDEVICE (f->device); @@ -1679,7 +1677,8 @@ given face. ****************************************************************************/ static void -x_clear_region (Lisp_Object locale, struct device* d, struct frame* f, face_index findex, +x_clear_region (Lisp_Object UNUSED (locale), struct device* d, + struct frame* f, face_index UNUSED (findex), int x, int y, int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, Lisp_Object background_pixmap) diff --text -u 'xemacs-21.5.17/src/redisplay.c' 'xemacs-21.5.18/src/redisplay.c' Index: ./src/redisplay.c --- ./src/redisplay.c Wed Oct 1 00:26:54 2003 +++ ./src/redisplay.c Tue Sep 21 04:19:57 2004 @@ -3160,7 +3160,7 @@ /* Add a blank to a margin display block. */ static void -add_margin_blank (struct display_line *dl, struct display_block *db, +add_margin_blank (struct display_line *UNUSED (dl), struct display_block *db, struct window *w, int xpos, int width, int side) { struct rune rb; @@ -4071,7 +4071,7 @@ modeline extents. */ static Charcount add_glyph_to_fstring_db_runes (pos_data *data, Lisp_Object glyph, - Charcount pos, Charcount min_pos, + Charcount pos, Charcount UNUSED (min_pos), Charcount max_pos, Lisp_Object extent) { /* This function has been Mule-ized. */ @@ -5897,7 +5897,7 @@ first_line = last_line = line; while (line <= dla_end) { - Charbpos old_start, old_end, new_start; + Charbpos old_start, old_end; struct display_line *cdl = Dynarr_atp (cdla, line); struct display_line *ddl = Dynarr_atp (ddla, line); struct display_block *db; @@ -5918,8 +5918,8 @@ if (line == first_line && ddl->used_prop_data) return 0; - new_start = generate_display_line (w, ddl, 0, ddl->charpos + ddl->offset, - &prop, DESIRED_DISP); + generate_display_line (w, ddl, 0, ddl->charpos + ddl->offset, + &prop, DESIRED_DISP); ddl->offset = 0; /* #### If there is propagated stuff the fail. We could @@ -6053,7 +6053,6 @@ we fail the next thing that is going to happen is a full regen so we will actually end up being safe. */ { - Charbpos new_start; prop_block_dynarr *prop = NULL; struct display_line *cdl = Dynarr_atp (cdla, line); struct display_line *ddl = Dynarr_atp (ddla, line); @@ -6070,8 +6069,8 @@ if (ddl->used_prop_data) return 0; - new_start = generate_display_line (w, ddl, 0, ddl->charpos + ddl->offset, - &prop, DESIRED_DISP); + generate_display_line (w, ddl, 0, ddl->charpos + ddl->offset, + &prop, DESIRED_DISP); ddl->offset = 0; /* If there is propagated stuff then it is pretty much a @@ -6666,7 +6665,7 @@ be a better way to do this. */ static int -reset_buffer_changes_mapfun (struct window *w, void *ignored_closure) +reset_buffer_changes_mapfun (struct window *w, void *UNUSED (closure)) { buffer_reset_changes (XBUFFER (w->buffer)); return 0; @@ -6745,7 +6744,7 @@ #ifdef ERROR_CHECK_TRAPPING_PROBLEMS static Lisp_Object -commit_ritual_suicide (Lisp_Object ceci_nest_pas_une_pipe) +commit_ritual_suicide (Lisp_Object UNUSED (ceci_nest_pas_une_pipe)) { assert (!in_display); return Qnil; @@ -6805,7 +6804,7 @@ static int in_display_nesting; static Lisp_Object -end_hold_frame_size_changes (Lisp_Object obj) +end_hold_frame_size_changes (Lisp_Object UNUSED (obj)) { if (!hold_frame_size_changes) { @@ -9599,7 +9598,7 @@ Force the modeline of the current buffer to be redisplayed. With optional non-nil ALL, force redisplay of all modelines. */ - (all)) + (UNUSED (all))) { MARK_MODELINE_CHANGED; return Qnil; @@ -9626,15 +9625,18 @@ /***************************************************************************/ static void -margin_width_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) +margin_width_changed_in_frame (Lisp_Object UNUSED (specifier), + struct frame *UNUSED (f), + Lisp_Object UNUSED (oldval)) { /* Nothing to be done? */ } int -redisplay_variable_changed (Lisp_Object sym, Lisp_Object *val, - Lisp_Object in_object, int flags) +redisplay_variable_changed (Lisp_Object UNUSED (sym), + Lisp_Object *UNUSED (val), + Lisp_Object UNUSED (in_object), + int UNUSED (flags)) { /* #### clip_changed should really be renamed something like global_redisplay_change. */ @@ -9645,8 +9647,8 @@ /* This is called if the built-in glyphs have their properties changed. */ void -redisplay_glyph_changed (Lisp_Object glyph, Lisp_Object property, - Lisp_Object locale) +redisplay_glyph_changed (Lisp_Object UNUSED (glyph), + Lisp_Object UNUSED (property), Lisp_Object locale) { if (WINDOWP (locale)) { @@ -9677,8 +9679,8 @@ } static void -text_cursor_visible_p_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +text_cursor_visible_p_changed (Lisp_Object UNUSED (specifier), + struct window *w, Lisp_Object UNUSED (oldval)) { if (XFRAME (w->frame)->init_finished) Fforce_cursor_redisplay (w->frame); @@ -9827,7 +9829,8 @@ #ifdef ERROR_CHECK_DISPLAY static int -sledgehammer_check_redisplay_structs_1 (struct window *w, void *closure) +sledgehammer_check_redisplay_structs_1 (struct window *w, + void *UNUSED (closure)) { int i, j; display_line_dynarr *dl; diff --text -u 'xemacs-21.5.17/src/regex.c' 'xemacs-21.5.18/src/regex.c' Index: ./src/regex.c --- ./src/regex.c Wed Oct 1 00:26:56 2003 +++ ./src/regex.c Fri Oct 15 02:26:24 2004 @@ -45,13 +45,6 @@ #include <sys/types.h> #include <stddef.h> /* needed for ptrdiff_t under Solaris */ -/* This is for other GNU distributions with internationalized messages. */ -#if defined (I18N3) && (defined (HAVE_LIBINTL_H) || defined (_LIBC)) -# include <libintl.h> -#else -# define gettext(msgid) (msgid) -#endif - /* XEmacs addition */ #ifdef REL_ALLOC #define REGEX_REL_ALLOC /* may be undefined below */ @@ -90,6 +83,8 @@ #else /* not emacs */ +#include "compiler.h" /* Get compiler-specific definitions like UNUSED */ + /* If we are not linking with Emacs proper, we can't use the relocating allocator even if config.h says that we can. */ @@ -174,6 +169,13 @@ #endif /* emacs */ +/* This is for other GNU distributions with internationalized messages. */ +#if defined (I18N3) && (defined (HAVE_LIBINTL_H) || defined (_LIBC)) +# include <libintl.h> +#else +# define gettext(msgid) (msgid) +#endif + /* Under XEmacs, this is needed because we don't define it elsewhere. */ #ifdef SWITCH_ENUM_BUG #define SWITCH_ENUM_CAST(x) ((int)(x)) @@ -4767,7 +4769,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, int size1, re_char *string2, int size2, int pos, struct re_registers *regs, int stop - RE_LISP_CONTEXT_ARGS_DECL) + RE_LISP_CONTEXT_ARGS_MULE_DECL) { /* General temporaries. */ int mcnt; @@ -6661,7 +6663,8 @@ bcmp_translate (re_char *s1, re_char *s2, REGISTER int len, RE_TRANSLATE_TYPE translate #ifdef emacs - , Internal_Format fmt, Lisp_Object lispobj + , Internal_Format USED_IF_MULE (fmt), + Lisp_Object USED_IF_MULE (lispobj) #endif ) { @@ -6963,7 +6966,7 @@ from either regcomp or regexec. We don't use PREG here. */ size_t -regerror (int errcode, const regex_t *preg, char *errbuf, +regerror (int errcode, const regex_t *UNUSED (preg), char *errbuf, size_t errbuf_size) { const char *msg; diff --text -u 'xemacs-21.5.17/src/regex.h' 'xemacs-21.5.18/src/regex.h' Index: ./src/regex.h --- ./src/regex.h Fri May 9 23:52:38 2003 +++ ./src/regex.h Fri Oct 15 02:26:24 2004 @@ -26,15 +26,17 @@ #ifdef emacs #define RE_TRANSLATE_TYPE Lisp_Object -#define RE_LISP_SHORT_CONTEXT_ARGS_DECL , Lisp_Object lispobj, struct buffer *lispbuf +#define RE_LISP_SHORT_CONTEXT_ARGS_DECL , Lisp_Object UNUSED (lispobj), struct buffer *UNUSED (lispbuf) #define RE_LISP_SHORT_CONTEXT_ARGS , lispobj, lispbuf #define RE_LISP_CONTEXT_ARGS_DECL , Lisp_Object lispobj, struct buffer *lispbuf, struct syntax_cache *scache +#define RE_LISP_CONTEXT_ARGS_MULE_DECL , Lisp_Object lispobj, struct buffer *USED_IF_MULE (lispbuf), struct syntax_cache *scache #define RE_LISP_CONTEXT_ARGS , lispobj, lispbuf, scache #else #define RE_TRANSLATE_TYPE char * #define RE_LISP_SHORT_CONTEXT_ARGS_DECL #define RE_LISP_SHORT_CONTEXT_ARGS #define RE_LISP_CONTEXT_ARGS_DECL +#define RE_LISP_CONTEXT_ARGS_MULE_DECL #define RE_LISP_CONTEXT_ARGS #define Elemcount ssize_t #define Bytecount ssize_t diff --text -u 'xemacs-21.5.17/src/s/windowsnt.h' 'xemacs-21.5.18/src/s/windowsnt.h' Index: ./src/s/windowsnt.h --- ./src/s/windowsnt.h Tue Oct 14 14:03:13 2003 +++ ./src/s/windowsnt.h Mon Sep 20 13:07:46 2004 @@ -241,8 +241,9 @@ /* MSVC 6.0 has a mechanism to declare functions which never return */ #if (_MSC_VER >= 1200) -#define DOESNT_RETURN __declspec(noreturn) void -#define DECLARE_DOESNT_RETURN(decl) __declspec(noreturn) extern void XCDECL decl +#define DOESNT_RETURN_TYPE(rettype) __declspec(noreturn) rettype +#define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) \ + __declspec(noreturn) rettype XCDECL decl #endif /* MSVC 6.0 */ /* MSVC warnings no-no crap. When adding one to this section, diff --text -u 'xemacs-21.5.17/src/scrollbar-gtk.c' 'xemacs-21.5.18/src/scrollbar-gtk.c' Index: ./src/scrollbar-gtk.c --- ./src/scrollbar-gtk.c Wed Oct 1 00:26:57 2003 +++ ./src/scrollbar-gtk.c Tue Sep 21 04:19:58 2004 @@ -1,4 +1,4 @@ -/* scrollbar implementation -- X interface. +/* scrollbar implementation -- GTK interface. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1994 Amdhal Corporation. Copyright (C) 1995 Sun Microsystems, Inc. @@ -75,7 +75,8 @@ } static gboolean -scrollbar_drag_hack_cb (GtkWidget *w, GdkEventButton *ev, gpointer v) +scrollbar_drag_hack_cb (GtkWidget *UNUSED (w), GdkEventButton *UNUSED (ev), + gpointer v) { vertical_drag_in_progress = (int) v; inhibit_slider_size_change = (int) v; @@ -97,8 +98,8 @@ SCROLLBAR_GTK_VDRAG_ORIG_VALUE (instance) = -1; SCROLLBAR_GTK_LAST_VALUE (instance) = adj->value; - gtk_object_set_data (GTK_OBJECT (adj), "xemacs::gui_id", (void *) SCROLLBAR_GTK_ID (instance)); - gtk_object_set_data (GTK_OBJECT (adj), "xemacs::frame", f); + gtk_object_set_data (GTK_OBJECT (adj), GTK_DATA_GUI_IDENTIFIER, (void *) SCROLLBAR_GTK_ID (instance)); + gtk_object_set_data (GTK_OBJECT (adj), GTK_DATA_FRAME_IDENTIFIER, f); sb = GTK_SCROLLBAR (vertical ? gtk_vscrollbar_new (adj) : gtk_hscrollbar_new (adj)); SCROLLBAR_GTK_WIDGET (instance) = GTK_WIDGET (sb); @@ -221,6 +222,21 @@ gtk_widget_set_usize (wid, pos_data->scrollbar_width, pos_data->scrollbar_height); + + /* + UGLY! UGLY! UGLY! Changes to wid->allocation are queued and + not performed until the GTK event loop. However, when the + fontlock progress bar is run, the vertical scrollbar's height + is change and then changed back before events are again + processed. This means that the change back is not seen and + the scrollbar is left too short. Fix this by making the + change manually so the test above sees the change. This does + not seem to cause problems in other cases. + */ + + wid->allocation.width = pos_data->scrollbar_width; + wid->allocation.height = pos_data->scrollbar_height; + modified_p = 1; } @@ -232,6 +248,21 @@ wid, pos_data->scrollbar_x, pos_data->scrollbar_y); + + /* + UGLY! UGLY! UGLY! Changes to wid->allocation are queued and + not performed until the GTK event loop. However, when the + fontlock progress bar is run, the horizontal scrollbar's + position is change and then changed back before events are + again processed. This means that the change back is not seen + and the scrollbar is left in the wrong position. Fix this by + making the change manually so the test above sees the change. + This does not seem to cause problems in other cases. + */ + + wid->allocation.x = pos_data->scrollbar_x; + wid->allocation.y = pos_data->scrollbar_y; + modified_p = 1; } @@ -364,9 +395,9 @@ { /* This function can GC */ int vertical = (int) user_data; - struct frame *f = gtk_object_get_data (GTK_OBJECT (adj), "xemacs::frame"); + struct frame *f = (struct frame*) gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_FRAME_IDENTIFIER); struct scrollbar_instance *instance; - GUI_ID id = (GUI_ID) gtk_object_get_data (GTK_OBJECT (adj), "xemacs::gui_id"); + GUI_ID id = (GUI_ID) gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_GUI_IDENTIFIER); Lisp_Object win, frame; struct window_mirror *mirror; Lisp_Object event_type = Qnil; @@ -442,7 +473,7 @@ #ifdef MEMORY_USAGE_STATS static int -gtk_compute_scrollbar_instance_usage (struct device *d, +gtk_compute_scrollbar_instance_usage (struct device *UNUSED (d), struct scrollbar_instance *inst, struct overhead_stats *ovstats) { diff --text -u 'xemacs-21.5.17/src/scrollbar-msw.c' 'xemacs-21.5.18/src/scrollbar-msw.c' Index: ./src/scrollbar-msw.c --- ./src/scrollbar-msw.c Wed Oct 1 00:26:58 2003 +++ ./src/scrollbar-msw.c Tue Sep 21 04:19:58 2004 @@ -129,10 +129,10 @@ } static void -mswindows_update_scrollbar_instance_values (struct window *w, +mswindows_update_scrollbar_instance_values (struct window *UNUSED (w), struct scrollbar_instance *sb, - int new_line_increment, - int new_page_increment, + int UNUSED (new_line_increment), + int UNUSED (new_page_increment), int new_minimum, int new_maximum, int new_slider_size, int new_slider_position, @@ -184,8 +184,8 @@ } static void -mswindows_update_scrollbar_instance_status (struct window *w, - int active, int size, +mswindows_update_scrollbar_instance_status (struct window *UNUSED (w), + int UNUSED (active), int size, struct scrollbar_instance *sb) { if (SCROLLBAR_MSW_SIZE (sb) != size) @@ -199,7 +199,7 @@ } void -mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos) +mswindows_handle_scrollbar_event (HWND hwnd, int code, int UNUSED (pos)) { struct frame *f; Lisp_Object win, frame; @@ -422,9 +422,9 @@ #ifdef MEMORY_USAGE_STATS static int -mswindows_compute_scrollbar_instance_usage (struct device *d, - struct scrollbar_instance *inst, - struct overhead_stats *ovstats) +mswindows_compute_scrollbar_instance_usage (struct device *UNUSED (d), + struct scrollbar_instance *inst, + struct overhead_stats *ovstats) { int total = 0; diff --text -u 'xemacs-21.5.17/src/scrollbar-x.c' 'xemacs-21.5.18/src/scrollbar-x.c' Index: ./src/scrollbar-x.c --- ./src/scrollbar-x.c Wed Oct 1 00:26:58 2003 +++ ./src/scrollbar-x.c Tue Sep 21 04:19:59 2004 @@ -692,7 +692,7 @@ #ifdef MEMORY_USAGE_STATS static int -x_compute_scrollbar_instance_usage (struct device *d, +x_compute_scrollbar_instance_usage (struct device *UNUSED (d), struct scrollbar_instance *inst, struct overhead_stats *ovstats) { diff --text -u 'xemacs-21.5.17/src/scrollbar.c' 'xemacs-21.5.18/src/scrollbar.c' Index: ./src/scrollbar.c --- ./src/scrollbar.c Mon Sep 22 13:21:43 2003 +++ ./src/scrollbar.c Tue Sep 21 04:19:59 2004 @@ -437,7 +437,9 @@ int new_minimum = -1, new_maximum = -1; int new_slider_size = -1, new_slider_position = -1; int new_width = -1, new_height = -1, new_x = -1, new_y = -1; +#if 0 struct window *new_window = 0; /* #### currently unused */ +#endif end_pos = BUF_Z (b) - w->window_end_pos[CURRENT_DISP]; sb_pos = scrollbar_point (w, 0); @@ -528,7 +530,9 @@ new_slider_size = min ((end_pos - start_pos), (new_maximum - new_minimum)); new_slider_position = sb_pos; +#if 0 new_window = w; +#endif } } else if (!MINI_WINDOW_P (w)) @@ -620,9 +624,9 @@ } static void -vertical_scrollbar_changed_in_window (Lisp_Object specifier, +vertical_scrollbar_changed_in_window (Lisp_Object UNUSED (specifier), struct window *w, - Lisp_Object oldval) + Lisp_Object UNUSED (oldval)) { /* Hold on your cerebella guys. If we always show the dividers, changing scrollbar affects only how the text and scrollbar are @@ -642,8 +646,9 @@ /* This function is called as a result of a change to the `scrollbar-pointer' glyph. */ static void -scrollbar_pointer_changed_in_window (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +scrollbar_pointer_changed_in_window (Lisp_Object UNUSED (specifier), + struct window *w, + Lisp_Object UNUSED (oldval)) { struct frame *f = XFRAME (WINDOW_FRAME (w)); diff --text -u 'xemacs-21.5.17/src/search.c' 'xemacs-21.5.18/src/search.c' Index: ./src/search.c --- ./src/search.c Mon Sep 29 18:20:41 2003 +++ ./src/search.c Fri Oct 15 02:26:25 2004 @@ -137,8 +137,10 @@ int RE, Lisp_Object trt, Lisp_Object inverse_trt, int posix); -static void -matcher_overflow (void) +static DECLARE_DOESNT_RETURN (matcher_overflow (void)); + +static DOESNT_RETURN +matcher_overflow () { stack_overflow ("Stack overflow in regexp matcher", Qunbound); } @@ -156,7 +158,7 @@ static int compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, - struct re_registers *regp, Lisp_Object translate, + struct re_registers *UNUSED (regp), Lisp_Object translate, int posix, Error_Behavior errb) { const char *val; @@ -195,8 +197,9 @@ struct re_pattern_buffer * compile_pattern (Lisp_Object pattern, struct re_registers *regp, - Lisp_Object translate, Lisp_Object searchobj, - struct buffer *searchbuf, int posix, Error_Behavior errb) + Lisp_Object translate, Lisp_Object UNUSED (searchobj), + struct buffer *UNUSED (searchbuf), int posix, + Error_Behavior errb) { struct regexp_cache *cp, **cpp; @@ -243,12 +246,13 @@ /* Error condition used for failing searches */ Lisp_Object Qsearch_failed; -static Lisp_Object +static DECLARE_DOESNT_RETURN (signal_failure (Lisp_Object)); + +static DOESNT_RETURN signal_failure (Lisp_Object arg) { for (;;) Fsignal (Qsearch_failed, list1 (arg)); - return Qnil; /* Not reached. */ } /* Convert the search registers from Bytebpos's to Charbpos's. Needs to be @@ -401,7 +405,7 @@ static Lisp_Object string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, - struct buffer *buf, int posix) + struct buffer *buf, int UNUSED (posix)) { Bytecount val; Charcount s; @@ -1159,7 +1163,10 @@ if (np <= 0) { if (NILP (noerror)) - return signal_failure (string); + { + signal_failure (string); + RETURN_NOT_REACHED (Qnil); + } if (!EQ (noerror, Qt)) { if (lim < BUF_BEGV (buf) || lim > BUF_ZV (buf)) @@ -1538,7 +1545,7 @@ static Charbpos boyer_moore (struct buffer *buf, Ibyte *base_pat, Bytecount len, Bytebpos pos, Bytebpos lim, EMACS_INT n, Lisp_Object trt, - Lisp_Object inverse_trt, int charset_base) + Lisp_Object inverse_trt, int USED_IF_MULE (charset_base)) { /* &&#### needs some 8-bit work here */ /* #### Someone really really really needs to comment the workings @@ -3079,7 +3086,7 @@ #### Not yet implemented. Currently does nothing. #### Do not use this yet. Its calling interface is likely to change. */ - (regexp)) + (UNUSED (regexp))) { return Qnil; } diff --text -u 'xemacs-21.5.17/src/select-gtk.c' 'xemacs-21.5.18/src/select-gtk.c' Index: ./src/select-gtk.c --- ./src/select-gtk.c Wed Oct 1 00:26:58 2003 +++ ./src/select-gtk.c Tue Sep 21 04:19:59 2004 @@ -49,7 +49,8 @@ extern Lisp_Object time_to_lisp (time_t); static GdkAtom -symbol_to_gtk_atom (struct device *d, Lisp_Object sym, int only_if_exists) +symbol_to_gtk_atom (struct device *UNUSED (d), Lisp_Object sym, + int only_if_exists) { if (NILP (sym)) return GDK_SELECTION_PRIMARY; if (EQ (sym, Qt)) return GDK_SELECTION_SECONDARY; @@ -64,7 +65,7 @@ } static Lisp_Object -atom_to_symbol (struct device *d, GdkAtom atom) +atom_to_symbol (struct device *UNUSED (d), GdkAtom atom) { if (atom == GDK_SELECTION_PRIMARY) return (QPRIMARY); if (atom == GDK_SELECTION_SECONDARY) return (QSECONDARY); @@ -129,11 +130,11 @@ ** WMP Feb 12 2001 */ void -emacs_gtk_selection_handle (GtkWidget *widget, +emacs_gtk_selection_handle (GtkWidget *UNUSED (widget), GtkSelectionData *selection_data, - guint info, + guint UNUSED (info), guint time_stamp, - gpointer data) + gpointer UNUSED (data)) { /* This function can GC */ struct gcpro gcpro1, gcpro2; @@ -241,9 +242,9 @@ void -emacs_gtk_selection_clear_event_handle (GtkWidget *widget, +emacs_gtk_selection_clear_event_handle (GtkWidget *UNUSED (widget), GdkEventSelection *event, - gpointer data) + gpointer UNUSED (data)) { GdkAtom selection = event->selection; guint32 changed_owner_time = event->time; @@ -281,9 +282,9 @@ /* Gets the current selection owned by another application */ void -emacs_gtk_selection_received (GtkWidget *widget, +emacs_gtk_selection_received (GtkWidget *UNUSED (widget), GtkSelectionData *selection_data, - gpointer user_data) + gpointer UNUSED (user_data)) { waiting_for_selection = FALSE; Vretrieved_selection = Qnil; @@ -306,7 +307,7 @@ } static int -selection_reply_done (void *ignore) +selection_reply_done (void *UNUSED (ignore)) { return !reading_selection_reply; } @@ -404,12 +405,13 @@ static Lisp_Object -gtk_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, - Lisp_Object how_to_add, Lisp_Object selection_type, int owned_p) +gtk_own_selection (Lisp_Object selection_name, + Lisp_Object UNUSED (selection_value), + Lisp_Object UNUSED (how_to_add), + Lisp_Object UNUSED (selection_type), int UNUSED (owned_p)) { struct device *d = decode_gtk_device (Qnil); GtkWidget *selecting_window = GTK_WIDGET (DEVICE_GTK_APP_SHELL (d)); - Lisp_Object selection_time; /* Use the time of the last-read mouse or keyboard event. For selection purposes, we use this as a sleazy way of knowing what the current time is in server-time. This assumes that the most recently read @@ -460,7 +462,7 @@ static Lisp_Object gtk_selection_exists_p (Lisp_Object selection, - Lisp_Object selection_type) + Lisp_Object UNUSED (selection_type)) { struct device *d = decode_gtk_device (Qnil); diff --text -u 'xemacs-21.5.17/src/select-msw.c' 'xemacs-21.5.18/src/select-msw.c' Index: ./src/select-msw.c --- ./src/select-msw.c Wed Oct 1 00:26:58 2003 +++ ./src/select-msw.c Tue Sep 21 04:19:59 2004 @@ -227,7 +227,7 @@ Lisp_Object selection_value, Lisp_Object how_to_add, Lisp_Object selection_type, - int owned_p /* Not used */) + int UNUSED (owned_p)) { HGLOBAL hValue = NULL; UINT cfType; @@ -584,7 +584,8 @@ } static void -mswindows_disown_selection (Lisp_Object selection, Lisp_Object timeval) +mswindows_disown_selection (Lisp_Object selection, + Lisp_Object UNUSED (timeval)) { if (EQ (selection, QCLIPBOARD)) { diff --text -u 'xemacs-21.5.17/src/select-x.c' 'xemacs-21.5.18/src/select-x.c' Index: ./src/select-x.c --- ./src/select-x.c Wed Oct 1 00:26:58 2003 +++ ./src/select-x.c Tue Sep 21 04:19:59 2004 @@ -203,9 +203,20 @@ /* Do protocol to assert ourself as a selection owner. */ static Lisp_Object -x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, - Lisp_Object how_to_add, Lisp_Object selection_type, - int owned_p) +x_own_selection (Lisp_Object selection_name, +#ifdef MOTIF_CLIPBOARDS + Lisp_Object selection_value, +#else + Lisp_Object UNUSED (selection_value), +#endif + Lisp_Object UNUSED (how_to_add), + Lisp_Object UNUSED (selection_type), +#ifdef MOTIF_CLIPBOARDS + int owned_p +#else + int UNUSED (owned_p) +#endif +) { struct device *d = decode_x_device (Qnil); Display *display = DEVICE_X_DISPLAY (d); @@ -881,7 +892,7 @@ static int selection_reply_timed_out; static int -selection_reply_done (void *ignore) +selection_reply_done (void *UNUSED (unused)) { return !reading_selection_reply; } @@ -891,7 +902,7 @@ DEFUN ("x-selection-reply-timeout-internal", Fx_selection_reply_timeout_internal, 1, 1, 0, /* */ - (arg)) + (UNUSED (arg))) { selection_reply_timed_out = 1; reading_selection_reply = 0; @@ -1028,7 +1039,7 @@ static void receive_incremental_selection (Display *display, Window window, Atom property, /* this one is for error messages only */ - Lisp_Object target_type, + Lisp_Object UNUSED (target_type), Bytecount min_size_bytes, UChar_Binary **data_ret, Bytecount *size_bytes_ret, @@ -1203,7 +1214,7 @@ static Lisp_Object x_selection_exists_p (Lisp_Object selection, - Lisp_Object selection_type) + Lisp_Object UNUSED (selection_type)) { struct device *d = decode_x_device (Qnil); Display *dpy = DEVICE_X_DISPLAY (d); diff --text -u 'xemacs-21.5.17/src/sgiplay.c' 'xemacs-21.5.18/src/sgiplay.c' Index: ./src/sgiplay.c --- ./src/sgiplay.c Wed Mar 13 17:52:58 2002 +++ ./src/sgiplay.c Tue Sep 21 04:19:59 2004 @@ -316,7 +316,7 @@ } static int -play_internal (UChar_Binary *data, int length, AudioContext ac) +play_internal (UChar_Binary *data, int UNUSED (length), AudioContext ac) { UChar_Binary * limit; if (ac == (AudioContext) 0) diff --text -u 'xemacs-21.5.17/src/signal.c' 'xemacs-21.5.18/src/signal.c' Index: ./src/signal.c --- ./src/signal.c Fri Feb 21 15:57:00 2003 +++ ./src/signal.c Tue Sep 21 04:20:00 2004 @@ -436,10 +436,6 @@ code. */ #ifdef ERROR_CHECK_TRAPPING_PROBLEMS - assert_with_message - (proper_redisplay_wrapping_in_place (), - "QUIT called from within redisplay without being properly wrapped"); - /* When in a critical section, don't reset something_happened, so that every single QUIT will verify proper wrapping. (something_happened was set by enter_redisplay_critical_section() and will be reset @@ -467,7 +463,7 @@ /* Signal handler for SIGIO. */ static void -input_available_signal (int signo) +input_available_signal (int SIG_ARG_MAYBE_UNUSED (signo)) { something_happened = 1; /* tell QUIT to wake up */ quit_check_signal_happened = 1; @@ -982,6 +978,14 @@ if (quit_check_signal_happened) { +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS + /* Since the code below can call Lisp, make sure that proper wrapping is + in place during redisplay. */ + assert_with_message + (proper_redisplay_wrapping_in_place (), + "QUIT called from within redisplay without being properly wrapped"); +#endif + /* Since arbitrary Lisp code may be executed (e.g. through a menu filter, see backtrace directly above), GC might happen, which would majorly fuck a lot of things, e.g. re_match() diff --text -u 'xemacs-21.5.17/src/sound.c' 'xemacs-21.5.18/src/sound.c' Index: ./src/sound.c --- ./src/sound.c Sun Mar 9 11:27:46 2003 +++ ./src/sound.c Wed Sep 22 04:44:27 2004 @@ -490,11 +490,16 @@ return Qnil; } +#ifdef HAVE_NAS_SOUND +#define USED_IF_HAVE_NAS(decl) decl +#else +#define USED_IF_HAVE_NAS(decl) UNUSED (decl) +#endif + DEFUN ("wait-for-sounds", Fwait_for_sounds, 0, 1, 0, /* Wait for all sounds to finish playing on DEVICE. */ - (device)) - + (USED_IF_HAVE_NAS (device))) { #ifdef HAVE_NAS_SOUND struct device *d = decode_device (device); @@ -510,7 +515,7 @@ DEFUN ("connected-to-nas-p", Fconnected_to_nas_p, 0, 1, 0, /* Return t if connected to NAS server for sounds on DEVICE. */ - (device)) + (USED_IF_HAVE_NAS (device))) { #ifdef HAVE_NAS_SOUND return DEVICE_CONNECTED_TO_NAS_P (decode_device (device)) ? Qt : Qnil; diff --text -u 'xemacs-21.5.17/src/specifier.c' 'xemacs-21.5.18/src/specifier.c' Index: ./src/specifier.c --- ./src/specifier.c Fri Jan 23 19:00:23 2004 +++ ./src/specifier.c Tue Sep 21 04:20:00 2004 @@ -263,7 +263,8 @@ } static void -print_specifier (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_specifier (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { Lisp_Specifier *sp = XSPECIFIER (obj); int count = specpdl_depth (); @@ -1233,20 +1234,11 @@ check_valid_inst_list (Lisp_Object inst_list, struct specifier_methods *meths, Error_Behavior errb) { - Lisp_Object rest; - - LIST_LOOP (rest, inst_list) + EXTERNAL_LIST_LOOP_2 (inst_pair, inst_list) { - Lisp_Object inst_pair, tag_set; + Lisp_Object tag_set; - if (!CONSP (rest)) - { - maybe_sferror ( - "Invalid instantiator list", inst_list, - Qspecifier, errb); - return Qnil; - } - if (!CONSP (inst_pair = XCAR (rest))) + if (!CONSP (inst_pair)) { maybe_sferror ( "Invalid instantiator pair", inst_pair, @@ -1292,12 +1284,10 @@ check_valid_spec_list (Lisp_Object spec_list, struct specifier_methods *meths, Error_Behavior errb) { - Lisp_Object rest; - - LIST_LOOP (rest, spec_list) + EXTERNAL_LIST_LOOP_2 (spec, spec_list) { - Lisp_Object spec, locale; - if (!CONSP (rest) || !CONSP (spec = XCAR (rest))) + Lisp_Object locale; + if (!CONSP (spec)) { maybe_sferror ( "Invalid specification list", spec_list, @@ -2197,7 +2187,7 @@ enum spec_locale_type locale_type, Lisp_Object tag_set, int exact_p, - void *ignored_closure) + void *UNUSED (closure)) { if (NILP (locale)) specifier_remove_locale_type (specifier, locale_type, tag_set, exact_p); @@ -2558,7 +2548,6 @@ Lisp_Object window = Qnil; Lisp_Object frame = Qnil; Lisp_Object device = Qnil; - Lisp_Object tag = Qnil; /* #### currently unused */ Lisp_Specifier *sp = XSPECIFIER (specifier); /* Attempt to determine buffer, window, frame, and device from the @@ -2590,7 +2579,7 @@ device = FRAME_DEVICE (XFRAME (frame)); /* device had better be determined by now; abort if not. */ - tag = DEVICE_CLASS (XDEVICE (device)); + (void) DEVICE_CLASS (XDEVICE (device)); depth = make_int (1 + XINT (depth)); if (XINT (depth) > 20) diff --text -u 'xemacs-21.5.17/src/sunpro.c' 'xemacs-21.5.18/src/sunpro.c' Index: ./src/sunpro.c --- ./src/sunpro.c Wed Mar 13 17:52:59 2002 +++ ./src/sunpro.c Tue Sep 21 04:20:00 2004 @@ -46,7 +46,11 @@ function has no effect and always returns `nil'. See function `has-usage-tracking-p'. */ - (int nargs, Lisp_Object *args)) +#ifdef USAGE_TRACKING + (int nargs, Lisp_Object *args) +#else + (int UNUSED (nargs), Lisp_Object *UNUSED (args)) +#endif { #ifdef USAGE_TRACKING Lisp_Object xs; diff --text -u 'xemacs-21.5.17/src/symbols.c' 'xemacs-21.5.18/src/symbols.c' Index: ./src/symbols.c --- ./src/symbols.c Wed Sep 10 17:40:41 2003 +++ ./src/symbols.c Tue Sep 21 04:20:00 2004 @@ -995,8 +995,8 @@ /* Should never, ever be called. (except by an external debugger) */ void -print_symbol_value_magic (Lisp_Object obj, - Lisp_Object printcharfun, int escapeflag) +print_symbol_value_magic (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { write_fmt_string (printcharfun, "#<INTERNAL OBJECT (XEmacs bug?) (%s type %d) 0x%lx>", @@ -1323,7 +1323,7 @@ */ static void -write_out_buffer_local_cache (Lisp_Object symbol, +write_out_buffer_local_cache (Lisp_Object UNUSED (symbol), struct symbol_value_buffer_local *bfwd) { if (!NILP (bfwd->current_buffer)) @@ -2998,7 +2998,8 @@ this function (or change the semantics of its arguments) without pity, thereby invalidating your code. */ - (variable, handler_type, handler, harg, keep_existing)) + (variable, handler_type, handler, harg, + UNUSED (keep_existing))) { Lisp_Object valcontents; struct symbol_value_lisp_magic *bfwd; diff --text -u 'xemacs-21.5.17/src/symsinit.h' 'xemacs-21.5.18/src/symsinit.h' Index: ./src/symsinit.h --- ./src/symsinit.h Mon Sep 22 12:21:19 2003 +++ ./src/symsinit.h Tue Apr 6 07:49:56 2004 @@ -151,6 +151,7 @@ void syms_of_mule_coding (void); void syms_of_mule_wnn (void); void syms_of_nt (void); +void syms_of_number (void); void syms_of_objects (void); void syms_of_objects_mswindows (void); void syms_of_objects_tty (void); @@ -391,6 +392,7 @@ void vars_of_mule_wnn (void); void reinit_vars_of_mule_wnn (void); void vars_of_nt (void); +void vars_of_number (void); void vars_of_objects (void); void reinit_vars_of_objects (void); void vars_of_objects_tty (void); @@ -548,4 +550,8 @@ void init_event_gtk_late (void); void console_type_create_select_gtk (void); +/* Enhanced number initialization: must be done only at runtime due to complex + interactions with the supporting libraries. */ +void init_number (void); + #endif /* INCLUDED_symsinit_h_ */ diff --text -u 'xemacs-21.5.17/src/syntax.c' 'xemacs-21.5.18/src/syntax.c' Index: ./src/syntax.c --- ./src/syntax.c Wed Oct 1 00:26:59 2003 +++ ./src/syntax.c Wed Sep 22 11:06:51 2004 @@ -31,32 +31,6 @@ #include "syntax.h" #include "extents.h" -/* Here is a comment from Ken'ichi HANDA <handa@etl.go.jp> - explaining the purpose of the Sextword syntax category: - -Japanese words are not separated by spaces, which makes finding word -boundaries very difficult. Theoretically it's impossible without -using natural language processing techniques. But, by defining -pseudo-words as below (much simplified for letting you understand it -easily) for Japanese, we can have a convenient forward-word function -for Japanese. - - A Japanese word is a sequence of characters that consists of - zero or more Kanji characters followed by zero or more - Hiragana characters. - -Then, the problem is that now we can't say that a sequence of -word-constituents makes up a WORD. For instance, both Hiragana "A" -and Kanji "KAN" are word-constituents but the sequence of these two -letters can't be a single word. - -So, we introduced Sextword for Japanese letters. A character of -Sextword is a word-constituent but a word boundary may exist between -two such characters. */ - -/* Mule 2.4 doesn't seem to have Sextword - I'm removing it -- mrb */ -/* Recovered by tomo */ - #define ST_COMMENT_STYLE 0x101 #define ST_STRING_STYLE 0x102 @@ -307,7 +281,7 @@ if (count <= 0) { from--; - from = buffer_or_string_clip_to_accessible_byte (cache->object, + from = buffer_or_string_clip_to_accessible_char (cache->object, from); } if (!(from >= cache->prev_change && from < cache->next_change)) @@ -458,7 +432,8 @@ outward to the current buffer (#### rewrite in English please?!). */ void -update_syntax_cache (struct syntax_cache *cache, Charxpos cpos, int count) +update_syntax_cache (struct syntax_cache *cache, Charxpos cpos, + int UNUSED (count)) { Lisp_Object tmp_table; Bytexpos pos; @@ -615,7 +590,8 @@ #ifdef MULE enum syntaxcode -charset_syntax (struct buffer *buf, Lisp_Object charset, int *multi_p_out) +charset_syntax (struct buffer *UNUSED (buf), Lisp_Object UNUSED (charset), + int *multi_p_out) { *multi_p_out = 1; /* !!#### get this right */ @@ -2234,7 +2210,7 @@ */ static int -copy_to_mirrortab (struct chartab_range *range, Lisp_Object table, +copy_to_mirrortab (struct chartab_range *range, Lisp_Object UNUSED (table), Lisp_Object val, void *arg) { Lisp_Object mirrortab = VOID_TO_LISP (arg); @@ -2247,7 +2223,8 @@ } static int -copy_if_not_already_present (struct chartab_range *range, Lisp_Object table, +copy_if_not_already_present (struct chartab_range *range, + Lisp_Object UNUSED (table), Lisp_Object val, void *arg) { Lisp_Object mirrortab = VOID_TO_LISP (arg); diff --text -u 'xemacs-21.5.17/src/sysdep.c' 'xemacs-21.5.18/src/sysdep.c' Index: ./src/sysdep.c --- ./src/sysdep.c Wed Oct 1 00:26:59 2003 +++ ./src/sysdep.c Wed Oct 20 02:19:07 2004 @@ -123,6 +123,12 @@ #include <sys/termio.h> #endif +#ifdef HAVE_TTY +#define USED_IF_TTY(decl) decl +#else +#define USED_IF_TTY(decl) UNUSED (decl) +#endif + /************************************************************************/ /* subprocess control */ @@ -150,7 +156,13 @@ /* Arrange for character C to be read as the next input from the terminal. */ void -stuff_char (struct console *con, int c) +stuff_char (struct console *con, +#ifdef TIOCSTI + int c +#else + int UNUSED (c) +#endif + ) { int input_fd; @@ -169,7 +181,13 @@ #endif /* HAVE_TTY */ void -set_exclusive_use (int fd) +set_exclusive_use ( +#ifdef FIOCLEX + int fd +#else + int UNUSED (fd) +#endif + ) { #ifdef FIOCLEX ioctl (fd, FIOCLEX, 0); @@ -178,7 +196,13 @@ } void -set_descriptor_non_blocking (int fd) +set_descriptor_non_blocking ( +#if defined (STRIDE) || (defined (pfa) && defined (HAVE_PTYS)) || defined (AIX) || defined (F_SETFL) + int fd +#else + int UNUSED (fd) +#endif + ) { /* Stride people say it's a mystery why this is needed as well as the O_NDELAY, but that it fails without this. */ @@ -367,7 +391,13 @@ */ void -flush_pending_output (int channel) +flush_pending_output ( +#if !defined (HAVE_TERMIOS) && (defined (TCFLSH) || defined (TIOCFLUSH)) + int channel +#else + int UNUSED (channel) +#endif + ) { #ifdef HAVE_TERMIOS /* If we try this, we get hit with SIGTTIN, because @@ -692,7 +722,13 @@ /* Suspend a process if possible; give terminal to its superior. */ void -sys_suspend_process (int process) +sys_suspend_process ( +#ifdef SIGTSTP + int process +#else + int UNUSED (process) +#endif + ) { /* I don't doubt that it is possible to suspend processes on * VMS machines or thost that use USG_JOBCTRL, @@ -708,7 +744,13 @@ so that the function works even when fd is not a pty. */ int -get_pty_max_bytes (int fd) +get_pty_max_bytes ( +#if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON) + int fd +#else + int UNUSED (fd) +#endif + ) { /* DEC OSF 4.0 fpathconf returns 255, but xemacs hangs on long shell input lines if we return 253. 252 is OK!. So let's leave a bit @@ -793,7 +835,13 @@ to HEIGHT and WIDTH. This is used mainly with ptys. */ int -set_window_size (int fd, int height, int width) +set_window_size ( +#if defined (TIOCSWINSZ) || defined (TIOCSSIZE) + int fd, int height, int width +#else + int UNUSED (fd), int UNUSED (height), int UNUSED (width) +#endif + ) { #ifdef TIOCSWINSZ @@ -826,7 +874,13 @@ /* Set up the proper status flags for use of a pty. */ void -setup_pty (int fd) +setup_pty ( +#ifdef TIOCPKT + int fd +#else + int UNUSED (fd) +#endif + ) { #ifdef IBMRTAIX /* On AIX, the parent gets SIGHUP when a pty attached child dies. So, we */ @@ -1479,11 +1533,16 @@ tty_init_sys_modes_on_device (struct device *d) { struct emacs_tty tty; - int input_fd, output_fd; + int input_fd; +#if defined (IBMR2AIX) && defined (AIXHFT) + int output_fd; +#endif struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); input_fd = CONSOLE_TTY_DATA (con)->infd; +#if defined (IBMR2AIX) && defined (AIXHFT) output_fd = CONSOLE_TTY_DATA (con)->outfd; +#endif emacs_get_tty (input_fd, &CONSOLE_TTY_DATA (con)->old_tty); tty = CONSOLE_TTY_DATA (con)->old_tty; @@ -1709,7 +1768,13 @@ #endif /* HAVE_TTY */ void -init_one_device (struct device *d) +init_one_device ( +#if defined(HAVE_TTY) || (defined(SIGIO) && !defined(BROKEN_SIGIO)) + struct device *d +#else + struct device *UNUSED (d) +#endif + ) { #ifdef HAVE_TTY if (DEVICE_TTY_P (d)) @@ -1759,7 +1824,7 @@ At the time this is called, init_sys_modes has not been done yet. */ int -tabs_safe_p (struct device *d) +tabs_safe_p (struct device *USED_IF_TTY (d)) { #ifdef HAVE_TTY if (DEVICE_TTY_P (d)) @@ -1863,11 +1928,16 @@ static void tty_reset_sys_modes_on_device (struct device *d) { - int input_fd, output_fd; +#if defined (BSD) || (defined (IBMR2AIX) && defined (AIXHFT)) + int output_fd; +#endif + int input_fd; struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); input_fd = CONSOLE_TTY_DATA (con)->infd; +#if defined (BSD) || (defined (IBMR2AIX) && defined (AIXHFT)) output_fd = CONSOLE_TTY_DATA (con)->outfd; +#endif #if defined (IBMR2AIX) && defined (AIXHFT) { @@ -2493,7 +2563,7 @@ /* Ben sez: read Dick Gabriel's essay about the Worse Is Better approach to programming and its connection to the silly interruptible-system-call business. To find it, look on - Jamie's home page (http://www.jwz.org/worse-is-better.html). */ + Jamie's home page (http://www.jwz.org/doc/worse-is-better.html). */ #ifdef WIN32_NATIVE @@ -2865,7 +2935,13 @@ } int -qxe_mkdir (const Ibyte *path, mode_t mode) +qxe_mkdir (const Ibyte *path, +#ifdef WIN32_NATIVE + mode_t UNUSED (mode) +#else + mode_t mode +#endif + ) { Extbyte *pathout; PATHNAME_CONVERT_OUT (path, pathout); @@ -3484,7 +3560,14 @@ access to those functions goes through the following. */ int -set_file_times (Lisp_Object path, EMACS_TIME atime, EMACS_TIME mtime) +set_file_times ( +#if defined (WIN32_NATIVE) || defined (HAVE_UTIME) || defined (HAVE_UTIMES) + Lisp_Object path, EMACS_TIME atime, EMACS_TIME mtime +#else + Lisp_Object UNUSED (path), EMACS_TIME UNUSED (atime), + EMACS_TIME UNUSED (mtime) +#endif + ) { #if defined (WIN32_NATIVE) struct utimbuf utb; @@ -3524,7 +3607,13 @@ for increased accuracy. */ static int -get_process_times_1 (long *user_ticks, long *system_ticks) +get_process_times_1 ( +#if defined (CLOCKS_PER_SEC) || defined (_SC_CLK_TCK) || defined (CLK_TCK) && !defined(WIN32_NATIVE) + long *user_ticks, long *system_ticks +#else + long *UNUSED (user_ticks), long *UNUSED (system_ticks) +#endif + ) { #if defined (_SC_CLK_TCK) || defined (CLK_TCK) && !defined(WIN32_NATIVE) /* We have the POSIX times() function available. */ @@ -3635,6 +3724,9 @@ srand ((unsigned int)arg); # endif #endif +#ifdef HAVE_BIGNUM + bignum_random_seed ((unsigned long) arg); +#endif } /* @@ -3645,19 +3737,19 @@ get_random (void) { long val = random (); -#if VALBITS > RAND_BITS +#if INT_VALBITS > RAND_BITS val = (val << RAND_BITS) ^ random (); -#if VALBITS > 2*RAND_BITS +#if INT_VALBITS > 2*RAND_BITS val = (val << RAND_BITS) ^ random (); -#if VALBITS > 3*RAND_BITS +#if INT_VALBITS > 3*RAND_BITS val = (val << RAND_BITS) ^ random (); -#if VALBITS > 4*RAND_BITS +#if INT_VALBITS > 4*RAND_BITS val = (val << RAND_BITS) ^ random (); #endif /* need at least 5 */ #endif /* need at least 4 */ #endif /* need at least 3 */ #endif /* need at least 2 */ - return val & ((1L << VALBITS) - 1); + return val & (EMACS_INT) ((1UL << INT_VALBITS) - 1); } diff --text -u 'xemacs-21.5.17/src/sysdll.c' 'xemacs-21.5.18/src/sysdll.c' Index: ./src/sysdll.c --- ./src/sysdll.c Sun Jan 4 08:06:51 2004 +++ ./src/sysdll.c Sat May 15 00:34:40 2004 @@ -62,12 +62,6 @@ # endif #endif -int -dll_init (const Extbyte *arg) -{ - return 0; -} - dll_handle dll_open (Lisp_Object fname) { @@ -121,12 +115,6 @@ #elif defined(HAVE_SHL_LOAD) /* This is the HP/UX version */ #include <dl.h> -int -dll_init (const Extbyte *arg) -{ - return 0; -} - dll_handle dll_open (Lisp_Object fname) { @@ -184,12 +172,6 @@ #include "syswindows.h" #include "sysfile.h" -int -dll_init (const Extbyte *arg) -{ - return 0; -} - dll_handle dll_open (Lisp_Object fname) { @@ -238,12 +220,6 @@ #include <mach-o/dyld.h> -int -dll_init (const Extbyte *arg) -{ - return 0; -} - dll_handle dll_open (Lisp_Object fname) { @@ -362,7 +338,7 @@ static NSSymbol search_linked_libs(const struct mach_header * mh, const char *symbol) { - int n; + unsigned long n; NSSymbol nssym = 0; struct load_command *lc = @@ -407,7 +383,7 @@ { /* NOTE: This assumes that this function is included in the main program and not in a shared library. */ - const struct mach_header* my_mh = image_for_address(&dll_function); + const struct mach_header* my_mh = image_for_address((void*) &dll_function); if (NSIsSymbolNameDefinedInImage(my_mh, n)) { @@ -451,14 +427,53 @@ NSLinkEditError(&c, &errorNumber, &fileNameWithError, &errorString); return build_ext_string (errorString, Qnative); } -#else -/* Catchall if we don't know about this system's method of dynamic loading */ +#elif HAVE_LTDL +/* Libtool's libltdl */ +#include <ltdl.h> + +dll_handle +dll_open (Lisp_Object fname) +{ + Extbyte *soname; + + if (NILP (fname)) + { + soname = NULL; + } + else + { + LISP_STRING_TO_EXTERNAL (fname, soname, Qdll_filename_encoding); + } + return (dll_handle) lt_dlopen (soname); +} + int -dll_init (const Extbyte *arg) +dll_close (dll_handle h) +{ + return lt_dlclose ((lt_dlhandle) h); +} + +dll_func +dll_function (dll_handle h, const CIbyte *n) +{ + MAYBE_PREPEND_UNDERSCORE (n); + return (dll_func) lt_dlsym ((lt_dlhandle) h, n); +} + +dll_var +dll_variable (dll_handle h, const CIbyte *n) { - return -1; + MAYBE_PREPEND_UNDERSCORE (n); + return (dll_var) lt_dlsym ((lt_dlhandle) h, n); } +Lisp_Object +dll_error () +{ + return build_ext_string (lt_dlerror (), Qnative); +} +#else +/* Catchall if we don't know about this system's method of dynamic loading */ dll_handle dll_open (Lisp_Object fname) { diff --text -u 'xemacs-21.5.17/src/sysdll.h' 'xemacs-21.5.18/src/sysdll.h' Index: ./src/sysdll.h --- ./src/sysdll.h Sun Nov 30 07:11:49 2003 +++ ./src/sysdll.h Sat May 15 00:34:40 2004 @@ -28,13 +28,11 @@ typedef void * dll_func; typedef void * dll_var; -extern int dll_init(const Extbyte *); -extern int dll_shutdown(void); -extern dll_handle dll_open(Lisp_Object); -extern int dll_close(dll_handle); -extern dll_func dll_function(dll_handle, const CIbyte *); -extern dll_var dll_variable(dll_handle, const CIbyte *); -extern Lisp_Object dll_error(void); +extern dll_handle dll_open (Lisp_Object); +extern int dll_close (dll_handle); +extern dll_func dll_function (dll_handle, const CIbyte *); +extern dll_var dll_variable (dll_handle, const CIbyte *); +extern Lisp_Object dll_error (void); /* More stand-ins ... */ diff --text -u 'xemacs-21.5.17/src/sysproc.h' 'xemacs-21.5.18/src/sysproc.h' Index: ./src/sysproc.h --- ./src/sysproc.h Wed Jun 5 18:57:19 2002 +++ ./src/sysproc.h Tue Sep 21 04:20:02 2004 @@ -152,6 +152,17 @@ #include <util.h> /* openpty() on NetBSD */ #endif +/* The FD_* macros expand to __extension__ forms on glibc-based systems. Uno + does not understand such forms, so let's help it out. */ +#ifdef UNO +#undef FD_SET +#undef FD_CLR +#undef FD_ISSET +#undef FD_ZERO +#undef MAXDESC +#undef SELECT_TYPE +#endif /* UNO */ + #ifdef FD_SET /* We could get this from param.h, but better not to depend on finding that. diff --text -u 'xemacs-21.5.17/src/syssignal.h' 'xemacs-21.5.18/src/syssignal.h' Index: ./src/syssignal.h --- ./src/syssignal.h Fri Aug 30 04:45:30 2002 +++ ./src/syssignal.h Tue Sep 21 04:20:02 2004 @@ -148,6 +148,7 @@ sigsuspend (&ES_mask); \ } while (0) #define EMACS_REESTABLISH_SIGNAL(sig, handler) +#define SIG_ARG_MAYBE_UNUSED(decl) UNUSED (decl) #elif defined (HAVE_SIGBLOCK) @@ -173,6 +174,7 @@ sigpause (ES_mask & ~sigmask (sig)); \ } while (0) #define EMACS_REESTABLISH_SIGNAL(sig, handler) +#define SIG_ARG_MAYBE_UNUSED(decl) UNUSED (decl) #elif defined (HAVE_SIGHOLD) @@ -188,6 +190,7 @@ #define EMACS_UNBLOCK_ALL_SIGNALS() 0 #define EMACS_WAIT_FOR_SIGNAL(sig) sigpause (sig) #define EMACS_REESTABLISH_SIGNAL(sig, handler) +#define SIG_ARG_MAYBE_UNUSED(decl) UNUSED (decl) #elif defined (WIN32_NATIVE) @@ -203,6 +206,7 @@ #define EMACS_UNBLOCK_ALL_SIGNALS() 0 #define EMACS_WAIT_FOR_SIGNAL(sig) mswindows_sigpause (sig) #define EMACS_REESTABLISH_SIGNAL(sig, handler) +#define SIG_ARG_MAYBE_UNUSED(decl) UNUSED (decl) /* Defines that we need that aren't in the standard signal.h */ #define SIGHUP 1 /* Hang up */ @@ -227,6 +231,7 @@ signal (sig, handler); \ errno = old_errno; \ } while (0) +#define SIG_ARG_MAYBE_UNUSED(decl) decl /* Under SYSV, setting a signal handler for SIGCLD causes SIGCLD to immediately be sent if there any unwaited processes diff --text -u 'xemacs-21.5.17/src/syswait.h' 'xemacs-21.5.18/src/syswait.h' Index: ./src/syswait.h --- ./src/syswait.h Fri Apr 13 03:24:23 2001 +++ ./src/syswait.h Tue Sep 21 04:20:02 2004 @@ -28,6 +28,19 @@ #include <sys/wait.h> #endif +#ifdef UNO +/* On glibc-based systems, these macros expand to forms containing + __extension__, which Uno cannot understand. */ +#undef WEXITSTATUS +#undef WIFEXITED +#undef WIFSTOPPED +#undef WIFSIGNALED +#undef WCOREDUMP +#undef WTERMSIG +#undef WSTOPSIG +#undef WRETCODE +#endif + #ifndef WEXITSTATUS #define WEXITSTATUS(s) ((s) >> 8) #endif diff --text -u 'xemacs-21.5.17/src/terminfo.c' 'xemacs-21.5.18/src/terminfo.c' Index: ./src/terminfo.c --- ./src/terminfo.c Mon Apr 30 19:13:09 2001 +++ ./src/terminfo.c Tue Sep 21 04:20:02 2004 @@ -66,7 +66,7 @@ /* XEmacs: renamed this function because just tparam() conflicts with ncurses (We don't use this function anyway!) */ char * -emacs_tparam (const char *string, char *outstring, int len, int arg1, +emacs_tparam (const char *string, char *outstring, int UNUSED (len), int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) { diff --text -u 'xemacs-21.5.17/src/tests.c' 'xemacs-21.5.18/src/tests.c' Index: ./src/tests.c --- ./src/tests.c Wed Oct 1 00:26:59 2003 +++ ./src/tests.c Tue Sep 21 04:20:02 2004 @@ -407,7 +407,7 @@ static int -test_hash_tables_mapper (Lisp_Object key, Lisp_Object value, +test_hash_tables_mapper (Lisp_Object UNUSED (key), Lisp_Object value, void *extra_arg) { test_hash_tables_data *p = (test_hash_tables_data *) extra_arg; @@ -428,8 +428,9 @@ } static int -test_hash_tables_predicate (Lisp_Object key, Lisp_Object value, - void *extra_arg) +test_hash_tables_predicate (Lisp_Object key, + Lisp_Object UNUSED (value), + void *UNUSED (extra_arg)) { return XINT (key) < 0; } diff --text -u 'xemacs-21.5.17/src/text.c' 'xemacs-21.5.18/src/text.c' Index: ./src/text.c --- ./src/text.c Wed Oct 1 00:26:59 2003 +++ ./src/text.c Fri Oct 15 02:26:25 2004 @@ -1175,10 +1175,10 @@ Bytecount copy_text_between_formats (const Ibyte *src, Bytecount srclen, Internal_Format srcfmt, - Lisp_Object srcobj, + Lisp_Object USED_IF_MULE (srcobj), Ibyte *dst, Bytecount dstlen, Internal_Format dstfmt, - Lisp_Object dstobj, + Lisp_Object USED_IF_MULE (dstobj), Bytecount *src_used) { if (srcfmt == dstfmt && @@ -1270,8 +1270,9 @@ /************************************************************************/ void -find_charsets_in_ibyte_string (unsigned char *charsets, const Ibyte *str, - Bytecount len) +find_charsets_in_ibyte_string (unsigned char *charsets, + const Ibyte *USED_IF_MULE (str), + Bytecount USED_IF_MULE (len)) { #ifndef MULE /* Telescope this. */ @@ -1297,8 +1298,9 @@ } void -find_charsets_in_ichar_string (unsigned char *charsets, const Ichar *str, - Charcount len) +find_charsets_in_ichar_string (unsigned char *charsets, + const Ichar *USED_IF_MULE (str), + Charcount USED_IF_MULE (len)) { #ifndef MULE /* Telescope this. */ @@ -1343,7 +1345,7 @@ } int -ichar_string_displayed_columns (const Ichar *str, Charcount len) +ichar_string_displayed_columns (const Ichar *USED_IF_MULE (str), Charcount len) { #ifdef MULE int cols = 0; @@ -1359,7 +1361,8 @@ } Charcount -ibyte_string_nonascii_chars (const Ibyte *str, Bytecount len) +ibyte_string_nonascii_chars (const Ibyte *USED_IF_MULE (str), + Bytecount USED_IF_MULE (len)) { #ifdef MULE const Ibyte *end = str + len; @@ -1503,7 +1506,7 @@ Ibyte * eicpyout_malloc_fmt (Eistring *eistr, Bytecount *len_out, Internal_Format fmt, - Lisp_Object object) + Lisp_Object UNUSED (object)) { Ibyte *ptr; @@ -3648,7 +3651,7 @@ `int-to-char of the resulting ARG1' is returned, and ARG2 is always ignored. */ - (charset, arg1, arg2)) + (charset, arg1, USED_IF_MULE (arg2))) { #ifdef MULE Lisp_Charset *cs; diff --text -u 'xemacs-21.5.17/src/text.h' 'xemacs-21.5.18/src/text.h' Index: ./src/text.h --- ./src/text.h Tue Oct 14 14:03:07 2003 +++ ./src/text.h Fri Oct 15 02:26:25 2004 @@ -275,7 +275,8 @@ DECLARE_INLINE_HEADER ( Raw_Ichar -ichar_to_raw (Ichar ch, Internal_Format fmt, Lisp_Object object) +ichar_to_raw (Ichar ch, Internal_Format fmt, + Lisp_Object UNUSED (object)) ) { switch (fmt) @@ -299,7 +300,8 @@ DECLARE_INLINE_HEADER ( int -ichar_fits_in_format (Ichar ch, Internal_Format fmt, Lisp_Object object) +ichar_fits_in_format (Ichar ch, Internal_Format fmt, + Lisp_Object UNUSED (object)) ) { switch (fmt) @@ -321,8 +323,8 @@ DECLARE_INLINE_HEADER ( int -objects_have_same_internal_representation (Lisp_Object srcobj, - Lisp_Object dstobj) +objects_have_same_internal_representation (Lisp_Object UNUSED (srcobj), + Lisp_Object UNUSED (dstobj)) ) { /* &&#### implement this properly when we allow per-object format @@ -751,7 +753,8 @@ DECLARE_INLINE_HEADER ( Bytecount -itext_ichar_len_fmt (const Ibyte *ptr, Internal_Format fmt) +itext_ichar_len_fmt (const Ibyte *USED_IF_MULE_OR_CHECK_TEXT (ptr), + Internal_Format fmt) ) { switch (fmt) @@ -833,7 +836,7 @@ DECLARE_INLINE_HEADER ( Ichar itext_ichar_fmt (const Ibyte *ptr, Internal_Format fmt, - Lisp_Object object) + Lisp_Object UNUSED (object)) ) { switch (fmt) @@ -863,7 +866,7 @@ DECLARE_INLINE_HEADER ( Ichar itext_ichar_ascii_fmt (const Ibyte *ptr, Internal_Format fmt, - Lisp_Object object) + Lisp_Object UNUSED (object)) ) { switch (fmt) @@ -929,7 +932,7 @@ DECLARE_INLINE_HEADER ( Bytecount set_itext_ichar_fmt (Ibyte *ptr, Ichar x, Internal_Format fmt, - Lisp_Object object) + Lisp_Object UNUSED (object)) ) { switch (fmt) @@ -1120,7 +1123,8 @@ /* Convert a byte index into a string into a char index. */ DECLARE_INLINE_HEADER ( Charcount -string_index_byte_to_char (Lisp_Object s, Bytecount idx) +string_index_byte_to_char (Lisp_Object USED_IF_MULE_OR_CHECK_TEXT (s), + Bytecount idx) ) { Charcount retval; @@ -1147,7 +1151,8 @@ /* Convert a char index into a string into a byte index. */ DECLARE_INLINE_HEADER ( Bytecount -string_index_char_to_byte (Lisp_Object s, Charcount idx) +string_index_char_to_byte (Lisp_Object USED_IF_MULE_OR_CHECK_TEXT (s), + Charcount idx) ) { Bytecount retval; @@ -1174,7 +1179,9 @@ chars. */ DECLARE_INLINE_HEADER ( Charcount -string_offset_byte_to_char_len (Lisp_Object s, Bytecount off, Bytecount len) +string_offset_byte_to_char_len (Lisp_Object USED_IF_MULE_OR_CHECK_TEXT (s), + Bytecount USED_IF_MULE_OR_CHECK_TEXT (off), + Bytecount len) ) { Charcount retval; @@ -1203,7 +1210,9 @@ bytes. */ DECLARE_INLINE_HEADER ( Bytecount -string_offset_char_to_byte_len (Lisp_Object s, Bytecount off, Charcount len) +string_offset_char_to_byte_len (Lisp_Object USED_IF_MULE_OR_CHECK_TEXT (s), + Bytecount USED_IF_MULE_OR_CHECK_TEXT (off), + Charcount len) ) { Bytecount retval; diff --text -u 'xemacs-21.5.17/src/toolbar-common.c' 'xemacs-21.5.18/src/toolbar-common.c' Index: ./src/toolbar-common.c --- ./src/toolbar-common.c Sun Jul 7 06:05:55 2002 +++ ./src/toolbar-common.c Thu Aug 12 23:51:35 2004 @@ -167,7 +167,7 @@ int shadow_thickness = 2; int x_adj, y_adj, width_adj, height_adj; struct device *d = XDEVICE (f->device); - Lisp_Object instance, frame, window, glyph; + Lisp_Object instance, window, glyph; struct toolbar_button *tb = XTOOLBAR_BUTTON (button); struct Lisp_Image_Instance *p; struct window *w; @@ -190,7 +190,6 @@ height_adj = - 2 * border_width; } - frame = wrap_frame (f); window = FRAME_LAST_NONMINIBUF_WINDOW (f); w = XWINDOW (window); diff --text -u 'xemacs-21.5.17/src/toolbar-gtk.c' 'xemacs-21.5.18/src/toolbar-gtk.c' Index: ./src/toolbar-gtk.c --- ./src/toolbar-gtk.c Sun Jul 7 06:05:56 2002 +++ ./src/toolbar-gtk.c Tue Sep 21 04:20:03 2004 @@ -44,14 +44,14 @@ static void -gtk_initialize_frame_toolbars (struct frame *f) +gtk_initialize_frame_toolbars (struct frame *UNUSED (f)) { } /* This only calls one function but we go ahead and create this in case we ever do decide that we need to do more work. */ static void -gtk_free_frame_toolbars (struct frame *f) +gtk_free_frame_toolbars (struct frame *UNUSED (f)) { } diff --text -u 'xemacs-21.5.17/src/toolbar-msw.c' 'xemacs-21.5.18/src/toolbar-msw.c' Index: ./src/toolbar-msw.c --- ./src/toolbar-msw.c Wed Oct 1 00:27:00 2003 +++ ./src/toolbar-msw.c Tue Sep 21 04:20:03 2004 @@ -84,7 +84,7 @@ static int allocate_toolbar_item_id (struct frame *f, struct toolbar_button *button, - enum toolbar_pos pos) + enum toolbar_pos UNUSED (pos)) { /* hmm what do we generate an id based on */ int id = TOOLBAR_ITEM_ID_BITS (internal_hash (button->callback, 0)); @@ -98,7 +98,7 @@ static void mswindows_clear_toolbar (struct frame *f, enum toolbar_pos pos, - int thickness_change) + int UNUSED (thickness_change)) { HIMAGELIST ilist = NULL; int i; @@ -513,8 +513,9 @@ } static void -mswindows_redraw_exposed_toolbars (struct frame *f, int x, int y, int width, - int height) +mswindows_redraw_exposed_toolbars (struct frame *f, + int UNUSED (x), int UNUSED (y), + int UNUSED (width), int UNUSED (height)) { assert (FRAME_MSWINDOWS_P (f)); @@ -539,7 +540,7 @@ } static void -mswindows_initialize_frame_toolbars (struct frame *f) +mswindows_initialize_frame_toolbars (struct frame *UNUSED (f)) { } @@ -616,7 +617,8 @@ * command if we return nil */ Lisp_Object -mswindows_handle_toolbar_wm_command (struct frame *f, HWND ctrl, WORD id) +mswindows_handle_toolbar_wm_command (struct frame *f, HWND UNUSED (ctrl), + WORD id) { /* Try to map the command id through the proper hash table */ Lisp_Object button, data, fn, arg, frame; diff --text -u 'xemacs-21.5.17/src/toolbar-x.c' 'xemacs-21.5.18/src/toolbar-x.c' Index: ./src/toolbar-x.c --- ./src/toolbar-x.c Sun Jul 7 06:05:57 2002 +++ ./src/toolbar-x.c Tue Sep 21 04:20:03 2004 @@ -65,7 +65,7 @@ /* This only calls one function but we go ahead and create this in case we ever do decide that we need to do more work. */ static void -x_free_frame_toolbars (struct frame *f) +x_free_frame_toolbars (struct frame *UNUSED (unused)) { } diff --text -u 'xemacs-21.5.17/src/toolbar.c' 'xemacs-21.5.18/src/toolbar.c' Index: ./src/toolbar.c --- ./src/toolbar.c Fri Jul 4 16:16:26 2003 +++ ./src/toolbar.c Tue Sep 21 04:20:03 2004 @@ -1192,7 +1192,8 @@ } static void -toolbar_after_change (Lisp_Object specifier, Lisp_Object locale) +toolbar_after_change (Lisp_Object UNUSED (specifier), + Lisp_Object UNUSED (locale)) { /* #### This is overkill. I really need to rethink the after-change functions to make them easier to use. */ @@ -1223,8 +1224,9 @@ } static void -toolbar_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +toolbar_specs_changed (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { /* This could be smarter but I doubt that it would make any noticeable difference given the infrequency with which this is @@ -1234,69 +1236,74 @@ } static void -default_toolbar_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +default_toolbar_specs_changed (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vtoolbar); } static void -default_toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) +default_toolbar_size_changed_in_frame (Lisp_Object UNUSED (specifier), + struct frame *UNUSED (f), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vtoolbar_size); } static void -default_toolbar_border_width_changed_in_frame (Lisp_Object specifier, - struct frame *f, - Lisp_Object oldval) +default_toolbar_border_width_changed_in_frame (Lisp_Object UNUSED (specifier), + struct frame *UNUSED (f), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vtoolbar_border_width); } static void -default_toolbar_visible_p_changed_in_frame (Lisp_Object specifier, - struct frame *f, - Lisp_Object oldval) +default_toolbar_visible_p_changed_in_frame (Lisp_Object UNUSED (specifier), + struct frame *UNUSED (f), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vtoolbar_visible_p); } static void -toolbar_geometry_changed_in_window (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +toolbar_geometry_changed_in_window (Lisp_Object UNUSED (specifier), + struct window *w, + Lisp_Object UNUSED (oldval)) { MARK_TOOLBAR_CHANGED; MARK_WINDOWS_CHANGED (w); } static void -default_toolbar_size_changed_in_window (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +default_toolbar_size_changed_in_window (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vtoolbar_size); } static void -default_toolbar_border_width_changed_in_window (Lisp_Object specifier, - struct window *w, - Lisp_Object oldval) +default_toolbar_border_width_changed_in_window (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vtoolbar_border_width); } static void -default_toolbar_visible_p_changed_in_window (Lisp_Object specifier, - struct window *w, - Lisp_Object oldval) +default_toolbar_visible_p_changed_in_window (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { recompute_overlaying_specifier (Vtoolbar_visible_p); } static void -toolbar_buttons_captioned_p_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +toolbar_buttons_captioned_p_changed (Lisp_Object UNUSED (specifier), + struct window *UNUSED (w), + Lisp_Object UNUSED (oldval)) { /* This could be smarter but I doubt that it would make any noticeable difference given the infrequency with which this is @@ -1305,8 +1312,9 @@ } static void -toolbar_shadows_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +toolbar_shadows_changed (Lisp_Object UNUSED (specifier), + struct window *w, + Lisp_Object UNUSED (oldval)) { struct frame *f = XFRAME (w->frame); diff --text -u 'xemacs-21.5.17/src/tooltalk.c' 'xemacs-21.5.18/src/tooltalk.c' Index: ./src/tooltalk.c --- ./src/tooltalk.c Sun Jan 12 20:08:22 2003 +++ ./src/tooltalk.c Tue Sep 21 04:20:04 2004 @@ -167,7 +167,7 @@ static void print_tooltalk_message (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { Lisp_Tooltalk_Message *p = XTOOLTALK_MESSAGE (obj); @@ -245,7 +245,7 @@ static void print_tooltalk_pattern (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag) + int UNUSED (escapeflag)) { Lisp_Tooltalk_Pattern *p = XTOOLTALK_PATTERN (obj); @@ -323,7 +323,7 @@ Run tt_message_receive(). This function is the process handler for the ToolTalk connection process. */ - (ignore1, ignore2)) + (UNUSED (ignore1), UNUSED (ignore2))) { /* This function can GC */ Tt_message mess = tt_message_receive (); diff --text -u 'xemacs-21.5.17/src/ui-byhand.c' 'xemacs-21.5.18/src/ui-byhand.c' Index: ./src/ui-byhand.c --- ./src/ui-byhand.c Thu May 23 20:46:35 2002 +++ ./src/ui-byhand.c Tue Sep 21 04:20:04 2004 @@ -468,7 +468,7 @@ } static void -__generic_toolbar_callback (GtkWidget *item, gpointer user_data) +__generic_toolbar_callback (GtkWidget *UNUSED (item), gpointer user_data) { Lisp_Object callback; Lisp_Object lisp_user_data; @@ -527,9 +527,9 @@ { w = (NILP (prepend_p) ? gtk_toolbar_append_item : gtk_toolbar_prepend_item) (GTK_TOOLBAR (XGTK_OBJECT (toolbar)->object), - XSTRING_DATA (text), - XSTRING_DATA (tooltip_text), - XSTRING_DATA (tooltip_private_text), + (char*) XSTRING_DATA (text), + (char*) XSTRING_DATA (tooltip_text), + (char*) XSTRING_DATA (tooltip_private_text), GTK_WIDGET (XGTK_OBJECT (icon)->object), GTK_SIGNAL_FUNC (__generic_toolbar_callback), LISP_TO_VOID (callback)); @@ -537,9 +537,9 @@ else { w = gtk_toolbar_insert_item (GTK_TOOLBAR (XGTK_OBJECT (toolbar)->object), - XSTRING_DATA (text), - XSTRING_DATA (tooltip_text), - XSTRING_DATA (tooltip_private_text), + (char*) XSTRING_DATA (text), + (char*) XSTRING_DATA (tooltip_text), + (char*) XSTRING_DATA (tooltip_private_text), GTK_WIDGET (XGTK_OBJECT (icon)->object), GTK_SIGNAL_FUNC (__generic_toolbar_callback), LISP_TO_VOID (callback), diff --text -u 'xemacs-21.5.17/src/ui-gtk.c' 'xemacs-21.5.18/src/ui-gtk.c' Index: ./src/ui-gtk.c --- ./src/ui-gtk.c Tue Jan 27 22:13:45 2004 +++ ./src/ui-gtk.c Tue Sep 21 04:20:04 2004 @@ -11,7 +11,7 @@ #include "lisp.h" #include "buffer.h" -#include "console-gtk.h" +#include "console-gtk-impl.h" #include "device.h" #include "elhash.h" #include "event-gtk.h" @@ -27,6 +27,9 @@ /* XEmacs specific GTK types */ #include "gtk-glue.c" +/* Is the fundamental type of 't' the xemacs defined fundamental type 'type'? */ +#define IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t,type) (((GtkType) GTK_FUNDAMENTAL_TYPE(t)) == (type)) + Lisp_Object Qemacs_ffip; Lisp_Object Qemacs_gtk_objectp; Lisp_Object Qemacs_gtk_boxedp; @@ -53,9 +56,11 @@ { if (!dll_cache) { + static char text[] = "---XEmacs Internal Handle---"; + dll_cache = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (dll_cache, "---XEmacs Internal Handle---", dll_open (Qnil)); + g_hash_table_insert (dll_cache, text, dll_open (Qnil)); } } @@ -85,12 +90,11 @@ if (h) { - g_hash_table_insert (dll_cache, g_strdup (XSTRING_DATA (dll)), h); + g_hash_table_insert (dll_cache, qxestrdup (XSTRING_DATA (dll)), h); } else { - signal_error (Qfile_error, - "dll_open error", build_string (dll_error ())); + signal_error (Qfile_error, "dll_open error", dll_error()); } } return (h ? Qt : Qnil); @@ -314,7 +318,8 @@ } static void -ffi_object_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +ffi_object_printer (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { if (print_readably) printing_unreadable_object ("#<ffi %p>", XFFI (obj)->function_ptr); @@ -331,17 +336,25 @@ 0, 0, 0, ffi_data_description, emacs_ffi_data); -typedef GtkObject * (*__OBJECT_fn) (); -typedef gint (*__INT_fn) (); -typedef void (*__NONE_fn) (); -typedef gchar * (*__STRING_fn) (); -typedef gboolean (*__BOOL_fn) (); -typedef gfloat (*__FLOAT_fn) (); -typedef void * (*__POINTER_fn) (); -typedef GList * (*__LIST_fn) (); +#if defined (__cplusplus) +#define MANY_ARGS ... +#else +#define MANY_ARGS +#endif + +typedef void (*pfv)(); +typedef GtkObject * (*__OBJECT_fn) (MANY_ARGS); +typedef gint (*__INT_fn) (MANY_ARGS); +typedef void (*__NONE_fn) (MANY_ARGS); +typedef gchar * (*__STRING_fn) (MANY_ARGS); +typedef gboolean (*__BOOL_fn) (MANY_ARGS); +typedef gfloat (*__FLOAT_fn) (MANY_ARGS); +typedef void * (*__POINTER_fn) (MANY_ARGS); +typedef GList * (*__LIST_fn) (MANY_ARGS); /* An auto-generated file of marshalling functions. */ #include "emacs-marshals.c" +#undef MANY_ARGS #define CONVERT_SINGLE_TYPE(var,nam,tp) case GTK_TYPE_##nam: GTK_VALUE_##nam (var) = * (tp *) v; break; #define CONVERT_RETVAL(a,freep) \ @@ -424,7 +437,7 @@ break; default: - if (GTK_FUNDAMENTAL_TYPE (t) == GTK_TYPE_LISTOF) + if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_LISTOF)) { s = (sizeof (void *)); } @@ -478,29 +491,30 @@ new fundamental type that is not fixed at compile time. *sigh* */ - if (GTK_FUNDAMENTAL_TYPE (t) == GTK_TYPE_ARRAY) + if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_ARRAY)) return (build_string ("ARRAY")); - if (GTK_FUNDAMENTAL_TYPE (t) == GTK_TYPE_LISTOF) + if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_LISTOF)) return (build_string ("LIST")); return (Qnil); } } struct __dll_mapper_closure { - void * (*func) (dll_handle, const char *); - const char *obj_name; + void * (*func) (dll_handle, const CIbyte *); + Ibyte *obj_name; void **storage; }; -static void __dll_mapper (gpointer key, gpointer value, gpointer user_data) +static void __dll_mapper (gpointer UNUSED (key), gpointer value, + gpointer user_data) { struct __dll_mapper_closure *closure = (struct __dll_mapper_closure *) user_data; if (*(closure->storage) == NULL) { /* Need to see if it is in this one */ - *(closure->storage) = closure->func ((dll_handle) value, closure->obj_name); + *(closure->storage) = closure->func ((dll_handle) value, (CIbyte*) closure->obj_name); } } @@ -657,7 +671,7 @@ data->n_args = n_args; data->function_name = name; - data->function_ptr = name_func; + data->function_ptr = (dll_func) name_func; data->marshal = marshaller_func; rval = wrap_emacs_ffi (data); @@ -756,11 +770,11 @@ int i; for (i = 0; i < n_args; i++) { - if (GTK_FUNDAMENTAL_TYPE (the_args[i].type) == GTK_TYPE_ARRAY) + if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(the_args[i].type, GTK_TYPE_ARRAY)) { g_free (GTK_VALUE_POINTER (the_args[i])); } - else if (GTK_FUNDAMENTAL_TYPE (the_args[i].type) == GTK_TYPE_LISTOF) + else if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(the_args[i].type, GTK_TYPE_LISTOF)) { /* g_list_free (GTK_VALUE_POINTER (the_args[i])); */ } @@ -774,7 +788,8 @@ /* GtkObject wrapping for Lisp */ static void -emacs_gtk_object_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +emacs_gtk_object_printer (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { if (print_readably) printing_unreadable_object ("#<GtkObject %p>", XGTK_OBJECT (obj)->object); @@ -957,7 +972,7 @@ lisp_to_gtk_type() routine to defend against passing dead objects to GTK routines. */ static void -__notice_object_destruction (GtkObject *obj, gpointer user_data) +__notice_object_destruction (GtkObject *UNUSED (obj), gpointer user_data) { ungcpro_popup_callbacks ((GUI_ID) user_data); } @@ -968,7 +983,7 @@ emacs_gtk_object_data *data = NULL; GUI_ID id = 0; - id = (GUI_ID) gtk_object_get_data (obj, "xemacs::gui_id"); + id = (GUI_ID) gtk_object_get_data (obj, GTK_DATA_GUI_IDENTIFIER); if (id) { @@ -984,7 +999,7 @@ retval = wrap_emacs_gtk_object (data); id = new_gui_id (); - gtk_object_set_data (obj, "xemacs::gui_id", (gpointer) id); + gtk_object_set_data (obj, GTK_DATA_GUI_IDENTIFIER, (gpointer) id); gcpro_popup_callbacks (id, retval); gtk_object_ref (obj); gtk_signal_connect (obj, "destroy", GTK_SIGNAL_FUNC (__notice_object_destruction), (gpointer)id); @@ -1092,7 +1107,8 @@ }; static void -emacs_gtk_boxed_printer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +emacs_gtk_boxed_printer (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { if (print_readably) printing_unreadable_object ("#<GtkBoxed %p>", XGTK_BOXED (obj)->object); @@ -1103,7 +1119,7 @@ } static int -emacs_gtk_boxed_equality (Lisp_Object o1, Lisp_Object o2, int depth) +emacs_gtk_boxed_equality (Lisp_Object o1, Lisp_Object o2, int UNUSED (depth)) { emacs_gtk_boxed_data *data1 = XGTK_BOXED(o1); emacs_gtk_boxed_data *data2 = XGTK_BOXED(o2); @@ -1113,7 +1129,7 @@ } static unsigned long -emacs_gtk_boxed_hash (Lisp_Object obj, int depth) +emacs_gtk_boxed_hash (Lisp_Object obj, int UNUSED (depth)) { emacs_gtk_boxed_data *data = XGTK_BOXED(obj); return (HASH2 ((unsigned long)data->object, data->object_type)); @@ -1237,7 +1253,7 @@ if (STRINGP (type)) { - t = gtk_type_from_name (XSTRING_DATA (type)); + t = gtk_type_from_name ((gchar*) XSTRING_DATA (type)); if (t == GTK_TYPE_INVALID) { invalid_argument ("Not a GTK type", type); @@ -1518,7 +1534,7 @@ } default: - if (GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_LISTOF) + if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, GTK_TYPE_LISTOF)) { if (!GTK_VALUE_POINTER (*arg)) return (Qnil); @@ -1779,7 +1795,7 @@ break; default: - if (GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_ARRAY) + if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, GTK_TYPE_ARRAY)) { if (NILP (obj)) GTK_VALUE_POINTER(*arg) = NULL; @@ -1788,7 +1804,7 @@ xemacs_list_to_array (obj, arg); } } - else if (GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_LISTOF) + else if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, GTK_TYPE_LISTOF)) { if (NILP (obj)) GTK_VALUE_POINTER(*arg) = NULL; @@ -2059,7 +2075,7 @@ break; default: - if (GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_ARRAY) + if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, GTK_TYPE_ARRAY)) { if (NILP (obj)) *(GTK_RETLOC_POINTER(*arg)) = NULL; @@ -2068,7 +2084,7 @@ xemacs_list_to_array (obj, arg); } } - else if (GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_LISTOF) + else if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, GTK_TYPE_LISTOF)) { if (NILP (obj)) *(GTK_RETLOC_POINTER(*arg)) = NULL; diff --text -u 'xemacs-21.5.17/src/undo.c' 'xemacs-21.5.18/src/undo.c' Index: ./src/undo.c --- ./src/undo.c Tue May 28 17:45:05 2002 +++ ./src/undo.c Wed Sep 22 11:06:52 2004 @@ -423,7 +423,7 @@ #ifdef CLASH_DETECTION Funlock_buffer (); #endif /* CLASH_DETECTION */ - /* may GC under ENERGIZE: */ + /* #### need to check if this can GC */ Fset_buffer_modified_p (Qnil, Qnil); } else if (EXTENTP (car)) diff --text -u 'xemacs-21.5.17/src/unexaix.c' 'xemacs-21.5.18/src/unexaix.c' Index: ./src/unexaix.c --- ./src/unexaix.c Wed Mar 13 17:53:02 2002 +++ ./src/unexaix.c Tue Sep 21 04:20:04 2004 @@ -197,7 +197,7 @@ static int make_hdr (int new, int a_out, unsigned data_start, unsigned bss_start, - unsigned entry_address, + unsigned UNUSED (entry_address), char *a_name, char *new_name) { int scns; @@ -535,7 +535,7 @@ } static int -adjust_lnnoptrs (int writedesc, int readdesc, char *new_name) +adjust_lnnoptrs (int UNUSED (writedesc), int UNUSED (readdesc), char *new_name) { int nsyms; int naux; diff --text -u 'xemacs-21.5.17/src/unexalpha.c' 'xemacs-21.5.18/src/unexalpha.c' Index: ./src/unexalpha.c --- ./src/unexalpha.c Sun Jun 10 19:42:34 2001 +++ ./src/unexalpha.c Tue Sep 21 04:20:05 2004 @@ -37,6 +37,7 @@ #include <aouthdr.h> #include <scnhdr.h> #include <syms.h> +#include "compiler.h" static void fatal_unexec (char *, char *); static void mark_x (char *); @@ -92,7 +93,7 @@ int unexec (char *new_name, char *a_name, unsigned long data_start, - unsigned long bss_start, + unsigned long UNUSED (bss_start), unsigned long entry_address) { int new, old; diff --text -u 'xemacs-21.5.17/src/unexconvex.c' 'xemacs-21.5.18/src/unexconvex.c' Index: ./src/unexconvex.c --- ./src/unexconvex.c Mon Aug 13 13:46:42 2001 +++ ./src/unexconvex.c Tue Sep 21 04:20:05 2004 @@ -180,6 +180,8 @@ #include <machine/scnhdr.h> #include <machine/pte.h> +#include "compiler.h" + static long block_copy_start; /* Old executable start point */ static struct filehdr f_hdr; /* File header */ static struct opthdr f_ohdr; /* Optional file header (a.out) */ @@ -266,7 +268,8 @@ static int make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) int new, a_out; - unsigned data_start, bss_start, entry_address; + unsigned data_start, bss_start; + unsigned UNUSED (entry_address); char *a_name; char *new_name; { diff --text -u 'xemacs-21.5.17/src/unexcw.c' 'xemacs-21.5.18/src/unexcw.c' Index: ./src/unexcw.c --- ./src/unexcw.c Tue Sep 16 06:19:17 2003 +++ ./src/unexcw.c Tue Sep 21 04:20:05 2004 @@ -97,8 +97,8 @@ /* Dump out .data and .bss sections into a new executable. */ int -unexec (char *out_name, char *in_name, uintptr_t start_data, - uintptr_t d1, uintptr_t d2) +unexec (char *out_name, char *in_name, uintptr_t UNUSED (start_data), + uintptr_t UNUSED (d1), uintptr_t UNUSED (d2)) { /* ugly nt hack - should be in lisp */ int a_new, a_out = -1; diff --text -u 'xemacs-21.5.17/src/unexec.c' 'xemacs-21.5.18/src/unexec.c' Index: ./src/unexec.c --- ./src/unexec.c Sat Mar 1 16:25:36 2003 +++ ./src/unexec.c Tue Sep 21 04:20:05 2004 @@ -220,6 +220,8 @@ #include <fcntl.h> #endif +#include "compiler.h" + #ifndef O_RDONLY #define O_RDONLY 0 #endif @@ -227,7 +229,6 @@ #define O_RDWR 2 #endif - extern char *start_of_text (); /* Start of text */ extern void *start_of_data (); /* Start of initialized data */ @@ -812,7 +813,13 @@ * Copy the text and data segments from memory to the new a.out */ static int -copy_text_and_data (int new, int a_out) +copy_text_and_data (int new, +#if defined (COFF) && defined (USG_SHARED_LIBRARIES) + int a_out +#else + int UNUSED (a_out) +#endif + ) { char *end; char *ptr; @@ -1154,8 +1161,8 @@ int adjust_lnnoptrs (writedesc, readdesc, new_name) - int writedesc; - int readdesc; + int UNUSED (writedesc); + int UNUSED (readdesc); char *new_name; { int nsyms; diff --text -u 'xemacs-21.5.17/src/unexelf.c' 'xemacs-21.5.18/src/unexelf.c' Index: ./src/unexelf.c --- ./src/unexelf.c Fri Apr 13 03:24:27 2001 +++ ./src/unexelf.c Tue Sep 21 04:20:05 2004 @@ -436,6 +436,8 @@ #include <sym.h> /* for HDRR declaration */ #endif /* __sgi */ +#include "compiler.h" + #if defined (__alpha__) && !defined (__NetBSD__) && !defined (__OpenBSD__) /* Declare COFF debugging symbol table. This used to be in /usr/include/sym.h, but this file is no longer included in Red Hat @@ -556,8 +558,8 @@ void unexec (char *new_name, char *old_name, unsigned int data_start, unsigned int bss_start, unsigned int entry_address); void -unexec (char *new_name, char *old_name, unsigned int data_start, - unsigned int bss_start, unsigned int entry_address) +unexec (char *new_name, char *old_name, unsigned int UNUSED (data_start), + unsigned int UNUSED (bss_start), unsigned int UNUSED (entry_address)) { int new_file, old_file, new_file_size; diff --text -u 'xemacs-21.5.17/src/unexelfsgi.c' 'xemacs-21.5.18/src/unexelfsgi.c' Index: ./src/unexelfsgi.c --- ./src/unexelfsgi.c Sun Jun 10 19:42:34 2001 +++ ./src/unexelfsgi.c Tue Sep 21 04:20:05 2004 @@ -100,6 +100,8 @@ # include <link.h> /* get ElfW etc */ #endif +#include "compiler.h" + #ifndef ElfW # ifdef __STDC__ # define ElfBitsW(bits, type) Elf##bits##_##type @@ -197,9 +199,9 @@ void unexec (char *new_name, char *old_name, - uintptr_t data_start, - uintptr_t bss_start, - uintptr_t entry_address) + uintptr_t UNUSED (data_start), + uintptr_t UNUSED (bss_start), + uintptr_t UNUSED (entry_address)) { int old_file; diff --text -u 'xemacs-21.5.17/src/unexencap.c' 'xemacs-21.5.18/src/unexencap.c' Index: ./src/unexencap.c --- ./src/unexencap.c Thu Dec 19 07:44:05 1996 +++ ./src/unexencap.c Tue Sep 21 04:20:06 2004 @@ -15,6 +15,7 @@ #include <sys/file.h> #include <stdio.h> #include "/usr/gnu/lib/gcc/gcc-include/a.out.h" +#include "compiler.h" filecpy(to, from, n) FILE *to, *from; @@ -41,7 +42,9 @@ * ****************************************************************/ unexec (new_name, a_name, data_start, bss_start, entry_address) char *new_name, *a_name; -unsigned data_start, bss_start, entry_address; +unsigned UNUSED (data_start); +unsigned UNUSED (bss_start); +unsigned UNUSED (entry_address); { struct coffheader header1; struct coffscn *tp, *dp, *bp; diff --text -u 'xemacs-21.5.17/src/unexenix.c' 'xemacs-21.5.18/src/unexenix.c' Index: ./src/unexenix.c --- ./src/unexenix.c Thu Dec 19 07:44:05 1996 +++ ./src/unexenix.c Tue Sep 21 04:20:06 2004 @@ -44,6 +44,7 @@ #include <stdio.h> #include <varargs.h> #include <a.out.h> +#include "compiler.h" static void fatal_unexec (); @@ -72,14 +73,16 @@ /* Should check the magic number of the old executable; not yet written. */ check_exec (x) - struct xexec *x; + struct xexec *UNUSED (x); { } unexec (new_name, a_name, data_start, bss_start, entry_address) char *new_name, *a_name; - unsigned data_start, bss_start, entry_address; + unsigned UNUSED (data_start); + unsigned UNUSED (bss_start); + unsigned UNUSED (entry_address); { char *sbrk (), *datalim = sbrk (0), *data_org; long segpos, textseen, textpos, textlen, datapos, datadiff, datalen; diff --text -u 'xemacs-21.5.17/src/unexfreebsd.c' 'xemacs-21.5.18/src/unexfreebsd.c' Index: ./src/unexfreebsd.c --- ./src/unexfreebsd.c Tue May 28 17:45:05 2002 +++ ./src/unexfreebsd.c Tue Sep 21 04:20:06 2004 @@ -47,6 +47,7 @@ #include <stab.h> #include <sys/dir.h> #include <link.h> +#include "compiler.h" /********************** Macros *************************************/ @@ -492,8 +493,8 @@ static void *dynamic_addr = (void *) &_DYNAMIC; int -unexec (char *new_name, char *old_name, - unsigned int emacs_edata, unsigned int dummy1, unsigned int dummy2) +unexec (char *new_name, char *old_name, unsigned int UNUSED (emacs_edata), + unsigned int UNUSED (dummy1), unsigned int UNUSED (dummy2)) { /* ld.so data */ struct _dynamic *ld = 0; @@ -676,7 +677,7 @@ int -run_time_remap (char *dummy) +run_time_remap (char *UNUSED (dummy)) { unsigned long current_sbrk = (unsigned long) sbrk (0); diff --text -u 'xemacs-21.5.17/src/unexfx2800.c' 'xemacs-21.5.18/src/unexfx2800.c' Index: ./src/unexfx2800.c --- ./src/unexfx2800.c Thu Dec 19 07:44:07 1996 +++ ./src/unexfx2800.c Tue Sep 21 04:20:06 2004 @@ -20,10 +20,13 @@ /* Synched up with: FSF 19.31. */ #include <stdio.h> +#include "compiler.h" unexec (new_name, a_name, data_start, bss_start, entry_address) char *new_name, *a_name; - unsigned data_start, bss_start, entry_address; + unsigned UNUSED (data_start); + unsigned UNUSED (bss_start); + unsigned UNUSED (entry_address); { int stat; diff --text -u 'xemacs-21.5.17/src/unexhp9k3.c' 'xemacs-21.5.18/src/unexhp9k3.c' Index: ./src/unexhp9k3.c --- ./src/unexhp9k3.c Fri Aug 30 04:45:30 2002 +++ ./src/unexhp9k3.c Tue Sep 21 04:20:06 2004 @@ -51,6 +51,7 @@ #include <sys/dir.h> #include "sysdep.h" +#include "compiler.h" /* XEmacs: Richard Cognot <cognot@ensg.u-nancy.fr> says we need these */ extern void perror(const char*); @@ -274,8 +275,8 @@ static void *dynamic_addr = (void *) &_DYNAMIC; int -unexec (char *new_name, char *old_name, - unsigned int emacs_edata, unsigned int dummy1, unsigned int dummy2) +unexec (char *new_name, char *old_name, unsigned int emacs_edata, + unsigned int UNUSED (dummy1), unsigned int UNUSED (dummy2)) { /* /dld.sl data */ struct dynamic *ld = 0; @@ -506,7 +507,7 @@ int -run_time_remap (char *dummy) +run_time_remap (char *UNUSED (dummy)) { unsigned long current_sbrk = (unsigned long) sbrk (0); diff --text -u 'xemacs-21.5.17/src/unexhp9k800.c' 'xemacs-21.5.18/src/unexhp9k800.c' Index: ./src/unexhp9k800.c --- ./src/unexhp9k800.c Fri Apr 13 03:24:27 2001 +++ ./src/unexhp9k800.c Tue Sep 21 04:20:06 2004 @@ -101,8 +101,9 @@ int unexec (char *new_name, /* name of the new a.out file to be created */ char *old_name, /* name of the old a.out file */ - uintptr_t new_end_of_text, /* ptr to new edata/etext; NOT USED YET */ - uintptr_t dummy1, uintptr_t dummy2) /* not used by emacs */ + uintptr_t UNUSED (new_end_of_text), /* ptr to new edata/etext */ + uintptr_t UNUSED (dummy1), /* not used by emacs */ + uintptr_t UNUSED (dummy2)) { int old, new; int old_size, new_size; @@ -164,7 +165,7 @@ /* Save current data space in the file, update header. */ void -save_data_space (int file, struct header *hdr, +save_data_space (int file, struct header *UNUSED (hdr), struct som_exec_auxhdr *auxhdr, int size) { /* Write the entire data space out to the file */ @@ -358,7 +359,7 @@ /* run_time_remap is the magic called by startup code in the dumped executable if RUN_TIME_REMAP is set. */ int -run_time_remap (char *dummy) +run_time_remap (char *UNUSED (dummy)) { Restore_Shared_Data (); return 0; diff --text -u 'xemacs-21.5.17/src/unexmips.c' 'xemacs-21.5.18/src/unexmips.c' Index: ./src/unexmips.c --- ./src/unexmips.c Fri Apr 13 03:24:28 2001 +++ ./src/unexmips.c Tue Sep 21 04:20:06 2004 @@ -28,6 +28,7 @@ #include <stdio.h> #include <errno.h> #include <varargs.h> +#include "compiler.h" #ifdef MACH @@ -124,7 +125,9 @@ unexec (new_name, a_name, data_start, bss_start, entry_address) char *new_name, *a_name; - unsigned data_start, bss_start, entry_address; + unsigned data_start; + unsigned UNUSED (bss_start); + unsigned entry_address; { int new, old; int pagesize, brk; diff --text -u 'xemacs-21.5.17/src/unexnt.c' 'xemacs-21.5.18/src/unexnt.c' Index: ./src/unexnt.c --- ./src/unexnt.c Sun Jan 12 20:08:22 2003 +++ ./src/unexnt.c Tue Sep 21 04:20:06 2004 @@ -180,8 +180,8 @@ /* Dump out .data and .bss sections into a new executable. */ int -unexec (Ibyte *new_name, Ibyte *old_name, unsigned int start_data, - unsigned int start_bss, unsigned int entry_address) +unexec (Ibyte *new_name, Ibyte *old_name, unsigned int UNUSED (start_data), + unsigned int UNUSED (start_bss), unsigned int UNUSED (entry_address)) { file_data in_file, out_file; Ibyte *out_filename = alloca_ibytes (qxestrlen (new_name) + 10); @@ -479,7 +479,7 @@ } static void -dump_bss_and_heap (file_data *p_infile, file_data *p_outfile) +dump_bss_and_heap (file_data *UNUSED (p_infile), file_data *p_outfile) { UChar_Binary *heap_data; unsigned long size, index; diff --text -u 'xemacs-21.5.17/src/unexsni.c' 'xemacs-21.5.18/src/unexsni.c' Index: ./src/unexsni.c --- ./src/unexsni.c Wed Mar 13 17:53:03 2002 +++ ./src/unexsni.c Tue Sep 21 04:20:07 2004 @@ -306,6 +306,7 @@ #include <fcntl.h> #include <elf.h> #include <sys/mman.h> +#include "compiler.h" #ifndef emacs #define fatal(a, b, c) fprintf(stderr, a, b, c), exit(1) @@ -357,7 +358,9 @@ void unexec (new_name, old_name, data_start, bss_start, entry_address) char *new_name, *old_name; - unsigned data_start, bss_start, entry_address; + unsigned UNUSED (data_start); + unsigned UNUSED (bss_start); + unsigned UNUSED (entry_address); { extern unsigned int bss_end; int new_file, old_file, new_file_size; diff --text -u 'xemacs-21.5.17/src/unexsol2-6.c' 'xemacs-21.5.18/src/unexsol2-6.c' Index: ./src/unexsol2-6.c --- ./src/unexsol2-6.c Thu Dec 19 07:44:10 1996 +++ ./src/unexsol2-6.c Tue Sep 21 04:20:07 2004 @@ -23,12 +23,14 @@ #include <stdlib.h> #include <stdio.h> #include <dlfcn.h> +#include "compiler.h" int unexec (char *new_name, char *old_name, unsigned int data_start, unsigned int bss_start, unsigned int entry_address); int -unexec (char *new_name, char *old_name, unsigned int data_start, - unsigned int bss_start, unsigned int entry_address) +unexec (char *new_name, char *UNUSED (old_name), + unsigned int UNUSED (data_start), unsigned int UNUSED (bss_start), + unsigned int UNUSED (entry_address)) { if (dldump (0, new_name, RTLD_MEMORY) != 0) { diff --text -u 'xemacs-21.5.17/src/unexsol2.c' 'xemacs-21.5.18/src/unexsol2.c' Index: ./src/unexsol2.c Prereq: 1.3 --- ./src/unexsol2.c Mon Oct 13 12:35:33 1997 +++ ./src/unexsol2.c Tue Sep 21 04:20:07 2004 @@ -20,11 +20,12 @@ /* Synched up with: Not in FSF. */ -/* #pragma ident "@(#) $Id: unexsol2.c,v 1.3 1997/10/13 03:35:33 steve Exp $" */ +/* #pragma ident "@(#) $Id: unexsol2.c,v 1.4 2004/09/20 19:20:07 james Exp $" */ #include <stdlib.h> #include <stdio.h> #include <dlfcn.h> +#include "compiler.h" #define DYNODUMP_SO "../dynodump/dynodump.so" #define DYNODUMP_SYM "dynodump" @@ -32,8 +33,9 @@ int unexec (char *new_name, char *old_name, unsigned int data_start, unsigned int bss_start, unsigned int entry_address); int -unexec(char *new_name, char *old_name, unsigned int data_start, - unsigned int bss_start, unsigned int entry_address) +unexec(char *new_name, char *UNUSED (old_name), + unsigned int UNUSED (data_start), unsigned int UNUSED (bss_start), + unsigned int UNUSED (entry_address)) { void *handle; void (*func)(const char *file); diff --text -u 'xemacs-21.5.17/src/unexsunos4.c' 'xemacs-21.5.18/src/unexsunos4.c' Index: ./src/unexsunos4.c --- ./src/unexsunos4.c Tue May 28 17:45:05 2002 +++ ./src/unexsunos4.c Tue Sep 21 04:20:07 2004 @@ -51,6 +51,7 @@ #include <stab.h> #include <sys/dir.h> #include <link.h> +#include "compiler.h" /********************** Macros *************************************/ @@ -434,8 +435,8 @@ static void *dynamic_addr = (void *) &_DYNAMIC; int -unexec (char *new_name, char *old_name, - unsigned int emacs_edata, unsigned int dummy1, unsigned int dummy2) +unexec (char *new_name, char *old_name, unsigned int emacs_edata, + unsigned int UNUSED (dummy1), unsigned int UNUSED (dummy2)) { /* ld.so data */ struct link_dynamic *ld = 0; @@ -615,7 +616,7 @@ int -run_time_remap (char *dummy) +run_time_remap (char *UNUSED (dummy)) { long page_size = getpagesize(); unsigned long base_addr = MASK_UP (mprotect_bottom_addr, page_size); diff --text -u 'xemacs-21.5.17/src/unicode.c' 'xemacs-21.5.18/src/unicode.c' Index: ./src/unicode.c --- ./src/unicode.c Wed Jan 28 02:55:18 2004 +++ ./src/unicode.c Fri Oct 15 02:26:25 2004 @@ -1234,7 +1234,7 @@ present), this function simply does `int-to-char' and ignores the CHARSETS argument. */ - (code, charsets)) + (code, USED_IF_MULE (charsets))) { #ifdef MULE Lisp_Object_dynarr *dyn; @@ -1638,9 +1638,9 @@ } static void -encode_unicode_char (Lisp_Object charset, int h, int l, - unsigned_char_dynarr *dst, enum unicode_type type, - unsigned int little_endian) +encode_unicode_char (Lisp_Object USED_IF_MULE (charset), int h, + int USED_IF_MULE (l), unsigned_char_dynarr *dst, + enum unicode_type type, unsigned int little_endian) { #ifdef MULE int code = ichar_to_unicode (make_ichar (charset, h & 127, l & 127)); @@ -2298,7 +2298,8 @@ } static void -unicode_print (Lisp_Object cs, Lisp_Object printcharfun, int escapeflag) +unicode_print (Lisp_Object cs, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { write_fmt_string_lisp (printcharfun, "(%s", 1, unicode_getprop (cs, Qtype)); if (XCODING_SYSTEM_UNICODE_LITTLE_ENDIAN (cs)) @@ -2309,7 +2310,13 @@ } int -dfc_coding_system_is_unicode (Lisp_Object codesys) +dfc_coding_system_is_unicode ( +#ifdef WIN32_ANY + Lisp_Object codesys +#else + Lisp_Object UNUSED (codesys) +#endif + ) { #ifdef WIN32_ANY codesys = Fget_coding_system (codesys); diff --text -u 'xemacs-21.5.17/src/vm-limit.c' 'xemacs-21.5.18/src/vm-limit.c' Index: ./src/vm-limit.c --- ./src/vm-limit.c Fri Mar 29 13:48:47 2002 +++ ./src/vm-limit.c Tue Sep 21 04:20:07 2004 @@ -142,7 +142,13 @@ also declare where the end of pure storage is. */ void -memory_warnings (void *start, void (*warnfun) (const char *)) +memory_warnings (void *start, +#ifdef _NO_MALLOC_WARNING_ + void (*UNUSED_ARG (warnfun)) (const char *) ATTRIBUTE_UNUSED +#else + void (*warnfun) (const char *) +#endif + ) { #ifndef _NO_MALLOC_WARNING_ extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ diff --text -u 'xemacs-21.5.17/src/win32.c' 'xemacs-21.5.18/src/win32.c' Index: ./src/win32.c --- ./src/win32.c Wed Jun 5 18:57:32 2002 +++ ./src/win32.c Tue Sep 21 04:20:07 2004 @@ -466,11 +466,11 @@ } int -mswindows_sigpause (int nsig) +mswindows_sigpause (int UNUSED (nsig)) { /* This is currently not called, because the only call to sigpause inside XEmacs is with SIGCHLD parameter. Just in case, we put an - assert here, so anyone adds a call to sigpause will be surprised + assert here, so anyone who adds a call to sigpause will be surprised (or surprise someone else...) */ assert (0); return 0; @@ -541,8 +541,8 @@ MMRESULT tid_prof = 0; static void CALLBACK -setitimer_helper_proc (UINT uID, UINT uMsg, DWORD dwUser, - DWORD dw1, DWORD dw2) +setitimer_helper_proc (UINT UNUSED (uID), UINT UNUSED (uMsg), DWORD dwUser, + DWORD UNUSED (dw1), DWORD UNUSED (dw2)) { /* Just raise the signal indicated by the dwUser parameter */ mswindows_raise (dwUser); diff --text -u 'xemacs-21.5.17/src/window.c' 'xemacs-21.5.18/src/window.c' Index: ./src/window.c --- ./src/window.c Wed Oct 15 18:09:38 2003 +++ ./src/window.c Tue Sep 21 12:28:15 2004 @@ -61,6 +61,8 @@ #endif #endif +extern int allow_deletion_of_last_visible_frame; + EXFUN (Fnext_window, 4); static int window_pixel_width_to_char_width (struct window *w, @@ -263,7 +265,8 @@ } static void -print_window (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_window (Lisp_Object obj, Lisp_Object printcharfun, + int UNUSED (escapeflag)) { if (print_readably) printing_unreadable_object ("#<window 0x%x>", XWINDOW (obj)->header.uid); @@ -278,7 +281,7 @@ } static void -finalize_window (void *header, int for_disksave) +finalize_window (void *header, int UNUSED (for_disksave)) { struct window *w = (struct window *) header; @@ -958,7 +961,7 @@ /* Called from invalidate_vertical_divider_cache_in_frame */ int invalidate_vertical_divider_cache_in_window (struct window *w, - void *u_n_u_s_e_d) + void *UNUSED (unused)) { w->need_vertical_divider_valid_p = 0; return 0; @@ -1099,7 +1102,6 @@ static int margin_width_internal (struct window *w, int left_margin) { - struct buffer *b; int window_cwidth = window_char_width (w, 1); int margin_cwidth; int font_width; @@ -1114,7 +1116,6 @@ return 0; window = wrap_window (w); - b = XBUFFER (w->buffer); margin_cwidth = (left_margin ? XINT (w->left_margin_width) : XINT (w->right_margin_width)); @@ -2919,7 +2920,8 @@ of its own, kill the frame. */ if (EQ (w, FRAME_ROOT_WINDOW (f)) && !NILP (p->dedicated) - && other_visible_frames (f)) + && (allow_deletion_of_last_visible_frame + || other_visible_frames (f))) { /* Skip the other windows on this frame. There might be one, the minibuffer! */ @@ -3371,7 +3373,8 @@ if (!NILP (XWINDOW (window)->dedicated) && EQ (window, FRAME_ROOT_WINDOW (XFRAME (frame))) - && other_visible_frames (XFRAME (frame))) + && (allow_deletion_of_last_visible_frame + || other_visible_frames (XFRAME (frame)))) { delete_frame_internal (XFRAME (frame), 0, 0, 0); /* GC */ } @@ -5046,17 +5049,18 @@ static void -modeline_shadow_thickness_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +modeline_shadow_thickness_changed (Lisp_Object UNUSED (specifier), + struct window *w, + Lisp_Object UNUSED (oldval)) { w->shadow_thickness_changed = 1; MARK_WINDOWS_CHANGED (w); } static void -vertical_divider_changed_in_window (Lisp_Object specifier, +vertical_divider_changed_in_window (Lisp_Object UNUSED (specifier), struct window *w, - Lisp_Object oldval) + Lisp_Object UNUSED (oldval)) { MARK_WINDOWS_CHANGED (w); MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (XFRAME (WINDOW_FRAME (w))); @@ -5064,8 +5068,9 @@ /* also used in scrollbar.c */ void -some_window_value_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) +some_window_value_changed (Lisp_Object UNUSED (specifier), + struct window *w, + Lisp_Object UNUSED (oldval)) { MARK_WINDOWS_CHANGED (w); } @@ -5207,26 +5212,23 @@ return unbind_to_1 (speccount, Fprogn (args)); } -DEFUN ("current-pixel-column", Fcurrent_pixel_column, 0, 2, 0, /* -Return the horizontal pixel position of POS in window. -Beginning of line is column 0. This is calculated using the redisplay -display tables. If WINDOW is nil, the current window is assumed. -If POS is nil, point is assumed. Note that POS must be visible for -a non-nil result to be returned. -*/ - (window, pos)) +static int +get_current_pixel_pos (Lisp_Object window, Lisp_Object pos, + struct window **w, + struct rune **rb, struct display_line **dl) { - struct window* w = decode_window (window); - display_line_dynarr *dla = window_display_lines (w, CURRENT_DISP); - - struct display_line *dl = 0; - struct display_block *db = 0; - struct rune* rb = 0; - int y = w->last_point_y[CURRENT_DISP]; - int x = w->last_point_x[CURRENT_DISP]; + display_line_dynarr *dla; + struct display_block *db = NULL; + int x, y; - if (MINI_WINDOW_P (w)) - return Qnil; + *rb = NULL; + *dl = NULL; + *w = decode_window (window); + dla = window_display_lines (*w, CURRENT_DISP); + x = (*w)->last_point_x[CURRENT_DISP]; + y = (*w)->last_point_y[CURRENT_DISP]; + if (MINI_WINDOW_P (*w)) + return 0; if (y<0 || x<0 || y >= Dynarr_length (dla) || !NILP (pos)) { @@ -5246,39 +5248,85 @@ for (i = first_line; i < Dynarr_length (dla); i++) { - dl = Dynarr_atp (dla, i); + *dl = Dynarr_atp (dla, i); /* find the vertical location first */ - if (point >= dl->charpos && point <= dl->end_charpos) + if (point >= (*dl)->charpos && point <= (*dl)->end_charpos) { - db = get_display_block_from_line (dl, TEXT); + db = get_display_block_from_line (*dl, TEXT); for (i = 0; i < Dynarr_length (db->runes); i++) { - rb = Dynarr_atp (db->runes, i); - if (point <= rb->charpos) + *rb = Dynarr_atp (db->runes, i); + if (point <= (*rb)->charpos) goto found_charpos; } - return Qnil; + return 0; } } - return Qnil; + return 0; found_charpos: ; } else { /* optimized case */ - dl = Dynarr_atp (dla, y); - db = get_display_block_from_line (dl, TEXT); + *dl = Dynarr_atp (dla, y); + db = get_display_block_from_line (*dl, TEXT); if (x >= Dynarr_length (db->runes)) - return Qnil; + return 0; - rb = Dynarr_atp (db->runes, x); + *rb = Dynarr_atp (db->runes, x); } + return 1; +} + +DEFUN ("current-pixel-column", Fcurrent_pixel_column, 0, 2, 0, /* +Return the horizontal pixel position of point POS in window. +Beginning of line is column 0. If WINDOW is nil, the current window +is assumed. If POS is nil, point is assumed. Note that POS must be +visible for a non-nil result to be returned. This is calculated using +the redisplay display tables; because of this, the returned value will +only be correct if the redisplay tables are up-to-date. Use +\"(sit-for 0)\" to insure that they are; however, if WINDOW is part of +a new frame, use the following instead: + (while (not (frame-visible-p frame)) (sleep-for .5)) +*/ + (window, pos)) +{ + struct window* w; + struct display_line *dl; + struct rune* rb; + + if (!get_current_pixel_pos(window, pos, &w, &rb, &dl)) + return Qnil; + return make_int (rb->xpos - WINDOW_LEFT (w)); } +DEFUN ("current-pixel-row", Fcurrent_pixel_row, 0, 2, 0, /* +Return the vertical pixel position of point POS in window. Top of +window is row 0. If WINDOW is nil, the current window is assumed. If +POS is nil, point is assumed. Note that POS must be visible for a +non-nil result to be returned. This is calculated using the redisplay +display tables; because of this, the returned value will only be +correct if the redisplay tables are up-to-date. Use \"(sit-for 0)\" +to insure that they are; however, if WINDOW is part of a new frame, +use the following instead: + (while (not (frame-visible-p frame)) (sleep-for .5)) +*/ + (window, pos)) +{ + struct window* w; + struct display_line *dl; + struct rune* rb; + + if (!get_current_pixel_pos(window, pos, &w, &rb, &dl)) + return Qnil; + + return make_int (dl->ypos - dl->ascent - WINDOW_TOP (w)); +} + #ifdef DEBUG_XEMACS /* This is short and simple in elisp, but... it was written to debug @@ -5426,6 +5474,7 @@ #endif DEFSUBR (Fsave_window_excursion); DEFSUBR (Fcurrent_pixel_column); + DEFSUBR (Fcurrent_pixel_row); } void diff --text -u 'xemacs-21.5.17/tests/ChangeLog' 'xemacs-21.5.18/tests/ChangeLog' Index: ./tests/ChangeLog --- ./tests/ChangeLog Mon Mar 22 18:25:04 2004 +++ ./tests/ChangeLog Fri Oct 22 14:10:31 2004 @@ -1,3 +1,56 @@ +2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> + + * XEmacs 21.5.18 "chestnut" is released. + +2004-10-07 Stephen J. Turnbull <stephen@xemacs.org> + + * automated/regexp-tests.el: Add tests for bug identified by + Steve Youngs 2004-09-30 <microsoft-free.87ekkjhj7t.fsf@youngs.au.com> + +2004-09-08 Stephen J. Turnbull <stephen@xemacs.org> + + * automated/regexp-tests.el: Add tests for bug identified by + Katsumi Yamaoka 2004-09-03 <b9ywtzbbpue.fsf_-_@jpl.org>. + +2004-05-14 Stephen J. Turnbull <stephen@xemacs.org> + + * automated/tag-tests.el (first form): Put non-ASCII chars back. + +2004-05-13 Jerry James <james@xemacs.org> + + * automated/lisp-tests:el: Another test fix because + (eq most-negative-fixnum (- most-negative-fixnum)). + +2004-05-11 Vin Shelton <acs@xemacs.org> + + * automated/tag-test.el: Use a temp directory to avoid conflicts + with extra TAGS files. + +2004-05-08 Vin Shelton <acs@xemacs.org> + + * automated/tag-test.el: Created. + +2004-04-21 Jerry James <james@xemacs.org> + + * automated/test-harness.el (Assert): Add an optional failing-case + arg so we can see what the test was trying to do when it failed. + * automated/lisp-tests.el: Use the failing-case arg for Asserts + with variables. Use eql on tests that might produce bignums. Fix + test for non-bignum XEmacsen that fails because + (eq most-negative-fixnum (- most-negative-fixnum)). + +2004-04-19 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> + + * automated/mule-tests.el: Inhibit GC to speed up BIG_STRING tests. + +2004-04-19 Stephen J. Turnbull <stephen@xemacs.org> + + * automated/mule-tests.el: Darwin doesn't like ISO 8859/2 filenames. + +2004-04-05 Jerry James <james@xemacs.org> + + * automated/lisp-tests.el: Add bignum and ratio tests. + 2004-03-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.17 "chayote" is released. diff --text -u 'xemacs-21.5.17/tests/automated/lisp-tests.el' 'xemacs-21.5.18/tests/automated/lisp-tests.el' Index: ./tests/automated/lisp-tests.el --- ./tests/automated/lisp-tests.el Thu Apr 24 00:42:52 2003 +++ ./tests/automated/lisp-tests.el Fri May 14 00:33:18 2004 @@ -229,8 +229,27 @@ (Assert (= (+ 1.0 1) 2.0)) (Assert (= (+ 1.0 1 1) 3.0)) (Assert (= (+ 1 1 1.0) 3.0)) -(Assert (eq (1+ most-positive-fixnum) most-negative-fixnum)) -(Assert (eq (+ most-positive-fixnum 1) most-negative-fixnum)) +(if (featurep 'bignum) + (progn + (Assert (bignump (1+ most-positive-fixnum))) + (Assert (eq most-positive-fixnum (1- (1+ most-positive-fixnum)))) + (Assert (bignump (+ most-positive-fixnum 1))) + (Assert (eq most-positive-fixnum (- (+ most-positive-fixnum 1) 1))) + (Assert (= (1+ most-positive-fixnum) (- most-negative-fixnum))) + (Assert (zerop (+ (* 3 most-negative-fixnum) (* 3 most-positive-fixnum) + 3)))) + (Assert (eq (1+ most-positive-fixnum) most-negative-fixnum)) + (Assert (eq (+ most-positive-fixnum 1) most-negative-fixnum))) + +(when (featurep 'ratio) + (let ((threefourths (read "3/4")) + (threehalfs (read "3/2")) + (bigpos (div (+ most-positive-fixnum 2) (1+ most-positive-fixnum))) + (bigneg (div (+ most-positive-fixnum 2) most-negative-fixnum)) + (negone (div (1+ most-positive-fixnum) most-negative-fixnum))) + (Assert (= negone -1)) + (Assert (= threehalfs (+ threefourths threefourths))) + (Assert (zerop (+ bigpos bigneg))))) ;; Test `-' (Check-Error wrong-number-of-arguments (-)) @@ -247,18 +266,38 @@ (Assert (= (- 0 one one) -2)) (Assert (= (+ one 1) 2)) (dolist (zero '(0 0.0 ?\0)) - (Assert (= (+ 1 zero) 1)) - (Assert (= (+ zero 1) 1)) - (Assert (= (- zero) zero)) - (Assert (= (- zero) 0)) - (Assert (= (- zero zero) 0)) - (Assert (= (- zero one one) -2)))) + (Assert (= (+ 1 zero) 1) zero) + (Assert (= (+ zero 1) 1) zero) + (Assert (= (- zero) zero) zero) + (Assert (= (- zero) 0) zero) + (Assert (= (- zero zero) 0) zero) + (Assert (= (- zero one one) -2) zero))) (Assert (= (- 1.5 1) .5)) (Assert (= (- 1 1.5) (- .5))) -(Assert (eq (1- most-negative-fixnum) most-positive-fixnum)) -(Assert (eq (- most-negative-fixnum 1) most-positive-fixnum)) +(if (featurep 'bignum) + (progn + (Assert (bignump (1- most-negative-fixnum))) + (Assert (eq most-negative-fixnum (1+ (1- most-negative-fixnum)))) + (Assert (bignump (- most-negative-fixnum 1))) + (Assert (eq most-negative-fixnum (+ (- most-negative-fixnum 1) 1))) + (Assert (= (1- most-negative-fixnum) (- 0 most-positive-fixnum 2))) + (Assert (eq (- (- most-positive-fixnum most-negative-fixnum) + (* 2 most-positive-fixnum)) + 1))) + (Assert (eq (1- most-negative-fixnum) most-positive-fixnum)) + (Assert (eq (- most-negative-fixnum 1) most-positive-fixnum))) + +(when (featurep 'ratio) + (let ((threefourths (read "3/4")) + (threehalfs (read "3/2")) + (bigpos (div (+ most-positive-fixnum 2) (1+ most-positive-fixnum))) + (bigneg (div most-positive-fixnum most-negative-fixnum)) + (negone (div (1+ most-positive-fixnum) most-negative-fixnum))) + (Assert (= (- negone) 1)) + (Assert (= threefourths (- threehalfs threefourths))) + (Assert (= (- bigpos bigneg) 2)))) ;; Test `/' @@ -279,63 +318,112 @@ (dolist (six '(6 6.0 ?\06)) (dolist (two '(2 2.0 ?\02)) (dolist (three '(3 3.0 ?\03)) - (Assert (= (/ six two) three))))) + (Assert (= (/ six two) three) (list six two three))))) (dolist (three '(3 3.0 ?\03)) - (Assert (= (/ three 2.0) 1.5))) + (Assert (= (/ three 2.0) 1.5) three)) (dolist (two '(2 2.0 ?\02)) - (Assert (= (/ 3.0 two) 1.5))) + (Assert (= (/ 3.0 two) 1.5) two)) + +(when (featurep 'bignum) + (let* ((million 1000000) + (billion (* million 1000)) ;; American, not British, billion + (trillion (* billion 1000))) + (Assert (= (/ billion 1000) (/ trillion million) million 1000000.0)) + (Assert (= (/ billion -1000) (/ trillion (- million)) (- million))) + (Assert (= (/ trillion 1000) billion 1000000000.0)) + (Assert (= (/ trillion -1000) (- billion) -1000000000.0)) + (Assert (= (/ trillion 10) (* 100 billion) 100000000000.0)) + (Assert (= (/ (- trillion) 10) (* -100 billion) -100000000000.0)))) + +(when (featurep 'ratio) + (let ((half (div 1 2)) + (fivefourths (div 5 4)) + (fivehalfs (div 5 2))) + (Assert (= half (read "3000000000/6000000000"))) + (Assert (= (/ fivehalfs fivefourths) 2)) + (Assert (= (/ fivefourths fivehalfs) half)) + (Assert (= (- half) (read "-3000000000/6000000000"))) + (Assert (= (/ fivehalfs (- fivefourths)) -2)) + (Assert (= (/ (- fivefourths) fivehalfs) (- half))))) ;; Test `*' (Assert (= 1 (*))) (dolist (one `(1 1.0 ?\01 ,(Int-to-Marker 1))) - (Assert (= 1 (* one)))) + (Assert (= 1 (* one)) one)) (dolist (two '(2 2.0 ?\02)) - (Assert (= 2 (* two)))) + (Assert (= 2 (* two)) two)) (dolist (six '(6 6.0 ?\06)) (dolist (two '(2 2.0 ?\02)) (dolist (three '(3 3.0 ?\03)) - (Assert (= (* three two) six))))) + (Assert (= (* three two) six) (list three two six))))) (dolist (three '(3 3.0 ?\03)) (dolist (two '(2 2.0 ?\02)) - (Assert (= (* 1.5 two) three)) + (Assert (= (* 1.5 two) three) (list two three)) (dolist (five '(5 5.0 ?\05)) - (Assert (= 30 (* five two three)))))) + (Assert (= 30 (* five two three)) (list five two three))))) + +(when (featurep 'bignum) + (let ((64K 65536)) + (Assert (= (* 64K 64K) (read "4294967296"))) + (Assert (= (* (- 64K) 64K) (read "-4294967296"))) + (Assert (/= (* -1 most-negative-fixnum) most-negative-fixnum)))) + +(when (featurep 'ratio) + (let ((half (div 1 2)) + (fivefourths (div 5 4)) + (twofifths (div 2 5))) + (Assert (= (* fivefourths twofifths) half)) + (Assert (= (* half twofifths) (read "3/15"))))) ;; Test `+' (Assert (= 0 (+))) (dolist (one `(1 1.0 ?\01 ,(Int-to-Marker 1))) - (Assert (= 1 (+ one)))) + (Assert (= 1 (+ one)) one)) (dolist (two '(2 2.0 ?\02)) - (Assert (= 2 (+ two)))) + (Assert (= 2 (+ two)) two)) (dolist (five '(5 5.0 ?\05)) (dolist (two '(2 2.0 ?\02)) (dolist (three '(3 3.0 ?\03)) - (Assert (= (+ three two) five)) - (Assert (= 10 (+ five two three)))))) + (Assert (= (+ three two) five) (list three two five)) + (Assert (= 10 (+ five two three)) (list five two three))))) ;; Test `max', `min' (dolist (one `(1 1.0 ?\01 ,(Int-to-Marker 1))) - (Assert (= one (max one))) - (Assert (= one (max one one))) - (Assert (= one (max one one one))) - (Assert (= one (min one))) - (Assert (= one (min one one))) - (Assert (= one (min one one one))) + (Assert (= one (max one)) one) + (Assert (= one (max one one)) one) + (Assert (= one (max one one one)) one) + (Assert (= one (min one)) one) + (Assert (= one (min one one)) one) + (Assert (= one (min one one one)) one) (dolist (two `(2 2.0 ?\02 ,(Int-to-Marker 2))) - (Assert (= one (min one two))) - (Assert (= one (min one two two))) - (Assert (= one (min two two one))) - (Assert (= two (max one two))) - (Assert (= two (max one two two))) - (Assert (= two (max two two one))))) + (Assert (= one (min one two)) (list one two)) + (Assert (= one (min one two two)) (list one two)) + (Assert (= one (min two two one)) (list one two)) + (Assert (= two (max one two)) (list one two)) + (Assert (= two (max one two two)) (list one two)) + (Assert (= two (max two two one)) (list one two)))) + +(when (featurep 'bignum) + (let ((big (1+ most-positive-fixnum)) + (small (1- most-negative-fixnum))) + (Assert (= big (max 1 1000000.0 most-positive-fixnum big))) + (Assert (= small (min -1 -1000000.0 most-negative-fixnum small))))) + +(when (featurep 'ratio) + (let* ((big (1+ most-positive-fixnum)) + (small (1- most-negative-fixnum)) + (bigr (div (* 5 (1+ most-positive-fixnum)) 4)) + (smallr (- bigr))) + (Assert (= bigr (max 1 1000000.0 most-positive-fixnum big bigr))) + (Assert (= smallr (min -1 -1000000.0 most-negative-fixnum small smallr))))) ;; The byte compiler has special handling for these constructs: (let ((three 3) (five 5)) @@ -382,22 +470,22 @@ (Check-Error wrong-type-argument (logand 3.0)) (dolist (three '(3 ?\03)) - (Assert (eq 3 (logand three))) - (Assert (eq 3 (logxor three))) - (Assert (eq 3 (logior three))) - (Assert (eq 3 (logand three three))) - (Assert (eq 0 (logxor three three))) - (Assert (eq 3 (logior three three)))) + (Assert (eq 3 (logand three)) three) + (Assert (eq 3 (logxor three)) three) + (Assert (eq 3 (logior three)) three) + (Assert (eq 3 (logand three three)) three) + (Assert (eq 0 (logxor three three)) three) + (Assert (eq 3 (logior three three))) three) (dolist (one `(1 ?\01 ,(Int-to-Marker 1))) (dolist (two '(2 ?\02)) - (Assert (eq 0 (logand one two))) - (Assert (eq 3 (logior one two))) - (Assert (eq 3 (logxor one two)))) + (Assert (eq 0 (logand one two)) (list one two)) + (Assert (eq 3 (logior one two)) (list one two)) + (Assert (eq 3 (logxor one two)) (list one two))) (dolist (three '(3 ?\03)) - (Assert (eq 1 (logand one three))) - (Assert (eq 3 (logior one three))) - (Assert (eq 2 (logxor one three))))) + (Assert (eq 1 (logand one three)) (list one three)) + (Assert (eq 3 (logior one three)) (list one three)) + (Assert (eq 2 (logxor one three)) (list one three)))) ;;----------------------------------------------------- ;; Test `%', mod @@ -413,12 +501,28 @@ (Check-Error wrong-type-argument (% 10.0 2)) (Check-Error wrong-type-argument (% 10 2.0)) -(dotimes (j 30) - (let ((x (- (random) (random)))) - (Assert (eq x (+ (% x 17) (* (/ x 17) 17)))) - (Assert (eq (- x) (+ (% (- x) 17) (* (/ (- x) 17) 17)))) - (Assert (eq (% x -17) (- (% (- x) 17)))) - )) +(flet ((test1 (x) (Assert (eql x (+ (% x 17) (* (/ x 17) 17))) x)) + (test2 (x) (Assert (eql (- x) (+ (% (- x) 17) (* (/ (- x) 17) 17))) x)) + (test3 (x) (Assert (eql x (+ (% (- x) 17) (* (/ (- x) 17) 17))) x)) + (test4 (x) (Assert (eql (% x -17) (- (% (- x) 17))) x)) + (test5 (x) (Assert (eql (% x -17) (% (- x) 17))) x)) + (test1 most-negative-fixnum) + (if (featurep 'bignum) + (progn + (test2 most-negative-fixnum) + (test4 most-negative-fixnum)) + (test3 most-negative-fixnum) + (test5 most-negative-fixnum)) + (test1 most-positive-fixnum) + (test2 most-positive-fixnum) + (test4 most-positive-fixnum) + (dotimes (j 30) + (let ((x (random))) + (if (eq x most-negative-fixnum) (setq x (1+ x))) + (if (eq x most-positive-fixnum) (setq x (1- x))) + (test1 x) + (test2 x) + (test4 x)))) (macrolet ((division-test (seven) @@ -476,7 +580,13 @@ (division-test ?\07) (division-test (Int-to-Marker 7))) - +(when (featurep 'bignum) + (let ((big (+ (* 7 most-positive-fixnum 6))) + (negbig (- (* 7 most-negative-fixnum 6)))) + (= (% big (1+ most-positive-fixnum)) most-positive-fixnum) + (= (% negbig (1- most-negative-fixnum)) most-negative-fixnum) + (= (mod big (1+ most-positive-fixnum)) most-positive-fixnum) + (= (mod negbig (1- most-negative-fixnum)) most-negative-fixnum))) ;;----------------------------------------------------- ;; Arithmetic comparison operations @@ -490,12 +600,12 @@ ;; One argument always yields t (loop for x in `(1 1.0 ,(Int-to-Marker 1) ?z) do - (Assert (eq t (= x))) - (Assert (eq t (< x))) - (Assert (eq t (> x))) - (Assert (eq t (>= x))) - (Assert (eq t (<= x))) - (Assert (eq t (/= x))) + (Assert (eq t (= x)) x) + (Assert (eq t (< x)) x) + (Assert (eq t (> x)) x) + (Assert (eq t (>= x)) x) + (Assert (eq t (<= x)) x) + (Assert (eq t (/= x)) x) ) ;; Type checking @@ -509,44 +619,44 @@ ;; Meat (dolist (one `(1 1.0 ,(Int-to-Marker 1) ?\01)) (dolist (two '(2 2.0 ?\02)) - (Assert (< one two)) - (Assert (<= one two)) - (Assert (<= two two)) - (Assert (> two one)) - (Assert (>= two one)) - (Assert (>= two two)) - (Assert (/= one two)) - (Assert (not (/= two two))) - (Assert (not (< one one))) - (Assert (not (> one one))) - (Assert (<= one one two two)) - (Assert (not (< one one two two))) - (Assert (>= two two one one)) - (Assert (not (> two two one one))) - (Assert (= one one one)) - (Assert (not (= one one one two))) - (Assert (not (/= one two one))) + (Assert (< one two) (list one two)) + (Assert (<= one two) (list one two)) + (Assert (<= two two) two) + (Assert (> two one) (list one two)) + (Assert (>= two one) (list one two)) + (Assert (>= two two) two) + (Assert (/= one two) (list one two)) + (Assert (not (/= two two)) two) + (Assert (not (< one one)) one) + (Assert (not (> one one)) one) + (Assert (<= one one two two) (list one two)) + (Assert (not (< one one two two)) (list one two)) + (Assert (>= two two one one) (list one two)) + (Assert (not (> two two one one)) (list one two)) + (Assert (= one one one) one) + (Assert (not (= one one one two)) (list one two)) + (Assert (not (/= one two one)) (list one two)) )) (dolist (one `(1 1.0 ,(Int-to-Marker 1) ?\01)) (dolist (two '(2 2.0 ?\02)) - (Assert (< one two)) - (Assert (<= one two)) - (Assert (<= two two)) - (Assert (> two one)) - (Assert (>= two one)) - (Assert (>= two two)) - (Assert (/= one two)) - (Assert (not (/= two two))) - (Assert (not (< one one))) - (Assert (not (> one one))) - (Assert (<= one one two two)) - (Assert (not (< one one two two))) - (Assert (>= two two one one)) - (Assert (not (> two two one one))) - (Assert (= one one one)) - (Assert (not (= one one one two))) - (Assert (not (/= one two one))) + (Assert (< one two) (list one two)) + (Assert (<= one two) (list one two)) + (Assert (<= two two) two) + (Assert (> two one) (list one two)) + (Assert (>= two one) (list one two)) + (Assert (>= two two) two) + (Assert (/= one two) (list one two)) + (Assert (not (/= two two)) two) + (Assert (not (< one one)) one) + (Assert (not (> one one)) one) + (Assert (<= one one two two) (list one two)) + (Assert (not (< one one two two)) (list one two)) + (Assert (>= two two one one) (list one two)) + (Assert (not (> two two one one)) (list one two)) + (Assert (= one one one) one) + (Assert (not (= one one one two)) (list one two)) + (Assert (not (/= one two one)) (list one two)) )) ;; ad-hoc @@ -567,6 +677,42 @@ (Assert (= 1 (Int-to-Marker 1))) (Assert (= (point) (point-marker))) +(when (featurep 'bignum) + (let ((big1 (1+ most-positive-fixnum)) + (big2 (* 10 most-positive-fixnum)) + (small1 (1- most-negative-fixnum)) + (small2 (* 10 most-negative-fixnum))) + (Assert (< small2 small1 most-negative-fixnum most-positive-fixnum big1 + big2)) + (Assert (<= small2 small1 most-negative-fixnum most-positive-fixnum big1 + big2)) + (Assert (> big2 big1 most-positive-fixnum most-negative-fixnum small1 + small2)) + (Assert (>= big2 big1 most-positive-fixnum most-negative-fixnum small1 + small2)) + (Assert (/= small2 small1 most-negative-fixnum most-positive-fixnum big1 + big2)))) + +(when (featurep 'ratio) + (let ((big1 (div (* 10 most-positive-fixnum) 4)) + (big2 (div (* 5 most-positive-fixnum) 2)) + (big3 (div (* 7 most-positive-fixnum) 2)) + (small1 (div (* 10 most-negative-fixnum) 4)) + (small2 (div (* 5 most-negative-fixnum) 2)) + (small3 (div (* 7 most-negative-fixnum) 2))) + (Assert (= big1 big2)) + (Assert (= small1 small2)) + (Assert (< small3 small1 most-negative-fixnum most-positive-fixnum big1 + big3)) + (Assert (<= small3 small2 small1 most-negative-fixnum most-positive-fixnum + big1 big2 big3)) + (Assert (> big3 big1 most-positive-fixnum most-negative-fixnum small1 + small3)) + (Assert (>= big3 big2 big1 most-positive-fixnum most-negative-fixnum + small1 small2 small3)) + (Assert (/= big3 big1 most-positive-fixnum most-negative-fixnum small1 + small3)))) + ;;----------------------------------------------------- ;; testing list-walker functions ;;----------------------------------------------------- @@ -978,18 +1124,18 @@ (make-extent nil nil nil) (make-face 'test-face)) do - (Assert (eq 2 (get obj ?1 2))) - (Assert (eq 4 (put obj ?3 4))) - (Assert (eq 4 (get obj ?3))) + (Assert (eq 2 (get obj ?1 2)) obj) + (Assert (eq 4 (put obj ?3 4)) obj) + (Assert (eq 4 (get obj ?3)) obj) (when (or (stringp obj) (symbolp obj)) - (Assert (equal '(?3 4) (object-plist obj)))) - (Assert (eq t (remprop obj ?3))) + (Assert (equal '(?3 4) (object-plist obj)) obj)) + (Assert (eq t (remprop obj ?3)) obj) (when (or (stringp obj) (symbolp obj)) - (Assert (eq '() (object-plist obj)))) - (Assert (eq nil (remprop obj ?3))) + (Assert (eq '() (object-plist obj)) obj)) + (Assert (eq nil (remprop obj ?3)) obj) (when (or (stringp obj) (symbolp obj)) - (Assert (eq '() (object-plist obj)))) - (Assert (eq 5 (get obj ?3 5))) + (Assert (eq '() (object-plist obj)) obj)) + (Assert (eq 5 (get obj ?3 5)) obj) ) (Check-Error-Message @@ -1135,10 +1281,16 @@ ;;; "%u" is undocumented, and Emacs Lisp has no unsigned type. ;;; What to do if "%u" is used with a negative number? -;;; The most reasonable thing seems to be to print an un-read-able number. -;;; The printed value might be useful to a human, if not to Emacs Lisp. -(Check-Error invalid-read-syntax (read (format "%u" most-negative-fixnum))) -(Check-Error invalid-read-syntax (read (format "%u" -1))) +;;; For non-bignum XEmacsen, the most reasonable thing seems to be to print an +;;; un-read-able number. The printed value might be useful to a human, if not +;;; to Emacs Lisp. +;;; For bignum XEmacsen, we make %u with a negative value throw an error. +(if (featurep 'bignum) + (progn + (Check-Error wrong-type-argument (format "%u" most-negative-fixnum)) + (Check-Error wrong-type-argument (format "%u" -1))) + (Check-Error invalid-read-syntax (read (format "%u" most-negative-fixnum))) + (Check-Error invalid-read-syntax (read (format "%u" -1)))) ;; Check all-completions ignore element start with space. (Assert (not (all-completions "" '((" hidden" . "object"))))) diff --text -u 'xemacs-21.5.17/tests/automated/mule-tests.el' 'xemacs-21.5.18/tests/automated/mule-tests.el' Index: ./tests/automated/mule-tests.el --- ./tests/automated/mule-tests.el Fri Feb 21 00:39:42 2003 +++ ./tests/automated/mule-tests.el Mon Apr 19 15:22:34 2004 @@ -233,7 +233,7 @@ ;; Test strings waxing and waning across the 8k BIG_STRING limit (see alloc.c) ;;--------------------------------------------------------------- (defun charset-char-string (charset) - (let (lo hi string n) + (let (lo hi string n (gc-cons-threshold most-positive-fixnum)) (if (= (charset-chars charset) 94) (setq lo 33 hi 126) (setq lo 32 hi 127)) @@ -245,6 +245,7 @@ (progn (aset string n (make-char charset j)) (incf n))) + (garbage-collect) string) (progn (setq string (make-string (* (1+ (- hi lo)) (1+ (- hi lo))) ??)) @@ -254,6 +255,7 @@ (progn (aset string n (make-char charset j k)) (incf n)))) + (garbage-collect) string)))) ;; The following two used to crash xemacs! @@ -298,7 +300,13 @@ latin2-string)) (name1 (make-temp-name prefix)) (name2 (make-temp-name prefix)) - (file-name-coding-system 'iso-8859-2)) + (file-name-coding-system + ;; 'iso-8859-X doesn't work on darwin (as of "Panther" 10.3), it + ;; seems to know that file-name-coding-system is definitely utf-8 + (if (string-match "darwin" system-configuration) + 'utf-8 + 'iso-8859-2)) + ) ;; This is how you suppress output from `message', called by `write-region' (flet ((append-message (&rest args) ())) (Assert (not (equal name1 name2))) diff --text -u 'xemacs-21.5.17/tests/automated/regexp-tests.el' 'xemacs-21.5.18/tests/automated/regexp-tests.el' Index: ./tests/automated/regexp-tests.el --- ./tests/automated/regexp-tests.el Thu Sep 25 20:59:24 2003 +++ ./tests/automated/regexp-tests.el Thu Oct 7 17:01:44 2004 @@ -394,3 +394,32 @@ (string-match "b" a) (match-string 1 a)) a))) + +;; bug identified by Katsumi Yamaoka 2004-09-03 <b9ywtzbbpue.fsf_-_@jpl.org> +;; fix submitted by sjt 2004-09-08 +;; trailing comments are values from buggy 21.4.15 +(let ((text "abc")) + (Assert (eq 0 (string-match "\\(?:ab+\\)*c" text))) ; 2 + (Assert (eq 0 (string-match "^\\(?:ab+\\)*c" text))) ; nil + (Assert (eq 0 (string-match "^\\(?:ab+\\)*" text))) ; 0 + (Assert (eq 0 (string-match "^\\(?:ab+\\)c" text))) ; 0 + (Assert (eq 0 (string-match "^\\(?:ab\\)*c" text))) ; 0 + (Assert (eq 0 (string-match "^\\(?:a+\\)*b" text))) ; nil + (Assert (eq 0 (string-match "^\\(?:a\\)*b" text))) ; 0 +) + +;; per Steve Youngs 2004-09-30 <microsoft-free.87ekkjhj7t.fsf@youngs.au.com> +;; fix submitted by sjt 2004-10-07 +;; trailing comments are values from buggy 21.4.pre16 +(let ((text "abc")) + (Assert (eq 0 (string-match "\\(?:a\\(b\\)\\)" text))) ; 0 + (Assert (string= (match-string 1 text) "b")) ; ab + (Assert (null (match-string 2 text))) ; b + (Assert (null (match-string 3 text))) ; nil + (Assert (eq 0 (string-match "\\(?:a\\(?:b\\(c\\)\\)\\)" text))) ; 0 + (Assert (string= (match-string 1 text) "c")) ; abc + (Assert (null (match-string 2 text))) ; ab + (Assert (null (match-string 3 text))) ; c + (Assert (null (match-string 4 text))) ; nil +) + diff --text -u /dev/null 'xemacs-21.5.18/tests/automated/tag-tests.el' Index: ./tests/automated/tag-tests.el --- ./tests/automated/tag-tests.el Thu Jan 1 09:00:00 1970 +++ ./tests/automated/tag-tests.el Fri May 14 01:41:27 2004 @@ -0,0 +1,91 @@ +;; Copyright (C) 2004 Vin Shelton + +;; Author: Vin Shelton <acs@xemacs.org> +;; Maintainer: Vin Shelton <acs@xemacs.org> +;; Created: 2004 +;; Keywords: tests + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. + +;;; Synched up with: Not in FSF. + +;;; Commentary: + +;; Test tag support. +;; See test-harness.el for instructions on how to run these tests. + +(let ((testfile "tag-test.c") + (tagfile "TAGS") + (tags-build-completion-table nil)) + + (cd (temp-directory)) + + ;; Create a TAGS file + (with-temp-file tagfile + (insert +" +tag-test.c,99 +struct mystruct mystruct2,1 +struct mystruct *foo\(4,23 +DEFUN \(\"require\", Frequire,require,7,51 +")) + + ;; Create the test file + (with-temp-file testfile + (insert +" +struct mystruct { }; + +struct mystruct *foo\(\) { +} + +DEFUN \(\"require\", Frequire, 1, 2, 0, /* +If feature FEATURE is not loaded, load it from FILENAME. +If FEATURE is not a member of the list `features', then the feature +is not loaded; so load the file FILENAME. +If FILENAME is omitted, the printname of FEATURE is used as the file name. +*/ + \(feature, filename\)\) +{ +} +")) + + (let ((tags-always-exact t)) + + ;; Search for the tag "mystruct"; this should succeed + (find-tag "mystruct") + (Assert (eq (point) 2)) + + ;; Search again. The search should fail, based on the patch that + ;; Sven Grundmann submitted for 21.4.16. + (Check-Error-Message error "No more entries matching mystruct" + (tags-loop-continue))) + + (let ((tags-always-exact nil)) + + ;; Search for the definition of "require". Until the etags.el upgrade + ;; from 21.5 in 21.4.16, this test would fail. + (condition-case nil + (find-tag "require") + (t t)) + (Assert (eq (point) 52))) + + (kill-buffer testfile) + (delete-file testfile) + (kill-buffer tagfile) + (delete-file tagfile)) diff --text -u 'xemacs-21.5.17/tests/automated/test-harness.el' 'xemacs-21.5.18/tests/automated/test-harness.el' Index: ./tests/automated/test-harness.el --- ./tests/automated/test-harness.el Thu Oct 23 21:48:49 2003 +++ ./tests/automated/test-harness.el Tue May 4 00:08:51 2004 @@ -210,18 +210,25 @@ (Print-Skip ,description ,reason)) ,@body)) - (defmacro Assert (assertion) + (defmacro Assert (assertion &optional failing-case) `(condition-case error-info - (progn - (assert ,assertion) - (Print-Pass "%S" (quote ,assertion)) - (incf passes)) - (cl-assertion-failed - (Print-Failure "Assertion failed: %S" (quote ,assertion)) - (incf assertion-failures)) - (t (Print-Failure "%S ==> error: %S" (quote ,assertion) error-info) - (incf other-failures) - ))) + (progn + (assert ,assertion) + (Print-Pass "%S" (quote ,assertion)) + (incf passes)) + (cl-assertion-failed + (Print-Failure (if ,failing-case + "Assertion failed: %S; failing case = %S" + "Assertion failed: %S") + (quote ,assertion) ,failing-case) + (incf assertion-failures)) + (t (Print-Failure (if ,failing-case + "%S ==> error: %S; failing case = %S" + "%S ==> error: %S") + (quote ,assertion) error-info ,failing-case) + (incf other-failures) + ))) + (defmacro Check-Error (expected-error &rest body) (let ((quoted-body (if (= 1 (length body)) diff --text -u 'xemacs-21.5.17/version.sh' 'xemacs-21.5.18/version.sh' Index: ./version.sh --- ./version.sh Mon Mar 22 18:22:24 2004 +++ ./version.sh Fri Oct 22 14:10:31 2004 @@ -2,10 +2,10 @@ emacs_is_beta=t emacs_major_version=21 emacs_minor_version=5 -emacs_beta_version=17 -xemacs_codename="chayote" +emacs_beta_version=18 +xemacs_codename="chestnut" emacs_kit_version= infodock_major_version=4 infodock_minor_version=0 infodock_build_version=8 -xemacs_extra_name="(+CVS-20040321)" +xemacs_extra_name="(+CVS-20041021)" #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Fri Oct 22 16:07:08 2004 # Generated by : makepatch 2.00_12* # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # (\A|/).*\~\Z # (\A|/)\.cvsignore\Z # (\A|/)CVS\Z # (\A|/)MANIFEST\Z # (\A|/)\.precious\Z # (\A|/)TAGS\Z # (\A|/)xemacs\-packages\Z # (\A|/)mule\-packages\Z # (\A|/).*\.gz\Z # (\A|/)display\Z # (\A|/)TUTORIAL\.ru\Z # (\A|/)TUTORIAL\.th\Z # (\A|/).*\.png\Z # (\A|/).*\.bmp\Z # (\A|/).*\.ico\Z # (\A|/).*\.elc\Z # (\A|/).*\.info.*\Z # r './src/callproc.c' 0 0 # p './CHANGES-beta' 66092 1098411254 0100644 # p './ChangeLog' 156539 1098421831 0100644 # p './INSTALL' 36196 1095703239 0100644 # p './Makefile.in.in' 24123 1094817488 0100644 # p './aclocal.m4' 16257 1084548929 0100644 # p './config.guess' 39576 1092430531 0100755 # p './configure' 467011 1098422195 0100755 # p './configure.in' 187270 1096472311 0100644 # p './configure.usage' 17794 1081253635 0100644 # p './etc/ChangeLog' 43916 1098421831 0100644 # c './etc/ETAGS.EBNF' 0 1097160671 0100644 # p './etc/NEWS' 58200 1095758651 0100644 # p './etc/PACKAGES' 8055 1080683115 0100644 # p './etc/SERVICE' 33943 1092160751 0100644 # p './etc/etags.1' 10479 1097160671 0100644 # c './etc/gtkrc' 0 1084606985 0100644 # p './lib-src/ChangeLog' 49162 1098421831 0100644 # p './lib-src/Makefile.in.in' 12615 1082062577 0100644 # p './lib-src/config.values.in' 4691 1084548876 0100644 # p './lib-src/digest-doc.c' 1000 1095707950 0100644 # p './lib-src/etags.c' 144921 1097160679 0100644 # p './lib-src/fakemail.c' 15558 1095707950 0100644 # p './lib-src/gnuclient.c' 18369 1095707950 0100644 # p './lib-src/gnuserv.c' 21923 1095707950 0100644 # c './lib-src/insert-data-in-exec.c' 0 1082208560 0100644 # p './lib-src/make-docfile.c' 30875 1095707950 0100644 # p './lib-src/make-dump-id.c' 2140 1095707950 0100644 # p './lib-src/pop.c' 33555 1095707951 0100644 # p './lib-src/profile.c' 2934 1095707951 0100644 # p './lib-src/sorted-doc.c' 5844 1095707951 0100644 # p './lisp/ChangeLog' 748617 1098421831 0100644 # p './lisp/about.el' 91184 1095917707 0100644 # p './lisp/apropos.el' 23995 1095237026 0100644 # p './lisp/bytecomp.el' 166576 1092431955 0100644 # p './lisp/cl-compat.el' 6201 1088285124 0100644 # p './lisp/cl-extra.el' 29567 1088285124 0100644 # p './lisp/cl-macs.el' 124945 1095818749 0100644 # p './lisp/cl-seq.el' 39247 1088285124 0100644 # p './lisp/cl.el' 25961 1088285124 0100644 # p './lisp/code-init.el' 14530 1095818749 0100644 # p './lisp/code-process.el' 16797 1081022426 0100644 # p './lisp/cus-edit.el' 130025 1086870001 0100644 # p './lisp/derived.el' 14638 1087573718 0100644 # p './lisp/dialog-gtk.el' 9576 1084606304 0100644 # p './lisp/etags.el' 48193 1084170391 0100644 # p './lisp/files.el' 171932 1086566324 0100644 # p './lisp/find-paths.el' 8853 1095818750 0100644 # p './lisp/font-menu.el' 15965 1095818750 0100644 # p './lisp/gtk-font-menu.el' 9690 1095818750 0100644 # p './lisp/gtk-marshal.el' 10242 1083470812 0100644 # p './lisp/gtk-widgets.el' 85731 1084606304 0100644 # p './lisp/help-macro.el' 6736 1095237026 0100644 # p './lisp/help.el' 65335 1095237026 0100644 # p './lisp/hyper-apropos.el' 50298 1095237027 0100644 # p './lisp/isearch-mode.el' 76280 1084172674 0100644 # p './lisp/itimer.el' 32294 1096165231 0100644 # p './lisp/lisp-mode.el' 46136 1086566324 0100644 # p './lisp/list-mode.el' 25922 1085523208 0100644 # p './lisp/menubar-items.el' 77293 1082364890 0100644 # p './lisp/minibuf.el' 92715 1082195964 0100644 # p './lisp/mule/ethio-util.el' 71332 1086566326 0100644 # p './lisp/mule/mule-charset.el' 32086 1095819906 0100644 # p './lisp/newcomment.el' 41649 1086566324 0100644 # p './lisp/package-get.el' 53734 1088198676 0100644 # p './lisp/package-ui.el' 25178 1087842378 0100644 # p './lisp/packages.el' 19183 1094515699 0100644 # p './lisp/specifier.el' 41388 1095818751 0100644 # p './lisp/startup.el' 53451 1095918277 0100644 # p './lisp/subr.el' 60340 1087471779 0100644 # p './lisp/term/tvi970.el' 4337 1086566326 0100644 # p './lisp/unicode.el' 11469 1095818751 0100644 # p './lisp/widgets-gtk.el' 5263 1089201659 0100644 # p './lisp/window-xemacs.el' 37615 1093107951 0100644 # p './lisp/x-font-menu.el' 9498 1095818751 0100644 # p './lwlib/ChangeLog' 25910 1098421831 0100644 # p './lwlib/Makefile.in.in' 3162 1095707956 0100644 # p './lwlib/config.h.in' 1374 1095707956 0100644 # p './lwlib/lwlib-Xaw.c' 25048 1095707956 0100644 # p './lwlib/lwlib-Xlw.c' 17387 1095707956 0100644 # p './lwlib/lwlib-Xm.c' 64238 1096310351 0100644 # p './lwlib/lwlib-utils.c' 4854 1095707957 0100644 # p './lwlib/lwlib.c' 36341 1095707957 0100644 # p './lwlib/xlwcheckbox.c' 10892 1095707957 0100644 # p './lwlib/xlwgauge.c' 28335 1095707957 0100644 # p './lwlib/xlwgcs.c' 14847 1095707957 0100644 # p './lwlib/xlwmenu.c' 99405 1095707957 0100644 # p './lwlib/xlwradio.c' 15658 1095707957 0100644 # p './lwlib/xlwscrollbar.c' 52374 1095707958 0100644 # p './lwlib/xlwtabs.c' 57963 1095707958 0100644 # p './man/ChangeLog' 111466 1098421831 0100644 # p './man/internals/internals.texi' 441536 1095172797 0100644 # p './man/lispref/control.texi' 48767 1095818787 0100644 # p './man/lispref/extents.texi' 40033 1090225468 0100644 # p './man/lispref/faces.texi' 31943 1087208685 0100644 # p './man/lispref/glyphs.texi' 68929 1095818787 0100644 # p './man/lispref/gutter.texi' 19295 1082361758 0100644 # p './man/lispref/lispref.texi' 54208 1090225468 0100644 # p './man/lispref/modes.texi' 55697 1087441277 0100644 # p './man/lispref/numbers.texi' 34177 1090225468 0100644 # p './man/lispref/positions.texi' 38710 1092389303 0100644 # p './man/lispref/searching.texi' 58387 1094639575 0100644 # p './man/lispref/specifiers.texi' 69071 1087543120 0100644 # p './man/lispref/text.texi' 115286 1094665220 0100644 # p './man/lispref/windows.texi' 71366 1095735612 0100644 # p './man/widget.texi' 55660 1082361747 0100644 # p './man/xemacs-faq.texi' 268853 1089024150 0100644 # p './man/xemacs/help.texi' 18755 1092390477 0100644 # p './modules/ChangeLog' 8764 1098421831 0100644 # p './modules/ldap/eldap.c' 24992 1095707966 0100644 # p './modules/postgresql/postgresql.c' 51335 1095707969 0100644 # p './netinstall/ChangeLog' 12740 1098422317 0100644 # p './nt/ChangeLog' 63951 1098421831 0100644 # p './nt/installer/Wise/ChangeLog' 1760 1098421831 0100644 # p './nt/xemacs.dsp' 23434 1095172802 0100644 # p './nt/xemacs.mak' 47237 1086046890 0100644 # p './src/ChangeLog' 1355411 1098421831 0100644 # p './src/EmacsFrame.c' 22655 1095707974 0100644 # p './src/EmacsManager.c' 8370 1095707974 0100644 # p './src/ExternalClient-Xlib.c' 4218 1086167780 0100644 # p './src/ExternalClient.c' 18127 1095822284 0100644 # p './src/ExternalShell.c' 22672 1095822284 0100644 # p './src/Makefile.in.in' 32054 1094817513 0100644 # p './src/alloc.c' 157079 1095707974 0100644 # p './src/balloon_help.c' 15695 1095707975 0100644 # p './src/buffer.c' 97636 1095172365 0100644 # p './src/buffer.h' 44008 1097774782 0100644 # p './src/bytecode.c' 59879 1095707975 0100644 # p './src/callint.c' 33690 1095707975 0100644 # p './src/casetab.c' 16368 1095707975 0100644 # p './src/chartab.c' 52119 1095707975 0100644 # p './src/cm.c' 11867 1095707975 0100644 # p './src/cmdloop.c' 20864 1095707975 0100644 # p './src/commands.h' 4207 1095172366 0100644 # p './src/compiler.h' 6800 1097774782 0100644 # p './src/config.h.in' 31024 1094880521 0100644 # p './src/console-gtk-impl.h' 7092 1089201666 0100644 # p './src/console-gtk.c' 3189 1095707976 0100644 # p './src/console-gtk.h' 3606 1089201666 0100644 # p './src/console-msw.c' 19133 1095707976 0100644 # p './src/console-stream.c' 10406 1098243780 0100644 # p './src/console-tty.c' 11825 1095707976 0100644 # p './src/console-x.c' 8371 1095707976 0100644 # p './src/console.c' 47190 1098206347 0100644 # p './src/data.c' 69684 1095707976 0100644 # p './src/database.c' 20942 1095707977 0100644 # p './src/depend' 41443 1095890087 0100644 # p './src/device-gtk.c' 21688 1095707977 0100644 # p './src/device-msw.c' 41246 1095707977 0100644 # p './src/device-tty.c' 5756 1095707977 0100644 # p './src/device-x.c' 65332 1097774783 0100644 # p './src/device.c' 43763 1095707978 0100644 # p './src/dgif_lib.c' 32870 1083845533 0100644 # p './src/dialog-gtk.c' 1733 1095707978 0100644 # p './src/dialog-msw.c' 25105 1095707978 0100644 # p './src/dialog-x.c' 8855 1095707978 0100644 # p './src/dired.c' 28997 1095818804 0100644 # p './src/doprnt.c' 25976 1095195276 0100644 # c './src/dump-data.c' 0 1082386147 0100644 # c './src/dump-data.h' 0 1082386147 0100644 # p './src/dumper.c' 43555 1095707978 0100644 # p './src/editfns.c' 79699 1095707979 0100644 # p './src/elhash.c' 53634 1097774783 0100644 # p './src/emacs-marshals.c' 74734 1083470818 0100644 # p './src/emacs.c' 136322 1095707979 0100644 # p './src/emodules.c' 20604 1084548880 0100644 # p './src/esd.c' 3821 1095707980 0100644 # p './src/eval.c' 198112 1095818805 0100644 # p './src/event-Xt.c' 107685 1095707980 0100644 # p './src/event-gtk.c' 60006 1095707981 0100644 # p './src/event-msw.c' 152431 1095707981 0100644 # p './src/event-stream.c' 174832 1095707981 0100644 # p './src/event-tty.c' 8508 1095707981 0100644 # p './src/events.c' 77866 1098206346 0100644 # p './src/extents.c' 235890 1095707982 0100644 # p './src/extw-Xt.c' 6599 1086525345 0100644 # p './src/faces.c' 70357 1095707982 0100644 # p './src/file-coding.c' 165121 1095818806 0100644 # p './src/file-coding.h' 43702 1095818807 0100644 # p './src/fileio.c' 133507 1095707983 0100644 # p './src/filemode.c' 4634 1095707983 0100644 # p './src/floatfns.c' 24156 1095707983 0100644 # p './src/fns.c' 113920 1095707983 0100644 # p './src/frame-gtk.c' 42051 1095707984 0100644 # p './src/frame-msw.c' 38081 1095707984 0100644 # p './src/frame-tty.c' 6045 1095707984 0100644 # p './src/frame-x.c' 84965 1095707984 0100644 # p './src/frame.c' 118551 1095707985 0100644 # p './src/free-hook.c' 15459 1095707985 0100644 # p './src/gccache-gtk.c' 8189 1083470819 0100644 # p './src/gccache-gtk.h' 1176 1083470819 0100644 # p './src/general-slots.h' 6770 1081205394 0100644 # p './src/gif_io.c' 8452 1095172370 0100644 # p './src/gifrlib.h' 11570 1095222376 0100644 # p './src/glade.c' 3177 1083470819 0100644 # p './src/glyphs-eimage.c' 40348 1095707985 0100644 # p './src/glyphs-gtk.c' 80611 1095707985 0100644 # p './src/glyphs-gtk.h' 5883 1084606989 0100644 # p './src/glyphs-msw.c' 92541 1097774783 0100644 # p './src/glyphs-shared.c' 8998 1095707986 0100644 # p './src/glyphs-widget.c' 66996 1095818808 0100644 # p './src/glyphs-x.c' 90152 1095707986 0100644 # p './src/glyphs.c' 169929 1095818808 0100644 # p './src/gmalloc.c' 40279 1096311082 0100644 # p './src/gpmevent.c' 16804 1095707987 0100644 # p './src/gtk-glue.c' 6793 1083470820 0100644 # p './src/gtk-xemacs.c' 10743 1097932138 0100644 # p './src/gui-gtk.c' 2682 1089201667 0100644 # p './src/gui-msw.c' 5189 1095707987 0100644 # p './src/gui-x.c' 19437 1095707987 0100644 # p './src/gui.c' 21303 1095707987 0100644 # p './src/gutter.c' 52174 1095707988 0100644 # p './src/hpplay.c' 7757 1095707988 0100644 # p './src/input-method-motif.c' 4064 1095707989 0100644 # p './src/input-method-xlib.c' 33552 1095707989 0100644 # p './src/intl-encap-win32.c' 82330 1094875241 0100644 # p './src/intl-win32.c' 61836 1097774784 0100644 # p './src/intl-x.c' 2030 1097774784 0100644 # p './src/keymap.c' 139211 1095707990 0100644 # p './src/linuxplay.c' 14559 1095193606 0100644 # p './src/lisp.h' 194742 1095172370 0100644 # p './src/lread.c' 91151 1095707990 0100644 # p './src/lrecord.h' 62139 1081205396 0100644 # p './src/lstream.c' 52360 1095707990 0100644 # p './src/malloc.c' 22663 1087390166 0100644 # p './src/marker.c' 14853 1095707991 0100644 # p './src/mem-limits.h' 4557 1094880521 0100644 # p './src/menubar-gtk.c' 35981 1095707991 0100644 # p './src/menubar-msw.c' 27173 1095707991 0100644 # p './src/menubar-x.c' 37494 1095707991 0100644 # p './src/menubar.c' 27885 1095707991 0100644 # p './src/minibuf.c' 27350 1095707991 0100644 # p './src/miscplay.c' 27923 1095707991 0100644 # p './src/mule-canna.c' 47513 1095707992 0100644 # p './src/mule-ccl.c' 63510 1095707992 0100644 # p './src/mule-charset.c' 43075 1095707992 0100644 # p './src/mule-coding.c' 97783 1095707992 0100644 # p './src/nas.c' 23421 1095707992 0100644 # p './src/native-gtk-toolbar.c' 7155 1095707992 0100644 # p './src/nt.c' 58570 1095707993 0100644 # p './src/ntplay.c' 2919 1095707993 0100644 # c './src/number-gmp.c' 0 1095707993 0100644 # c './src/number-gmp.h' 0 1095707993 0100644 # c './src/number-mp.c' 0 1081305690 0100644 # c './src/number-mp.h' 0 1081205396 0100644 # c './src/number.c' 0 1095707994 0100644 # c './src/number.h' 0 1085172992 0100644 # p './src/objects-gtk.c' 16522 1095707994 0100644 # p './src/objects-msw.c' 79455 1095707994 0100644 # p './src/objects-tty.c' 10376 1095707994 0100644 # p './src/objects-x.c' 34015 1095707995 0100644 # p './src/objects.c' 35597 1097774784 0100644 # p './src/objects.h' 3136 1095172372 0100644 # p './src/opaque.c' 5245 1095707995 0100644 # p './src/print.c' 70849 1095707995 0100644 # p './src/process-nt.c' 44073 1095707995 0100644 # p './src/process-unix.c' 66364 1095707996 0100644 # p './src/process.c' 80715 1095818809 0100644 # p './src/procimpl.h' 5638 1095818810 0100644 # p './src/profile.c' 24793 1095707996 0100644 # p './src/rangetab.c' 22254 1095707996 0100644 # p './src/redisplay-gtk.c' 54868 1095707996 0100644 # p './src/redisplay-msw.c' 39004 1095707996 0100644 # p './src/redisplay-output.c' 84665 1095707997 0100644 # p './src/redisplay-tty.c' 42435 1095707997 0100644 # p './src/redisplay-x.c' 60638 1095707997 0100644 # p './src/redisplay.c' 313390 1095707997 0100644 # p './src/regex.c' 223739 1097774784 0100644 # p './src/regex.h' 20733 1097774784 0100644 # p './src/s/windowsnt.h' 9098 1095653266 0100644 # p './src/scrollbar-gtk.c' 15052 1095707998 0100644 # p './src/scrollbar-msw.c' 15895 1095707998 0100644 # p './src/scrollbar-x.c' 22627 1095707999 0100644 # p './src/scrollbar.c' 32040 1095707999 0100644 # p './src/search.c' 98084 1097774785 0100644 # p './src/select-gtk.c' 14575 1095707999 0100644 # p './src/select-msw.c' 17493 1095707999 0100644 # p './src/select-x.c' 46665 1095707999 0100644 # p './src/sgiplay.c' 18538 1095707999 0100644 # p './src/signal.c' 47323 1095708000 0100644 # p './src/sound.c' 20515 1095795867 0100644 # p './src/specifier.c' 107027 1095708000 0100644 # p './src/sunpro.c' 2755 1095708000 0100644 # p './src/symbols.c' 116275 1095708000 0100644 # p './src/symsinit.h' 19002 1081205396 0100644 # p './src/syntax.c' 70427 1095818811 0100644 # p './src/sysdep.c' 114275 1098206347 0100644 # p './src/sysdll.c' 10077 1084548880 0100644 # p './src/sysdll.h' 1476 1084548880 0100644 # p './src/sysproc.h' 6711 1095708002 0100644 # p './src/syssignal.h' 9972 1095708002 0100644 # p './src/syswait.h' 1545 1095708002 0100644 # p './src/terminfo.c' 2997 1095708002 0100644 # p './src/tests.c' 16184 1095708002 0100644 # p './src/text.c' 118821 1097774785 0100644 # p './src/text.h' 115231 1097774785 0100644 # p './src/toolbar-common.c' 20052 1092322295 0100644 # p './src/toolbar-gtk.c' 2455 1095708003 0100644 # p './src/toolbar-msw.c' 18456 1095708003 0100644 # p './src/toolbar-x.c' 2886 1095708003 0100644 # p './src/toolbar.c' 61872 1095708003 0100644 # p './src/tooltalk.c' 42411 1095708004 0100644 # p './src/ui-byhand.c' 18914 1095708004 0100644 # p './src/ui-gtk.c' 53109 1095708004 0100644 # p './src/undo.c' 15124 1095818812 0100644 # p './src/unexaix.c' 17341 1095708004 0100644 # p './src/unexalpha.c' 11977 1095708005 0100644 # p './src/unexconvex.c' 16633 1095708005 0100644 # p './src/unexcw.c' 16211 1095708005 0100644 # p './src/unexec.c' 33896 1095708005 0100644 # p './src/unexelf.c' 40900 1095708005 0100644 # p './src/unexelfsgi.c' 20314 1095708005 0100644 # p './src/unexencap.c' 3207 1095708006 0100644 # p './src/unexenix.c' 7299 1095708006 0100644 # p './src/unexfreebsd.c' 20912 1095708006 0100644 # p './src/unexfx2800.c' 1176 1095708006 0100644 # p './src/unexhp9k3.c' 14653 1095708006 0100644 # p './src/unexhp9k800.c' 11322 1095708006 0100644 # p './src/unexmips.c' 10039 1095708006 0100644 # p './src/unexnt.c' 18750 1095708006 0100644 # p './src/unexsni.c' 29348 1095708007 0100644 # p './src/unexsol2-6.c' 1302 1095708007 0100644 # p './src/unexsol2.c' 1788 1095708007 0100644 # p './src/unexsunos4.c' 19269 1095708007 0100644 # p './src/unicode.c' 67695 1097774785 0100644 # p './src/vm-limit.c' 4061 1095708007 0100644 # p './src/win32.c' 18540 1095708007 0100644 # p './src/window.c' 173332 1095737295 0100644 # p './tests/ChangeLog' 19518 1098421831 0100644 # p './tests/automated/lisp-tests.el' 43207 1084462398 0100644 # p './tests/automated/mule-tests.el' 15888 1082355754 0100644 # p './tests/automated/regexp-tests.el' 13849 1097136104 0100644 # c './tests/automated/tag-tests.el' 0 1084466487 0100644 # p './tests/automated/test-harness.el' 18953 1083596931 0100644 # p './version.sh' 249 1098421831 0100644 #### End of ApplyPatch data #### #### End of Patch kit [created: Fri Oct 22 16:07:08 2004] #### #### Patch checksum: 52828 1820130 20961 #### #### Checksum: 52881 1821908 36972 ####