Mercurial > hg > xemacs-beta
changeset 272:c5d627a313b1 r21-0b34
Import from CVS: tag r21-0b34
line wrap: on
line diff
--- a/CHANGES-beta Mon Aug 13 10:27:41 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 10:28:48 2007 +0200 @@ -1,4 +1,16 @@ -*- indented-text -*- +to 21.0 beta34 "Oberhasli" +-- defsymbol cleanup from Martin Buchholz +-- miscellaneous patches from Martin Buchholz +-- MS Windows fixes from Andy Piper +-- various motion changes from Greg Klanderman +-- dynamic info dir/localdir courtesy of Oscar Figueiredo +-- Various patches from Kyle Jones and Hrvoje Niksic +-- package path startup fixes from Michael Sperber +-- Speed fix/MS Windows cleanup patches from Kirill Katsnelson +-- Martin patches +-- miscellaneous bug fixes + to 21.0 beta33 "Nigerian Dwarf" -- Various MS Windows patches from Kirill Katsnelson, Andy Piper and Jonathon Harris
--- a/ChangeLog Mon Aug 13 10:27:41 2007 +0200 +++ b/ChangeLog Mon Aug 13 10:28:48 2007 +0200 @@ -1,3 +1,81 @@ +1998-04-04 SL Baur <steve@altair.xemacs.org> + + * XEmacs 21.0-beta34 is released. + +1998-04-03 Martin Buchholz <martin@xemacs.org> + + * configure.in: + checking whether gettimeofday accepts one or two arguments... two + +1998-04-03 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * configure.in: Fixed magic to handle AIX and MIT X11R6. + +1998-04-02 Martin Buchholz <martin@xemacs.org> + + * configure.in: Add magic -T $srcdir/ppc.ldscript on Linux powerpc + +1998-04-01 Martin Buchholz <martin@xemacs.org> + + * tests/database.el (test-database): Temporary files (the databases + that were created) should be deleted. + + * Makefile.in (testdir): Remove gnumake-specific syntax. + (src/Makefile): src/Makefile depends on src/depend. + +1998-03-29 Martin Buchholz <martin@xemacs.org> + + * configure.in: Check for -lz, -lgz unconditionally. Too many + system linkers don't properly die when there are cascaded link + dependencies, so we can't rely on the linker for that. The only + downside is that we might link with an extra unneeded library. If + you really really care about this, you can go fix it. + + * configure.in: Enhance PANIC msg to make it clear that + --with-FEATURE is going to die if FEATURE is not installed. + +1998-03-27 Martin Buchholz <martin@xemacs.org> + + * configure.in: $debug was not properly dependent on $beta + + * configure.in: Move offix configuration out of src/Makefile.in.in + into configure.in. + + * configure.in: Reorganize xpm detection code. + + * configure.in: XIM default to ON if Motif which is not Lesstif is + found. + + * configure.in: Keep auto-generated makefile dependencies out of + src/Makefile.in.in by using AC_OUTPUT file concatenation support. + +1998-03-26 Martin Buchholz <martin@xemacs.org> + + * configure.in: Fix up cflags handling. Specifically, configure + --cflags='' would fail to be recognized. + + * configure.in: Fix up png detection. Link with png_read_image to + make sure -lz is required. Test for png >- 0.96 via header file. + +1998-03-21 Martin Buchholz <martin@xemacs.org> + + * configure.in (XE_GCC_WRAP_LDFLAGS) + Rename to XE_PROTECT_LINKER_FLAGS. Rewrite. + + * configure.in: Make sure BSD always links in libz.a + BSD's stupid linker can't detect cascaded lib dependencies + + * configure.in: Autodetect lesstif. define have_lesstif. + Don't use motif-xim with lesstif, at least by default. + +1998-03-30 SL Baur <steve@altair.xemacs.org> + + * version.sh: Add InfoDock version number variables. + +1998-03-30 Amir J. Katz <amir@ndsoft.com> + + * info/dir: Replaced string '20.5' with '21.0' + 1998-03-24 SL Baur <steve@altair.xemacs.org> * XEmacs 21.0-beta33 is released.
--- a/INSTALL Mon Aug 13 10:27:41 2007 +0200 +++ b/INSTALL Mon Aug 13 10:28:48 2007 +0200 @@ -27,11 +27,11 @@ insufficient, you will get an error in the command `temacs -batch -l loadup dump', found in `./src/Makefile.in.in', or possibly when running the final dumped XEmacs. - + Building XEmacs requires about 41 Mb of disk space (including the XEmacs sources). Once installed, XEmacs occupies about 16 Mb in the file system where it is installed; this includes the executable files, -Lisp libraries, miscellaneous data files, and on-line documentation. +Lisp libraries, miscellaneous data files, and on-line documentation. The amount of storage of the Lisp directories may be reduced by compressing the .el files. If the building and installation take place in different directories, then the installation procedure temporarily @@ -51,8 +51,8 @@ on your system, obtain, build and install those external packages before building XEmacs. The packages XEmacs can use are: - Xaw3d, XPM, JPEG, compface, PNG, zlib, OffiX, GNU DBM, Berkeley DB, - socks, term, NAS, Canna, Kinput2, SJ3, Wnn. + Xaw3d, XPM, JPEG, compface, PNG, zlib, GNU DBM, Berkeley DB, socks, + term, NAS, Canna, Kinput2, SJ3, Wnn. You can get (most of) them from the XEmacs ftp site at ftp://ftp.xemacs.org/pub/xemacs/aux @@ -62,7 +62,7 @@ libraries are statically linked. Use the --site-includes and --site-libraries options when building -XEmacs to allow configure to find the external software packages. +XEmacs to allow configure to find the external software packages. If you link with dynamic (``.so'') external package libraries, which is not recommended, you will also need to add the library directories to the --site-runtime-libraries option. @@ -101,7 +101,7 @@ VENDOR, and OPSYS. Also check `./etc/MACHINES' for advice on building on particular machines. -If you don't want X support, specify `--with-x=no'. If you omit this +If you don't want X support, specify `--without-x'. If you omit this option, `configure' will try to autodetect whether your system has X, and arrange to use it if present. @@ -115,7 +115,7 @@ to specify additional places the compiler should look for include files and object libraries. You may specify multiple DIR's by enclosing the list in quotes. All the external packages you want to -use with XEmacs (e.g. xpm, wnn, ...) described later should have their +use with XEmacs (e.g. xpm, wnn, ...) described later should have their include and library directories defined using these options. The `--site-runtime-libraries=DIR' option specifies directories to @@ -166,7 +166,7 @@ emacs dynamically rather than statically. The `--const-is-losing' option is for use if you have trouble -compiling due to the `const' storage class in C. This is defined by +compiling due to the `const' storage class in C. This is defined by default. Most users should have no need to change this. You can build XEmacs for several different machine types from a single @@ -253,22 +253,23 @@ The `--with-sparcworks' option specifies that XEmacs should be built with support for Sun Sparcworks 3.0.1 and up (including Sun WorkShop). This functionality is only of use on SunOS 4.1.x and Solaris 2.x -systems. If you use this option, you should have the Sun package (see +systems. If you use this option, you should have the Sun package (see etc/PACKAGES) installed prior to building XEmacs. The `--with-cde' option allows you to enable or disable CDE drag and drop support. `configure' will attempt to detect this option and define `--with-cde' for you. -The `--with-offix' option allows you to enable or disable OffiX drag and -drop support. `configure' will attempt to detect this option and -define `--with-offix' for you. +The `--with-offix' option allows you to enable or disable OffiX drag +and drop support. This requires no external library support, so if +X11 support is available, then this option defaults to `yes'. OffiX +support can be explicitly disabled via the `--without-offix' option. The `--external-widget' option specifies that XEmacs should be built with support for being used as a widget by other X11 applications. This functionality should be considered beta. -The `--with-xmu=no' option can be used if your vendor doesn't ship +The `--without-xmu' option can be used if your vendor doesn't ship the Xmu library. The `--puresize' option can be used to change the amount of purespace @@ -342,9 +343,9 @@ the `locale' package which contains localized Splash screens and Menubars. -The `--with-xfs' option enables use of a multilingual Menubar. At the +The `--with-xfs' option enables use of a multilingual Menubar. At the present time, only Japanese and French locales are supported. In -order to use a multilingual Menubar you must have the `locale' package +order to use a multilingual Menubar you must have the `locale' package installed. The `locale' package does not have to be installed when building XEmacs. @@ -356,7 +357,7 @@ 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 +`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
--- a/Makefile.in Mon Aug 13 10:27:41 2007 +0200 +++ b/Makefile.in Mon Aug 13 10:28:48 2007 +0200 @@ -377,7 +377,7 @@ Makefile: ${srcdir}/Makefile.in config.status ./config.status -src/Makefile: ${srcdir}/src/Makefile.in.in config.status +src/Makefile: ${srcdir}/src/Makefile.in.in ${srcdir}/src/depend config.status ./config.status lib-src/Makefile: ${srcdir}/lib-src/Makefile.in.in config.status @@ -658,12 +658,12 @@ done ; \ etags -a lwlib/*.[ch] -check: - @echo "We don't have any automated tests for XEmacs yet." +## We have automated tests! +testdir = ${srcdir}/tests +tests = ${testdir}/basic-lisp.el ${testdir}/database.el -## Is this something Chuck used and doesn't work with CVS? -slb -## dist: -## cd ${srcdir} && make-dist +check: + src/xemacs -batch -l ${testdir}/test-emacs.el -f batch-test-emacs ${tests} info: FRC.info cd ${srcdir}/man && $(RECURSIVE_MAKE) $@
--- a/configure Mon Aug 13 10:27:41 2007 +0200 +++ b/configure Mon Aug 13 10:28:48 2007 +0200 @@ -238,14 +238,11 @@ with_scrollbars='' with_dialogs='' with_file_coding='' -const_is_losing='yes' puresize='' -cflags='UNSPECIFIED' +cpp='' cppflags='' libs='' ldflags='' dynamic='' with_x11='' with_msw='' -with_gung='no' -with_minimal_tagbits='no' rel_alloc='default' with_system_malloc='default' with_dlmalloc='default' @@ -310,7 +307,6 @@ with_gcc | \ with_gnu_make | \ dynamic | \ - with_gung | \ with_ncurses | \ with_dnet | \ with_socks | \ @@ -351,6 +347,10 @@ use_union_type | \ debug | \ use_assertions | \ + use_minimal_tagbits | \ + use_indexed_lrecord_implementation | \ + gung_ho | \ + use_assertions | \ memory_usage_stats | \ with_clash_detection | \ with_shlib | \ @@ -368,6 +368,10 @@ srcdir | \ compiler | \ cflags | \ + cpp | \ + cppflags | \ + libs | \ + ldflags | \ puresize | \ cache_file | \ native_sound_lib | \ @@ -595,6 +599,12 @@ done +test -n "$cpp" && CPP="$cpp" +test -n "$cppflags" && CPPFLAGS="$cppflags" +test -n "$libs" && LIBS="$libs" +test -n "$ldflags" && LDFLAGS="$ldflags" + + eval set x "$quoted_arguments"; shift test "$extra_verbose" = "yes" && verbose=yes @@ -606,6 +616,20 @@ test -n "$with_x" && with_x11="$with_x" + +if test -n "$gung_ho"; then + test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho" + test -z "$use_indexed_lrecord_implementation" && \ + use_indexed_lrecord_implementation="$gung_ho" +fi +if test "$use_minimal_tagbits" = "no"; then + test "$with_dlmalloc" = "yes" && \ + (echo "$progname: Usage error:" +echo " " --with-dlmalloc=yes requires --use-minimal-tagbits=yes +echo " Use \`$progname --help' to show usage.") >&2 && exit 1 + with_dlmalloc=no +fi + if test "$run_in_place" = "yes"; then echo "configure: warning: "The --run-in-place option is ignored because it is unnecessary."" 1>&2 fi @@ -646,7 +670,7 @@ if test -z "$configuration"; then echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:650: checking "host system type"" >&5 +echo "configure:674: checking "host system type"" >&5 if configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess | \ sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` ; then echo "$ac_t""$configuration" 1>&6 @@ -660,7 +684,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:664: checking whether ln -s works" >&5 +echo "configure:688: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -804,7 +828,7 @@ EOF } -if test "${debug=beta}" = "yes"; then +if test "${debug:=$beta}" = "yes"; then use_assertions=yes memory_usage_stats=yes extra_objs="$extra_objs debug.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"debug.o\"" @@ -837,7 +861,7 @@ echo "checking "the configuration name"" 1>&6 -echo "configure:841: checking "the configuration name"" >&5 +echo "configure:865: checking "the configuration name"" >&5 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'` if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else exit $? @@ -1290,13 +1314,18 @@ if test "$with_gcc" = "no"; then case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac fi -test "$cflags" != "UNSPECIFIED" && CFLAGS="$cflags" +test "${cflags-unset}" != unset && CFLAGS="$cflags" +if test "${CFLAGS-unset}" != unset + then cflags_specified=yes; + else cflags_specified=no; +fi + xe_save_CFLAGS="$CFLAGS" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1300: checking for $ac_word" >&5 +echo "configure:1329: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1322,7 +1351,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:1326: checking for $ac_word" >&5 +echo "configure:1355: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1367,7 +1396,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1371: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1400: 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' @@ -1379,11 +1408,11 @@ cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1383 "configure" +#line 1412 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 @@ -1403,19 +1432,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:1407: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1436: 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:1412: checking whether we are using GNU C" >&5 +echo "configure:1441: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1448: \"$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 @@ -1429,7 +1458,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1433: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1462: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1458,7 +1487,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:1462: checking for $ac_word" >&5 +echo "configure:1491: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1484,7 +1513,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:1488: checking for $ac_word" >&5 +echo "configure:1517: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1529,7 +1558,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1533: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1562: 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' @@ -1541,11 +1570,11 @@ cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1545 "configure" +#line 1574 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 @@ -1565,19 +1594,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:1569: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1598: 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:1574: checking whether we are using GNU C" >&5 +echo "configure:1603: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1610: \"$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 @@ -1591,7 +1620,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1595: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1624: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1620,7 +1649,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:1624: checking for $ac_word" >&5 +echo "configure:1653: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1646,7 +1675,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:1650: checking for $ac_word" >&5 +echo "configure:1679: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1691,7 +1720,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1724: 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' @@ -1703,11 +1732,11 @@ cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1707 "configure" +#line 1736 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 @@ -1727,19 +1756,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:1731: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1760: 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:1736: checking whether we are using GNU C" >&5 +echo "configure:1765: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1772: \"$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 @@ -1753,7 +1782,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1757: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1786: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1786,7 +1815,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:1790: checking how to run the C preprocessor" >&5 +echo "configure:1819: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1799,13 +1828,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1803 "configure" +#line 1832 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1816,13 +1845,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1820 "configure" +#line 1849 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1845,9 +1874,9 @@ echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1849: checking for AIX" >&5 -cat > conftest.$ac_ext <<EOF -#line 1851 "configure" +echo "configure:1878: checking for AIX" >&5 +cat > conftest.$ac_ext <<EOF +#line 1880 "configure" #include "confdefs.h" #ifdef _AIX yes @@ -1874,9 +1903,9 @@ echo $ac_n "checking for GNU libc""... $ac_c" 1>&6 -echo "configure:1878: checking for GNU libc" >&5 -cat > conftest.$ac_ext <<EOF -#line 1880 "configure" +echo "configure:1907: checking for GNU libc" >&5 +cat > conftest.$ac_ext <<EOF +#line 1909 "configure" #include "confdefs.h" #include <features.h> int main() { @@ -1888,7 +1917,7 @@ ; return 0; } EOF -if { (eval echo configure:1892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -1899,11 +1928,19 @@ fi rm -f conftest* echo "$ac_t""$have_glibc" 1>&6 +test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF + Defining _GNU_SOURCE +EOF +cat >> confdefs.h <<\EOF +#define _GNU_SOURCE 1 +EOF +} + echo $ac_n "checking whether we are using SunPro C""... $ac_c" 1>&6 -echo "configure:1905: checking whether we are using SunPro C" >&5 -cat > conftest.$ac_ext <<EOF -#line 1907 "configure" +echo "configure:1942: checking whether we are using SunPro C" >&5 +cat > conftest.$ac_ext <<EOF +#line 1944 "configure" #include "confdefs.h" int main() { @@ -1914,7 +1951,7 @@ ; return 0; } EOF -if { (eval echo configure:1918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* __sunpro_c=yes else @@ -2087,37 +2124,6 @@ #endif -#if 0 -#ifdef THIS_IS_CONFIGURE - -/* Get the CFLAGS for tests in configure. */ -#ifndef C_DEBUG_SWITCH -#define C_DEBUG_SWITCH "-g" -#endif -configure___ c_debug_switch=C_DEBUG_SWITCH - -#ifndef C_OPTIMIZE_SWITCH -#define C_OPTIMIZE_SWITCH "-O" -#endif -configure___ c_optimize_switch=C_OPTIMIZE_SWITCH - -#ifdef __GNUC__ -configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '$SPECIFIED_CFLAGS' -#else -configure___ CFLAGS=C_DEBUG_SWITCH '$SPECIFIED_CFLAGS' -#endif - -#else /* not THIS_IS_CONFIGURE */ - -/* Get the CFLAGS for real compilation. */ -#ifdef __GNUC__ -configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '$SPECIFIED_CFLAGS' -#else -configure___ REAL_CFLAGS=C_DEBUG_SWITCH '$SPECIFIED_CFLAGS' -#endif - -#endif /* not THIS_IS_CONFIGURE */ -#endif /* 0 */ ' > $tempcname CPP=`eval "echo $CPP"` eval `$CPP -Isrc $tempcname \ @@ -2130,7 +2136,7 @@ test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc" -if test -z "$CFLAGS"; then +if test "$cflags_specified" = "no"; then if test "$GCC" = "yes"; then CFLAGS="-g -O2 -Wall -Wno-switch" elif test "$__sunpro_c" = "yes"; then @@ -2141,41 +2147,59 @@ elif test "$CC" = "xlc"; then CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000" else - CFLAGS="-O" ; fi + CFLAGS="-O" ; fi +fi + + +if test "$GCC" = "yes"; then + set x $ld_switch_system; shift; ld_switch_system="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) ld_switch_system="$ld_switch_system $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* ) ld_switch_system="$ld_switch_system $1" ;; + -Xlinker* ) ;; + * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;; + esac + shift + done fi if test "$GCC" = "yes"; then - ld_switch_system_tmp="$ld_switch_system"; ld_switch_system="" - for arg in $ld_switch_system_tmp; do - case "$arg" in - -L* | -l* | -R* | -u* | -Wl* | -f*) ld_switch_system="$ld_switch_system $arg" ;; + set x $ld_switch_machine; shift; ld_switch_machine="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* ) ld_switch_machine="$ld_switch_machine $1" ;; -Xlinker* ) ;; - * ) ld_switch_system="$ld_switch_system -Xlinker $arg" ;; + * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;; esac - done - ld_switch_machine_tmp="$ld_switch_machine"; ld_switch_machine="" - for arg in $ld_switch_machine_tmp; do - case "$arg" in - -L* | -l* | -R* | -u* | -Wl* | -f*) ld_switch_machine="$ld_switch_machine $arg" ;; - -Xlinker* ) ;; - * ) ld_switch_machine="$ld_switch_machine -Xlinker $arg" ;; - esac + shift done - LDFLAGS_tmp="$LDFLAGS"; LDFLAGS="" - for arg in $LDFLAGS_tmp; do - case "$arg" in - -L* | -l* | -R* | -u* | -Wl* | -f*) LDFLAGS="$LDFLAGS $arg" ;; +fi + +if test "$GCC" = "yes"; then + set x $LDFLAGS; shift; LDFLAGS="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) LDFLAGS="$LDFLAGS $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* ) LDFLAGS="$LDFLAGS $1" ;; -Xlinker* ) ;; - * ) LDFLAGS="$LDFLAGS -Xlinker $arg" ;; + * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;; esac + shift done - ld_call_shared_tmp="$ld_call_shared"; ld_call_shared="" - for arg in $ld_call_shared_tmp; do - case "$arg" in - -L* | -l* | -R* | -u* | -Wl* | -f*) ld_call_shared="$ld_call_shared $arg" ;; +fi + +if test "$GCC" = "yes"; then + set x $ld_call_shared; shift; ld_call_shared="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) ld_call_shared="$ld_call_shared $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* ) ld_call_shared="$ld_call_shared $1" ;; -Xlinker* ) ;; - * ) ld_call_shared="$ld_call_shared -Xlinker $arg" ;; + * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;; esac + shift done fi @@ -2190,7 +2214,7 @@ fi echo $ac_n "checking for dynodump""... $ac_c" 1>&6 -echo "configure:2194: checking for dynodump" >&5 +echo "configure:2218: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -2214,17 +2238,19 @@ fi +test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/ppc.ldscript" + if test "$unexec" = "unexaix.o"; then if test "$dynamic" = "no"; then start_flags="-Wl,-bnso,-bnodelcsect" test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}" - for f in "/lib/syscalls.exp" "$srcdir/src/m/ibmrs6000.inp"; do + for f in "/lib/syscalls.exp" "/lib/threads.exp"; do if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi done for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi done - fi + fi elif test -n "$ld_text_start_addr"; then start_flags="-T $ld_text_start_addr -e __start" fi @@ -2244,9 +2270,9 @@ if test -n "$site_prefixes"; then for arg in $site_prefixes; do - case "$arg" in - -* ) ;; - * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;; + case "$arg" in + -* ) ;; + * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;; esac c_switch_site="$c_switch_site $argi" && if test "$extra_verbose" = "yes"; then echo " Appending \"$argi\" to \$c_switch_site"; fi ld_switch_site="$ld_switch_site $argl" && if test "$extra_verbose" = "yes"; then echo " Appending \"$argl\" to \$ld_switch_site"; fi @@ -2260,7 +2286,7 @@ done fi -if test -n "$site_includes" ; then +if test -n "$site_includes"; then for arg in $site_includes; do case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac c_switch_site="$c_switch_site $arg" && if test "$extra_verbose" = "yes"; then echo " Appending \"$arg\" to \$c_switch_site"; fi @@ -2272,7 +2298,7 @@ test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L${dir}\" to \$ld_switch_site"; fi done -if test -n "$site_runtime_libraries" ; then +if test -n "$site_runtime_libraries"; then LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/ */:/g'`" export LD_RUN_PATH fi @@ -2288,19 +2314,32 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:2292: checking "for runtime libraries flag"" >&5 +echo "configure:2318: checking "for runtime libraries flag"" >&5 dash_r="" for try_dash_r in "-R" "-R " "-rpath "; do xe_check_libs="${try_dash_r}/no/such/file-or-directory" + +if test "$GCC" = "yes"; then + set x $xe_check_libs; shift; xe_check_libs="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) xe_check_libs="$xe_check_libs $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* ) xe_check_libs="$xe_check_libs $1" ;; + -Xlinker* ) ;; + * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;; + esac + shift + done +fi cat > conftest.$ac_ext <<EOF -#line 2297 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 2336 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* dash_r="$try_dash_r" else @@ -2373,6 +2412,19 @@ fi if test -n "$runpath"; then ld_switch_run="${dash_r}${runpath}" + +if test "$GCC" = "yes"; then + set x $ld_switch_run; shift; ld_switch_run="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) ld_switch_run="$ld_switch_run $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;; + -Xlinker* ) ;; + * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;; + esac + shift + done +fi test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" fi fi @@ -2387,10 +2439,10 @@ fi after_morecore_hook_exists=yes echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6 -echo "configure:2391: checking for malloc_get_state" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2394 "configure" +echo "configure:2443: checking for malloc_get_state" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2446 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char malloc_get_state(); below. */ @@ -2413,7 +2465,7 @@ ; return 0; } EOF -if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_malloc_get_state=yes" else @@ -2433,10 +2485,10 @@ fi echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:2437: checking for malloc_set_state" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2440 "configure" +echo "configure:2489: checking for malloc_set_state" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2492 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char malloc_set_state(); below. */ @@ -2459,7 +2511,7 @@ ; return 0; } EOF -if { (eval echo configure:2463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_malloc_set_state=yes" else @@ -2479,16 +2531,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:2483: checking whether __after_morecore_hook exists" >&5 -cat > conftest.$ac_ext <<EOF -#line 2485 "configure" +echo "configure:2535: checking whether __after_morecore_hook exists" >&5 +cat > conftest.$ac_ext <<EOF +#line 2537 "configure" #include "confdefs.h" extern void (* __after_morecore_hook)(); int main() { __after_morecore_hook = 0 ; return 0; } EOF -if { (eval echo configure:2492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2526,14 +2578,6 @@ EOF } - { test "$extra_verbose" = "yes" && cat << \EOF - Defining USE_MINIMAL_TAGBITS -EOF -cat >> confdefs.h <<\EOF -#define USE_MINIMAL_TAGBITS 1 -EOF -} - if test "$after_morecore_hook_exists" = "no" ; then GNU_MALLOC_reason=" (Using Doug Lea's new malloc from the Linux C Library.)" @@ -2546,7 +2590,7 @@ } fi - with_minimal_tagbits=yes + use_minimal_tagbits=yes fi @@ -2555,7 +2599,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:2559: checking for $ac_word" >&5 +echo "configure:2603: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -2608,7 +2652,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:2612: checking for a BSD compatible install" >&5 +echo "configure:2656: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" @@ -2659,7 +2703,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:2663: checking for $ac_word" >&5 +echo "configure:2707: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2690,15 +2734,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2694: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2697 "configure" +echo "configure:2738: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2741 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2731,15 +2775,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2735: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2738 "configure" +echo "configure:2779: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2782 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2772,15 +2816,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2776: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2779 "configure" +echo "configure:2820: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2823 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2810,10 +2854,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:2814: checking for sys/wait.h that is POSIX.1 compatible" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2817 "configure" +echo "configure:2858: checking for sys/wait.h that is POSIX.1 compatible" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2861 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -2829,7 +2873,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:2833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -2853,10 +2897,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2857: checking for ANSI C header files" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2860 "configure" +echo "configure:2901: checking for ANSI C header files" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2904 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -2864,7 +2908,7 @@ #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2881,7 +2925,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 -#line 2885 "configure" +#line 2929 "configure" #include "confdefs.h" #include <string.h> EOF @@ -2899,7 +2943,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 -#line 2903 "configure" +#line 2947 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -2917,7 +2961,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 <<EOF -#line 2921 "configure" +#line 2965 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2928,7 +2972,7 @@ exit (0); } EOF -if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:2976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then : else @@ -2953,10 +2997,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2957: checking whether time.h and sys/time.h may both be included" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2960 "configure" +echo "configure:3001: checking whether time.h and sys/time.h may both be included" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3004 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -2965,7 +3009,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2989,10 +3033,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:2993: checking for sys_siglist declaration in signal.h or unistd.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2996 "configure" +echo "configure:3037: checking for sys_siglist declaration in signal.h or unistd.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3040 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -3004,7 +3048,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3029,9 +3073,9 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:3033: checking for struct utimbuf" >&5 -cat > conftest.$ac_ext <<EOF -#line 3035 "configure" +echo "configure:3077: checking for struct utimbuf" >&5 +cat > conftest.$ac_ext <<EOF +#line 3079 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME #include <sys/time.h> @@ -3050,7 +3094,7 @@ static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:3054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3098: \"$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 @@ -3070,10 +3114,10 @@ rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3074: checking return type of signal handlers" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3077 "configure" +echo "configure:3118: checking return type of signal handlers" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3121 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -3090,7 +3134,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3112,10 +3156,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3116: checking for size_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3119 "configure" +echo "configure:3160: checking for size_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3163 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3146,10 +3190,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3150: checking for pid_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3153 "configure" +echo "configure:3194: checking for pid_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3197 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3180,10 +3224,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3184: checking for uid_t in sys/types.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3187 "configure" +echo "configure:3228: checking for uid_t in sys/types.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3231 "configure" #include "confdefs.h" #include <sys/types.h> EOF @@ -3219,10 +3263,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3223: checking for mode_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3226 "configure" +echo "configure:3267: checking for mode_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3270 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3253,10 +3297,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3257: checking for off_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3260 "configure" +echo "configure:3301: checking for off_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3304 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3288,9 +3332,9 @@ echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:3292: checking for struct timeval" >&5 -cat > conftest.$ac_ext <<EOF -#line 3294 "configure" +echo "configure:3336: checking for struct timeval" >&5 +cat > conftest.$ac_ext <<EOF +#line 3338 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME #include <sys/time.h> @@ -3306,7 +3350,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -3328,10 +3372,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:3332: checking whether struct tm is in sys/time.h or time.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3335 "configure" +echo "configure:3376: checking whether struct tm is in sys/time.h or time.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3379 "configure" #include "confdefs.h" #include <sys/types.h> #include <time.h> @@ -3339,7 +3383,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3363,10 +3407,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3367: checking for tm_zone in struct tm" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3370 "configure" +echo "configure:3411: checking for tm_zone in struct tm" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3414 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_cv_struct_tm> @@ -3374,7 +3418,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:3378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -3397,10 +3441,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:3401: checking for tzname" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3404 "configure" +echo "configure:3445: checking for tzname" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3448 "configure" #include "confdefs.h" #include <time.h> #ifndef tzname /* For SGI. */ @@ -3410,7 +3454,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -3436,10 +3480,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3440: checking for working const" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3443 "configure" +echo "configure:3484: checking for working const" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3487 "configure" #include "confdefs.h" int main() { @@ -3488,7 +3532,7 @@ ; return 0; } EOF -if { (eval echo configure:3492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3513,7 +3557,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:3517: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:3561: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -3538,12 +3582,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:3542: checking whether byte ordering is bigendian" >&5 +echo "configure:3586: checking whether byte ordering is bigendian" >&5 ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext <<EOF -#line 3547 "configure" +#line 3591 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -3554,11 +3598,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:3558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext <<EOF -#line 3562 "configure" +#line 3606 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -3569,7 +3613,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:3573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3586,7 +3630,7 @@ rm -f conftest* if test $ac_cv_c_bigendian = unknown; then cat > conftest.$ac_ext <<EOF -#line 3590 "configure" +#line 3634 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -3599,7 +3643,7 @@ exit (u.c[sizeof (long) - 1] == 1); } EOF -if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_c_bigendian=no else @@ -3625,10 +3669,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:3629: checking size of short" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3632 "configure" +echo "configure:3673: checking size of short" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3676 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3639,7 +3683,7 @@ exit(0); } EOF -if { (eval echo configure:3643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -3666,10 +3710,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:3670: checking size of int" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3673 "configure" +echo "configure:3714: checking size of int" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3717 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3680,7 +3724,7 @@ exit(0); } EOF -if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -3701,10 +3745,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:3705: checking size of long" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3708 "configure" +echo "configure:3749: checking size of long" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3752 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3715,7 +3759,7 @@ exit(0); } EOF -if { (eval echo configure:3719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -3736,10 +3780,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:3740: checking size of long long" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3743 "configure" +echo "configure:3784: checking size of long long" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3787 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3750,7 +3794,7 @@ exit(0); } EOF -if { (eval echo configure:3754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3798: \"$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 @@ -3771,10 +3815,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:3775: checking size of void *" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3778 "configure" +echo "configure:3819: checking size of void *" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3822 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3785,7 +3829,7 @@ exit(0); } EOF -if { (eval echo configure:3789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3833: \"$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 @@ -3807,7 +3851,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:3811: checking for long file names" >&5 +echo "configure:3855: 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: @@ -3854,12 +3898,12 @@ echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:3858: checking for sin in -lm" >&5 +echo "configure:3902: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` xe_check_libs=" -lm " cat > conftest.$ac_ext <<EOF -#line 3863 "configure" +#line 3907 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3870,7 +3914,7 @@ sin() ; return 0; } EOF -if { (eval echo configure:3874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3912,14 +3956,14 @@ cat > conftest.$ac_ext <<EOF -#line 3916 "configure" +#line 3960 "configure" #include "confdefs.h" #include <math.h> int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:3923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_INVERSE_HYPERBOLIC @@ -3936,7 +3980,7 @@ rm -f conftest* echo "checking type of mail spool file locking" 1>&6 -echo "configure:3940: checking type of mail spool file locking" >&5 +echo "configure:3984: checking type of mail spool file locking" >&5 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf if test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF @@ -3960,12 +4004,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:3964: checking for kstat_open in -lkstat" >&5 +echo "configure:4008: checking for kstat_open in -lkstat" >&5 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lkstat " cat > conftest.$ac_ext <<EOF -#line 3969 "configure" +#line 4013 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3976,7 +4020,7 @@ kstat_open() ; return 0; } EOF -if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4010,12 +4054,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:4014: checking for kvm_read in -lkvm" >&5 +echo "configure:4058: checking for kvm_read in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` xe_check_libs=" -lkvm " cat > conftest.$ac_ext <<EOF -#line 4019 "configure" +#line 4063 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4026,7 +4070,7 @@ kvm_read() ; return 0; } EOF -if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4060,12 +4104,12 @@ echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4064: checking for cma_open in -lpthreads" >&5 +echo "configure:4108: checking for cma_open in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lpthreads " cat > conftest.$ac_ext <<EOF -#line 4069 "configure" +#line 4113 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4076,7 +4120,7 @@ cma_open() ; return 0; } EOF -if { (eval echo configure:4080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4112,7 +4156,7 @@ fi echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:4116: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:4160: 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; @@ -4123,7 +4167,7 @@ if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6 -echo "configure:4127: checking for \"-z ignore\" linker flag" >&5 +echo "configure:4171: 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 ;; @@ -4133,29 +4177,32 @@ echo "checking "for specified window system"" 1>&6 -echo "configure:4137: checking "for specified window system"" >&5 +echo "configure:4181: checking "for specified window system"" >&5 if test "$with_x11" != "no"; then test "$x_includes $x_libraries" != "NONE NONE" && \ window_system=x11 with_x11=yes - if test "$x_includes $x_libraries" = "NONE NONE"; then - if test -n "$OPENWINHOME" \ - -a "$OPENWINHOME" != "/usr/openwin" \ - -a -d "$OPENWINHOME"; then + + if test "$x_includes $x_libraries" = "NONE NONE" \ + -a -n "$OPENWINHOME" \ + -a "$OPENWINHOME" != "/usr/openwin" \ + -a -d "$OPENWINHOME"; then test -d "$OPENWINHOME/lib" && x_libraries="$OPENWINHOME/lib" test -d "$OPENWINHOME/include" && x_includes="$OPENWINHOME/include" test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include" - else - for dir in "/usr/X11R6/include" "/usr/include/X11R6"; do - if test -d "$dir/X11"; then x_includes="$dir"; break; fi - done - if test "$x_includes" != "NONE"; then - for dir in "/usr/X11R6/lib" "/usr/lib/X11R6"; do - if test -d "$dir"; then x_libraries="$dir"; break; fi - done - fi - fi + fi + + if test "$x_includes" = "NONE"; then + for dir in "/usr/X11" "/usr/X11R6"; do + if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi + done + fi + + if test "$x_libraries" = "NONE"; then + for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do + if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi + done fi # If we find X, set shell vars x_includes and x_libraries to the @@ -4163,7 +4210,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:4167: checking for X" >&5 +echo "configure:4214: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4223,12 +4270,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 4227 "configure" +#line 4274 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4297,14 +4344,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 4301 "configure" +#line 4348 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -4413,17 +4460,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:4417: checking whether -R must be followed by a space" >&5 +echo "configure:4464: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <<EOF -#line 4420 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 4467 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -4439,14 +4486,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <<EOF -#line 4443 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:4450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 4490 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -4482,12 +4529,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:4486: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4533: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet " cat > conftest.$ac_ext <<EOF -#line 4491 "configure" +#line 4538 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4498,7 +4545,7 @@ dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:4502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4522,12 +4569,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:4526: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4573: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet_stub " cat > conftest.$ac_ext <<EOF -#line 4531 "configure" +#line 4578 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4538,7 +4585,7 @@ dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:4542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4567,10 +4614,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:4571: checking for gethostbyname" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4574 "configure" +echo "configure:4618: checking for gethostbyname" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4621 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname(); below. */ @@ -4593,7 +4640,7 @@ ; return 0; } EOF -if { (eval echo configure:4597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4614,12 +4661,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4618: checking for gethostbyname in -lnsl" >&5 +echo "configure:4665: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` xe_check_libs=" -lnsl " cat > conftest.$ac_ext <<EOF -#line 4623 "configure" +#line 4670 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4630,7 +4677,7 @@ gethostbyname() ; return 0; } EOF -if { (eval echo configure:4634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4660,10 +4707,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:4664: checking for connect" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4667 "configure" +echo "configure:4711: checking for connect" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4714 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect(); below. */ @@ -4686,7 +4733,7 @@ ; return 0; } EOF -if { (eval echo configure:4690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4709,12 +4756,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:4713: checking "$xe_msg_checking"" >&5 +echo "configure:4760: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocket $X_EXTRA_LIBS" cat > conftest.$ac_ext <<EOF -#line 4718 "configure" +#line 4765 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4725,7 +4772,7 @@ connect() ; return 0; } EOF -if { (eval echo configure:4729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4749,10 +4796,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:4753: checking for remove" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4756 "configure" +echo "configure:4800: checking for remove" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4803 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove(); below. */ @@ -4775,7 +4822,7 @@ ; return 0; } EOF -if { (eval echo configure:4779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -4796,12 +4843,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:4800: checking for remove in -lposix" >&5 +echo "configure:4847: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` xe_check_libs=" -lposix " cat > conftest.$ac_ext <<EOF -#line 4805 "configure" +#line 4852 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4812,7 +4859,7 @@ remove() ; return 0; } EOF -if { (eval echo configure:4816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4836,10 +4883,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:4840: checking for shmat" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4843 "configure" +echo "configure:4887: checking for shmat" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4890 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat(); below. */ @@ -4862,7 +4909,7 @@ ; return 0; } EOF -if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -4883,12 +4930,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:4887: checking for shmat in -lipc" >&5 +echo "configure:4934: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` xe_check_libs=" -lipc " cat > conftest.$ac_ext <<EOF -#line 4892 "configure" +#line 4939 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4899,7 +4946,7 @@ shmat() ; return 0; } EOF -if { (eval echo configure:4903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4933,12 +4980,12 @@ # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:4937: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:4984: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` xe_check_libs=" -lICE " cat > conftest.$ac_ext <<EOF -#line 4942 "configure" +#line 4989 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4949,7 +4996,7 @@ IceConnectionNumber() ; return 0; } EOF -if { (eval echo configure:4953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5070,6 +5117,19 @@ fi if test -n "$runpath"; then ld_switch_run="${dash_r}${runpath}" + +if test "$GCC" = "yes"; then + set x $ld_switch_run; shift; ld_switch_run="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) ld_switch_run="$ld_switch_run $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;; + -Xlinker* ) ;; + * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;; + esac + shift + done +fi test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" fi fi @@ -5103,7 +5163,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:5107: checking for X defines extracted by xmkmf" >&5 +echo "configure:5167: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -5135,15 +5195,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:5139: checking for X11/Intrinsic.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5142 "configure" +echo "configure:5199: checking for X11/Intrinsic.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5202 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5167,12 +5227,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:5171: checking for XOpenDisplay in -lX11" >&5 +echo "configure:5231: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <<EOF -#line 5176 "configure" +#line 5236 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5183,7 +5243,7 @@ XOpenDisplay() ; return 0; } EOF -if { (eval echo configure:5187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5208,12 +5268,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:5212: checking "$xe_msg_checking"" >&5 +echo "configure:5272: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 -b i486-linuxaout" cat > conftest.$ac_ext <<EOF -#line 5217 "configure" +#line 5277 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5224,7 +5284,7 @@ XGetFontProperty() ; return 0; } EOF -if { (eval echo configure:5228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5251,12 +5311,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:5255: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:5315: checking for XShapeSelectInput in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'` xe_check_libs=" -lXext " cat > conftest.$ac_ext <<EOF -#line 5260 "configure" +#line 5320 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5267,7 +5327,7 @@ XShapeSelectInput() ; return 0; } EOF -if { (eval echo configure:5271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5290,12 +5350,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:5294: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:5354: checking for XtOpenDisplay in -lXt" >&5 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lXt " cat > conftest.$ac_ext <<EOF -#line 5299 "configure" +#line 5359 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5306,7 +5366,7 @@ XtOpenDisplay() ; return 0; } EOF -if { (eval echo configure:5310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5329,14 +5389,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:5333: checking the version of X11 being used" >&5 +echo "configure:5393: checking the version of X11 being used" >&5 cat > conftest.$ac_ext <<EOF -#line 5335 "configure" +#line 5395 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> - main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; } -EOF -if { (eval echo configure:5340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 + int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; } +EOF +if { (eval echo configure:5400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ./conftest foobar; x11_release=$? else @@ -5360,15 +5420,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5364: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5367 "configure" +echo "configure:5424: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5427 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5399,7 +5459,7 @@ echo $ac_n "checking for XFree86""... $ac_c" 1>&6 -echo "configure:5403: checking for XFree86" >&5 +echo "configure:5463: checking for XFree86" >&5 if test -d "/usr/X386/include" -o \ -f "/etc/XF86Config" -o \ -f "/etc/X11/XF86Config" -o \ @@ -5419,12 +5479,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:5423: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:5483: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` xe_check_libs=" -lXmu " cat > conftest.$ac_ext <<EOF -#line 5428 "configure" +#line 5488 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5435,7 +5495,7 @@ XmuReadBitmapDataFromFile() ; return 0; } EOF -if { (eval echo configure:5439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5474,19 +5534,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:5478: checking for main in -lXbsd" >&5 +echo "configure:5538: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lXbsd " cat > conftest.$ac_ext <<EOF -#line 5483 "configure" +#line 5543 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5508,28 +5568,36 @@ if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then - libs_x="$libs_x -lc_r" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lc_r\" to \$libs_x"; fi + case "$CC" in + "xlc" ) CC="xlc_r" ;; + "xlC" ) CC="xlC_r" ;; + "cc" ) CC="cc_r" ;; + "gcc" ) + X_CFLAGS="-mthreads $X_CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-mthreads\" to \$X_CFLAGS"; fi + libs_x="-mthreads $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-mthreads\" to \$libs_x"; fi + ;; + esac fi fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:5518: checking for MS-Windows" >&5 +echo "configure:5586: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:5521: checking for main in -lgdi32" >&5 +echo "configure:5589: checking for main in -lgdi32" >&5 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdi32 " cat > conftest.$ac_ext <<EOF -#line 5526 "configure" +#line 5594 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5589,12 +5657,32 @@ test -z "$window_system" && window_system="none" -if test "$window_system" = "none" ; then - if test "$with_tty" = "no" ; then - { echo "configure: error: No window system support and no TTY support - Unable to proceed." 1>&2; exit 1; } - fi - for feature in tooltalk cde offix session \ - menubars scrollbars toolbars dialogs xim xmu \ +if test "$window_system" = "none"; then + for feature in menubars scrollbars toolbars dialogs + do + if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then + echo "configure: warning: --with-$feature ignored: Not valid without window system support" 1>&2 + fi + eval "with_${feature}=no" + done +else + test -z "$with_toolbars" && with_toolbars=yes +fi + +if test "$with_msw" != "yes"; then + for feature in MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES + do + if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then + echo "configure: warning: --with-$feature ignored: Not valid without MS-Windows support" 1>&2 + fi + eval "with_${feature}=no" + done +else + : +fi + +if test "$with_x11" != "yes"; then + for feature in tooltalk cde offix session xim xmu \ tiff png jpeg gif xface xpm do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then @@ -5602,15 +5690,13 @@ fi eval "with_${feature}=no" done -else - test -z "$with_toolbars" && with_toolbars=yes fi bitmapdir= case "$window_system" in x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;; - msw ) HAVE_X_WINDOWS=no; echo " Using MS-Windows." ;; + msw ) HAVE_X_WINDOWS=no ; echo " Using MS-Windows." ;; none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;; esac @@ -5620,7 +5706,7 @@ esac echo "checking for session-management option" 1>&6 -echo "configure:5624: checking for session-management option" >&5; +echo "configure:5710: checking for session-management option" >&5; if test "$with_session" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SESSION @@ -5635,15 +5721,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:5639: checking for X11/Xauth.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5642 "configure" +echo "configure:5725: checking for X11/Xauth.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5728 "configure" #include "confdefs.h" #include <X11/Xauth.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5666,12 +5752,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:5670: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:5756: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <<EOF -#line 5675 "configure" +#line 5761 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5682,7 +5768,7 @@ XauGetAuthByAddr() ; return 0; } EOF -if { (eval echo configure:5686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5721,7 +5807,6 @@ fi -OFFIX_O="" test "$window_system" != "x11" && with_offix=no if test "$with_xmu" != yes -a "$with_x11" = yes; then echo "configure: warning: No OffiX without real Xmu support" 1>&2 @@ -5737,24 +5822,25 @@ EOF } - OFFIX_O="offix.o" -fi - + extra_objs="$extra_objs offix.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"offix.o\"" + fi +fi test "$with_cde" = "yes" && with_tooltalk=yes # CDE requires tooltalk if test "$with_tooltalk" != "no" ; then for dir in "" "Tt/" "desktop/" ; do ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6 -echo "configure:5750: checking for ${dir}tt_c.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5753 "configure" +echo "configure:5836: checking for ${dir}tt_c.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5839 "configure" #include "confdefs.h" #include <${dir}tt_c.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5783,12 +5869,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:5787: checking "$xe_msg_checking"" >&5 +echo "configure:5873: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` xe_check_libs=" -ltt $extra_libs" cat > conftest.$ac_ext <<EOF -#line 5792 "configure" +#line 5878 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5799,7 +5885,7 @@ tt_message_create() ; return 0; } EOF -if { (eval echo configure:5803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5848,15 +5934,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:5852: checking for Dt/Dt.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5855 "configure" +echo "configure:5938: checking for Dt/Dt.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5941 "configure" #include "confdefs.h" #include <Dt/Dt.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5879,12 +5965,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:5883: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:5969: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <<EOF -#line 5888 "configure" +#line 5974 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5895,7 +5981,7 @@ DtDndDragStart() ; return 0; } EOF -if { (eval echo configure:5899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5932,18 +6018,18 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:5936: checking for LDAP" >&5 +echo "configure:6022: checking for LDAP" >&5 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ldap.h""... $ac_c" 1>&6 -echo "configure:5939: checking for ldap.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5942 "configure" +echo "configure:6025: checking for ldap.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6028 "configure" #include "confdefs.h" #include <ldap.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5966,15 +6052,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:5970: checking for lber.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5973 "configure" +echo "configure:6056: checking for lber.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6059 "configure" #include "confdefs.h" #include <lber.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5995,16 +6081,17 @@ with_ldap=no fi } -test -z "$with_ldap" -o "$with_ldap" = "yes" && { +if test "$with_ldap" != "no"; then + test -z "$with_umich_ldap" && { 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:6003: checking "$xe_msg_checking"" >&5 +echo "configure:6090: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber" cat > conftest.$ac_ext <<EOF -#line 6008 "configure" +#line 6095 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6015,7 +6102,7 @@ ldap_open() ; return 0; } EOF -if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6036,14 +6123,14 @@ fi } -test \( -z "$with_ldap" -o "$with_ldap" = "yes" \) -a "$with_umich_ldap" = "no" && { + test "$with_umich_ldap" = "no" && { echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6 -echo "configure:6042: checking for ldap_set_option in -lldap10" >&5 +echo "configure:6129: checking for ldap_set_option in -lldap10" >&5 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap10 " cat > conftest.$ac_ext <<EOF -#line 6047 "configure" +#line 6134 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6054,7 +6141,7 @@ ldap_set_option() ; return 0; } EOF -if { (eval echo configure:6058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6075,30 +6162,9 @@ fi } -test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes -if test "$with_ldap" = "yes" -a "$with_umich_ldap" = "yes" ; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_LDAP -EOF -cat >> confdefs.h <<\EOF -#define HAVE_LDAP 1 -EOF -} - - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_UMICH_LDAP -EOF -cat >> confdefs.h <<\EOF -#define HAVE_UMICH_LDAP 1 -EOF -} - - LIBS="-llber $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-llber\" to \$LIBS"; fi - LIBS="-lldap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$LIBS"; fi - extra_objs="$extra_objs eldap.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"eldap.o\"" - fi -elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then + test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes +fi +if test "$with_ldap" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_LDAP EOF @@ -6107,7 +6173,22 @@ EOF } - { test "$extra_verbose" = "yes" && cat << \EOF + extra_objs="$extra_objs eldap.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"eldap.o\"" + fi + if test "$with_umich_ldap" = "yes" ; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_UMICH_LDAP +EOF +cat >> confdefs.h <<\EOF +#define HAVE_UMICH_LDAP 1 +EOF +} + + LIBS="-llber $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-llber\" to \$LIBS"; fi + LIBS="-lldap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$LIBS"; fi + elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_NS_LDAP EOF cat >> confdefs.h <<\EOF @@ -6115,49 +6196,168 @@ EOF } - LIBS="-lldap10 $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap10\" to \$LIBS"; fi - extra_objs="$extra_objs eldap.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"eldap.o\"" - fi -elif test "$with_ldap" = "yes" ; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_LDAP -EOF -cat >> confdefs.h <<\EOF -#define HAVE_LDAP 1 -EOF -} - - LIBS="-lldap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$LIBS"; fi - extra_objs="$extra_objs eldap.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"eldap.o\"" - fi + LIBS="-lldap10 $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap10\" to \$LIBS"; fi + elif test "$with_ldap" = "yes" ; then + LIBS="-lldap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$LIBS"; fi + fi fi if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:6142: checking for X11 graphics libraries" >&5 - +echo "configure:6210: checking for X11 graphics libraries" >&5 + + if test "$with_png $with_tiff" != "no no"; then + +echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 +echo "configure:6215: checking for inflate in -lc" >&5 +ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lc " +cat > conftest.$ac_ext <<EOF +#line 6220 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inflate(); + +int main() { +inflate() +; return 0; } +EOF +if { (eval echo configure:6231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 + : +else + echo "$ac_t""no" 1>&6 + +echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 +echo "configure:6250: checking for inflate in -lz" >&5 +ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lz " +cat > conftest.$ac_ext <<EOF +#line 6255 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inflate(); + +int main() { +inflate() +; return 0; } +EOF +if { (eval echo configure:6266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 + libs_x="-lz $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lz\" to \$libs_x"; fi +else + echo "$ac_t""no" 1>&6 + +echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 +echo "configure:6285: checking for inflate in -lgz" >&5 +ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lgz " +cat > conftest.$ac_ext <<EOF +#line 6290 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inflate(); + +int main() { +inflate() +; return 0; } +EOF +if { (eval echo configure:6301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 + libs_x="-lgz $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgz\" to \$libs_x"; fi +else + echo "$ac_t""no" 1>&6 +fi + + +fi + + +fi + + + fi + + if test -z "$with_xpm"; then echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:6145: checking for Xpm - no older than 3.4f" >&5 - xe_check_libs=-lXpm - test -z "$with_xpm" && { cat > conftest.$ac_ext <<EOF -#line 6148 "configure" +echo "configure:6331: checking for Xpm - no older than 3.4f" >&5 + xe_check_libs=-lXpm + cat > conftest.$ac_ext <<EOF +#line 6334 "configure" #include "confdefs.h" #include <X11/xpm.h> - int main(int c, char **v) { - return c == 1 ? 0 : - XpmIncludeVersion != XpmLibraryVersion() ? 1 : - XpmIncludeVersion < 30406 ? 2 : - 0 ; - } -EOF -if { (eval echo configure:6158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 + int main(int c, char **v) { + return c == 1 ? 0 : + XpmIncludeVersion != XpmLibraryVersion() ? 1 : + XpmIncludeVersion < 30406 ? 2 : 0 ;} +EOF +if { (eval echo configure:6342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then - ./conftest foobar; xpm_status=$?; - if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi; + ./conftest dummy_arg; xpm_status=$?; + if test "$?" = "0"; then + with_xpm=yes; + else + with_xpm=no; + if test "$?" = "1"; then + xpm_problem="Xpm library version and header file version don't match!" + elif test "$?" = "2"; then + xpm_problem="Xpm library version is too old!" + else + xpm_problem="Internal xpm detection logic error!" + fi + echo " + *** WARNING *** $problem + I'm not touching that with a 10-foot pole! + If you really want to use the installed version of Xpm, rerun + configure --with-xpm=yes, but don't blame me if XEmacs crashes!" + fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 @@ -6165,18 +6365,8 @@ with_xpm=no fi rm -fr conftest* - } - xe_check_libs= - echo "$ac_t""$with_xpm" 1>&6 - if test "$xpm_status" = "1" -o "$xpm_status" = "2"; then - test "$xpm_status" = "1" && problem="Xpm library version and header file version don't match!" - test "$xpm_status" = "2" && problem="Xpm library version is too old!" - echo " - *** WARNING *** $problem - I'm not touching that with a 10-foot pole! - If you really want to use the installed version of Xpm, rerun - configure --with-xpm=yes, but don't blame me if XEmacs crashes! - " + xe_check_libs= + echo "$ac_t""$with_xpm" 1>&6 fi if test "$with_xpm" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF @@ -6192,15 +6382,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:6196: checking for compface.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6199 "configure" +echo "configure:6386: checking for compface.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6389 "configure" #include "confdefs.h" #include <compface.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6223,12 +6413,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:6227: checking for UnGenFace in -lcompface" >&5 +echo "configure:6417: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <<EOF -#line 6232 "configure" +#line 6422 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6239,7 +6429,7 @@ UnGenFace() ; return 0; } EOF -if { (eval echo configure:6243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6274,18 +6464,18 @@ fi echo $ac_n "checking for giflib - no older than 3.1""... $ac_c" 1>&6 -echo "configure:6278: checking for giflib - no older than 3.1" >&5 +echo "configure:6468: checking for giflib - no older than 3.1" >&5 test -z "$with_gif" && { ac_safe=`echo "gif_lib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gif_lib.h""... $ac_c" 1>&6 -echo "configure:6281: checking for gif_lib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6284 "configure" +echo "configure:6471: checking for gif_lib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6474 "configure" #include "confdefs.h" #include <gif_lib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6308,12 +6498,12 @@ } test -z "$with_gif" && { echo $ac_n "checking for GetGifError in -lgif""... $ac_c" 1>&6 -echo "configure:6312: checking for GetGifError in -lgif" >&5 +echo "configure:6502: checking for GetGifError in -lgif" >&5 ac_lib_var=`echo gif'_'GetGifError | sed 'y%./+-%__p_%'` xe_check_libs=" -lgif " cat > conftest.$ac_ext <<EOF -#line 6317 "configure" +#line 6507 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6324,7 +6514,7 @@ GetGifError() ; return 0; } EOF -if { (eval echo configure:6328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6360,15 +6550,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:6364: checking for jpeglib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6367 "configure" +echo "configure:6554: checking for jpeglib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6557 "configure" #include "confdefs.h" #include <jpeglib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6391,12 +6581,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:6395: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:6585: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` xe_check_libs=" -ljpeg " cat > conftest.$ac_ext <<EOF -#line 6400 "configure" +#line 6590 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6407,7 +6597,7 @@ jpeg_destroy_decompress() ; return 0; } EOF -if { (eval echo configure:6411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6441,42 +6631,34 @@ libs_x="-ljpeg $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ljpeg\" to \$libs_x"; fi fi - test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:6447: checking for png.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6450 "configure" + if test -z "$with_png"; then + echo $ac_n "checking for png.h - no older than 0.96""... $ac_c" 1>&6 +echo "configure:6637: checking for png.h - no older than 0.96" >&5 + cat > conftest.$ac_ext <<EOF +#line 6639 "configure" #include "confdefs.h" #include <png.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -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 - : -else - echo "$ac_t""no" 1>&6 -with_png=no -fi - } +#if PNG_LIBPNG_VER >= 96 +yes +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 +else + rm -rf conftest* + echo "$ac_t""no" 1>&6; have_png=no +fi +rm -f conftest* + + fi test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:6477: checking for pow" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6480 "configure" +echo "configure:6659: checking for pow" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6662 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pow(); below. */ @@ -6499,7 +6681,7 @@ ; return 0; } EOF -if { (eval echo configure:6503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -6518,29 +6700,25 @@ with_png=no fi } - if test "$with_png" != "no"; then - for extra_libs in "" "-lz" "-lgz"; do - -xe_msg_checking="for png_set_strip_alpha in -lpng" -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:6528: checking "$xe_msg_checking"" >&5 -ac_lib_var=`echo png'_'png_set_strip_alpha | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lpng $extra_libs" -cat > conftest.$ac_ext <<EOF -#line 6533 "configure" + test -z "$with_png" && { +echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 +echo "configure:6706: checking for png_read_image in -lpng" >&5 +ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lpng " +cat > conftest.$ac_ext <<EOF +#line 6711 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char png_set_strip_alpha(); - -int main() { -png_set_strip_alpha() -; return 0; } -EOF -if { (eval echo configure:6544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +char png_read_image(); + +int main() { +png_read_image() +; return 0; } +EOF +if { (eval echo configure:6722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6554,16 +6732,14 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - png_libs="-lpng $extra_libs" with_png=yes; break -else - echo "$ac_t""no" 1>&6 -: -fi - - - done - fi - test -z "$with_png" && with_png=no + : +else + echo "$ac_t""no" 1>&6 +with_png=no +fi + + } + test -z "$with_png" && with_png=yes if test "$with_png" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_PNG @@ -6573,21 +6749,48 @@ EOF } - libs_x="$png_libs $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$png_libs\" to \$libs_x"; fi + libs_x="-lpng $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lpng\" to \$libs_x"; fi fi - if test "$with_tiff" != no; then - for extra_libs in "" "-lz" "-lgz"; do - -xe_msg_checking="for TIFFReadScanline in -ltiff" -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:6586: checking "$xe_msg_checking"" >&5 + 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:6758: checking for tiffio.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6761 "configure" +#include "confdefs.h" +#include <tiffio.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:6766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +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 + : +else + echo "$ac_t""no" 1>&6 +with_tiff=no +fi + } + test -z "$with_tiff" && { +echo $ac_n "checking for TIFFReadScanline in -ltiff""... $ac_c" 1>&6 +echo "configure:6789: checking for TIFFReadScanline in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFReadScanline | sed 'y%./+-%__p_%'` -xe_check_libs=" -ltiff $extra_libs" -cat > conftest.$ac_ext <<EOF -#line 6591 "configure" +xe_check_libs=" -ltiff " +cat > conftest.$ac_ext <<EOF +#line 6794 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6598,7 +6801,7 @@ TIFFReadScanline() ; return 0; } EOF -if { (eval echo configure:6602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6612,16 +6815,14 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - tiff_libs="-ltiff $extra_libs" with_tiff=yes; break -else - echo "$ac_t""no" 1>&6 -: -fi - - - done - fi - test -z "$with_tiff" && with_tiff=no + : +else + echo "$ac_t""no" 1>&6 +with_tiff=no +fi + + } + test -z "$with_tiff" && with_tiff=yes if test "$with_tiff" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TIFF @@ -6631,17 +6832,17 @@ EOF } - libs_x="$tiff_libs $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$tiff_libs\" to \$libs_x"; fi + libs_x="-ltiff $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ltiff\" to \$libs_x"; fi fi - + echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6 -echo "configure:6640: checking for XawScrollbarSetThumb in -lXaw" >&5 +echo "configure:6841: checking for XawScrollbarSetThumb in -lXaw" >&5 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <<EOF -#line 6645 "configure" +#line 6846 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6652,7 +6853,7 @@ XawScrollbarSetThumb() ; return 0; } EOF -if { (eval echo configure:6656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6676,15 +6877,15 @@ ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:6680: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6683 "configure" +echo "configure:6881: checking for Xm/Xm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6884 "configure" #include "confdefs.h" #include <Xm/Xm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6701,12 +6902,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:6705: checking for XmStringFree in -lXm" >&5 +echo "configure:6906: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <<EOF -#line 6710 "configure" +#line 6911 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6717,7 +6918,7 @@ XmStringFree() ; return 0; } EOF -if { (eval echo configure:6721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6744,6 +6945,31 @@ fi + if test "$have_motif" = "yes"; then + echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 +echo "configure:6951: checking for Lesstif" >&5 + cat > conftest.$ac_ext <<EOF +#line 6953 "configure" +#include "confdefs.h" +#include <Xm/Xm.h> +#ifdef LESSTIF_VERSION +yes +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + have_lesstif=yes +else + rm -rf conftest* + have_lesstif=no +fi +rm -f conftest* + + echo "$ac_t""$have_lesstif" 1>&6 + fi + fi case "$with_menubars" in "" | "yes" | "athena" | "athena3d" ) @@ -6968,8 +7194,7 @@ fi fi -if test "$with_gung" != "no"; then - test "$with_minimal_tagbits" = "no" && { test "$extra_verbose" = "yes" && cat << \EOF +test "$use_minimal_tagbits" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF Defining USE_MINIMAL_TAGBITS EOF cat >> confdefs.h <<\EOF @@ -6977,7 +7202,8 @@ EOF } - { test "$extra_verbose" = "yes" && cat << \EOF +test "$use_indexed_lrecord_implementation" = "yes" && \ + { test "$extra_verbose" = "yes" && cat << \EOF Defining USE_INDEXED_LRECORD_IMPLEMENTATION EOF cat >> confdefs.h <<\EOF @@ -6985,10 +7211,9 @@ EOF } -fi - - -test -z "$with_mule" && with_mule=no + + +test -z "$with_mule" && with_mule=no test -z "$with_file_coding" && with_file_coding=no @@ -7008,7 +7233,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:7012: checking for Mule-related features" >&5 +echo "configure:7237: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -7033,15 +7258,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7037: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7040 "configure" +echo "configure:7262: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7265 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7072,12 +7297,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:7076: checking for strerror in -lintl" >&5 +echo "configure:7301: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <<EOF -#line 7081 "configure" +#line 7306 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7088,7 +7313,7 @@ strerror() ; return 0; } EOF -if { (eval echo configure:7092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7121,19 +7346,19 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:7125: checking for Mule input methods" >&5 - test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no - case "$with_xim" in "" | "yes" ) +echo "configure:7350: checking for Mule input methods" >&5 + case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:7129: checking for XIM" >&5 - +echo "configure:7353: checking for XIM" >&5 + if test "$have_lesstif" = "yes"; then with_xim=xlib + else echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:7132: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:7357: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <<EOF -#line 7137 "configure" +#line 7362 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7144,7 +7369,7 @@ XmImMbLookupString() ; return 0; } EOF -if { (eval echo configure:7148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7165,8 +7390,9 @@ fi + fi esac - if test "$with_xim" != "no" ; then + if test "$with_xim" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_XIM EOF @@ -7209,15 +7435,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:7213: checking for XFontSet" >&5 +echo "configure:7439: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:7216: checking for XmbDrawString in -lX11" >&5 +echo "configure:7442: checking for XmbDrawString in -lX11" >&5 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <<EOF -#line 7221 "configure" +#line 7447 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7228,7 +7454,7 @@ XmbDrawString() ; return 0; } EOF -if { (eval echo configure:7232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7268,15 +7494,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:7272: checking for wnn/jllib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7275 "configure" +echo "configure:7498: checking for wnn/jllib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7501 "configure" #include "confdefs.h" #include <wnn/jllib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7301,10 +7527,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7305: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7308 "configure" +echo "configure:7531: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7534 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7327,7 +7553,7 @@ ; return 0; } EOF -if { (eval echo configure:7331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7356,12 +7582,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:7360: checking for crypt in -lcrypt" >&5 +echo "configure:7586: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` xe_check_libs=" -lcrypt " cat > conftest.$ac_ext <<EOF -#line 7365 "configure" +#line 7591 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7372,7 +7598,7 @@ crypt() ; return 0; } EOF -if { (eval echo configure:7376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7406,12 +7632,12 @@ fi test -z "$with_wnn" && { echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6 -echo "configure:7410: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:7636: checking for jl_dic_list_e in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <<EOF -#line 7415 "configure" +#line 7641 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7422,7 +7648,7 @@ jl_dic_list_e() ; return 0; } EOF -if { (eval echo configure:7426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7459,12 +7685,12 @@ fi echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6 -echo "configure:7463: checking for jl_fi_dic_list in -lwnn" >&5 +echo "configure:7689: checking for jl_fi_dic_list in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <<EOF -#line 7468 "configure" +#line 7694 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7475,7 +7701,7 @@ jl_fi_dic_list() ; return 0; } EOF -if { (eval echo configure:7479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7509,15 +7735,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:7513: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7516 "configure" +echo "configure:7739: checking for canna/jrkanji.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7742 "configure" #include "confdefs.h" #include <canna/jrkanji.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7544,15 +7770,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:7548: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7551 "configure" +echo "configure:7774: checking for canna/jrkanji.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7777 "configure" #include "confdefs.h" #include <canna/jrkanji.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7580,15 +7806,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:7584: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7587 "configure" +echo "configure:7810: checking for canna/RK.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7813 "configure" #include "confdefs.h" #include <canna/RK.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7611,12 +7837,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:7615: checking for RkBgnBun in -lRKC" >&5 +echo "configure:7841: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <<EOF -#line 7620 "configure" +#line 7846 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7627,7 +7853,7 @@ RkBgnBun() ; return 0; } EOF -if { (eval echo configure:7631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7650,12 +7876,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:7654: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:7880: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <<EOF -#line 7659 "configure" +#line 7885 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7666,7 +7892,7 @@ jrKanjiControl() ; return 0; } EOF -if { (eval echo configure:7670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7715,12 +7941,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:7719: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:7945: checking for layout_object_getvalue in -li18n" >&5 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'` xe_check_libs=" -li18n " cat > conftest.$ac_ext <<EOF -#line 7724 "configure" +#line 7950 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7731,7 +7957,7 @@ layout_object_getvalue() ; return 0; } EOF -if { (eval echo configure:7735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7795,6 +8021,19 @@ fi if test -n "$runpath"; then ld_switch_run="${dash_r}${runpath}" + +if test "$GCC" = "yes"; then + set x $ld_switch_run; shift; ld_switch_run="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) ld_switch_run="$ld_switch_run $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;; + -Xlinker* ) ;; + * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;; + esac + shift + done +fi test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" fi fi @@ -7804,10 +8043,10 @@ for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7808: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7811 "configure" +echo "configure:8047: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8050 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7830,7 +8069,7 @@ ; return 0; } EOF -if { (eval echo configure:7834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7867,10 +8106,10 @@ for ac_func in realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7871: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7874 "configure" +echo "configure:8110: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8113 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7893,7 +8132,7 @@ ; return 0; } EOF -if { (eval echo configure:7897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7926,16 +8165,16 @@ esac echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:7930: checking whether netdb declares h_errno" >&5 -cat > conftest.$ac_ext <<EOF -#line 7932 "configure" +echo "configure:8169: checking whether netdb declares h_errno" >&5 +cat > conftest.$ac_ext <<EOF +#line 8171 "configure" #include "confdefs.h" #include <netdb.h> int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:7939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -7955,16 +8194,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:7959: checking for sigsetjmp" >&5 -cat > conftest.$ac_ext <<EOF -#line 7961 "configure" +echo "configure:8198: checking for sigsetjmp" >&5 +cat > conftest.$ac_ext <<EOF +#line 8200 "configure" #include "confdefs.h" #include <setjmp.h> int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:7968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8207: \"$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 @@ -7984,11 +8223,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:7988: checking whether localtime caches TZ" >&5 +echo "configure:8227: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext <<EOF -#line 7992 "configure" +#line 8231 "configure" #include "confdefs.h" #include <time.h> #if STDC_HEADERS @@ -8023,7 +8262,7 @@ exit (0); } EOF -if { (eval echo configure:8027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then emacs_cv_localtime_cache=no else @@ -8052,9 +8291,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday cannot accept two arguments""... $ac_c" 1>&6 -echo "configure:8056: checking whether gettimeofday cannot accept two arguments" >&5 -cat > conftest.$ac_ext <<EOF -#line 8058 "configure" +echo "configure:8295: checking whether gettimeofday cannot accept two arguments" >&5 +cat > conftest.$ac_ext <<EOF +#line 8297 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME @@ -8076,7 +8315,7 @@ ; return 0; } EOF -if { (eval echo configure:8080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""no" 1>&6 else @@ -8098,19 +8337,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:8102: checking for inline" >&5 +echo "configure:8341: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 8107 "configure" +#line 8346 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:8114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -8160,17 +8399,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:8164: checking for working alloca.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8167 "configure" +echo "configure:8403: checking for working alloca.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8406 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:8174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -8194,10 +8433,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8198: checking for alloca" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8201 "configure" +echo "configure:8437: checking for alloca" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8440 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -8220,7 +8459,7 @@ char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:8224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -8259,10 +8498,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8263: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8266 "configure" +echo "configure:8502: checking whether alloca needs Cray hooks" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8505 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -8286,10 +8525,10 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8290: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8293 "configure" +echo "configure:8529: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8532 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -8312,7 +8551,7 @@ ; return 0; } EOF -if { (eval echo configure:8316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8342,10 +8581,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8346: checking stack direction for C alloca" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8349 "configure" +echo "configure:8585: checking stack direction for C alloca" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8588 "configure" #include "confdefs.h" find_stack_direction () { @@ -8364,7 +8603,7 @@ exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:8368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_c_stack_direction=1 else @@ -8392,15 +8631,15 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:8396: checking for vfork.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8399 "configure" +echo "configure:8635: checking for vfork.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8638 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8428,10 +8667,10 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:8432: checking for working vfork" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8435 "configure" +echo "configure:8671: checking for working vfork" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8674 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -8526,7 +8765,7 @@ } } EOF -if { (eval echo configure:8530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_vfork_works=yes else @@ -8551,10 +8790,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:8555: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8558 "configure" +echo "configure:8794: checking for working strcoll" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8797 "configure" #include "confdefs.h" #include <string.h> main () @@ -8564,7 +8803,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:8568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -8591,10 +8830,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8595: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8598 "configure" +echo "configure:8834: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8837 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -8617,7 +8856,7 @@ ; return 0; } EOF -if { (eval echo configure:8621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8645,10 +8884,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8649: checking whether getpgrp takes no argument" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8652 "configure" +echo "configure:8888: checking whether getpgrp takes no argument" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8891 "configure" #include "confdefs.h" /* @@ -8703,7 +8942,7 @@ } EOF -if { (eval echo configure:8707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -8729,10 +8968,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:8733: checking for working mmap" >&5 +echo "configure:8972: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext <<EOF -#line 8736 "configure" +#line 8975 "configure" #include "confdefs.h" #include <stdio.h> #include <unistd.h> @@ -8765,7 +9004,7 @@ return 1; } EOF -if { (eval echo configure:8769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:9008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then have_mmap=yes else @@ -8799,15 +9038,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:8803: checking for termios.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8806 "configure" +echo "configure:9042: checking for termios.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9045 "configure" #include "confdefs.h" #include <termios.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8850,15 +9089,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:8854: checking for termio.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8857 "configure" +echo "configure:9093: checking for termio.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9096 "configure" #include "confdefs.h" #include <termio.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9101: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8890,10 +9129,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:8894: checking for socket" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8897 "configure" +echo "configure:9133: checking for socket" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9136 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket(); below. */ @@ -8916,7 +9155,7 @@ ; return 0; } EOF -if { (eval echo configure:8920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -8931,15 +9170,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:8935: checking for netinet/in.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8938 "configure" +echo "configure:9174: checking for netinet/in.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9177 "configure" #include "confdefs.h" #include <netinet/in.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8956,15 +9195,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:8960: checking for arpa/inet.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8963 "configure" +echo "configure:9199: checking for arpa/inet.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9202 "configure" #include "confdefs.h" #include <arpa/inet.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8989,9 +9228,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:8993: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:9232: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext <<EOF -#line 8995 "configure" +#line 9234 "configure" #include "confdefs.h" #include <sys/types.h> @@ -9002,7 +9241,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:9006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SOCKADDR_SUN_LEN @@ -9020,9 +9259,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:9024: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:9263: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext <<EOF -#line 9026 "configure" +#line 9265 "configure" #include "confdefs.h" #include <netinet/in.h> @@ -9031,7 +9270,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:9035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MULTICAST @@ -9062,10 +9301,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:9066: checking for msgget" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9069 "configure" +echo "configure:9305: checking for msgget" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9308 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char msgget(); below. */ @@ -9088,7 +9327,7 @@ ; return 0; } EOF -if { (eval echo configure:9092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -9103,15 +9342,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:9107: checking for sys/ipc.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9110 "configure" +echo "configure:9346: checking for sys/ipc.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9349 "configure" #include "confdefs.h" #include <sys/ipc.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9128,15 +9367,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:9132: checking for sys/msg.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9135 "configure" +echo "configure:9371: checking for sys/msg.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9374 "configure" #include "confdefs.h" #include <sys/msg.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9174,15 +9413,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:9178: checking for dirent.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9181 "configure" +echo "configure:9417: checking for dirent.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9420 "configure" #include "confdefs.h" #include <dirent.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9209,15 +9448,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:9213: checking for sys/dir.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9216 "configure" +echo "configure:9452: checking for sys/dir.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9455 "configure" #include "confdefs.h" #include <sys/dir.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9250,15 +9489,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:9254: checking for nlist.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9257 "configure" +echo "configure:9493: checking for nlist.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9496 "configure" #include "confdefs.h" #include <nlist.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9288,7 +9527,7 @@ echo "checking "for sound support"" 1>&6 -echo "configure:9292: checking "for sound support"" >&5 +echo "configure:9531: checking "for sound support"" >&5 case "$with_sound" in native | both ) with_native_sound=yes;; nas | no ) with_native_sound=no;; @@ -9299,15 +9538,15 @@ 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:9303: checking for multimedia/audio_device.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9306 "configure" +echo "configure:9542: checking for multimedia/audio_device.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9545 "configure" #include "confdefs.h" #include <multimedia/audio_device.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9355,12 +9594,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:9359: checking for ALopenport in -laudio" >&5 +echo "configure:9598: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <<EOF -#line 9364 "configure" +#line 9603 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9371,7 +9610,7 @@ ALopenport() ; return 0; } EOF -if { (eval echo configure:9375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9402,12 +9641,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:9406: checking for AOpenAudio in -lAlib" >&5 +echo "configure:9645: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <<EOF -#line 9411 "configure" +#line 9650 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9418,7 +9657,7 @@ AOpenAudio() ; return 0; } EOF -if { (eval echo configure:9422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9456,15 +9695,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:9460: checking for ${dir}/soundcard.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9463 "configure" +echo "configure:9699: checking for ${dir}/soundcard.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9702 "configure" #include "confdefs.h" #include <${dir}/soundcard.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9534,7 +9773,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 -#line 9538 "configure" +#line 9777 "configure" #include "confdefs.h" #include <audio/Xtutil.h> EOF @@ -9561,7 +9800,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:9565: checking for TTY-related features" >&5 +echo "configure:9804: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -9577,12 +9816,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:9581: checking for tgetent in -lncurses" >&5 +echo "configure:9820: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <<EOF -#line 9586 "configure" +#line 9825 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9593,7 +9832,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:9597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9626,15 +9865,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:9630: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9633 "configure" +echo "configure:9869: checking for ncurses/curses.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9872 "configure" #include "confdefs.h" #include <ncurses/curses.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9656,15 +9895,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:9660: checking for ncurses/term.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9663 "configure" +echo "configure:9899: checking for ncurses/term.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9902 "configure" #include "confdefs.h" #include <ncurses/term.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9694,15 +9933,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:9698: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9701 "configure" +echo "configure:9937: checking for ncurses/curses.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9940 "configure" #include "confdefs.h" #include <ncurses/curses.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9737,12 +9976,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:9741: checking for tgetent in -l$lib" >&5 +echo "configure:9980: checking for tgetent in -l$lib" >&5 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -l$lib " cat > conftest.$ac_ext <<EOF -#line 9746 "configure" +#line 9985 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9753,7 +9992,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:9757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9784,12 +10023,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:9788: checking for tgetent in -lcurses" >&5 +echo "configure:10027: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lcurses " cat > conftest.$ac_ext <<EOF -#line 9793 "configure" +#line 10032 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9800,7 +10039,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:9804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9818,12 +10057,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:9822: checking for tgetent in -ltermcap" >&5 +echo "configure:10061: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -ltermcap " cat > conftest.$ac_ext <<EOF -#line 9827 "configure" +#line 10066 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9834,7 +10073,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:9838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9882,15 +10121,15 @@ test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gpm.h""... $ac_c" 1>&6 -echo "configure:9886: checking for gpm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9889 "configure" +echo "configure:10125: checking for gpm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10128 "configure" #include "confdefs.h" #include <gpm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9913,12 +10152,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:9917: checking for Gpm_Open in -lgpm" >&5 +echo "configure:10156: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgpm " cat > conftest.$ac_ext <<EOF -#line 9922 "configure" +#line 10161 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9929,7 +10168,7 @@ Gpm_Open() ; return 0; } EOF -if { (eval echo configure:9933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9978,22 +10217,22 @@ echo "checking for database support" 1>&6 -echo "configure:9982: checking for database support" >&5 +echo "configure:10221: checking for database support" >&5 if test "$with_database_gnudbm" != "no"; then for ac_hdr in ndbm.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9989: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9992 "configure" +echo "configure:10228: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10231 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10025,12 +10264,12 @@ if test "$have_ndbm_h" = "yes"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:10029: checking for dbm_open in -lgdbm" >&5 +echo "configure:10268: checking for dbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdbm " cat > conftest.$ac_ext <<EOF -#line 10034 "configure" +#line 10273 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10041,7 +10280,7 @@ dbm_open() ; return 0; } EOF -if { (eval echo configure:10045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10064,10 +10303,10 @@ fi if test "$with_database_gnudbm" != "yes"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:10068: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10071 "configure" +echo "configure:10307: checking for dbm_open" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10310 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbm_open(); below. */ @@ -10090,7 +10329,7 @@ ; return 0; } EOF -if { (eval echo configure:10094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -10126,10 +10365,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:10130: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10133 "configure" +echo "configure:10369: checking for dbm_open" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10372 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbm_open(); below. */ @@ -10152,7 +10391,7 @@ ; return 0; } EOF -if { (eval echo configure:10156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -10173,12 +10412,12 @@ if test "$need_libdbm" != "no"; then echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:10177: checking for dbm_open in -ldbm" >&5 +echo "configure:10416: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -ldbm " cat > conftest.$ac_ext <<EOF -#line 10182 "configure" +#line 10421 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10189,7 +10428,7 @@ dbm_open() ; return 0; } EOF -if { (eval echo configure:10193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10226,10 +10465,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for dbopen""... $ac_c" 1>&6 -echo "configure:10230: checking for dbopen" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10233 "configure" +echo "configure:10469: checking for dbopen" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10472 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbopen(); below. */ @@ -10252,7 +10491,7 @@ ; return 0; } EOF -if { (eval echo configure:10256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbopen=yes" else @@ -10273,12 +10512,12 @@ if test "$need_libdb" != "no"; then echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6 -echo "configure:10277: checking for dbopen in -ldb" >&5 +echo "configure:10516: checking for dbopen in -ldb" >&5 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <<EOF -#line 10282 "configure" +#line 10521 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10289,7 +10528,7 @@ dbopen() ; return 0; } EOF -if { (eval echo configure:10293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10313,7 +10552,7 @@ if test "$with_database_berkdb" = "yes"; then for path in "db/db.h" "db.h"; do cat > conftest.$ac_ext <<EOF -#line 10317 "configure" +#line 10556 "configure" #include "confdefs.h" #ifdef HAVE_INTTYPES_H #define __BIT_TYPES_DEFINED__ @@ -10331,7 +10570,7 @@ ; return 0; } EOF -if { (eval echo configure:10335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_path="$path"; break else @@ -10364,9 +10603,8 @@ fi fi -if test "$with_database_gnudbm" = "yes" -o \ - "$with_database_dbm" = "yes" -o \ - "$with_database_berkdb" = "yes"; then +if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \ + != "no no no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DATABASE EOF @@ -10383,12 +10621,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:10387: checking for SOCKSinit in -lsocks" >&5 +echo "configure:10625: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <<EOF -#line 10392 "configure" +#line 10630 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10399,7 +10637,7 @@ SOCKSinit() ; return 0; } EOF -if { (eval echo configure:10403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10456,15 +10694,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10460: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10463 "configure" +echo "configure:10698: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10701 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10495,12 +10733,12 @@ test -z "$with_shlib" && test ! -z "$have_dlfcn" && { echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:10499: checking for dlopen in -ldl" >&5 +echo "configure:10737: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldl " cat > conftest.$ac_ext <<EOF -#line 10504 "configure" +#line 10742 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10511,7 +10749,7 @@ dlopen() ; return 0; } EOF -if { (eval echo configure:10515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10540,12 +10778,12 @@ } test -z "$with_shlib" && test ! -z "$have_dlfcn" && { echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6 -echo "configure:10544: checking for _dlopen in -lc" >&5 +echo "configure:10782: checking for _dlopen in -lc" >&5 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <<EOF -#line 10549 "configure" +#line 10787 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10556,7 +10794,7 @@ _dlopen() ; return 0; } EOF -if { (eval echo configure:10560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10585,12 +10823,12 @@ } test -z "$with_shlib" && test ! -z "$have_dlfcn" && { echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:10589: checking for dlopen in -lc" >&5 +echo "configure:10827: checking for dlopen in -lc" >&5 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <<EOF -#line 10594 "configure" +#line 10832 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10601,7 +10839,7 @@ dlopen() ; return 0; } EOF -if { (eval echo configure:10605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10630,12 +10868,12 @@ } test -z "$with_shlib" && { echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:10634: checking for shl_load in -ldld" >&5 +echo "configure:10872: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <<EOF -#line 10639 "configure" +#line 10877 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10646,7 +10884,7 @@ shl_load() ; return 0; } EOF -if { (eval echo configure:10650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10675,12 +10913,12 @@ } test -z "$with_shlib" && { echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:10679: checking for dld_init in -ldld" >&5 +echo "configure:10917: checking for dld_init in -ldld" >&5 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <<EOF -#line 10684 "configure" +#line 10922 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10691,7 +10929,7 @@ dld_init() ; return 0; } EOF -if { (eval echo configure:10695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10741,7 +10979,7 @@ dll_oflags="-o " echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6 -echo "configure:10745: checking how to build a shared library" >&5 +echo "configure:10983: checking how to build a shared library" >&5 case `uname -rs` in UNIX_SV*|UNIX_System_V*) dll_lflags="-G" @@ -10837,6 +11075,37 @@ esac fi +cat > conftest.$ac_ext <<EOF +#line 11080 "configure" +#include "confdefs.h" +int main(int c,char *v[]){return 0;} +EOF +if { (eval echo configure:11084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + + echo "" + echo "*** PANIC *** The C compiler can no longer build working executables." + echo "*** PANIC *** Please examine the tail of config.log for runtime errors." + echo "*** PANIC *** The most likely reason for this problem is that configure" + echo "*** PANIC *** links with shared libraries, but those libraries cannot be" + echo "*** PANIC *** found at run time." + echo "*** PANIC ***" + echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig." + echo "*** PANIC *** On other systems, try telling configure where to find the" + echo "*** PANIC *** shared libraries using the --site-runtime-libraries option" + echo "*** PANIC ***" + echo "*** PANIC *** Another way to shoot yourself in the foot is to specify" + echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed" + echo "*** PANIC *** on your system. Don't do that." + exit 1 +fi +rm -fr conftest* + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_UNIX_PROCESSES @@ -11193,14 +11462,6 @@ EOF } -test "$const_is_losing" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining CONST_IS_LOSING -EOF -cat >> confdefs.h <<\EOF -#define CONST_IS_LOSING 1 -EOF -} - test "$with_quantify" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF Defining QUANTIFY EOF @@ -11233,11 +11494,11 @@ EOF } -test "$use_union_type" != yes && { test "$extra_verbose" = "yes" && cat << \EOF - Defining NO_UNION_TYPE -EOF -cat >> confdefs.h <<\EOF -#define NO_UNION_TYPE 1 +test "$use_union_type" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF + Defining USE_UNION_TYPE +EOF +cat >> confdefs.h <<\EOF +#define USE_UNION_TYPE 1 EOF } @@ -11366,10 +11627,9 @@ test "$with_pop" = yes && echo " Using POP for mail access" test "$with_kerberos" = yes && echo " Using Kerberos for POP authentication" test "$with_hesiod" = yes && echo " Using Hesiod to get POP server host" -test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." -test "$with_minimal_tagbits" != "no" -o "$with_gung" != "no" && \ - echo " Using Lisp_Objects with minimal tagbits." -test "$with_gung" != "no" && echo " Using indexed lrecord implementation." +test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." +test "$use_minimal_tagbits" = yes && echo " Using Lisp_Objects with minimal tagbits." +test "$use_indexed_lrecord_implementation" = yes && echo " Using indexed lrecord implementation." test "$debug" = yes && echo " Compiling in extra code for debugging." test "$memory_usage_stats" = yes && echo " Compiling in code for checking XEmacs memory usage." test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." @@ -11398,6 +11658,13 @@ exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'` +for file in $internal_makefile_list; do + test "$file" = src/Makefile.in && \ + file="src/Makefile.in:src/Makefile.in.in:src/depend" + ac_output_files="${ac_output_files+$ac_output_files }$file" +done +ac_output_files="$ac_output_files lib-src/config.values" + trap '' 1 2 15 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 @@ -11453,7 +11720,7 @@ ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "$internal_makefile_list lib-src/config.values src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <<EOF @@ -11502,7 +11769,6 @@ s%@X_LIBS@%$X_LIBS%g s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g s%@libs_xauth@%$libs_xauth%g -s%@OFFIX_O@%$OFFIX_O%g s%@lwlib_objs@%$lwlib_objs%g s%@ALLOCA@%$ALLOCA%g s%@dll_ld@%$dll_ld%g @@ -11594,7 +11860,7 @@ cat >> $CONFIG_STATUS <<EOF -CONFIG_FILES=\${CONFIG_FILES-"$internal_makefile_list lib-src/config.values"} +CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -11769,7 +12035,6 @@ EOF cat >> $CONFIG_STATUS <<\EOF - for dir in $MAKE_SUBDIR; do echo creating $dir/Makefile ( @@ -11796,8 +12061,8 @@ | sed -n -e '/^..*$/p' \ | sed '/^"/ { s/\\\([\"]\)/\1/g -s/^"// -s/"$// +s/^[ ]*"// +s/"[ ]*$// }' > Makefile.new chmod 444 Makefile.new mv -f Makefile.new Makefile
--- a/configure.in Mon Aug 13 10:27:41 2007 +0200 +++ b/configure.in Mon Aug 13 10:28:48 2007 +0200 @@ -347,19 +347,19 @@ with_scrollbars='' with_dialogs='' with_file_coding='' -const_is_losing='yes' +dnl const_is_losing is removed - we rely on AC_C_CONST instead. +dnl We accept (and ignore) the --const-is-losing option for compatibility. +dnl const_is_losing='yes' puresize='' -cflags='UNSPECIFIED' +cpp='' cppflags='' libs='' ldflags='' dynamic='' with_x11='' with_msw='' -with_gung='no' -with_minimal_tagbits='no' rel_alloc='default' with_system_malloc='default' with_dlmalloc='default' native_sound_lib='' -dnl use-assertions should be 'yes' by default. Too many people in this +dnl use_assertions should be 'yes' by default. Too many people in this dnl world have core dumps turned off by default or \"cannot find where the dnl core file went\". At least we should get some useful output ... use_assertions="yes" @@ -455,7 +455,6 @@ with_gcc | \ with_gnu_make | \ dynamic | \ - with_gung | \ with_ncurses | \ with_dnet | \ with_socks | \ @@ -496,6 +495,10 @@ use_union_type | \ debug | \ use_assertions | \ + use_minimal_tagbits | \ + use_indexed_lrecord_implementation | \ + gung_ho | \ + use_assertions | \ memory_usage_stats | \ with_clash_detection | \ with_shlib | \ @@ -514,6 +517,10 @@ srcdir | \ compiler | \ cflags | \ + cpp | \ + cppflags | \ + libs | \ + ldflags | \ puresize | \ cache_file | \ native_sound_lib | \ @@ -750,6 +757,17 @@ dnl Finish options processing dnl ------------------------- +dnl Several options are equivalent to, and override, environment variables. +test -n "$cpp" && CPP="$cpp" +test -n "$cppflags" && CPPFLAGS="$cppflags" +test -n "$libs" && LIBS="$libs" +test -n "$ldflags" && LDFLAGS="$ldflags" + +dnl Personal settings shouldn't affect the configuration process. +dnl if test "$infopath_user_defined" = "no" -a -n "$INFOPATH" ; then +dnl infopath="$INFOPATH" +dnl fi + dnl Get the arguments back. See the diatribe on Shell Magic above. eval set x "$quoted_arguments"; shift @@ -767,6 +785,20 @@ dnl with_x is an obsolete synonym for with_x11 test -n "$with_x" && with_x11="$with_x" +dnl --gung-ho=val is a synonym for +dnl --use-minimal-tagbits=val --use-indexed-lrecord-implementation=val + +if test -n "$gung_ho"; then + test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho" + test -z "$use_indexed_lrecord_implementation" && \ + use_indexed_lrecord_implementation="$gung_ho" +fi +if test "$use_minimal_tagbits" = "no"; then + test "$with_dlmalloc" = "yes" && \ + USAGE_ERROR(--with-dlmalloc=yes requires --use-minimal-tagbits=yes) + with_dlmalloc=no +fi + dnl# Ignore useless run-in-place flag if test "$run_in_place" = "yes"; then AC_MSG_WARN("The --run-in-place option is ignored because it is unnecessary.") @@ -901,7 +933,7 @@ dnl debug=yes must be set when error checking is present. This should be dnl fixed up. dnl debug implies other options -if test "${debug=beta}" = "yes"; then +if test "${debug:=$beta}" = "yes"; then use_assertions=yes memory_usage_stats=yes XE_ADD_OBJS(debug.o) AC_DEFINE(DEBUG_XEMACS) @@ -1466,7 +1498,13 @@ dnl If we don't set CFLAGS here, AC_PROG_CC will set it. dnl But we know better what's good for us, so we do our own dnl computation of real CFLAGS later. -test "$cflags" != "UNSPECIFIED" && CFLAGS="$cflags" +dnl --cflags overrides environment variable CFLAGS +test "${cflags-unset}" != unset && CFLAGS="$cflags" +if test "${CFLAGS-unset}" != unset + then cflags_specified=yes; + else cflags_specified=no; +fi + xe_save_CFLAGS="$CFLAGS" AC_PROG_CC dnl Autoconf has its own magic for compiler autodetection @@ -1503,7 +1541,8 @@ ], have_glibc=yes, have_glibc=no) AC_MSG_RESULT($have_glibc) dnl I'm tired of pop being broken with GLIBC -slb -dnl test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE) +dnl Well. then why not fix fucking pop? +test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE) AC_MSG_CHECKING(whether we are using SunPro C) AC_TRY_COMPILE([],[#ifndef __SUNPRO_C @@ -1615,29 +1654,6 @@ CPP_boolean_to_sh(MAIL_USE_FLOCK, mail_use_flock) CPP_boolean_to_sh(MAIL_USE_LOCKF, mail_use_lockf) -#if 0 -#ifdef THIS_IS_CONFIGURE - -/* Get the CFLAGS for tests in configure. */ -CPP_to_sh(C_DEBUG_SWITCH, c_debug_switch, -g) -CPP_to_sh(C_OPTIMIZE_SWITCH, c_optimize_switch, -O) -#ifdef __GNUC__ -configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '$SPECIFIED_CFLAGS' -#else -configure___ CFLAGS=C_DEBUG_SWITCH '$SPECIFIED_CFLAGS' -#endif - -#else /* not THIS_IS_CONFIGURE */ - -/* Get the CFLAGS for real compilation. */ -#ifdef __GNUC__ -configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '$SPECIFIED_CFLAGS' -#else -configure___ REAL_CFLAGS=C_DEBUG_SWITCH '$SPECIFIED_CFLAGS' -#endif - -#endif /* not THIS_IS_CONFIGURE */ -#endif /* 0 */ ' > $tempcname dnl The value of CPP is a quoted variable reference, so we need to do this dnl to get its actual value... @@ -1647,12 +1663,6 @@ eval `$CPP -Isrc $tempcname \ | sed -n -e "s/[ TAB]*=[ TAB\"]*/='/" -e "s/[ TAB\"]*\$/'/" -e "s/^configure___//p"` changequote([, ])dnl -dnl if test -z "$SPECIFIED_CFLAGS"; then -dnl eval `$CPP -Isrc -DTHIS_IS_CONFIGURE $tempcname \ -dnl | sed -n -e "s/ *=[[ \"]]*/='/" -e "s/[[ \"]]*\$/'/" -e "s/^configure___//p"` -dnl else -dnl REAL_CFLAGS="$CFLAGS" -dnl fi rm $tempcname @@ -1669,7 +1679,7 @@ dnl Calculalate value of CFLAGS: dnl Use either command line flag, environment var, or autodetection -if test -z "$CFLAGS"; then +if test "$cflags_specified" = "no"; then dnl Following values of CFLAGS are known to work well. dnl Should we take debugging options into consideration? if test "$GCC" = "yes"; then @@ -1685,26 +1695,30 @@ elif test "$CC" = "xlc"; then CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000" else + dnl ### Add tests for other compilers here... CFLAGS="-O" ;dnl The only POSIX-approved flag fi fi -dnl Make sure linker flags not understood by GCC are properly wrapped. +dnl Inform compiler that certain flags are meant for the linker +dnl XE_PROTECT_LINKER_FLAGS(shell_var) +define([XE_PROTECT_LINKER_FLAGS], [ if test "$GCC" = "yes"; then - define([XE_GCC_WRAP_LDFLAGS], - [[$1_tmp]="$[$1]"; [$1]="" - for arg in $[$1_tmp]; do - case "$arg" in - -L* | -l* | -R* | -u* | -Wl* | -f*) [$1]="$[$1] $arg" ;; + set x $[$1]; shift; [$1]="" + while test -n "[$]1"; do + case [$]1 in + -L | -l | -u ) [$1]="$[$1] [$]1 [$]2"; shift ;; + -L* | -l* | -u* | -Wl* ) [$1]="$[$1] [$]1" ;; -Xlinker* ) ;; - * ) [$1]="$[$1] -Xlinker $arg" ;; + * ) [$1]="$[$1] -Xlinker [$]1" ;; esac - done])dnl - XE_GCC_WRAP_LDFLAGS(ld_switch_system) - XE_GCC_WRAP_LDFLAGS(ld_switch_machine) - XE_GCC_WRAP_LDFLAGS(LDFLAGS) - XE_GCC_WRAP_LDFLAGS(ld_call_shared) -fi + shift + done +fi])dnl +XE_PROTECT_LINKER_FLAGS(ld_switch_system) +XE_PROTECT_LINKER_FLAGS(ld_switch_machine) +XE_PROTECT_LINKER_FLAGS(LDFLAGS) +XE_PROTECT_LINKER_FLAGS(ld_call_shared) dnl Add s&m-determined objects (including unexec) to link line test -n "$objects_machine" && XE_ADD_OBJS($objects_machine) @@ -1731,20 +1745,20 @@ 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/ppc.ldscript" + if test "$unexec" = "unexaix.o"; then dnl AIX needs various hacks to make static linking work. -dnl This can go away if we ever figure out how to get dynamic linking on AIX. if test "$dynamic" = "no"; then start_flags="-Wl,-bnso,-bnodelcsect" test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}" - for f in "/lib/syscalls.exp" "$srcdir/src/m/ibmrs6000.inp"; do + for f in "/lib/syscalls.exp" "/lib/threads.exp"; do if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi done for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi done - dnl elif - dnl Put any AIX/gcc/dynamic flags here - xlc needs none added fi elif test -n "$ld_text_start_addr"; then start_flags="-T $ld_text_start_addr -e __start" @@ -1773,9 +1787,9 @@ dnl --site-prefixes (multiple dirs) if test -n "$site_prefixes"; then for arg in $site_prefixes; do - case "$arg" in - -* ) ;; - * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;; + case "$arg" in + -* ) ;; + * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;; esac XE_APPEND($argi, c_switch_site) XE_APPEND($argl, ld_switch_site) @@ -1791,7 +1805,7 @@ fi dnl --site-includes (multiple dirs) -if test -n "$site_includes" ; then +if test -n "$site_includes"; then for arg in $site_includes; do case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac XE_APPEND($arg, c_switch_site) @@ -1810,7 +1824,7 @@ done dnl --site-runtime-libraries (multiple dirs) -if test -n "$site_runtime_libraries" ; then +if test -n "$site_runtime_libraries"; then LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/ */:/g'`" export LD_RUN_PATH fi @@ -1834,6 +1848,7 @@ dash_r="" for try_dash_r in "-R" "-R " "-rpath "; do xe_check_libs="${try_dash_r}/no/such/file-or-directory" + XE_PROTECT_LINKER_FLAGS(xe_check_libs) AC_TRY_LINK(, , dash_r="$try_dash_r") xe_check_libs="" test -n "$dash_r" && break @@ -1908,6 +1923,7 @@ if test -n "$runpath"; then ld_switch_run="${dash_r}${runpath}" + XE_PROTECT_LINKER_FLAGS(ld_switch_run) test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" fi fi @@ -1954,13 +1970,12 @@ (Using Doug Lea's new malloc from the GNU C Library.)" fi AC_DEFINE(DOUG_LEA_MALLOC) - AC_DEFINE(USE_MINIMAL_TAGBITS) if test "$after_morecore_hook_exists" = "no" ; then GNU_MALLOC_reason=" (Using Doug Lea's new malloc from the Linux C Library.)" AC_DEFINE(_NO_MALLOC_WARNING_) fi - with_minimal_tagbits=yes + use_minimal_tagbits=yes fi dnl #### mcheck is broken in all versions of Linux libc and glibc. @@ -2130,28 +2145,36 @@ test "$x_includes $x_libraries" != "NONE NONE" && \ window_system=x11 with_x11=yes + dnl Autodetection of X11 libraries and includes + dnl ------------------------------------------- + dnl AC_PATH_XTRA thinks it can find our X headers and includes, but + dnl it often gets it wrong, so we only use it as a last resort. + dnl $OPENWINHOME implies --x-includes and --x-libraries dnl Not (yet) handled by autoconf2 - if test "$x_includes $x_libraries" = "NONE NONE"; then - if test -n "$OPENWINHOME" \ - -a "$OPENWINHOME" != "/usr/openwin" \ - -a -d "$OPENWINHOME"; then + if test "$x_includes $x_libraries" = "NONE NONE" \ + -a -n "$OPENWINHOME" \ + -a "$OPENWINHOME" != "/usr/openwin" \ + -a -d "$OPENWINHOME"; then test -d "$OPENWINHOME/lib" && x_libraries="$OPENWINHOME/lib" test -d "$OPENWINHOME/include" && x_includes="$OPENWINHOME/include" test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include" - else - dnl AC_PATH_XTRA often guesses /usr/include, when some other - dnl include directory is a MUCH better guess (Linux, HP-UX 10.20). - dnl This is a workaround for idiot (esp. HP) system packagers. - for dir in "/usr/X11R6/include" "/usr/include/X11R6"; do - if test -d "$dir/X11"; then x_includes="$dir"; break; fi - done - if test "$x_includes" != "NONE"; then - for dir in "/usr/X11R6/lib" "/usr/lib/X11R6"; do - if test -d "$dir"; then x_libraries="$dir"; break; fi - done - fi - fi + fi + + if test "$x_includes" = "NONE"; then + dnl AC_PATH_XTRA often guesses /usr/include, when some other + dnl include directory is a MUCH better guess (Linux, HP-UX 10.20). + dnl This is a workaround for idiot (esp. HP) system vendors, who + dnl provide a /usr/include/X11, but DON'T FULLY POPULATE IT. + for dir in "/usr/X11" "/usr/X11R6"; do + if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi + done + fi + + if test "$x_libraries" = "NONE"; then + for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do + if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi + done fi AC_PATH_XTRA # Autoconf claims to find X library and include dirs for us. @@ -2282,7 +2305,7 @@ AC_MSG_CHECKING(the version of X11 being used) AC_TRY_RUN([#include <X11/Intrinsic.h> - main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; }], + int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }], [./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4]) AC_MSG_RESULT(R${x11_release}) AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release}) @@ -2317,7 +2340,16 @@ dnl Problem with the MIT distribution of X on AIX if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then - XE_APPEND(-lc_r, libs_x) + dnl X11R6 requires thread-safe code on AIX for some reason + case "$CC" in + "xlc" ) CC="xlc_r" ;; + "xlC" ) CC="xlC_r" ;; + "cc" ) CC="cc_r" ;; + "gcc" ) + XE_PREPEND(-mthreads, X_CFLAGS) + XE_PREPEND(-mthreads, libs_x) + ;; + esac fi fi dnl $with_x11 = yes @@ -2348,12 +2380,41 @@ test -z "$window_system" && window_system="none" -if test "$window_system" = "none" ; then - if test "$with_tty" = "no" ; then - AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.]) - fi - for feature in tooltalk cde offix session \ - menubars scrollbars toolbars dialogs xim xmu \ +dnl Test for features that require a window system - ANY window system +if test "$window_system" = "none"; then + for feature in menubars scrollbars toolbars dialogs + do + if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then + AC_MSG_WARN([--with-$feature ignored: Not valid without window system support]) + fi + eval "with_${feature}=no" + done +else + test -z "$with_toolbars" && with_toolbars=yes +fi + +dnl ### Test for features that require mswindows support - currently none +dnl ### MS-Windows folks: add code here..... (martin) +if test "$with_msw" != "yes"; then + for feature in MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES + do + if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then + AC_MSG_WARN([--with-$feature ignored: Not valid without MS-Windows support]) + fi + eval "with_${feature}=no" + done +else + : +fi + +dnl Test for features that require X11 support +if test "$with_x11" != "yes"; then + dnl It ought to be reasonable to have no output device at all, and only use + dnl XEmacs in --batch mode. + dnl if test "$with_tty" = "no" ; then + dnl AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.]) + dnl fi + for feature in tooltalk cde offix session xim xmu \ tiff png jpeg gif xface xpm do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then @@ -2361,8 +2422,6 @@ fi eval "with_${feature}=no" done -else - test -z "$with_toolbars" && with_toolbars=yes fi dnl FSF 19.29 has some bitmapdir stuff here. @@ -2370,7 +2429,7 @@ case "$window_system" in x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;; - msw ) HAVE_X_WINDOWS=no; echo " Using MS-Windows." ;; + msw ) HAVE_X_WINDOWS=no ; echo " Using MS-Windows." ;; none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;; esac @@ -2398,9 +2457,8 @@ fi AC_SUBST(libs_xauth) -dnl Always compile OffiX except --without-offix is given or no -dnl x11 support is compiled in or no standard Xmu. -OFFIX_O="" +dnl Always compile OffiX unless --without-offix is given or no +dnl X11 support is compiled in or no standard Xmu. test "$window_system" != "x11" && with_offix=no if test "$with_xmu" != yes -a "$with_x11" = yes; then AC_MSG_WARN([No OffiX without real Xmu support]) @@ -2409,9 +2467,8 @@ test -z "$with_offix" && with_offix=yes if test "$with_offix" = "yes"; then AC_DEFINE(HAVE_OFFIX_DND) - OFFIX_O="offix.o" + XE_ADD_OBJS(offix.o) fi -AC_SUBST(OFFIX_O) dnl Autodetect tooltalk test "$with_cde" = "yes" && with_tooltalk=yes # CDE requires tooltalk @@ -2450,26 +2507,26 @@ dnl Autodetect LDAP AC_CHECKING(for LDAP) -test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) } -test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) } -test -z "$with_ldap" -o "$with_ldap" = "yes" && { AC_CHECK_LIB(ldap, ldap_open, with_umich_ldap=yes, with_umich_ldap=no, -llber) } -test \( -z "$with_ldap" -o "$with_ldap" = "yes" \) -a "$with_umich_ldap" = "no" && { AC_CHECK_LIB(ldap10, ldap_set_option, with_ns_ldap=yes, with_ns_ldap=no) } -test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes -if test "$with_ldap" = "yes" -a "$with_umich_ldap" = "yes" ; then +test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) } +test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) } +if test "$with_ldap" != "no"; then + test -z "$with_umich_ldap" && { AC_CHECK_LIB(ldap, ldap_open, with_umich_ldap=yes, with_umich_ldap=no, -llber) } + test "$with_umich_ldap" = "no" && { AC_CHECK_LIB(ldap10, ldap_set_option, with_ns_ldap=yes, with_ns_ldap=no) } + test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes +fi +if test "$with_ldap" = "yes"; then AC_DEFINE(HAVE_LDAP) - AC_DEFINE(HAVE_UMICH_LDAP) - XE_PREPEND(-llber, LIBS) - XE_PREPEND(-lldap, LIBS) XE_ADD_OBJS(eldap.o) -elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then - AC_DEFINE(HAVE_LDAP) - AC_DEFINE(HAVE_NS_LDAP) - XE_PREPEND(-lldap10, LIBS) - XE_ADD_OBJS(eldap.o) -elif test "$with_ldap" = "yes" ; then - AC_DEFINE(HAVE_LDAP) - XE_PREPEND(-lldap, LIBS) - XE_ADD_OBJS(eldap.o) + if test "$with_umich_ldap" = "yes" ; then + AC_DEFINE(HAVE_UMICH_LDAP) + XE_PREPEND(-llber, LIBS) + XE_PREPEND(-lldap, LIBS) + elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then + AC_DEFINE(HAVE_NS_LDAP) + XE_PREPEND(-lldap10, LIBS) + elif test "$with_ldap" = "yes" ; then + XE_PREPEND(-lldap, LIBS) + fi fi dnl ---------------------- @@ -2480,30 +2537,44 @@ AC_CHECKING(for X11 graphics libraries) + dnl Too many stupid linkers can't detect cascaded lib dependencies until runtime + dnl So we always search for libz compression support. + if test "$with_png $with_tiff" != "no no"; then + AC_CHECK_LIB(c, inflate, [:], [ + AC_CHECK_LIB(z, inflate, [XE_PREPEND(-lz, libs_x)],[ + AC_CHECK_LIB(gz, inflate, [XE_PREPEND(-lgz, libs_x)])])]) + fi + dnl Autodetect Xpm - AC_MSG_CHECKING(for Xpm - no older than 3.4f) - xe_check_libs=-lXpm - test -z "$with_xpm" && { AC_TRY_RUN([#include <X11/xpm.h> - int main(int c, char **v) { - return c == 1 ? 0 : - XpmIncludeVersion != XpmLibraryVersion() ? 1 : - XpmIncludeVersion < 30406 ? 2 : - 0 ; - }], [./conftest foobar; xpm_status=$?; - if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi;], - with_xpm=no, with_xpm=no) - } - xe_check_libs= - AC_MSG_RESULT($with_xpm) - if test "$xpm_status" = "1" -o "$xpm_status" = "2"; then - test "$xpm_status" = "1" && problem="Xpm library version and header file version don't match!" - test "$xpm_status" = "2" && problem="Xpm library version is too old!" - echo " + if test -z "$with_xpm"; then + AC_MSG_CHECKING(for Xpm - no older than 3.4f) + xe_check_libs=-lXpm + AC_TRY_RUN([#include <X11/xpm.h> + int main(int c, char **v) { + return c == 1 ? 0 : + XpmIncludeVersion != XpmLibraryVersion() ? 1 : + XpmIncludeVersion < 30406 ? 2 : 0 ;}], + [./conftest dummy_arg; xpm_status=$?; + if test "$?" = "0"; then + with_xpm=yes; + else + with_xpm=no; + if test "$?" = "1"; then + xpm_problem="Xpm library version and header file version don't match!" + elif test "$?" = "2"; then + xpm_problem="Xpm library version is too old!" + else + xpm_problem="Internal xpm detection logic error!" + fi + echo " *** WARNING *** $problem I'm not touching that with a 10-foot pole! If you really want to use the installed version of Xpm, rerun - configure --with-xpm=yes, but don't blame me if XEmacs crashes! - " + configure --with-xpm=yes, but don't blame me if XEmacs crashes!" + fi], + [with_xpm=no]) + xe_check_libs= + AC_MSG_RESULT($with_xpm) fi if test "$with_xpm" = "yes"; then AC_DEFINE(HAVE_XPM) @@ -2539,33 +2610,32 @@ fi dnl autodetect PNG - test -z "$with_png" && { AC_CHECK_HEADER(png.h, , with_png=no) } - test -z "$with_png" && { AC_CHECK_FUNC(pow, , with_png=no) } - if test "$with_png" != "no"; then - for extra_libs in "" "-lz" "-lgz"; do - AC_CHECK_LIB(png, png_set_strip_alpha, - png_libs="-lpng $extra_libs" with_png=yes; break,[:],$extra_libs) - done + if test -z "$with_png"; then + AC_MSG_CHECKING(for png.h - no older than 0.96) + AC_EGREP_CPP(yes, +[#include <png.h> +#if PNG_LIBPNG_VER >= 96 +yes +#endif +], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_png=no]) fi - test -z "$with_png" && with_png=no + test -z "$with_png" && { AC_CHECK_FUNC(pow, ,with_png=no) } + test -z "$with_png" && { AC_CHECK_LIB(png, png_read_image,[:],with_png=no) } + test -z "$with_png" && with_png=yes if test "$with_png" = "yes"; then AC_DEFINE(HAVE_PNG) - XE_PREPEND($png_libs, libs_x) + XE_PREPEND(-lpng, libs_x) fi dnl autodetect TIFF - if test "$with_tiff" != no; then - for extra_libs in "" "-lz" "-lgz"; do - AC_CHECK_LIB(tiff, TIFFReadScanline, - tiff_libs="-ltiff $extra_libs" with_tiff=yes; break, [:], $extra_libs) - done - fi - test -z "$with_tiff" && with_tiff=no + test -z "$with_tiff" && { AC_CHECK_HEADER(tiffio.h, ,with_tiff=no) } + test -z "$with_tiff" && { AC_CHECK_LIB(tiff, TIFFReadScanline,[:],with_tiff=no) } + test -z "$with_tiff" && with_tiff=yes if test "$with_tiff" = "yes"; then AC_DEFINE(HAVE_TIFF) - XE_PREPEND($tiff_libs, libs_x) + XE_PREPEND(-ltiff, libs_x) fi - + dnl Autodetect -lXaw AC_CHECK_LIB(Xaw, XawScrollbarSetThumb, have_xaw=yes, have_xaw=no) dnl if test "$have_xaw" = "yes"; then @@ -2579,6 +2649,18 @@ [AC_CHECK_LIB(Xm, XmStringFree, have_motif=yes, have_motif=no)], have_motif=no) + if test "$have_motif" = "yes"; then + dnl autodetect lesstif + AC_MSG_CHECKING(for Lesstif) + AC_EGREP_CPP(yes, +[#include <Xm/Xm.h> +#ifdef LESSTIF_VERSION +yes +#endif +], have_lesstif=yes, have_lesstif=no) + AC_MSG_RESULT($have_lesstif) + fi + fi dnl "$with_x11" = "yes" dnl Finish ensuring that we have values for the various toolkit items. @@ -2661,16 +2743,15 @@ fi fi -if test "$with_gung" != "no"; then - test "$with_minimal_tagbits" = "no" && AC_DEFINE(USE_MINIMAL_TAGBITS) - AC_DEFINE(USE_INDEXED_LRECORD_IMPLEMENTATION) -fi +test "$use_minimal_tagbits" = "yes" && AC_DEFINE(USE_MINIMAL_TAGBITS) +test "$use_indexed_lrecord_implementation" = "yes" && \ + AC_DEFINE(USE_INDEXED_LRECORD_IMPLEMENTATION) dnl ---------------------- dnl Mule-dependent options dnl ---------------------- -test -z "$with_mule" && with_mule=no +test -z "$with_mule" && with_mule=no test -z "$with_file_coding" && with_file_coding=no dnl if test "$with_mule" = "yes" && test ! -d "$srcdir/lisp/mule"; then @@ -2698,12 +2779,15 @@ AC_CHECKING(for Mule input methods) dnl Do we have the XmIm* routines? And if so, do we want to use them? dnl XIM seems to be flaky except on Solaris... - test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no + dnl test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no case "$with_xim" in "" | "yes" ) AC_CHECKING(for XIM) - AC_CHECK_LIB(Xm, XmImMbLookupString, with_xim=motif, with_xim=xlib) + dnl XIM + Lesstif is not (yet?) usable + if test "$have_lesstif" = "yes"; then with_xim=xlib + else AC_CHECK_LIB(Xm, XmImMbLookupString, with_xim=motif, with_xim=xlib) + fi esac - if test "$with_xim" != "no" ; then + if test "$with_xim" != "no"; then AC_DEFINE(HAVE_XIM) if test "$with_xim" = "xlib"; then AC_DEFINE(XIM_XLIB) @@ -2873,7 +2957,7 @@ fi if test "$HAVE_TIMEVAL" = "yes"; then -AC_MSG_CHECKING(whether gettimeofday cannot accept two arguments) +AC_MSG_CHECKING(whether gettimeofday accepts one or two arguments) AC_TRY_LINK([ #ifdef TIME_WITH_SYS_TIME #include <sys/time.h> @@ -2891,8 +2975,8 @@ struct timezone dummy; gettimeofday (&time, &dummy); ], - [AC_MSG_RESULT(no)], - [AC_MSG_RESULT(yes) + [AC_MSG_RESULT(two)], + [AC_MSG_RESULT(one) AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)]) fi @@ -3262,9 +3346,8 @@ fi fi -if test "$with_database_gnudbm" = "yes" -o \ - "$with_database_dbm" = "yes" -o \ - "$with_database_berkdb" = "yes"; then +if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \ + != "no no no"; then AC_DEFINE(HAVE_DATABASE) XE_ADD_OBJS(database.o) fi @@ -3303,6 +3386,27 @@ esac 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 +dnl have reported incorrect results. +AC_TRY_RUN([int main(int c,char *v[]){return 0;}],[:],[ + echo "" + echo "*** PANIC *** The C compiler can no longer build working executables." + echo "*** PANIC *** Please examine the tail of config.log for runtime errors." + echo "*** PANIC *** The most likely reason for this problem is that configure" + echo "*** PANIC *** links with shared libraries, but those libraries cannot be" + echo "*** PANIC *** found at run time." + echo "*** PANIC ***" + echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig." + echo "*** PANIC *** On other systems, try telling configure where to find the" + echo "*** PANIC *** shared libraries using the --site-runtime-libraries option" + echo "*** PANIC ***" + echo "*** PANIC *** Another way to shoot yourself in the foot is to specify" + echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed" + echo "*** PANIC *** on your system. Don't do that." + exit 1]) + dnl Process support (hardcoded) dnl every system that supports this runs configure, the others don't @@ -3487,12 +3591,12 @@ test "$external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET) test "$with_gnu_make" = "yes" && AC_DEFINE(USE_GNU_MAKE) test "$no_doc_file" = "yes" && AC_DEFINE(NO_DOC_FILE) -test "$const_is_losing" = "yes" && AC_DEFINE(CONST_IS_LOSING) +dnl test "$const_is_losing" = "yes" && AC_DEFINE(CONST_IS_LOSING) test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY) test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP) test "$with_kerberos" = "yes" && AC_DEFINE(KERBEROS) test "$with_hesiod" = "yes" && AC_DEFINE(HESIOD) -test "$use_union_type" != yes && AC_DEFINE(NO_UNION_TYPE) +test "$use_union_type" = "yes" && AC_DEFINE(USE_UNION_TYPE) dnl ------------------------------- dnl Report on what we decided to do @@ -3624,10 +3728,9 @@ test "$with_pop" = yes && echo " Using POP for mail access" test "$with_kerberos" = yes && echo " Using Kerberos for POP authentication" test "$with_hesiod" = yes && echo " Using Hesiod to get POP server host" -test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." -test "$with_minimal_tagbits" != "no" -o "$with_gung" != "no" && \ - echo " Using Lisp_Objects with minimal tagbits." -test "$with_gung" != "no" && echo " Using indexed lrecord implementation." +test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." +test "$use_minimal_tagbits" = yes && echo " Using Lisp_Objects with minimal tagbits." +test "$use_indexed_lrecord_implementation" = yes && echo " Using indexed lrecord implementation." test "$debug" = yes && echo " Compiling in extra code for debugging." test "$memory_usage_stats" = yes && echo " Compiling in code for checking XEmacs memory usage." test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." @@ -3664,8 +3767,15 @@ dnl Build Makefile.in's from Makefile.in.in's dnl except ./Makefile from $srcdir/Makefile.in -AC_OUTPUT($internal_makefile_list lib-src/config.values,[ -for dir in $MAKE_SUBDIR; do +for file in $internal_makefile_list; do + test "$file" = src/Makefile.in && \ + file="src/Makefile.in:src/Makefile.in.in:src/depend" + ac_output_files="${ac_output_files+$ac_output_files }$file" +done +ac_output_files="$ac_output_files lib-src/config.values" + +AC_OUTPUT($ac_output_files, +[for dir in $MAKE_SUBDIR; do echo creating $dir/Makefile ( changequote(<<, >>)dnl @@ -3692,8 +3802,8 @@ | sed -n -e '/^..*$/p' \ | sed '/^"/ { s/\\\([\"]\)/\1/g -s/^"// -s/"$// +s/^[ TAB]*"// +s/"[ TAB]*$// }' > Makefile.new chmod 444 Makefile.new mv -f Makefile.new Makefile
--- a/configure.usage Mon Aug 13 10:27:41 2007 +0200 +++ b/configure.usage Mon Aug 13 10:28:48 2007 +0200 @@ -6,7 +6,7 @@ them using `--OPTION=yes' and explicitly disable them using `--OPTION=no'. This is especially useful for auto-detected options. -Options marked with a (*) are autodetected. +Options marked with a (*) are auto-detected. Use colons (or quoted spaces) to separate directory names in option values which are PATHs (i.e. lists of directories). @@ -20,15 +20,19 @@ Compilation options: ---compiler=XXXX Specify compiler. Overrides environment variable CC. +--compiler=prog C compiler to use. --with-gcc (*) Use GCC to compile XEmacs. ---with-gcc=no Don't use GCC to compile XEmacs. +--without-gcc Don't use GCC to compile XEmacs. --with-gnu-make Write the Makefiles to take advantage of special features of GNU Make. (GNU Make works fine on the Makefiles even without this option. This just allows for simultaneous in-place and --srcdir building.) ---cflags=FLAGS Compiler flags. Overrides environment variable CFLAGS. +--cflags=FLAGS Compiler flags (such as -O) +--cpp=prog C preprocessor to use (e.g. /usr/ccs/lib/cpp or cc -E) +--cppflags=FLAGS C preprocessor flags (e.g. -I/foo or -Dfoo=bar) +--libs=LIBS Additional libraries (e.g. -lfoo) +--ldflags=FLAGS Additional linker flags (e.g. -L/foo) --site-includes=PATH List of directories to search first for header files. --site-libraries=PATH List of directories to search first for libraries. --site-prefixes=PATH List of directories to search for include/ and lib/ @@ -42,8 +46,10 @@ linking is the default. --srcdir=DIR Look for the XEmacs source files in DIR. See also --with-gnu-make. ---const-is-losing=no Allow the use of const in the source code. ---with-gung Build with new-style Lisp_Objects. +--use-indexed-lrecord-implementation +--use-minimal-tagbits +--gung-ho Build with new-style Lisp_Objects. + Equivalent to both of the 2 previous options combined. Installation options: @@ -54,11 +60,11 @@ Window-system options: --with-x11 (*) Support the X Window System. ---with-x11=no Don't support X. +--without-x11 Don't support X. --x-includes=DIR Search for X header files in DIR. --x-libraries=DIR Search for X libraries in DIR. ---with-toolbars=no Don't compile with any toolbar support. ---with-session=no Compile without realized leader window which will +--without-toolbars Don't compile with any toolbar support. +--without-session Compile without realized leader window which will keep the WM_COMMAND property. Required for proper session-management. --with-menubars=TYPE Use TYPE menubars (lucid, motif, or no). The Lucid @@ -70,8 +76,8 @@ Lucid menubars and scrollbars are the default. Motif dialog boxes will be used if Motif can be found. --with-cde (*) Compile in support for CDE drag and drop. ---with-offix (*) Compile in support for OffiX drag and drop. ---with-xmu=no (*) For those unfortunates whose vendors don't ship Xmu. +--with-offix Compile in support for OffiX drag and drop. +--without-xmu (*) For those unfortunates whose vendors don't ship Xmu. --external-widget Compile with external widget support. --with-xpm (*) Compile with support for XPM files. It is highly recommended that you obtain XPM @@ -95,7 +101,7 @@ TTY options: ---with-tty=no Don't support TTY-s. +--without-tty Don't support TTY-s. --with-ncurses (*) Use the ncurses library for tty support. --with-gpm (*) Compile in support for General Purpose Mouse. @@ -143,7 +149,7 @@ Internationalization options: --with-mule Compile with Mule (MUlti-Lingual Emacs) support, - needed to suport non-Latin-1 (including Asian) languages. + needed to support non-Latin-1 (including Asian) languages. --with-xim=xlib Compile with support for X input methods, --with-xim=motif (*) Used in conjunction with Mule support. Use either raw Xlib to provide XIM support, or @@ -212,13 +218,18 @@ If successful, configure leaves its status in config.status. If unsuccessful after disturbing the status quo, it removes config.status. -The configure build process also uses the following environment variables: +The configure script also recognizes some environment variables, each +of which is equivalent to a corresponding configure flag. A specified +configure flag always overrides the environment variable. -CC C compiler to use (but configure flags take precedence) -CPP C preprocessor to use (such as /usr/ccs/lib/cpp or cc -E) -CFLAGS C compiler compilation flags (such as -O) -CPPFLAGS Compilation flags (such as -I/foo) used only by the preprocessor -LDFLAGS Additional linker flags (such as -L/foo) -LIBS Additional libraries (such as -lfoo) +envvar configure flag +----- -------------- +CC --compiler +CPP --cpp +CFLAGS --cflags +CPPFLAGS --cppflags +LDFLAGS --ldflags +LIBS --libs +LD_RUN_PATH --site-runtime-libraries For more details on the install process, consult the INSTALL file.
--- a/dynodump/dynodump.c Mon Aug 13 10:27:41 2007 +0200 +++ b/dynodump/dynodump.c Mon Aug 13 10:28:48 2007 +0200 @@ -18,9 +18,9 @@ * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * + * * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, + * the part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE @@ -73,7 +73,7 @@ * N.B. The above commentary is not quite correct in the flags have been hardwired * to RTLD_SAVREL. */ -#pragma ident "@(#) $Id: dynodump.c,v 1.5 1997/09/03 03:39:06 steve Exp $ - SMI" +#pragma ident "@(#) $Id: dynodump.c,v 1.6 1998/03/31 20:10:55 steve Exp $ - SMI" #define __EXTENSIONS__ 1 @@ -492,7 +492,7 @@ /* * If were inserting the new .heap section, insert the new - * section name and initialize it's virtual address. + * section name and initialize its virtual address. */ if (_addr) { strs = heap;
--- a/dynodump/ppc/_relocate.c Mon Aug 13 10:27:41 2007 +0200 +++ b/dynodump/ppc/_relocate.c Mon Aug 13 10:28:48 2007 +0200 @@ -18,9 +18,9 @@ * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * + * * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, + * the part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE @@ -32,7 +32,7 @@ * Mountain View, California 94043 */ -#pragma ident "@(#) $Id: _relocate.c,v 1.3 1997/05/29 04:23:20 steve Exp $ - SMI" +#pragma ident "@(#) $Id: _relocate.c,v 1.4 1998/03/31 20:10:55 steve Exp $ - SMI" /* LINTLIBRARY */ @@ -256,7 +256,7 @@ /* * If we are required to restore the relocation location - * to it's value prior to relocation, then read the + * to its value prior to relocation, then read the * locations original contents from the input image and * copy it to the output image. */
--- a/dynodump/sparc/_relocate.c Mon Aug 13 10:27:41 2007 +0200 +++ b/dynodump/sparc/_relocate.c Mon Aug 13 10:28:48 2007 +0200 @@ -18,9 +18,9 @@ * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * + * * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, + * the part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE @@ -35,7 +35,7 @@ /* * Update the value of the `_edata' and `_end' symbols. */ -#pragma ident "@(#) $Id: _relocate.c,v 1.3 1997/05/29 04:23:26 steve Exp $ - SMI" +#pragma ident "@(#) $Id: _relocate.c,v 1.4 1998/03/31 20:10:55 steve Exp $ - SMI" #include <libelf.h> #include <string.h> @@ -282,7 +282,7 @@ /* * If we are required to restore the relocation location - * to it's value prior to relocation, then read the + * to its value prior to relocation, then read the * locations original contents from the input image and * copy it to the output image. */
--- a/etc/BETA Mon Aug 13 10:27:41 2007 +0200 +++ b/etc/BETA Mon Aug 13 10:28:48 2007 +0200 @@ -32,7 +32,7 @@ requests to the main address (xemacs-beta@xemacs.org), always send them to xemacs-beta-request@xemacs.org. If you have problems with the list itself, they should be brought to the attention of the XEmacs -Mailing List manager Steve Baur <steve@xemacs.org>. +Mailing List manager Jason Mastaler <list-manager@xemacs.org>. ** Beta Release Schedule @@ -131,42 +131,43 @@ writing: ./configure \ - --cflags="-m486 -g -O4 -fno-strength-reduce -malign-loops=2 \ - -malign-jumps=2 -malign-functions=2" \ - --with-sound=no --with=offix \ + --cflags="-mpentium -march=pentium -O6 -g -fno-peep-spills" \ --error-checking=all --debug=yes \ --with-scrollbars=athena3d --with-dialogs=athena3d \ - --with-mule --with-canna --with-wnn + --with-mule --with-xfs --with-xim=xlib Part of the configure output is a summary that looks something like: uname -a: Linux altair.xemacs.org 2.0.32 #2 Sun Nov 16 18:52:14 PST 1997 i586 -./configure '--cflags=-Wall -Wno-switch -O6' '--error-checking=none' '--debug=no' '--with-mule=yes' '--with-dialogs=athena3d' '--with-scrollbars=athena3d' '--use-union-type=no' '--with-xim=xlib' '--with-xfs' '--mail-locking=file' +./configure '--cflags=-mpentium -march=pentium -O6 -g -fno-peep-spills' '--error-checking=all' '--debug=yes' '--with-scrollbars=athena3d' '--with-dialogs=athena3d' '--with-mule' '--with-xfs' '--with-xim=xlib' -Configured for `i586-pc-linux'. +XEmacs 21.0-b34 "Oberhasli-pre2" configured for `i586-pc-linux'. - Where should the build process find the source code? /usr/src/xemacs-20.15 - What installation prefix should install use? /usr/local - Where should XEmacs look for packages? ~/.xemacs:/usr/local/lib/xemacs/packages + Where should the build process find the source code? /home/xemacs/xemacs-20.0 + What installation prefix should install use? /usr/local What operating system and machine description files should XEmacs use? `s/linux.h' and `m/intel386.h' - What compiler should XEmacs be built with? gcc -Wall -Wno-switch -O6 + What compiler should XEmacs be built with? gcc -mpentium -march=pentium -O6 -g -fno-peep-spills Should XEmacs use the GNU version of malloc? yes + (Using Doug Lea's new malloc from the GNU C Library.) Should XEmacs use the relocating allocator for buffers? yes What window system should XEmacs use? x11 - Where do we find X Windows header files? /usr/X11R6/include - Where do we find X Windows libraries? /usr/X11R6/lib + Where do we find X Windows header files? /usr/X11/include + Where do we find X Windows libraries? /usr/X11/lib Compiling in support for XAUTH. Compiling in support for XPM images. Compiling in support for X-Face message headers. - Compiling in support for ImageMagick image conversion. - Using -ljbig -ljpeg -lmpeg -lttf -lpng -lz -ltiff -ljpeg -lz for graphics libraries. + Compiling in support for GIF image conversion. + Compiling in support for JPEG image conversion. + Compiling in support for PNG image conversion. + Compiling in support for TIFF image conversion. Compiling in native sound support. Compiling in support for Berkeley DB. - Compiling in support for DBM. + Compiling in support for GNU DBM. Compiling in support for ncurses. + Compiling in support for GPM (General Purpose Mouse). Compiling in Mule (multi-lingual) support. Compiling in XIM (X11R5+ I18N input method) support. Using raw Xlib to provide XIM support. @@ -175,14 +176,24 @@ Compiling in support for the WNN input method on Mule. Using WNN version 6. Compiling in support for OffiX. + Compiling in support for proper session-management. Using Lucid menubars. Using Athena-3d scrollbars. Using Athena-3d dialog boxes. + Compiling in DLL support. movemail will use "dot-locking" for locking mail spool files. - The `Info-default-directory-list' will be initialized from: - INFOPATH="/usr/local/info:/usr/info:/usr/local/lib/texmf/doc/info:/usr/lib/texmf/doc/info" + Using Lisp_Objects with minimal tagbits. + Compiling in extra code for debugging. + Compiling in code for checking XEmacs memory usage. + WARNING: --------------------------------------------------------- + WARNING: Compiling in support for runtime error checking. + WARNING: XEmacs will run noticeably more slowly as a result. + WARNING: Error checking is on by default for XEmacs beta releases. + WARNING: --------------------------------------------------------- -Then type `make; make finder' and you should have a working XEmacs. + + +Then type `make' and you should have a working XEmacs. After you have verified that you have a functional editor, fire up your favorite mail program and send a build report to @@ -200,7 +211,8 @@ 4. The configuration report illustrated above For convenience all of the above items are placed in a file called - `Installation' in the top level build directory. + `Installation' in the top level build directory. They are also + available by performing M-x describe-installation inside XEmacs. 5. Any other unusual items you feel should be brought to the attention of the developers. @@ -236,9 +248,9 @@ M-x cd to the appropriate directory, and issue the command `C-u M-!' from within XEmacs. -* XEmacs 20.5 packages +* XEmacs 21 packages -XEmacs 20.5 has added the concept of installable packages searched prior +XEmacs 21 has added the concept of installable packages searched prior to dump time when building. Packages are searched by default under /usr/local/lib/xemacs/packages/. @@ -273,18 +285,14 @@ AUCTeX and Gnus have package tarballs in - ftp://ftp.xemacs.org/pub/xemacs/beta/xemacs-20.5/packages/ + ftp://ftp.xemacs.org/pub/xemacs/beta/xemacs-21.0/packages/ that you can simply untar in a package directory to install. -Karl Hegbloom has a set of packages in - [sorry - reference has been lost] -that work the same way. - ** Packages directory on the FTP Site ===================================== The packages directory - ftp://ftp.xemacs.org/pub/xemacs/beta/xemacs-20.4/packages/ + ftp://ftp.xemacs.org/pub/xemacs/beta/xemacs-21.0/packages/ is divided into subdirectory by the major type of package. @@ -304,7 +312,7 @@ ** Binary package installation (binary-packages) ================================================ -Prerequisite: XEmacs 20.5-b1. +Prerequisite: XEmacs 21.0-b1. Binary packages are complete entities that can be untarred at the top level of an XEmacs package hierarchy and work at runtime. To install files @@ -314,7 +322,7 @@ ** Manual procedures for package management =========================================== -Prerequisite: XEmacs 20.5 +Prerequisite: XEmacs 21.0 When adding and deleting files from a lisp directory the auto-autoloads.el (global symbols) and custom-load.el (Customization @@ -322,16 +330,16 @@ directory called `lisp-utils', the command to rebuild the auto-autoloads.el file is: -xemacs-20.5 -vanilla -batch -l autoload -f batch-update-directory lisp-utils +xemacs-21.0 -vanilla -batch -l autoload -f batch-update-directory lisp-utils The command to rebuild the custom-load.el file is: -xemacs-20.5 -vanilla -batch -l cus-dep \ +xemacs-21.0 -vanilla -batch -l cus-dep \ -f Custom-make-dependencies lisp-utils To bytecompile both of these files the command is: -xemacs-20.5 -vanilla -batch -f batch-byte-compile \ +xemacs-21.0 -vanilla -batch -f batch-byte-compile \ lisp-utils/auto-autoloads.el lisp-utils/custom-laod.el ** Building XEmacs and XEmacs packages from scratch @@ -359,14 +367,6 @@ **** Do a make from the top level package lisp source directory.[1] -***** There are two build glitches at this time. You must `make - auto-autoloads.el' manually in comm/tm before starting if you have - done a `make distclean'. This should be unnecessary after a fresh - cvs checkout. - -***** You must go back and rebuild the strokes package after the main - build is complete. - **** Do `make bindist's on all the packages you wish to install and remove the byproduct .tar.gz's.
--- a/etc/PACKAGES Mon Aug 13 10:27:41 2007 +0200 +++ b/etc/PACKAGES Mon Aug 13 10:28:48 2007 +0200 @@ -35,15 +35,18 @@ ** Package Path =============== -For backwards compatibility and for ease of transition to XEmacs -20.5+, it is possible to use previous XEmacs installations as package -directories. Specify something like ---package-path="~/.xemacs::/usr/local/lib/xemacs-20.3" to configure -when building. You will have extra messages at dump time relating to -lisp shadows which you may ignore. The magical null directory `::' is -a marker indicating where Lisp bundled with the running XEmacs gets -put into the load path. By specifing the older directories after the -current one, the newer lisp overrides the older lisp. +For backwards compatibility and for ease of transition to XEmacs 21, it +is possible to use previous XEmacs installations as package directories. +Specify something like +--package-path="~/.xemacs::/somewhere-newpackages::/usr/local/lib/xemacs-20.4" +to configure when building. You will have extra messages at dump +time relating to lisp shadows which you may ignore. The first +magical null directory `::' is a marker indicating what packages +should only be searched at run-time. The second magical null +directory is used to indicate where Lisp bundled with the running +XEmacs gets put at the back of load path. By specifing the older +directories after the current one, the newer lisp overrides the +older lisp. ** The anatomy of an XEmacs Package hierarchy =============================================
--- a/info/dir Mon Aug 13 10:27:41 2007 +0200 +++ b/info/dir Mon Aug 13 10:28:48 2007 +0200 @@ -34,7 +34,7 @@ * Menu: -XEmacs 20.5 +XEmacs 21.0 =========== * Info:: Documentation browsing system. * XEmacs:: The extensible user-friendly self-documenting text editor.
--- a/lib-src/Makefile.in.in Mon Aug 13 10:27:41 2007 +0200 +++ b/lib-src/Makefile.in.in Mon Aug 13 10:28:48 2007 +0200 @@ -25,7 +25,7 @@ ## For performance and consistency, no built-in rules .SUFFIXES: -.SUFFIXES: .c .o .i .h +.SUFFIXES: .c .h .o ## ==================== Things "configure" will edit ==================== @SET_MAKE@ @@ -122,21 +122,16 @@ #endif c_switch_general=@c_switch_general@ -c_switch_window_system=@c_switch_window_system@ c_switch_all=@c_switch_all@ ld_switch_general=@ld_switch_general@ -ld_switch_window_system=@ld_switch_window_system@ ld_switch_all=@ld_switch_all@ ld_libs_general=@ld_libs_general@ -ld_libs_window_system=@ld_libs_window_system@ -ld_libs_all=@ld_libs_all@ ## We need to #define emacs to get the right versions of some files. -lib_src_cppflags = -Demacs -I../src -I${srcdir} -I${srcdir}/../src $(CPPFLAGS) -lib_src_cppflags = -Demacs -I../src $(CPPFLAGS) -cflags = $(CFLAGS) $(lib_src_cppflags) $(c_switch_all) -ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_libs_general) +cppflags = -Demacs -I../src $(CPPFLAGS) +cflags = $(CFLAGS) $(cppflags) $(c_switch_general) +ldflags = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general) ## This is the default compilation command. ## But we should never rely on it, because some make version @@ -166,7 +161,7 @@ maybe-blessmail: $(blessmail) #ifdef MOVEMAIL_NEEDS_BLESSING ## Do not charge ahead and do it! Let the installer decide. -## ./blessmail ${archlibdir}/movemail +## ./blessmail ${archlibdir}/movemail @if test `wc -l <blessmail` != 2; then \ dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \ echo "*************************************************************";\ @@ -181,7 +176,7 @@ do-blessmail: $(blessmail) #ifdef MOVEMAIL_NEEDS_BLESSING - ./blessmail ${archlibdir}/movemail + ./blessmail ${archlibdir}/movemail #endif ## Install the internal utilities. Until they are installed, we can @@ -254,10 +249,10 @@ ${CC} -c $(cflags) ${srcdir}/../src/alloca.c regex.o: ${srcdir}/../src/regex.c ${srcdir}/../src/regex.h - $(CC) -c `echo ${cflags} | sed 's/-Demacs/ /'` \ + $(CC) -c `echo $(cflags) | sed 's/-Demacs/ /'` \ -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c -etags_args = -I. ${cflags} -I${srcdir} -I${srcdir}/../src \ +etags_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \ -DVERSION='"${version}"' ${srcdir}/etags.c \ $(GETOPTOBJS) regex.o $(ldflags) etags_deps = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h @@ -270,37 +265,37 @@ $(CC) -DCTAGS ${etags_args} -o $@ wakeup: ${srcdir}/wakeup.c - $(CC) ${cflags} ${srcdir}/wakeup.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/wakeup.c $(ldflags) -o $@ profile: ${srcdir}/profile.c - $(CC) ${cflags} ${srcdir}/profile.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/profile.c $(ldflags) -o $@ make-docfile: ${srcdir}/make-docfile.c - $(CC) ${cflags} ${srcdir}/make-docfile.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/make-docfile.c $(ldflags) -o $@ digest-doc: ${srcdir}/digest-doc.c - $(CC) ${cflags} ${srcdir}/digest-doc.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/digest-doc.c $(ldflags) -o $@ sorted-doc: ${srcdir}/sorted-doc.c - $(CC) ${cflags} ${srcdir}/sorted-doc.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/sorted-doc.c $(ldflags) -o $@ b2m: ${srcdir}/b2m.c ../src/config.h - $(CC) ${cflags} ${srcdir}/b2m.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/b2m.c $(ldflags) -o $@ movemail: ${srcdir}/movemail.c ${srcdir}/pop.c ${srcdir}/pop.h ../src/config.h - $(CC) ${cflags} ${MOVE_FLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c $(ldflags) ${MOVE_LIBS} -o $@ + $(CC) $(cflags) ${MOVE_FLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c $(ldflags) ${MOVE_LIBS} -o $@ cvtmail: ${srcdir}/cvtmail.c - $(CC) ${cflags} ${srcdir}/cvtmail.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/cvtmail.c $(ldflags) -o $@ fakemail: ${srcdir}/fakemail.c ../src/config.h - $(CC) ${cflags} ${srcdir}/fakemail.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/fakemail.c $(ldflags) -o $@ yow: ${srcdir}/yow.c ../src/paths.h - $(CC) ${cflags} ${srcdir}/yow.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/yow.c $(ldflags) -o $@ hexl: ${srcdir}/hexl.c - $(CC) ${cflags} ${srcdir}/hexl.c $(ldflags) -o $@ + $(CC) $(cflags) ${srcdir}/hexl.c $(ldflags) -o $@ make-msgfile: ${srcdir}/make-msgfile.c $(CC) $(cflags) ${srcdir}/make-msgfile.c $(ldflags) -o $@ @@ -308,20 +303,19 @@ make-po: ${srcdir}/make-po.c $(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o $@ -## Why oh why does HP not include half of the standard X distribution? - +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 - $(CC) -c ${cflags} ${srcdir}/gnuslib.c + $(CC) -c $(cflags_gnuserv) ${srcdir}/gnuslib.c gnuclient: ${srcdir}/gnuclient.c gnuslib.o ${srcdir}/gnuserv.h - $(CC) ${cflags} ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@ + $(CC) $(cflags_gnuserv) ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@ gnuserv: ${srcdir}/gnuserv.c gnuslib.o ${srcdir}/gnuserv.h - $(CC) ${cflags} ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@ + $(CC) $(cflags_gnuserv) ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@ ## mmencode binary is used by tm - but is really part of the metamail package ## mmencode.c was merged copy of mmencode.c and codes.c of metamail mmencode : ${srcdir}/mmencode.c - $(CC) ${cflags} ${srcdir}/mmencode.c -o $@ + $(CC) $(cflags) ${srcdir}/mmencode.c -o $@ ## The timer utility (timer.c, getdate.y) is not used in XEmacs
--- a/lib-src/config.values.in Mon Aug 13 10:27:41 2007 +0200 +++ b/lib-src/config.values.in Mon Aug 13 10:28:48 2007 +0200 @@ -30,7 +30,6 @@ LIBS "@LIBS@" LN_S "@LN_S@" MAKE_SUBDIR "@MAKE_SUBDIR@" -OFFIX_O "@OFFIX_O@" RANLIB "@RANLIB@" RECURSIVE_MAKE "@RECURSIVE_MAKE@" SET_MAKE "@SET_MAKE@"
--- a/lib-src/etags.c Mon Aug 13 10:27:41 2007 +0200 +++ b/lib-src/etags.c Mon Aug 13 10:28:48 2007 +0200 @@ -33,6 +33,30 @@ char pot_etags_version[] = "@(#) pot revision number is 12.28"; +/* Prototyping magic snarfed from gmalloc.c */ +#if defined (__cplusplus) || defined (__STDC__) +#undef PP +#define PP(args) args +#undef __ptr_t +#define __ptr_t void * +#else /* Not C++ or ANSI C. */ +#undef PP +#define PP(args) () +#undef const +#define const +#undef __ptr_t +#define __ptr_t char * +#endif /* C++ or ANSI C. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> + /* On some systems, Emacs defines static as nothing for the sake + of unexec. We don't want that here since we don't use unexec. */ +# undef static +# define ETAGS_REGEXPS /* use the regexp features */ +# define LONG_OPTIONS /* accept long options */ +#endif /* HAVE_CONFIG_H */ + #define TRUE 1 #define FALSE 0 @@ -64,31 +88,6 @@ # endif /* not HAVE_CONFIG_H */ #endif /* WINDOWSNT */ -#ifdef HAVE_CONFIG_H -# include <config.h> - /* On some systems, Emacs defines static as nothing for the sake - of unexec. We don't want that here since we don't use unexec. */ -# undef static -# define ETAGS_REGEXPS /* use the regexp features */ -# define LONG_OPTIONS /* accept long options */ -#endif /* HAVE_CONFIG_H */ - -/* Prototyping magic snarfed from gmalloc.c */ -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) || defined (__SUNPRO_C) -#undef PP -#define PP(args) args -#undef __ptr_t -#define __ptr_t void * -#else /* Not C++ or ANSI C. */ -#undef PP -#define PP(args) () -#undef const -#define const -#undef __ptr_t -#define __ptr_t char * -#endif /* C++ or ANSI C. */ - - #if !defined (WINDOWSNT) && defined (STDC_HEADERS) #include <stdlib.h> #include <string.h>
--- a/lib-src/gnuclient.c Mon Aug 13 10:27:41 2007 +0200 +++ b/lib-src/gnuclient.c Mon Aug 13 10:28:48 2007 +0200 @@ -21,7 +21,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Author: Andy Norman (ange@hplb.hpl.hp.com), based on + Author: Andy Norman (ange@hplb.hpl.hp.com), based on 'etc/emacsclient.c' from the GNU Emacs 18.52 distribution. Please mail bugs and suggestions to the author at the above address. @@ -89,7 +89,7 @@ /* Why is SYSV so retarded? */ /* We want emacs to realize that we are resuming */ - signal(SIGCONT, tell_emacs_to_resume); + signal(SIGCONT, tell_emacs_to_resume); connect_type = make_connection (NULL, (u_short) 0, &s); @@ -154,7 +154,7 @@ progname); exit (1); } /* if */ - + /* on some systems, cwd can look like '@machine/' ... */ /* ignore everything before the first '/' */ for (cp = cwd; *cp && *cp != '/'; ++cp) @@ -179,7 +179,7 @@ int len; fullpath[0] = '\0'; - + if (filename[0] && filename[0] != '/') { /* relative filename */ strcat (fullpath, get_current_working_directory ()); @@ -203,14 +203,18 @@ int i = 0; char *p, *res; - for (p = s; *p; p++, i++) - { - if (*p == '\\' || *p == '\"') - ++i; - else if (*p == '\004') - i += 3; - } - p = res = (char *)malloc (i + 2 + 1); + { + CONST char *const_p; + for (const_p = s; *const_p; const_p++, i++) + { + if (*const_p == '\\' || *const_p == '\"') + ++i; + else if (*const_p == '\004') + i += 3; + } + } + + p = res = (char *) malloc (i + 2 + 1); *p++ = '\"'; for (; *s; p++, s++) { @@ -523,7 +527,7 @@ char *ptr; gethostname (thishost, HOSTNAMSZ); if (!rflg) - { /* attempt to generate a path + { /* attempt to generate a path * to this machine */ if ((ptr = getenv ("GNU_NODE")) != NULL) /* user specified a path */ @@ -533,7 +537,7 @@ #if defined (hp9000s300) || defined (hp9000s800) else if (strcmp (thishost,hostarg)) { /* try /net/thishost */ - strcpy (remotepath, "/net/"); /* (this fails using internet + strcpy (remotepath, "/net/"); /* (this fails using internet addresses) */ strcat (remotepath, thishost); } @@ -547,7 +551,7 @@ #endif /* INTERNET_DOMAIN_SOCKETS */ #ifdef SYSV_IPC - if ((msgp = (struct msgbuf *) + if ((msgp = (struct msgbuf *) malloc (sizeof *msgp + GSERV_BUFSZ)) == NULL) { fprintf (stderr, "%s: not enough memory for message buffer\n", progname);
--- a/lib-src/movemail.c Mon Aug 13 10:27:41 2007 +0200 +++ b/lib-src/movemail.c Mon Aug 13 10:28:48 2007 +0200 @@ -207,10 +207,8 @@ #ifdef MAIL_USE_POP if (!strncmp (inname, "po:", 3)) { - int status; - - status = popmail (inname + 3, outname, argc > 3 ? argv[3] : NULL); - exit (status); + int retcode = popmail (inname + 3, outname, argc > 3 ? argv[3] : NULL); + exit (retcode); } setuid (getuid ()); @@ -504,9 +502,7 @@ register int i; int mbfi; FILE *mbf; - char *getenv (); popserver server; - extern char *strerror (); server = pop_open (0, user, password, POP_NO_GETPASS); if (! server)
--- a/lib-src/pop.c Mon Aug 13 10:27:41 2007 +0200 +++ b/lib-src/pop.c Mon Aug 13 10:28:48 2007 +0200 @@ -92,12 +92,6 @@ #endif /* KRB5 */ #endif /* KERBEROS */ -extern char *getenv (/* char * */); -extern char *getlogin (/* void */); -extern char *getpass (/* char * */); -extern char *strerror (/* int */); -extern char *index (); - #ifdef KERBEROS #ifndef KRB5 extern int krb_sendauth (/* long, int, KTEXT, char *, char *, char *, @@ -114,16 +108,16 @@ #endif #endif -static int socket_connection (/* char *, int */); -static char *getline (/* popserver */); -static int sendline (/* popserver, char * */); -static int fullwrite (/* int, char *, int */); -static int getok (/* popserver */); +static int socket_connection (char *, int); +static char *pop_getline (popserver); +static int sendline (popserver, char *); +static int fullwrite (int, char *, int); +static int getok (popserver); #if 0 -static int gettermination (/* popserver */); +static int gettermination (popserver); #endif -static void pop_trash (/* popserver */); -static char *find_crlf (/* char * */); +static void pop_trash (popserver); +static char *find_crlf (char *); #define ERROR_MAX 80 /* a pretty arbitrary size */ #define POP_PORT 110 @@ -178,11 +172,7 @@ * explanation of the error. */ popserver -pop_open (host, username, password, flags) - char *host; - char *username; - char *password; - int flags; +pop_open (char *host, char *username, char *password, int flags) { int sock; popserver server; @@ -348,10 +338,7 @@ * connection impossible. */ int -pop_stat (server, count, size) - popserver server; - int *count; - int *size; +pop_stat (popserver server, int *count, int *size) { char *fromserver; @@ -361,7 +348,7 @@ return (-1); } - if (sendline (server, "STAT") || (! (fromserver = getline (server)))) + if (sendline (server, "STAT") || (! (fromserver = pop_getline (server)))) return (-1); if (strncmp (fromserver, "+OK ", 4)) @@ -381,7 +368,7 @@ *count = atoi (&fromserver[4]); - fromserver = index (&fromserver[4], ' '); + fromserver = strchr (&fromserver[4], ' '); if (! fromserver) { strcpy (pop_error, @@ -415,11 +402,7 @@ * connection impossible. */ int -pop_list (server, message, IDs, sizes) - popserver server; - int message; - int **IDs; - int **sizes; +pop_list (popserver server, int message, int **IDs, int **sizes) { int how_many, i; char *fromserver; @@ -457,7 +440,7 @@ free ((char *) *sizes); return (-1); } - if (! (fromserver = getline (server))) + if (! (fromserver = pop_getline (server))) { free ((char *) *IDs); free ((char *) *sizes); @@ -478,7 +461,7 @@ return (-1); } (*IDs)[0] = atoi (&fromserver[4]); - fromserver = index (&fromserver[4], ' '); + fromserver = strchr (&fromserver[4], ' '); if (! fromserver) { strcpy (pop_error, @@ -509,7 +492,7 @@ return (-1); } (*IDs)[i] = atoi (fromserver); - fromserver = index (fromserver, ' '); + fromserver = strchr (fromserver, ' '); if (! fromserver) { strcpy (pop_error, @@ -558,10 +541,7 @@ * Side effects: May kill connection on error. */ char * -pop_retrieve (server, message, markfrom) - popserver server; - int message; - int markfrom; +pop_retrieve (popserver server, int message, int markfrom) { int *IDs, *sizes, bufsize, fromcount = 0, cp = 0; char *ptr, *fromserver; @@ -627,7 +607,7 @@ ptr[cp++] = '>'; } linesize = strlen (fromserver); - bcopy (fromserver, &ptr[cp], linesize); + memcpy (&ptr[cp], fromserver, linesize); cp += linesize; ptr[cp++] = '\n'; } @@ -642,60 +622,45 @@ } int -pop_retrieve_first (server, message, response) - popserver server; - int message; - char **response; +pop_retrieve_first (popserver server, int message, char **response) { sprintf (pop_error, "RETR %d", message); return (pop_multi_first (server, pop_error, response)); } int -pop_retrieve_next (server, line) - popserver server; - char **line; +pop_retrieve_next (popserver server, char **line) { return (pop_multi_next (server, line)); } int -pop_retrieve_flush (server) - popserver server; +pop_retrieve_flush (popserver server) { return (pop_multi_flush (server)); } int -pop_top_first (server, message, lines, response) - popserver server; - int message, lines; - char **response; +pop_top_first (popserver server, int message, int lines, char **response) { sprintf (pop_error, "TOP %d %d", message, lines); return (pop_multi_first (server, pop_error, response)); } int -pop_top_next (server, line) - popserver server; - char **line; +pop_top_next (popserver server, char **line) { return (pop_multi_next (server, line)); } int -pop_top_flush (server) - popserver server; +pop_top_flush (popserver server) { return (pop_multi_flush (server)); } int -pop_multi_first (server, command, response) - popserver server; - char *command; - char **response; +pop_multi_first (popserver server, char *command, char **response) { if (server->in_multi) { @@ -704,7 +669,7 @@ return (-1); } - if (sendline (server, command) || (! (*response = getline (server)))) + if (sendline (server, command) || (! (*response = pop_getline (server)))) { return (-1); } @@ -729,9 +694,7 @@ } int -pop_multi_next (server, line) - popserver server; - char **line; +pop_multi_next (popserver server, char **line) { char *fromserver; @@ -741,7 +704,7 @@ return (-1); } - fromserver = getline (server); + fromserver = pop_getline (server); if (! fromserver) { return (-1); @@ -769,8 +732,7 @@ } int -pop_multi_flush (server) - popserver server; +pop_multi_flush (popserver server) { char *line; @@ -802,9 +764,7 @@ * otherwise. */ int -pop_delete (server, message) - popserver server; - int message; +pop_delete (popserver server, int message) { if (server->in_multi) { @@ -834,8 +794,7 @@ * Side effects: Closes connection on error. */ int -pop_noop (server) - popserver server; +pop_noop (popserver server) { if (server->in_multi) { @@ -864,8 +823,7 @@ * Side effects: Closes the connection on error. */ int -pop_last (server) - popserver server; +pop_last (popserver server) { char *fromserver; @@ -878,7 +836,7 @@ if (sendline (server, "LAST")) return (-1); - if (! (fromserver = getline (server))) + if (! (fromserver = pop_getline (server))) return (-1); if (! strncmp (fromserver, "-ERR", 4)) @@ -912,8 +870,7 @@ * Side effects: Closes the connection on error. */ int -pop_reset (server) - popserver server; +pop_reset (popserver server) { if (pop_retrieve_flush (server)) { @@ -941,8 +898,7 @@ * function is called, even if an error occurs. */ int -pop_quit (server) - popserver server; +pop_quit (popserver server) { int ret = 0; @@ -987,9 +943,7 @@ * into pop_error. */ static int -socket_connection (host, flags) - char *host; - int flags; +socket_connection (char *host, int flags) { struct hostent *hostent; struct servent *servent; @@ -1038,7 +992,7 @@ } } while (! hostent); - bzero ((char *) &addr, sizeof (addr)); + memset (&addr, 0, sizeof (addr)); addr.sin_family = AF_INET; #ifdef KERBEROS @@ -1090,8 +1044,7 @@ while (*hostent->h_addr_list) { - bcopy (*hostent->h_addr_list, (char *) &addr.sin_addr, - hostent->h_length); + memcpy (&addr.sin_addr, *hostent->h_addr_list, hostent->h_length); if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) break; hostent->h_addr_list++; @@ -1207,7 +1160,7 @@ } /* socket_connection */ /* - * Function: getline + * Function: pop_getline * * Purpose: Get a line of text from the connection and return a * pointer to it. The carriage return and linefeed at the end of @@ -1220,13 +1173,12 @@ * Returns: A non-null pointer if successful, or a null pointer on any * error, with an error message copied into pop_error. * - * Notes: The line returned is overwritten with each call to getline. + * Notes: The line returned is overwritten with each call to pop_getline. * * Side effects: Closes the connection on error. */ static char * -getline (server) - popserver server; +pop_getline (popserver server) { #define GETLINE_ERROR "Error reading from server: " @@ -1254,8 +1206,9 @@ } else { - bcopy (server->buffer + server->buffer_index, - server->buffer, server->data); + memcpy (server->buffer, + server->buffer + server->buffer_index, + server->data); /* Record the fact that we've searched the data already in the buffer for a CRLF, so that when we search below, we don't have to search the same data twice. There's a "- @@ -1283,7 +1236,7 @@ server->buffer = (char *)realloc (server->buffer, server->buffer_size); if (! server->buffer) { - strcpy (pop_error, "Out of memory in getline"); + strcpy (pop_error, "Out of memory in pop_getline"); pop_trash (server); return (0); } @@ -1300,7 +1253,7 @@ } else if (ret == 0) { - strcpy (pop_error, "Unexpected EOF from server in getline"); + strcpy (pop_error, "Unexpected EOF from server in pop_getline"); pop_trash (server); return (0); } @@ -1348,9 +1301,7 @@ * Side effects: Closes the connection on error. */ static int -sendline (server, line) - popserver server; - char *line; +sendline (popserver server, char *line) { #define SENDLINE_ERROR "Error writing to POP server: " int ret; @@ -1385,10 +1336,7 @@ * Return value: Same as write. Pop_error is not set. */ static int -fullwrite (fd, buf, nbytes) - int fd; - char *buf; - int nbytes; +fullwrite (int fd, char *buf, int nbytes) { char *cp; int ret; @@ -1418,12 +1366,11 @@ * Side effects: On failure, may make the connection unusable. */ static int -getok (server) - popserver server; +getok (popserver server) { char *fromline; - if (! (fromline = getline (server))) + if (! (fromline = pop_getline (server))) { return (-1); } @@ -1457,12 +1404,11 @@ * Side effects: Closes the connection on error. */ static int -gettermination (server) - popserver server; +gettermination (popserver server) { char *fromserver; - fromserver = getline (server); + fromserver = pop_getline (server); if (! fromserver) return (-1); @@ -1491,8 +1437,7 @@ * since the last pop_reset) may be lost. */ void -pop_close (server) - popserver server; +pop_close (popserver server) { pop_trash (server); free ((char *) server); @@ -1508,8 +1453,7 @@ * pop_close or pop_quit after this function has been called. */ static void -pop_trash (server) - popserver server; +pop_trash (popserver server) { if (server->file >= 0) { @@ -1540,8 +1484,7 @@ or 0 if it does not contain one. */ static char * -find_crlf (in_string) - char *in_string; +find_crlf (char *in_string) { while (1) {
--- a/lib-src/profile.c Mon Aug 13 10:27:41 2007 +0200 +++ b/lib-src/profile.c Mon Aug 13 10:28:48 2007 +0200 @@ -34,9 +34,7 @@ */ #include <../src/config.h> #include <stdio.h> -#if __STDC__ || defined(STDC_HEADERS) #include <stdlib.h> -#endif #include "../src/systime.h" static struct timeval TV1, TV2;
--- a/lisp/ChangeLog Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/ChangeLog Mon Aug 13 10:28:48 2007 +0200 @@ -1,3 +1,103 @@ +1998-04-04 Hrvoje Niksic <hniksic@srce.hr> + + * isearch-mode.el (isearch-just-started): New variable. + (isearch-mode): Set it. + (isearch-repeat): Advance one character forward only if the search + was successful, and was not just started. + (isearch-repeat): Clear isearch-just-started. + +1998-04-02 SL Baur <steve@altair.xemacs.org> + + * finder.el (finder-compile-keywords): Don't eval new finder-inf + if running -batch. + +1998-03-26 Hrvoje Niksic <hniksic@srce.hr> + + * subr.el (listify-key-sequence): Removed. + +1998-03-31 Hrvoje Niksic <hniksic@srce.hr> + + * bytecomp.el (byte-compile-print-gensym): New option. + (byte-compile-output-file-form): Use it. + (byte-compile-output-docform): Ditto. + (byte-compile-compiled-obj-to-list): Ditto. + +Sun Mar 29 1998 Andy Piper <andyp@parallax.co.uk> + + * msw-glyphs.el: set frame icon if xpm support. + +1998-03-30 Kyle Jones <kyle_jones@wonderworks.com> + + * help.el: Code that pretty prints variable values + removed. + +1998-04-02 SL Baur <steve@altair.xemacs.org> + + * find-paths.el (paths-emacs-root-p): Correct test for installation + directory. + From Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + +1998-03-30 Kyle Jones <kyle_jones@wonderworks.com> + + * loaddefs.el: Don't set debug-ignored-errors; leave + its default value set to nil. + +1998-03-29 Damon Lipparelli <lipp@primus.com> + + * info.el (Info-rebuild-dir): fixed mis-spelling. + +1998-03-29 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> + + * info.el (Info-rebuild-outdated-dir): New custom var + (Info-insert-node): Create/update dir file when needed, ie when it + does not exist or is older than some info files in directory + +1998-04-01 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * setup-paths.el, dump-paths.el, startup.el, packages.el: Allowed + for last packages, mainly for using a 20.4 package base. + + * packages.el (late-packages): Typo fix. It was called + early-packages. + + * find-paths.el (paths-find-emacs-root): Bug fix: it now chases + relative symlinks correctly. + (paths-find-emacs-roots): More rigorous checking for plausible + configuration-time root. + + * startup.el (normal-top-level): Added a warning if XEmacs cannot + find its roots. + +1998-03-27 Martin Buchholz <martin@xemacs.org> + + * faces.el: Fix docstrings. + * glyphs.el: Fix docstrings. + * mouse.el: Fix docstrings. + + * frame.el: Change phrase `current frame' to `selected frame'. + + * faces.el (face-spec-set-match-display): Make FRAME arg optional. + + * bytecomp.el (displaying-byte-compile-warnings): Rewrite some + macros using backquote to make them infinitely more readable. + +1998-03-30 SL Baur <steve@altair.xemacs.org> + + * packages.el (packages-find-package-path): Hardcoded specialized + InfoDock support until we can clean this up. + + * help.el (describe-bindings-1): Return the value of the bindings + help buffer created. + (describe-bindings): Ditto. + + * simple.el (set-variable): Restore previous behavior of not + bombing if the variable to set is not boundp. + +1998-03-30 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * packages.el (packages-handle-package-dumped-lisps): Allow for + non-local files to be loaded off the package-lisp variable. + 1998-03-27 Kyle Jones <kyle_jones@wonderworks.com> * x-faces.el: Global X resources should override
--- a/lisp/abbrev.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/abbrev.el Mon Aug 13 10:28:48 2007 +0200 @@ -57,7 +57,7 @@ This causes `save-some-buffers' to offer to save the abbrevs.") (defun make-abbrev-table () - "Create a new, empty abbrev table object." + "Return a new, empty abbrev table object." (make-vector 59 0)) ; 59 is prime (defun clear-abbrev-table (table) @@ -125,7 +125,7 @@ (setq abbrev-table-name-list (delq fixup abbrev-table-name-list)) (define-abbrev-table (car fixup) (cdr fixup)))) (setq l (cdr l)))) - ;; These are no longer initialised by C code + ;; These are no longer initialized by C code (if (not global-abbrev-table) (progn (setq global-abbrev-table (make-abbrev-table)) @@ -186,7 +186,7 @@ "Undo the expansion of the last abbrev that expanded. This differs from ordinary undo in that other editing done since then is not undone." - (interactive) + (interactive) (if (or (< last-abbrev-location (point-min)) (> last-abbrev-location (point-max)) (not (stringp last-abbrev-text))) @@ -216,7 +216,7 @@ define the abbrev table NAME exactly as it is currently defined." (let ((table (symbol-value name)) (stream (current-buffer))) - (message "Abbrev-table %s..." name) + (message "Abbrev-table %s..." name) (if human-readable (progn (prin1 (list name) stream) @@ -431,7 +431,7 @@ (interactive "P") (add-abbrev (if only-global-abbrevs - global-abbrev-table + global-abbrev-table (or local-abbrev-table (error "No per-mode abbrev table"))) "Mode" arg)) @@ -468,7 +468,7 @@ (y-or-n-p (format "%s expands to \"%s\"; redefine? " name (abbrev-expansion name table)))) (define-abbrev table (downcase name) exp)))) - + (defun inverse-add-mode-abbrev (arg) "Define last word before point as a mode-specific abbrev. With prefix argument N, defines the Nth word before point. @@ -477,7 +477,7 @@ (interactive "p") (inverse-add-abbrev (if only-global-abbrevs - global-abbrev-table + global-abbrev-table (or local-abbrev-table (error "No per-mode abbrev table"))) "Mode" arg))
--- a/lisp/about.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/about.el Mon Aug 13 10:28:48 2007 +0200 @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -75,7 +75,7 @@ (mcook "Michael R. Cook" "mcook@cognex.com") (mly "Richard Mlynarik" "mly@adoc.xerox.com") (morioka "MORIOKA Tomohiko" "morioka@jaist.ac.jp") - (mrb "Martin Buchholz" "mrb@sun.eng.com") + (martin "Martin Buchholz" "martin@xemacs.org") (ograf "Oliver Graf" "ograf@fga.de") (pez "Peter Pezaris" "pez@dwwc.com") (piper "Andy Piper" "andyp@parallax.co.uk") @@ -276,7 +276,7 @@ :value who) (widget-insert (format " <%s>\n" address))))) ;; Setup persons responsible for this release. - (mapc 'setup-person '(slb hniksic kyle mrb)) + (mapc 'setup-person '(slb hniksic kyle martin)) (widget-insert "\n\t* ") (widget-create 'link :help-echo "A legion of XEmacs hackers" :action 'about-hackers @@ -588,9 +588,9 @@ My main hobby while not maintaining XEmacs or working is ... you have got to be kidding ...") (widget-insert ".\n")) - (mrb + (martin (widget-insert "\ -Martin is the XEmacs guy at DevPro, a part of Sun Microsystems. +Martin was the XEmacs guy at DevPro, a part of Sun Microsystems. Martin used to do XEmacs as a `hobby' while at IBM, and was crazy enough to try to make a living doing it at Sun. @@ -600,8 +600,8 @@ light. He dreams of rewriting shell mode from scratch. Stderr should show up in red!! -Martin is currently working mostly on Internationalization. He spends -most of his waking hours inside a Japanized XEmacs.\n")) +Martin is no longer doing XEmacs for a living, and is Just Another +Volunteer.\n")) (hniksic (widget-insert "\ Hrvoje is currently a student at the Faculty of Electrical @@ -691,7 +691,7 @@ (widget-insert "\ Currently studying computer science in Trondheim, Norway. Full time Linux user and proud of it. XEmacs hacker light. Maintainer of the -RPM package. +RPM package. See:\t") (about-url-link 'stigb "Visit Stig's home page")) @@ -849,7 +849,7 @@ using emacs for a long, long time.) Vin also contributed the detached minibuffer code as well as a few minor enhancements to the menubar options. - + I own and operate my own consulting firm, EtherSoft. Shhh, don't tell anyone, but it's named after an Ultimate team I used to play with in Austin, Texas - the Ether Bunnies. I'm getting too old @@ -893,8 +893,8 @@ (widget-insert ".\n")) (dkindred (widget-insert "\ -Darrell tends to come out of the woodwork a couple of weeks -before a new release with a flurry of fixes for bugs that +Darrell tends to come out of the woodwork a couple of weeks +before a new release with a flurry of fixes for bugs that annoy him. He hopes he's spared you from a core dump or two. Darrell is currently a doctoral student in computer science at @@ -916,7 +916,7 @@ (widget-insert "\ I'm currently working (Ph.D.) on the cognitive aspects of Human-Machine Interaction in Virtual Environments, and especialy on -the possibility of adding (artificial) intelligence between the system +the possibility of adding (artificial) intelligence between the system and the operator, in order to detect the intentions of the latter. Otherwise, I'm, say, 35.82% professional Jazz guitar player, @@ -939,8 +939,8 @@ major is computational linguistics (human language generation and analysis). -I make my living as a managing director of a small but fine company -which I started two years ago with one of my friends. We provide +I make my living as a managing director of a small but fine company +which I started two years ago with one of my friends. We provide business network solutions based on linux servers and various other networking products. @@ -972,10 +972,10 @@ (widget-insert ".\n")) (jason (widget-insert "\ -Beta tester and manager of the various XEmacs mailing lists. -Originator and maintainer of the gnus.org domain. +Beta tester and manager of the various XEmacs mailing lists. +Originator and maintainer of the gnus.org domain. -Jason resides in Albuquerque, New Mexico where he keeps himself +Jason resides in Albuquerque, New Mexico where he keeps himself busy with studies at the university and consulting work. See: ") @@ -1043,7 +1043,7 @@ big white van set up for nomadic living and hacking. Implemented the faster stay-up Lucid menus and hyper-apropos. Contributor of many dispersed improvements in the core Lisp code, and back-seat -contributor for several of it's major packages.\n") +contributor for several of its major packages.\n") (about-show-linked-info 'baw "\ Author of CC Mode for C, C++, Objective-C and Java editing, and Supercite for mail and news citing. Also various and sundry other @@ -1142,8 +1142,8 @@ IENAGA Kazuyuki is the XEmacs technical lead on BSD, particularly FreeBSD.\n") (about-show-linked-info 'dkindred "\ -Darrell tends to come out of the woodwork a couple of weeks -before a new release with a flurry of fixes for bugs that +Darrell tends to come out of the woodwork a couple of weeks +before a new release with a flurry of fixes for bugs that annoy him. He hopes he's spared you from a core dump or two. Darrell is currently a doctoral student in computer science at @@ -1152,7 +1152,7 @@ (about-show-linked-info 'dv "\ I'm currently working (Ph.D.) on the cognitive aspects of Human-Machine Interaction in Virtual Environments, and especialy on -the possibility of adding (artificial) intelligence between the system +the possibility of adding (artificial) intelligence between the system and the operator, in order to detect the intentions of the latter. Otherwise, I'm, say, 35.82% professional Jazz guitar player, @@ -1275,6 +1275,7 @@ (print-short "Richard Cognot" "cognot@ensg.u-nancy.fr") (print-short "Andy Cohen" "cohen@andy.bu.edu") (print-short "Richard Coleman" "coleman@math.gatech.edu") + (print-short "Mauro Condarelli" "MC5686@mclink.it") (print-short "Andrew J Cosgriff" "ajc@bing.wattle.id.au") (print-short "Nick J. Crabtree" "nickc@scopic.com") (print-short "Christopher Davis" "ckd@kei.com")
--- a/lisp/apropos.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/apropos.el Mon Aug 13 10:28:48 2007 +0200 @@ -70,14 +70,14 @@ (defvar apropos-symbol-face (if (boundp 'font-lock-keyword-face) font-lock-keyword-face 'bold) - "*Face for symbol name in apropos output or `nil'. + "*Face for symbol name in apropos output or `nil'. This looks good, but slows down the commands several times.") ;; XEmacs addition (defvar apropos-keybinding-face (if (boundp 'font-lock-string-face) font-lock-string-face 'underline) - "*Face for keybinding display in apropos output or `nil'. + "*Face for keybinding display in apropos output or `nil'. This looks good, but slows down the commands several times.") ;; XEmacs addition @@ -94,11 +94,11 @@ (defvar apropos-property-face (if (boundp 'font-lock-variable-name-face) font-lock-variable-name-face 'bold-italic) - "*Face for property name in apropos output or `nil'. + "*Face for property name in apropos output or `nil'. This looks good, but slows down the commands several times.") (defvar apropos-match-face 'secondary-selection - "*Face for matching part in apropos-documentation/value output or `nil'. + "*Face for matching part in apropos-documentation/value output or `nil'. This looks good, but slows down the commands several times.") @@ -594,7 +594,7 @@ (defun apropos-macrop (symbol) - "T if SYMBOL is a Lisp macro." + "Return t if SYMBOL is a Lisp macro." (and (fboundp symbol) (consp (setq symbol (symbol-function symbol)))
--- a/lisp/backquote.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/backquote.el Mon Aug 13 10:28:48 2007 +0200 @@ -42,7 +42,7 @@ ;; - nixed support for |,.| because ;; (a) it's not in CLtl2 ;; (b) ",.foo" is the same as ". ,foo" -;; (c) because RMS isn't interested in using this version of backquote.el +;; (c) because RMS isn't interested in using this version of backquote.el ;; ;; wing@666.com; added ,. support back in: ;; (a) yes, it is in CLtl2. Read closely on page 529. @@ -66,22 +66,22 @@ ;; T: [a] => a ;the T flag is used when a is self-evaluating ;; QUOTE: [a] => (QUOTE a) ;; APPEND: [a] => (APPEND . a) -;; NCONC: [a] => (NCONC . a) +;; NCONC: [a] => (NCONC . a) ;; LIST: [a] => (LIST . a) ;; LIST*: [a] => (LIST* . a) ;; ;; The flags are combined according to the following set of rules: ;; ([a] means that a should be converted according to the previous table) ;; -;; \ car || otherwise | QUOTE or | |`,@| | |`,.| -;;cdr \ || | T or NIL | | +;; \ car || otherwise | QUOTE or | |`,@| | |`,.| +;;cdr \ || | T or NIL | | ;;============================================================================ ;; |`,| ||LIST* ([a] [d]) |LIST* ([a] [d]) |APPEND (a [d]) |NCONC (a [d]) -;; NIL ||LIST ([a]) |QUOTE (a) |<hair> a |<hair> a -;;QUOTE or T||LIST* ([a] [d]) |QUOTE (a . d) |APPEND (a [d]) |NCONC (a [d]) -;; APPEND ||LIST* ([a] [d]) |LIST* ([a] [d]) |APPEND (a . d) |NCONC (a [d]) -;; NCONC ||LIST* ([a] [d]) |LIST* ([a] [d]) |APPEND (a [d]) |NCONC (a . d) -;; LIST ||LIST ([a] . d) |LIST ([a] . d) |APPEND (a [d]) |NCONC (a [d]) +;; NIL ||LIST ([a]) |QUOTE (a) |<hair> a |<hair> a +;;QUOTE or T||LIST* ([a] [d]) |QUOTE (a . d) |APPEND (a [d]) |NCONC (a [d]) +;; APPEND ||LIST* ([a] [d]) |LIST* ([a] [d]) |APPEND (a . d) |NCONC (a [d]) +;; NCONC ||LIST* ([a] [d]) |LIST* ([a] [d]) |APPEND (a [d]) |NCONC (a . d) +;; LIST ||LIST ([a] . d) |LIST ([a] . d) |APPEND (a [d]) |NCONC (a [d]) ;; LIST* ||LIST* ([a] . d) |LIST* ([a] . d) |APPEND (a [d]) |NCONC (a [d]) ;; ;;<hair> involves starting over again pretending you had read ".,a)" instead @@ -92,7 +92,7 @@ ;;; Code: -(defconst bq-backquote-marker 'backquote) +(defconst bq-backquote-marker 'backquote) (defconst bq-backtick-marker '\`) ; remnant of the old lossage (defconst bq-comma-marker '\,) (defconst bq-at-marker '\,@) @@ -130,8 +130,8 @@ Note that this is very slow in interpreted code, but fast if you compile. TEMPLATE is one or more nested lists or vectors, which are `almost quoted'. They are copied recursively, with elements preceded by comma evaluated. - (backquote (a b)) == (list 'a 'b) - (backquote (a [b c])) == (list 'a (vector 'b 'c)) + (backquote (a b)) == (list 'a 'b) + (backquote (a [b c])) == (list 'a (vector 'b 'c)) However, certain special lists are not copied. They specify substitution. Lists that look like (\\, EXP) are evaluated and the result is substituted. @@ -197,7 +197,7 @@ (cond ((vectorp code) (let* ((dflag-d (bq-process-2 (bq-vector-contents code)))) - (cons 'vector (bq-process-1 (car dflag-d) (cdr dflag-d))))) + (cons 'vector (bq-process-1 (car dflag-d) (cdr dflag-d))))) ((atom code) (cond ((null code) (cons nil nil)) ((or (numberp code) (eq code t)) @@ -253,7 +253,7 @@ (cons 'list* (list a (bq-process-1 dflag d))))))))))) -;;; This handles the <hair> cases +;;; This handles the <hair> cases (defun bq-comma (code) (cond ((atom code) (cond ((null code) @@ -290,7 +290,7 @@ ;;; ---------------------------------------------------------------- (defmacro bq-list* (&rest args) - "Returns a list of its arguments with last cons a dotted pair." + "Return a list of its arguments with last cons a dotted pair." (setq args (reverse args)) (let ((result (car args))) (setq args (cdr args))
--- a/lisp/bytecomp.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/bytecomp.el Mon Aug 13 10:28:48 2007 +0200 @@ -24,7 +24,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -66,7 +66,7 @@ ;;; - functions being redefined as macros, or vice-versa; ;;; - functions or macros defined multiple times in the same file; ;;; - functions being called with the incorrect number of arguments; -;;; - functions being called which are not defined globally, in the +;;; - functions being called which are not defined globally, in the ;;; file, or as autoloads; ;;; - assignment and reference of undeclared free variables; ;;; - various syntax errors; @@ -78,9 +78,9 @@ ;;; ;;; byte-compile-verbose Whether to report the function currently being ;;; compiled in the minibuffer; -;;; byte-optimize Whether to do optimizations; this may be +;;; byte-optimize Whether to do optimizations; this may be ;;; t, nil, 'source, or 'byte; -;;; byte-optimize-log Whether to report (in excruciating detail) +;;; byte-optimize-log Whether to report (in excruciating detail) ;;; exactly which optimizations have been made. ;;; This may be t, nil, 'source, or 'byte; ;;; byte-compile-error-on-warn Whether to stop compilation when a warning is @@ -89,7 +89,7 @@ ;;; variable references that are side-effect-free ;;; except that they may return an error. ;;; byte-compile-generate-call-tree Whether to generate a histogram of -;;; function calls. This can be useful for +;;; function calls. This can be useful for ;;; finding unused functions, as well as simple ;;; performance metering. ;;; byte-compile-warnings List of warnings to issue, or t. May contain @@ -133,7 +133,7 @@ ;;; (proclaim-inline my-function) ;;; This is, in fact, exactly what `defsubst' does. To make a function no ;;; longer be inline, you must use `proclaim-notinline'. Beware that if -;;; you define a function with `defsubst' and later redefine it with +;;; you define a function with `defsubst' and later redefine it with ;;; `defun', it will still be open-coded until you use proclaim-notinline. ;;; ;;; o You can also open-code one particular call to a function without @@ -141,7 +141,7 @@ ;;; ;;; (inline (foo 1 2 3)) ;; `foo' will be open-coded ;;; or... -;;; (inline ;; `foo' and `baz' will be +;;; (inline ;; `foo' and `baz' will be ;;; (foo 1 2 3 (bar 5)) ;; open-coded, but `bar' will not. ;;; (baz 0)) ;;; @@ -166,7 +166,7 @@ ;;; ;;; o The command compile-defun is analogous to eval-defun. ;;; -;;; o If you run byte-compile-file on a filename which is visited in a +;;; o If you run byte-compile-file on a filename which is visited in a ;;; buffer, and that buffer is modified, you are asked whether you want ;;; to save the buffer before compiling. ;;; @@ -269,6 +269,17 @@ (not (emacs-version>= 20)) "*Non-nil means generate output that can run in Emacs 19.") +(defvar byte-compile-print-gensym t + "*Non-nil means generate code that creates unique symbols at run-time. +This is achieved by printing uninterned symbols using the `#:SYMBOL' +notation, so that they will be read uninterned when run. + +With this feature, code that uses uninterned symbols in macros will +not be runnable under pre-21.0 XEmacsen. + +When `byte-compile-emacs19-compatibility' is non-nil, this variable is +ignored and considered to be nil.") + (defvar byte-optimize t "*Enables optimization in the byte compiler. nil means don't do any optimization. @@ -392,7 +403,7 @@ "If nil, old .elc files are deleted before the new is saved, and .elc files will have the same modes as the corresponding .el file. Otherwise, existing .elc files will simply be overwritten, and the existing modes -will not be changed. If this variable is nil, then an .elc file which +will not be changed. If this variable is nil, then an .elc file which is a symbolic link will be turned into a normal file, instead of the file which the link points to being overwritten.") @@ -410,7 +421,7 @@ "list of all variables encountered during compilation of this form") (defvar byte-compile-bound-variables nil "Alist of variables bound in the context of the current form, -that is, the current lexical environment. This list lives partly +that is, the current lexical environment. This list lives partly on the specbind stack. The cdr of each cell is an integer bitmask.") (defconst byte-compile-referenced-bit 1) @@ -605,10 +616,10 @@ (byte-defop 132 -1 byte-goto-if-not-nil "to pop value and jump if it's not nil") (byte-defop 133 -1 byte-goto-if-nil-else-pop - "to examine top-of-stack, jump and don't pop it if it's nil, + "to examine top-of-stack, jump and don't pop it if it's nil, otherwise pop it") (byte-defop 134 -1 byte-goto-if-not-nil-else-pop - "to examine top-of-stack, jump and don't pop it if it's non nil, + "to examine top-of-stack, jump and don't pop it if it's non nil, otherwise pop it") (byte-defop 135 -1 byte-return "to pop a value and return it from `byte-code'") @@ -626,7 +637,7 @@ (byte-defop 142 -1 byte-unwind-protect "for unwind-protect. Takes, on stack, an expression for the unwind-action") -;; For condition-case. Takes, on stack, the variable to bind, +;; For condition-case. Takes, on stack, the variable to bind, ;; an expression for the body, and a list of clauses. (byte-defop 143 -2 byte-condition-case) @@ -722,7 +733,7 @@ ;;; where instruction is a symbol naming a byte-code instruction, ;;; and parameter is an argument to that instruction, if any. ;;; -;;; The instruction can be the pseudo-op TAG, which means that this position +;;; The instruction can be the pseudo-op TAG, which means that this position ;;; in the instruction stream is a target of a goto. (car PARAMETER) will be ;;; the PC for this location, and the whole instruction "(TAG pc)" will be the ;;; parameter for some goto op. @@ -983,7 +994,7 @@ '((new-bytecodes t))) ;; Inhibit v19/v20 selectors if the version is hardcoded. -;; #### This should print a warning if the user tries to change something +;; #### This should print a warning if the user tries to change something ;; than can't be changed because the running compiler doesn't support it. (cond ((byte-compile-single-version) @@ -1173,12 +1184,12 @@ (byte-compile-arglist-signature-string sig) (if (equal sig '(1 . 1)) " arg" " args") (byte-compile-arglist-signature-string (cons min max)))) - + (setq byte-compile-unresolved-functions (delq calls byte-compile-unresolved-functions))))) ))) -;; If we have compiled any calls to functions which are not known to be +;; If we have compiled any calls to functions which are not known to be ;; defined, issue a warning enumerating them. ;; `unresolved' in the list `byte-compile-warnings' disables this. (defun byte-compile-warn-about-unresolved-functions (&optional msg) @@ -1271,80 +1282,79 @@ ((memq (, form) '(nil t)))))) (defmacro byte-compile-close-variables (&rest body) - (cons 'let - (cons '(;; - ;; Close over these variables to encapsulate the - ;; compilation state - ;; - (byte-compile-macro-environment - ;; Copy it because the compiler may patch into the - ;; macroenvironment. - (copy-alist byte-compile-initial-macro-environment)) - (byte-compile-function-environment nil) - (byte-compile-autoload-environment nil) - (byte-compile-unresolved-functions nil) - (byte-compile-bound-variables nil) - (byte-compile-free-references nil) - (byte-compile-free-assignments nil) - ;; - ;; Close over these variables so that `byte-compiler-options' - ;; can change them on a per-file basis. - ;; - (byte-compile-verbose byte-compile-verbose) - (byte-optimize byte-optimize) - (byte-compile-emacs19-compatibility - byte-compile-emacs19-compatibility) - (byte-compile-dynamic byte-compile-dynamic) - (byte-compile-dynamic-docstrings - byte-compile-dynamic-docstrings) - (byte-compile-warnings (if (eq byte-compile-warnings t) - byte-compile-default-warnings - byte-compile-warnings)) - (byte-compile-file-domain nil) - ) - (list - (list 'prog1 (cons 'progn body) - '(if (memq 'unused-vars byte-compile-warnings) - ;; done compiling in this scope, warn now. - (byte-compile-warn-about-unused-variables))))))) + `(let + (;; + ;; Close over these variables to encapsulate the + ;; compilation state + ;; + (byte-compile-macro-environment + ;; Copy it because the compiler may patch into the + ;; macroenvironment. + (copy-alist byte-compile-initial-macro-environment)) + (byte-compile-function-environment nil) + (byte-compile-autoload-environment nil) + (byte-compile-unresolved-functions nil) + (byte-compile-bound-variables nil) + (byte-compile-free-references nil) + (byte-compile-free-assignments nil) + ;; + ;; Close over these variables so that `byte-compiler-options' + ;; can change them on a per-file basis. + ;; + (byte-compile-verbose byte-compile-verbose) + (byte-optimize byte-optimize) + (byte-compile-emacs19-compatibility + byte-compile-emacs19-compatibility) + (byte-compile-dynamic byte-compile-dynamic) + (byte-compile-dynamic-docstrings + byte-compile-dynamic-docstrings) + (byte-compile-warnings (if (eq byte-compile-warnings t) + byte-compile-default-warnings + byte-compile-warnings)) + (byte-compile-file-domain nil) + ) + (prog1 + (progn ,@body) + (if (memq 'unused-vars byte-compile-warnings) + ;; done compiling in this scope, warn now. + (byte-compile-warn-about-unused-variables))))) (defvar byte-compile-warnings-point-max nil) (defmacro displaying-byte-compile-warnings (&rest body) - (list 'let - '((byte-compile-warnings-point-max byte-compile-warnings-point-max)) + `(let ((byte-compile-warnings-point-max byte-compile-warnings-point-max)) ;; Log the file name. - '(byte-compile-log-file) + (byte-compile-log-file) ;; Record how much is logged now. ;; We will display the log buffer if anything more is logged ;; before the end of BODY. - '(or byte-compile-warnings-point-max - (save-excursion - (set-buffer (get-buffer-create "*Compile-Log*")) - (setq byte-compile-warnings-point-max (point-max)))) - (list 'unwind-protect - (list 'condition-case 'error-info - (cons 'progn body) - '(error - (byte-compile-report-error error-info))) - '(save-excursion - ;; If there were compilation warnings, display them. - (set-buffer "*Compile-Log*") - (if (= byte-compile-warnings-point-max (point-max)) - nil - (if temp-buffer-show-function - (let ((show-buffer (get-buffer-create "*Compile-Log-Show*"))) - (save-excursion - (set-buffer show-buffer) - (setq buffer-read-only nil) - (erase-buffer)) - (copy-to-buffer show-buffer - (save-excursion - (goto-char byte-compile-warnings-point-max) - (forward-line -1) - (point)) - (point-max)) - (funcall temp-buffer-show-function show-buffer)) + (or byte-compile-warnings-point-max + (save-excursion + (set-buffer (get-buffer-create "*Compile-Log*")) + (setq byte-compile-warnings-point-max (point-max)))) + (unwind-protect + (condition-case error-info + (progn ,@body) + (error + (byte-compile-report-error error-info))) + (save-excursion + ;; If there were compilation warnings, display them. + (set-buffer "*Compile-Log*") + (if (= byte-compile-warnings-point-max (point-max)) + nil + (if temp-buffer-show-function + (let ((show-buffer (get-buffer-create "*Compile-Log-Show*"))) + (save-excursion + (set-buffer show-buffer) + (setq buffer-read-only nil) + (erase-buffer)) + (copy-to-buffer show-buffer + (save-excursion + (goto-char byte-compile-warnings-point-max) + (forward-line -1) + (point)) + (point-max)) + (funcall temp-buffer-show-function show-buffer)) (select-window (prog1 (selected-window) (select-window (display-buffer (current-buffer))) @@ -1453,7 +1463,7 @@ (and force (or (eq 0 force) (y-or-n-p (concat "Compile " filename "? ")))))) - (byte-compile-file filename)))) + (byte-compile-file filename)))) (defvar kanji-flag nil) @@ -1558,7 +1568,7 @@ ;; RMS comments the next two out. (defun byte-compile-and-load-file (&optional filename) "Compile a file of Lisp code named FILENAME into a file of byte code, -and then load it. The output file's name is made by appending \"c\" to +and then load it. The output file's name is made by appending \"c\" to the end of FILENAME." (interactive) (if filename ; I don't get it, (interactive-p) doesn't always work @@ -1659,7 +1669,7 @@ ;; Compile pending forms at end of file. (byte-compile-flush-pending) (byte-compile-warn-about-unresolved-functions) - ;; SHould we always do this? When calling multiple files, it + ;; Should we always do this? When calling multiple files, it ;; would be useful to delay this warning until all have ;; been compiled. (setq byte-compile-unresolved-functions nil))) @@ -1768,7 +1778,7 @@ ;; mrb - Fix this someday. (save-excursion (set-buffer byte-compile-inbuffer) - (setq byte-compile-dynamic nil + (setq byte-compile-dynamic nil byte-compile-dynamic-docstrings nil)) ;;(external-debugging-output (prin1-to-string (buffer-local-variables)))) )) @@ -1790,9 +1800,9 @@ (print-length nil) (print-level nil) (print-readably t) ; print #[] for bytecode, 'x for (quote x) - ;; Emacs 19 can't handle gensyms well. - (print-gensym (if byte-compile-emacs19-compatibility nil - t))) + (print-gensym (if (and byte-compile-print-gensym + (not byte-compile-emacs19-compatibility)) + t nil))) (princ "\n" byte-compile-outbuffer) (prin1 form byte-compile-outbuffer) nil))) @@ -1843,8 +1853,9 @@ ;; Use a cons cell to say that we want ;; print-gensym-alist not to be cleared between calls ;; to print functions. - (print-gensym (if byte-compile-emacs19-compatibility nil - '(t))) + (print-gensym (if (and byte-compile-print-gensym + (not byte-compile-emacs19-compatibility)) + '(t) nil)) print-gensym-alist (index 0)) (prin1 (car form) byte-compile-outbuffer) @@ -1984,7 +1995,7 @@ (setq byte-compile-autoload-environment (cons (cons name form) byte-compile-autoload-environment))))))) - ;; + ;; ;; Now output the form. (if (stringp (nth 3 form)) form @@ -2064,8 +2075,9 @@ (read (concat "(" (substring (let ((print-readably t) (print-gensym - (if byte-compile-emacs19-compatibility nil - '(t))) + (if (and byte-compile-print-gensym + (not byte-compile-emacs19-compatibility)) + '(t) nil)) (print-gensym-alist nil)) (prin1-to-string obj)) 2 -1) @@ -2182,7 +2194,7 @@ (setq code new-one) (if macrop '(" '(macro " 2 ")") '(" '(" 2 ")"))) ((if macrop '(" (cons 'macro (" 5 "))") '(" (" 5 ")")))) - ;; The result of byte-compile-byte-code-maker is either a + ;; The result of byte-compile-byte-code-maker is either a ;; compiled-function object, or a list of some kind. If it's ;; not a cons, we must coerce it into a list of the elements ;; to be printed to the file. @@ -2506,7 +2518,7 @@ (if (memq byte-optimize '(t byte)) (setq byte-compile-output (byte-optimize-lapcode byte-compile-output for-effect))) - + ;; Decompile trivial functions: ;; only constants and variables, or a single funcall except in lambdas. ;; Except for Lisp_Compiled objects, forms like (foo "hi") @@ -2587,7 +2599,7 @@ (body (list body)))) -;; This is the recursive entry point for compiling each subform of an +;; This is the recursive entry point for compiling each subform of an ;; expression. ;; If for-effect is non-nil, byte-compile-form will output a byte-discard ;; before terminating (ie no value will be left on the stack). @@ -2748,7 +2760,7 @@ (2-3+1 . byte-compile-two-or-three-args-with-one-extra) (0+2 . byte-compile-no-args-with-two-extra) (1+2 . byte-compile-one-arg-with-two-extra) - + ))) compile-handler (intern (concat "byte-compile-" @@ -2930,7 +2942,7 @@ ;; requires the new interpretation must be compiled with bytecomp version 2.18 ;; or newer, or the emitted code will run the byte-code for `%' instead of an ;; actual call to `mod'. So be careful of compiling new code with an old -;; compiler. Note also that `%' is more efficient than `mod' because the +;; compiler. Note also that `%' is more efficient than `mod' because the ;; former is byte-coded and the latter is not. ;;(byte-defop-compiler (mod byte-rem) 2) @@ -3018,7 +3030,7 @@ ((= len 2) (byte-compile-one-arg form)) ((= len 3) (byte-compile-normal-call form)) (t (byte-compile-subr-wrong-args form "0-2"))))) - + (defun byte-compile-one-or-two-args-with-one-extra (form) (let ((len (length form))) (cond ((= len 2) (byte-compile-two-args (append form '(nil)))) @@ -3616,7 +3628,7 @@ ;; (and (stringp (get condition 'error-message)) ;; (consp (get condition 'error-conditions))))) ;; (byte-compile-warn -;; "%s is not a known condition name (in condition-case)" +;; "%s is not a known condition name (in condition-case)" ;; condition)) ) (setq compiled-clauses @@ -3723,7 +3735,7 @@ (list 'setq 'current-load-list (list 'cons (list 'quote var) 'current-load-list)) - (if string + (if string (list 'put (list 'quote var) ''variable-documentation string)) (list 'quote var))))) @@ -3733,7 +3745,7 @@ (memq (eval (nth 5 form)) '(t macro)) ; macro-p (not (fboundp (eval (nth 1 form)))) (byte-compile-warn - "The compiler ignores `autoload' except at top level. You should + "The compiler ignores `autoload' except at top level. You should probably put the autoload of the macro `%s' at top-level." (eval (nth 1 form)))) (byte-compile-normal-call form)) @@ -3992,7 +4004,7 @@ Use this from the command line, with `-batch'; it won't work in an interactive Emacs. Each file is processed even if an error occurred previously. -For example, invoke \"emacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" +For example, invoke \"xemacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" ;; command-line-args-left is what is left of the command line (from ;; startup.el) (defvar command-line-args-left) ;Avoid 'free variable' warning
--- a/lisp/cl-extra.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/cl-extra.el Mon Aug 13 10:28:48 2007 +0200 @@ -89,7 +89,7 @@ ;;; Predicates. (defun equalp (x y) - "T if two Lisp objects have similar structures and contents. + "Return t if two Lisp objects have similar structures and contents. This is like `equal', except that it accepts numerically equal numbers of different types (float vs. integer), and also compares strings case-insensitively."
--- a/lisp/cl-seq.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/cl-seq.el Mon Aug 13 10:28:48 2007 +0200 @@ -920,7 +920,7 @@ (setq cl-tree (cdr cl-tree)))))) (defun tree-equal (cl-x cl-y &rest cl-keys) - "T if trees X and Y have `eql' leaves. + "Return t if trees X and Y have `eql' leaves. Atoms are compared by `eql'; cons cells are compared recursively. Keywords supported: :test :test-not :key" (cl-parsing-keywords (:test :test-not :key) ()
--- a/lisp/cl.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/cl.el Mon Aug 13 10:28:48 2007 +0200 @@ -149,7 +149,7 @@ ;;; Predicates. (defun eql (a b) ; See compiler macro in cl-macs.el - "T if the two args are the same Lisp object. + "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) @@ -332,7 +332,7 @@ ;;; Numbers. (defun floatp-safe (x) - "T if OBJECT is a floating point number. + "Return t if OBJECT is a floating point number. On Emacs versions that lack floating-point support, this function always returns nil." ;;(and (numberp x) (not (integerp x))) @@ -341,19 +341,19 @@ (floatp x)) (defun plusp (x) - "T if NUMBER is positive." + "Return t if NUMBER is positive." (> x 0)) (defun minusp (x) - "T if NUMBER is negative." + "Return t if NUMBER is negative." (< x 0)) (defun oddp (x) - "T if INTEGER is odd." + "Return t if INTEGER is odd." (eq (logand x 1) 1)) (defun evenp (x) - "T if INTEGER is even." + "Return t if INTEGER is even." (eq (logand x 1) 0)) (defun cl-abs (x) @@ -553,8 +553,8 @@ (cdr (cdr (cdr (cdr 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)." + "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)) @@ -564,12 +564,12 @@ x)) (defun butlast (x &optional n) - "Returns a copy of LIST with the last N elements removed." + "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) - "Modifies LIST to remove the last N elements." + "Modify LIST to remove the last N elements." (let ((m (length x))) (or n (setq n 1)) (and (< n m) @@ -648,7 +648,10 @@ cl-tree (cons a d)))) (t cl-tree))) -(defun acons (a b c) (cons (cons a b) c)) +(defun acons (a b c) + "Return a new alist created by adding (KEY . VALUE) to ALIST." + (cons (cons a b) c)) + (defun pairlis (a b &optional c) (nconc (mapcar* 'cons a b) c))
--- a/lisp/config.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/config.el Mon Aug 13 10:28:48 2007 +0200 @@ -37,7 +37,7 @@ ;;;###autoload (defun config-value-hash-table () - "Returns hashtable of configuration parameters and their values." + "Return hashtable of configuration parameters and their values." (when (null config-value-hash-table) (setq config-value-hash-table (make-hashtable 300)) (save-excursion @@ -65,6 +65,6 @@ (defun config-value (config-symbol) "Return the value of the configuration parameter CONFIG_SYMBOL." (gethash config-symbol (config-value-hash-table))) - + (provide 'config) ;;; config.el ends here
--- a/lisp/derived.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/derived.el Mon Aug 13 10:28:48 2007 +0200 @@ -216,7 +216,7 @@ ;; XEmacs -- don't autoload (defun derived-mode-init-mode-variables (mode) - "Initialise variables for a new mode. + "Initialize 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."
--- a/lisp/dump-paths.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/dump-paths.el Mon Aug 13 10:28:48 2007 +0200 @@ -35,13 +35,14 @@ (setq package-path (packages-find-package-path roots)) (let ((stuff (packages-find-packages package-path inhibit-package-init))) - (setq late-packages (cdr stuff))) + (setq late-packages (car (cdr stuff)))) (setq late-package-load-path (packages-find-package-load-path late-packages)) (setq load-path (paths-construct-load-path roots '() late-package-load-path + '() inhibit-site-lisp))) ;;; dump-paths.el ends here
--- a/lisp/extents.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/extents.el Mon Aug 13 10:28:48 2007 +0200 @@ -17,7 +17,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -32,7 +32,7 @@ ;; an alternative to map-extents. (defun mapcar-extents (function &optional predicate buffer-or-string from to flags property value) - "Applies FUNCTION to all extents which overlap a region in BUFFER-OR-STRING. + "Apply FUNCTION to all extents which overlap a region in BUFFER-OR-STRING. The region is delimited by FROM and TO. FUNCTION is called with one argument, the extent. A list of the values returned by FUNCTION is returned. An optional PREDICATE may be used to further limit the
--- a/lisp/faces.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/faces.el Mon Aug 13 10:28:48 2007 +0200 @@ -146,7 +146,7 @@ (setq face (get-face face)) (let ((specifier (get face property))) ;; if a user-property does not have a specifier but a - ;; locale was specified, put a specifier there. + ;; locale was specified, put a specifier there. ;; If there was already a value there, convert it to a ;; specifier with the value as its 'global instantiator. (unless (specifierp specifier) @@ -231,7 +231,7 @@ (defun set-face-property (face property value &optional locale tag-set how-to-add) - "Change a property of a FACE. + "Change a property of FACE. NOTE: If you want to remove a property from a face, use `remove-face-property' rather than attempting to set a value of nil for the property. @@ -293,16 +293,16 @@ foreground The foreground color of the face. For valid instantiators, see `color-specifier-p'. - + background The background color of the face. For valid instantiators, see `color-specifier-p'. - + font The font used to display text covered by this face. For valid instantiators, see `font-specifier-p'. - + display-table The display table of the face. This should be a vector of 256 elements. - + background-pixmap The pixmap displayed in the background of the face. Only used by faces on X devices. For valid instantiators, see `image-specifier-p'. @@ -316,19 +316,19 @@ highlight Highlight all text covered by this face. Only used by faces on TTY devices. For valid instantiators, see `face-boolean-specifier-p'. - + dim Dim all text covered by this face. Only used by faces on TTY devices. For valid instantiators, see `face-boolean-specifier-p'. - + blinking Blink all text covered by this face. Only used by faces on TTY devices. For valid instantiators, see `face-boolean-specifier-p'. - + reverse Reverse the foreground and background colors. Only used by faces on TTY devices. For valid instantiators, see `face-boolean-specifier-p'. - + doc-string Description of what the face's normal use is. NOTE: This is not a specifier, unlike all the other built-in properties, and cannot @@ -347,7 +347,7 @@ value) (defun remove-face-property (face property &optional locale tag-set exact-p) - "Remove a property from a face. + "Remove a property from FACE. For built-in properties, this is analogous to `remove-specifier'. See `remove-specifier' for the meaning of the LOCALE, TAG-SET, and EXACT-P arguments." @@ -397,13 +397,13 @@ (set-face-property face 'doc-string doc-string)) (defun face-font-name (face &optional domain charset) - "Return the font name of the given face, or nil if it is unspecified. + "Return the font name of FACE in DOMAIN, or nil if it is unspecified. DOMAIN is as in `face-font-instance'." (let ((f (face-font-instance face domain charset))) (and f (font-instance-name f)))) (defun face-font (face &optional locale tag-set exact-p) - "Return the font of the given face, or nil if it is unspecified. + "Return the font of FACE in LOCALE, or nil if it is unspecified. FACE may be either a face object or a symbol representing a face. @@ -416,7 +416,7 @@ (face-property face 'font locale tag-set exact-p)) (defun face-font-instance (face &optional domain charset) - "Return the instance of the given face's font in the given domain. + "Return the instance of FACE's font in DOMAIN. FACE may be either a face object or a symbol representing a face. @@ -430,7 +430,7 @@ (face-property-instance face 'font domain))) (defun set-face-font (face font &optional locale tag-set how-to-add) - "Change the font of the given face. + "Change the font of FACE to FONT in LOCALE. FACE may be either a face object or a symbol representing a face. @@ -449,7 +449,7 @@ (set-face-property face 'font font locale tag-set how-to-add)) (defun face-foreground (face &optional locale tag-set exact-p) - "Return the foreground of the given face, or nil if it is unspecified. + "Return the foreground of FACE in LOCALE, or nil if it is unspecified. FACE may be either a face object or a symbol representing a face. @@ -462,7 +462,7 @@ (face-property face 'foreground locale tag-set exact-p)) (defun face-foreground-instance (face &optional domain default no-fallback) - "Return the instance of the given face's foreground in the given domain. + "Return the instance of FACE's foreground in DOMAIN. FACE may be either a face object or a symbol representing a face. @@ -474,7 +474,7 @@ (face-property-instance face 'foreground domain default no-fallback)) (defun face-foreground-name (face &optional domain default no-fallback) - "Return the name of the given face's foreground color in the given domain. + "Return the name of FACE's foreground color in DOMAIN. FACE may be either a face object or a symbol representing a face. @@ -487,7 +487,7 @@ face domain default no-fallback))) (defun set-face-foreground (face color &optional locale tag-set how-to-add) - "Change the foreground of the given face. + "Change the foreground color of FACE to COLOR in LOCALE. FACE may be either a face object or a symbol representing a face. @@ -506,7 +506,7 @@ (set-face-property face 'foreground color locale tag-set how-to-add)) (defun face-background (face &optional locale tag-set exact-p) - "Return the background of the given face, or nil if it is unspecified. + "Return the background color of FACE in LOCALE, or nil if it is unspecified. FACE may be either a face object or a symbol representing a face. @@ -519,7 +519,7 @@ (face-property face 'background locale tag-set exact-p)) (defun face-background-instance (face &optional domain default no-fallback) - "Return the instance of the given face's background in the given domain. + "Return the instance of FACE's background in DOMAIN. FACE may be either a face object or a symbol representing a face. @@ -531,7 +531,7 @@ (face-property-instance face 'background domain default no-fallback)) (defun face-background-name (face &optional domain default no-fallback) - "Return the name of the given face's background color in the given domain. + "Return the name of FACE's background color in DOMAIN. FACE may be either a face object or a symbol representing a face. @@ -544,7 +544,7 @@ face domain default no-fallback))) (defun set-face-background (face color &optional locale tag-set how-to-add) - "Change the background of the given face. + "Change the background color of FACE to COLOR in LOCALE. FACE may be either a face object or a symbol representing a face. @@ -563,8 +563,8 @@ (set-face-property face 'background color locale tag-set how-to-add)) (defun face-background-pixmap (face &optional locale tag-set exact-p) - "Return the background pixmap of the given face, or nil if it is unspecified. -This property is only used on X devices. + "Return the background pixmap of FACE in LOCALE, or nil if it is unspecified. +This property is only used on window system devices. FACE may be either a face object or a symbol representing a face. @@ -578,7 +578,7 @@ (defun face-background-pixmap-instance (face &optional domain default no-fallback) - "Return the instance of the given face's background pixmap in the given domain. + "Return the instance of FACE's background pixmap in DOMAIN. FACE may be either a face object or a symbol representing a face. @@ -591,8 +591,8 @@ (defun set-face-background-pixmap (face pixmap &optional locale tag-set how-to-add) - "Change the background pixmap of the given face. -This property is only used on X devices. + "Change the background pixmap of FACE to PIXMAP in LOCALE. +This property is only used on window system devices. FACE may be either a face object or a symbol representing a face. @@ -611,7 +611,7 @@ (set-face-property face 'background-pixmap pixmap locale tag-set how-to-add)) (defun face-display-table (face &optional locale tag-set exact-p) - "Return the display table of the given face. + "Return the display table of FACE in LOCALE. A vector (as returned by `make-display-table') will be returned. @@ -632,7 +632,7 @@ (defun set-face-display-table (face display-table &optional locale tag-set how-to-add) - "Change the display table of the given face. + "Change the display table of FACE to DISPLAY-TABLE in LOCALE. DISPLAY-TABLE should be a vector as returned by `make-display-table'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and @@ -645,13 +645,13 @@ ;; implementation. Cf. with `make-face-bold'. (defun face-underline-p (face &optional domain default no-fallback) - "Return whether the given face is underlined. + "Return t if FACE is underlined in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (face-property-instance face 'underline domain default no-fallback)) (defun set-face-underline-p (face underline-p &optional locale tag-set how-to-add) - "Change whether the given face is underlined. + "Change the underline property of FACE to UNDERLINE-P. UNDERLINE-P is normally a face-boolean instantiator; see `face-boolean-specifier-p'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and @@ -660,13 +660,13 @@ (set-face-property face 'underline underline-p locale tag-set how-to-add)) (defun face-strikethru-p (face &optional domain default no-fallback) - "Return whether the given face is strikethru-d (i.e. struck through). + "Return t if FACE is strikethru-d (i.e. struck through) in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (face-property-instance face 'strikethru domain default no-fallback)) (defun set-face-strikethru-p (face strikethru-p &optional locale tag-set how-to-add) - "Change whether the given face is strikethru-d (i.e. struck through). + "Change whether FACE is strikethru-d (i.e. struck through) in LOCALE. STRIKETHRU-P is normally a face-boolean instantiator; see `face-boolean-specifier-p'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and @@ -675,13 +675,13 @@ (set-face-property face 'strikethru strikethru-p locale tag-set how-to-add)) (defun face-highlight-p (face &optional domain default no-fallback) - "Return whether the given face is highlighted (TTY domains only). + "Return t if FACE is highlighted in DOMAIN (TTY domains only). See `face-property-instance' for the semantics of the DOMAIN argument." (face-property-instance face 'highlight domain default no-fallback)) (defun set-face-highlight-p (face highlight-p &optional locale tag-set how-to-add) - "Change whether the given face is highlighted (TTY locales only). + "Change whether FACE is highlighted in LOCALE (TTY locales only). HIGHLIGHT-P is normally a face-boolean instantiator; see `face-boolean-specifier-p'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and @@ -690,12 +690,12 @@ (set-face-property face 'highlight highlight-p locale tag-set how-to-add)) (defun face-dim-p (face &optional domain default no-fallback) - "Return whether the given face is dimmed (TTY domains only). + "Return t if FACE is dimmed in DOMAIN (TTY domains only). See `face-property-instance' for the semantics of the DOMAIN argument." (face-property-instance face 'dim domain default no-fallback)) (defun set-face-dim-p (face dim-p &optional locale tag-set how-to-add) - "Change whether the given face is dimmed (TTY locales only). + "Change whether FACE is dimmed in LOCALE (TTY locales only). DIM-P is normally a face-boolean instantiator; see `face-boolean-specifier-p'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and @@ -704,13 +704,13 @@ (set-face-property face 'dim dim-p locale tag-set how-to-add)) (defun face-blinking-p (face &optional domain default no-fallback) - "Return whether the given face is blinking (TTY domains only). + "Return t if FACE is blinking in DOMAIN (TTY domains only). See `face-property-instance' for the semantics of the DOMAIN argument." (face-property-instance face 'blinking domain default no-fallback)) (defun set-face-blinking-p (face blinking-p &optional locale tag-set how-to-add) - "Change whether the given face is blinking (TTY locales only). + "Change whether FACE is blinking in LOCALE (TTY locales only). BLINKING-P is normally a face-boolean instantiator; see `face-boolean-specifier-p'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and @@ -719,12 +719,12 @@ (set-face-property face 'blinking blinking-p locale tag-set how-to-add)) (defun face-reverse-p (face &optional domain default no-fallback) - "Return whether the given face is reversed (TTY domains only). + "Return t if FACE is reversed in DOMAIN (TTY domains only). See `face-property-instance' for the semantics of the DOMAIN argument." (face-property-instance face 'reverse domain default no-fallback)) (defun set-face-reverse-p (face reverse-p &optional locale tag-set how-to-add) - "Change whether the given face is reversed (TTY locales only). + "Change whether FACE is reversed in LOCALE (TTY locales only). REVERSE-P is normally a face-boolean instantiator; see `face-boolean-specifier-p'. See `set-face-property' for the semantics of the LOCALE, TAG-SET, and @@ -744,7 +744,7 @@ (null props)) (defun face-equal (face1 face2 &optional domain) - "True if the given faces will display in the same way. + "Return t if FACE1 and FACE2 will display in the same way in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (if (null domain) (setq domain (selected-window))) (if (not (valid-specifier-domain-p domain)) @@ -765,7 +765,7 @@ (t t))))) (defun face-differs-from-default-p (face &optional domain) - "True if the given face will display differently from the default face. + "Return t if FACE will display differently from the default face in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (not (face-equal face 'default domain))) @@ -931,7 +931,7 @@ the-locale)))))) (defun make-face-bold (face &optional locale) - "Make the face bold, if possible. + "Make FACE bold in LOCALE, if possible. This will attempt to make the font bold for X locales and will set the highlight flag for TTY locales. @@ -977,7 +977,7 @@ ([bold-italic] . t)))) (defun make-face-italic (face &optional locale) - "Make the face italic, if possible. + "Make FACE italic in LOCALE, if possible. This will attempt to make the font italic for X locales and will set the underline flag for TTY locales. See `make-face-bold' for the semantics of the LOCALE argument and @@ -1002,7 +1002,7 @@ ([bold-italic] . t)))) (defun make-face-bold-italic (face &optional locale) - "Make the face bold and italic, if possible. + "Make FACE bold and italic in LOCALE, if possible. This will attempt to make the font bold-italic for X locales and will set the highlight and underline flags for TTY locales. See `make-face-bold' for the semantics of the LOCALE argument and @@ -1028,7 +1028,7 @@ ([bold-italic] . t)))) (defun make-face-unbold (face &optional locale) - "Make the face non-bold, if possible. + "Make FACE non-bold in LOCALE, if possible. This will attempt to make the font non-bold for X locales and will unset the highlight flag for TTY locales. See `make-face-bold' for the semantics of the LOCALE argument and @@ -1053,7 +1053,7 @@ ([bold-italic] . [italic])))) (defun make-face-unitalic (face &optional locale) - "Make the face non-italic, if possible. + "Make FACE non-italic in LOCALE, if possible. This will attempt to make the font non-italic for X locales and will unset the underline flag for TTY locales. See `make-face-bold' for the semantics of the LOCALE argument and @@ -1082,7 +1082,7 @@ ;; circumstances? (defun make-face-smaller (face &optional locale) - "Make the font of the given face be smaller, if possible. + "Make the font of FACE be smaller, if possible. LOCALE works as in `make-face-bold' et al., but the ``inheriting- from-the-bold-face'' operations described there are not done because they don't make sense in this context." @@ -1094,7 +1094,7 @@ (frob-face-property face 'font 'mswindows-find-smaller-font locale))) (defun make-face-larger (face &optional locale) - "Make the font of the given face be larger, if possible. + "Make the font of FACE be larger, if possible. See `make-face-smaller' for the semantics of the LOCALE argument." (interactive (list (read-face-name "Enlarge which face: "))) ;; handle X specific entries @@ -1119,27 +1119,27 @@ ;;; Convenience functions (defun face-ascent (face &optional domain charset) - "Return the ascent of a face. + "Return the ascent of FACE in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (font-ascent (face-font face) domain charset)) (defun face-descent (face &optional domain charset) - "Return the descent of a face. + "Return the descent of FACE in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (font-descent (face-font face) domain charset)) (defun face-width (face &optional domain charset) - "Return the width of a face. + "Return the width of FACE in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (font-width (face-font face) domain charset)) (defun face-height (face &optional domain charset) - "Return the height of a face. + "Return the height of FACE in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (+ (face-ascent face domain charset) (face-descent face domain charset))) (defun face-proportional-p (face &optional domain charset) - "Return whether FACE is proportional. + "Return t if FACE is proportional in DOMAIN. See `face-property-instance' for the semantics of the DOMAIN argument." (font-proportional-p (face-font face) domain charset)) @@ -1152,7 +1152,7 @@ your background is light, or nil (default) if you want Emacs to examine the brightness for you." :group 'faces - :type '(choice (choice-item dark) + :type '(choice (choice-item dark) (choice-item light) (choice-item :tag "Auto" nil))) @@ -1228,7 +1228,7 @@ (defvar default-custom-frame-properties nil "The frame properties used for the global faces. Frames not matching these propertiess should have frame local faces. -The value should be nil, if uninitialized, or a plist otherwise. +The value should be nil, if uninitialized, or a plist otherwise. See `defface' for a list of valid keys and values for the plist.") (defun get-custom-frame-properties (&optional frame) @@ -1250,10 +1250,10 @@ (setq default-custom-frame-properties (extract-custom-frame-properties (selected-frame)))))) -(defun face-spec-set-match-display (display frame) - "Non-nil iff DISPLAY matches FRAME. +(defun face-spec-set-match-display (display &optional frame) + "Return non-nil if DISPLAY matches FRAME. DISPLAY is part of a spec such as can be used in `defface'. -If FRAME is nil, the current FRAME is used." +If FRAME is nil or omitted, the selected frame is used." (if (eq display t) t (let* ((props (get-custom-frame-properties frame)) @@ -1304,7 +1304,7 @@ (defun custom-initialize-frame (frame) "Initialize frame-local custom faces for FRAME if necessary." - (unless (equal (get-custom-frame-properties) + (unless (equal (get-custom-frame-properties) (get-custom-frame-properties frame)) (initialize-custom-faces frame))) @@ -1449,7 +1449,7 @@ ;; make sure that everything works properly. (defun init-other-random-faces (device) - "Initializes the colors and fonts of the bold, italic, bold-italic, + "Initialize the colors and fonts of the bold, italic, bold-italic, zmacs-region, list-mode-item-selected, highlight, primary-selection, secondary-selection, and isearch faces when each device is created. If you want to add code to do stuff like this, use the create-device-hook." @@ -1469,7 +1469,7 @@ ;; the time. For many languages, italic is an alien concept. ;; Basically, because italic is not a globally meaningful concept, ;; the use of the italic face should really be oboleted. - + ;; I disagree with above. In many languages, the concept of capital ;; letters is just as alien, and yet we use them. Italic is here to ;; stay. -hniksic @@ -1520,7 +1520,7 @@ ;; New function with 20.1, suggested by Per Abrahamsen, coded by Kyle Jones. (defun set-face-stipple (face pixmap &optional frame) - "Change the stipple pixmap of face FACE to PIXMAP. + "Change the stipple pixmap of FACE to PIXMAP. This is an Emacs compatibility function; consider using set-face-background-pixmap instead.
--- a/lisp/files.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/files.el Mon Aug 13 10:28:48 2007 +0200 @@ -313,9 +313,9 @@ ;; a write-file-hook which returns non-nil. (put 'write-file-data-hooks 'permanent-local t) (defvar write-file-data-hooks nil - "List of functions to be called to put the bytes on disk. + "List of functions to be called to put the bytes on disk. These functions receive the name of the file to write to as argument. -The default behavior is to call +The default behavior is to call (write-region (point-min) (point-max) filename nil t) If one of them returns non-nil, the file is considered already written and the rest are not called. @@ -579,7 +579,7 @@ ;; XEmacs addition. Called from `insert-file-contents-internal' ;; at the appropriate time. (defun compute-buffer-file-truename (&optional buffer) - "Recomputes BUFFER's value of `buffer-file-truename' + "Recompute BUFFER's value of `buffer-file-truename' based on the current value of `buffer-file-name'. BUFFER defaults to the current buffer if unspecified." (save-excursion @@ -890,7 +890,7 @@ ;; If the home dir is just /, don't change it. (not (and (= (match-end 0) 1) ;#### unix-specific (= (aref filename 0) ?/))) - (not (and (or (eq system-type 'ms-dos) + (not (and (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) (save-match-data (string-match "^[a-zA-Z]:/$" filename))))) @@ -956,7 +956,7 @@ (let ((file-name-handler-alist nil) (format-alist nil) (after-insert-file-functions nil) - (find-buffer-file-type-function + (find-buffer-file-type-function (if (fboundp 'find-buffer-file-type) (symbol-function 'find-buffer-file-type) nil))) @@ -1094,7 +1094,7 @@ ;; This should be in C. Put pathname abbreviations that have ;; been explicitly requested back into the pathname. Most ;; importantly, strip out automounter /tmp_mnt directories so - ;; that auto-save will work + ;; that auto-save will work (setq buffer-file-name (abbreviate-file-name buffer-file-name))) ;; Set buffer's default directory to that of the file. (setq default-directory (file-name-directory buffer-file-name)) @@ -1356,7 +1356,7 @@ (let ((alist auto-mode-alist) (mode nil)) ;; Find first matching alist entry. - (let ((case-fold-search + (let ((case-fold-search (memq system-type '(vax-vms windows-nt)))) (while (and (not mode) alist) (if (string-match (car (car alist)) name) @@ -1447,8 +1447,8 @@ ;;; end: ;;; ;;; The lines may begin with a common prefix, like ";;; " in the above -;;; example. They may also have a common suffix (" */" for example). In -;;; this form, the local variable "mode" can be used to change the major +;;; example. They may also have a common suffix (" */" for example). In +;;; this form, the local variable "mode" can be used to change the major ;;; mode, and the local variable "eval" can be used to evaluate an arbitrary ;;; form. ;;; @@ -1554,7 +1554,7 @@ (save-excursion (goto-char (point-min)) (skip-chars-forward " \t\n\r") - (let ((end (save-excursion + (let ((end (save-excursion ;; If the file begins with "#!" ;; (un*x exec interpreter magic), look ;; for mode frobs in the first two @@ -1602,7 +1602,7 @@ (setq result (cons (cons key val) result)) (skip-chars-forward " \t;"))) (setq result (nreverse result)))))) - + (let ((set-any-p (or force ;; It's OK to force null specifications. (null result) @@ -1662,7 +1662,7 @@ ;; Don't wait for outline.el to be loaded, for the sake of outline-minor-mode. (put 'outline-level 'risky-local-variable t) (put 'rmail-output-file-alist 'risky-local-variable t) - + ;; This one is safe because the user gets to check it before it is used. (put 'compile-command 'safe-local-variable t) @@ -1970,7 +1970,7 @@ (length name)))))))) (defun file-ownership-preserved-p (file) - "Returns t if deleting FILE and rewriting it would preserve the owner." + "Return t if deleting FILE and rewriting it would preserve the owner." (let ((handler (find-file-name-handler file 'file-ownership-preserved-p))) (if handler (funcall handler 'file-ownership-preserved-p file) @@ -2167,7 +2167,7 @@ (if (memq t localval) (setq localval (append (delq t localval) (delq t globalval)))) localval)) - + (defun basic-save-buffer () "Save the current buffer in its visited file, if it has been modified. After saving the buffer, run `after-save-hook'." @@ -2280,7 +2280,7 @@ "Attempt to save to a file which you aren't allowed to write")))))) (or buffer-backed-up (setq setmodes (backup-buffer))) - (let ((dir (file-name-directory buffer-file-name))) + (let ((dir (file-name-directory buffer-file-name))) (if (and file-precious-flag (file-writable-p dir)) ;; If file is precious, write temp name, then rename it. @@ -2304,7 +2304,7 @@ (setq succeed t)) ;; If writing the temp file fails, ;; delete the temp file. - (or succeed + (or succeed (progn (delete-file tempname) (set-visited-file-modtime old-modtime)))) @@ -2713,7 +2713,7 @@ (interactive "FRecover file: ") (setq file (expand-file-name file)) (let ((handler (or (find-file-name-handler file 'recover-file) - (find-file-name-handler + (find-file-name-handler (let ((buffer-file-name file)) (make-auto-save-file-name)) 'recover-file)))) @@ -2831,7 +2831,7 @@ (lambda (file) (condition-case nil (save-excursion (recover-file file)) - (error + (error "Failed to recover `%s'" file))) files '("file" "files" "recover")) @@ -2911,7 +2911,7 @@ ;; Deal with buffers that don't have any associated files. (Mail ;; mode tends to create a good number of these.) - + (let ((buffer-name (buffer-name)) (limit 0)) ;; Use technique from Sebastian Kremer's auto-save @@ -2922,7 +2922,7 @@ ;; somewhere else and make the name translation customizable. ;; Using "\!" as part of a filename on a UNIX filesystem is nearly ;; IMPOSSIBLE to get past a shell parser. -stig - + (while (string-match "[/\\]" buffer-name limit) (setq buffer-name (concat (substring buffer-name 0 (match-beginning 0)) @@ -2945,7 +2945,7 @@ ;; mail came from a previous emacs process (far and away ;; the most likely case) then this can never succeed as ;; the pid differs. - + (expand-file-name (format "#%s#" buffer-name))) )) ;; don't try to write auto-save files in unwritable places. Unless @@ -3115,7 +3115,7 @@ (t (if wildcard ;; Run ls in the directory of the file pattern we asked for. - (let ((default-directory + (let ((default-directory (if (file-name-absolute-p file) (file-name-directory file) (file-name-directory (expand-file-name file))))
--- a/lisp/find-paths.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/find-paths.el Mon Aug 13 10:28:48 2007 +0200 @@ -74,8 +74,7 @@ "Check if DIRECTORY is a plausible installation root for XEmacs." (or ;; installed - (file-directory-p - (concat directory "lib/xemacs-" (construct-emacs-version))) + (file-directory-p (concat directory "lib/xemacs")) ;; in-place (and (file-directory-p (concat directory "lib-src")) @@ -98,7 +97,8 @@ (let ((maybe-symlink (file-symlink-p (concat invocation-directory invocation-name)))) (if maybe-symlink - (let ((directory (file-name-directory maybe-symlink))) + (let* ((symlink (expand-file-name maybe-symlink invocation-directory)) + (directory (file-name-directory symlink))) (paths-find-emacs-root directory invocation-name)) nil)))))) @@ -230,12 +230,13 @@ (let ((invocation-root (paths-find-emacs-root invocation-directory invocation-name)) (installation-root - (if (and configure-prefix-directory - (file-directory-p configure-prefix-directory)) - configure-prefix-directory))) + (and configure-prefix-directory + (file-directory-p configure-prefix-directory) + (file-name-as-directory configure-prefix-directory)))) (append (and invocation-root (list invocation-root)) (and installation-root + (paths-emacs-root-p installation-root) (list installation-root))))) ;;; find-paths.el ends here
--- a/lisp/finder.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/finder.el Mon Aug 13 10:28:48 2007 +0200 @@ -206,7 +206,8 @@ dirs) (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n") (kill-buffer "*finder-scratch*") - (eval-current-buffer) ;; So we get the new keyword list immediately + (unless noninteractive + (eval-current-buffer)) ; So we get the new keyword list immediately (basic-save-buffer)))) (defun finder-compile-keywords-make-dist ()
--- a/lisp/format.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/format.el Mon Aug 13 10:28:48 2007 +0200 @@ -50,7 +50,7 @@ ;; You can manually translate a buffer into or out of a particular format ;; with the functions `format-encode-buffer' and `format-decode-buffer'. ;; To translate just the region use the functions `format-encode-region' -;; and `format-decode-region'. +;; and `format-decode-region'. ;; ;; You can define a new format by writing the encoding and decoding ;; functions, and adding an entry to `format-alist'. See enriched.el for @@ -94,37 +94,37 @@ ;; Plain only exists so that there is an obvious neutral choice in ;; the completion list. nil nil nil nil nil) - ;; (ibm "IBM Code Page 850 (DOS)" + ;; (ibm "IBM Code Page 850 (DOS)" ;; "1\\(^\\)" ;; "recode ibm-pc:latin1" "recode latin1:ibm-pc" t nil) - ;; (mac "Apple Macintosh" + ;; (mac "Apple Macintosh" ;; "1\\(^\\)" ;; "recode mac:latin1" "recode latin1:mac" t nil) - ;; (hp "HP Roman8" + ;; (hp "HP Roman8" ;; "1\\(^\\)" ;; "recode roman8:latin1" "recode latin1:roman8" t nil) - ;; (TeX "TeX (encoding)" + ;; (TeX "TeX (encoding)" ;; "1\\(^\\)" ;; iso-tex2iso iso-iso2tex t nil) - ;; (gtex "German TeX (encoding)" + ;; (gtex "German TeX (encoding)" ;; "1\\(^\\)" ;; iso-gtex2iso iso-iso2gtex t nil) - ;; (html "HTML (encoding)" + ;; (html "HTML (encoding)" ;; "1\\(^\\)" ;; "recode html:latin1" "recode latin1:html" t nil) - ;; (rot13 "rot13" + ;; (rot13 "rot13" ;; "1\\(^\\)" ;; "tr a-mn-z n-za-m" "tr a-mn-z n-za-m" t nil) - ;; (duden "Duden Ersatzdarstellung" + ;; (duden "Duden Ersatzdarstellung" ;; "1\\(^\\)" - ;; "diac" iso-iso2duden t nil) - ;; (de646 "German ASCII (ISO 646)" + ;; "diac" iso-iso2duden t nil) + ;; (de646 "German ASCII (ISO 646)" ;; "1\\(^\\)" ;; "recode iso646-ge:latin1" "recode latin1:iso646-ge" t nil) - ;; (denet "net German" + ;; (denet "net German" ;; "1\\(^\\)" ;; iso-german iso-cvt-read-only t nil) - ;; (esnet "net Spanish" + ;; (esnet "net Spanish" ;; "1\\(^\\)" ;; iso-spanish iso-cvt-read-only t nil) ) @@ -140,7 +140,7 @@ REGEXP is a regular expression to match against the beginning of the file; it should match only files in that format. -FROM-FN is called to decode files in that format; it gets two args, BEGIN +FROM-FN is called to decode files in that format; it gets two args, BEGIN and END, and can make any modifications it likes, returning the new end. It must make sure that the beginning of the file no longer matches REGEXP, or else it will get called again. @@ -158,7 +158,7 @@ MODIFY, if non-nil, means the TO-FN wants to modify the region. If nil, TO-FN will not make any changes but will instead return a list of - annotations. + annotations. MODE-FN, if specified, is called when visiting a file with that format.") @@ -189,7 +189,7 @@ (funcall method from to))) (defun format-annotate-function (format from to orig-buf) - "Returns annotations for writing region as FORMAT. + "Return annotations for writing region as FORMAT. FORMAT is a symbol naming one of the formats defined in `format-alist', it must be a single symbol, not a list like `buffer-file-format'. FROM and TO delimit the region to be operated on in the current buffer. @@ -199,7 +199,7 @@ current, which contains the modified text to write. For most purposes, consider using `format-encode-region' instead." - ;; This function is called by write-region (actually build-annotations) + ;; This function is called by write-region (actually build-annotations) ;; for each element of buffer-file-format. (let* ((info (assq format format-alist)) (to-fn (nth 4 info)) @@ -218,7 +218,7 @@ (defun format-decode (format length &optional visit-flag) "Decode text from any known FORMAT. -FORMAT is a symbol appearing in `format-alist' or a list of such symbols, +FORMAT is a symbol appearing in `format-alist' or a list of such symbols, or nil, in which case this function tries to guess the format of the data by matching against the regular expressions in `format-alist'. After a match is found and the region decoded, the alist is searched again from the beginning @@ -283,7 +283,7 @@ (defun format-decode-buffer (&optional format) "Translate the buffer from some FORMAT. If the format is not specified, this function attempts to guess. -`buffer-file-format' is set to the format used, and any mode-functions +`buffer-file-format' is set to the format used, and any mode-functions for the format are called." (interactive (list (format-read "Translate buffer from format (default: guess): "))) @@ -296,7 +296,7 @@ Arg FORMAT is optional; if omitted the format will be determined by looking for identifying regular expressions at the beginning of the region." (interactive - (list (region-beginning) (region-end) + (list (region-beginning) (region-end) (format-read "Translate region from format (default: guess): "))) (save-excursion (goto-char from) @@ -325,7 +325,7 @@ (goto-char end) (let ( ; (cur-buf (current-buffer)) (end (point-marker))) - (while format + (while format (let* ((info (assq (car format) format-alist)) (to-fn (nth 4 info)) (modify (nth 5 info)) @@ -353,7 +353,7 @@ (cdr (assq 'default-directory (buffer-local-variables))) nil nil (buffer-name)))) - (fmt (format-read (format "Write file `%s' in format: " + (fmt (format-read (format "Write file `%s' in format: " (file-name-nondirectory file))))) (list file fmt))) (setq buffer-file-format format) @@ -365,7 +365,7 @@ (interactive ;; Same interactive spec as write-file, plus format question. (let* ((file (read-file-name "Find file: ")) - (fmt (format-read (format "Read file `%s' in format: " + (fmt (format-read (format "Read file `%s' in format: " (file-name-nondirectory file))))) (list file fmt))) (let ((format-alist nil)) @@ -384,7 +384,7 @@ (interactive ;; Same interactive spec as write-file, plus format question. (let* ((file (read-file-name "Find file: ")) - (fmt (format-read (format "Read file `%s' in format: " + (fmt (format-read (format "Read file `%s' in format: " (file-name-nondirectory file))))) (list file fmt))) (let (value size) @@ -417,7 +417,7 @@ `search-forward' and `replace-match' respectively. Optional 2nd arg REVERSE, if non-nil, means the pairs are (to . from), so that you can use the same list in both directions if it contains only literal -strings. +strings. Optional args BEGIN and END specify a region of the buffer to operate on." (save-excursion (save-restriction @@ -440,8 +440,8 @@ (defun format-delq-cons (cons list) "Remove the given CONS from LIST by side effect, -and return the new LIST. Since CONS could be the first element -of LIST, write `\(setq foo \(format-delq-cons element foo))' to be sure of +and return the new LIST. Since CONS could be the first element +of LIST, write `\(setq foo \(format-delq-cons element foo))' to be sure of changing the value of `foo'." (if (eq cons list) (cdr list) @@ -452,7 +452,7 @@ ;; Now (cdr p) is the cons to delete (setcdr p (cdr cons)) list))) - + (defun format-make-relatively-unique (a b) "Delete common elements of lists A and B, return as pair. Compares using `equal'." @@ -475,7 +475,7 @@ (let ((la (length a)) (lb (length b))) ;; Make sure they are the same length - (if (> la lb) + (if (> la lb) (setq a (nthcdr (- la lb) a)) (setq b (nthcdr (- lb la) b)))) (while (not (equal a b)) @@ -490,7 +490,7 @@ (if order (let ((item (member (car order) items))) (if item - (cons (car item) + (cons (car item) (format-reorder (format-delq-cons item items) (cdr order))) (format-reorder items (cdr order)))) @@ -508,7 +508,7 @@ (defun format-deannotate-region (from to translations next-fn) "Translate annotations in the region into text properties. -This sets text properties between FROM to TO as directed by the +This sets text properties between FROM to TO as directed by the TRANSLATIONS and NEXT-FN arguments. NEXT-FN is a function that searches forward from point for an annotation. @@ -710,7 +710,7 @@ (s (car subtrahend)) results) (while (and minuend subtrahend) - (cond + (cond ;; The minuend starts after the subtrahend ends; keep it. ((> (car m) (cdr s)) (setq results (cons m results) @@ -758,7 +758,7 @@ not relative to the beginning of the buffer: annotations will be inserted at their location-OFFSET+1 \(ie, the offset is treated as the character number of the first character in the buffer)." - (if (not offset) + (if (not offset) (setq offset 0) (setq offset (1- offset))) (let ((l (reverse list))) @@ -792,7 +792,7 @@ \(as formatted by FORMAT-FN) are inserted into the file. When the property stops having that value, the matching negated annotation will be inserted \(it may actually be closed earlier and reopened, if -necessary, to keep proper nesting). +necessary, to keep proper nesting). If the property's value is a list, then each element of the list is dealt with separately. @@ -834,14 +834,14 @@ ;; To close anno. N, need to first close ans 1 to N-1, ;; remembering to re-open them later. (setq pos-ans (cons (car open-ans) pos-ans)) - (setq all-ans + (setq all-ans (cons (cons loc (funcall format-fn (car open-ans) nil)) all-ans)) (setq open-ans (cdr open-ans))) ;; Now remove the one we're really interested in from open list. (setq open-ans (cdr open-ans)) ;; And put the closing annotation here. - (setq all-ans + (setq all-ans (cons (cons loc (funcall format-fn (car neg-ans) nil)) all-ans))) (setq neg-ans (cdr neg-ans))) @@ -850,14 +850,14 @@ ) (while pos-ans (setq open-ans (cons (car pos-ans) open-ans)) - (setq all-ans + (setq all-ans (cons (cons loc (funcall format-fn (car pos-ans) t)) all-ans)) (setq pos-ans (cdr pos-ans)))))) ;; Close any annotations still open (while open-ans - (setq all-ans + (setq all-ans (cons (cons to (funcall format-fn (car open-ans) nil)) all-ans)) (setq open-ans (cdr open-ans))) @@ -930,13 +930,13 @@ ;; (tail (format-common-tail old new)) close open) (while old - (setq close + (setq close (append (car (format-annotate-atomic-property-change prop-alist (car old) nil)) close) old (cdr old))) (while new - (setq open + (setq open (append (cdr (format-annotate-atomic-property-change prop-alist nil (car new))) open)
--- a/lisp/frame.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/frame.el Mon Aug 13 10:28:48 2007 +0200 @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -246,7 +246,7 @@ ;; The initial frame we create above always has a minibuffer. ;; If the user wants to remove it, or make it a minibuffer-only - ;; frame, then we'll have to delete the current frame and make a + ;; frame, then we'll have to delete the selected frame and make a ;; new one; you can't remove or add a root window to/from an ;; existing frame. ;; @@ -412,7 +412,7 @@ ;;;; Creation of additional frames, and other frame miscellanea (defun get-other-frame () - "Return some frame other than the current frame, creating one if necessary." + "Return some frame other than the selected frame, creating one if necessary." (let* ((this (selected-frame)) ;; search visible frames first (next (next-frame this 'visible-nomini))) @@ -693,7 +693,7 @@ ;;; emacs is in this globally-iconified state, de-iconifying any emacs icon ;;; will uniconify all frames that were visible, and iconify all frames ;;; that were not. This is done by temporarily changing the value of -;;; `map-frame-hook' to `deiconify-emacs' (which should never be called +;;; `map-frame-hook' to `deiconify-emacs' (which should never be called ;;; except from the map-frame-hook while emacs is iconified). ;;; ;;; The title of the icon representing all emacs frames is controlled by @@ -757,11 +757,11 @@ (setq iconification-data (cdr iconification-data)))) (defun suspend-or-iconify-emacs () - "Calls iconify-emacs if frame is an X frame, otherwise calls suspend-emacs" + "Call iconify-emacs if using a window system, otherwise call suspend-emacs." (interactive) (cond ((device-on-window-system-p) (iconify-emacs)) - ((and (eq (frame-type) 'tty) + ((and (eq (device-type) 'tty) (console-tty-controlling-process (selected-console))) (suspend-console (selected-console))) (t @@ -772,7 +772,7 @@ ;; different things depending on window-system. We can't do the same, ;; because we allow simultaneous X and TTY consoles. (defun suspend-emacs-or-iconify-frame () - "Iconify current frame if it is an X frame, otherwise suspend Emacs." + "Iconify the selected frame if using a window system, otherwise suspend Emacs." (interactive) (cond ((device-on-window-system-p) (iconify-frame)) @@ -800,12 +800,12 @@ :group 'frames) (defun default-select-frame-hook () - "Implements the `auto-raise-frame' variable. + "Implement the `auto-raise-frame' variable. For use as the value of `select-frame-hook'." (if auto-raise-frame (raise-frame (selected-frame)))) (defun default-deselect-frame-hook () - "Implements the `auto-lower-frame' variable. + "Implement the `auto-lower-frame' variable. For use as the value of `deselect-frame-hook'." (if auto-lower-frame (lower-frame (selected-frame))) (highlight-extent nil nil)) @@ -817,7 +817,7 @@ (add-hook 'deselect-frame-hook 'default-deselect-frame-hook)) (defun default-drag-and-drop-functions (frame filepath &optional data) - "Implements the `drag-and-drop-functions' variable. + "Implement the `drag-and-drop-functions' variable. For use as the value of `drag-and-drop-functions'. A file is popped up in a new buffer, some data without is inserted at point." @@ -836,7 +836,7 @@ (add-hook 'drag-and-drop-functions 'default-drag-and-drop-functions))) (defun cde-start-drag (begin end) - "Implements the CDE drag operation. + "Implement the CDE drag operation. Calls the internal function cde-start-drag-internal to do the actual work." (interactive "_r") (if (featurep 'cde) @@ -849,7 +849,7 @@ ;; the OffiX drag stuff will soon move also (perhaps mouse.el) ;; if the drag event is done (defun offix-start-drag (event data &optional type) - "Implements the OffiX drag operation. + "Implement the OffiX drag operation. Calls the internal function offix-start-drag-internal to do the actual work. If type is not given, DndText is assumed." ;; Oliver Graf <ograf@fga.de> @@ -859,7 +859,7 @@ (error "OffiX functionality not compiled in."))) (defun offix-start-drag-region (event begin end) - "Implements the OffiX drag operation for a region. + "Implement the OffiX drag operation for a region. Calls the internal function offix-start-drag-internal to do the actual work. This always assumes DndText as type." ;; Oliver Graf <ograf@fga.de> @@ -905,7 +905,7 @@ fr)) (defcustom get-frame-for-buffer-default-to-current nil - "*When non-nil, `get-frame-for-buffer' will default to the current frame." + "*When non-nil, `get-frame-for-buffer' will default to the selected frame." :type 'boolean :group 'frames) @@ -949,7 +949,7 @@ ;; to minimize thrashing. (setq frames (cons (selected-frame) (delq (selected-frame) frames))) - + (setq name (symbol-name name)) (while frames (setq frame (car frames)) @@ -1042,7 +1042,7 @@ ;; ;; This buffer's mode did not express a preference for a frame of a ;; particular name. So try to find a frame already displaying this - ;; buffer. + ;; buffer. ;; (let ((w (or (get-buffer-window buffer nil) ; check current first (get-buffer-window buffer 'visible) ; then visible @@ -1061,11 +1061,11 @@ ;; changes to the selected frame. (defun get-frame-for-buffer (buffer &optional not-this-window-p on-frame) "Select and return a frame in which to display BUFFER. -Normally, the buffer will simply be displayed in the current frame. +Normally, the buffer will simply be displayed in the selected frame. But if the symbol naming the major-mode of the buffer has a 'frame-name property (which should be a symbol), then the buffer will be displayed in a frame of that name. If there is no frame of that name, then one is -created. +created. If the major-mode doesn't have a 'frame-name property, then the frame named by `get-frame-for-buffer-default-frame-name' will be used. If @@ -1076,14 +1076,14 @@ with that name will be created, until there are `instance-limit' of them. If instance-limit is 0, then a new frame will be created each time. -If a buffer is already displayed in a frame, then `instance-limit' is +If a buffer is already displayed in a frame, then `instance-limit' is ignored, and that frame is used. If the frame-name symbol has a 'frame-defaults property, then that is prepended to the `default-frame-plist' when creating a frame for the first time. -This function may be used as the value of `pre-display-buffer-function', +This function may be used as the value of `pre-display-buffer-function', to cause the display-buffer function and its callers to exhibit the above behavior." (let ((frame (get-frame-for-buffer-noselect @@ -1112,7 +1112,7 @@ nil (if (eq cur-frame next-frame) (setq save-frame next-frame) - (and + (and (or (not visible-only) (frame-visible-p next-frame)) (setq frames (append frames (list next-frame)))))) @@ -1134,7 +1134,7 @@ (defun show-temp-buffer-in-current-frame (buffer) "For use as the value of temp-buffer-show-function: -always displays the buffer in the current frame, regardless of the behavior +always displays the buffer in the selected frame, regardless of the behavior that would otherwise be introduced by the `pre-display-buffer-function', which is normally set to `get-frame-for-buffer' (which see)." (let ((pre-display-buffer-function nil)) ; turn it off, whatever it is
--- a/lisp/glyphs.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/glyphs.el Mon Aug 13 10:28:48 2007 +0200 @@ -20,7 +20,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -35,7 +35,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; font specifiers (defun make-image-specifier (spec-list) - "Create a new `image' specifier object with the given specification list. + "Return a new `image' specifier object with the specification list SPEC-LIST. SPEC-LIST can be a list of specifications (each of which is a cons of a locale and a list of instantiators), a single instantiator, or a list of instantiators. See `make-specifier' for more information about @@ -49,7 +49,7 @@ "A list of the built-in face properties that are specifiers.") (defun glyph-property (glyph property &optional locale) - "Return GLYPH's value of the given PROPERTY. + "Return GLYPH's value of PROPERTY in LOCALE. If LOCALE is omitted, the GLYPH's actual value for PROPERTY will be returned. For built-in properties, this will be a specifier object @@ -106,7 +106,7 @@ (check-argument-type 'glyphp glyph) (let ((specifier (get glyph property))) ;; if a user-property does not have a specifier but a - ;; locale was specified, put a specifier there. + ;; locale was specified, put a specifier there. ;; If there was already a value there, convert it to a ;; specifier with the value as its 'global instantiator. (if (not (specifierp specifier)) @@ -218,15 +218,15 @@ The following symbols have predefined meanings: - image The image used to display the glyph. + image The image used to display the glyph. - baseline Percent above baseline that glyph is to be - displayed. + baseline Percent above baseline that glyph is to be + displayed. - contrib-p Whether the glyph contributes to the - height of the line it's on. + contrib-p Whether the glyph contributes to the + height of the line it's on. - face Face of this glyph (*not* a specifier)." + face Face of this glyph (*not* a specifier)." (check-argument-type 'glyphp glyph) (if (memq property built-in-glyph-specifiers) (set-specifier (get glyph property) value locale tag-set how-to-add) @@ -263,7 +263,7 @@ (set-glyph-property glyph 'face face)) (defun glyph-image (glyph &optional locale) - "Return the image of the given glyph, or nil if it is unspecified. + "Return the image of GLYPH in LOCALE, or nil if it is unspecified. LOCALE may be a locale (the instantiators for that particular locale will be returned), a locale type (the specifications for all locales @@ -274,7 +274,7 @@ (glyph-property glyph 'image locale)) (defun glyph-image-instance (glyph &optional domain default no-fallback) - "Return the instance of the given glyph's image in the given domain. + "Return the instance of GLYPH's image in DOMAIN. Normally DOMAIN will be a window or nil (meaning the selected window), and an instance object describing how the image appears in that @@ -284,7 +284,7 @@ (glyph-property-instance glyph 'image domain default no-fallback)) (defun set-glyph-image (glyph spec &optional locale tag-set how-to-add) - "Change the image of the given glyph. + "Change the image of GLYPH in LOCALE. SPEC should be an instantiator (a string or vector; see `image-specifier-p' for a description of possible values here), @@ -314,7 +314,7 @@ (glyph-property glyph 'contrib-p locale)) (defun glyph-contrib-p-instance (glyph &optional domain default no-fallback) - "Return the instance of the GLYPH's 'contrib-p property in the given domain. + "Return the instance of GLYPH's 'contrib-p property in DOMAIN. Normally DOMAIN will be a window or nil (meaning the selected window), and an instance object describing what the 'contrib-p property is in @@ -324,7 +324,7 @@ (glyph-property-instance glyph 'contrib-p domain default no-fallback)) (defun set-glyph-contrib-p (glyph spec &optional locale tag-set how-to-add) - "Change the contrib-p of the given glyph. + "Change the contrib-p property of GLYPH in LOCALE. SPEC should be an instantiator (t or nil), a list of (possibly tagged) instantiators, an alist of specifications (each mapping a @@ -341,7 +341,7 @@ (set-glyph-property glyph 'contrib-p spec locale tag-set how-to-add)) (defun glyph-baseline (glyph &optional locale) - "Return the baseline of the given glyph, or nil if it is unspecified. + "Return the baseline of GLYPH in LOCALE, or nil if it is unspecified. LOCALE may be a locale (the instantiators for that particular locale will be returned), a locale type (the specifications for all locales @@ -352,7 +352,7 @@ (glyph-property glyph 'baseline locale)) (defun glyph-baseline-instance (glyph &optional domain default no-fallback) - "Return the instance of the given glyph's baseline in the given domain. + "Return the instance of GLYPH's baseline in DOMAIN. Normally DOMAIN will be a window or nil (meaning the selected window), and an integer or nil (specifying the baseline in that particular @@ -362,7 +362,7 @@ (glyph-property-instance glyph 'baseline domain default no-fallback)) (defun set-glyph-baseline (glyph spec &optional locale tag-set how-to-add) - "Change the baseline of the given glyph. + "Change the baseline of GLYPH to SPEC in LOCALE. SPEC should be an instantiator (an integer [a percentage above the baseline of the line the glyph is on] or nil), a list of (possibly @@ -380,7 +380,7 @@ (set-glyph-property glyph 'baseline spec locale tag-set how-to-add)) (defun make-glyph (&optional spec-list type) - "Create a new `glyph' object of type TYPE. + "Return a new `glyph' object of type TYPE. TYPE should be one of `buffer' (used for glyphs in an extent, the modeline, the toolbar, or elsewhere in a buffer), `pointer' (used for the mouse-pointer), @@ -399,22 +399,21 @@ glyph)) (defun buffer-glyph-p (object) - "t if OBJECT is a glyph of type `buffer'." + "Return t if OBJECT is a glyph of type `buffer'." (and (glyphp object) (eq 'buffer (glyph-type object)))) (defun pointer-glyph-p (object) - "t if OBJECT is a glyph of type `pointer'." + "Return t if OBJECT is a glyph of type `pointer'." (and (glyphp object) (eq 'pointer (glyph-type object)))) (defun icon-glyph-p (object) - "t if OBJECT is a glyph of type `icon'." + "Return t if OBJECT is a glyph of type `icon'." (and (glyphp object) (eq 'icon (glyph-type object)))) (defun make-pointer-glyph (&optional spec-list) - "Create a new `pointer-glyph' object with the given specification list. + "Return a new `pointer-glyph' object with the specification list SPEC-LIST. -This is equivalent to calling `make-glyph' and specifying a type of -`pointer'. +This is equivalent to calling `make-glyph', specifying a type of `pointer'. SPEC-LIST is used to initialize the glyph's image. It is typically an image instantiator (a string or a vector; see `image-specifier-p' for @@ -430,10 +429,9 @@ (make-glyph spec-list 'pointer)) (defun make-icon-glyph (&optional spec-list) - "Create a new `icon-glyph' object with the given specification list. + "Return a new `icon-glyph' object with the specification list SPEC-LIST. -This is equivalent to calling `make-glyph' and specifying a type of -`icon'. +This is equivalent to calling `make-glyph', specifying a type of `icon'. SPEC-LIST is used to initialize the glyph's image. It is typically an image instantiator (a string or a vector; see `image-specifier-p' for @@ -449,29 +447,29 @@ (make-glyph spec-list 'icon)) (defun nothing-image-instance-p (object) - "t if OBJECT is an image instance of type `nothing'." + "Return t if OBJECT is an image instance of type `nothing'." (and (image-instance-p object) (eq 'nothing (image-instance-type object)))) (defun text-image-instance-p (object) - "t if OBJECT is an image instance of type `text'." + "Return t if OBJECT is an image instance of type `text'." (and (image-instance-p object) (eq 'text (image-instance-type object)))) (defun mono-pixmap-image-instance-p (object) - "t if OBJECT is an image instance of type `mono-pixmap'." + "Return t if OBJECT is an image instance of type `mono-pixmap'." (and (image-instance-p object) (eq 'mono-pixmap (image-instance-type object)))) (defun color-pixmap-image-instance-p (object) - "t if OBJECT is an image instance of type `color-pixmap'." + "Return t if OBJECT is an image instance of type `color-pixmap'." (and (image-instance-p object) (eq 'color-pixmap (image-instance-type object)))) (defun pointer-image-instance-p (object) - "t if OBJECT is an image instance of type `pointer'." + "Return t if OBJECT is an image instance of type `pointer'." (and (image-instance-p object) (eq 'pointer (image-instance-type object)))) (defun subwindow-image-instance-p (object) - "t if OBJECT is an image instance of type `subwindow'. + "Return t if OBJECT is an image instance of type `subwindow'. Subwindows are not implemented in this version of XEmacs." (and (image-instance-p object) (eq 'subwindow (image-instance-type object)))) @@ -659,7 +657,7 @@ ;; has a built-in bitmap (if (featurep 'xpm) (set-glyph-image xemacs-logo - (concat "../etc/" + (concat "../etc/" (if emacs-beta-version "xemacs-beta.xpm" "xemacs.xpm"))
--- a/lisp/gnuserv.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/gnuserv.el Mon Aug 13 10:28:48 2007 +0200 @@ -21,14 +21,14 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Synched up with: Not in FSF. ;;; Commentary: - + ;; Gnuserv is run when Emacs needs to operate as a server for other ;; processes. Specifically, any number of files can be attached for ;; editing to a running XEmacs process using the `gnuclient' program. @@ -141,7 +141,7 @@ :group 'gnuserv :group 'frames) -(defcustom gnuserv-done-function 'kill-buffer +(defcustom gnuserv-done-function 'kill-buffer "*Function used to remove a buffer after editing. It is called with one BUFFER argument. Functions such as `kill-buffer' and `bury-buffer' are good values. See also `gnuserv-done-temp-file-function'." @@ -239,7 +239,7 @@ (device nil) (frame nil)) -(defvar gnuserv-process nil +(defvar gnuserv-process nil "The current gnuserv process.") (defvar gnuserv-string "" @@ -269,13 +269,13 @@ ;; Sample gnuserv-frame functions (defun gnuserv-main-frame-function (type) - "Returns a sensible value for the main Emacs frame." + "Return a sensible value for the main Emacs frame." (if (eq type 'x) (car (frame-list)) nil)) (defun gnuserv-visible-frame-function (type) - "Returns a frame if there is a frame that is truly visible, nil otherwise. + "Return a frame if there is a frame that is truly visible, nil otherwise. This is meant in the X sense, so it will not return frames that are on another visual screen. Totally visible frames are preferred. If none found, return nil." (if (eq type 'x) @@ -288,7 +288,7 @@ nil)) (defun gnuserv-special-frame-function (type) - "Creates a special frame for Gnuserv and returns it on later invocations." + "Create a special frame for Gnuserv and return it on later invocations." (unless (frame-live-p gnuserv-special-frame) (setq gnuserv-special-frame (make-frame gnuserv-frame-plist))) gnuserv-special-frame) @@ -499,7 +499,7 @@ ;; possible, because it is slow, and conses a list. Use ;; `gnuserv-buffer-p' when appropriate, for instance. (defun gnuserv-buffer-clients (buffer) - "Returns a list of clients to which BUFFER belongs." + "Return a list of clients to which BUFFER belongs." (let (res) (dolist (client gnuserv-clients) (when (memq buffer (gnuclient-buffers client)) @@ -728,7 +728,7 @@ (defun gnuserv-start (&optional leave-dead) "Allow this Emacs process to be a server for client processes. This starts a gnuserv communications subprocess through which -client \"editors\" (gnuclient and gnudoit) can send editing commands to +client \"editors\" (gnuclient and gnudoit) can send editing commands to this Emacs job. See the gnuserv(1) manual page for more details. Prefix arg means just kill any existing server communications subprocess."
--- a/lisp/help.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/help.el Mon Aug 13 10:28:48 2007 +0200 @@ -18,14 +18,14 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Synched up with: FSF 19.30. ;;; Commentary: - + ;; This file is dumped with XEmacs. ;; This code implements XEmacs's on-line help system, the one invoked by @@ -151,7 +151,7 @@ ; become hyperlinks. ; -- we should *not* use font-lock keywords like below. Instead we ; should add the font-lock stuff ourselves during the scanning phase, -; if font-lock is enabled in this buffer. +; if font-lock is enabled in this buffer. ;(defun help-follow-reference (event extent user-data) ; (let ((symbol (intern-soft (extent-string extent)))) @@ -242,12 +242,12 @@ (search-backward-regexp "^\\w+:" nil t)) (defun help-mode-bury () - "Buries the buffer, possibly restoring the previous window configuration." + "Bury the help buffer, possibly restoring the previous window configuration." (interactive) (help-mode-quit t)) (defun help-mode-quit (&optional bury) - "Exits from help mode, possibly restoring the previous window configuration. + "Exit from help mode, possibly restoring the previous window configuration. If the optional argument BURY is non-nil, the help buffer is buried, otherwise it is killed." (interactive) @@ -366,7 +366,7 @@ "Print the name of the function KEY invokes. KEY is a string." (interactive "kDescribe key briefly: ") (let (defn menup) - (setq defn (key-or-menu-binding key 'menup)) + (setq defn (key-or-menu-binding key 'menup)) (if (or (null defn) (integerp defn)) (message "%s is undefined" (key-description key)) ;; If it's a keyboard macro which trivially invokes another command, @@ -634,8 +634,10 @@ If the second argument (prefix arg, interactively) is non-null then only the mouse bindings are displayed." (interactive (list nil current-prefix-arg)) - (with-displaying-help-buffer (format "bindings for %s" major-mode) - (describe-bindings-1 prefix mouse-only-p))) + (let (buf) + (with-displaying-help-buffer (format "bindings for %s" major-mode) + (setq buf (describe-bindings-1 prefix mouse-only-p))) + buf)) (defun describe-bindings-1 (&optional prefix mouse-only-p) (let ((heading (if mouse-only-p @@ -671,7 +673,8 @@ (insert "\nFunction key map translations:\n" heading) (describe-bindings-internal function-key-map nil nil prefix mouse-only-p)) - (set-buffer buffer))) + (set-buffer buffer) + standard-output)) (defun describe-prefix-bindings () "Describe the bindings of the prefix used to reach this command. @@ -691,7 +694,7 @@ (princ ":\n\n") (describe-bindings-1 prefix nil)))) -;; Make C-h after a prefix, when not specifically bound, +;; Make C-h after a prefix, when not specifically bound, ;; run describe-prefix-bindings. (setq prefix-help-command 'describe-prefix-bindings) @@ -967,7 +970,7 @@ ;; taken out of `describe-function-1' (defun function-arglist (function) - "Returns a string giving the argument list of FUNCTION. + "Return a string giving the argument list of FUNCTION. For example: (function-arglist 'function-arglist) @@ -999,8 +1002,8 @@ (format "(%s %s)" function arglist))))) (defun function-documentation (function &optional strip-arglist) - "Returns a string giving the documentation for FUNCTION if any. -If the optional argument STRIP-ARGLIST is non-nil remove the arglist + "Return a string giving the documentation for FUNCTION, if any. +If the optional argument STRIP-ARGLIST is non-nil, remove the arglist part of the documentation of internal subroutines." (let ((doc (condition-case nil (or (documentation function) @@ -1021,7 +1024,7 @@ (setq aliases (if aliases ;; I18N3 Need gettext due to concat - (concat aliases + (concat aliases (format "\n which is an alias for `%s', " (symbol-name def))) @@ -1180,43 +1183,9 @@ (if type "an unknown type of built-in variable?" "a variable declared in Lisp"))))) -(defcustom help-pretty-print-limit 100 - "Limit on length of lists above which pretty-printing of values is stopped. -Setting this to 0 disables pretty-printing." - :type 'integer - :group 'help) - -(defun help-maybe-pretty-print-value (object) - "Pretty-print OBJECT, unless it is a long list. -OBJECT is printed in the current buffer. Unless it is a list with -more than `help-pretty-print-limit' elements, it is pretty-printed. - -Uses `pp-internal' if defined, otherwise `cl-prettyprint'" - (princ - (let ((valstr - (if (and (or (listp object) (vectorp object)) - (< (length object) - help-pretty-print-limit)) - (with-output-to-string - (with-syntax-table emacs-lisp-mode-syntax-table - ;; print `#<...>' values better - (modify-syntax-entry ?< "(>") - (modify-syntax-entry ?> ")<") - (let ((indent-line-function 'lisp-indent-line)) - (if (fboundp 'pp-internal) - (progn - (pp-internal object "\n") - (terpri)) - (cl-prettyprint object))))) - (format "\n%S\n" object)))) - - (if (string-match "^\n[^\n]*\n$" valstr) - (substring valstr 1) - valstr)))) - (defun describe-variable (variable) "Display the full documentation of VARIABLE (a symbol)." - (interactive + (interactive (let* ((v (variable-at-point)) (val (let ((enable-recursive-minibuffers t)) (completing-read @@ -1235,7 +1204,7 @@ (if aliases ;; I18N3 Need gettext due to concat (setq aliases - (concat aliases + (concat aliases (format "\n which is an alias for `%s'," (symbol-name newvar)))) (setq aliases @@ -1252,7 +1221,8 @@ (princ "\nValue: ") (if (not (boundp variable)) (princ "void\n") - (help-maybe-pretty-print-value (symbol-value variable))) + (prin1 (symbol-value variable)) + (terpri)) (terpri) (cond ((local-variable-p variable (current-buffer)) (let* ((void (cons nil nil)) @@ -1270,7 +1240,8 @@ (progn (princ "Default-value: ") (if (eq def void) (princ "void\n") - (help-maybe-pretty-print-value def)) + (prin1 def) + (terpri)) (terpri))))) ((local-variable-p variable (current-buffer) t) (princ "Setting it would make its value buffer-local.\n\n")))) @@ -1311,7 +1282,7 @@ `function-at-point'." (interactive (let ((fn (function-at-point)) - (enable-recursive-minibuffers t) + (enable-recursive-minibuffers t) val) (setq val (read-command (if fn (format "Where is command (default %s): " fn)
--- a/lisp/info.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/info.el Mon Aug 13 10:28:48 2007 +0200 @@ -302,6 +302,12 @@ ;; (also added to defaults in "lisp/utils/savehist.el") ;; Other changes in main ChangeLog. +;; Modified 1998-03-29 by Oscar Figueiredo +;; +;; Added automatic dir/localdir (re)building capability for directories that +;; contain none or when it has become older than info files in the same +;; directory. + ;; Code: (defgroup info nil @@ -381,6 +387,17 @@ :type '(repeat directory) :group 'info) +(defcustom Info-rebuild-outdated-dir 'ask + "*What to do if the `dir' or `localdir' file needs to be (re)built. +Possible values are: +`never' never (re)build the `dir' or `localdir' file +`always' automatically (re)builds when needed +`ask' asks the user before (re)building" + :type '(choice (const :tag "never" never) + (const :tag "always" always) + (const :tag "ask" ask)) + :group 'info) + (defvar Info-emacs-info-file-name "xemacs.info" "The filename of the XEmacs info for `Info-goto-emacs-command-node' (`\\<help-mode-map>\\[Info-goto-emacs-command-node]')") @@ -473,6 +490,18 @@ (defvar Info-in-cross-reference nil) (defvar Info-window-configuration nil) +(defvar Info-dir-prologue "-*- Text -*- +This is the file .../info/dir, which contains the topmost node of the +Info hierarchy. The first time you invoke Info you start off +looking at that node, which is (dir)Top. + +File: dir Node: Top This is the top of the INFO tree + This (the Directory node) gives a menu of major topics. + +* Menu: The list of major topics begins on the next line. + +") + ;;;###autoload (defun info (&optional file) "Enter Info, the documentation browser. @@ -764,7 +793,8 @@ (member (directory-file-name truename) dirs-done) ;; Try several variants of specified name. ;; Try upcasing, appending `.info', or both. - (let* (file + (let* (buf + file (attrs (or (progn (setq file (expand-file-name "dir" truename)) @@ -777,20 +807,29 @@ (file-attributes file)) (progn (setq file (expand-file-name "localdir" truename)) (file-attributes file)) + (progn (setq file (expand-file-name "dir" truename)) + nil) ))) (setq dirs-done (cons truename (cons (directory-file-name truename) dirs-done))) - (if attrs + (if (not (string= truename + (file-truename (car Info-directory-list)))) + (Info-maybe-update-dir file)) + (setq attrs (file-attributes file)) + (if (or (setq buf (find-buffer-visiting file)) + attrs) (save-excursion (or buffers (message "Composing main Info directory...")) - (set-buffer (generate-new-buffer - (if (string-match "localdir" file) - "localdir" - "info dir"))) - (insert-file-contents file) + (set-buffer (or buf + (generate-new-buffer + (if (string-match "localdir" file) + "localdir" + "info dir")))) + (if (not buf) + (insert-file-contents file)) (if (string-match "localdir" (buffer-name)) (setq lbuffers (cons (current-buffer) lbuffers)) (setq buffers (cons (current-buffer) buffers))) @@ -927,6 +966,168 @@ (setq default-directory Info-dir-contents-directory) (setq buffer-file-name (caar Info-dir-file-attributes))) +(defun Info-maybe-update-dir (file) + "Rebuild dir or localdir if it does not exist or is outdated." + (unless (or (eq Info-rebuild-outdated-dir 'never) + (not (file-exists-p (file-name-directory file))) + (null (directory-files (file-name-directory file) nil "\\.info"))) + (if (not (find-buffer-visiting file)) + (if (not (file-exists-p file)) + (if (or (eq Info-rebuild-outdated-dir 'always) + (and (eq Info-rebuild-outdated-dir 'ask) + (y-or-n-p (format "No dir file in %s. Rebuild now ? " (file-name-directory file))))) + (Info-build-dir-anew (file-name-directory file) (not (file-writable-p file)))) + (if (Info-dir-outdated-p file) + (if (or (eq Info-rebuild-outdated-dir 'always) + (and (eq Info-rebuild-outdated-dir 'ask) + (y-or-n-p (format "%s is outdated. Rebuild now ? " file)))) + (Info-rebuild-dir file (not (file-writable-p file))))))))) + +;; Record which *.info files are newer than the dir file +(defvar Info-dir-newer-info-files nil) + +(defun Info-dir-outdated-p (file) + "Return non-nil if dir or localdir is outdated. +dir or localdir are outdated when an *.info file in the same +directory has been modified more recently." + (let ((dir-mod-time (nth 5 (file-attributes file))) + f-mod-time + newer) + (setq Info-dir-newer-info-files nil) + (mapcar + '(lambda (f) + (prog2 + (setq f-mod-time (nth 5 (file-attributes f))) + (setq newer (or (> (car f-mod-time) (car dir-mod-time)) + (and (= (car f-mod-time) (car dir-mod-time)) + (> (car (cdr f-mod-time)) (car (cdr dir-mod-time)))))) + (if (and (file-readable-p f) + newer) + (setq Info-dir-newer-info-files + (cons f Info-dir-newer-info-files))))) + (directory-files (file-name-directory file) + 'fullname + ".*\\.info\\(.gz\\|.Z\\|-z\\|.zip\\)?$" + 'nosort + t)) + Info-dir-newer-info-files)) + +(defun Info-extract-dir-entries-from (file) + "Extract dir entries from the info FILE. +dir entries are delimited by the markers `START-INFO-DIR-ENTRY' +and `END-INFO-DIR-ENTRY'" + (save-excursion + (set-buffer (get-buffer-create " *Info-tmp*")) + (when (file-readable-p file) + (insert-file-contents file nil nil nil t) + (goto-char (point-min)) + (let (beg) + (unless (null (re-search-forward "^START-INFO-DIR-ENTRY" nil t)) + (forward-line 1) + (setq beg (point)) + (unless (null (re-search-forward "^END-INFO-DIR-ENTRY" nil t)) + (goto-char (match-beginning 0)) + (buffer-substring beg (point)))))))) + +(defun Info-build-dir-anew (directory to-temp) + "Build a new info dir file in DIRECTORY" + (save-excursion + (let ((dirfile (expand-file-name "dir" directory))) + (if to-temp + (message "Creating temporary dir...") + (message "Creating %s..." dirfile)) + (set-buffer (find-file-noselect dirfile)) + (erase-buffer) + (insert Info-dir-prologue + "Info files in " directory "\n\n") + (mapcar + '(lambda (f) + (insert (or (Info-extract-dir-entries-from f) + (format "* %s::\t[No description available]\n" + (file-name-sans-extension (file-name-nondirectory f)))))) + (directory-files directory + 'fullname + ".*\\.info\\(.gz\\|.Z\\|-z\\|.zip\\)?$" + nil + t)) + (if to-temp + (set-buffer-modified-p nil) + (save-buffer)) + (if to-temp + (message "Creating temporary dir...done") + (message "Creating %s...done" dirfile))))) + +(defvar Info-dir-entry-matcher "^\\* \\([^:]+\\):\\([ \t]*(\\(.*\\))\\w*\\.\\|:\\)[ \t]+\\(.*\\)$") + +(defun Info-parse-dir-entry (entry) + (string-match Info-dir-entry-matcher entry) + (list (match-string 1 entry) (match-string 2 entry) (match-string 4 entry))) + +(defun Info-rebuild-dir (file to-temp) + "Update an existing info dir file after info files have been modified" + (save-excursion + (let (dir-contents + dir-entry + file-dir-entry) + (set-buffer (find-file-noselect file)) + (if to-temp + (message "Rebuilding temporary dir...") + (message "Rebuilding %s..." file)) + (setq buffer-read-only nil) + (goto-char (point-min)) + (search-forward "\^_") + (re-search-forward "^\\* Menu:.*$" nil t) + (narrow-to-region (or (and (re-search-forward Info-dir-entry-matcher nil t) + (match-beginning 0)) + (point)) + (point-max)) + (goto-char (point-min)) + (while (re-search-forward Info-dir-entry-matcher nil t) + (setq dir-contents (cons (list (downcase (or (match-string 3) + (match-string 1))) + (match-string 1) + (match-string 2) + (match-string 4)) + dir-contents))) + (mapcar '(lambda (file) + (setq dir-entry (assoc (downcase + (file-name-sans-extension + (file-name-nondirectory file))) + dir-contents) + file-dir-entry (Info-extract-dir-entries-from file)) + (if dir-entry + (if file-dir-entry + ;; A dir entry in the info file takes precedence over an + ;; existing entry in the dir file + (setcdr dir-entry (Info-parse-dir-entry file-dir-entry))) + (if file-dir-entry + (setq dir-contents (cons (cons 'dummy (Info-parse-dir-entry file-dir-entry)) + dir-contents)) + (setq dir-contents (cons (list 'dummy + (capitalize (file-name-sans-extension + (file-name-nondirectory file))) + ":" + "[No description available]") + dir-contents))))) + Info-dir-newer-info-files) + (delete-region (point-min) (point-max)) + (mapcar '(lambda (entry) + (setq entry (cdr entry)) + (insert (format "* %s:" + (car entry))) + (setq entry (cdr entry)) + (insert (car entry)) + (insert "\t" (car (cdr entry)) "\n")) + (nreverse dir-contents)) + (widen) + (if to-temp + (set-buffer-modified-p nil) + (save-buffer)) + (if to-temp + (message "Rebuilding temporary dir...done") + (message "Rebuilding %s...done" file))))) + + (defun Info-history-add (file node point) (if Info-keeping-history (let* ((name (format "(%s)%s" (Info-file-name-only file) node))
--- a/lisp/isearch-mode.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/isearch-mode.el Mon Aug 13 10:28:48 2007 +0200 @@ -283,6 +283,7 @@ (defvar isearch-other-end nil) ; Start (end) of match if forward (backward). (defvar isearch-wrapped nil) ; Searching restarted from the top (bottom). (defvar isearch-barrier 0) +(defvar isearch-just-started nil) (defvar isearch-buffer nil) ; the buffer we've frobbed the keymap of (defvar isearch-case-fold-search nil) @@ -453,6 +454,7 @@ (* 4 search-slow-window-lines))) isearch-other-end nil isearch-small-window nil + isearch-just-started t isearch-opoint (point) isearch-window-configuration (current-window-configuration) @@ -802,22 +804,24 @@ (setq isearch-forward (not isearch-forward))) (setq isearch-barrier (point)) ; For subsequent \| if regexp. - (setq isearch-success t) - (or (equal isearch-string "") + (if (equal isearch-string "") + (setq isearch-success t) + (if (and (equal (match-end 0) (match-beginning 0)) + isearch-success + (not isearch-just-started)) ;; If repeating a search that found ;; an empty string, ensure we advance. - (if (equal (match-end 0) (match-beginning 0)) - (if (if isearch-forward (eobp) (bobp)) - ;; nowhere to advance to, so fail (and wrap next time) - (progn - (setq isearch-success nil) - (and executing-kbd-macro - (not defining-kbd-macro) - (isearch-done)) - (ding nil 'isearch-failed)) - (forward-char (if isearch-forward 1 -1)) - (isearch-search)) - (isearch-search))) + (if (if isearch-forward (eobp) (bobp)) + ;; nowhere to advance to, so fail (and wrap next time) + (progn + (setq isearch-success nil) + (and executing-kbd-macro + (not defining-kbd-macro) + (isearch-done)) + (ding nil 'isearch-failed)) + (forward-char (if isearch-forward 1 -1)) + (isearch-search)) + (isearch-search))) (isearch-push-state) (isearch-update)) @@ -1509,6 +1513,7 @@ (t (if isearch-forward 'search-forward 'search-backward))) isearch-string nil t)) + (setq isearch-just-started nil) (if isearch-success (setq isearch-other-end (if isearch-forward (match-beginning 0) (match-end 0)))))
--- a/lisp/itimer.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/itimer.el Mon Aug 13 10:28:48 2007 +0200 @@ -95,7 +95,7 @@ (define-key itimer-edit-map "\C-?" 'itimer-edit-previous-field) (define-key itimer-edit-map "x" 'start-itimer) (define-key itimer-edit-map "?" 'itimer-edit-help)) - + (defvar itimer-inside-driver nil) (defvar itimer-edit-start-marker nil) @@ -127,7 +127,7 @@ (defmacro check-itimer-coerce-string (var) "If VAR is not 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 +bind VAR to it. Otherwise, if VAR is not bound to an itimer, signal wrong-type-argument. This is a macro." (list 'setq var (list 'cond @@ -159,56 +159,56 @@ ;; Functions to access and modify itimer attributes. (defun itimerp (obj) - "Returns non-nil iff OBJ is an itimer." + "Return t if OBJ is an itimer." (and (consp obj) (eq (length obj) 8))) (defun itimer-live-p (obj) - "Returns non-nil iff OBJ is an itimer and is active. + "Return non-nil if OBJ is an itimer and is active. ``Active'' means Emacs will run it when it expires. -`activate-timer' must be called on a itimer to make it active. +`activate-timer' must be called on an itimer to make it active. Itimers started with `start-itimer' are automatically active." (and (itimerp obj) (memq obj itimer-list))) (defun itimer-name (itimer) - "Returns the name of ITIMER." + "Return the name of ITIMER." (check-itimer itimer) (car itimer)) (defun itimer-value (itimer) - "Returns the number of seconds until ITIMER expires." + "Return the number of seconds until ITIMER expires." (check-itimer itimer) (nth 1 itimer)) (defun itimer-restart (itimer) - "Returns the value to which ITIMER will be set at restart. -nil is returned if this itimer doesn't restart." + "Return the value to which ITIMER will be set at restart. +Return nil if this itimer doesn't restart." (check-itimer itimer) (nth 2 itimer)) (defun itimer-function (itimer) - "Returns the function of ITIMER. + "Return the function of ITIMER. This function is called each time ITIMER expires." (check-itimer itimer) (nth 3 itimer)) (defun itimer-is-idle (itimer) - "Returns non-nil if ITIMER is an idle timer. + "Return non-nil if ITIMER is an idle timer. Normal timers expire after a set interval. Idle timers expire -only after Emacs has been idle for a specific interval. ``Idle'' -means no command events within the interval." +only after Emacs has been idle for a specific interval. +``Idle'' means no command events occur within the interval." (check-itimer itimer) (nth 4 itimer)) (defun itimer-uses-arguments (itimer) - "Returns non-nil if the function of ITIMER will be called with arguments. + "Return non-nil if the function of ITIMER will be called with arguments. ITIMER's function is called with the arguments each time ITIMER expires. The arguments themselves are retrievable with `itimer-function-arguments'." (check-itimer itimer) (nth 5 itimer)) (defun itimer-function-arguments (itimer) - "Returns the function arguments of ITIMER as a list. -ITIMER's function is called with these argument each timer ITIMER expires." + "Return the function arguments of ITIMER as a list. +ITIMER's function is called with these argument each time ITIMER expires." (check-itimer itimer) (nth 6 itimer)) @@ -218,7 +218,7 @@ (defun set-itimer-value (itimer value) "Set the timeout value of ITIMER to be VALUE. -Itimer will expire is this many seconds. +Itimer will expire in this many seconds. If your version of Emacs supports floating point numbers then VALUE can be a floating point number. Otherwise it must be an integer. @@ -264,14 +264,14 @@ (setcar (nthcdr 3 itimer) function)) (defun set-itimer-is-idle (itimer flag) - "Sets flag that says whether ITIMER is an idle timer. -If FLAG is non-nil, then ITIMER will eb considered an idle timer. + "Set flag that says whether ITIMER is an idle timer. +If FLAG is non-nil, then ITIMER will be considered an idle timer. Returns FLAG." (check-itimer itimer) (setcar (nthcdr 4 itimer) flag)) (defun set-itimer-uses-arguments (itimer flag) - "Sets flag that says whether the function of ITIMER is called with arguments. + "Set flag that says whether the function of ITIMER is called with arguments. If FLAG is non-nil, then the function will be called with one argument, otherwise the function will be called with no arguments. Returns FLAG." @@ -298,11 +298,11 @@ "Read the name of an itimer from the minibuffer and return the itimer associated with that name. The user is prompted with PROMPT. Optional second arg INITIAL-INPUT non-nil is inserted into the - minibuffer as initial user input." +minibuffer as initial user input." (get-itimer (completing-read prompt itimer-list nil 'confirm initial-input))) (defun delete-itimer (itimer) - "Deletes ITIMER. ITIMER may be an itimer or the name of one." + "Delete ITIMER. ITIMER may be an itimer or the name of one." (check-itimer-coerce-string itimer) (setq itimer-list (delq itimer itimer-list))) @@ -312,8 +312,8 @@ Arguments are NAME, FUNCTION, VALUE &optional RESTART, IS-IDLE, WITH-ARGS, &rest FUNCTION-ARGUMENTS. NAME is an identifier for the itimer. It must be a string. If an itimer - already exists with this name, NAME will be modified slightly to until - it is unique. + already exists with this name, NAME will be modified slightly to make + it unique. FUNCTION should be a function (or symbol naming one). It will be called each time the itimer expires with arguments of FUNCTION-ARGUMENTS. The function can access the itimer that @@ -323,17 +323,17 @@ package which always called FUNCTION with no arguments. VALUE is the number of seconds until this itimer expires. If your version of Emacs supports floating point numbers then - you can VALUE can be a floating point number. Otherwise it + VALUE can be a floating point number. Otherwise it must be an integer. Optional fourth arg RESTART non-nil means that this itimer should be restarted automatically after its function is called. Normally an itimer - is deleted at expiration after its function has returned. - If non-nil RESTART should be a number indicating the value at which the - itimer should be set at restart time. -Optional fifth arg IS-IDLE specified if this is an idle timer. - Normal timers eexpire after a set interval. Idle timers expire - only after Emacs has been idle for specific interval. ``Idle'' - means no command events within the interval. + is deleted at expiration after its function has returned. + If non-nil, RESTART should be a number indicating the value at which + the itimer should be set at restart time. +Optional fifth arg IS-IDLE specifies if this is an idle timer. + Normal timers expire after a set interval. Idle timers expire + only after Emacs has been idle for specific interval. + ``Idle'' means no command events occur within the interval. Returns the newly created itimer." (interactive (list (completing-read "Start itimer: " itimer-list)
--- a/lisp/keymap.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/keymap.el Mon Aug 13 10:28:48 2007 +0200 @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -76,7 +76,7 @@ (map-keymap #'(lambda (key binding) (if (eq binding olddef) ;; The new bindings always go in KEYMAP even if we - ;; found them in OLDMAP or one of it's children. + ;; found them in OLDMAP or one of its children. ;; If KEYMAP will be shadowing OLDMAP, then do not ;; redefine the key if there is another binding ;; in KEYMAP that will shadow OLDDEF. @@ -84,7 +84,7 @@ (lookup-key keymap key)) ;; define-key will give an error if a prefix ;; of the key is already defined. Otherwise - ;; it will define the key in the map. + ;; it will define the key in the map. ;; #### - Perhaps this should be protected? (define-key keymap @@ -295,7 +295,7 @@ ;; By passing t for the `allow-meta' arg we could get kbd macros ;; with meta in them to translate to the string form instead of ;; the list/symbol form; but I expect that would cause confusion, - ;; so let's use the list/symbol form whenever there's + ;; so let's use the list/symbol form whenever there's ;; any ambiguity. (setq c (event-to-character ce)) (if (and c @@ -342,7 +342,7 @@ ((or (button-press-event-p event) (button-release-event-p event)) (if no-mice - (error + (error "Mouse events can't be saved in keyboard macros.")) (setq mods (event-modifiers event) key (intern (concat "button"
--- a/lisp/loaddefs.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/loaddefs.el Mon Aug 13 10:28:48 2007 +0200 @@ -97,69 +97,70 @@ ".diff" ".oi" ".class")))) -(setq debug-ignored-errors - '(beginning-of-line - beginning-of-buffer - end-of-line - end-of-buffer - end-of-file buffer-read-only - "\\`Previous command was not a yank\\'" - "\\`Minibuffer is not active for completion\\'" - "\\`No \\(following\\|preceding\\) item in .*-history\\'" - "\\`No recursive edit is in progress\\'" - "\\`Changes to be undone are outside visible portion of buffer\\'" - "\\`No further undo information\\'" - "\\`No undo information in this buffer\\'" - "\\`Buffer modified since last undo/redo, cannot redo" - "\\`Save not confirmed\\'" - "\\`Canceled\\'" - "\\`\\(Revert\\|Steal\\|Recover-file\\) cancelled\\.\\'" +;; This needs to be redone better. -slb +;(setq debug-ignored-errors +; '(beginning-of-line +; beginning-of-buffer +; end-of-line +; end-of-buffer +; end-of-file buffer-read-only +; "\\`Previous command was not a yank\\'" +; "\\`Minibuffer is not active for completion\\'" +; "\\`No \\(following\\|preceding\\) item in .*-history\\'" +; "\\`No recursive edit is in progress\\'" +; "\\`Changes to be undone are outside visible portion of buffer\\'" +; "\\`No further undo information\\'" +; "\\`No undo information in this buffer\\'" +; "\\`Buffer modified since last undo/redo, cannot redo" +; "\\`Save not confirmed\\'" +; "\\`Canceled\\'" +; "\\`\\(Revert\\|Steal\\|Recover-file\\) cancelled\\.\\'" - ;; comint - "\\`Not at command line\\'" - "\\`Empty input ring\\'" - "\\`No history\\'" - "\\`Not found\\'" ;; To common? - "\\`Current buffer has no process\\'" +; ;; comint +; "\\`Not at command line\\'" +; "\\`Empty input ring\\'" +; "\\`No history\\'" +; "\\`Not found\\'" ;; To common? +; "\\`Current buffer has no process\\'" - ;; dabbrev - "\\`No \\(further \\)?dynamic expansion for .* found\\.?\\'" - - ;; Completion - "\\`To complete, the point must be after a symbol at least [0-9]* character long\\.\\'" - "\\`The string \".*\" is too short to be saved as a completion\\.\\'" +; ;; dabbrev +; "\\`No \\(further \\)?dynamic expansion for .* found\\.?\\'" - ;; Compile - "\\`No more errors\\( yet\\|\\)\\'" +; ;; Completion +; "\\`To complete, the point must be after a symbol at least [0-9]* character long\\.\\'" +; "\\`The string \".*\" is too short to be saved as a completion\\.\\'" - ;; Gnus - ;"\\`NNTP: Connection closed\\.\\'" +; ;; Compile +; "\\`No more errors\\( yet\\|\\)\\'" - ;; info - "\\`Node has no Previous\\'" - "\\`No \".*\" in index\\'" +; ;; Gnus +; ;"\\`NNTP: Connection closed\\.\\'" - ;; imenu - ;"\\`No items suitable for an index found in this buffer\\.\\'" - ;"\\`The mode \".*\" does not take full advantage of imenu\\.el yet\\.\\'" +; ;; info +; "\\`Node has no Previous\\'" +; "\\`No \".*\" in index\\'" + +; ;; imenu +; ;"\\`No items suitable for an index found in this buffer\\.\\'" +; ;"\\`The mode \".*\" does not take full advantage of imenu\\.el yet\\.\\'" - ;; ispell - "\\`No word found to check!\\'" +; ;; ispell +; "\\`No word found to check!\\'" - ;; man - "\\`.* not found\\'" - "\\`No more history\\.\\'" +; ;; man +; "\\`.* not found\\'" +; "\\`No more history\\.\\'" - ;; etags - "\\`File .* is not a valid tag table\\'" - "\\`File .* is not a valid tags file\\'" - "\\`All files processed\\.\\'" - "No TAGS file name supplied\\'" - "\\`Nothing to complete\\'" +; ;; etags +; "\\`File .* is not a valid tag table\\'" +; "\\`File .* is not a valid tags file\\'" +; "\\`All files processed\\.\\'" +; "No TAGS file name supplied\\'" +; "\\`Nothing to complete\\'" - ;; BBDB - "\\`no previous record\\'" - "\\`no next record\\'")) +; ;; BBDB +; "\\`no previous record\\'" +; "\\`no next record\\'")) (make-variable-buffer-local 'indent-tabs-mode)
--- a/lisp/loadup.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/loadup.el Mon Aug 13 10:28:48 2007 +0200 @@ -90,6 +90,9 @@ '(garbage-collect)) (external-debugging-output (format "\nLoad file %s: not found\n" file)) + ;; Uncomment in case of trouble + ;;(print (format "late-packages: %S" late-packages)) + ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) nil))) (load (concat default-directory "../lisp/dumped-lisp.el"))
--- a/lisp/make-docfile.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/make-docfile.el Mon Aug 13 10:28:48 2007 +0200 @@ -108,7 +108,12 @@ arg) (setq arg (locate-library arg0)) (if (null arg) + (progn (princ (format "Error: dumped file %s does not exist\n" arg0)) + ;; Uncomment in case of difficulties + ;;(print (format "late-packages: %S" late-packages)) + ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) + ) (if (null (member arg processed)) (progn (if (and (null docfile-out-of-date)
--- a/lisp/minibuf.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/minibuf.el Mon Aug 13 10:28:48 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1992, 1993, 1994, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems ;; Copyright (C) 1995, 1996 Ben Wing - + ;; Author: Richard Mlynarik ;; Created: 2-Oct-92 ;; Maintainer: XEmacs Development Team @@ -22,7 +22,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -159,7 +159,7 @@ (define-key minibuffer-local-map '[prior] "\M-p") (define-key minibuffer-local-map "\M-r" 'previous-matching-history-element) (define-key minibuffer-local-map "\M-s" 'next-matching-history-element) -(define-key minibuffer-local-must-match-map [next] +(define-key minibuffer-local-must-match-map [next] 'next-complete-history-element) (define-key minibuffer-local-must-match-map [prior] 'previous-complete-history-element) @@ -397,7 +397,7 @@ (get-buffer-create (format " *Minibuf-%d" (minibuffer-depth))))) (frame (window-frame window)) - (mconfig (if (eq frame (selected-frame)) + (mconfig (if (eq frame (selected-frame)) nil (current-window-configuration frame))) (oconfig (current-window-configuration)) ;; dynamic scope sucks sucks sucks sucks sucks sucks. @@ -549,7 +549,7 @@ ;; complaint, like `disabled' commands do, since it's likely that non-novice ;; users will be annoyed by this change, so we give them an easy way to get ;; rid of it forever. - ;; + ;; (beep t 'minibuffer-limit-exceeded) (message "Minibuffer already active: abort it with `^]', enable new one with `n': ") @@ -567,7 +567,7 @@ (find-file-noselect (substitute-in-file-name custom-file))) (goto-char (point-min)) - (if (re-search-forward + (if (re-search-forward "^(setq minibuffer-max-depth \\([0-9]+\\|'?nil\\|'?()\\))\n" nil t) (delete-region (match-beginning 0 ) (match-end 0)) @@ -598,8 +598,8 @@ (let ((inhibit-quit t)) (sit-for 2) (delete-region savemax (point-max)) - ;; If the user types a ^G while we're in sit-for, then quit-flag - ;; gets set. In this case, we want that ^G to be interpreted + ;; If the user types a ^G while we're in sit-for, then quit-flag + ;; gets set. In this case, we want that ^G to be interpreted ;; as a normal character, and act just like typeahead. (if (and quit-flag (not unread-command-event)) (setq unread-command-event (character-to-event (quit-char)) @@ -658,7 +658,7 @@ ;; 0 'none no possible completion ;; 1 'unique was already an exact and unique completion ;; 3 'exact was already an exact (but nonunique) completion -;; NOT USED 'completed-exact-unique completed to an exact and completion +;; NOT USED 'completed-exact-unique completed to an exact and completion ;; 4 'completed-exact completed to an exact (but nonunique) completion ;; 5 'completed some completion happened ;; 6 'uncompleted no completion happened @@ -936,7 +936,7 @@ (and (not (eq char ?\-)) (funcall foo "-")) (progn - (if completion-auto-help + (if completion-auto-help (minibuffer-completion-help) ;; New message, only in this new Lisp code ;; rewritten for I18N3 snarfing @@ -1316,7 +1316,7 @@ (goto-char (point-max)))))) (defun previous-history-element (n) - "Inserts the previous element of the minibuffer history into the minibuffer." + "Insert the previous element of the minibuffer history into the minibuffer." (interactive "p") (next-history-element (- n))) @@ -1415,7 +1415,7 @@ Prompts with PROMPT. Optional second arg DEFAULT is value to return if user enters an empty line. If optional third arg REQUIRE-MATCH is non-nil, only existing buffer names are allowed." - (let ((prompt (if default + (let ((prompt (if default (format "%s(default %s) " (gettext prompt) (if (bufferp default) (buffer-name default) @@ -1444,7 +1444,7 @@ result))) (defun read-number (prompt &optional integers-only) - "Reads a number from the minibuffer." + "Read a number from the minibuffer." (let ((pred (if integers-only 'integerp 'numberp)) num) (while (not (funcall pred num)) @@ -1492,8 +1492,8 @@ ;; already aset by make-string initial-value (setq n (1+ n)))) new)))) - -(defun read-file-name-2 (history prompt dir default + +(defun read-file-name-2 (history prompt dir default must-match initial-contents completer) (if (not dir) @@ -1587,7 +1587,7 @@ :activate-callback 'read-file-name-activate-callback) (goto-char (point-min) completion-buf))))) -(defun read-file-name-1 (history prompt dir default +(defun read-file-name-1 (history prompt dir default must-match initial-contents completer) (if (should-use-dialog-box-p) @@ -1660,7 +1660,7 @@ Sixth arg HISTORY specifies the history list to use. Default is `file-name-history'. DIR defaults to current buffer's directory default." - (read-file-name-1 + (read-file-name-1 (or history 'file-name-history) prompt dir (or default default-directory) must-match initial-contents 'read-directory-name-internal)) @@ -1675,16 +1675,16 @@ (let* ((orig (if (equal string "") nil string)) (sstring (if orig (substitute-in-file-name string) string)) (specdir (if orig (file-name-directory sstring) nil))) - (funcall completer - action - orig - sstring + (funcall completer + action + orig + sstring specdir (if specdir (expand-file-name specdir dir) dir) (if orig (file-name-nondirectory sstring) string))) ;; An odd number of trailing $'s (let* ((start (match-beginning 3)) - (env (substring string + (env (substring string (cond ((= start (length string)) ;; "...$" start) @@ -1699,7 +1699,7 @@ (cons (substring x 0 (string-match "=" x)) 'nil)) process-environment)))) - + (cond ((eq action 'lambda) nil) ((eq action 't) @@ -1731,13 +1731,13 @@ (defun read-file-name-internal (string dir action) - (read-file-name-internal-1 + (read-file-name-internal-1 string dir action #'(lambda (action orig string specdir dir name) (cond ((eq action 'lambda) (if (not orig) nil - (let ((sstring (condition-case nil + (let ((sstring (condition-case nil (expand-file-name string) (error nil)))) (if (not sstring) @@ -1771,7 +1771,7 @@ val))))))))) (defun read-directory-name-internal (string dir action) - (read-file-name-internal-1 + (read-file-name-internal-1 string dir action #'(lambda (action orig string specdir dir name) (let* ((dirs #'(lambda (fn) @@ -1784,7 +1784,7 @@ 'directories) (directory-files dir - nil + nil (concat "\\`" (regexp-quote name)) nil 'directories)))) @@ -1802,7 +1802,7 @@ ((eq action 't) ;; all completions (funcall dirs #'(lambda (n) - (un-substitute-in-file-name + (un-substitute-in-file-name (file-name-as-directory n))))) (t ;; complete @@ -1824,13 +1824,13 @@ (defun append-expand-filename (file-string string) "Append STRING to FILE-STRING differently depending on whether STRING -is a username (~string), an environment variable ($string), -or a filename (/string). The resultant string is returned with the -environment variable or username expanded and resolved to indicate +is a username (~string), an environment variable ($string), +or a filename (/string). The resultant string is returned with the +environment variable or username expanded and resolved to indicate whether it is a file(/result) or a directory (/result/)." - (let ((file + (let ((file (cond ((string-match "\\([~$]\\)\\([^~$/]*\\)$" file-string) - (cond ((string= (substring file-string + (cond ((string= (substring file-string (match-beginning 1) (match-end 1)) "~") (concat (substring file-string 0 (match-end 1)) @@ -1838,12 +1838,12 @@ (t (substitute-in-file-name (concat (substring file-string 0 (match-end 1)) string))))) - (t (concat (file-name-directory + (t (concat (file-name-directory (substitute-in-file-name file-string)) string)))) result) - + (cond ((stringp (setq result (and (file-exists-p (expand-file-name file)) - (read-file-name-internal + (read-file-name-internal (condition-case nil (expand-file-name file) (error file)) @@ -1854,7 +1854,7 @@ (defun mouse-file-display-completion-list (window dir minibuf user-data) (let ((standard-output (window-buffer window))) (condition-case nil - (display-completion-list + (display-completion-list (directory-files dir nil nil nil t) :window-width (* 2 (window-width window)) :activate-callback @@ -1902,7 +1902,7 @@ user-data))))) ;; this is rather cheesified but gets the job done. -(defun mouse-read-file-name-1 (history prompt dir default +(defun mouse-read-file-name-1 (history prompt dir default must-match initial-contents completer) (let* ((file-p (eq 'read-file-name-internal completer)) @@ -1939,7 +1939,7 @@ (when (featurep 'scrollbar) (set-specifier scrollbar-width 0 butbuff)) (insert " ") - (insert-gui-button (make-gui-button "OK" + (insert-gui-button (make-gui-button "OK" (lambda (foo) (exit-minibuffer)))) (insert " ") @@ -1982,7 +1982,7 @@ (progn (add-hook 'minibuffer-setup-hook rfhookfun) (add-hook 'completion-setup-hook rfcshookfun) - (read-file-name-2 history prompt dir default + (read-file-name-2 history prompt dir default must-match initial-contents completer)) (remove-hook 'minibuffer-setup-hook rfhookfun) @@ -2003,7 +2003,7 @@ ;; Ben wanted all of the possibilities from the `configure' script used ;; here, but I think this is way too many. I already trimmed the R4 variants -;; and a few obvious losers from the list. --Stig +;; and a few obvious losers from the list. --Stig (defvar x-library-search-path '("/usr/X11R6/lib/X11/" "/usr/X11R5/lib/X11/" "/usr/lib/X11R6/X11/"
--- a/lisp/mouse.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/mouse.el Mon Aug 13 10:28:48 2007 +0200 @@ -20,7 +20,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -148,8 +148,8 @@ (funcall mouse-yank-function)) (defun click-inside-extent-p (click extent) - "Returns non-nil if the button event is within the bounds of the primary -selection-extent, nil otherwise." + "Return non-nil if the button event is within the primary selection-extent. +Return nil otherwise." ;; stig@hackvan.com (let ((ewin (event-window click)) (epnt (event-point click))) @@ -168,11 +168,12 @@ )) (defun point-inside-extent-p (extent) - "Returns non-nil if the point is within or just after the bounds of the -primary selection-extent, nil otherwise." + "Return t if point is within the bounds of the primary selection extent. +Return t is point is at the end position of the extent. +Return nil otherwise." ;; stig@hackvan.com (and extent - (eq (current-buffer) + (eq (current-buffer) (extent-object extent)) (> (point) (extent-start-position extent)) (>= (extent-end-position extent) (point)))) @@ -183,10 +184,10 @@ (point-inside-extent-p zmacs-region-extent))) (defun mouse-drag-or-yank (event) - "Either drag or paste the current selection. If the variable - `mouse-yank-at-point' is non-nil, then moves the cursor to the location of - the click before pasting. - This functions has to be improved. Until now it is just a (working) test." + "Either drag or paste the current selection. +If the variable `mouse-yank-at-point' is non-nil, +move the cursor to the location of the click before pasting. +This functions has to be improved. Currently it is just a (working) test." ;; by Oliver Graf <ograf@fga.de> (interactive "e") (if (click-inside-extent-p event zmacs-region-extent) @@ -208,9 +209,9 @@ ) (defun mouse-offix-drop (event) - "Do something with an OffiX drop event. Inserts Text drops and - executes appropriate commands for specific drops. - Text drops follow the `mouse-yank-at-point' variable." + "Do something with an OffiX drop event. +Insert Text drops and execute appropriate commands for specific drops. +Text drops follow the `mouse-yank-at-point' variable." ;; by Oliver Graf <ograf@fga.de> (interactive "e") (let ((type (car (event-drag-and-drop-data event))) @@ -253,9 +254,9 @@ (undo-boundary))) (defun mouse-mswindows-drop (event) - "Do something with a drop event. Inserts Text drops and - executes appropriate commands for specific drops. - Text drops follow the `mouse-yank-at-point' variable." + "Do something with a drop event. +Insert Text drops and execute appropriate commands for specific drops. +Text drops follow the `mouse-yank-at-point' variable." (interactive "e") (let* ((type (car (event-drag-and-drop-data event))) (data (cadr (event-drag-and-drop-data event))) @@ -307,7 +308,7 @@ (interactive "e\nP") (let (exp val result-str) (setq exp (save-window-excursion - (save-excursion + (save-excursion (mouse-set-point click) (save-excursion (or (looking-at "(") (forward-sexp -1)) @@ -383,7 +384,7 @@ (save-selected-window (select-window (event-window event)) (bury-buffer))) - + (defun mouse-unbury-buffer (event) "Unbury and select the most recently buried buffer." (interactive "e") @@ -644,7 +645,7 @@ any custom-supplied handlers, by using the function `mouse-track-default' instead of `mouse-track'. -Default behavior is as follows: +Default behavior is as follows: If you click-and-drag, the selection will be set to the region between the point of the initial click and the point at which you release the button. @@ -746,7 +747,7 @@ (defvar default-mouse-track-down-event nil) ;; D. Verna Feb. 17 1998 -;; This function used to assume that when (event-window event) differs from +;; This function used to assume that when (event-window event) differs from ;; window, we have to scroll. This is WRONG, for instance when there are ;; toolbars on the side, in which case window-event returns nil. (defun default-mouse-track-set-point-in-window (event window) @@ -760,21 +761,21 @@ (mouse-set-point event) t)) ;; Not over a modeline, not the same window. Check if the Y position - ;; is still overlapping the original window. + ;; is still overlapping the original window. (let* ((edges (window-pixel-edges window)) (row (event-y-pixel event)) (text-start (nth 1 edges)) (text-end (+ (nth 3 edges)))) - (if (or (< row text-start) + (if (or (< row text-start) (> row text-end)) nil ;; Scroll ;; The Y pos in overlapping the original window. Check however if - ;; the position is really visible, because there could be a + ;; the position is really visible, because there could be a ;; scrollbar or a modeline at this place. ;; Find the mean line height (height / lines nb), and approximate ;; the line number for Y pos. (select-window window) - (let ((line (/ (* (- row text-start) (window-height)) + (let ((line (/ (* (- row text-start) (window-height)) (- text-end text-start)))) (if (not (save-excursion (goto-char (window-start)) @@ -817,10 +818,10 @@ ;; window-end reports the end of the clipped line, even if ;; scroll-on-clipped-lines is t. compensate. ;; (If window-end gets fixed this can be removed.) - (if (not (pos-visible-in-window-p (max (1- (point)) + (if (not (pos-visible-in-window-p (max (1- (point)) (point-min)))) (vertical-motion -1)) - (condition-case () (backward-char 1) + (condition-case () (backward-char 1) (error (end-of-line))))))))) @@ -1081,7 +1082,7 @@ (let ((p (event-closest-point event))) (and p (min (max p (point-min)) (point-max)))))) extent previous-point) - + (if (not (event-window event)) (error "not over window?")) (setq default-mouse-track-type @@ -1106,7 +1107,7 @@ (if mouse-track-rectangle-p (setq default-mouse-track-extent (list default-mouse-track-extent))) - + (setq previous-point (if (and adjust (markerp default-mouse-track-previous-point) @@ -1307,7 +1308,7 @@ (defun mouse-track-insert-drag-up-hook (event click-count) (setq mouse-track-insert-selected-region (default-mouse-track-return-dragged-selection event))) - + (defun mouse-track-insert (event &optional delete) "Make a selection with the mouse and insert it at point. This is exactly the same as the `mouse-track' command on \\[mouse-track],
--- a/lisp/msw-glyphs.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/msw-glyphs.el Mon Aug 13 10:28:48 2007 +0200 @@ -71,6 +71,9 @@ (set-glyph-image invisible-text-glyph " ...") (cond ((featurep 'xpm) + (set-glyph-image frame-icon-glyph + (concat "../etc/" "xemacs-icon.xpm") + 'global 'mswindows) (set-glyph-image xemacs-logo (concat "../etc/" (if emacs-beta-version
--- a/lisp/objects.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/objects.el Mon Aug 13 10:28:48 2007 +0200 @@ -21,7 +21,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -42,7 +42,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; font specifiers (defun make-font-specifier (spec-list) - "Create a new `font' specifier object with the given specification list. + "Return a new `font' specifier object with the given specification list. SPEC-LIST can be a list of specifications (each of which is a cons of a locale and a list of instantiators), a single instantiator, or a list of instantiators. See `make-specifier' for more information about @@ -123,7 +123,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; color specifiers (defun make-color-specifier (spec-list) - "Create a new `color' specifier object with the given specification list. + "Return a new `color' specifier object with the given specification list. SPEC-LIST can be a list of specifications (each of which is a cons of a locale and a list of instantiators), a single instantiator, or a list of instantiators. See `make-specifier' for a detailed description of
--- a/lisp/obsolete.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/obsolete.el Mon Aug 13 10:28:48 2007 +0200 @@ -20,7 +20,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -54,7 +54,7 @@ (defsubst define-obsolete-variable-alias (oldvar newvar) "Define OLDVAR as an obsolete alias for variable NEWVAR. This makes referencing or setting OLDVAR equivalent to referencing or -setting NEWVAR and marks OLDVAR as obsolete. +setting NEWVAR and marks OLDVAR as obsolete. If OLDVAR was bound and NEWVAR was not, Set NEWVAR to OLDVAR. Note: Use this before any other references (defvar/defcustom) to NEWVAR" @@ -78,7 +78,7 @@ "use the `set-input-mode' function instead.") (defun x-display-color-p (&optional device) - "Returns non-nil if DEVICE is a color device." + "Return t if DEVICE is a color device." (eq 'color (device-class device))) (make-compatible 'x-display-color-p 'device-class) @@ -86,7 +86,7 @@ (make-compatible 'x-display-color-p 'device-class) (defun x-display-grayscale-p (&optional device) - "Returns non-nil if DEVICE is a grayscale device." + "Return t if DEVICE is a grayscale device." (eq 'grayscale (device-class device))) (make-compatible 'x-display-grayscale-p 'device-class) @@ -110,12 +110,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;; extents (defun extent-data (extent) - "Obsolete. Returns the `data' property of the given extent." + "Obsolete. Return the `data' property of EXTENT." (extent-property extent 'data)) (make-obsolete 'set-window-dot 'set-window-point) (defun set-extent-data (extent data) - "Obsolete. Sets the `data' property of the given extent." + "Obsolete. Set the `data' property of EXTENT." (set-extent-property extent 'data data)) (make-obsolete 'set-extent-data 'set-extent-property) @@ -253,7 +253,7 @@ (make-obsolete 'x-create-screen 'make-frame) (defun frame-first-window (frame) - "Returns the topmost, leftmost window of FRAME. + "Return the topmost, leftmost window of FRAME. If omitted, FRAME defaults to the currently selected frame." (frame-highest-window frame 0)) (make-compatible 'frame-first-window 'frame-highest-window) @@ -340,12 +340,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;; keymaps (defun keymap-parent (keymap) - "Returns the first parent of the given keymap." + "Return the first parent of the given keymap." (car (keymap-parents keymap))) (make-compatible 'keymap-parent 'keymap-parents) (defun set-keymap-parent (keymap parent) - "Makes the given keymap have (only) the given parent." + "Make the given keymap have (only) the given parent." (set-keymap-parents keymap (if parent (list parent) '())) parent) (make-compatible 'set-keymap-parent 'set-keymap-parents)
--- a/lisp/packages.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/packages.el Mon Aug 13 10:28:48 2007 +0200 @@ -63,12 +63,18 @@ (defvar early-package-load-path nil "Load path for packages early in the load path.") -(defvar early-packages nil +(defvar late-packages nil "Packages late in the load path.") (defvar late-package-load-path nil "Load path for packages late in the load path.") +(defvar last-packages nil + "Packages last in the load path.") + +(defvar last-package-load-path nil + "Load path for packages last in the load path.") + (defun package-get-key-1 (info key) "Locate keyword `key' in list." (cond ((null info) @@ -307,9 +313,24 @@ (version-mule-directory (and (featurep 'mule) (paths-find-version-directory roots - "mule-packages")))) + "mule-packages"))) + ;; There needs to be a cleverer way of doing this + (site-infodock-directory + (and (featurep 'infodock) + (paths-find-site-directory roots + "infodock-packages"))) + (version-infodock-directory + (and (featurep 'infodock) + (paths-find-version-directory roots + "infodock-packages")))) (append '("~/.xemacs/") '(nil) + (and version-infodock-directory + (null (string-equal version-infodock-directory + site-infodock-directory)) + (list version-infodock-directory)) + (and site-infodock-directory + (list site-infodock-directory)) (and version-mule-directory (null (string-equal version-mule-directory site-mule-directory)) @@ -336,27 +357,33 @@ (defun packages-split-path (path) "Split PATH at NIL, return pair with two components. The second component is shared with PATH." - (let ((reverse-tail '())) - (while (and path (null (null (car path)))) - (setq reverse-tail (cons (car path) reverse-tail)) - (setq path (cdr path))) - (if (null path) - (cons nil (nreverse reverse-tail)) - (cons (nreverse reverse-tail) (cdr path))))) + (let ((reverse-tail '()) + (rest path)) + (while (and rest (null (null (car rest)))) + (setq reverse-tail (cons (car rest) reverse-tail)) + (setq rest (cdr rest))) + (if (null rest) + (cons path nil) + (cons (nreverse reverse-tail) (cdr rest))))) (defun packages-find-packages (package-path &optional inhibit) "Search for all packages in PACKAGE-PATH. -PACKAGE-PATH may distinguish (by NIL-separation) between early -and late packages. +PACKAGE-PATH may distinguish (by NIL-separation) between early, +late and last packages. If INHIBIT is non-NIL, return empty paths. -This returns (CONS EARLY-PACKAGES LATE-PACKAGES)." +This returns (LIST EARLY-PACKAGES LATE-PACKAGES LAST-PACKAGES)." (if inhibit - (cons '() '()) + (list '() '() '()) + ;; When in doubt, it's late (let* ((stuff (packages-split-path package-path)) - (early (car stuff)) - (late (cdr stuff))) - (cons (packages-find-packages-in-directories early) - (packages-find-packages-in-directories late))))) + (early (and (cdr stuff) (car stuff))) + (late+last (or (cdr stuff) (car stuff))) + (stuff (packages-split-path late+last)) + (late (car stuff)) + (last (cdr stuff))) + (list (packages-find-packages-in-directories early) + (packages-find-packages-in-directories late) + (packages-find-packages-in-directories last))))) (defun packages-find-package-library-path (packages suffixes) "Construct a path into a component of the packages hierarchy. @@ -424,7 +451,7 @@ ;; dumped-lisp.el could have set this ... (if package-lisp (mapc #'(lambda (base) - (funcall handle (expand-file-name base dir))) + (funcall handle base)) package-lisp)))))) package-load-path)) @@ -439,8 +466,7 @@ (let ((*files* '())) (packages-handle-package-dumped-lisps #'(lambda (file) - (setq *files* (cons (file-name-nondirectory file) - *files*))) + (setq *files* (cons file *files*))) package-load-path) (reverse *files*)))
--- a/lisp/paths.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/paths.el Mon Aug 13 10:28:48 2007 +0200 @@ -77,7 +77,7 @@ ; ;; set this to your local server ; "The name of the host running an NNTP server. ;If it is a string such as \":DIRECTORY\", then ~/DIRECTORY -;is used as a news spool. `gnus-nntp-server' is initialised from NNTPSERVER +;is used as a news spool. `gnus-nntp-server' is initialized from NNTPSERVER ;environment variable or, if none, this value.") ;(defvar gnus-nntp-service "nntp"
--- a/lisp/register.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/register.el Mon Aug 13 10:28:48 2007 +0200 @@ -49,7 +49,7 @@ (cdr (assq reg register-alist))) (defun set-register (register value) - "Set contents of Emacs register named REGISTER to VALUE. Returns VALUE. + "Set contents of Emacs register named REGISTER to VALUE. Return VALUE. See the documentation of the variable `register-alist' for possible VALUE." (let ((aelt (assq register register-alist))) (if aelt @@ -138,7 +138,7 @@ ;to get the number to store. ;Interactively, NUMBER is the prefix arg (none means nil)." ; (interactive "P\ncNumber to register: ") -; (set-register char +; (set-register char ; (if arg ; (prefix-numeric-value arg) ; (if (looking-at "[0-9][0-9]*") @@ -153,7 +153,7 @@ ;(defun increment-register (arg char) ; "Add NUMBER to the contents of register REGISTER. -;Interactively, NUMBER is the prefix arg (none means nil)." +;Interactively, NUMBER is the prefix arg (none means nil)." ; (interactive "p\ncNumber to register: ") ; (or (integerp (get-register char)) ; (error "Register does not contain a number"))
--- a/lisp/setup-paths.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/setup-paths.el Mon Aug 13 10:28:48 2007 +0200 @@ -51,7 +51,7 @@ configure-lisp-directory)) (defun paths-construct-load-path - (roots early-package-load-path late-package-load-path + (roots early-package-load-path late-package-load-path last-package-load-path &optional inhibit-site-lisp) "Construct the load path." (let* ((envvar-value (getenv "EMACSLOADPATH")) @@ -65,14 +65,16 @@ (paths-find-recursive-load-path (list site-lisp-directory)))) (lisp-directory (paths-find-lisp-directory roots)) (lisp-load-path - (paths-find-recursive-load-path (list lisp-directory)))) + (and lisp-directory + (paths-find-recursive-load-path (list lisp-directory))))) (append env-load-path early-package-load-path site-lisp-load-path late-package-load-path - lisp-load-path))) + lisp-load-path + last-package-load-path))) -(defun paths-construct-info-path (roots early-packages late-packages) +(defun paths-construct-info-path (roots early-packages late-packages last-packages) "Construct the info path." (append (packages-find-package-info-path early-packages) @@ -83,6 +85,7 @@ configure-info-directory))) (and info-directory (list info-directory))) + (packages-find-package-info-path last-packages) (let ((info-path-envval (getenv "INFOPATH"))) (if info-path-envval (decode-path-internal info-path-envval) @@ -111,7 +114,8 @@ "Find the binary directory." (paths-find-architecture-directory roots "lib-src")) -(defun paths-construct-exec-path (roots exec-directory early-packages late-packages) +(defun paths-construct-exec-path (roots exec-directory + early-packages late-packages last-packages) "Find the binary path." (append (let ((path-envval (getenv "PATH"))) @@ -119,6 +123,7 @@ (decode-path-internal path-envval))) (packages-find-package-exec-path early-packages) (packages-find-package-exec-path late-packages) + (packages-find-package-exec-path last-packages) (let ((emacspath-envval (getenv "EMACSPATH"))) (if emacspath-envval (decode-path-internal emacspath-envval) @@ -130,11 +135,13 @@ "Find the data directory." (paths-find-version-directory roots "etc" "EMACSDATA" configure-data-directory)) -(defun paths-construct-data-directory-list (data-directory early-packages late-packages) +(defun paths-construct-data-directory-list (data-directory + early-packages late-packages last-packages) "Find the data path." (append (packages-find-package-data-path early-packages) (packages-find-package-data-path late-packages) + (packages-find-package-data-path last-packages) (list data-directory))) ;;; setup-paths.el ends here
--- a/lisp/simple.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/simple.el Mon Aug 13 10:28:48 2007 +0200 @@ -34,7 +34,7 @@ ;; Changes for zmacs-style active-regions: ;; -;; beginning-of-buffer, end-of-buffer, count-lines-region, +;; beginning-of-buffer, end-of-buffer, count-lines-region, ;; count-lines-buffer, what-line, what-cursor-position, set-goal-column, ;; set-fill-column, prefix-arg-internal, and line-move (which is used by ;; next-line and previous-line) set zmacs-region-stays to t, so that they @@ -43,12 +43,12 @@ ;; mark-whole-buffer, mark-word, exchange-point-and-mark, and ;; set-mark-command (without an argument) call zmacs-activate-region. ;; -;; mark takes an optional arg like the new Fmark_marker() does. When +;; mark takes an optional arg like the new Fmark_marker() does. When ;; the region is not active, mark returns nil unless the optional arg is true. ;; ;; push-mark, pop-mark, exchange-point-and-mark, and set-marker, and ;; set-mark-command use (mark t) so that they can access the mark whether -;; the region is active or not. +;; the region is active or not. ;; ;; shell-command, shell-command-on-region, yank, and yank-pop (which all ;; push a mark) have been altered to call exchange-point-and-mark with an @@ -106,7 +106,7 @@ ;; result is the same. So, if we're at beginning of line, pretend to be at ;; the end of the previous line. ;; #### Does this have any relevance in XEmacs? - (let ((flag (and (not (bobp)) + (let ((flag (and (not (bobp)) (bolp) ;; Make sure the newline before point isn't intangible. (not (get-char-property (1- (point)) 'intangible)) @@ -119,7 +119,7 @@ (not (get-char-property (1- (point)) 'end-open)) ;; Make sure the newline before point has the same ;; properties as the char before it (if any). - (< (or (previous-extent-change (point)) -2) + (< (or (previous-extent-change (point)) -2) (- (point) 2)))) (was-page-start (and (bolp) (looking-at page-delimiter))) @@ -1047,7 +1047,7 @@ (defcustom kill-hooks nil "*Functions run when something is added to the XEmacs kill ring. These functions are called with one argument, the string most recently -cut or copied. You can use this to, for example, make the most recent +cut or copied. You can use this to, for example, make the most recent kill become the X Clipboard selection." :type 'hook :group 'killing) @@ -1144,7 +1144,7 @@ If N is zero, `interprogram-paste-function' is set, and calling it returns a string, then that string is added to the front of the kill ring and returned as the latest kill. -If optional arg DO-NOT-MOVE is non-nil, then don't actually move the +If optional arg DO-NOT-MOVE is non-nil, then don't actually move the yanking point\; just return the Nth kill forward." (let ((interprogram-paste (and (= n 0) interprogram-paste-function @@ -1396,7 +1396,7 @@ (list (progn (barf-if-buffer-read-only) - (read-buffer "Insert buffer: " + (read-buffer "Insert buffer: " ;; XEmacs: we have different args (other-buffer (current-buffer) nil t) t)))) @@ -2170,10 +2170,10 @@ (defconst comment-indent-function ;; XEmacs - add at least one space after the end of the text on the - ;; current line... + ;; current line... (lambda () - (save-excursion - (beginning-of-line) + (save-excursion + (beginning-of-line) (let ((eol (save-excursion (end-of-line) (point)))) (and comment-start-skip (re-search-forward comment-start-skip eol t) @@ -2238,7 +2238,7 @@ (delete-region (point) begpos) (indent-to indent)) ;; An existing comment? - (if cpos + (if cpos (progn (goto-char cpos) (set-marker cpos nil)) ;; No, insert one. @@ -2594,7 +2594,7 @@ ; (null (setq fc (current-fill-column))) ; (and (eq justify 'left) ; (<= (current-column) fc)) -; (save-excursion (beginning-of-line) +; (save-excursion (beginning-of-line) ; ;; (setq bol (point)) ; (and auto-fill-inhibit-regexp ; (looking-at auto-fill-inhibit-regexp)))) @@ -2665,7 +2665,7 @@ ; (funcall comment-line-break-function t))) ; ;; Now do justification, if required ; (if (not (eq justify 'left)) -; (save-excursion +; (save-excursion ; (end-of-line 0) ; (justify-current-line justify nil t))) ; ;; If making the new line didn't reduce the hpos of @@ -2742,7 +2742,7 @@ If a fill column is specified, it overrides the use of the comment column or comment indentation. -The inserted newline is marked hard if `use-hard-newlines' is true, +The inserted newline is marked hard if `use-hard-newlines' is true, unless optional argument SOFT is non-nil." (interactive) (let (comcol comstart) @@ -2761,7 +2761,7 @@ ;; #### - Eric Eide reverts to v18 semantics for this function in ;; fa-extras, which I'm not gonna do. His changes are to (1) execute ;; the save-excursion below unconditionally, and (2) uncomment the check - ;; for (not comment-multi-line) further below. --Stig + ;; for (not comment-multi-line) further below. --Stig ;;### jhod: probably need to fix this for kinsoku processing (if (not comment-multi-line) (save-excursion @@ -2840,8 +2840,8 @@ ;; XEmacs (defun nuke-selective-display () "Ensure that the buffer is not in selective-display mode. -If `selective-display' is t, then restore the buffer text to it's original -state before disabling selective display." +If `selective-display' is t, then restore the buffer text to its original +state before disabling selective display." ;; by Stig@hackvan.com (interactive) (and (eq t selective-display) @@ -3221,7 +3221,7 @@ (interactive (let* ((var (read-variable "Set variable: ")) ;; #### - yucky code replication here. This should use something - ;; from help.el or hyper-apropos.el + ;; from help.el or hyper-apropos.el (minibuffer-help-form '(funcall myhelp)) (myhelp @@ -3248,7 +3248,7 @@ (list 'interactive prop) 'arg)) (eval-minibuffer (format "Set %s to value: " var))))))) - (if (specifierp (symbol-value var)) + (if (and (boundp var) (specifierp (symbol-value var))) (set-specifier (symbol-value var) val) (set var val))) @@ -3262,7 +3262,7 @@ ;; XEmacs (defsubst region-exists-p () - "Non-nil iff the region exists. + "Return t if the region exists. If active regions are in use (i.e. `zmacs-regions' is true), this means that the region is active. Otherwise, this means that the user has pushed a mark in this buffer at some point in the past. @@ -3272,7 +3272,7 @@ ;; XEmacs (defun region-active-p () - "Non-nil iff the region is active. + "Return non-nil if the region is active. If `zmacs-regions' is true, this is equivalent to `region-exists-p'. Otherwise, this function always returns false." (and zmacs-regions zmacs-region-extent)) @@ -3497,7 +3497,7 @@ (defvar message-stack nil "An alist of label/string pairs representing active echo-area messages. The first element in the list is currently displayed in the echo area. -Do not modify this directly--use the `message' or +Do not modify this directly--use the `message' or `display-message'/`clear-message' functions.") (defvar remove-message-hook 'log-message @@ -3551,15 +3551,15 @@ ;; "^Parsed [0-9]+ of [0-9]+ ([0-9]+%)" ) "List of regular expressions matching messages which shouldn't be logged. -See `log-message'. +See `log-message'. Ideally, packages which generate messages which might need to be ignored -should label them with 'progress, 'prompt, or 'no-log, so they can be +should label them with 'progress, 'prompt, or 'no-log, so they can be filtered by the log-message-ignore-labels." :type '(repeat regexp) :group 'log-message) -(defcustom log-message-ignore-labels +(defcustom log-message-ignore-labels '(help-echo command progress prompt no-log garbage-collecting auto-saving) "List of symbols indicating labels of messages which shouldn't be logged. See `display-message' for some common labels. See also `log-message'." @@ -3574,7 +3574,7 @@ (pop-to-buffer (get-buffer-create " *Message-Log*"))) (defvar log-message-filter-function 'log-message-filter - "Value must be a function of two arguments: a symbol (label) and + "Value must be a function of two arguments: a symbol (label) and a string (message). It should return non-nil to indicate a message should be logged. Possible values include 'log-message-filter and 'log-message-filter-errors-only.") @@ -3738,7 +3738,7 @@ (append-message label message frame stdout-p)) (defun current-message (&optional frame) - "Returns the current message in the echo area, or nil. + "Return the current message in the echo area, or nil. The FRAME argument is currently unused." (cdr (car message-stack)))
--- a/lisp/sound.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/sound.el Mon Aug 13 10:28:48 2007 +0200 @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -31,7 +31,7 @@ (defgroup sound nil "Configure XEmacs sounds and properties" :group 'environment) - + (defcustom sound-default-alist '((default :sound bass) (undefined-key :sound drum) @@ -48,7 +48,7 @@ (no-completion :sound whip) (isearch-failed :sound quiet) (isearch-quit :sound bass) - ;; QUIT: sound generated by ^G and it's variants. + ;; QUIT: sound generated by ^G and its variants. (quit :sound quiet :volume 75) ;; READY: time-consuming task has completed... compile, ;; cvs-update, etc. @@ -82,7 +82,7 @@ (const :format "" :value :duration) (integer :tag "Duration")))))) -(defcustom sound-load-alist +(defcustom sound-load-alist '((load-sound-file "drum-beep.au" 'drum) (load-sound-file "quiet-beep.au" 'quiet) (load-sound-file "bass-snap.au" 'bass 80) @@ -91,10 +91,10 @@ (load-sound-file "yeep.au" 'yeep) (load-sound-file "hype.au" 'hype 100) ) - "A list of calls to load-sound-file to be processed by load-default-sounds. + "A list of calls to load-sound-file to be processed by load-default-sounds. Reference load-sound-file for more information." - + :group 'sound :type '(repeat (sexp :tag "Sound") )) @@ -107,7 +107,7 @@ ) (defcustom sound-ext "" - "Filename extensions to complete sound file name with. If more than one + "Filename extensions to complete sound file name with. If more than one extension is used, they should be separated by \":\". " :group 'sound :type 'string) @@ -174,7 +174,7 @@ console of a machine with native sound support or running a NetAudio server and XEmacs has the necessary sound support compiled in." (interactive) - ;; #### - this should do NOTHING if the sounds can't be played. + ;; #### - this should do NOTHING if the sounds can't be played. (message "Loading sounds...") (setq sound-alist nil) ;; this is where the calls to load-sound-file get done
--- a/lisp/startup.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/startup.el Mon Aug 13 10:28:48 2007 +0200 @@ -374,15 +374,18 @@ (let ((roots (paths-find-emacs-roots invocation-directory invocation-name))) - (startup-setup-paths roots - inhibit-package-init - inhibit-site-lisp) + (if (null roots) + (startup-find-roots-warning) + (startup-setup-paths roots + inhibit-package-init + inhibit-site-lisp)) (startup-setup-paths-warning)) (if (not inhibit-package-init) (progn - (packages-load-package-auto-autoloads early-package-load-path) - (packages-load-package-auto-autoloads late-package-load-path))) + (packages-load-package-auto-autoloads last-package-load-path) + (packages-load-package-auto-autoloads late-package-load-path) + (packages-load-package-auto-autoloads early-package-load-path))) (unwind-protect (command-line) @@ -1015,20 +1018,25 @@ (setq package-path (packages-find-package-path roots)) - (let ((stuff (packages-find-packages package-path inhibit-packages))) - (setq early-packages (car stuff)) - (setq late-packages (cdr stuff))) + (apply #'(lambda (early late last) + (setq early-packages early) + (setq late-packages late) + (setq last-packages last)) + (packages-find-packages package-path inhibit-packages)) (setq early-package-load-path (packages-find-package-load-path early-packages)) (setq late-package-load-path (packages-find-package-load-path late-packages)) + (setq last-package-load-path (packages-find-package-load-path last-packages)) (setq load-path (paths-construct-load-path roots early-package-load-path late-package-load-path + last-package-load-path inhibit-site-lisp)) (setq Info-directory-list - (paths-construct-info-path roots early-packages late-packages)) + (paths-construct-info-path roots + early-packages late-packages last-packages)) (if (boundp 'lock-directory) (progn @@ -1037,16 +1045,33 @@ (setq exec-directory (paths-find-exec-directory roots)) - (setq exec-path (paths-construct-exec-path roots exec-directory - early-packages late-packages)) - + (setq exec-path + (paths-construct-exec-path roots exec-directory + early-packages late-packages last-packages)) + (setq doc-directory (paths-find-doc-directory roots)) (setq data-directory (paths-find-data-directory roots)) (setq data-directory-list (paths-construct-data-directory-list data-directory early-packages - late-packages))) + late-packages + last-packages))) + +(defun startup-find-roots-warning () + (save-excursion + (set-buffer (get-buffer-create " *warning-tmp*")) + (erase-buffer) + (buffer-disable-undo (current-buffer)) + + (insert "Couldn't find an obvious default for the root of the " + "XEmacs hierarchy.") + + (let ((fill-column 76)) + (fill-region (point-min) (point-max))) + + (princ "\nWARNING:\n" 'external-debugging-output) + (princ (buffer-string) 'external-debugging-output))) (defun startup-setup-paths-warning () (let ((lock (if (boundp 'lock-directory) lock-directory 't)) @@ -1076,11 +1101,9 @@ invocation-name) " is in a strange place?") - (if (fboundp 'fill-region) - ;; Might not be bound in the cold load environment... - (let ((fill-column 76)) - (fill-region (point-min) (point-max)))) - (goto-char (point-min)) + (let ((fill-column 76)) + (fill-region (point-min) (point-max))) + (princ "\nWARNING:\n" 'external-debugging-output) (princ (buffer-string) 'external-debugging-output) (erase-buffer)
--- a/lisp/subr.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/subr.el Mon Aug 13 10:28:48 2007 +0200 @@ -75,27 +75,13 @@ ;;;; Keymap support. ;; XEmacs: removed to keymap.el -;;;; The global keymap tree. +;;;; The global keymap tree. ;;; global-map, esc-map, and ctl-x-map have their values set up in ;;; keymap.c; we just give them docstrings here. ;;;; Event manipulation functions. -;; The call to `read' is to ensure that the value is computed at load time -;; and not compiled into the .elc file. The value is negative on most -;; machines, but not on all! -(defconst listify-key-sequence-1 (logior 128 (read "?\\M-\\^@"))) - -(defun listify-key-sequence (key) - "Convert a key sequence to a list of events." - (if (vectorp key) - (append key nil) - (mapcar (function (lambda (c) - (if (> c 127) - (logxor c listify-key-sequence-1) - c))) - (append key nil)))) ;; XEmacs: This stuff is done in C Code. ;;;; Obsolescent names for functions. @@ -172,7 +158,7 @@ (or (if (consp function) (member function (symbol-value hook)) (memq function (symbol-value hook))) - (set hook + (set hook (if append (append (symbol-value hook) (list function)) (cons function (symbol-value hook))))) @@ -181,7 +167,7 @@ (or (if (consp function) (member function (default-value hook)) (memq function (default-value hook))) - (set-default hook + (set-default hook (if append (append (default-value hook) (list function)) (cons function (default-value hook))))))) @@ -260,7 +246,7 @@ ;; XEmacs (defun replace-in-string (str regexp newtext &optional literal) - "Replaces all matches in STR for REGEXP with NEWTEXT string, + "Replace all matches in STR for REGEXP with NEWTEXT string, and returns the new string. Optional LITERAL non-nil means do a literal replacement. Otherwise treat \\ in NEWTEXT string as special: @@ -389,7 +375,7 @@ (erase-buffer tempbuf))))) (defun insert-face (string face) - "Insert STRING and highlight with FACE. Returns the extent created." + "Insert STRING and highlight with FACE. Return the extent created." (let ((p (point)) ext) (insert string) (setq ext (make-extent p (point))) @@ -592,7 +578,7 @@ (defun function-interactive (function) - "Returns the interactive specification of FUNCTION. + "Return the interactive specification of FUNCTION. FUNCTION can be any funcallable object. The specification will be returned as the list of the symbol `interactive' and the specs.
--- a/lisp/text-props.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/text-props.el Mon Aug 13 10:28:48 2007 +0200 @@ -59,7 +59,7 @@ ;; partition a buffer (that is, change some attribute of a range from one ;; value to another without disturbing the properties outside of that range) ;; then an interface that deals with properties of characters may be most -;; natural. +;; natural. ;; Another way of thinking of it is, do you care where the endpoints of the ;; region are? If you do, then you should use extents. If it's ok for the @@ -200,10 +200,10 @@ props)) (defun extent-properties-at (position &optional object) - "Returns the properties of the character at the given position -in OBJECT (a string or buffer) by merging the properties of overlapping -extents. The returned value is a property list, some of which may be -shared with other structures. You must not modify it. + "Return the properties of the character at the given position in OBJECT. +OBJECT is either a string or a buffer. The properties of overlapping +extents are merged. The returned value is a property list, some of +which may be shared with other structures. You must not modify it. If POSITION is at the end of OBJECT, the value is nil. @@ -212,10 +212,10 @@ (extent-properties-at-1 position object nil)) (defun text-properties-at (position &optional object) - "Returns the properties of the character at the given position -in OBJECT (a string or buffer) by merging the properties of overlapping -extents. The returned value is a property list, some of which may be -shared with other structures. You must not modify it. + "Return the properties of the character at the given position in OBJECT. +OBJECT is either a string or a buffer. The properties of overlapping +extents are merged. The returned value is a property list, some of +which may be shared with other structures. You must not modify it. If POSITION is at the end of OBJECT, the value is nil.
--- a/lisp/toolbar.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/toolbar.el Mon Aug 13 10:28:48 2007 +0200 @@ -18,7 +18,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -37,7 +37,7 @@ "Location of standard toolbar icon bitmaps.") (defun toolbar-make-button-list (up &optional down disabled cap-up cap-down cap-disabled) - "Calls make-glyph on each arg and returns a list of the results." + "Call make-glyph on each arg and return a list of the results." (if (featurep 'x) (let ((up-glyph (make-glyph up)) (down-glyph (and down (make-glyph down)))
--- a/lisp/update-elc.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/update-elc.el Mon Aug 13 10:28:48 2007 +0200 @@ -92,8 +92,6 @@ (let (preloaded-file-list site-load-packages) (load (concat default-directory "../lisp/dumped-lisp.el")) - (print (format "%S" package-path)) - ;; Path setup (let ((package-preloaded-file-list (packages-collect-package-dumped-lisps late-package-load-path))) @@ -120,6 +118,9 @@ (progn (print (format "Error: Library file %s not found" (car preloaded-file-list))) + ;; Uncomment in case of trouble + ;;(print (format "late-packages: %S" late-packages)) + ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) (kill-emacs))) (if (string-match "\\.elc?\\'" arg) (setq arg (substring arg 0 (match-beginning 0))))
--- a/lisp/window-xemacs.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/window-xemacs.el Mon Aug 13 10:28:48 2007 +0200 @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -46,7 +46,7 @@ (other-window (- arg) all-frames device)) (defun windows-of-buffer (&optional buffer) - "Returns a list of windows that have BUFFER in them. + "Return a list of windows that have BUFFER in them. If BUFFER is not specified, the current buffer will be used." (or (bufferp buffer) (if (stringp buffer) @@ -54,7 +54,7 @@ (get-file-buffer buffer))) (setq buffer (current-buffer)))) (let* ((firstwin (next-window nil nil t)) - (wind firstwin) + (wind firstwin) (done nil) window-list) (while (not done) @@ -75,7 +75,7 @@ (defun window-list (&optional frame minibuf window) "Return a list of windows on FRAME, beginning with WINDOW. -FRAME and WINDOW default to the selected ones. +FRAME and WINDOW default to the selected ones. Optional second arg MINIBUF t means count the minibuffer window even if not active. If MINIBUF is neither t nor nil it means not to count the minibuffer even if it is active." @@ -419,7 +419,7 @@ ;; so it's a fine candidate for display. (if (not (eq old-frame target-frame)) (setq not-this-window-p nil)) - + ;; if it's in the selected window, and that's ok, then we're done. (if (and (not not-this-window-p) (eq buffer (window-buffer (selected-window)))) @@ -427,16 +427,16 @@ ;; See if the user has specified this buffer should appear ;; in the selected window. - + (if not-this-window-p nil - + (if (or (member (buffer-name buffer) same-window-buffer-names) (assoc (buffer-name buffer) same-window-buffer-names)) (progn (switch-to-buffer buffer) (throw 'done (display-buffer-1 (selected-window))))) - + (let ((tem same-window-regexps)) (while tem (let ((car (car tem))) @@ -450,14 +450,14 @@ (throw 'done (display-buffer-1 (selected-window)))))) (setq tem (cdr tem))))) - + ;; If pop-up-frames, look for a window showing BUFFER on ;; any visible or iconified frame. Otherwise search only ;; the current frame. (if (and (not explicit-frame) (or pop-up-frames (not (last-nonminibuf-frame)))) (setq target-frame 0)) - + ;; Otherwise, find some window that it's already in, and ;; return that, unless that window is the selected window ;; and that isn't ok. What a contorted mess! @@ -566,7 +566,7 @@ ;; If the LRU window is selected, and big enough, ;; and can be split, split it. (if (and window - (not (frame-property (window-frame window) + (not (frame-property (window-frame window) 'unsplittable)) (or (eq window (selected-window)) (not (window-parent window)))
--- a/lisp/window.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/window.el Mon Aug 13 10:28:48 2007 +0200 @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -34,13 +34,13 @@ ;;;; Window tree functions. (defun one-window-p (&optional nomini all-frames device) - "Returns non-nil if the selected window is the only window (in its frame). + "Return non-nil if the selected window is the only window (in its frame). Optional arg NOMINI non-nil means don't count the minibuffer even if it is active. The optional arg ALL-FRAMES t means count windows on all frames. If it is `visible', count windows on all visible frames. -ALL-FRAMES nil or omitted means count only the selected frame, +ALL-FRAMES nil or omitted means count only the selected frame, plus the minibuffer it uses (which may be on another frame). ALL-FRAMES = 0 means count windows on all visible and iconified frames. If ALL-FRAMES is any other value, count only the selected frame. @@ -87,7 +87,7 @@ ;; If we start from the minibuffer window, don't fail to come back to it. (if (window-minibuffer-p (selected-window)) (setq minibuf t)) - ;; Note that, like next-window & previous-window, this behaves a little + ;; Note that, like next-window & previous-window, this behaves a little ;; strangely if the selected window is on an invisible frame: it hits ;; some of the windows on that frame, and all windows on visible frames. (let* ((walk-windows-start (selected-window)) @@ -129,7 +129,7 @@ (list 'select-window 'save-selected-window-window))))) (defun count-windows (&optional minibuf) - "Returns the number of visible windows. + "Return the number of visible windows. Optional arg MINIBUF non-nil means count the minibuffer even if it is inactive." (let ((count 0)) @@ -139,7 +139,7 @@ count)) (defun balance-windows () - "Makes all visible windows the same height (approximately)." + "Make all visible windows the same height (approximately)." (interactive) (let ((count -1) levels newsizes size) ;FSFmacs
--- a/lisp/x-faces.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/x-faces.el Mon Aug 13 10:28:48 2007 +0200 @@ -20,7 +20,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -46,7 +46,7 @@ ;; Emacs.bold.attributeUnderline: true/false ;; Emacs.bold.attributeStrikethru: true/false -;; You can specify the properties of a face on a per-frame basis. For +;; You can specify the properties of a face on a per-frame basis. For ;; example, to have the "isearch" face use a red foreground on frames ;; named "emacs" (the default) but use a blue foreground on frames that ;; you create named "debugger", you could do @@ -101,7 +101,7 @@ (encoding "[^-]+") ; false! ) (setq x-font-regexp - (purecopy + (purecopy (concat "\\`\\*?[-?*]" foundry - family - weight\? - slant\? - swidth - adstyle - pixelsize - pointsize - resx - resy - spacing - avgwidth - @@ -340,14 +340,14 @@ (nth 2 result)))))) (defun x-find-smaller-font (font &optional device) - "Loads a new, slightly smaller version of the given font (or font name). + "Load a new, slightly smaller version of the given font (or font name). Returns the font if it succeeds, nil otherwise. If scalable fonts are available, this returns a font which is 1 point smaller. Otherwise, it returns the next smaller version of this font that is defined." (x-frob-font-size font nil device)) (defun x-find-larger-font (font &optional device) - "Loads a new, slightly larger version of the given font (or font name). + "Load a new, slightly larger version of the given font (or font name). Returns the font if it succeeds, nil otherwise. If scalable fonts are available, this returns a font which is 1 point larger. Otherwise, it returns the next larger version of this font that is defined." @@ -561,7 +561,7 @@ face 'underline) locale tty-tag-set) - (remove-specifier (face-propery face 'underline) locale + (remove-specifier (face-property face 'underline) locale tty-tag-set nil)) (set-face-underline-p face ulp locale nil append)) (when stp @@ -570,7 +570,7 @@ face 'strikethru) locale tty-tag-set) - (remove-specifier (face-propery face 'strikethru) + (remove-specifier (face-property face 'strikethru) locale tty-tag-set nil)) (set-face-strikethru-p face stp locale nil append)) (when hp @@ -579,7 +579,7 @@ face 'highlight) locale tty-tag-set) - (remove-specifier (face-propery face 'highlight) + (remove-specifier (face-property face 'highlight) locale tty-tag-set nil)) (set-face-highlight-p face hp locale nil append)) (when dp @@ -596,7 +596,7 @@ face 'blinking) locale tty-tag-set) - (remove-specifier (face-propery face 'blinking) locale + (remove-specifier (face-property face 'blinking) locale tty-tag-set nil)) (set-face-blinking-p face bp locale nil append)) (when rp @@ -702,7 +702,7 @@ (set-face-font 'default new-x-font device)))) ;; ;; If the "default" face didn't have both colors specified, then pick - ;; some, taking into account whether one of the colors was specified. + ;; some, taking into account whether one of the colors was specified. ;; (let ((fg (face-foreground-instance 'default device)) (bg (face-background-instance 'default device))) @@ -727,7 +727,7 @@ (x-init-pointer-shape device) ; from x-mouse.el ) -;;; This is called from `init-frame-faces', which is called from +;;; This is called from `init-frame-faces', which is called from ;;; init_frame_faces() which is called from Fmake_frame(), to perform ;;; any device-specific initialization. ;;;
--- a/lisp/x-menubar.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/x-menubar.el Mon Aug 13 10:28:48 2007 +0200 @@ -22,7 +22,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with Xmacs; see the file COPYING. If not, write to the +;; along with Xmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -86,7 +86,7 @@ "-----" ["Exit XEmacs" save-buffers-kill-emacs] ) - + ("Edit" ["Undo" advertised-undo :active (and (not (eq buffer-undo-list t)) @@ -140,7 +140,7 @@ "----" ["Show Message Log" show-message-log] ) - + ,@(if (featurep 'mule) '(("Mule" ("Describe language support") @@ -168,7 +168,7 @@ ;; not implemented yet ["Show diagnosis for MULE" mule-diag :active nil] ["Show many languages" view-hello-file]))) - + ("Apps" ["Read Mail (VM)..." vm :active (fboundp 'vm)] @@ -200,7 +200,7 @@ :active (fboundp 'phases-of-moon)] ["Sunrise/Sunset" sunrise-sunset :active (fboundp 'sunrise-sunset)]) - + ("Games" ["Mine Game" xmine :active (fboundp 'xmine)] @@ -418,7 +418,7 @@ ) "-----" - ("Syntax Highlighting" + ("Syntax Highlighting" ["In This Buffer" (font-lock-mode) :style toggle :selected (and (boundp 'font-lock-mode) font-lock-mode) :active (fboundp 'font-lock-mode)] @@ -444,7 +444,7 @@ :active (fboundp 'font-lock-mode)] ["Colors" (progn (require 'font-lock) (font-lock-use-default-colors) - (setq font-lock-use-colors t + (setq font-lock-use-colors t font-lock-use-fonts nil) (font-lock-mode 1)) :style radio @@ -743,13 +743,13 @@ "-----" ["Save Options" save-options-menu-settings] ) - + ("Buffers" :filter buffers-menu-filter ["List All Buffers" list-buffers] "--" ) - + ("Tools" ["Grep..." grep :active (fboundp 'grep)] @@ -798,15 +798,15 @@ (while lang (and (setq tut (assq 'tutorial (car lang))) (not (string= (caar lang) "ASCII")) - (setq - submenu - (cons + (setq + submenu + (cons `[,(caar lang) (help-with-tutorial nil ,(cdr tut))] submenu))) (setq lang (cdr lang))) - (append `("Tutorials" + (append `("Tutorials" :filter tutorials-menu-filter - ["Default" help-with-tutorial t + ["Default" help-with-tutorial t ,(concat "(" current-language-environment ")")]) submenu)) ;; Non mule tutorials. @@ -814,8 +814,8 @@ submenu) (while lang (setq submenu - (cons - `[,(caar lang) + (cons + `[,(caar lang) (help-with-tutorial ,(format "TUTORIAL.%s" (cadr (car lang))))] submenu)) @@ -875,12 +875,12 @@ ;; by Stig@hackvan.com (cond (init-file-user nil) - ((file-exists-p (cond + ((file-exists-p (cond ((eq system-type 'ms-dos) (concat "~" (user-login-name) "/_emacs")) - ((eq system-type 'vax-vms) + ((eq system-type 'vax-vms) "sys$login:.emacs") - (t + (t (concat "~" (user-login-name) "/.emacs")))) (add-menu-button nil ["Load .emacs" @@ -1341,7 +1341,7 @@ ;; Now save all faces. - ;; Setting this in lisp conflicts with X resources. Bad move. --Stig + ;; Setting this in lisp conflicts with X resources. Bad move. --Stig ;; (list 'set-face-font ''default (face-font-name 'default)) ;; (list 'set-face-font ''modeline (face-font-name 'modeline)) (if options-save-faces @@ -1379,8 +1379,7 @@ options listed in the Options menu.") (defun save-options-non-customized-face-list () - "This function will return a list of all faces that have not been -'customized'." + "Return a list of all faces that have not been 'customized'." (delq nil (mapcar '(lambda (face) (unless (get face 'saved-face) face)) @@ -1415,7 +1414,7 @@ .emacs file.") (defun save-options-menu-settings () - "Saves the current settings of the `Options' menu to your `.emacs' file." + "Save the current settings of the `Options' menu to your `.emacs' file." (interactive) ;; we compute the actual filenames now because x-menubar is loaded ;; at dump time, when the identity of the user running XEmacs is not known. @@ -1541,13 +1540,13 @@ ;; appear first as the default one. Otherwise, use the english one. (let* ((menu menu-items) (item (pop menu-items))) - (aset - item 3 - (concat "(" - (if (assoc - 'tutorial + (aset + item 3 + (concat "(" + (if (assoc + 'tutorial (assoc current-language-environment language-info-alist)) - current-language-environment + current-language-environment "English") ")")) menu))) @@ -1636,7 +1635,7 @@ global-popup-menu (error "No menu here.")))))) -(defun popup-buffer-menu (event) +(defun popup-buffer-menu (event) "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked." (interactive "e") (let ((window (and (event-over-text-area-p event) (event-window event))) @@ -1652,7 +1651,7 @@ (error "Can't find the Buffers menu")) (popup-menu bmenu))) -(defun popup-menubar-menu (event) +(defun popup-menubar-menu (event) "Pop up a copy of menu that also appears in the menubar" ;; by Stig@hackvan.com (interactive "e")
--- a/lisp/x-mouse.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/x-mouse.el Mon Aug 13 10:28:48 2007 +0200 @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -135,8 +135,7 @@ (defvar x-pointers-initialized nil) (defun x-init-pointer-shape (device) - "Initializes the mouse-pointers of the given device from the resource -database." + "Initialize the mouse-pointers of DEVICE from the X resource database." (if x-pointers-initialized ; only do it when the first device is created nil (set-glyph-image text-pointer-glyph
--- a/lisp/x-select.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/x-select.el Mon Aug 13 10:28:48 2007 +0200 @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -45,7 +45,7 @@ (defun x-get-selection (&optional type data-type) "Return the value of an X Windows selection. -The argument TYPE (default `PRIMARY') says which selection, +The argument TYPE (default `PRIMARY') says which selection, and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) says how to convert the data." (or type (setq type 'PRIMARY)) @@ -149,12 +149,12 @@ ;; arguments (duh ...). This order is more logical. (defun x-own-selection (data &optional type) "Make an X Windows selection of type TYPE and value DATA. -The argument TYPE (default `PRIMARY') says which selection, +The argument TYPE (default `PRIMARY') says which selection, and DATA specifies the contents. DATA may be a string, a symbol, an integer (or a cons of two integers or list of two integers). The selection may also be a cons of two markers pointing to the same buffer, -or an overlay. In these cases, the selection is considered to be the text +or an overlay. In these cases, the selection is considered to be the text between the markers *at whatever time the selection is examined*. Thus, editing done in the buffer after you specify the selection can alter the effective value of the selection. @@ -215,7 +215,7 @@ (buffer-live-p (marker-buffer (cdr data)))))) (defun x-own-secondary-selection (selection &optional type) - "Make a secondary X Selection of the given argument. The argument may be a + "Make a secondary X Selection of the given argument. The argument may be a string or a cons of two markers (in which case the selection is considered to be the text between those markers)." (interactive (if (not current-prefix-arg) @@ -275,7 +275,7 @@ ;;; Selections in killed buffers -;;; this function is called by kill-buffer as if it were on the +;;; this function is called by kill-buffer as if it were on the ;;; kill-buffer-hook (though it isn't really). (defun xselect-kill-buffer-hook () @@ -308,9 +308,9 @@ ;;; FSF name x-get-cut-buffer (defun x-get-cutbuffer (&optional which-one) - "Returns the value of one of the 8 X server cut buffers. Optional arg -WHICH-ONE should be a number from 0 to 7, defaulting to 0. -Cut buffers are considered obsolete\; you should use selections instead. + "Return the value of one of the 8 X server cut buffers. +Optional arg WHICH-ONE should be a number from 0 to 7, defaulting to 0. +Cut buffers are considered obsolete; you should use selections instead. This function does nothing if support for cut buffers was not compiled into Emacs." (and (fboundp 'x-get-cutbuffer-internal)
--- a/lisp/x-win-sun.el Mon Aug 13 10:27:41 2007 +0200 +++ b/lisp/x-win-sun.el Mon Aug 13 10:28:48 2007 +0200 @@ -17,7 +17,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA.
--- a/lwlib/Makefile.in.in Mon Aug 13 10:27:41 2007 +0200 +++ b/lwlib/Makefile.in.in Mon Aug 13 10:28:48 2007 +0200 @@ -23,7 +23,7 @@ ## For performance and consistency, no built-in rules .SUFFIXES: -.SUFFIXES: .c .o .i .h +.SUFFIXES: .c .h .o .i .s srcdir=@srcdir@ @@ -35,7 +35,6 @@ CC=@CC@ CPP=@CPP@ CFLAGS=@CFLAGS@ -LDFLAGS=@LDFLAGS@ CPPFLAGS=@CPPFLAGS@ RANLIB=@RANLIB@ @@ -53,20 +52,11 @@ all: liblw.a -c_switch_general=@c_switch_general@ -c_switch_window_system=@c_switch_window_system@ c_switch_all=@c_switch_all@ -ld_switch_general=@ld_switch_general@ -ld_switch_window_system=@ld_switch_window_system@ -ld_switch_all=@ld_switch_all@ -ld_libs_general=@ld_libs_general@ -ld_libs_window_system=@ld_libs_window_system@ -ld_libs_all=@ld_libs_all@ -cppflags = $(CPPFLAGS) -I. $(c_switch_all) +cppflags = $(CPPFLAGS) -I. $(c_switch_all) cflags = $(CFLAGS) $(cppflags) -ALL_CFLAGS= $(CFLAGS) $(CPPFLAGS) -I. $(c_switch_all) #ifdef SOLARIS2 %.o : %.c #else @@ -76,7 +66,15 @@ ## Create preprocessor output (debugging purposes only) .c.i: +#ifdef __GNUC__ + $(CC) -E $(cppflags) -o $@ $< +#else /* works on Solaris; what about other systems? */ $(CC) -P $(cppflags) $< +#endif /* compiler */ + +## Create assembler output (debugging purposes only) +.c.s: + $(CC) -S -c $(cflags) $< liblw.a: $(objs) $(RM) $@ @@ -95,13 +93,13 @@ CONFIG_H = ../src/config.h config.h -lwlib-config.o: lwlib.h $(CONFIG_H) -lwlib-Xaw.o: lwlib.h lwlib-internal.h lwlib-Xaw.h $(CONFIG_H) -lwlib-Xlw.o: lwlib.h lwlib-internal.h lwlib-Xlw.h xlwmenu.h $(CONFIG_H) -lwlib-Xm.o: lwlib.h lwlib-internal.h lwlib-utils.h lwlib-Xm.h $(CONFIG_H) -lwlib-Xm.o: $(CONFIG_H) -lwlib-utils.o: lwlib-utils.h $(CONFIG_H) -lwlib.o: lwlib.h lwlib-internal.h lwlib-utils.h $(CONFIG_H) -lwlib.o: lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h $(CONFIG_H) -xlwmenu.o: lwlib.h xlwmenu.h xlwmenuP.h $(CONFIG_H) -xlwscrollbar.o: lwlib.h xlwscrollbar.h xlwscrollbarP.h $(CONFIG_H) +## Following correct as of 19980312 + +lwlib-Xaw.o: $(CONFIG_H) lwlib-Xaw.h lwlib-internal.h lwlib.h xlwmenu.h +lwlib-Xlw.o: $(CONFIG_H) lwlib-Xlw.h lwlib-internal.h lwlib.h xlwmenu.h xlwscrollbar.h +lwlib-Xm.o: $(CONFIG_H) lwlib-Xm.h lwlib-internal.h lwlib-utils.h lwlib.h xlwmenu.h +lwlib-config.o: $(CONFIG_H) lwlib.h xlwmenu.h +lwlib-utils.o: $(CONFIG_H) lwlib-utils.h +lwlib.o: $(CONFIG_H) lwlib-Xaw.h lwlib-Xlw.h lwlib-Xm.h lwlib-internal.h lwlib-utils.h lwlib.h xlwmenu.h +xlwmenu.o: $(CONFIG_H) lwlib.h xlwmenu.h xlwmenuP.h +xlwscrollbar.o: $(CONFIG_H) xlwscrollbar.h xlwscrollbarP.h
--- a/lwlib/lwlib.c Mon Aug 13 10:27:41 2007 +0200 +++ b/lwlib/lwlib.c Mon Aug 13 10:28:48 2007 +0200 @@ -885,22 +885,18 @@ Widget lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p) { - widget_instance *instance; - - instance = find_instance (id, parent, pop_up_p); + widget_instance *instance = find_instance (id, parent, pop_up_p); return instance ? instance->widget : NULL; } Widget lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p) { - widget_instance *instance; - widget_info *info; + widget_instance *instance = find_instance (id, parent, pop_up_p); - instance = find_instance (id, parent, pop_up_p); if (!instance) { - info = get_widget_info (id, False); + widget_info *info = get_widget_info (id, False); if (!info) return NULL; instance = allocate_widget_instance (info, parent, pop_up_p);
--- a/lwlib/lwlib.h Mon Aug 13 10:27:41 2007 +0200 +++ b/lwlib/lwlib.h Mon Aug 13 10:28:48 2007 +0200 @@ -3,14 +3,6 @@ #include <X11/Intrinsic.h> -/* To eliminate use of `const' in the lwlib sources, define CONST_IS_LOSING. */ -#undef CONST -#ifdef CONST_IS_LOSING -# define CONST -#else -# define CONST const -#endif - #if defined (LWLIB_MENUBARS_LUCID) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_MENUBARS_ATHENA) #define NEED_MENUBARS #endif @@ -23,14 +15,14 @@ /* ** Widget values depend on the Widget type: -** +** ** widget: (name value key enabled data contents/selected) ** ** label: ("name" "string" NULL NULL NULL NULL) ** BUTTON: ("name" "string" "key" T/F data <default-button-p>) -** CASCADE (button w/menu): +** CASCADE (button w/menu): ** ("name" "string" "key" T/F data (label|button|button w/menu...)) -** INCREMENTAL (button w/menu construction callback): +** INCREMENTAL (button w/menu construction callback): ** ("name" "string" NULL T/F <opaque pointer>) ** menubar: ("name" NULL NULL T/F data (button w/menu)) ** scrollbar:("name" NULL NULL T/F NULL NULL) @@ -43,7 +35,7 @@ ** ** Note that the above is EXTREMELY bogus. The "type" of the various entities ** that a widget_value structure can represent is implicit in the contents of -** half a dozen slots, instead of there simply being a type field. This +** half a dozen slots, instead of there simply being a type field. This ** should all be rethunk. I've added a type field, but for now it's only used ** by the new xlwmenu code. */ @@ -114,7 +106,7 @@ char* name; /* value (meaning BOGUSLY depend on widget type) */ char* value; - /* keyboard equivalent. no implications for XtTranslations */ + /* keyboard equivalent. no implications for XtTranslations */ char* key; /* accelerator key. For XEmacs, this should be a Lisp_Object holding a char or symbol suitable for passing to event_matches_key_specifier_p.
--- a/lwlib/xlwmenu.c Mon Aug 13 10:27:41 2007 +0200 +++ b/lwlib/xlwmenu.c Mon Aug 13 10:28:48 2007 +0200 @@ -32,9 +32,6 @@ #include <unistd.h> #endif -#if 0 /* mrb */ -#include <X11/Xos.h> -#endif #include <X11/IntrinsicP.h> #include <X11/ShellP.h> #include <X11/StringDefs.h> @@ -345,7 +342,7 @@ } static Boolean -close_to_reference_time(Widget w, Time reference_time, XEvent *ev) +close_to_reference_time (Widget w, Time reference_time, XEvent *ev) { return reference_time && @@ -383,10 +380,10 @@ static char massaged_resource_char[256]; static void -Initialize_massaged_resource_char (void) +initialize_massaged_resource_char (void) { int j; - for (j = 0; j < sizeof (massaged_resource_char); j++) + for (j = 0; j < (int) sizeof (massaged_resource_char); j++) { if ((j >= 'a' && j <= 'z') || (j >= 'A' && j <= 'Z') || @@ -433,7 +430,7 @@ chars = string; #endif - for (i = j = 0; chars[i] && (j < sizeof (newchars)); i++) + for (i = j = 0; chars[i] && (j < (int) sizeof (newchars)); i++) if (chars[i]=='%'&&chars[i+1]=='_') i++; else @@ -443,11 +440,11 @@ #ifdef NEED_MOTIF newstring = XmStringLtoRCreate (newchars, XmFONTLIST_DEFAULT_TAG); XmStringExtent (mw->menu.font_list, newstring, &width, &height); - XmStringFree(newstring); + XmStringFree (newstring); return width; #else # ifdef USE_XFONTSET - XmbTextExtents(mw->menu.font_set, newchars, j, &ri, &rl); + XmbTextExtents (mw->menu.font_set, newchars, j, &ri, &rl); return rl.width; # else /* ! USE_XFONTSET */ XTextExtents (mw->menu.font, newchars, j, &drop, &drop, &drop, &xcs); @@ -493,8 +490,8 @@ *out = 0; #ifdef PRINT_XLWMENU_RESOURCE_CONVERSIONS - printf("! Emacs*XlwMenu.%s.labelString:\t%s\n", save_out, save_in); - printf( "Emacs*XlwMenu.%s.labelString:\n", save_out); + printf ("! Emacs*XlwMenu.%s.labelString:\t%s\n", save_out, save_in); + printf ( "Emacs*XlwMenu.%s.labelString:\n", save_out); #endif } @@ -523,8 +520,8 @@ { char *percent; char *result; - unsigned done = 0; - unsigned ntimes; + unsigned int done = 0; + unsigned int ntimes; if (!string) { @@ -545,13 +542,13 @@ while ((percent = strchr(string, '%'))) { - unsigned left_pad; - unsigned right_pad; + unsigned int left_pad; + unsigned int right_pad; char *p; if (percent[1] == '%') { /* it's a real % */ - strncat(result, string, 1 + percent - string); /* incl % */ + strncat (result, string, 1 + percent - string); /* incl % */ string = &percent[2]; /* after the second '%' */ continue; /* with the while() loop */ } @@ -571,15 +568,15 @@ } else if (*p == '1') { /* param and terminator */ - strncat(result, string, percent - string); + strncat (result, string, percent - string); if (value[0] != '\0') { - unsigned i; + unsigned int i; for (i = 0; i < left_pad; i++) - strcat(result, " "); - strcat(result, value); + strcat (result, " "); + strcat (result, value); for (i = 0; i < right_pad; i++) - strcat(result, " "); + strcat (result, " "); } string = &p[1]; /* after the '1' */ done++; /* no need to do old way */ @@ -588,25 +585,21 @@ else { /* bogus, copy the format as is */ /* out of for() loop */ - strncat(result, string, 1 + p - string); - string= (*p ? &p[1] : p); + strncat (result, string, 1 + p - string); + string = (*p ? &p[1] : p); break; } } } - /* - * Copy the tail of the string - */ - strcat(result, string); - - /* - * If we have not processed a % string, and we have a value, tail it. - */ + /* Copy the tail of the string */ + strcat (result, string); + + /* If we have not processed a % string, and we have a value, tail it. */ if (!done && value[0] != '\0') { - strcat(result, " "); - strcat(result, value); + strcat (result, " "); + strcat (result, value); } return result; @@ -635,7 +628,7 @@ if (val->value) { char named_name[1024]; - sprintf(named_name, "%sNamed", massaged_name); + sprintf (named_name, "%sNamed", massaged_name); XtGetSubresources ((Widget) mw, (XtPointer) &resourced_name, named_name, named_name, @@ -657,7 +650,7 @@ resourced_name = val->name; /* Parameterize the string. */ - converted_name = parameterize_string(resourced_name, val->value); + converted_name = parameterize_string (resourced_name, val->value); /* nuke newline characters to prevent menubar screwups */ for ( str = converted_name ; *str ; str++ ) @@ -682,14 +675,12 @@ /* Unused */ #if 0 -/* - * These two routines should be a seperate file..djw - */ +/* These two routines should be a seperate file..djw */ static char * xlw_create_localized_string (Widget w, char *name, char **args, - unsigned nargs) + unsigned int nargs) { char *string = NULL; char *arg = NULL; @@ -714,11 +705,11 @@ xlw_create_localized_xmstring (Widget w, char *name, char **args, - unsigned nargs) + unsigned int nargs) { char * string = xlw_create_localized_string (w, name, args, nargs); XmString xm_string = XmStringCreateLtoR (string, XmSTRING_DEFAULT_CHARSET); - XtFree(string); + XtFree (string); return xm_string; } #endif /* 0 */ @@ -746,7 +737,7 @@ if (!resourced_name) resourced_name = val->name; - complete_name = parameterize_string(resourced_name, val->value); + complete_name = parameterize_string (resourced_name, val->value); val->toolkit_data = complete_name; /* nuke newline characters to prevent menubar screwups */ @@ -762,18 +753,16 @@ #endif /* !Motif */ -/* - * Code for drawing strings. - */ +/* Code for drawing strings. */ static void -string_draw(XlwMenuWidget mw, - Window window, - int x, int y, - GC gc, +string_draw (XlwMenuWidget mw, + Window window, + int x, int y, + GC gc, #ifdef NEED_MOTIF - XmString string + XmString string #else - char *string + char *string #endif ) { @@ -913,16 +902,16 @@ #endif } -/* - * Low level code for drawing 3-D edges. - */ +/* Low level code for drawing 3-D edges. */ static void shadow_rectangle_draw (Display *dpy, Window window, GC top_gc, GC bottom_gc, - int x, int y, unsigned width, unsigned height, - unsigned thickness) + int x, int y, + unsigned int width, + unsigned int height, + unsigned int thickness) { XPoint points [4]; @@ -992,7 +981,9 @@ static void shadow_draw (XlwMenuWidget mw, Window window, - int x, int y, unsigned width, unsigned height, + int x, int y, + unsigned int width, + unsigned int height, shadow_type type) { Display *dpy = XtDisplay (mw); @@ -1032,7 +1023,7 @@ if (etched) { - unsigned half = thickness/2; + unsigned int half = thickness/2; shadow_rectangle_draw (dpy, window, top_gc, @@ -1064,7 +1055,7 @@ arrow_decoration_draw (XlwMenuWidget mw, Window window, int x, int y, - unsigned width, + unsigned int width, Boolean raised) { Display *dpy = XtDisplay (mw); @@ -1095,10 +1086,8 @@ bottom_gc = mw->menu.shadow_bottom_gc; } - /* - * Fill internal area, we do this first so that the borders - * have a nice sharp edge. - */ + /* Fill internal area. We do this first so that the borders have a + nice sharp edge. */ points [0].x = x + thickness; points [0].y = y + thickness; points [1].x = x + length - thickness; @@ -1157,7 +1146,7 @@ toggle_decoration_draw (XlwMenuWidget mw, Window window, int x, int y, - unsigned width, + unsigned int width, Boolean set) { Display *dpy = XtDisplay (mw); @@ -1170,9 +1159,7 @@ else type = SHADOW_OUT; - /* - * Fill internal area. - */ + /* Fill internal area. */ if (set) XFillRectangle (dpy, window, @@ -1182,14 +1169,14 @@ width - (2*thickness), width - (2*thickness)); - shadow_draw(mw, window, x, y, width, width, type); + shadow_draw (mw, window, x, y, width, width, type); } static void radio_decoration_draw (XlwMenuWidget mw, Window window, int x, int y, - unsigned width, + unsigned int width, Boolean enabled) { Display *dpy = XtDisplay (mw); @@ -1220,10 +1207,8 @@ } #if 1 - /* - * Draw the bottom first, just incase the regions overlap. - * The top should cast the longer shadow. - */ + /* Draw the bottom first, just in case the regions overlap. + The top should cast the longer shadow. */ points [0].x = x; /* left corner */ points [0].y = y + half_width; points [1].x = x + half_width; /* bottom corner */ @@ -1268,10 +1253,8 @@ XFillPolygon (dpy, window, top_gc, points, 4, Convex, CoordModeOrigin); #else - /* - * Draw the bottom first, just incase the regions overlap. - * The top should cast the longer shadow. - */ + /* Draw the bottom first, just in case the regions overlap. + The top should cast the longer shadow. */ npoints = 0; points [npoints].x = x; /* left corner */ points [npoints++].y = y + half_width; @@ -1309,9 +1292,7 @@ #endif - /* - * Fill internal area. - */ + /* Fill internal area. */ if (enabled) { points [0].x = x + thickness; @@ -1336,19 +1317,18 @@ separator_decoration_draw (XlwMenuWidget mw, Window window, int x, int y, - unsigned width, + unsigned int width, Boolean vertical, shadow_type type) { Display *dpy = XtDisplay (mw); GC top_gc; GC bottom_gc; - unsigned offset = 0; - unsigned num_separators = 1; - unsigned top_line_thickness = 0; - unsigned bottom_line_thickness = 0; + unsigned int offset = 0; + unsigned int num_separators = 1; + unsigned int top_line_thickness = 0; + unsigned int bottom_line_thickness = 0; Boolean dashed = False; - int i; switch (type) { @@ -1416,6 +1396,7 @@ while (num_separators--) { + unsigned int i; for (i = 0; i < top_line_thickness; i++) XDrawLine (dpy, window, top_gc, x, y + i, x + width, y + i); @@ -1459,7 +1440,8 @@ { char d [200]; int i; - for (i = 0; i < depth; i++) d[i] = ' '; + for (i = 0; i < depth; i++) + d[i] = ' '; d[depth]=0; if (!wv) { @@ -1510,7 +1492,7 @@ else { #if SLOPPY_TYPES - if (all_dashes_p(val->name)) + if (all_dashes_p (val->name)) return SEPARATOR_TYPE; else if (val->name && val->name[0] == '\0') /* push right */ return PUSHRIGHT_TYPE; @@ -1530,10 +1512,10 @@ label_button_size (XlwMenuWidget mw, widget_value *val, Boolean in_menubar, - unsigned *toggle_width, - unsigned *label_width, - unsigned *bindings_width, - unsigned *height) + unsigned int *toggle_width, + unsigned int *label_width, + unsigned int *bindings_width, + unsigned int *height) { *height = (mw->menu.font_ascent + mw->menu.font_descent + 2 * mw->menu.vertical_margin + @@ -1552,10 +1534,10 @@ Boolean highlighted, Window window, int x, int y, - unsigned width, - unsigned height, - unsigned label_offset, - unsigned binding_tab) + unsigned int width, + unsigned int height, + unsigned int label_offset, + unsigned int binding_tab) { int y_offset = mw->menu.shadow_thickness + mw->menu.vertical_margin; GC gc; @@ -1570,9 +1552,7 @@ else gc = mw->menu.title_gc; - /* - * Draw the label string. - */ + /* Draw the label string. */ string_draw_u (mw, window, x + label_offset, y + y_offset, @@ -1584,10 +1564,10 @@ push_button_size (XlwMenuWidget mw, widget_value *val, Boolean in_menubar, - unsigned *toggle_width, - unsigned *label_width, - unsigned *bindings_width, - unsigned *height) + unsigned int *toggle_width, + unsigned int *label_width, + unsigned int *bindings_width, + unsigned int *height) { /* inherit */ label_button_size (mw, val, in_menubar, @@ -1600,7 +1580,7 @@ int w; #ifdef NEED_MOTIF XmString key = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET); - w = string_width(mw, key); + w = string_width (mw, key); XmStringFree (key); #else char *key = val->key; @@ -1617,18 +1597,17 @@ Boolean highlighted, Window window, int x, int y, - unsigned width, unsigned height, - unsigned label_offset, - unsigned binding_offset) + unsigned int width, + unsigned int height, + unsigned int label_offset, + unsigned int binding_offset) { int y_offset = mw->menu.shadow_thickness + mw->menu.vertical_margin; GC gc; shadow_type type; Boolean menu_pb = in_menubar && (menu_item_type (val) == BUTTON_TYPE); - /* - * Draw the label string. - */ + /* Draw the label string. */ if (!label_offset) label_offset = mw->menu.shadow_thickness + mw->menu.horizontal_margin; @@ -1658,16 +1637,15 @@ window, x + label_offset, y + y_offset, gc, - resource_widget_value(mw, val)); - - /* - * Draw the keybindings - */ + resource_widget_value (mw, val)); + + /* Draw the keybindings */ if (val->key) { if (!binding_offset) { - unsigned s_width = string_width (mw, resource_widget_value(mw, val)); + unsigned int s_width = + string_width (mw, resource_widget_value (mw, val)); binding_offset = label_offset + s_width + mw->menu.shadow_thickness; } binding_draw (mw, window, @@ -1675,9 +1653,7 @@ y + y_offset, gc, val->key); } - /* - * Draw the shadow - */ + /* Draw the shadow */ if (menu_pb) { if (highlighted) @@ -1699,8 +1675,7 @@ static unsigned int arrow_decoration_height (XlwMenuWidget mw) { - unsigned int result = - (mw->menu.font_ascent + mw->menu.font_descent) / (unsigned int)2; + int result = (mw->menu.font_ascent + mw->menu.font_descent) / 2; result += 2 * mw->menu.shadow_thickness; @@ -1714,10 +1689,10 @@ cascade_button_size (XlwMenuWidget mw, widget_value *val, Boolean in_menubar, - unsigned *toggle_width, - unsigned *label_width, - unsigned *arrow_width, - unsigned *height) + unsigned int *toggle_width, + unsigned int *label_width, + unsigned int *arrow_width, + unsigned int *height) { /* inherit */ label_button_size (mw, val, in_menubar, @@ -1726,7 +1701,7 @@ /* we have a pull aside arrow */ if (!in_menubar) { - *arrow_width += arrow_decoration_height(mw) + mw->menu.column_spacing; + *arrow_width += arrow_decoration_height (mw) + mw->menu.column_spacing; } } @@ -1737,33 +1712,31 @@ Boolean highlighted, Window window, int x, int y, - unsigned width, unsigned height, - unsigned label_offset, - unsigned binding_offset) + unsigned int width, + unsigned int height, + unsigned int label_offset, + unsigned int binding_offset) { shadow_type type; - /* - * Draw the label string. - */ + /* Draw the label string. */ label_button_draw (mw, val, in_menubar, highlighted, window, x, y, width, height, label_offset, binding_offset); - /* - * Draw the pull aside arrow - */ + /* Draw the pull aside arrow */ if (!in_menubar && val->contents) { int y_offset; - unsigned arrow_height = arrow_decoration_height (mw); + unsigned int arrow_height = arrow_decoration_height (mw); y_offset = mw->menu.shadow_thickness + mw->menu.vertical_margin + (mw->menu.font_ascent+mw->menu.font_descent - arrow_height)/2; if (!binding_offset) { - unsigned s_width = string_width(mw, resource_widget_value (mw, val)); + unsigned int s_width = + string_width (mw, resource_widget_value (mw, val)); if (!label_offset) label_offset = mw->menu.shadow_thickness + @@ -1780,33 +1753,29 @@ highlighted); } - /* - * Draw the shadow - */ + /* Draw the shadow */ if (highlighted) type = SHADOW_OUT; else type = SHADOW_BACKGROUND; - shadow_draw(mw, window, x, y, width, height, type); + shadow_draw (mw, window, x, y, width, height, type); } -static unsigned -toggle_decoration_height(XlwMenuWidget mw) +static unsigned int +toggle_decoration_height (XlwMenuWidget mw) { - unsigned rv; + int rv; if (mw->menu.indicator_size > 0) rv = mw->menu.indicator_size; else rv = mw->menu.font_ascent; - if (rv > (mw->menu.font_ascent+mw->menu.font_descent)) - rv = mw->menu.font_ascent+mw->menu.font_descent; - - /* - * radio button can't be smaller than its border or a filling - * error will occur. - */ + if (rv > (mw->menu.font_ascent + mw->menu.font_descent)) + rv = mw->menu.font_ascent + mw->menu.font_descent; + + /* radio button can't be smaller than its border or a filling + error will occur. */ if (rv < 2 * mw->menu.shadow_thickness) rv = 2 * mw->menu.shadow_thickness; @@ -1817,17 +1786,17 @@ toggle_button_size (XlwMenuWidget mw, widget_value *val, Boolean in_menubar, - unsigned *toggle_width, - unsigned *label_width, - unsigned *bindings_width, - unsigned *height) + unsigned int *toggle_width, + unsigned int *label_width, + unsigned int *bindings_width, + unsigned int *height) { /* inherit */ push_button_size (mw, val, in_menubar, toggle_width, label_width, bindings_width, height); /* we have a toggle */ - *toggle_width += toggle_decoration_height(mw) + mw->menu.column_spacing; + *toggle_width += toggle_decoration_height (mw) + mw->menu.column_spacing; } static void @@ -1837,17 +1806,16 @@ Boolean highlighted, Window window, int x, int y, - unsigned width, unsigned height, - unsigned label_tab, - unsigned binding_tab) + unsigned int width, + unsigned int height, + unsigned int label_tab, + unsigned int binding_tab) { int x_offset; int y_offset; - unsigned t_height = toggle_decoration_height(mw); - - /* - * Draw a toggle. - */ + unsigned int t_height = toggle_decoration_height (mw); + + /* Draw a toggle. */ x_offset = mw->menu.shadow_thickness + mw->menu.horizontal_margin; y_offset = mw->menu.shadow_thickness + mw->menu.vertical_margin; y_offset += (mw->menu.font_ascent + mw->menu.font_descent - t_height)/2; @@ -1855,17 +1823,15 @@ toggle_decoration_draw (mw, window, x + x_offset, y + y_offset, t_height, val->selected); - /* - * Draw the pushbutton parts. - */ + /* Draw the pushbutton parts. */ push_button_draw (mw, val, in_menubar, highlighted, window, x, y, width, height, label_tab, binding_tab); } -static unsigned -radio_decoration_height(XlwMenuWidget mw) +static unsigned int +radio_decoration_height (XlwMenuWidget mw) { - return toggle_decoration_height(mw); + return toggle_decoration_height (mw); } static void @@ -1875,17 +1841,16 @@ Boolean highlighted, Window window, int x, int y, - unsigned width, unsigned height, - unsigned label_tab, - unsigned binding_tab) + unsigned int width, + unsigned int height, + unsigned int label_tab, + unsigned int binding_tab) { int x_offset; int y_offset; - unsigned r_height = radio_decoration_height(mw); - - /* - * Draw a toggle. - */ + unsigned int r_height = radio_decoration_height (mw); + + /* Draw a toggle. */ x_offset = mw->menu.shadow_thickness + mw->menu.horizontal_margin; y_offset = mw->menu.shadow_thickness + mw->menu.vertical_margin; y_offset += (mw->menu.font_ascent + mw->menu.font_descent - r_height)/2; @@ -1893,9 +1858,7 @@ radio_decoration_draw (mw, window, x + x_offset, y + y_offset, r_height, val->selected); - /* - * Draw the pushbutton parts. - */ + /* Draw the pushbutton parts. */ push_button_draw (mw, val, in_menubar, highlighted, window, x, y, width, height, label_tab, binding_tab); } @@ -1926,11 +1889,10 @@ static shadow_type separator_type (char *name) { - int i; - if (name) { - for (i = 0; i < XtNumber(shadow_names); i++ ) + int i; + for (i = 0; i < (int) (XtNumber (shadow_names)); i++ ) { if (strcmp (name, shadow_names[i].name) == 0) return shadow_names[i].type; @@ -1939,11 +1901,11 @@ return SHADOW_BACKGROUND; } -static unsigned +static unsigned int separator_decoration_height (XlwMenuWidget mw, widget_value *val) { - switch (separator_type(val->value)) + switch (separator_type (val->value)) { case SHADOW_NO_LINE: case SHADOW_SINGLE_LINE: @@ -1968,10 +1930,10 @@ separator_size (XlwMenuWidget mw, widget_value *val, Boolean in_menubar, - unsigned *toggle_width, - unsigned *label_width, - unsigned *rest_width, - unsigned *height) + unsigned int *toggle_width, + unsigned int *label_width, + unsigned int *rest_width, + unsigned int *height) { *height = separator_decoration_height (mw, val); *label_width = 1; @@ -1985,11 +1947,12 @@ Boolean highlighted, Window window, int x, int y, - unsigned width, unsigned height, - unsigned label_tab, - unsigned binding_tab) + unsigned int width, + unsigned int height, + unsigned int label_tab, + unsigned int binding_tab) { - unsigned sep_width; + unsigned int sep_width; if (in_menubar) sep_width = height; @@ -2009,11 +1972,10 @@ pushright_size (XlwMenuWidget mw, widget_value *val, Boolean in_menubar, - unsigned *toggle_width, - unsigned *label_width, - unsigned *rest_width, - unsigned *height -) + unsigned int *toggle_width, + unsigned int *label_width, + unsigned int *rest_width, + unsigned int *height) { *height = *label_width = *toggle_width = *rest_width = 0; } @@ -2022,19 +1984,18 @@ size_menu_item (XlwMenuWidget mw, widget_value *val, int horizontal, - unsigned *toggle_width, - unsigned *label_width, - unsigned *rest_width, - unsigned *height -) + unsigned int *toggle_width, + unsigned int *label_width, + unsigned int *rest_width, + unsigned int *height) { void (*function_ptr) (XlwMenuWidget _mw, widget_value *_val, Boolean _in_menubar, - unsigned *_toggle_width, - unsigned *_label_width, - unsigned *_rest_width, - unsigned *_height); + unsigned int *_toggle_width, + unsigned int *_label_width, + unsigned int *_rest_width, + unsigned int *_height); switch (menu_item_type (val)) { @@ -2082,22 +2043,23 @@ int x = where->x /* + mw->menu.shadow_thickness */ ; int y = where->y /* + mw->menu.shadow_thickness */ ; - unsigned toggle_width; - unsigned label_width; - unsigned binding_width; - unsigned width; - unsigned height; - unsigned label_tab; - unsigned binding_tab; + unsigned int toggle_width; + unsigned int label_width; + unsigned int binding_width; + unsigned int width; + unsigned int height; + unsigned int label_tab; + unsigned int binding_tab; void (*function_ptr) (XlwMenuWidget _mw, widget_value *_val, Boolean _in_menubar, Boolean _highlighted, Window _window, int _x, int _y, - unsigned _width, unsigned _height, - unsigned _label_tab, - unsigned _binding_tab); + unsigned int _width, + unsigned int _height, + unsigned int _label_tab, + unsigned int _binding_tab); size_menu_item (mw, val, horizontal, &toggle_width, &label_width, &binding_width, &height); @@ -2162,14 +2124,14 @@ static void size_menu (XlwMenuWidget mw, int level) { - unsigned toggle_width; - unsigned label_width; - unsigned rest_width; - unsigned height; - unsigned max_toggle_width = 0; - unsigned max_label_width = 0; - unsigned max_rest_width = 0; - unsigned max_height = 0; + unsigned int toggle_width; + unsigned int label_width; + unsigned int rest_width; + unsigned int height; + unsigned int max_toggle_width = 0; + unsigned int max_label_width = 0; + unsigned int max_rest_width = 0; + unsigned int max_height = 0; int horizontal_p = mw->menu.horizontal && (level == 0); widget_value* val; window_state* ws; @@ -2643,11 +2605,11 @@ xgcv.foreground = mw->core.background_pixel; xgcv.background = mw->menu.foreground; - mw->menu.background_gc = XtGetGC ((Widget)mw, flags, &xgcv); + mw->menu.background_gc = XtGetGC ((Widget) mw, flags, &xgcv); xgcv.foreground = mw->menu.foreground; xgcv.background = mw->core.background_pixel; - mw->menu.foreground_gc = XtGetGC ((Widget)mw, flags, &xgcv); + mw->menu.foreground_gc = XtGetGC ((Widget) mw, flags, &xgcv); if (mw->menu.select_color != (Pixel)-1) { @@ -2666,9 +2628,9 @@ Colormap cmap = mw->core.colormap; xcolor.pixel = mw->core.background_pixel; XQueryColor (dpy, cmap, &xcolor); - xcolor.red *= 0.85; - xcolor.green *= 0.85; - xcolor.blue *= 0.85; + xcolor.red = (xcolor.red * 17) / 20; + xcolor.green = (xcolor.green * 17) / 20; + xcolor.blue = (xcolor.blue * 17) / 20; if (allocate_nearest_color (dpy, cmap, &xcolor)) xgcv.foreground = xcolor.pixel; } @@ -2738,9 +2700,9 @@ XColor topc, botc; int top_frobbed = 0, bottom_frobbed = 0; - if (mw->menu.top_shadow_color == -1) + if (mw->menu.top_shadow_color == (Pixel) (-1)) mw->menu.top_shadow_color = mw->core.background_pixel; - if (mw->menu.bottom_shadow_color == -1) + if (mw->menu.bottom_shadow_color == (Pixel) (-1)) mw->menu.bottom_shadow_color = mw->menu.foreground; if (mw->menu.top_shadow_color == mw->core.background_pixel || @@ -2778,9 +2740,9 @@ { botc.pixel = mw->core.background_pixel; XQueryColor (dpy, cmap, &botc); - botc.red *= 0.6; - botc.green *= 0.6; - botc.blue *= 0.6; + botc.red = (botc.red * 3) / 5; + botc.green = (botc.green * 3) / 5; + botc.blue = (botc.blue * 3) / 5; if (allocate_nearest_color (dpy, cmap, &botc)) { if (botc.pixel == mw->core.background_pixel) @@ -3084,7 +3046,7 @@ static void XlwMenuClassInitialize (void) { - Initialize_massaged_resource_char(); + initialize_massaged_resource_char(); } static void @@ -3292,7 +3254,7 @@ { int x = ev->x_root; int y = ev->y_root; - int state = ev->state; + unsigned int state = ev->state; XMotionEvent *event= ev, dummy; /* allow motion events to be generated again */
--- a/lwlib/xlwscrollbar.c Mon Aug 13 10:27:41 2007 +0200 +++ b/lwlib/xlwscrollbar.c Mon Aug 13 10:28:48 2007 +0200 @@ -4,13 +4,13 @@ This file is part of the Lucid Widget Library. -The Lucid Widget Library is free software; you can redistribute it and/or +The Lucid Widget Library 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. The Lucid Widget Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of +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. @@ -613,9 +613,9 @@ { botc.pixel = bg; XQueryColor (dpy, cmap, &botc); - botc.red *= 0.6; - botc.green *= 0.6; - botc.blue *= 0.6; + botc.red = (botc.red * 3) / 5; + botc.green = (botc.green * 3) / 5; + botc.blue = (botc.blue * 3) / 5; if (allocate_nearest_color (dpy, cmap, &botc)) { if (botc.pixel == bg) @@ -698,9 +698,9 @@ { troughC.pixel = w->core.background_pixel; XQueryColor (dpy, cmap, &troughC); - troughC.red *= 0.8; - troughC.green *= 0.8; - troughC.blue *= 0.8; + troughC.red = (troughC.red * 4) / 5; + troughC.green = (troughC.green * 4) / 5; + troughC.blue = (troughC.blue * 4) / 5; if (allocate_nearest_color (dpy, cmap, &troughC)) w->sb.troughColor = troughC.pixel; } @@ -944,10 +944,9 @@ int *ss_return, int *below_return) { float total, height, fuz; - int value; - int above, ss, below; + int value, above, ss, below; - height= widget_h (w); + height = widget_h (w); if (w->sb.showArrows) height -= (2 * arrow_h (w)); value = w->sb.value - w->sb.minimum; @@ -955,9 +954,9 @@ total = w->sb.maximum - w->sb.minimum; fuz = total / 2; - ss = ((height * w->sb.sliderSize + fuz) / total); - above = ((height * value + fuz) / total); - below = ((height) - (ss + above)); + ss = (int) ((height * w->sb.sliderSize + fuz) / total); + above = (int) ((height * value + fuz) / total); + below = (int) ((height) - (ss + above)); /* Don't let slider get smaller than SS_MIN */ if (ss < SS_MIN) @@ -967,22 +966,22 @@ above -= (int) tmp; ss = SS_MIN; - below = ((height) - (ss + above)); + below = (int) ((height) - (ss + above)); if (above < 0) { above = 0; - below = height - ss; + below = (int) (height - ss); } if (below < 0) { - above = height - ss; + above = (int) (height - ss); below = 0; } if (ss > height) { above = 0; - ss = height; + ss = (int) height; below = 0; } } @@ -1031,12 +1030,12 @@ total = w->sb.maximum - w->sb.minimum; fuz = height / 2; - ss = ((height * w->sb.sliderSize + (total / 2)) / total); + ss = (int) ((height * w->sb.sliderSize + (total / 2)) / total); if (ss < SS_MIN) { /* add a percent amount for integer rounding */ - above += ((((SS_MIN - ss) * above) + fuz) / height); + above += (int) ((((SS_MIN - ss) * above) + fuz) / height); } { @@ -1047,7 +1046,7 @@ else if (floatval <= (float) INT_MIN) value = INT_MIN; else - value = floatval; + value = (int) floatval; } return value;
--- a/man/internals/internals.texi Mon Aug 13 10:27:41 2007 +0200 +++ b/man/internals/internals.texi Mon Aug 13 10:28:48 2007 +0200 @@ -984,23 +984,31 @@ all possible configurations. When configure is done running, it generates @file{Makefile}s and the -file @file{config.h} (which describes the features of your system) from -template files. You then run @file{make}, which compiles the auxiliary -code and programs in @file{lib-src/} and @file{lwlib/} and the main -XEmacs executable in @file{src/}. The result of this is an executable -called @file{temacs}, which is @emph{not} the XEmacs executable. -@file{temacs} by itself cannot function as an editor or even display any -windows on the screen, and if you simply run it, it will exit -immediately. The Makefile runs @file{temacs} with certain options that -cause it to initialize itself, read in a number of basic Lisp files, and -then dump itself out into a new executable called @file{xemacs}. This -new executable has been pre-initialized and contains pre-digested Lisp -code that is necessary for the editor to function (this includes most -basic Lisp functions, e.g. @code{not}, that can be defined in terms of -other Lisp primitives; some initialization code that is called when -certain objects, such as frames, are created; and all of the standard -keybindings and code for the actions they result in). This executable, -@file{xemacs}, is the executable that you run to use the XEmacs editor. +file @file{src/config.h} (which describes the features of your system) +from template files. You then run @file{make}, which compiles the +auxiliary code and programs in @file{lib-src/} and @file{lwlib/} and the +main XEmacs executable in @file{src/}. The result of compiling and +linking is an executable called @file{temacs}, which is @emph{not} the +final XEmacs executable. @file{temacs} by itself is not intended to +function as an editor or even display any windows on the screen, and if +you simply run it, it will exit immediately. The @file{Makefile} runs +@file{temacs} with certain options that cause it to initialize itself, +read in a number of basic Lisp files, and then dump itself out into a +new executable called @file{xemacs}. This new executable has been +pre-initialized and contains pre-digested Lisp code that is necessary +for the editor to function (this includes most basic Lisp functions, +e.g. @code{not}, that can be defined in terms of other Lisp primitives; +some initialization code that is called when certain objects, such as +frames, are created; and all of the standard keybindings and code for +the actions they result in). This executable, @file{xemacs}, is the +executable that you run to use the XEmacs editor. + +Although @file{temacs} is not intended to be run as an editor, it can, +by using the incantation @code{temacs -batch -l loadup.el run-temacs}. +This is useful when the dumping procedure described above is broken, or +when using certain program debugging tools such as Purify. These tools +get mighty confused by the tricks played by the XEmacs build process, +such as allocation memory in one process, and freeing it in the next. @node XEmacs From the Inside, The XEmacs Object System (Abstractly Speaking), XEmacs From the Perspective of Building, Top @chapter XEmacs From the Inside @@ -1451,8 +1459,8 @@ looking up the string equivalent in the global variable @code{obarray}, whose contents should be an obarray. If no symbol is found, a new symbol with the name @code{"foobar"} is automatically -created and adding it to @code{obarray}; this process is called -@dfn{interning} the symbol. +created and added to @code{obarray}; this process is called +@dfn{interning} the symbol. @cindex interning @example @@ -1552,18 +1560,17 @@ Lisp objects use the typedef @code{Lisp_Object}, but the actual C type used for the Lisp object can vary. It can be either a simple type (@code{long} on the DEC Alpha, @code{int} on other machines) or a -structure whose fields are bit fields that line up properly (actually, -it's a union of structures that's used). Generally the simple integral -type is preferable because it ensures that the compiler will actually -use a machine word to represent the object (some compilers will use more +structure whose fields are bit fields that line up properly (actually, a +union of structures that's used). Generally the simple integral type is +preferable because it ensures that the compiler will actually use a +machine word to represent the object (some compilers will use more general and less efficient code for unions and structs even if they can fit in a machine word). The union type, however, has the advantage of stricter type checking (if you accidentally pass an integer where a Lisp object is desired, you get a compile error), and it makes it easier to decode Lisp objects when debugging. The choice of which type to use is determined by the presence or absence of the preprocessor constant -@code{NO_UNION_TYPE}. (Shouldn't it be @code{USE_UNION_TYPE}, with -opposite semantics? ``Hysterical reasons'', of course.) +@code{USE_UNION_TYPE}. @cindex record type Note that there are only eight types that the tag can represent, @@ -1627,7 +1634,7 @@ The reason for this is that standard C doesn't let you ``construct'' a structure (but GCC does). Granted, this sometimes isn't too convenient; for the case of integers, at least, you can use the function -@code{make_number()}, which constructs and @emph{returns} an integer +@code{make_int()}, which constructs and @emph{returns} an integer Lisp object. Note that the @code{XSET@var{TYPE}()} macros are also affected by @code{ERROR_CHECK_TYPECHECK} and make sure that the structure is of the right type in the case of record types, where the @@ -2310,7 +2317,7 @@ basic definitions for the Lisp environment, as well as some general-purpose definitions (e.g. @code{min()} and @code{max()}). @file{lisp.h} includes either @file{lisp-disunion.h} or -@file{lisp-union.h}, depending on whether @code{NO_UNION_TYPE} is +@file{lisp-union.h}, depending on whether @code{USE_UNION_TYPE} is defined. These files define the typedef of the Lisp object itself (as described above) and the low-level macros that hide the actual implementation of the Lisp object. All extractor and constructor macros @@ -3991,7 +3998,7 @@ Note that @code{obarray} is one of the @code{staticpro()}d things. Therefore, all functions and variables get marked through this. @item -Any shadowed bindings that are sitting on the specpdl stack. +Any shadowed bindings that are sitting on the @code{specpdl} stack. @item Any objects sitting in currently active (Lisp) stack frames, catches, and condition cases. @@ -4038,7 +4045,7 @@ It is actually possible for a single @code{struct gcpro} to protect a contiguous array of any number of values, rather than just a single lvalue. To effect this, call @code{GCPRO@var{n}} as usual on -the first object in the array and then set @code{gcpron.nvars}. +the first object in the array and then set @code{gcpro@var{n}.nvars}. @item @strong{Strings are relocated.} What this means in practice is that the @@ -5086,7 +5093,7 @@ the evaluation, however, and is almost identical to eval. @code{Fapply()} implements Lisp @code{apply}, which is very similar to -funcall except that if the last argument is a list, the result is the +@code{funcall} except that if the last argument is a list, the result is the same as if each of the arguments in the list had been passed separately. @code{Fapply()} does some business to expand the last argument if it's a list, then calls @code{Ffuncall()} to do the work. @@ -5114,9 +5121,9 @@ array, @code{specpdl_size} specifies the total number of binding slots in the array, and @code{max_specpdl_size} specifies the maximum number of bindings the array can be expanded to hold. @code{grow_specpdl()} -increases the size of the specpdl array, multiplying its size by 2 but -never exceeding max_specpdl_size (except that if this number is less -than 400, it is first set to 400). +increases the size of the @code{specpdl} array, multiplying its size by +2 but never exceeding @code{max_specpdl_size} (except that if this +number is less than 400, it is first set to 400). @code{specbind()} binds a symbol to a value and is used for local variables and @code{let} forms. The symbol and its old value (which @@ -5127,14 +5134,14 @@ which, when placed around a section of code, ensures that some specified cleanup routine will be executed even if the code exits abnormally (e.g. through a @code{throw} or quit). @code{record_unwind_protect()} -simply adds a new specbinding to the specpdl array and stores the +simply adds a new specbinding to the @code{specpdl} array and stores the appropriate information in it. The cleanup routine can either be a C function, which is stored in the @code{func} field, or a @code{progn} form, which is stored in the @code{old_value} field. - @code{unbind_to()} removes specbindings from the specpdl array until -the specified position is reached. Each specbinding can be one of three -types: + @code{unbind_to()} removes specbindings from the @code{specpdl} array +until the specified position is reached. Each specbinding can be one of +three types: @enumerate @item @@ -5200,7 +5207,7 @@ @code{internal_catch()} is fairly straightforward. It stores into the @code{struct catchtag} the tag name and the current values of @code{backtrace_list}, @code{lisp_eval_depth}, @code{gcprolist}, and the -offset into the specpdl array, sets a jump point with @code{_setjmp()} +offset into the @code{specpdl} array, sets a jump point with @code{_setjmp()} (storing the jump point into the @code{struct catchtag}), and calls the function. Control will return to @code{internal_catch()} either when the function exits normally or through a @code{_longjmp()} to this jump
--- a/man/lispref/help.texi Mon Aug 13 10:27:41 2007 +0200 +++ b/man/lispref/help.texi Mon Aug 13 10:28:48 2007 +0200 @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the XEmacs Lisp Reference Manual. -@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/help.info @node Documentation, Files, Modes, Top @@ -151,7 +151,7 @@ in the `*Help*' buffer." (interactive "sDescribe symbols matching: ") (let ((describe-func - (function + (function (lambda (s) @end group @group @@ -159,30 +159,30 @@ (if (fboundp s) ; @r{It is a function.} (princ (format "%s\t%s\n%s\n\n" s - (if (commandp s) + (if (commandp s) (let ((keys (where-is-internal s))) (if keys (concat "Keys: " - (mapconcat 'key-description + (mapconcat 'key-description keys " ")) "Keys: none")) "Function") @end group @group - (or (documentation s) + (or (documentation s) "not documented")))) - + (if (boundp s) ; @r{It is a variable.} @end group @group (princ (format "%s\t%s\n%s\n\n" s - (if (user-variable-p s) + (if (user-variable-p s) "Option " "Variable") @end group @group - (or (documentation-property + (or (documentation-property s 'variable-documentation) "not documented"))))))) sym-list) @@ -190,7 +190,7 @@ @group ;; @r{Build a list of symbols that match pattern.} - (mapatoms (function + (mapatoms (function (lambda (sym) (if (string-match pattern (symbol-name sym)) (setq sym-list (cons sym sym-list)))))) @@ -212,7 +212,7 @@ (describe-symbols "goal") ---------- Buffer: *Help* ---------- -goal-column Option +goal-column Option *Semipermanent goal column for vertical motion, as set by C-x C-n, or nil. @end group @c Do not blithely break or fill these lines. @@ -301,11 +301,11 @@ stands for a key sequence that will invoke @var{command}, or @samp{M-x @var{command}} if @var{command} has no key bindings. -@item \@{@var{mapvar}@} +@item \@{@var{mapvar}@} stands for a summary of the value of @var{mapvar}, which should be a keymap. The summary is made by @code{describe-bindings}. -@item \<@var{mapvar}> +@item \<@var{mapvar}> stands for no text itself. It is used for a side effect: it specifies @var{mapvar} as the keymap for any following @samp{\[@var{command}]} sequences in this documentation string. @@ -329,13 +329,13 @@ @smallexample @group -(substitute-command-keys +(substitute-command-keys "To abort recursive edit, type: \\[abort-recursive-edit]") @result{} "To abort recursive edit, type: C-]" @end group @group -(substitute-command-keys +(substitute-command-keys "The keys that are defined for the minibuffer here are: \\@{minibuffer-local-must-match-map@}") @result{} "The keys that are defined for the minibuffer here are: @@ -363,7 +363,7 @@ Substrings of the form \\=\\<MAPVAR> specify to use the value of MAPVAR as the keymap for future \\=\\[COMMAND] substrings. \\=\\= quotes the following character and is discarded; -thus, \\=\\=\\=\\= puts \\=\\= into the output, +thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ into the output.") @result{} "Substrings of the form \@{MAPVAR@} are replaced by summaries (made by describe-bindings) of the value of MAPVAR, taken as a keymap. @@ -498,7 +498,7 @@ Function: Save and/or delete buffers marked with M-x Buffer-menu-save or M-x Buffer-menu-delete commands. execute-extended-command ESC x - Function: Read function name, then read its + Function: Read function name, then read its arguments and call it. ---------- Buffer: *Help* ---------- @end group @@ -637,7 +637,7 @@ @ignore @c Not in XEmacs currently @c Emacs 19 feature @defmac make-help-screen fname help-line help-text help-map -This macro defines a help command named @var{fname} that acts like a +This macro defines a help command named @var{fname} that acts like a prefix key that shows a list of the subcommands it offers. When invoked, @var{fname} displays @var{help-text} in a window, then
--- a/man/xemacs-faq.texi Mon Aug 13 10:27:41 2007 +0200 +++ b/man/xemacs-faq.texi Mon Aug 13 10:28:48 2007 +0200 @@ -56,10 +56,10 @@ * Q1.0.3:: Where can I find it? * Q1.0.4:: Why Another Version of Emacs? * Q1.0.5:: Why Haven't XEmacs and GNU Emacs Merged? -* Q1.0.6:: Where can I get help? +* Q1.0.6:: Where can I get help? * Q1.0.7:: Where is the mailing list archived? * Q1.0.8:: How do you pronounce XEmacs? -* Q1.0.9:: What does XEmacs look like? +* Q1.0.9:: What does XEmacs look like? * Q1.0.10:: Is there a port of XEmacs to Microsoft ('95 or NT)? * Q1.0.11:: Is there a port of XEmacs to the Macintosh? * Q1.0.12:: Is there a port of XEmacs to NextStep? @@ -73,17 +73,17 @@ Credits: * Q1.2.1:: Who wrote XEmacs? -* Q1.2.2:: Who contributed to this version of the FAQ? -* Q1.2.3:: Who contributed to the FAQ in the past? +* Q1.2.2:: Who contributed to this version of the FAQ? +* Q1.2.3:: Who contributed to the FAQ in the past? Internationalization: -* Q1.3.1:: What is the status of XEmacs v20? +* Q1.3.1:: What is the status of XEmacs v20? * Q1.3.2:: What is the status of Asian-language support, aka @var{mule}? * Q1.3.3:: How do I type non-ASCII characters? * Q1.3.4:: Can XEmacs messages come out in a different language? * Q1.3.5:: Please explain the various input methods in MULE/XEmacs 20.0 * Q1.3.6:: How do I portably code for MULE/XEmacs 20.0? -* Q1.3.7:: How about Cyrillic Modes? +* Q1.3.7:: How about Cyrillic Modes? Getting Started: * Q1.4.1:: What is a @file{.emacs} and is there a sample one? @@ -96,20 +96,20 @@ Installation and Trouble Shooting -* Q2.0.1:: Running XEmacs without installing. -* Q2.0.2:: XEmacs is too big. +* Q2.0.1:: Running XEmacs without installing. +* Q2.0.2:: XEmacs is too big. * Q2.0.3:: Compiling XEmacs with Netaudio. * Q2.0.4:: Problems with Linux and ncurses. * Q2.0.5:: Do I need X11 to run XEmacs? * Q2.0.6:: I'm having strange crashes. What do I do? * Q2.0.7:: Libraries in non-standard locations. * Q2.0.8:: can't resolve symbol _h_errno -* Q2.0.9:: Where do I find external libraries? +* Q2.0.9:: Where do I find external libraries? * Q2.0.10:: After I run configure I find a coredump, is something wrong? * Q2.0.11:: XEmacs can't resolve host names. -* Q2.0.12:: Why can't I strip XEmacs? +* Q2.0.12:: Why can't I strip XEmacs? * Q2.0.13:: Can't link XEmacs on Solaris with Gcc. -* Q2.0.14:: Make on HP/UX 9 fails after linking temacs +* Q2.0.14:: Make on HP/UX 9 fails after linking temacs Trouble Shooting: * Q2.1.1:: XEmacs just crashed on me! @@ -138,13 +138,13 @@ Customization and Options -* Q3.0.1:: What version of Emacs am I running? +* Q3.0.1:: What version of Emacs am I running? * Q3.0.2:: How do I evaluate Elisp expressions? * Q3.0.3:: @code{(setq tab-width 6)} behaves oddly. * Q3.0.4:: How can I add directories to the @code{load-path}? * Q3.0.5:: How to check if a lisp function is defined? * Q3.0.6:: Can I force the output of @code{(face-list)} to a buffer? -* Q3.0.7:: Font selections don't get saved after @code{Save Options}. +* Q3.0.7:: Font selections don't get saved after @code{Save Options}. * Q3.0.8:: How do I make a single minibuffer frame? * Q3.0.9:: What is @code{Customize}? @@ -156,13 +156,13 @@ * Q3.1.5:: How can I get the icon to just say @samp{XEmacs}? * Q3.1.6:: How can I have the window title area display the full path? * Q3.1.7:: @samp{xemacs -name junk} doesn't work? -* Q3.1.8:: @samp{-iconic} it doesn't work. +* Q3.1.8:: @samp{-iconic} doesn't work. Textual Fonts & Colors: * Q3.2.1:: How can I set color options from @file{.emacs}? * Q3.2.2:: How do I set the text, menu and modeline fonts? * Q3.2.3:: How can I set the colors when highlighting a region? -* Q3.2.4:: How can I limit color map usage? +* Q3.2.4:: How can I limit color map usage? * Q3.2.5:: My tty supports color, but XEmacs doesn't use them. The Modeline: @@ -173,7 +173,7 @@ * Q3.3.5:: How can one change the modeline color based on the mode used? 3.4 Multiple Device Support: -* Q3.4.1:: How do I open a frame on another screen of my multi-headed display? +* Q3.4.1:: How do I open a frame on another screen of my multi-headed display? * Q3.4.2:: Can I really connect to a running XEmacs after calling up over a modem? How? 3.5 The Keyboard: @@ -182,7 +182,7 @@ * Q3.5.3:: How do I bind C-. and C-; to scroll one line up and down? * Q3.5.4:: Globally binding @kbd{Delete}? * Q3.5.5:: Scrolling one line at a time. -* Q3.5.6:: How to map @kbd{Help} key alone on Sun type4 keyboard? +* Q3.5.6:: How to map @kbd{Help} key alone on Sun type4 keyboard? * Q3.5.7:: How can you type in special characters in XEmacs? * Q3.5.8:: Why does @code{(global-set-key [delete-forward] 'delete-char)} complain? * Q3.5.9:: How do I make the Delete key delete forward? @@ -217,7 +217,7 @@ * Q3.9.4:: How can I get automatic horizontal scrolling? Text Selections: -* Q3.10.1:: How can I turn off or change highlighted selections? +* Q3.10.1:: How can I turn off or change highlighted selections? * Q3.10.2:: How do I get that typing on an active region removes it? * Q3.10.3:: Can I turn off the highlight during isearch? * Q3.10.4:: How do I turn off highlighting after @kbd{C-x C-p} (mark-page)? @@ -244,7 +244,7 @@ * Q4.1.3:: Is it true that W3 supports style sheets and tables? Reading Netnews and Mail with Gnus: -* Q4.2.1:: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Quassia Gnus, argh! +* Q4.2.1:: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Quassia Gnus, argh! * Q4.2.2:: [This question intentionally left blank] * Q4.2.3:: How do I make Gnus stay within a single frame? * Q4.2.4:: How do I customize the From: line? @@ -257,7 +257,7 @@ * Q4.3.5:: Where do I find pstogif (required by tm)? Sparcworks, EOS, and WorkShop: -* Q4.4.1:: What is SPARCworks, EOS, and WorkShop +* Q4.4.1:: What is SPARCworks, EOS, and WorkShop Energize: * Q4.5.1:: What is/was Energize? @@ -283,8 +283,8 @@ * Q5.0.7:: Telnet from shell filters too much. * Q5.0.8:: Why does edt emulation not work? * Q5.0.9:: How can I emulate VI and use it as my default mode? -* Q5.0.10:: [This question intentionally left blank] -* Q5.0.11:: Filladapt doesn't work in 19.15? +* Q5.0.10:: [This question intentionally left blank] +* Q5.0.11:: Filladapt doesn't work in 19.15? * Q5.0.12:: How do I disable gnuserv from opening a new frame? * Q5.0.13:: How do I start gnuserv so that each subsequent XEmacs is a client? * Q5.0.14:: Strange things are happening in Shell Mode. @@ -370,10 +370,10 @@ * Q1.0.3:: Where can I find it? * Q1.0.4:: Why Another Version of Emacs? * Q1.0.5:: Why Haven't XEmacs and GNU Emacs Merged? -* Q1.0.6:: Where can I get help? +* Q1.0.6:: Where can I get help? * Q1.0.7:: Where is the mailing list archived? * Q1.0.8:: How do you pronounce XEmacs? -* Q1.0.9:: What does XEmacs look like? +* Q1.0.9:: What does XEmacs look like? * Q1.0.10:: Is there a port of XEmacs to Microsoft ('95 or NT)? * Q1.0.11:: Is there a port of XEmacs to the Macintosh? * Q1.0.12:: Is there a port of XEmacs to NextStep? @@ -387,17 +387,17 @@ Credits: * Q1.2.1:: Who wrote XEmacs? -* Q1.2.2:: Who contributed to this version of the FAQ? -* Q1.2.3:: Who contributed to the FAQ in the past? +* Q1.2.2:: Who contributed to this version of the FAQ? +* Q1.2.3:: Who contributed to the FAQ in the past? Internationalization: -* Q1.3.1:: What is the status of XEmacs v20? +* Q1.3.1:: What is the status of XEmacs v20? * Q1.3.2:: What is the status of Asian-language support, aka @var{mule}? * Q1.3.3:: How do I type non-ASCII characters? * Q1.3.4:: Can XEmacs messages come out in a different language? * Q1.3.5:: Please explain the various input methods in MULE/XEmacs 20.0 * Q1.3.6:: How do I portably code for MULE/XEmacs 20.0? -* Q1.3.7:: How about Cyrillic Modes? +* Q1.3.7:: How about Cyrillic Modes? Getting Started: * Q1.4.1:: What is a @file{.emacs} and is there a sample one? @@ -520,7 +520,7 @@ If you have a comment to add regarding the merge, it is a good idea to avoid posting to the newsgroups, because of the very heated flamewars -that often result. Mail your questions to <xemacs-beta@@xemacs.org> and +that often result. Mail your questions to <xemacs-beta@@xemacs.org> and <bug-gnu-emacs@@prep.ai.mit.edu>. @node Q1.0.6, Q1.0.7, Q1.0.5, Introduction @@ -533,7 +533,7 @@ Try reading this FAQ, examining the regular GNU Emacs FAQ (which can be found with the Emacs 19 distribution) as well as at -<URL:http://www.eecs.nwu.edu/emacs/faq/> and reading the Usenet group +<URL:http://www.eecs.nwu.edu/emacs/faq/> and reading the Usenet group comp.emacs.xemacs. If that does not help, try posting your question to comp.emacs.xemacs. @@ -542,7 +542,7 @@ If you cannot post or read Usenet news, there is a corresponding mailing list which is available. It can be subscribed to by sending a message with a subject of @samp{subscribe} to <xemacs-request@@xemacs.org> -for subscription information and <xemacs@@xemacs.org> to send messages +for subscription information and <xemacs@@xemacs.org> to send messages to the list. To cancel a subscription, you @strong{must} use the xemacs-request @@ -663,7 +663,7 @@ @section How do I become a Beta Tester? Send an email message to <xemacs-beta-request@@xemacs.org> with a -subject line of @samp{subscribe}. +subject line of @samp{subscribe}. Be prepared to get your hands dirty, as beta testers are expected to identify problems as best they can. @@ -707,7 +707,7 @@ developers responsible for the 19.16/20.x releases are: @itemize @bullet -@item Martin Buchholz <mrb@@eng.sun.com> +@item Martin Buchholz <martin@@xemacs.org> @item Steve Baur <steve@@altair.xemacs.org> @@ -804,7 +804,7 @@ As of XEmacs 20.3, version 20 is @emph{the} supported version of XEmacs. This means that 19.16 will optionally receive stability fixes -(if any), but that all the real development work will be done on the v20 +(if any), but that all the real development work will be done on the v20 tree. The incompatible changes in XEmacs 20 include the additional byte-codes, @@ -815,7 +815,7 @@ However, to avoid breaking old code, many functions that should normally accept characters work with integers, and vice versa. For more -information, see the Lisp reference manual. Here is a relevant excerpt, +information, see the Lisp reference manual. Here is a relevant excerpt, for your convenience. @quotation @@ -872,7 +872,7 @@ who speak Japanese and will use XEmacs/MULE to work with Japanese and have some experience with E-Lisp. -As the fundings on Mule have stopped, Mule part of XEmacs is currently +As the funding on Mule have stopped, Mule part of XEmacs is currently looking for a full-time maintainer. If you can provide help here, or are willing to fund the work, please mail to <xemacs-beta@@xemacs.org>. @@ -898,9 +898,7 @@ @end example The name of the resource is derived from the non-localized entry by -removing punctuation and capitalizing as above. Martin Buchholz -<Martin.Buchholz@@sun.com> is working on adding support for Asian -language menubar localization to XEmacs 20. +removing punctuation and capitalizing as above. @node Q1.3.5, Q1.3.6, Q1.3.4, Introduction @section Please explain the various input methods in MULE/XEmacs 20.0 @@ -908,7 +906,7 @@ MORIOKA Tomohiko <morioka@@jaist.ac.jp> writes: @quotation -Original Mule supports following input methods: Wnn4, Wnn6, Canna, SJ3 +Original Mule supports the following input methods: Wnn4, Wnn6, Canna, SJ3 and XIM. Interfaces for Wnn and SJ3 uses the @code{egg} user interface. Interface for Canna does not use @samp{egg}. I don't know about XIM. It is to support ATOK, of course, it may work for another @@ -1166,20 +1164,20 @@ @menu Installation: -* Q2.0.1:: Running XEmacs without installing. -* Q2.0.2:: XEmacs is too big. +* Q2.0.1:: Running XEmacs without installing. +* Q2.0.2:: XEmacs is too big. * Q2.0.3:: Compiling XEmacs with Netaudio. * Q2.0.4:: Problems with Linux and ncurses. * Q2.0.5:: Do I need X11 to run XEmacs? * Q2.0.6:: I'm having strange crashes. What do I do? * Q2.0.7:: Libraries in non-standard locations. * Q2.0.8:: can't resolve symbol _h_errno -* Q2.0.9:: Where do I find external libraries? +* Q2.0.9:: Where do I find external libraries? * Q2.0.10:: After I run configure I find a coredump, is something wrong? * Q2.0.11:: XEmacs can't resolve host names. -* Q2.0.12:: Why can't I strip XEmacs? +* Q2.0.12:: Why can't I strip XEmacs? * Q2.0.13:: Can't link XEmacs on Solaris with Gcc. -* Q2.0.14:: Make on HP/UX 9 fails after linking temacs +* Q2.0.14:: Make on HP/UX 9 fails after linking temacs Trouble Shooting: * Q2.1.1:: XEmacs just crashed on me! @@ -1673,12 +1671,12 @@ error message might look like: @example -unexec(): dlopen(../dynodump/dynodump.so): ld.so.1: ./temacs: -fatal: relocation error: +unexec(): dlopen(../dynodump/dynodump.so): ld.so.1: ./temacs: +fatal: relocation error: symbol not found: main: referenced in ../dynodump/dynodump.so @end example -Martin Buchholz <mrb@@eng.sun.com> writes: +Martin Buchholz <martin@@xemacs.org> writes: @quotation You need to specify @samp{-fno-gnu-linker} as part of your flags to pass @@ -1934,10 +1932,10 @@ xemacs*pointerColor: black @end example -With the new colours installed the problem still occurs if the above +With the new colors installed the problem still occurs if the above resources are not defined. -If the new colours are not present then an additional error occurs on +If the new colors are not present then an additional error occurs on XEmacs startup, which says @samp{Color Red3} not defined. @end quotation @@ -1991,11 +1989,11 @@ Douglas Kosovic <douglask@@dstc.edu.au> writes: @quotation -Actually it's a DEC cc optimisation bug that screws up the regexp +Actually it's a DEC cc optimization bug that screws up the regexp handling in XEmacs. Rebuilding using the @samp{-migrate} switch for DEC cc (which uses a -different sort of optimisation) works fine. +different sort of optimization) works fine. @end quotation See @file{xemacs-19_13-dunix-3_2c.patch} at the following URL on how to @@ -2074,9 +2072,6 @@ @node Q2.1.15, Q2.1.16, Q2.1.14, Installation @section How to Debug an XEmacs problem with a debugger -Ben Wing <ben@@666.com> writes: - -@quotation If XEmacs does crash on you, one of the most productive things you can do to help get the bug fixed is to poke around a bit with the debugger. Here are some hints: @@ -2085,11 +2080,11 @@ @item First of all, if the crash is at all reproducible, consider very strongly recompiling your XEmacs with debugging symbols, with no -optimization, and with the configure options @samp{--debug=yes}, -@samp{--error-checking=all}, and @samp{--dynamic=no}. This will make -your XEmacs run somewhat slower but make it a lot more likely to catch -the problem earlier (closer to its source), and a lot easier to -determine what's going on with a debugger. +optimization, and with the configure options @samp{--debug=yes} and +@samp{--error-checking=all}. This will make your XEmacs run somewhat +slower but make it a lot more likely to catch the problem earlier +(closer to its source), and a lot easier to determine what's going on +with a debugger. @item If you're able to run XEmacs under a debugger and reproduce the crash @@ -2113,8 +2108,8 @@ Internally, you will probably see lots of variables that hold objects of type @code{Lisp_Object}. These are exactly what they appear to be, i.e. references to Lisp objects. Printing them out with the debugger -probably won't be too useful---you'll just see a number. To decode -them, do this: +probably won't be too useful---you'll likely just see a number. To +decode them, do this: @example call debug_print (OBJECT) @@ -2133,14 +2128,23 @@ @end example @item -If all you've got is a core dump, all is not lost. You can still poke -around somewhat, and if you're using GDB, there are some macros in the -file @file{gdbinit} in the @file{src} directory of the XEmacs -distribution that should make it easier for you to decode Lisp objects. - -If you're using DBX, you may be able to get further help from Martin -Buchholz, the engineer at Sun who works on XEmacs. Write to him at -<Martin.Buchholz@@sun.com>. +Using @code{debug_print} and @code{debug_backtrace} has two +disadvantages - it can only be used with a running xemacs process, and +it cannot display the internal C structure of a Lisp Object. Even if +all you've got is a core dump, all is not lost. + +If you're using GDB, there are some macros in the file +@file{src/gdbinit} in the XEmacs source distribution that should make it +easier for you to decode Lisp objects. Copy this file to +@file{~/.gdbinit}, or @code{source} it from @file{~/.gdbinit}, and use +the macros defined therein. In particular, use the @code{pobj} macro to +print the internal C representation of a lisp object. This will work +with a core file or not-yet-run executable. The aliases @code{ldp} and +@code{lbt} are provided for conveniently calling @code{debug_print} and +@code{debug_backtrace}. + +If you are using Sun's @file{dbx} debugger, there is an equivalent file +@file{src/dbxrc} to copy to or source from @file{~/.dbxrc}. @item If you're using a debugger to get a C stack backtrace and you're seeing @@ -2168,7 +2172,7 @@ @item Your stack is getting trashed. Debugging this is hard; you have to do a -binary-search-type of narrowing down where the crash occurs, until you +binary-search type of narrowing down where the crash occurs, until you figure out exactly which line is causing the problem. Of course, this only works if the bug is highly reproducible. @@ -2185,57 +2189,21 @@ @item If you compiled 19.14 with @samp{--debug} (or by default in later versions), you will get a Lisp backtrace output when XEmacs crashes, so -you'll have something useful. If you're in 19.13, you could try doing -@code{call debug_backtrace()}---sometimes this works even after a fatal -signal has been received. +you'll have something useful. @end enumerate + +@item +If you compile with the newer gcc variants gcc-2.8 or egcs, you will +need gdb 4.17. At the time of writing, this has not yet been released. +Pre-releases are available at ftp://ftp.cygnus.com/private/gdb. + +@item +The above information on using @file{src/gdbinit} works for XEmacs-21.0 +and above. For older versions of XEmacs, there are different +@file{gdbinit} files provided in the @file{src} directory. Use the one +corresponding to the configure options used when building XEmacs. + @end itemize -@end quotation - -Here's some more info about using gdbinit: - -Different version of @code{gdbinit} are provided for different -platforms. One of these should be installed as @file{.gdbinit} in your -home directory. If you're using XEmacs 19.14 or better, you should -install the default @code{gdbinit} in the @file{src/} directory if you -have GDB 4.14 or better. With GDB 4.13 or earlier, install -@file{gdbinit.pre-4.14}; however, this is noticeably harder to use. If -you're on a machine that uses a union type for Lisp_Objects (only the -DEC Alpha, I think), you'll have to use @code{gdbinit.union}, which is -of the pre-4.14 variety but should be easily upgradable. - -With XEmacs 19.13 and earlier, only one @code{gdbinit} is provided (I -think); it's of the pre-4.14 variety and of the union-type -variety. (Many more machines used the union type under 19.13). - -With the GDB 4.14+ gdbinit, you can print out a Lisp_Object using -@code{p1 OBJECT} (which calls @code{debug_print()}, and hence only works -if you have a running process) or @code{frob OBJECT} (which works even -on core dumps, and does its own decoding of the object, but its output -isn't always so convenient). - -With the pre-GDB 4.14 gdbinit, you have to do these steps: - -@example -print OBJECT -xtype -<then type "xcons" or "xstring" or whatever, depending on the type> -@end example - -If the object is a record type, you'll probably have to the following -steps: - -@example -print OBJECT -xtype -xrecord -<remember what type is printed> -print OBJECT -<then type "xbuffer" or "xsymbol" or whatever> -@end example - -Of course, if you know in advance what type the object is of, you can -omit all but the last two steps. @node Q2.1.16, Q2.1.17, Q2.1.15, Installation @section XEmacs crashes in @code{strcat} on HP/UX 10 @@ -2395,7 +2363,7 @@ @end quotation @node Q2.1.23, , Q2.1.22, Installation -@section Movemail on Linux does not work for XEmacs 19.15 and later. +@section Movemail on Linux does not work for XEmacs 19.15 and later. Movemail used to work fine in 19.14 but has stopped working in 19.15 and 20.x. I am using Linux. @@ -2421,13 +2389,13 @@ @menu Customization---Emacs Lisp and @file{.emacs}: -* Q3.0.1:: What version of Emacs am I running? +* Q3.0.1:: What version of Emacs am I running? * Q3.0.2:: How do I evaluate Elisp expressions? * Q3.0.3:: @code{(setq tab-width 6)} behaves oddly. * Q3.0.4:: How can I add directories to the @code{load-path}? * Q3.0.5:: How to check if a lisp function is defined? * Q3.0.6:: Can I force the output of @code{(face-list)} to a buffer? -* Q3.0.7:: Font selections don't get saved after @code{Save Options}. +* Q3.0.7:: Font selections don't get saved after @code{Save Options}. * Q3.0.8:: How do I make a single minibuffer frame? * Q3.0.9:: What is @code{Customize}? @@ -2439,13 +2407,13 @@ * Q3.1.5:: How can I get the icon to just say @samp{XEmacs}? * Q3.1.6:: How can I have the window title area display the full path? * Q3.1.7:: @samp{xemacs -name junk} doesn't work? -* Q3.1.8:: @samp{-iconic} it doesn't work. +* Q3.1.8:: @samp{-iconic} doesn't work. Textual Fonts & Colors: * Q3.2.1:: How can I set color options from @file{.emacs}? * Q3.2.2:: How do I set the text, menu and modeline fonts? * Q3.2.3:: How can I set the colors when highlighting a region? -* Q3.2.4:: How can I limit color map usage? +* Q3.2.4:: How can I limit color map usage? * Q3.2.5:: My tty supports color, but XEmacs doesn't use them. The Modeline: @@ -2456,7 +2424,7 @@ * Q3.3.5:: How can one change the modeline color based on the mode used? 3.4 Multiple Device Support: -* Q3.4.1:: How do I open a frame on another screen of my multi-headed display? +* Q3.4.1:: How do I open a frame on another screen of my multi-headed display? * Q3.4.2:: Can I really connect to a running XEmacs after calling up over a modem? How? 3.5 The Keyboard: @@ -2465,7 +2433,7 @@ * Q3.5.3:: How do I bind C-. and C-; to scroll one line up and down? * Q3.5.4:: Globally binding @kbd{Delete}? * Q3.5.5:: Scrolling one line at a time. -* Q3.5.6:: How to map @kbd{Help} key alone on Sun type4 keyboard? +* Q3.5.6:: How to map @kbd{Help} key alone on Sun type4 keyboard? * Q3.5.7:: How can you type in special characters in XEmacs? * Q3.5.8:: Why does @code{(global-set-key [delete-forward] 'delete-char)} complain? * Q3.5.9:: How do I make the Delete key delete forward? @@ -2500,7 +2468,7 @@ * Q3.9.4:: How can I get automatic horizontal scrolling? Text Selections: -* Q3.10.1:: How can I turn off or change highlighted selections? +* Q3.10.1:: How can I turn off or change highlighted selections? * Q3.10.2:: How do I get that typing on an active region removes it? * Q3.10.3:: Can I turn off the highlight during isearch? * Q3.10.4:: How do I turn off highlighting after @kbd{C-x C-p} (mark-page)? @@ -2587,10 +2555,10 @@ variables. Instead, use feature-tests, such as @code{featurep}, @code{boundp}, -@code{fboundp}, or even simple behavioural tests, eg.: +@code{fboundp}, or even simple behavioral tests, eg.: @lisp -(defvar foo-old-losing-code-p +(defvar foo-old-losing-code-p (condition-case nil (progn (losing-code t) nil) (wrong-number-of-arguments t))) @end lisp @@ -2628,7 +2596,7 @@ For XEmacs 19.15 and later: -Implement the above as well as set the following in your @file{.emacs} +Implement the above as well as set the following in your @file{.emacs} @lisp (setq options-save-faces t) @@ -2843,16 +2811,16 @@ (set-face-background 'default "bisque") ; frame background (set-face-foreground 'default "black") ; normal text (set-face-background 'zmacs-region "red") ; When selecting w/ - ; mouse + ; mouse (set-face-foreground 'zmacs-region "yellow") (set-face-font 'default "*courier-bold-r*120-100-100*") -(set-face-background 'highlight "blue") ; Ie when selecting buffers +(set-face-background 'highlight "blue") ; Ie when selecting buffers (set-face-foreground 'highlight "yellow") (set-face-background 'modeline "blue") ; Line at bottom of buffer (set-face-foreground 'modeline "white") (set-face-font 'modeline "*bold-r-normal*140-100-100*") (set-face-background 'isearch "yellow") ; When highlighting while - ; searching + ; searching (set-face-foreground 'isearch "red") (setq x-pointer-foreground-color "black") ; Adds to bg color, ; so keep black @@ -2869,7 +2837,7 @@ In @file{.Xdefaults}: @example -Emacs.default.attributeFont: -*-*-medium-r-*-*-*-120-*-*-m-*-*-* +Emacs.default.attributeFont: -*-*-medium-r-*-*-*-120-*-*-m-*-*-* Emacs*menubar*font: fixed Emacs.modeline.attributeFont: fixed @end example @@ -2898,7 +2866,7 @@ or in your @file{.emacs}: @lisp -(set-face-background 'zmacs-region "red") +(set-face-background 'zmacs-region "red") (set-face-foreground 'zmacs-region "yellow") @end lisp @@ -3020,7 +2988,7 @@ You can use something like the following: @lisp -(add-hook 'lisp-mode-hook +(add-hook 'lisp-mode-hook (lambda () (set-face-background 'modeline "red" (current-buffer)))) @end lisp @@ -3576,7 +3544,7 @@ may need to resize the frame before XEmacs completely realizes the toolbar is really gone. -Thanks to Martin Buchholz <Martin.Buchholz@@sun.com> for the correct +Thanks to Martin Buchholz <martin@@xemacs.org> for the correct code. @node Q3.9.1, Q3.9.2, Q3.8.5, Customization @@ -3589,7 +3557,7 @@ Emacs.scrollBarWidth: 0 @end example -Or select from the @code{Options} menu @code{Frame Appearance->Scrolbars}. +Or select from the @code{Options} menu @code{Frame Appearance->Scrollbars}. Remember to save options. To turn the scrollbar off on a per-frame basis, use the following @@ -3802,7 +3770,7 @@ * Q4.1.3:: Is it true that W3 supports style sheets and tables? Reading Netnews and Mail with Gnus: -* Q4.2.1:: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus,argh! +* Q4.2.1:: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus,argh! * Q4.2.2:: [This question intentionally left blank] * Q4.2.3:: How do I make Gnus stay within a single frame? * Q4.2.4:: How do I customize the From: line? @@ -3815,7 +3783,7 @@ * Q4.3.5:: Where do I find pstogif (required by tm)? Sparcworks, EOS, and WorkShop: -* Q4.4.1:: What is SPARCworks, EOS, and WorkShop +* Q4.4.1:: What is SPARCworks, EOS, and WorkShop Energize: * Q4.5.1:: What is/was Energize? @@ -3894,7 +3862,7 @@ @node Q4.0.7, Q4.0.8, Q4.0.6, Subsystems @section Is there a mailing list or FAQ for VM? -A FAQ for VM exists at <URL:http://www.cyberpass.net/~gorkab/vmfaq.htm>. +A FAQ for VM exists at <URL:http://www.cyberpass.net/~gorkab/vmfaq.htm>. VM has its own newsgroups gnu.emacs.vm.info and gnu.emacs.vm.bug. @@ -3945,7 +3913,7 @@ rmail and VM get new mail from @file{/usr/spool/mail/$USER} using a program called @code{movemail}. This program interlocks with @code{/bin/mail} using the protocol defined by @code{/bin/mail}. - + There are two different protocols in general use. One of them uses the @code{flock} system call. The other involves creating a lock file; @code{movemail} must be able to write in @file{/usr/spool/mail} in order @@ -4254,7 +4222,7 @@ to work on this wonderful editor. @end quotation -Martin Buchholz <Martin.Buchholz@@sun.com> writes: +Martin Buchholz <martin@@xemacs.org> writes: @quotation EOS is being replaced with a new graphical development environment @@ -4315,7 +4283,7 @@ InfoDock menus are much more extensive and more mature than standard Emacs menus. Each menu offers a @samp{Manual} item which displays documentation associated with the menu's functions. - + @noindent Four types of menubars are provided: @enumerate @@ -4375,7 +4343,7 @@ InfoDock is available across the Internet via anonymous FTP. To get it, first move to a directory into which you want the InfoDock archive files placed. We will call this <DIST-DIR>. - + @example cd <DIST-DIR> @end example @@ -4388,7 +4356,7 @@ Login as @samp{anonymous} with your own <user-id>@@<site-name> as a password. -@example +@example Name (ftp.xemacs.org): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: -<your-user-id@@your-domain> @@ -4466,7 +4434,7 @@ Georges Brun-Cottan <bruncott@@dormeur.inria.fr> writes: @quotation -When byte compiling auxtex-9.4g, you must use the command: +When byte compiling auctex-9.4g, you must use the command: @example xemacs -batch -l lpath.el @@ -4559,8 +4527,8 @@ * Q5.0.7:: Telnet from shell filters too much. * Q5.0.8:: Why does edt emulation not work? * Q5.0.9:: How can I emulate VI and use it as my default mode? -* Q5.0.10:: [This question intentionally left blank] -* Q5.0.11:: Filladapt doesn't work in 19.15? +* Q5.0.10:: [This question intentionally left blank] +* Q5.0.11:: Filladapt doesn't work in 19.15? * Q5.0.12:: How do I disable gnuserv from opening a new frame? * Q5.0.13:: How do I start gnuserv so that each subsequent XEmacs is a client? * Q5.0.14:: Strange things are happening in Shell Mode. @@ -4638,7 +4606,7 @@ (makunbound 'c++-mode-map) (makunbound 'c-style-alist) (load-library "old-c-mode") -(load-library "old-c++-mode") +(load-library "old-c++-mode") @end lisp This must be done before any other reference is made to either c-mode or @@ -4807,7 +4775,7 @@ @section [This question intentionally left blank] Obsolete question, left blank to avoid renumbering - + @node Q5.0.11, Q5.0.12, Q5.0.10, Miscellaneous @section Filladapt doesn't work in 19.15 @@ -4823,7 +4791,7 @@ major modes, like this: @lisp -(add-hook 'text-mode-hook 'turn-on-filladapt-mode) +(add-hook 'text-mode-hook 'turn-on-filladapt-mode) @end lisp @node Q5.0.12, Q5.0.13, Q5.0.11, Miscellaneous @@ -4881,7 +4849,7 @@ returned. If I hit return again, the rest of the previous command is given to the shell. -Martin Buchholz <Martin.Buchholz@@sun.com> writes: +Martin Buchholz <martin@@xemacs.org> writes: @quotation There is a known problem with interaction between @code{csh} and the @@ -5265,7 +5233,7 @@ (current-buffer)) @end lisp -Replace @samp{FORMAT} with an unquoted symbol representing the format of +Replace @samp{FORMAT} with an unquoted symbol representing the format of the image (e.g. @code{xpm}, @code{xbm}, @code{gif}, @code{jpeg}, etc.) Instead of @samp{FILE}, use the image file name (e.g. @file{/usr/local/lib/xemacs-20.2/etc/recycle.xpm}). @@ -5278,10 +5246,10 @@ @section @code{map-extents} won't traverse all of my extents! I tried to use @code{map-extents} to do an operation on all the extents -in a region. However, it seems to quit after processing a random number +in a region. However, it seems to quit after processing a random number of extents. Is it buggy? -No. The documentation of @code{map-extents} states that it will iterate +No. The documentation of @code{map-extents} states that it will iterate across the extents as long as @var{function} returns @code{nil}. Unexperienced programmers often forget to return @code{nil} explicitly, which results in buggy code. For instance, the following code is @@ -5315,7 +5283,7 @@ (setq sound-alist nil) @end lisp -That will make your XEmacs totally silent -- even the default ding sound +That will make your XEmacs totally silent -- even the default ding sound (TTY beep on TTY-s) will be gone. Starting with XEmacs-20.2 you can also change these with Customize. @@ -5476,7 +5444,7 @@ (let ((ext (make-extent (point-min) (point-max)))) (set-extent-property ext 'start-closed t) (set-extent-property ext 'end-closed t) - (set-extent-property ext 'detachable nil) + (set-extent-property ext 'detachable nil) (set-extent-end-glyph ext (make-glyph [string :data "[END]"]))) @end lisp @@ -5497,7 +5465,7 @@ (let ((ext (make-extent (point-min) (point-max)))) (set-extent-property ext 'start-closed t) (set-extent-property ext 'end-closed t) - (set-extent-property ext 'detachable nil) + (set-extent-property ext 'detachable nil) (set-extent-end-glyph ext (make-glyph '([xpm :data "\ /* XPM */ static char* eye = @{ @@ -5509,17 +5477,17 @@ \"_c c #fefe00\", \"_d c #fe0000\", \"_e c #bfbfbf\", -\"___________`_`_`___b_b_b_b_________`____\", -\"_________`_`_`___b_c_c_c_b_b____________\", -\"_____`_`_`_e___b_b_c_c_c___b___b_______`\", -\"___`_`_e_a___b_b_d___b___b___b___b______\", -\"_`_`_e_a_e___b_b_d_b___b___b___b___b____\", -\"_`_`_a_e_a___b_b_d___b___b___b___b___b__\", -\"_`_`_e_a_e___b_b_d_b___b___b___b___b_b__\", -\"___`_`_e_a___b_b_b_d_c___b___b___d_b____\", -\"_____`_`_e_e___b_b_b_d_c___b_b_d_b______\", -\"_`_____`_`_`_`___b_b_b_d_d_d_d_b________\", -\"___`_____`_`_`_`___b_b_b_b_b_b__________\", +\"___________`_`_`___b_b_b_b_________`____\", +\"_________`_`_`___b_c_c_c_b_b____________\", +\"_____`_`_`_e___b_b_c_c_c___b___b_______`\", +\"___`_`_e_a___b_b_d___b___b___b___b______\", +\"_`_`_e_a_e___b_b_d_b___b___b___b___b____\", +\"_`_`_a_e_a___b_b_d___b___b___b___b___b__\", +\"_`_`_e_a_e___b_b_d_b___b___b___b___b_b__\", +\"___`_`_e_a___b_b_b_d_c___b___b___d_b____\", +\"_____`_`_e_e___b_b_b_d_c___b_b_d_b______\", +\"_`_____`_`_`_`___b_b_b_d_d_d_d_b________\", +\"___`_____`_`_`_`___b_b_b_b_b_b__________\", @} ;"] [string :data "[END]"])))) @end lisp @@ -5590,7 +5558,7 @@ couple of suggestions here---either something like: @lisp -(setq mail-default-headers +(setq mail-default-headers "X-Face: <Ugly looking text string here>") @end lisp @@ -5598,7 +5566,7 @@ @lisp (defun mail-insert-x-face () - (save-excursion + (save-excursion (goto-char (point-min)) (search-forward mail-header-separator) (beginning-of-line) @@ -5629,11 +5597,11 @@ Contributors for this item: -Paul Emsley, +Paul Emsley, Ricardo Marek, Amir J. Katz, Glen McCort, -Heinz Uphoff, +Heinz Uphoff, Peter Arius, Paul Harrison, and Vegard Vesterheim @@ -5644,7 +5612,7 @@ You use something like: @lisp -(setq Info-directory-list (cons +(setq Info-directory-list (cons (expand-file-name "~/info") Info-default-directory-list)) @end lisp
--- a/nt/ChangeLog Mon Aug 13 10:27:41 2007 +0200 +++ b/nt/ChangeLog Mon Aug 13 10:28:48 2007 +0200 @@ -1,3 +1,7 @@ +1998-04-01 Kirill M. Katsnelson <kkm@kis.ru> + + * config.h: Patial sync-up with config.h.in + 1998-03-25 jhar@tardis.ed.ac.uk * xemacs.mak: Adds glyphs-msw.c and imgproc.c and reflects
--- a/nt/config.h Mon Aug 13 10:27:41 2007 +0200 +++ b/nt/config.h Mon Aug 13 10:28:48 2007 +0200 @@ -421,16 +421,7 @@ compiling-running-crashing. */ #undef NO_DOC_FILE - /* To eliminate use of `const' in the XEmacs sources, - do `#define CONST_IS_LOSING' */ -/* #define CONST_IS_LOSING hell, const works with VC! - kkm */ - -# undef CONST -# ifdef CONST_IS_LOSING -# define CONST -# else -# define CONST const -# endif /* CONST */ +#define CONST const /* If not defined, use unions instead of ints. A few systems (DEC Alpha) seem to require this, probably because something with the int @@ -631,15 +622,14 @@ #define listen Rlisten #endif /* HAVE_SOCKS && !DO_NOT_SOCKSIFY */ -#ifndef SHORTBITS -#define SHORTBITS (8 * SIZEOF_SHORT) +#ifndef BITS_PER_CHAR +#define BITS_PER_CHAR 8 #endif -#ifndef INTBITS -#define INTBITS (8 * SIZEOF_INT) -#endif -#ifndef LONGBITS -#define LONGBITS (8 * SIZEOF_LONG) -#endif +#define SHORTBITS (SIZEOF_SHORT * BITS_PER_CHAR) +#define INTBITS (SIZEOF_INT * BITS_PER_CHAR) +#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) /* MSVC version >= 2.x without /Za supports __inline */ #if (_MSC_VER < 900) || defined(__STDC__)
--- a/src/ChangeLog Mon Aug 13 10:27:41 2007 +0200 +++ b/src/ChangeLog Mon Aug 13 10:28:48 2007 +0200 @@ -1,3 +1,565 @@ +1998-04-04 Martin Buchholz <martin@xemacs.org> + + * emacs.c: #include <paths.h>, not "paths.h" + This is a standard bug. It manifests if you configure in the + source tree, then configure elsewhere with --srcdir. + Remove misleading PATH_EXEC comment; PATH_PACKAGEPATH is also used. + +1998-04-04 Olivier Galibert <galibert@pobox.com> + + * s/386bsd.h: Removed obsolete define. + +1998-04-04 Olivier Galibert <galibert@pobox.com> + + * s/386-ix.h: Removed useless define. + + * sysdep.c (insque): Removed. Not used anywhere in the code. + +1998-04-04 Olivier Galibert <galibert@pobox.com> + + * process-unix.c (unix_kill_child_process): Use TIOCSIGSEND or + TIOCSIGNAL as needed. + + * s/usg5-4.h: Remove kludgy TIOCSIGSEND #define which breaks on + irix 6.5. + +1998-03-28 Hrvoje Niksic <hniksic@srce.hr> + + * insdel.c (emchar_string_displayed_columns): Simplify for + non-Mule case. + + * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): Issue nicer output. + +1998-04-01 Martin Buchholz <martin@xemacs.org> + + * sysdir.h (sys_mkdir): + * sysfile.h (sys_read): + (sys_write): + (sys_chmod): + (sys_creat): + + * sysdep.c (sys_read_1): + (sys_read): + (sys_write_1): + (sys_write): + (sys_mkdir): + (sys_readlink): + (sys_chmod): + (sys_creat): + + * nt.c (sys_read): + (sys_chmod): + (sys_creat): + (sys_write): Change types of sys_* in accordance with published + standards. Use size_t and mode_t instead of unsigned int and int. + +1998-04-03 Martin Buchholz <martin@xemacs.org> + + * config.h.in (enum_field): + * lisp-union.h: + * extents.h: + * redisplay.c (add_margin_runes): + Prefer enums for use as bitfields in preference to unsigned int, + but allow the possibility to suppress it if a compiler disallows + it or emits annoying warnings. Currently only __SUNPRO_C cc -Xc + used unsigned ints. + + * event-stream.c: Fixup DEFVAR for + Vcomposed_character_default_binding; Real bug! + * event-msw.c: Rename mswindows_button2* to mswindows_mouse_button* + * emacs.c: Rename suppress_early_backtrace to + suppress_early_error_handler_backtrace + * objects-x.c: Rename handle_nonfull_spec_fonts to + x_handle_non_fully_specified_fonts + * lread.c: Rename puke_on_fsf_keys to + fail-on-bucky-bit-character-escapes + * lread.c: + * doc.c: Rename Vdoc_file_name to Vinternal_doc_file_name + * fileio.c: + * bufslots.h: + * buffer.c: Rename save_length to saved_size + * alloc.c: Rename pureptr to pure_bytes_used + * abbrev.c: Rename last_abbrev_point to last_abbrev_location + * lisp.h: + DEFVAR_* are supposed to be named following a standard convention. + +1998-04-03 Martin Buchholz <martin@xemacs.org> + + * callint.c: + * ralloc.c: + * data.c: + * eldap.c: + * extents.c: + * frame-msw.c: + * frame-x.c: + * general.c: + * process.c: + * xselect.c: + Rationalize defsymbol handling. + defsymbols are supposed to have equivalent C and Lisp names, for + consistency. At least one real bug (end-glyph-layout) fixed. + Move multiply defsymbol'ed stuff into general.c. + +1998-04-03 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * m/ibmrs6000.inp: Removed; obsoleted by configure.in changes. + +1998-04-03 Martin Buchholz <martin@xemacs.org> + + * console-tty.c (Fset_console_tty_input_coding_system): + (Fset_console_tty_output_coding_system): + Input/Output and encoding/decoding were reversed. + +1998-04-02 SL Baur <steve@altair.xemacs.org> + + * m/powerpc.h: Remove LD_SWITCH_MACHINE for Linux. + +1998-04-02 Greg Klanderman <greg@alphatech.com> + + * window.c (set_window_pixsize): Move up call to + check_min_window_sizes. + + * indent.c (vmotion_1): renamed from vmotion() and added + additional argument to optionally return the pixel motion. + (vpix_motion): Helper for vmotion_1. + (vmotion): Wrapper - just call vmotion_1() with the right args. + (Fvertical_motion_pixels): New function. + (syms_of_indent): DEFSUBR it. + +1998-04-02 Martin Buchholz <martin@xemacs.org> + + * xselect.c: + * event-Xt.c: + * emacs.c: + Remove last vestiges of #ifdef EPOCH code. It had no chance of + working anyways. In honour of seeing Marc Andreesen in person for + the first time today. + +1998-04-01 Martin Buchholz <martin@xemacs.org> + + * extents.h: + * lisp-union.h: + Don't use enums as bitfields - only unsigned ints. + Fixes: warning: nonportable bit-field type + + * eval.c (call_with_suspended_errors): More volatilizing to + appease Sunpro cc. + + * mem-limits.h: + * ralloc.c: Remove #undef NULL; they're not even used! + + * process-unix.c (unix_send_process): send_process is a method, so + we can't include volatile in the prototype. We make the argument + non-volatile, make a volatile copy, and then use that instead. + + * frame-x.c (x_delete_frame): The `frame' variable is initialized + but not actually used. + + * Makefile.in.in (xselect.o): The last line of b34-pre2's + src/Makefile.in.in contains a dependency that should have been + patched away. + (mostlyclean): Remove the removal of depend.* - no such files + exist anymore + + * make-src-depend: include a dependency on only one of + lisp-union.h or lisp-disunion.h. + +1998-04-01 Martin Buchholz <martin@xemacs.org> + + * specifier.c (specifier_instance_from_inst_list): A nanosecond + saved is a nanosecond earned. + +1998-03-31 Greg Klanderman <greg@alphatech.com> + + * redisplay.c (update_line_start_cache): Fix bug involving + invisible text in which the line_start_cache gets hosed. + +Sun Mar 29 1998 Andy Piper <andyp@parallax.co.uk> + + * console-msw.h: define FRAME_MSWINDOWS_CDC. + + * frame-msw.c: (mswindows_set_frame_icon) new function. Works but + no masks as yet. + + * glyphs-msw.c: GNUize the code. Fix 24bpp display and make the + default. Add managment of icons. + + * glyphs-msw.h: add icon attributes. + + * redisplay-msw.c: (mswindows_output_pixmap) remove unused cursor + code. + + * objects-msw.c: eliminate char subscript warning. + +1998-04-01 SL Baur <steve@altair.xemacs.org> + + * sysdll.c (dll_close): fix typo. + Suggested by Marcus Thiessel <marcus_thiessel@hp.com> + + +1998-03-28 Kyle Jones <kyle_jones@wonderworks.com> + + * device.c (Fset_device_class): Recompute cached + specifiers everywhere if device class is changed. + Set various redisplay flags so that the device's + various frames are redisplayed. + +1998-03-31 SL Baur <steve@altair.xemacs.org> + + * lrecord.h (DECLARE_NONRECORD): Remove redundant paren. + Suggested by Martin Buchholz <martin@xemacs.org> + +1998-04-01 Kirill M. Katsnelson <kkm@kis.ru> + + * gui.c (gui_item_display_flush_left): Fix suffix length. + +1998-04-01 Kirill M. Katsnelson <kkm@kis.ru> + + * s/windowsnt.h: Defined SIZEOF_LONG_LONG and SIZEOF_VOID_P + + * dired-msw.c: Included <limits.h> + + * config.h.in (VOID_P_BITS): Fixed so that uses SIZEOF_VOID_P + +1998-03-31 SL Baur <steve@altair.xemacs.org> + + * glyphs.c (image_instantiate_cache_result): Correct order of + parameters to Fputhash. + Suggested by Kirill M. Katsnelson <kkm@kis.ru> + +1998-03-30 Martin Buchholz <martin@xemacs.org> + + * redisplay.c (create_right_glyph_block): glyph_type should really + be glyph_layout. + +1998-03-29 Martin Buchholz <martin@xemacs.org> + + * sysfile.h: Move all encapsulations from lisp.h/emacsfns.h into + sysfile.h. Users of the functionality herein will have to + #include sysfile.h. + Check all .o files for missing #includes. + * config.h.in: + Discovered that config.h.in was missing ENCAPSULATE_CLOSEDIR, as a + result of fixing the above. + + * gui.c (gui_item_add_keyval_pair): We should not use the idiom + error ("%S", lisp_object) in C code. + I converted the code to use signal_simple_error_2 instead. + (signal_too_long_error): Ditto. + + * glyphs.c (image_instantiate_cache_result): Use XC[AD]R instead + of Fc[ad]r. This is always called with valid conses, and in fact, + already assumed it. + + * font-lock.c (find_context): Use context_none with context + instead of ccontext_none. + + * fns.c (Flength): The CONSP and NILP code can be combined. + Change the name of the arg to SEQUENCE from OBJ. + (Fnthcdr): CHECK_NATNUM instead of CHECK_INT. Optimize out Fcdr calls. + (Felt): Change argument from seq to sequence to match docstring. + +1998-03-28 Martin Buchholz <martin@xemacs.org> + + * fns.c (string_putprop): + (string_getprop): Make method functions static. + + * window.c (find_window_by_pixel_pos): Warning suppression. + + * imgproc.c (splitbox): Warning suppression. + + * redisplay-x.c (x_output_eol_cursor): Remove redundant XSETWINDOW. + + * glyphs-x.c (signal_image_error): + (signal_image_error_2): + (convert_EImage_to_XImage): Make functions static. + + * editfns.c (Fbuffer_size): Rename the `F' function to + Fbuffer_size in accordance with coding standards. + + * dll.c (Fdll_open): Fix up data conversion. + Provide auxiliary function maybe_call_library_function(). + + * device-x.c (get_x_display): make function static. + + * data.c (Fcar): Should generate listp, not consp error. + (Fcdr): Should generate listp, not consp error. + +1998-03-27 Martin Buchholz <martin@xemacs.org> + + * console-tty.c (free_tty_console_struct): + Replace con->console_data with CONSOLE_type_DATA (con) + + * *.[ch]: C++ compilability of xemacs, on Linux and Solaris. + + * casetab.c (Fcase_table_p): Optimize. + + * eval.c: + * bytecode.c: + Rename Fcondition_case_3 to condition_case_3 - it's not a DEFUN. + + * buffer.h: + Remove all *BUFFER_OR_STRING* macros - unused. + (memind_to_bytind): Merge two versions of function by moving + #ifdef ERROR_CHECK_BUFPOS into the function body. + (*_DATA_ALLOCA*): get types correct. rewrite for clarity. + + * balloon_help.c (balloon_help_destroy): rearrange order of + functions, and remove prototype from header file. + + * alloc.c (deadbeef_memory): Rewrite. Use size_t for clarity. + Don't bother with the left-over bytes, since in practice we will + always get called with a size multiple of 4. + (Fmake_list): CHECK_NATNUM instead of CHECK_INT + (vector[4567]): Currently unused; ifdef out. + (make_pure_float): make function static. + (garbage_collect_1): Optimize. + +1998-03-23 Martin Buchholz <martin@xemacs.org> + + * marker.c (print_marker): Fix compiler warning, real bug! + + * device.h (MARK_DEVICE_FRAMES_FACES_CHANGED): + * frame.h (MARK_FRAME_FACES_CHANGED): + (MARK_FRAME_TOOLBARS_CHANGED): + (MARK_FRAME_SIZE_CHANGED): + (MARK_FRAME_CHANGED): + (MARK_FRAME_WINDOWS_CHANGED): + (MARK_FRAME_WINDOWS_STRUCTURE_CHANGED): + Fix multiple evaluation of macro arguments. + Macros are a fact of life. Callers have to use temp variables to + avoid multiple evaluation of arguments. + + * data.c (Ftrue_list_p): New function, with obvious meaning. + This is terminology from Cltl2. + Also define a corresponding macro TRUE_LIST_P. + + * device-x.c (validify_resource_component): Optimize. Rename. + Use the standard technique of using a precomputed table of valid chars. + + (x_get_resource_prefix): + (Fx_get_resource): + (Fx_get_resource_prefix): + Avoid fixed buffer sizes. Use a char_dynarr. + Run validify_resource_component on all computed components. + + * lisp.h: Define a char_dynarr type. + +1998-03-22 Martin Buchholz <martin@xemacs.org> + + * fns.c (Fcopy_alist): Optimize. + + * alloc.c (acons): New function. Now used in the C code. + Definition in cl.el is commented out. Add docstring. + Use acons in functions which create alists. + * lisp/cl.el (acons): Add docstring. Really otta be a macro, tho. + + * buffer.c (Fbuffer_memory_usage): + * window.c (Fwindow_memory_usage): + Clean up horrible consing code using new acons function. + Fix incorrect value reported for gap-overhead. + + * fns.c (Fmember): + (Fold_member): + (Fmemq): + (Fold_memq): + (memq_no_quit): + (Fassoc): + (Fold_assoc): + (Fassq): + (Fold_assq): + (assq_no_quit): + (Frassoc): + (Fold_rassoc): + (Frassq): + (Fold_rassq): + (rassq_no_quit): + (Fdelete): + (Fold_delete): + (Fdelq): + (Fold_delq): + (delq_no_quit): + (delq_no_quit_and_free_cons): + (Fremassoc): + (Fremassq): + (remassq_no_quit): + (Fremrassoc): + (Fremrassq): + (remrassq_no_quit): + (Fnreverse): + (Freverse): + (Fnthcdr): + Optimize. + Replace calls to Fcar, Fcdr, Fsetcar with XCAR and XCDR. + Simplify logic. + Many of these functions wouldn't QUIT if called on cyclic lists. + e.g. try (progn (setq x '(nil)) (setcdr x x) (reverse x)) + One benchmark of delq showed it to be 3 times faster. + + * emacs.c: + * database.c: + Cleanup of database functions. + Make the get_subtype and get_type methods return Lisp_Objects, + instead of C strings. No more need for both dbm_type and dbm_lisp_type. + Rewrite the doc strings to be consistent with XEmacs tradition. + Replace old `dbm' names with `database'. + Rename struct database to struct Lisp_Database. + Rename DEFUN arguments to `database', when applicable. + + * buffer.c: + * chartab.c: + * console.c: + * data.c: + * database.c: + * device.c: + * elhash.c: + * eval.c: + * event-stream.c: + * extents.c: + * faces.c: + * frame.c: + * glyphs.c: + * keymap.c: + * lstream.c: + * mule-charset.c: + * mule-coding.c: + * objects.c: + * opaque.c: + * process.c: + * rangetab.c: + * specifier.c: + * symbols.c: + * tooltalk.c: + * window.c: + Place DEFINE_LRECORD_* after definition of static object methods, to + avoid redundant declarations. + + * console.c: + * console.h: + * device.c: + * device.h: + * extents.c: + * extents.h: + * frame.c: + * frame.h: + * glyphs.c: + * glyphs.h: + * lisp.h: + * lstream.c: + * lstream.h: + * signal.c: + * specifier.c: + * specifier.h: + Eliminate MAC_* macros. + The MAC_ macros use non-standard comiler extenstions which cause + gcc to generate bad code on Sparc/Solaris. Attractive though the + idea of using those compiler extensions is, they are just not + robust enough to use in the real world. So we eliminate them. + We put up with some sub-optimalities, like macros with multiple + evaluation. Such is life with C. The MAC_ macros were pretty + darn ugly anyways. We CAN use inline functions, since the advent + of C++ means that compilers must support those anyways. + +1998-03-21 Martin Buchholz <martin@xemacs.org> + + * alloc.c (list*): Optimize recursion levels. + + * alloc.c: Add debugger support via enum dbg_constants. + * gdbinit: Complete rewrite. + * gdbinit.union: Remove + * gdbinit.pre-4.14: Remove + * dbxrc: Complete rewrite. + * man/xemacs-faq.texi: + Proper robust debugger support for gdb and Sun's dbx. + Support all combinations of Kylish DEFINEs. + Work out of the box with no user customizations. + See the updated faq for details. + + * emacsfns.h: Remove. Move declarations to lisp.h + * dynarr.h: Remove. Move declarations to lisp.h + * lisp.h. + Optimize header file handling to improve compile time over a network. + Introduce EXFUN macro for external declaration to correspond to DEFUN. + Include header files only when necessary, i.e. not from lisp.h: + - unistd.h, limits.h, fnctl.h, blocktype.h, dynarr.h, emacsfns.h + + + * lisp.h: + * lisp-union.h: + * lisp-disunion.h: + Rewrite low level object frobbing. + Make it safe to use XSETOBJ on uninitialized Lisp_Objects. + (markbit might have been set otherwise) + Move XPRNTRVAL->XPNTR computation out of lisp-*union.h, since it + is union-type-independent. + + * EmacsFrame.c: + * alloc.c: + * chartab.c: + * console.c: + * dialog-x.c: + * doc.c: + * elhash.c: + * eval.c: + * event-Xt.c: + * event-stream.c: + * event-unixoid.c: + * extents.c: + * faces.c: + * file-coding.c: + * frame.c: + * glyphs.c: + * insdel.c: + * keymap.c: + * lstream.c: + * marker.c: + * menubar-x.c: + * mule-coding.c: + * opaque.c: + * ralloc.c: + * rangetab.c: + * redisplay-msw.c: + * redisplay-output.c: + * redisplay-tty.c: + * redisplay-x.c: + * redisplay.c: + * scrollbar-x.c: + * scrollbar.c: + * specifier.c: + * symbols.c: + * toolbar-x.c: + * toolbar.c: + * window.c: + As a result of the above lisp*.h changes, we can now safely remove + initializations of Lisp_Objects before calling XSETOBJ on them. + This was only being done half the time, anyways. + + * Makefile.in.in (depend): New target. calls make-src-depend. + * depend: New file. Generated by make-src-depend + * make-src-depend: New file. generates up-to-date dependencies. + Makefile dependencies are now automagically maintained, and + CORRECT. lisp.h and friends are now included in the dependencies, + since this complies with the principle of least astonishment. + + * symbols.c (symbol_is_constant): Optimize. + +1998-03-30 SL Baur <steve@altair.xemacs.org> + + * frame.c (vars_of_frame): Default frame name should be InfoDock + for InfoDock. + +1998-03-29 SL Baur <steve@altair.xemacs.org> + + * emacs.c (voodoo_free_hook): ELF libraries built with newer + versions of GCC do horrible things in dumped binaries after exit() + is called. + (Fkill_emacs): Use it. + +1998-03-28 SL Baur <steve@altair.xemacs.org> + + * s/linux.h: For simplicity, do not use standard linking because + it is deadly with new GCC. + Sat Mar 28 10:16:29 1998 Andy Piper <andyp@parallax.co.uk> * Makefile.in.in: fix fastdump target
--- a/src/EmacsFrame.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/EmacsFrame.c Mon Aug 13 10:28:48 2007 +0200 @@ -375,7 +375,7 @@ { EmacsFrame cur = (EmacsFrame) cur_widget; EmacsFrame new = (EmacsFrame) new_widget; - Lisp_Object frame = Qnil; + Lisp_Object frame; XSETFRAME (frame, new->emacs_frame.frame); in_resource_setting++;
--- a/src/EmacsShell-sub.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/EmacsShell-sub.c Mon Aug 13 10:28:48 2007 +0200 @@ -352,7 +352,7 @@ if (!XtIsRealized (wid)) { Widget child = NULL; - int i; + Cardinal i; /* the managed child indicates what our size is */ for (i = 0; i < w->composite.num_children; i++) {
--- a/src/Makefile.in.in Mon Aug 13 10:27:41 2007 +0200 +++ b/src/Makefile.in.in Mon Aug 13 10:28:48 2007 +0200 @@ -27,7 +27,7 @@ ## For performance and consistency, no built-in rules. .SUFFIXES: -.SUFFIXES: .c .cc .o .i .h .dep +.SUFFIXES: .c .h .o .i .s .dep @SET_MAKE@ SHELL=/bin/sh @@ -51,14 +51,8 @@ LDFLAGS=@LDFLAGS@ RECURSIVE_MAKE=@RECURSIVE_MAKE@ -c_switch_general=@c_switch_general@ -c_switch_window_system=@c_switch_window_system@ c_switch_all=@c_switch_all@ -ld_switch_general=@ld_switch_general@ -ld_switch_window_system=@ld_switch_window_system@ ld_switch_all=@ld_switch_all@ -ld_libs_general=@ld_libs_general@ -ld_libs_window_system=@ld_libs_window_system@ ld_libs_all=@ld_libs_all@ ld_dynamic_link_flags=@ld_dynamic_link_flags@ @@ -89,7 +83,6 @@ #ifdef USE_GNU_MAKE vpath %.c @srcdir@ -vpath %.cc @srcdir@ vpath %.h @srcdir@ ## now list files that should NOT be searched in the srcdir. ## This includes any .c or .h built from something else @@ -117,9 +110,6 @@ $(lwlib_libs) : cd ../lwlib && $(RECURSIVE_MAKE) -## a separate offix lib which merges with non-Xt event systems (TkStep, XEmacs) -OFFIX_O = @OFFIX_O@ - x_objs=balloon_help.o balloon-x.o console-x.o device-x.o event-Xt.o frame-x.o\ glyphs-x.o objects-x.o redisplay-x.o xgccache.o xselect.o @@ -127,7 +117,7 @@ LIBI18N = -li18n #endif /* AIX4 */ -X11_libs= $(LIBX11_LIBS) $(libx11_intl) $(LIBI18N) +X11_libs = $(LIBI18N) #endif /* HAVE_X_WINDOWS */ #ifdef HEAP_IN_DATA @@ -139,7 +129,7 @@ cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all) cflags = $(CFLAGS) $(cppflags) -ldflags = $(ld_switch_all) $(ld_dynamic_link_flags) +ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags) #ifdef SOLARIS2 %.o : %.c @@ -148,16 +138,17 @@ #endif $(CC) -c $(cflags) $< -#ifdef SOLARIS2 -%.o : %.cc -#else -.cc.o: -#endif - $(CC) -c $(cflags) $< - ## Create preprocessor output (debugging purposes only) .c.i: +#ifdef __GNUC__ + $(CC) -E $(cppflags) -o $@ $< +#else /* works on Solaris; what about other systems? */ $(CC) -P $(cppflags) $< +#endif /* compiler */ + +## Create assembler output (debugging purposes only) +.c.s: + $(CC) -S -c $(cflags) $< ## Create RTL files %.c.rtl : %.c @@ -274,7 +265,7 @@ all: ${other_files} # endif /* EXTERNAL_WIDGET */ -X11_objs = $(OFFIX_O) EmacsFrame.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o $(external_widget_objs) +X11_objs = EmacsFrame.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o $(external_widget_objs) #endif /* HAVE_X_WINDOWS */ ## define otherobjs as list of object files that make-docfile @@ -321,6 +312,7 @@ @$(RM) $@ && touch SATISFIED -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump @if test -f $@; then if test -f SATISFIED; then \ + echo "Testing for Lisp shadows ..."; \ ./xemacs -batch -vanilla -f list-load-path-shadows; fi; \ $(RM) SATISFIED; exit 0; fi; \ if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \ @@ -345,10 +337,10 @@ obj_src = $(objs:.o=.c) dortl : $(obj_rtl) $(otherrtls) - echo "(defvar source-files '(" > ${srcdir}/../lisp/source-files.el + echo "(defvar source-files '(" > ${srcdir}/../lisp/source-files.el (for a in $(obj_src) $(othersrcs);do \ echo -n "\""$$a"\"" >> ${srcdir}/../lisp/source-files.el ;\ - done) + done) echo "))" >> ${srcdir}/../lisp/source-files.el #ifdef DYNODUMP @@ -435,11 +427,11 @@ ## ## Purify, Quantify, PureCoverage are software quality products from ## Rational, formerly Pure Atria, formerly Pure Software. -## +## ## None of these products work with a dumped xemacs binary, because it ## does unexpected things like free memory that has been malloc'ed in ## a *different* process!! So we need to run these on temacs. -## +## .PHONY : run-rtcmacs run-puremacs run-quantmacs @@ -658,7 +650,7 @@ .PHONY: mostlyclean clean distclean realclean versionclean extraclean mostlyclean: - $(RM) temacs puremacs quantmacs prefix-args depend.* *.o *.i \ + $(RM) temacs puremacs quantmacs prefix-args *.o *.i \ core temacs.exe puresize-adjust.h sheap-adjust.h clean: mostlyclean versionclean $(RM) libextcli* update-elc.stamp @@ -682,2105 +674,9 @@ relock: chmod -w $(SOURCES) -#ifdef __GNUC__ - -## Dependency processing using GCC - -.c.dep: - $(CC) -MM $(cflags) $< > $*.dep - -obj_dep = $(objs:.o=.dep) - -.PHONY : depend gnu-depend -## #### Needs a bit of work: it doesn't see the object files that -## we are not compiling -gnu-depend: $(obj_dep) - cat $(obj_dep) | sh ${libsrc}process-gnu-depends.sh > depend.out - -#endif /* GCC */ - -## Dependency processing using makedepend -## This hasn't been used in over a year as of December 10, 1997. - -depend: - : > depend.tmp - makedepend -f depend.tmp -Dsubprocesses \ - -DHAVE_X_WINDOWS -DMULE -- $(cppflags) $(cflags) \ - -- *.c - sh ${libsrc}process-depends.sh < depend.tmp > depend.out - egrep '^mule|[^a-zA-Z]mule' depend.out > /tmp/depend1.$$ - grep -v '^mule' depend.out | grep -v '[^a-zA-Z]mule' > /tmp/depend2.$$ - echo '#ifdef MULE' > depend.out - cat /tmp/depend1.$$ >> depend.out - @# The things you have to do to pay homage to the lexer God ... frightening - echo '#endif /''* MULE *''/' >> depend.out - echo '' >> depend.out - cat /tmp/depend2.$$ >> depend.out - $(RM) /tmp/depend1.$$ /tmp/depend2.$$ - -## Manually-generated dependencies (makedepend misbehaves on these) - -## (actually makedepend does OK on these but we want to conditionalize them) -#ifdef EXTERNAL_WIDGET -ExternalClient-Xlib.o: extw-Xlib.h -ExternalClient-Xm.o: config.h -ExternalClient-Xm.o: xintrinsicp.h -ExternalClient-Xm.o: ExternalClient.h -ExternalClient-Xm.o: ExternalClientP.h -ExternalClient-Xm.o: extw-Xlib.h -ExternalClient-Xm.o: extw-Xt.h -ExternalClient-Xt.o: config.h -ExternalClient-Xt.o: xintrinsicp.h -ExternalClient-Xt.o: ExternalClient.h -ExternalClient-Xt.o: ExternalClientP.h -ExternalClient-Xt.o: extw-Xlib.h -ExternalClient-Xt.o: extw-Xt.h -ExternalShell.o: ExternalShell.h -ExternalShell.o: ExternalShellP.h -ExternalShell.o: config.h -ExternalShell.o: extw-Xlib.h -ExternalShell.o: extw-Xt.h -ExternalShell.o: xintrinsic.h -ExternalShell.o: xintrinsicp.h -extw-Xlib-shared.o: config.h -extw-Xlib-shared.o: extw-Xlib.h -extw-Xt-shared.o: config.h -extw-Xt-shared.o: extw-Xlib.h -extw-Xt-shared.o: extw-Xt.h -extw-Xlib-nonshared.o: config.h -extw-Xlib-nonshared.o: extw-Xlib.h -extw-Xt-nonshared.o: config.h -extw-Xt-nonshared.o: extw-Xlib.h -extw-Xt-nonshared.o: extw-Xt.h -#endif /* EXTERNAL_WIDGET */ - -#ifdef EMACS_BTL -cadillac-btl.o: $(BTL_dir)/cadillac-btl.c -cadillac-btl.o: $(BTL_dir)/cadillac-btl.h -cadillac-btl.o: $(BTL_dir)/cadillac-btl-extern.h -cadillac-btl-asm.o: $(BTL_dir)/cadillac-btl-asm.c -cadillac-btl-asm.o: $(BTL_dir)/cadillac-btl.h -cadillac-btl-asm.o: $(BTL_dir)/cadillac-btl-extern.h -cadillac-btl-emacs.o: $(BTL_dir)/cadillac-btl-extern.h -cadillac-btl-process.o: $(BTL_dir)/cadillac-btl-process.c -cadillac-btl-process.o: $(BTL_dir)/cadillac-btl.h -cadillac-btl-process.o: $(BTL_dir)/cadillac-btl-extern.h -#endif /* EMACS_BTL */ - -## (makedepend definitely misbehaves on these) -sgiplay.o: config.h -sgiplay.o: libst.h -unexconvex.o: getpagesize.h -unexec.o: getpagesize.h -unexaix.o: config.h -unexalpha.o: config.h -unexapollo.o: config.h -unexconvex.o: config.h -unexec.o: config.h -unexelf.o: config.h -unexenix.o: config.h -unexfreebsd.o: config.h -unexhp9k3.o: config.h -unexhp9k800.o: config.h -unexmips.o: config.h -unexsunos4.o: config.h - -## Dependencies (formerly) generated by 'make depend' - -## This has been hand-maintained since (at least) some time in 1996 -## Note: We deliberately do not include a dependency on lisp.h - -#ifdef FILE_CODING -callproc.o: file-coding.h -console-tty.o: file-coding.h -event-Xt.o: file-coding.h -event-stream.o: file-coding.h -file-coding.o: config.h -file-coding.o: buffer.h -file-coding.o: elhash.h -file-coding.o: file-coding.h -file-coding.o: insdel.h -file-coding.o: lstream.h -#ifdef MULE -file-coding.o: mule-ccl.h -#endif -fileio.o: file-coding.h -glyphs-x.o: file-coding.h -inline.o: file-coding.h -lread.o: file-coding.h -md5.o: file-coding.h -#ifdef HAVE_CANNA -mule-canna.o: file-coding.h -#endif -#ifdef MULE -mule-ccl.o: file-coding.h -#endif -process.o: file-coding.h -process-unix.o: file-coding.h -redisplay-x.o: file-coding.h -redisplay.o: file-coding.h -#endif - -#ifdef MULE -EmacsFrame.o: mule-charset.h -abbrev.o: mule-charset.h -alloc.o: mule-charset.h -buffer.o: mule-charset.h -bytecode.o: mule-charset.h -callint.o: mule-charset.h -callproc.o: mule-charset.h -casefiddle.o: mule-charset.h -casetab.o: mule-charset.h -chartab.o: mule-charset.h -cmdloop.o: mule-charset.h -cmds.o: mule-charset.h -console-tty.o: mule-charset.h -console.o: mule-charset.h -data.o: mule-charset.h -device-tty.o: mule-charset.h -device-x.o: mule-charset.h -device.o: mule-charset.h -dialog-x.o: mule-charset.h -dired.o: mule-charset.h -doc.o: mule-charset.h -doprnt.o: mule-charset.h -editfns.o: mule-charset.h -emacs.o: mule-charset.h -eval.o: mule-charset.h -event-Xt.o: mule-charset.h -event-stream.o: mule-charset.h -events.o: mule-charset.h -extents.o: mule-charset.h -faces.o: mule-charset.h -fileio.o: mule-charset.h -filelock.o: mule-charset.h -fns.o: mule-charset.h -font-lock.o: mule-charset.h -frame-x.o: mule-charset.h -frame.o: mule-charset.h -glyphs-x.o: mule-charset.h -glyphs.o: mule-charset.h -gui-x.o: mule-charset.h -indent.o: mule-charset.h -inline.o: mule-charset.h -insdel.o: mule-charset.h -keymap.o: mule-charset.h -lread.o: mule-charset.h -lstream.o: mule-charset.h -macros.o: mule-charset.h -marker.o: mule-charset.h -md5.o: mule-charset.h -menubar-x.o: mule-charset.h -minibuf.o: mule-charset.h -#ifdef HAVE_CANNA -mule-canna.o: blocktype.h -mule-canna.o: buffer.h -mule-canna.o: bufslots.h -mule-canna.o: config.h -mule-canna.o: dynarr.h -mule-canna.o: mule-charset.h -#endif /* HAVE_CANNA */ -mule-ccl.o: blocktype.h -mule-ccl.o: buffer.h -mule-ccl.o: bufslots.h -mule-ccl.o: config.h -mule-ccl.o: dynarr.h -mule-ccl.o: mule-charset.h -mule-charset.o: blocktype.h -mule-charset.o: buffer.h -mule-charset.o: bufslots.h -mule-charset.o: chartab.h -mule-charset.o: config.h -mule-charset.o: dynarr.h -mule-charset.o: elhash.h -mule-charset.o: lstream.h -mule-charset.o: mule-charset.h -#if 0 -mule-coding.o: blocktype.h -mule-coding.o: buffer.h -mule-coding.o: bufslots.h -mule-coding.o: config.h -mule-coding.o: dynarr.h -mule-coding.o: elhash.h -mule-coding.o: insdel.h -mule-coding.o: lstream.h -mule-coding.o: mule-charset.h -mule-coding.o: mule-coding.h -#endif -#if 0 -mule-mcpath.o: blocktype.h -mule-mcpath.o: buffer.h -mule-mcpath.o: bufslots.h -mule-mcpath.o: config.h -mule-mcpath.o: dynarr.h -mule-mcpath.o: mule-charset.h -mule-mcpath.o: sysfile.h -#endif /* obsolete */ -#ifdef HAVE_WNN -mule-wnnfns.o: blocktype.h -mule-wnnfns.o: buffer.h -mule-wnnfns.o: bufslots.h -mule-wnnfns.o: config.h -mule-wnnfns.o: dynarr.h -mule-wnnfns.o: mule-charset.h -mule-wnnfns.o: redisplay.h -mule-wnnfns.o: scrollbar.h -mule-wnnfns.o: window.h -#endif /* HAVE_WNN */ -mule.o: blocktype.h -mule.o: config.h -mule.o: dynarr.h -mule.o: regex.h -objects-tty.o: mule-charset.h -objects-x.o: mule-charset.h -objects.o: mule-charset.h -print.o: mule-charset.h -process.o: mule-charset.h -redisplay-output.o: mule-charset.h -redisplay-tty.o: mule-charset.h -redisplay-x.o: mule-charset.h -redisplay-msw.o: mule-charset.h -redisplay-msw.o: mule-ccl.h -redisplay.o: mule-charset.h -regex.o: mule-charset.h -scrollbar.o: mule-charset.h -search.o: mule-charset.h -sound.o: mule-charset.h -specifier.o: mule-charset.h -symbols.o: mule-charset.h -syntax.o: mule-charset.h -sysdep.o: mule-charset.h -toolbar-x.o: mule-charset.h -toolbar.o: mule-charset.h -tooltalk.o: mule-charset.h -undo.o: mule-charset.h -window.o: mule-charset.h -xselect.o: mule-charset.h -#endif /* MULE */ - -#ifdef HAVE_OFFIX_DND -device-x.o: offix.h -device-x.o: offix-types.h -device-x.o: xintrinsic.h -event-Xt.o: offix.h offix-types.h xintrinsic.h -event-Xt.o: offix-types.h -event-Xt.o: xintrinsic.h -frame-x.o: offix.h -frame-x.o: offix-types.h -frame-x.o: xintrinsic.h -offix.o: offix-cursors.h -offix.o: offix.h -offix.o: offix-types.h -offix.o: xintrinsic.h -#endif - -#ifdef HAVE_MS_WINDOWS -console-msw.o: blocktype.h -console-msw.o: config.h -console-msw.o: conslots.h -console-msw.o: console-msw.h -console-msw.o: console.h -console-msw.o: dynarr.h -device-msw.o: blocktype.h -device-msw.o: buffer.h -device-msw.o: bufslots.h -device-msw.o: config.h -device-msw.o: conslots.h -device-msw.o: console-msw.h -device-msw.o: console-stream.h -device-msw.o: console.h -device-msw.o: device.h -device-msw.o: dynarr.h -device-msw.o: events.h -device-msw.o: faces.h -device-msw.o: frame.h -device-msw.o: frameslots.h -device-msw.o: scrollbar.h -device-msw.o: specifier.h -device-msw.o: sysdep.h -device-msw.o: systime.h -device-msw.o: toolbar.h -event-msw.o: blocktype.h -event-msw.o: config.h -event-msw.o: conslots.h -event-msw.o: console-msw.h -event-msw.o: console.h -event-msw.o: device.h -event-msw.o: dynarr.h -event-msw.o: events-mod.h -event-msw.o: events.h -event-msw.o: frame.h -event-msw.o: frameslots.h -event-msw.o: menubar-msw.h -event-msw.o: process.h -event-msw.o: redisplay.h -event-msw.o: scrollbar-msw.h -event-msw.o: scrollbar.h -event-msw.o: specifier.h -event-msw.o: sysproc.h -event-msw.o: systime.h -event-msw.o: syswait.h -event-msw.o: toolbar.h -frame-msw.o: blocktype.h -frame-msw.o: buffer.h -frame-msw.o: bufslots.h -frame-msw.o: config.h -frame-msw.o: conslots.h -frame-msw.o: console-msw.h -frame-msw.o: console.h -frame-msw.o: device.h -frame-msw.o: dynarr.h -frame-msw.o: events.h -frame-msw.o: faces.h -frame-msw.o: frame.h -frame-msw.o: frameslots.h -frame-msw.o: scrollbar.h -frame-msw.o: specifier.h -frame-msw.o: systime.h -frame-msw.o: toolbar.h -menubar-msw.o: blocktype.h -menubar-msw.o: buffer.h -menubar-msw.o: bufslots.h -menubar-msw.o: commands.h -menubar-msw.o: config.h -menubar-msw.o: conslots.h -menubar-msw.o: console-msw.h -menubar-msw.o: console.h -menubar-msw.o: device.h -menubar-msw.o: dynarr.h -menubar-msw.o: elhash.h -menubar-msw.o: events.h -menubar-msw.o: frame.h -menubar-msw.o: frameslots.h -menubar-msw.o: gui.h -menubar-msw.o: menubar-msw.h -menubar-msw.o: menubar.h -menubar-msw.o: opaque.h -menubar-msw.o: redisplay.h -menubar-msw.o: scrollbar.h -menubar-msw.o: specifier.h -menubar-msw.o: systime.h -menubar-msw.o: toolbar.h -menubar-msw.o: window.h -objects-msw.o: blocktype.h -objects-msw.o: buffer.h -objects-msw.o: bufslots.h -objects-msw.o: config.h -objects-msw.o: conslots.h -objects-msw.o: console-msw.h -objects-msw.o: console.h -objects-msw.o: device.h -objects-msw.o: dynarr.h -objects-msw.o: insdel.h -objects-msw.o: objects-msw.h -objects-msw.o: objects.h -objects-msw.o: specifier.h -redisplay-msw.o: blocktype.h -redisplay-msw.o: buffer.h -redisplay-msw.o: bufslots.h -redisplay-msw.o: config.h -redisplay-msw.o: conslots.h -redisplay-msw.o: console-msw.h -redisplay-msw.o: console.h -redisplay-msw.o: debug.h -redisplay-msw.o: device.h -redisplay-msw.o: dynarr.h -redisplay-msw.o: events.h -redisplay-msw.o: faces.h -redisplay-msw.o: frame.h -redisplay-msw.o: frameslots.h -redisplay-msw.o: glyphs.h -redisplay-msw.o: objects-msw.h -redisplay-msw.o: objects.h -redisplay-msw.o: redisplay.h -redisplay-msw.o: scrollbar.h -redisplay-msw.o: specifier.h -redisplay-msw.o: sysdep.h -redisplay-msw.o: systime.h -redisplay-msw.o: toolbar.h -redisplay-msw.o: window.h -scrollbar-msw.o: blocktype.h -scrollbar-msw.o: config.h -scrollbar-msw.o: conslots.h -scrollbar-msw.o: console-msw.h -scrollbar-msw.o: console.h -scrollbar-msw.o: device.h -scrollbar-msw.o: dynarr.h -scrollbar-msw.o: events.h -scrollbar-msw.o: frame.h -scrollbar-msw.o: frameslots.h -scrollbar-msw.o: redisplay.h -scrollbar-msw.o: scrollbar-msw.h -scrollbar-msw.o: scrollbar.h -scrollbar-msw.o: specifier.h -scrollbar-msw.o: systime.h -scrollbar-msw.o: toolbar.h -scrollbar-msw.o: window.h -select-msw.o: blocktype.h -select-msw.o: config.h -select-msw.o: conslots.h -select-msw.o: console-msw.h -select-msw.o: console.h -select-msw.o: dynarr.h -#endif - -EmacsFrame.o: $(LWLIB_SRCDIR)/lwlib.h -EmacsFrame.o: EmacsFrame.h -EmacsFrame.o: EmacsFrameP.h -EmacsFrame.o: EmacsManager.h -EmacsFrame.o: blocktype.h -EmacsFrame.o: buffer.h -EmacsFrame.o: bufslots.h -EmacsFrame.o: config.h -EmacsFrame.o: conslots.h -EmacsFrame.o: console-x.h -EmacsFrame.o: console.h -EmacsFrame.o: device.h -EmacsFrame.o: dynarr.h -EmacsFrame.o: faces.h -EmacsFrame.o: frame.h -EmacsFrame.o: frameslots.h -EmacsFrame.o: glyphs-x.h -EmacsFrame.o: glyphs.h -EmacsFrame.o: objects-x.h -EmacsFrame.o: objects.h -EmacsFrame.o: redisplay.h -EmacsFrame.o: scrollbar.h -EmacsFrame.o: specifier.h -EmacsFrame.o: toolbar.h -EmacsFrame.o: window.h -EmacsFrame.o: xintrinsic.h -EmacsFrame.o: xintrinsicp.h -EmacsFrame.o: xmprimitivep.h -EmacsFrame.o: xmu.h -EmacsManager.o: EmacsManager.h -EmacsManager.o: EmacsManagerP.h -EmacsManager.o: config.h -EmacsManager.o: xintrinsicp.h -EmacsManager.o: xmmanagerp.h -EmacsShell-sub.o: EmacsShell.h -EmacsShell-sub.o: EmacsShellP.h -EmacsShell-sub.o: config.h -EmacsShell-sub.o: xintrinsic.h -EmacsShell-sub.o: xintrinsicp.h -EmacsShell.o: EmacsShell.h -EmacsShell.o: config.h -EmacsShell.o: xintrinsicp.h -abbrev.o: blocktype.h -abbrev.o: buffer.h -abbrev.o: bufslots.h -abbrev.o: chartab.h -abbrev.o: commands.h -abbrev.o: config.h -abbrev.o: dynarr.h -abbrev.o: insdel.h -abbrev.o: redisplay.h -abbrev.o: scrollbar.h -abbrev.o: syntax.h -abbrev.o: window.h -alloc.o: backtrace.h -alloc.o: blocktype.h -alloc.o: buffer.h -alloc.o: bufslots.h -alloc.o: bytecode.h -alloc.o: chartab.h -alloc.o: config.h -alloc.o: conslots.h -alloc.o: console.h -alloc.o: device.h -alloc.o: dynarr.h -alloc.o: elhash.h -alloc.o: events.h -alloc.o: extents.h -alloc.o: frame.h -alloc.o: frameslots.h -alloc.o: glyphs.h -alloc.o: puresize.h -alloc.o: redisplay.h -alloc.o: scrollbar.h -alloc.o: specifier.h -alloc.o: systime.h -alloc.o: toolbar.h -alloc.o: window.h -alloca.o: config.h -balloon_help.o: config.h -balloon_help.o: balloon_help.h -balloon-x.o: config.h -balloon-x.o: device.h -balloon-x.o: console-x.h -balloon-x.o: balloon_help.h -blocktype.o: blocktype.h -blocktype.o: config.h -blocktype.o: dynarr.h -buffer.o: blocktype.h -buffer.o: buffer.h -buffer.o: bufslots.h -buffer.o: chartab.h -buffer.o: commands.h -buffer.o: config.h -buffer.o: conslots.h -buffer.o: console.h -buffer.o: device.h -buffer.o: dynarr.h -buffer.o: elhash.h -buffer.o: extents.h -buffer.o: faces.h -buffer.o: frame.h -buffer.o: frameslots.h -buffer.o: insdel.h -buffer.o: process.h -buffer.o: redisplay.h -buffer.o: scrollbar.h -buffer.o: specifier.h -buffer.o: syntax.h -buffer.o: sysdep.h -buffer.o: sysfile.h -buffer.o: toolbar.h -buffer.o: window.h -bytecode.o: blocktype.h -bytecode.o: buffer.h -bytecode.o: bufslots.h -bytecode.o: chartab.h -bytecode.o: config.h -bytecode.o: dynarr.h -bytecode.o: syntax.h -callint.o: blocktype.h -callint.o: buffer.h -callint.o: bufslots.h -callint.o: bytecode.h -callint.o: commands.h -callint.o: config.h -callint.o: dynarr.h -callint.o: events.h -callint.o: insdel.h -callint.o: redisplay.h -callint.o: scrollbar.h -callint.o: systime.h -callint.o: window.h -callproc.o: blocktype.h -callproc.o: buffer.h -callproc.o: bufslots.h -callproc.o: commands.h -callproc.o: config.h -callproc.o: dynarr.h -callproc.o: insdel.h -callproc.o: lstream.h -callproc.o: paths.h -callproc.o: process.h -callproc.o: redisplay.h -callproc.o: scrollbar.h -callproc.o: sysdep.h -callproc.o: sysfile.h -callproc.o: sysproc.h -callproc.o: systime.h -callproc.o: systty.h -callproc.o: window.h -casefiddle.o: blocktype.h -casefiddle.o: buffer.h -casefiddle.o: bufslots.h -casefiddle.o: chartab.h -casefiddle.o: commands.h -casefiddle.o: config.h -casefiddle.o: dynarr.h -casefiddle.o: insdel.h -casefiddle.o: syntax.h -casetab.o: blocktype.h -casetab.o: buffer.h -casetab.o: bufslots.h -casetab.o: config.h -casetab.o: dynarr.h -casetab.o: opaque.h -chartab.o: blocktype.h -chartab.o: buffer.h -chartab.o: bufslots.h -chartab.o: chartab.h -chartab.o: commands.h -chartab.o: config.h -chartab.o: dynarr.h -chartab.o: syntax.h -cm.o: blocktype.h -cm.o: config.h -cm.o: conslots.h -cm.o: console-tty.h -cm.o: console.h -cm.o: device.h -cm.o: dynarr.h -cm.o: frame.h -cm.o: frameslots.h -cm.o: lstream.h -cm.o: redisplay.h -cm.o: scrollbar.h -cm.o: specifier.h -cm.o: systty.h -cm.o: toolbar.h -cmdloop.o: blocktype.h -cmdloop.o: buffer.h -cmdloop.o: bufslots.h -cmdloop.o: commands.h -cmdloop.o: config.h -cmdloop.o: conslots.h -cmdloop.o: console.h -cmdloop.o: device.h -cmdloop.o: dynarr.h -cmdloop.o: events.h -cmdloop.o: frame.h -cmdloop.o: frameslots.h -cmdloop.o: macros.h -cmdloop.o: redisplay.h -cmdloop.o: scrollbar.h -cmdloop.o: specifier.h -cmdloop.o: systime.h -cmdloop.o: toolbar.h -cmdloop.o: window.h -cmds.o: blocktype.h -cmds.o: buffer.h -cmds.o: bufslots.h -cmds.o: chartab.h -cmds.o: commands.h -cmds.o: config.h -cmds.o: dynarr.h -cmds.o: insdel.h -cmds.o: syntax.h -console-stream.o: blocktype.h -console-stream.o: config.h -console-stream.o: conslots.h -console-stream.o: console-stream.h -console-stream.o: console-tty.h -console-stream.o: console.h -console-stream.o: device.h -console-stream.o: dynarr.h -console-stream.o: events.h -console-stream.o: frame.h -console-stream.o: frameslots.h -console-stream.o: redisplay.h -console-stream.o: scrollbar.h -console-stream.o: specifier.h -console-stream.o: sysdep.h -console-stream.o: systime.h -console-stream.o: systty.h -console-stream.o: toolbar.h -console-stream.o: window.h -console-tty.o: blocktype.h -console-tty.o: buffer.h -console-tty.o: bufslots.h -console-tty.o: config.h -console-tty.o: conslots.h -console-tty.o: console-stream.h -console-tty.o: console-tty.h -console-tty.o: console.h -console-tty.o: device.h -console-tty.o: dynarr.h -console-tty.o: events.h -console-tty.o: faces.h -console-tty.o: frame.h -console-tty.o: frameslots.h -console-tty.o: lstream.h -console-tty.o: redisplay.h -console-tty.o: scrollbar.h -console-tty.o: specifier.h -console-tty.o: sysdep.h -console-tty.o: systime.h -console-tty.o: systty.h -console-tty.o: toolbar.h -console-x.o: blocktype.h -console-x.o: config.h -console-x.o: conslots.h -console-x.o: console-x.h -console-x.o: console.h -console-x.o: dynarr.h -console-x.o: process.h -console-x.o: redisplay.h -console-x.o: xintrinsic.h -console.o: blocktype.h -console.o: buffer.h -console.o: bufslots.h -console.o: config.h -console.o: conslots.h -console.o: console-tty.h -console.o: console.h -console.o: device.h -console.o: dynarr.h -console.o: events.h -console.o: frame.h -console.o: frameslots.h -console.o: redisplay.h -console.o: scrollbar.h -console.o: specifier.h -console.o: sysdep.h -console.o: systime.h -console.o: systty.h -console.o: toolbar.h -console.o: window.h -data.o: blocktype.h -data.o: buffer.h -data.o: bufslots.h -data.o: bytecode.h -data.o: config.h -data.o: dynarr.h -data.o: sysfloat.h -#ifdef HAVE_DATABASE -database.o: blocktype.h -database.o: config.h -database.o: database.h -database.o: dynarr.h -#endif /* HAVE_DATABASE */ -debug.o: blocktype.h -debug.o: bytecode.h -debug.o: config.h -debug.o: debug.h -debug.o: dynarr.h -device-tty.o: blocktype.h -device-tty.o: buffer.h -device-tty.o: bufslots.h -device-tty.o: config.h -device-tty.o: conslots.h -device-tty.o: console-stream.h -device-tty.o: console-tty.h -device-tty.o: console.h -device-tty.o: device.h -device-tty.o: dynarr.h -device-tty.o: events.h -device-tty.o: faces.h -device-tty.o: frame.h -device-tty.o: frameslots.h -device-tty.o: lstream.h -device-tty.o: redisplay.h -device-tty.o: scrollbar.h -device-tty.o: specifier.h -device-tty.o: sysdep.h -device-tty.o: systime.h -device-tty.o: systty.h -device-tty.o: toolbar.h -device-x.o: $(LWLIB_SRCDIR)/lwlib.h -device-x.o: blocktype.h -device-x.o: buffer.h -device-x.o: bufslots.h -device-x.o: config.h -device-x.o: conslots.h -device-x.o: console-x.h -device-x.o: console.h -device-x.o: device.h -device-x.o: dynarr.h -device-x.o: events.h -device-x.o: faces.h -device-x.o: frame.h -device-x.o: frameslots.h -device-x.o: glyphs-x.h -device-x.o: glyphs.h -device-x.o: objects-x.h -device-x.o: objects.h -device-x.o: redisplay.h -device-x.o: scrollbar.h -device-x.o: specifier.h -device-x.o: sysdep.h -device-x.o: sysfile.h -device-x.o: systime.h -device-x.o: toolbar.h -device-x.o: window.h -device-x.o: xgccache.h -device-x.o: xintrinsic.h -device-x.o: xintrinsicp.h -device-x.o: xmu.h -device.o: blocktype.h -device.o: buffer.h -device.o: bufslots.h -device.o: config.h -device.o: conslots.h -device.o: console.h -device.o: device.h -device.o: dynarr.h -device.o: elhash.h -device.o: events.h -device.o: faces.h -device.o: frame.h -device.o: frameslots.h -device.o: keymap.h -device.o: redisplay.h -device.o: scrollbar.h -device.o: specifier.h -device.o: sysdep.h -device.o: systime.h -device.o: toolbar.h -device.o: window.h -dialog-x.o: $(LWLIB_SRCDIR)/lwlib.h -dialog-x.o: EmacsFrame.h -dialog-x.o: EmacsManager.h -dialog-x.o: EmacsShell.h -dialog-x.o: blocktype.h -dialog-x.o: buffer.h -dialog-x.o: bufslots.h -dialog-x.o: commands.h -dialog-x.o: config.h -dialog-x.o: conslots.h -dialog-x.o: console-x.h -dialog-x.o: console.h -dialog-x.o: device.h -dialog-x.o: dynarr.h -dialog-x.o: events.h -dialog-x.o: frame.h -dialog-x.o: frameslots.h -dialog-x.o: gui-x.h -dialog-x.o: opaque.h -dialog-x.o: redisplay.h -dialog-x.o: scrollbar.h -dialog-x.o: specifier.h -dialog-x.o: systime.h -dialog-x.o: toolbar.h -dialog-x.o: window.h -dialog-x.o: xintrinsic.h -dialog.o: blocktype.h -dialog.o: config.h -dialog.o: dynarr.h -dired.o: blocktype.h -dired.o: buffer.h -dired.o: bufslots.h -dired.o: commands.h -dired.o: config.h -dired.o: dynarr.h -dired.o: elhash.h -dired.o: regex.h -dired.o: sysdir.h -dired.o: sysfile.h -dlopen.o: config.h -dlopen.o: buffer.h -doc.o: blocktype.h -doc.o: buffer.h -doc.o: bufslots.h -doc.o: bytecode.h -doc.o: config.h -doc.o: dynarr.h -doc.o: insdel.h -doc.o: keymap.h -doc.o: sysfile.h -doprnt.o: blocktype.h -doprnt.o: buffer.h -doprnt.o: bufslots.h -doprnt.o: config.h -doprnt.o: dynarr.h -doprnt.o: lstream.h -dynarr.o: blocktype.h -dynarr.o: config.h -dynarr.o: dynarr.h -ecrt0.o: config.h -editfns.o: blocktype.h -editfns.o: buffer.h -editfns.o: bufslots.h -editfns.o: commands.h -editfns.o: config.h -editfns.o: conslots.h -editfns.o: console.h -editfns.o: device.h -editfns.o: dynarr.h -editfns.o: events.h -editfns.o: extents.h -editfns.o: frame.h -editfns.o: frameslots.h -editfns.o: insdel.h -editfns.o: redisplay.h -editfns.o: scrollbar.h -editfns.o: specifier.h -editfns.o: sysdep.h -editfns.o: syspwd.h -editfns.o: systime.h -editfns.o: toolbar.h -editfns.o: window.h -elhash.o: blocktype.h -elhash.o: bytecode.h -elhash.o: config.h -elhash.o: dynarr.h -elhash.o: elhash.h -elhash.o: hash.h -emacs.o: backtrace.h -emacs.o: blocktype.h -emacs.o: buffer.h -emacs.o: bufslots.h -emacs.o: commands.h -emacs.o: config.h -emacs.o: conslots.h -emacs.o: console.h -emacs.o: dynarr.h -emacs.o: process.h -emacs.o: sysdep.h -emacs.o: sysfile.h -emacs.o: systime.h -emacs.o: systty.h -eval.o: backtrace.h -eval.o: blocktype.h -eval.o: buffer.h -eval.o: bufslots.h -eval.o: bytecode.h -eval.o: commands.h -eval.o: config.h -eval.o: conslots.h -eval.o: console.h -eval.o: dynarr.h -eval.o: opaque.h -event-Xt.o: $(LWLIB_SRCDIR)/lwlib.h -event-Xt.o: Emacs.ad.h -event-Xt.o: EmacsFrame.h -event-Xt.o: blocktype.h -event-Xt.o: buffer.h -event-Xt.o: bufslots.h -event-Xt.o: commands.h -event-Xt.o: config.h -event-Xt.o: conslots.h -event-Xt.o: console-tty.h -event-Xt.o: console-x.h -event-Xt.o: console.h -event-Xt.o: device.h -event-Xt.o: dynarr.h -event-Xt.o: events.h -event-Xt.o: frame.h -event-Xt.o: frameslots.h -event-Xt.o: objects-x.h -event-Xt.o: objects.h -event-Xt.o: paths.h -event-Xt.o: process.h -event-Xt.o: redisplay.h -event-Xt.o: scrollbar.h -event-Xt.o: specifier.h -event-Xt.o: sysproc.h -event-Xt.o: systime.h -event-Xt.o: systty.h -event-Xt.o: toolbar.h -event-Xt.o: xintrinsic.h -event-Xt.o: xintrinsicp.h -event-stream.o: blocktype.h -event-stream.o: buffer.h -event-stream.o: bufslots.h -event-stream.o: commands.h -event-stream.o: config.h -event-stream.o: conslots.h -event-stream.o: console.h -event-stream.o: device.h -event-stream.o: dynarr.h -event-stream.o: elhash.h -event-stream.o: events.h -event-stream.o: frame.h -event-stream.o: frameslots.h -event-stream.o: insdel.h -event-stream.o: keymap.h -event-stream.o: lstream.h -event-stream.o: macros.h -event-stream.o: opaque.h -event-stream.o: process.h -event-stream.o: redisplay.h -event-stream.o: scrollbar.h -event-stream.o: specifier.h -event-stream.o: sysdep.h -event-stream.o: systime.h -event-stream.o: toolbar.h -event-stream.o: window.h -event-tty.o: blocktype.h -event-tty.o: config.h -event-tty.o: conslots.h -event-tty.o: console-tty.h -event-tty.o: console.h -event-tty.o: device.h -event-tty.o: dynarr.h -event-tty.o: events.h -event-tty.o: frame.h -event-tty.o: frameslots.h -event-tty.o: paths.h -event-tty.o: process.h -event-tty.o: scrollbar.h -event-tty.o: specifier.h -event-tty.o: sysproc.h -event-tty.o: systime.h -event-tty.o: systty.h -event-tty.o: syswait.h -event-tty.o: toolbar.h -event-unixoid.o: blocktype.h -event-unixoid.o: config.h -event-unixoid.o: conslots.h -event-unixoid.o: console-stream.h -event-unixoid.o: console-tty.h -event-unixoid.o: console.h -event-unixoid.o: device.h -event-unixoid.o: dynarr.h -event-unixoid.o: events.h -event-unixoid.o: paths.h -event-unixoid.o: process.h -event-unixoid.o: sysdep.h -event-unixoid.o: sysproc.h -event-unixoid.o: systime.h -event-unixoid.o: systty.h -events.o: blocktype.h -events.o: buffer.h -events.o: bufslots.h -events.o: config.h -events.o: conslots.h -events.o: console-tty.h -events.o: console-x.h -events.o: console.h -events.o: device.h -events.o: dynarr.h -events.o: events.h -events.o: extents.h -events.o: frame.h -events.o: frameslots.h -events.o: glyphs.h -events.o: keymap.h -events.o: redisplay.h -events.o: scrollbar.h -events.o: specifier.h -events.o: systime.h -events.o: systty.h -events.o: toolbar.h -events.o: window.h -events.o: xintrinsic.h -extents.o: blocktype.h -extents.o: buffer.h -extents.o: bufslots.h -extents.o: config.h -extents.o: conslots.h -extents.o: console.h -extents.o: debug.h -extents.o: device.h -extents.o: dynarr.h -extents.o: elhash.h -extents.o: extents.h -extents.o: faces.h -extents.o: frame.h -extents.o: frameslots.h -extents.o: glyphs.h -extents.o: hash.h -extents.o: insdel.h -extents.o: opaque.h -extents.o: process.h -extents.o: redisplay.h -extents.o: scrollbar.h -extents.o: specifier.h -extents.o: toolbar.h -faces.o: EmacsFrame.h -faces.o: blocktype.h -faces.o: buffer.h -faces.o: bufslots.h -faces.o: config.h -faces.o: conslots.h -faces.o: console-x.h -faces.o: console.h -faces.o: device.h -faces.o: dynarr.h -faces.o: elhash.h -faces.o: extents.h -faces.o: faces.h -faces.o: frame.h -faces.o: frameslots.h -faces.o: glyphs.h -faces.o: hash.h -faces.o: objects-x.h -faces.o: objects.h -faces.o: redisplay.h -faces.o: scrollbar.h -faces.o: specifier.h -faces.o: toolbar.h -faces.o: window.h -faces.o: xintrinsic.h -fileio.o: blocktype.h -fileio.o: buffer.h -fileio.o: bufslots.h -fileio.o: config.h -fileio.o: conslots.h -fileio.o: console.h -fileio.o: device.h -fileio.o: dynarr.h -fileio.o: events.h -fileio.o: frame.h -fileio.o: frameslots.h -fileio.o: insdel.h -fileio.o: lstream.h -fileio.o: paths.h -fileio.o: redisplay.h -fileio.o: scrollbar.h -fileio.o: specifier.h -fileio.o: sysdep.h -fileio.o: sysdir.h -fileio.o: sysfile.h -fileio.o: sysproc.h -fileio.o: syspwd.h -fileio.o: systime.h -fileio.o: toolbar.h -fileio.o: window.h -filelock.o: blocktype.h -filelock.o: buffer.h -filelock.o: bufslots.h -filelock.o: config.h -filelock.o: dynarr.h -filelock.o: paths.h -filelock.o: sysdir.h -filelock.o: sysfile.h -filelock.o: syspwd.h -filemode.o: blocktype.h -filemode.o: config.h -filemode.o: dynarr.h -filemode.o: sysfile.h -floatfns.o: blocktype.h -floatfns.o: config.h -floatfns.o: dynarr.h -floatfns.o: sysfloat.h -fns.o: blocktype.h -fns.o: buffer.h -fns.o: bufslots.h -fns.o: bytecode.h -fns.o: commands.h -fns.o: config.h -fns.o: conslots.h -fns.o: console.h -fns.o: device.h -fns.o: dynarr.h -fns.o: events.h -fns.o: extents.h -fns.o: frame.h -fns.o: frameslots.h -fns.o: scrollbar.h -fns.o: specifier.h -fns.o: systime.h -fns.o: toolbar.h -font-lock.o: blocktype.h -font-lock.o: buffer.h -font-lock.o: bufslots.h -font-lock.o: chartab.h -font-lock.o: config.h -font-lock.o: dynarr.h -font-lock.o: insdel.h -font-lock.o: syntax.h -frame-tty.o: blocktype.h -frame-tty.o: config.h -frame-tty.o: conslots.h -frame-tty.o: console-tty.h -frame-tty.o: console.h -frame-tty.o: device.h -frame-tty.o: dynarr.h -frame-tty.o: frame.h -frame-tty.o: frameslots.h -frame-tty.o: scrollbar.h -frame-tty.o: specifier.h -frame-tty.o: systty.h -frame-tty.o: toolbar.h -frame-x.o: $(LWLIB_SRCDIR)/lwlib.h -frame-x.o: EmacsFrame.h -frame-x.o: EmacsFrameP.h -frame-x.o: EmacsManager.h -frame-x.o: EmacsShell.h -frame-x.o: ExternalShell.h -frame-x.o: blocktype.h -frame-x.o: buffer.h -frame-x.o: bufslots.h -frame-x.o: config.h -frame-x.o: conslots.h -frame-x.o: console-x.h -frame-x.o: console.h -frame-x.o: device.h -frame-x.o: dynarr.h -frame-x.o: events.h -frame-x.o: extents.h -frame-x.o: faces.h -frame-x.o: frame.h -frame-x.o: frameslots.h -frame-x.o: glyphs-x.h -frame-x.o: glyphs.h -frame-x.o: objects-x.h -frame-x.o: objects.h -frame-x.o: redisplay.h -frame-x.o: scrollbar-x.h -frame-x.o: scrollbar.h -frame-x.o: specifier.h -frame-x.o: systime.h -frame-x.o: toolbar.h -frame-x.o: window.h -frame-x.o: xintrinsic.h -frame-x.o: xintrinsicp.h -frame-x.o: xmprimitivep.h -frame-x.o: xmu.h -frame.o: blocktype.h -frame.o: buffer.h -frame.o: bufslots.h -frame.o: config.h -frame.o: conslots.h -frame.o: console.h -frame.o: device.h -frame.o: dynarr.h -frame.o: events.h -frame.o: extents.h -frame.o: faces.h -frame.o: frame.h -frame.o: frameslots.h -frame.o: glyphs.h -frame.o: menubar.h -frame.o: redisplay.h -frame.o: scrollbar.h -frame.o: specifier.h -frame.o: sysdep.h -frame.o: systime.h -frame.o: toolbar.h -frame.o: window.h -free-hook.o: blocktype.h -free-hook.o: config.h -free-hook.o: dynarr.h -free-hook.o: hash.h -general.o: blocktype.h -general.o: config.h -general.o: dynarr.h -getloadavg.o: blocktype.h -getloadavg.o: config.h -getloadavg.o: dynarr.h -glyphs-x.o: $(LWLIB_SRCDIR)/lwlib.h -glyphs-x.o: ${srcdir}/${etcdir}xemacs.xbm -glyphs-x.o: bitmaps.h -glyphs-x.o: blocktype.h -glyphs-x.o: buffer.h -glyphs-x.o: bufslots.h -glyphs-x.o: config.h -glyphs-x.o: conslots.h -glyphs-x.o: console-x.h -glyphs-x.o: console.h -glyphs-x.o: device.h -glyphs-x.o: dynarr.h -glyphs-x.o: frame.h -glyphs-x.o: frameslots.h -glyphs-x.o: glyphs-x.h -glyphs-x.o: glyphs.h -glyphs-x.o: insdel.h -glyphs-x.o: objects-x.h -glyphs-x.o: objects.h -glyphs-x.o: opaque.h -glyphs-x.o: scrollbar.h -glyphs-x.o: specifier.h -glyphs-x.o: sysfile.h -glyphs-x.o: toolbar.h -glyphs-x.o: xintrinsic.h -glyphs-x.o: xmu.h -glyphs-x.o: imgproc.h -imgproc.o: imgproc.h -imgproc.o: config.h -glyphs.o: blocktype.h -glyphs.o: buffer.h -glyphs.o: bufslots.h -glyphs.o: config.h -glyphs.o: conslots.h -glyphs.o: console.h -glyphs.o: device.h -glyphs.o: dynarr.h -glyphs.o: elhash.h -glyphs.o: faces.h -glyphs.o: frame.h -glyphs.o: frameslots.h -glyphs.o: glyphs.h -glyphs.o: objects.h -glyphs.o: redisplay.h -glyphs.o: scrollbar.h -glyphs.o: specifier.h -glyphs.o: toolbar.h -glyphs.o: window.h -glyphs-msw.o: bitmaps.h -glyphs-msw.o: blocktype.h -glyphs-msw.o: buffer.h -glyphs-msw.o: bufslots.h -glyphs-msw.o: config.h -glyphs-msw.o: conslots.h -glyphs-msw.o: console-msw.h -glyphs-msw.o: console.h -glyphs-msw.o: device.h -glyphs-msw.o: dynarr.h -glyphs-msw.o: frame.h -glyphs-msw.o: frameslots.h -glyphs-msw.o: glyphs-msw.h -glyphs-msw.o: glyphs.h -glyphs-msw.o: insdel.h -glyphs-msw.o: objects-msw.h -glyphs-msw.o: objects.h -glyphs-msw.o: opaque.h -glyphs-msw.o: scrollbar.h -glyphs-msw.o: specifier.h -glyphs-msw.o: sysfile.h -glyphs-msw.o: toolbar.h -glyphs-msw.o: imgproc.h -gmalloc.o: config.h -gmalloc.o: getpagesize.h -gui-x.o: $(LWLIB_SRCDIR)/lwlib.h -gui-x.o: blocktype.h -gui-x.o: buffer.h -gui-x.o: bufslots.h -gui-x.o: config.h -gui-x.o: conslots.h -gui-x.o: console-x.h -gui-x.o: console.h -gui-x.o: device.h -gui-x.o: dynarr.h -gui-x.o: frame.h -gui-x.o: frameslots.h -gui-x.o: gui-x.h -gui-x.o: opaque.h -gui-x.o: scrollbar.h -gui-x.o: specifier.h -gui-x.o: toolbar.h -gui-x.o: xintrinsic.h -gui.o: blocktype.h -gui.o: config.h -gui.o: dynarr.h -hash.o: blocktype.h -hash.o: config.h -hash.o: dynarr.h -hash.o: elhash.h -hash.o: hash.h -hftctl.o: blocktype.h -hftctl.o: config.h -hftctl.o: dynarr.h -hpplay.o: blocktype.h -hpplay.o: config.h -hpplay.o: dynarr.h -indent.o: blocktype.h -indent.o: buffer.h -indent.o: bufslots.h -indent.o: config.h -indent.o: conslots.h -indent.o: console.h -indent.o: device.h -indent.o: dynarr.h -indent.o: extents.h -indent.o: faces.h -indent.o: frame.h -indent.o: frameslots.h -indent.o: glyphs.h -indent.o: insdel.h -indent.o: redisplay.h -indent.o: scrollbar.h -indent.o: specifier.h -indent.o: toolbar.h -indent.o: window.h -inline.o: $(LWLIB_SRCDIR)/lwlib.h -inline.o: blocktype.h -inline.o: buffer.h -inline.o: bufslots.h -inline.o: bytecode.h -inline.o: chartab.h -inline.o: config.h -inline.o: conslots.h -inline.o: console-x.h -inline.o: console.h -inline.o: device.h -inline.o: dynarr.h -inline.o: elhash.h -inline.o: events.h -inline.o: extents.h -inline.o: faces.h -inline.o: frame.h -inline.o: frameslots.h -inline.o: glyphs-x.h -inline.o: glyphs.h -inline.o: gui-x.h -inline.o: keymap.h -inline.o: lstream.h -inline.o: objects.h -inline.o: opaque.h -inline.o: process.h -inline.o: redisplay.h -inline.o: scrollbar.h -inline.o: specifier.h -inline.o: syntax.h -inline.o: systime.h -inline.o: toolbar.h -inline.o: window.h -inline.o: xintrinsic.h -input-method-xlib.o: EmacsFrame.h -input-method-xlib.o: blocktype.h -input-method-xlib.o: buffer.h -input-method-xlib.o: bufslots.h -input-method-xlib.o: config.h -input-method-xlib.o: conslots.h -input-method-xlib.o: console-x.h -input-method-xlib.o: console.h -input-method-xlib.o: device.h -input-method-xlib.o: dynarr.h -input-method-xlib.o: frame.h -input-method-xlib.o: frameslots.h -input-method-xlib.o: insdel.h -input-method-xlib.o: lstream.h -input-method-xlib.o: redisplay.h -input-method-xlib.o: scrollbar.h -input-method-xlib.o: specifier.h -input-method-xlib.o: toolbar.h -input-method-xlib.o: window.h -input-method-xlib.o: xintrinsic.h -insdel.o: blocktype.h -insdel.o: buffer.h -insdel.o: bufslots.h -insdel.o: config.h -insdel.o: conslots.h -insdel.o: console.h -insdel.o: device.h -insdel.o: dynarr.h -insdel.o: extents.h -insdel.o: frame.h -insdel.o: frameslots.h -insdel.o: insdel.h -insdel.o: lstream.h -insdel.o: redisplay.h -insdel.o: scrollbar.h -insdel.o: specifier.h -insdel.o: toolbar.h -intl.o: blocktype.h -intl.o: bytecode.h -intl.o: config.h -intl.o: conslots.h -intl.o: console.h -intl.o: device.h -intl.o: dynarr.h -keymap.o: blocktype.h -keymap.o: buffer.h -keymap.o: bufslots.h -keymap.o: bytecode.h -keymap.o: commands.h -keymap.o: config.h -keymap.o: conslots.h -keymap.o: console.h -keymap.o: device.h -keymap.o: dynarr.h -keymap.o: elhash.h -keymap.o: events.h -keymap.o: frame.h -keymap.o: frameslots.h -keymap.o: insdel.h -keymap.o: keymap.h -keymap.o: redisplay.h -keymap.o: scrollbar.h -keymap.o: specifier.h -keymap.o: systime.h -keymap.o: toolbar.h -keymap.o: window.h -libsst.o: blocktype.h -libsst.o: config.h -libsst.o: dynarr.h -libsst.o: libsst.h -line-number.o: config.h -line-number.o: buffer.h -line-number.o: insdel.h -line-number.o: line-number.h -linuxplay.o: blocktype.h -linuxplay.o: config.h -linuxplay.o: dynarr.h -lread.o: blocktype.h -lread.o: buffer.h -lread.o: bufslots.h -lread.o: bytecode.h -lread.o: commands.h -lread.o: config.h -lread.o: dynarr.h -lread.o: insdel.h -lread.o: lstream.h -lread.o: opaque.h -lread.o: paths.h -lread.o: sysfile.h -lstream.o: blocktype.h -lstream.o: buffer.h -lstream.o: bufslots.h -lstream.o: config.h -lstream.o: dynarr.h -lstream.o: insdel.h -lstream.o: lstream.h -lstream.o: sysfile.h -macros.o: blocktype.h -macros.o: buffer.h -macros.o: bufslots.h -macros.o: commands.h -macros.o: config.h -macros.o: conslots.h -macros.o: console.h -macros.o: device.h -macros.o: dynarr.h -macros.o: events.h -macros.o: frame.h -macros.o: frameslots.h -macros.o: keymap.h -macros.o: macros.h -macros.o: redisplay.h -macros.o: scrollbar.h -macros.o: specifier.h -macros.o: systime.h -macros.o: toolbar.h -macros.o: window.h -malloc.o: config.h -malloc.o: getpagesize.h -marker.o: blocktype.h -marker.o: buffer.h -marker.o: bufslots.h -marker.o: config.h -marker.o: dynarr.h -md5.o: blocktype.h -md5.o: buffer.h -md5.o: bufslots.h -md5.o: config.h -md5.o: dynarr.h -md5.o: insdel.h -menubar-x.o: $(LWLIB_SRCDIR)/lwlib.h -menubar-x.o: EmacsFrame.h -menubar-x.o: EmacsManager.h -menubar-x.o: EmacsShell.h -menubar-x.o: blocktype.h -menubar-x.o: buffer.h -menubar-x.o: bufslots.h -menubar-x.o: commands.h -menubar-x.o: config.h -menubar-x.o: conslots.h -menubar-x.o: console-x.h -menubar-x.o: console.h -menubar-x.o: device.h -menubar-x.o: dynarr.h -menubar-x.o: events.h -menubar-x.o: frame.h -menubar-x.o: frameslots.h -menubar-x.o: gui-x.h -menubar-x.o: opaque.h -menubar-x.o: redisplay.h -menubar-x.o: scrollbar.h -menubar-x.o: specifier.h -menubar-x.o: systime.h -menubar-x.o: toolbar.h -menubar-x.o: window.h -menubar-x.o: xintrinsic.h -menubar.o: blocktype.h -menubar.o: config.h -menubar.o: conslots.h -menubar.o: console.h -menubar.o: device.h -menubar.o: dynarr.h -menubar.o: frame.h -menubar.o: frameslots.h -menubar.o: menubar.h -menubar.o: redisplay.h -menubar.o: scrollbar.h -menubar.o: specifier.h -menubar.o: toolbar.h -menubar.o: window.h -minibuf.o: blocktype.h -minibuf.o: buffer.h -minibuf.o: bufslots.h -minibuf.o: commands.h -minibuf.o: config.h -minibuf.o: conslots.h -minibuf.o: console-stream.h -minibuf.o: console.h -minibuf.o: device.h -minibuf.o: dynarr.h -minibuf.o: events.h -minibuf.o: frame.h -minibuf.o: frameslots.h -minibuf.o: insdel.h -minibuf.o: redisplay.h -minibuf.o: scrollbar.h -minibuf.o: specifier.h -minibuf.o: systime.h -minibuf.o: toolbar.h -minibuf.o: window.h -msdos.o: config.h -nas.o: blocktype.h -nas.o: config.h -nas.o: dynarr.h -objects-tty.o: blocktype.h -objects-tty.o: config.h -objects-tty.o: conslots.h -objects-tty.o: console-tty.h -objects-tty.o: console.h -objects-tty.o: device.h -objects-tty.o: dynarr.h -objects-tty.o: insdel.h -objects-tty.o: objects-tty.h -objects-tty.o: objects.h -objects-tty.o: specifier.h -objects-tty.o: systty.h -objects-x.o: blocktype.h -objects-x.o: buffer.h -objects-x.o: bufslots.h -objects-x.o: config.h -objects-x.o: conslots.h -objects-x.o: console-x.h -objects-x.o: console.h -objects-x.o: device.h -objects-x.o: dynarr.h -objects-x.o: insdel.h -objects-x.o: objects-x.h -objects-x.o: objects.h -objects-x.o: specifier.h -objects-x.o: xintrinsic.h -objects.o: blocktype.h -objects.o: buffer.h -objects.o: bufslots.h -objects.o: config.h -objects.o: conslots.h -objects.o: console.h -objects.o: device.h -objects.o: dynarr.h -objects.o: elhash.h -objects.o: faces.h -objects.o: frame.h -objects.o: frameslots.h -objects.o: objects.h -objects.o: redisplay.h -objects.o: scrollbar.h -objects.o: specifier.h -objects.o: toolbar.h -objects.o: window.h -opaque.o: blocktype.h -opaque.o: config.h -opaque.o: dynarr.h -opaque.o: opaque.h -print.o: backtrace.h -print.o: blocktype.h -print.o: buffer.h -print.o: bufslots.h -print.o: bytecode.h -print.o: config.h -print.o: conslots.h -print.o: console-stream.h -print.o: console-tty.h -print.o: console.h -print.o: device.h -print.o: dynarr.h -print.o: extents.h -print.o: frame.h -print.o: frameslots.h -print.o: insdel.h -print.o: lstream.h -print.o: scrollbar.h -print.o: specifier.h -print.o: systty.h -print.o: toolbar.h -process-unix.o: config.h -process-unix.o: buffer.h -process-unix.o: commands.h -process-unix.o: events.h -process-unix.o: frame.h -process-unix.o: insdel.h -process-unix.o: lstream.h -process-unix.o: opaque.h -process-unix.o: process.h -process-unix.o: procimpl.h -process-unix.o: window.h -process-unix.o: sysfile.h -process-unix.o: sysproc.h -process-unix.o: systime.h -process-unix.o: syssignal.h -process-unix.o: systty.h -process-unix.o: syswait.h -process.o: blocktype.h -process.o: buffer.h -process.o: bufslots.h -process.o: commands.h -process.o: config.h -process.o: conslots.h -process.o: console.h -process.o: device.h -process.o: dynarr.h -process.o: events.h -process.o: frame.h -process.o: frameslots.h -process.o: insdel.h -process.o: lstream.h -process.o: opaque.h -process.o: paths.h -process.o: process.h -process.o: redisplay.h -process.o: scrollbar.h -process.o: specifier.h -process.o: sysdep.h -process.o: sysfile.h -process.o: sysproc.h -process.o: systime.h -process.o: systty.h -process.o: syswait.h -process.o: toolbar.h -process.o: window.h -profile.o: backtrace.h -profile.o: blocktype.h -profile.o: bytecode.h -profile.o: config.h -profile.o: dynarr.h -profile.o: hash.h -profile.o: systime.h -pure.o: blocktype.h -pure.o: config.h -pure.o: dynarr.h -pure.o: puresize.h puresize-adjust.h -ralloc.o: blocktype.h -ralloc.o: config.h -ralloc.o: dynarr.h -ralloc.o: getpagesize.h -rangetab.o: blocktype.h -rangetab.o: config.h -rangetab.o: dynarr.h -realpath.o: config.h -redisplay-output.o: blocktype.h -redisplay-output.o: buffer.h -redisplay-output.o: bufslots.h -redisplay-output.o: config.h -redisplay-output.o: conslots.h -redisplay-output.o: console.h -redisplay-output.o: debug.h -redisplay-output.o: device.h -redisplay-output.o: dynarr.h -redisplay-output.o: faces.h -redisplay-output.o: frame.h -redisplay-output.o: frameslots.h -redisplay-output.o: glyphs.h -redisplay-output.o: redisplay.h -redisplay-output.o: scrollbar.h -redisplay-output.o: specifier.h -redisplay-output.o: sysdep.h -redisplay-output.o: toolbar.h -redisplay-output.o: window.h -redisplay-tty.o: blocktype.h -redisplay-tty.o: buffer.h -redisplay-tty.o: bufslots.h -redisplay-tty.o: config.h -redisplay-tty.o: conslots.h -redisplay-tty.o: console-tty.h -redisplay-tty.o: console.h -redisplay-tty.o: device.h -redisplay-tty.o: dynarr.h -redisplay-tty.o: events.h -redisplay-tty.o: faces.h -redisplay-tty.o: frame.h -redisplay-tty.o: frameslots.h -redisplay-tty.o: glyphs.h -redisplay-tty.o: lstream.h -redisplay-tty.o: objects-tty.h -redisplay-tty.o: objects.h -redisplay-tty.o: redisplay.h -redisplay-tty.o: scrollbar.h -redisplay-tty.o: specifier.h -redisplay-tty.o: sysdep.h -redisplay-tty.o: systime.h -redisplay-tty.o: systty.h -redisplay-tty.o: toolbar.h -redisplay-tty.o: window.h -redisplay-x.o: $(LWLIB_SRCDIR)/lwlib.h -redisplay-x.o: EmacsFrame.h -redisplay-x.o: EmacsFrameP.h -redisplay-x.o: blocktype.h -redisplay-x.o: buffer.h -redisplay-x.o: bufslots.h -redisplay-x.o: config.h -redisplay-x.o: conslots.h -redisplay-x.o: console-x.h -redisplay-x.o: console.h -redisplay-x.o: debug.h -redisplay-x.o: device.h -redisplay-x.o: dynarr.h -redisplay-x.o: faces.h -redisplay-x.o: frame.h -redisplay-x.o: frameslots.h -redisplay-x.o: glyphs-x.h -redisplay-x.o: glyphs.h -redisplay-x.o: objects-x.h -redisplay-x.o: objects.h -redisplay-x.o: paths.h -redisplay-x.o: redisplay.h -redisplay-x.o: scrollbar.h -redisplay-x.o: specifier.h -redisplay-x.o: sysdep.h -redisplay-x.o: sysproc.h -redisplay-x.o: systime.h -redisplay-x.o: toolbar.h -redisplay-x.o: window.h -redisplay-x.o: xgccache.h -redisplay-x.o: xintrinsic.h -redisplay-x.o: xintrinsicp.h -redisplay-x.o: xmprimitivep.h -redisplay.o: blocktype.h -redisplay.o: buffer.h -redisplay.o: bufslots.h -redisplay.o: commands.h -redisplay.o: config.h -redisplay.o: conslots.h -redisplay.o: console.h -redisplay.o: debug.h -redisplay.o: device.h -redisplay.o: dynarr.h -redisplay.o: extents.h -redisplay.o: faces.h -redisplay.o: frame.h -redisplay.o: frameslots.h -redisplay.o: glyphs.h -redisplay.o: insdel.h -redisplay.o: menubar.h -redisplay.o: objects.h -redisplay.o: process.h -redisplay.o: redisplay.h -redisplay.o: scrollbar.h -redisplay.o: specifier.h -redisplay.o: toolbar.h -redisplay.o: window.h -regex.o: blocktype.h -regex.o: buffer.h -regex.o: bufslots.h -regex.o: chartab.h -regex.o: config.h -regex.o: dynarr.h -regex.o: regex.h -regex.o: syntax.h -scrollbar-x.o: $(LWLIB_SRCDIR)/lwlib.h -scrollbar-x.o: EmacsFrame.h -scrollbar-x.o: EmacsManager.h -scrollbar-x.o: blocktype.h -scrollbar-x.o: config.h -scrollbar-x.o: conslots.h -scrollbar-x.o: console-x.h -scrollbar-x.o: console.h -scrollbar-x.o: device.h -scrollbar-x.o: dynarr.h -scrollbar-x.o: frame.h -scrollbar-x.o: frameslots.h -scrollbar-x.o: glyphs-x.h -scrollbar-x.o: glyphs.h -scrollbar-x.o: gui-x.h -scrollbar-x.o: redisplay.h -scrollbar-x.o: scrollbar-x.h -scrollbar-x.o: scrollbar.h -scrollbar-x.o: specifier.h -scrollbar-x.o: toolbar.h -scrollbar-x.o: window.h -scrollbar-x.o: xintrinsic.h -scrollbar.o: blocktype.h -scrollbar.o: buffer.h -scrollbar.o: bufslots.h -scrollbar.o: commands.h -scrollbar.o: config.h -scrollbar.o: conslots.h -scrollbar.o: console.h -scrollbar.o: device.h -scrollbar.o: dynarr.h -scrollbar.o: frame.h -scrollbar.o: frameslots.h -scrollbar.o: glyphs.h -scrollbar.o: redisplay.h -scrollbar.o: scrollbar.h -scrollbar.o: specifier.h -scrollbar.o: toolbar.h -scrollbar.o: window.h -search.o: blocktype.h -search.o: buffer.h -search.o: bufslots.h -search.o: chartab.h -search.o: commands.h -search.o: config.h -search.o: dynarr.h -search.o: insdel.h -search.o: opaque.h -search.o: regex.h -search.o: syntax.h -sheap.o: sheap-adjust.h -sheap.o: config.h -signal.o: blocktype.h -signal.o: config.h -signal.o: conslots.h -signal.o: console.h -signal.o: device.h -signal.o: dynarr.h -signal.o: events.h -signal.o: frame.h -signal.o: frameslots.h -signal.o: scrollbar.h -signal.o: specifier.h -signal.o: sysdep.h -signal.o: systime.h -signal.o: toolbar.h -sound.o: blocktype.h -sound.o: buffer.h -sound.o: bufslots.h -sound.o: commands.h -sound.o: config.h -sound.o: conslots.h -sound.o: console-x.h -sound.o: console.h -sound.o: device.h -sound.o: dynarr.h -sound.o: redisplay.h -sound.o: sysdep.h -sound.o: xintrinsic.h -specifier.o: blocktype.h -specifier.o: buffer.h -specifier.o: bufslots.h -specifier.o: config.h -specifier.o: conslots.h -specifier.o: console.h -specifier.o: device.h -specifier.o: dynarr.h -specifier.o: frame.h -specifier.o: frameslots.h -specifier.o: opaque.h -specifier.o: redisplay.h -specifier.o: scrollbar.h -specifier.o: specifier.h -specifier.o: toolbar.h -specifier.o: window.h -strftime.o: blocktype.h -strftime.o: config.h -strftime.o: dynarr.h -sunOS-fix.o: config.h -sunplay.o: blocktype.h -sunplay.o: config.h -sunplay.o: dynarr.h -sunplay.o: sysdep.h -sunpro.o: blocktype.h -sunpro.o: config.h -sunpro.o: dynarr.h -symbols.o: blocktype.h -symbols.o: buffer.h -symbols.o: bufslots.h -symbols.o: config.h -symbols.o: conslots.h -symbols.o: console.h -symbols.o: dynarr.h -syntax.o: blocktype.h -syntax.o: buffer.h -syntax.o: bufslots.h -syntax.o: chartab.h -syntax.o: commands.h -syntax.o: config.h -syntax.o: dynarr.h -syntax.o: insdel.h -syntax.o: syntax.h -sysdep.o: blocktype.h -sysdep.o: buffer.h -sysdep.o: bufslots.h -sysdep.o: config.h -sysdep.o: conslots.h -sysdep.o: console-stream.h -sysdep.o: console-x.h -sysdep.o: console.h -sysdep.o: device.h -sysdep.o: dynarr.h -sysdep.o: events.h -sysdep.o: frame.h -sysdep.o: frameslots.h -sysdep.o: process.h -sysdep.o: redisplay.h -sysdep.o: scrollbar.h -sysdep.o: specifier.h -sysdep.o: sysdep.h -sysdep.o: sysdir.h -sysdep.o: sysfile.h -sysdep.o: systime.h -sysdep.o: syswait.h -sysdep.o: toolbar.h -sysdep.o: window.h -sysdep.o: xintrinsic.h -termcap.o: blocktype.h -termcap.o: config.h -termcap.o: conslots.h -termcap.o: console.h -termcap.o: device.h -termcap.o: dynarr.h -terminfo.o: config.h -toolbar-x.o: $(LWLIB_SRCDIR)/lwlib.h -toolbar-x.o: EmacsFrame.h -toolbar-x.o: EmacsFrameP.h -toolbar-x.o: EmacsManager.h -toolbar-x.o: blocktype.h -toolbar-x.o: buffer.h -toolbar-x.o: bufslots.h -toolbar-x.o: config.h -toolbar-x.o: conslots.h -toolbar-x.o: console-x.h -toolbar-x.o: console.h -toolbar-x.o: device.h -toolbar-x.o: dynarr.h -toolbar-x.o: faces.h -toolbar-x.o: frame.h -toolbar-x.o: frameslots.h -toolbar-x.o: glyphs-x.h -toolbar-x.o: glyphs.h -toolbar-x.o: objects-x.h -toolbar-x.o: objects.h -toolbar-x.o: redisplay.h -toolbar-x.o: scrollbar.h -toolbar-x.o: specifier.h -toolbar-x.o: toolbar.h -toolbar-x.o: window.h -toolbar-x.o: xgccache.h -toolbar-x.o: xintrinsic.h -toolbar-x.o: xintrinsicp.h -toolbar-x.o: xmprimitivep.h -toolbar.o: blocktype.h -toolbar.o: buffer.h -toolbar.o: bufslots.h -toolbar.o: config.h -toolbar.o: conslots.h -toolbar.o: console.h -toolbar.o: device.h -toolbar.o: dynarr.h -toolbar.o: frame.h -toolbar.o: frameslots.h -toolbar.o: glyphs.h -toolbar.o: redisplay.h -toolbar.o: scrollbar.h -toolbar.o: specifier.h -toolbar.o: toolbar.h -toolbar.o: window.h -tooltalk.o: blocktype.h -tooltalk.o: buffer.h -tooltalk.o: bufslots.h -tooltalk.o: config.h -tooltalk.o: dynarr.h -tooltalk.o: elhash.h -tooltalk.o: process.h -tooltalk.o: tooltalk.h -tparam.o: config.h -undo.o: blocktype.h -undo.o: buffer.h -undo.o: bufslots.h -undo.o: config.h -undo.o: dynarr.h -undo.o: extents.h -vm-limit.o: blocktype.h -vm-limit.o: config.h -vm-limit.o: dynarr.h -vm-limit.o: mem-limits.h -widget.o: config.h -widget.o: buffer.h -widget.o: insdel.h -window.o: blocktype.h -window.o: buffer.h -window.o: bufslots.h -window.o: commands.h -window.o: config.h -window.o: conslots.h -window.o: console.h -window.o: device.h -window.o: dynarr.h -window.o: faces.h -window.o: frame.h -window.o: frameslots.h -window.o: glyphs.h -window.o: objects.h -window.o: redisplay.h -window.o: scrollbar.h -window.o: specifier.h -window.o: toolbar.h -window.o: window.h -xgccache.o: blocktype.h -xgccache.o: config.h -xgccache.o: dynarr.h -xgccache.o: hash.h -xgccache.o: xgccache.h -xmu.o: config.h -xselect.o: blocktype.h -xselect.o: buffer.h -xselect.o: bufslots.h -xselect.o: config.h -xselect.o: conslots.h -xselect.o: console-x.h -xselect.o: console.h -xselect.o: device.h -xselect.o: dynarr.h -xselect.o: frame.h -xselect.o: frameslots.h -xselect.o: objects-x.h -xselect.o: objects.h -xselect.o: opaque.h -xselect.o: scrollbar.h -xselect.o: specifier.h -xselect.o: systime.h -xselect.o: toolbar.h -xselect.o: xintrinsic.h +## Dependency processing using home-grown script, not makedepend +FRC.depend : +depend: FRC.depend + $(RM) $@; + perl ${srcdir}/make-src-depend > depend.tmp + mv depend.tmp ${srcdir}/depend
--- a/src/abbrev.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/abbrev.c Mon Aug 13 10:28:48 2007 +0200 @@ -69,9 +69,7 @@ Lisp_Object Vlast_abbrev_text; /* Character address of start of last abbrev expanded */ -int last_abbrev_point; - -Lisp_Object oblookup (Lisp_Object, CONST Bufbyte *, Bytecount); +int last_abbrev_location; /* Hook to run before expanding any abbrev. */ Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook; @@ -355,7 +353,7 @@ XSETSYMBOL (Vlast_abbrev, abbrev_symbol); Vlast_abbrev_text = make_string_from_buffer (buf, abbrev_start, abbrev_length); - last_abbrev_point = abbrev_start; + last_abbrev_location = abbrev_start; /* Add an undo boundary, in case we are doing this for a self-inserting command which has avoided making one so far. */ @@ -435,13 +433,13 @@ nil if the abbrev has already been unexpanded. */ ); - DEFVAR_INT ("last-abbrev-location", &last_abbrev_point /* + DEFVAR_INT ("last-abbrev-location", &last_abbrev_location /* The location of the start of the last abbrev expanded. */ ); Vlast_abbrev = Qnil; Vlast_abbrev_text = Qnil; - last_abbrev_point = 0; + last_abbrev_location = 0; DEFVAR_LISP ("abbrev-start-location", &Vabbrev_start_location /* Buffer position for `expand-abbrev' to use as the start of the abbrev.
--- a/src/alloc.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/alloc.c Mon Aug 13 10:28:48 2007 +0200 @@ -1,6 +1,5 @@ /* Storage allocation and gc for XEmacs Lisp interpreter. - Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994 - Free Software Foundation, Inc. + Copyright (C) 1985-1998 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1995, 1996 Ben Wing. @@ -41,7 +40,6 @@ #include <config.h> #include "lisp.h" -#include "sysdep.h" #ifndef standalone #include "backtrace.h" @@ -56,6 +54,7 @@ #include "glyphs.h" #include "redisplay.h" #include "specifier.h" +#include "sysfile.h" #include "window.h" #endif @@ -63,6 +62,8 @@ #include <malloc.h> #endif +EXFUN (Fgarbage_collect, 0); + /* #define GDB_SUCKS */ #if 0 /* this is _way_ too slow to be part of the standard debug options */ @@ -194,9 +195,7 @@ extern void sheap_adjust_h(); #endif -extern Lisp_Object pure[];/* moved to pure.c to speed incremental linking */ - -#define PUREBEG ((unsigned char *) pure) +#define PUREBEG ((char *) pure) #if 0 /* This is breathing_space in XEmacs */ /* Points to memory space allocated as "spare", @@ -207,20 +206,15 @@ #define SPARE_MEMORY (1 << 14) #endif -/* Number of extra blocks malloc should get when it needs more core. */ -static int malloc_hysteresis; - /* Index in pure at which next pure object will be allocated. */ -static long pureptr; - -#define PURIFIED(ptr) \ - ((uintptr_t) (ptr) < \ - (uintptr_t) (PUREBEG + get_PURESIZE()) && \ - (uintptr_t) (ptr) >= \ - (uintptr_t) PUREBEG) - -/* Non-zero if pureptr > get_PURESIZE(); accounts for excess purespace needs. */ -static long pure_lossage; +static size_t pure_bytes_used; + +#define PURIFIED(ptr) \ +((char *) (ptr) >= PUREBEG && \ + (char *) (ptr) < PUREBEG + get_PURESIZE()) + +/* Non-zero if pure_bytes_used > get_PURESIZE(); accounts for excess purespace needs. */ +static size_t pure_lossage; #ifdef ERROR_CHECK_TYPECHECK @@ -231,24 +225,24 @@ int purified (Lisp_Object obj) { - return !POINTER_TYPE_P (XGCTYPE (obj)) ? 0 : PURIFIED (XPNTR (obj)); + return POINTER_TYPE_P (XGCTYPE (obj)) && PURIFIED (XPNTR (obj)); } -int +size_t purespace_usage (void) { - return (int) pureptr; + return pure_bytes_used; } static int -check_purespace (EMACS_INT size) +check_purespace (size_t size) { if (pure_lossage) { pure_lossage += size; return 0; } - else if (pureptr + size > get_PURESIZE()) + else if (pure_bytes_used + size > get_PURESIZE()) { /* This can cause recursive bad behavior, we'll yell at the end */ /* when we're done. */ @@ -264,13 +258,13 @@ #ifndef PURESTAT -#define bump_purestat(p,b) do {} while (0) /* Do nothing */ +#define bump_purestat(p,b) DO_NOTHING #else /* PURESTAT */ static int purecopying_for_bytecode; -static int pure_sizeof (Lisp_Object /*, int recurse */); +static size_t pure_sizeof (Lisp_Object /*, int recurse */); /* Keep statistics on how much of what is in purespace */ static struct purestat @@ -318,7 +312,7 @@ }; static void -bump_purestat (struct purestat *purestat, int nbytes) +bump_purestat (struct purestat *purestat, size_t nbytes) { if (pure_lossage) return; purestat->nobjects += 1; @@ -333,11 +327,6 @@ #define MAX_SAVE_STACK 16000 #endif -/* Buffer in which we save a copy of the C stack at each GC. */ - -static char *stack_copy; -static int stack_copy_size; - /* Non-zero means ignore malloc warnings. Set during initialization. */ int ignore_malloc_warnings; @@ -448,35 +437,27 @@ free (block); } -#if INTBITS == 32 -# define FOUR_BYTE_TYPE unsigned int -#elif LONGBITS == 32 -# define FOUR_BYTE_TYPE unsigned long -#elif SHORTBITS == 32 -# define FOUR_BYTE_TYPE unsigned short +#ifdef ERROR_CHECK_GC + +#if SIZEOF_INT == 4 +typedef unsigned int four_byte_t; +#elif SIZEOF_LONG == 4 +typedef unsigned long four_byte_t; +#elif SIZEOF_SHORT == 4 +typedef unsigned short four_byte_t; #else What kind of strange-ass system are we running on? #endif -#ifdef ERROR_CHECK_GC - -#ifdef WORDS_BIGENDIAN -static unsigned char deadbeef_as_char[] = {0xDE, 0xAD, 0xBE, 0xEF}; -#else -static unsigned char deadbeef_as_char[] = {0xEF, 0xBE, 0xAD, 0xDE}; -#endif - static void -deadbeef_memory (void *ptr, unsigned long size) +deadbeef_memory (void *ptr, size_t size) { - unsigned long long_length = size / sizeof (FOUR_BYTE_TYPE); - unsigned long i; - unsigned long bytes_left_over = size - sizeof (FOUR_BYTE_TYPE) * long_length; - - for (i = 0; i < long_length; i++) - ((FOUR_BYTE_TYPE *) ptr)[i] = 0xdeadbeef; - for (i = i; i < bytes_left_over; i++) - ((unsigned char *) ptr + long_length)[i] = deadbeef_as_char[i]; + four_byte_t *ptr4 = (four_byte_t *) ptr; + size_t beefs = size >> 2; + + /* In practice, size will always be a multiple of four. */ + while (beefs--) + (*ptr4++) = 0xDEADBEEF; } #else /* !ERROR_CHECK_GC */ @@ -511,11 +492,12 @@ static void * -allocate_lisp_storage (int size) +allocate_lisp_storage (size_t size) { void *p = xmalloc (size); +#ifndef USE_MINIMAL_TAGBITS char *lim = ((char *) p) + size; - Lisp_Object val = Qnil; + Lisp_Object val; XSETOBJ (val, Lisp_Type_Record, lim); if ((char *) XPNTR (val) != lim) @@ -523,18 +505,19 @@ xfree (p); memory_full (); } +#endif /* ! USE_MINIMAL_TAGBITS */ return p; } /* lrecords are chained together through their "next.v" field. * After doing the mark phase, the GC will walk this linked - * list and free any record which hasn't been marked + * list and free any record which hasn't been marked. */ static struct lcrecord_header *all_lcrecords; void * -alloc_lcrecord (int size, CONST struct lrecord_implementation *implementation) +alloc_lcrecord (size_t size, CONST struct lrecord_implementation *implementation) { struct lcrecord_header *lcheader; @@ -641,18 +624,96 @@ int gc_record_type_p (Lisp_Object frob, CONST struct lrecord_implementation *type) { + CONST struct lrecord_implementation *imp; + + if (XGCTYPE (frob) != Lisp_Type_Record) + return 0; + + imp = XRECORD_LHEADER_IMPLEMENTATION (frob); #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION - return (XGCTYPE (frob) == Lisp_Type_Record - && XRECORD_LHEADER_IMPLEMENTATION (frob) == type); + return imp == type; #else - return (XGCTYPE (frob) == Lisp_Type_Record - && (XRECORD_LHEADER (frob)->implementation == type || - XRECORD_LHEADER (frob)->implementation == type + 1)); + return imp == type || imp == type + 1; #endif } /**********************************************************************/ +/* Debugger support */ +/**********************************************************************/ +/* Give gdb/dbx enough information to decode Lisp Objects. + We make sure certain symbols are defined, so gdb doesn't complain + about expressions in src/gdbinit. Values are randomly chosen. + See src/gdbinit or src/dbxrc to see how this is used. */ + +enum dbg_constants +{ +#ifdef USE_MINIMAL_TAGBITS + dbg_valmask = (EMACS_INT) (((1UL << VALBITS) - 1) << GCBITS), + dbg_typemask = (EMACS_INT) ((1UL << GCTYPEBITS) - 1), + dbg_USE_MINIMAL_TAGBITS = 1, + dbg_Lisp_Type_Int = 100, +#else /* ! USE_MIMIMAL_TAGBITS */ + dbg_valmask = (EMACS_INT) ((1UL << VALBITS) - 1), + dbg_typemask = (EMACS_INT) (((1UL << GCTYPEBITS) - 1) << (VALBITS + GCMARKBITS)), + dbg_USE_MINIMAL_TAGBITS = 0, + dbg_Lisp_Type_Int = Lisp_Type_Int, +#endif /* ! USE_MIMIMAL_TAGBITS */ +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1, +#else + dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 0, +#endif + dbg_Lisp_Type_Char = Lisp_Type_Char, + dbg_Lisp_Type_Record = Lisp_Type_Record, +#ifdef LRECORD_CONS + dbg_Lisp_Type_Cons = 101, +#else + dbg_Lisp_Type_Cons = Lisp_Type_Cons, + lrecord_cons = 201, +#endif +#ifdef LRECORD_STRING + dbg_Lisp_Type_String = 102, +#else + dbg_Lisp_Type_String = Lisp_Type_String, + lrecord_string = 202, +#endif +#ifdef LRECORD_VECTOR + dbg_Lisp_Type_Vector = 103, +#else + dbg_Lisp_Type_Vector = Lisp_Type_Vector, + lrecord_vector = 203, +#endif +#ifdef LRECORD_SYMBOL + dbg_Lisp_Type_Symbol = 104, +#else + dbg_Lisp_Type_Symbol = Lisp_Type_Symbol, + lrecord_symbol = 204, +#endif +#ifndef MULE + lrecord_char_table_entry = 205, + lrecord_charset = 206, + lrecord_coding_system = 207, +#endif +#ifndef HAVE_TOOLBARS + lrecord_toolbar_button = 208, + lrecord_toolbar_data = 209, +#endif +#ifndef HAVE_TOOLTALK + lrecord_tooltalk_message = 210, + lrecord_tooltalk_pattern = 211, +#endif +#ifndef HAVE_DATABASE + lrecord_database = 212, +#endif + dbg_valbits = VALBITS, + dbg_gctypebits = GCTYPEBITS + /* If we don't have an actual object of this enum, pgcc (and perhaps + other compilers) might optimize away the entire type declaration :-( */ +} dbg_dummy; + + +/**********************************************************************/ /* Fixed-size type macros */ /**********************************************************************/ @@ -819,7 +880,7 @@ try to set aside another reserve in case we run out once more. This is called when a relocatable block is freed in ralloc.c. */ - +void refill_memory_reserve (void); void refill_memory_reserve () { @@ -1040,8 +1101,8 @@ { if (NILP (XCDR (obj))) return XCAR (obj); - else - (markobj) (XCAR (obj)); + + (markobj) (XCAR (obj)); return XCDR (obj); } @@ -1050,8 +1111,8 @@ { while (internal_equal (XCAR (ob1), XCAR (ob2), depth + 1)) { - ob1 = XCDR(ob1); - ob2 = XCDR(ob2); + ob1 = XCDR (ob1); + ob2 = XCDR (ob2); if (! CONSP (ob1) || ! CONSP (ob2)) return internal_equal (ob1, ob2, depth + 1); } @@ -1076,7 +1137,7 @@ (car, cdr)) { /* This cannot GC. */ - Lisp_Object val = Qnil; + Lisp_Object val; struct Lisp_Cons *c; ALLOCATE_FIXED_TYPE (cons, struct Lisp_Cons, c); @@ -1095,7 +1156,7 @@ Lisp_Object noseeum_cons (Lisp_Object car, Lisp_Object cdr) { - Lisp_Object val = Qnil; + Lisp_Object val; struct Lisp_Cons *c; NOSEEUM_ALLOCATE_FIXED_TYPE (cons, struct Lisp_Cons, c); @@ -1133,17 +1194,17 @@ list2 (Lisp_Object obj0, Lisp_Object obj1) { /* This cannot GC. */ - return Fcons (obj0, list1 (obj1)); + return Fcons (obj0, Fcons (obj1, Qnil)); } Lisp_Object list3 (Lisp_Object obj0, Lisp_Object obj1, Lisp_Object obj2) { /* This cannot GC. */ - return Fcons (obj0, list2 (obj1, obj2)); + return Fcons (obj0, Fcons (obj1, Fcons (obj2, Qnil))); } -static Lisp_Object +Lisp_Object cons3 (Lisp_Object obj0, Lisp_Object obj1, Lisp_Object obj2) { /* This cannot GC. */ @@ -1151,10 +1212,16 @@ } Lisp_Object +acons (Lisp_Object key, Lisp_Object value, Lisp_Object alist) +{ + return Fcons (Fcons (key, value), alist); +} + +Lisp_Object list4 (Lisp_Object obj0, Lisp_Object obj1, Lisp_Object obj2, Lisp_Object obj3) { /* This cannot GC. */ - return Fcons (obj0, list3 (obj1, obj2, obj3)); + return Fcons (obj0, Fcons (obj1, Fcons (obj2, Fcons (obj3, Qnil)))); } Lisp_Object @@ -1162,7 +1229,7 @@ Lisp_Object obj4) { /* This cannot GC. */ - return Fcons (obj0, list4 (obj1, obj2, obj3, obj4)); + return Fcons (obj0, Fcons (obj1, Fcons (obj2, Fcons (obj3, Fcons (obj4, Qnil))))); } Lisp_Object @@ -1170,24 +1237,24 @@ Lisp_Object obj4, Lisp_Object obj5) { /* This cannot GC. */ - return Fcons (obj0, list5 (obj1, obj2, obj3, obj4, obj5)); + return Fcons (obj0, Fcons (obj1, Fcons (obj2, Fcons (obj3, Fcons (obj4, Fcons (obj5, Qnil)))))); } DEFUN ("make-list", Fmake_list, 2, 2, 0, /* -Return a newly created list of length LENGTH, with each element being INIT. +Return a new list of length LENGTH, with each element being INIT. */ (length, init)) { - Lisp_Object val; - int size; - CHECK_NATNUM (length); - size = XINT (length); - - val = Qnil; - while (size-- > 0) - val = Fcons (init, val); - return val; + + { + Lisp_Object val = Qnil; + int size = XINT (length); + + while (size-- > 0) + val = Fcons (init, val); + return val; + } } @@ -1234,15 +1301,12 @@ return (len > 0) ? ptr->contents[len - 1] : Qnil; } -static unsigned int +static size_t size_vector (CONST void *lheader) { - CONST struct Lisp_Vector *p = lheader; - /* - * -1 because struct Lisp_Vector includes 1 slot - */ + /* * -1 because struct Lisp_Vector includes 1 slot */ return sizeof (struct Lisp_Vector) + - ((p->size - 1) * sizeof (Lisp_Object)) ; + ((((struct Lisp_Vector *) lheader)->size - 1) * sizeof (Lisp_Object)); } static int @@ -1275,13 +1339,13 @@ /* #### should allocate `small' vectors from a frob-block */ static struct Lisp_Vector * -make_vector_internal (EMACS_INT sizei) +make_vector_internal (size_t sizei) { - EMACS_INT sizem = (sizeof (struct Lisp_Vector) - /* -1 because struct Lisp_Vector includes 1 slot */ - + (sizei - 1) * sizeof (Lisp_Object) - ); - struct Lisp_Vector *p = alloc_lcrecord (sizem, lrecord_vector); + size_t sizem = (sizeof (struct Lisp_Vector) + /* -1 because struct Lisp_Vector includes 1 slot */ + + (sizei - 1) * sizeof (Lisp_Object)); + struct Lisp_Vector *p = + (struct Lisp_Vector *) alloc_lcrecord (sizem, lrecord_vector); p->size = sizei; return p; @@ -1293,13 +1357,12 @@ /* #### should allocate `small' vectors from a frob-block */ static struct Lisp_Vector * -make_vector_internal (EMACS_INT sizei) +make_vector_internal (size_t sizei) { - EMACS_INT sizem = (sizeof (struct Lisp_Vector) - /* -1 because struct Lisp_Vector includes 1 slot, - * +1 to account for vector_next */ - + (sizei - 1 + 1) * sizeof (Lisp_Object) - ); + size_t sizem = (sizeof (struct Lisp_Vector) + /* -1 because struct Lisp_Vector includes 1 slot, + * +1 to account for vector_next */ + + (sizei - 1 + 1) * sizeof (Lisp_Object)); struct Lisp_Vector *p = (struct Lisp_Vector *) allocate_lisp_storage (sizem); INCREMENT_CONS_COUNTER (sizem, "vector"); @@ -1315,8 +1378,8 @@ Lisp_Object make_vector (EMACS_INT length, Lisp_Object init) { - EMACS_INT elt; - Lisp_Object vector = Qnil; + int elt; + Lisp_Object vector; struct Lisp_Vector *p; if (length < 0) @@ -1346,14 +1409,12 @@ } DEFUN ("make-vector", Fmake_vector, 2, 2, 0, /* -Return a newly created vector of length LENGTH, with each element being INIT. +Return a new vector of length LENGTH, with each element being INIT. See also the function `vector'. */ (length, init)) { - if (!INTP (length) || XINT (length) < 0) - length = wrong_type_argument (Qnatnump, length); - + CHECK_NATNUM (length); return make_vector (XINT (length), init); } @@ -1363,16 +1424,14 @@ */ (int nargs, Lisp_Object *args)) { - Lisp_Object vector = Qnil; + Lisp_Object vector; int elt; - struct Lisp_Vector *p; - - p = make_vector_internal (nargs); - XSETVECTOR (vector, p); + struct Lisp_Vector *p = make_vector_internal (nargs); for (elt = 0; elt < nargs; elt++) vector_data(p)[elt] = args[elt]; + XSETVECTOR (vector, p); return vector; } @@ -1401,6 +1460,8 @@ return Fvector (3, args); } +#if 0 /* currently unused */ + Lisp_Object vector4 (Lisp_Object obj0, Lisp_Object obj1, Lisp_Object obj2, Lisp_Object obj3) @@ -1472,6 +1533,7 @@ args[7] = obj7; return Fvector (8, args); } +#endif /* unused */ /**********************************************************************/ /* Bit Vector allocation */ @@ -1481,11 +1543,11 @@ /* #### should allocate `small' bit vectors from a frob-block */ static struct Lisp_Bit_Vector * -make_bit_vector_internal (EMACS_INT sizei) +make_bit_vector_internal (size_t sizei) { - EMACS_INT sizem = (sizeof (struct Lisp_Bit_Vector) + - /* -1 because struct Lisp_Bit_Vector includes 1 slot */ - sizeof (long) * (BIT_VECTOR_LONG_STORAGE (sizei) - 1)); + size_t sizem = sizeof (struct Lisp_Bit_Vector) + + /* -1 because struct Lisp_Bit_Vector includes 1 slot */ + sizeof (long) * (BIT_VECTOR_LONG_STORAGE (sizei) - 1); struct Lisp_Bit_Vector *p = (struct Lisp_Bit_Vector *) allocate_lisp_storage (sizem); set_lheader_implementation (&(p->lheader), lrecord_bit_vector); @@ -1504,13 +1566,10 @@ Lisp_Object make_bit_vector (EMACS_INT length, Lisp_Object init) { - Lisp_Object bit_vector = Qnil; + Lisp_Object bit_vector; struct Lisp_Bit_Vector *p; EMACS_INT num_longs; - if (length < 0) - length = XINT (wrong_type_argument (Qnatnump, make_int (length))); - CHECK_BIT (init); num_longs = BIT_VECTOR_LONG_STORAGE (length); @@ -1535,9 +1594,9 @@ Lisp_Object make_bit_vector_from_byte_vector (unsigned char *bytevec, EMACS_INT length) { - Lisp_Object bit_vector = Qnil; + Lisp_Object bit_vector; struct Lisp_Bit_Vector *p; - EMACS_INT i; + int i; if (length < 0) length = XINT (wrong_type_argument (Qnatnump, make_int (length))); @@ -1552,13 +1611,12 @@ } DEFUN ("make-bit-vector", Fmake_bit_vector, 2, 2, 0, /* -Return a newly created bit vector of length LENGTH. +Return a new bit vector of length LENGTH. with each bit being INIT. Each element is set to INIT. See also the function `bit-vector'. */ (length, init)) { - if (!INTP (length) || XINT (length) < 0) - length = wrong_type_argument (Qnatnump, length); + CONCHECK_NATNUM (length); return make_bit_vector (XINT (length), init); } @@ -1569,7 +1627,7 @@ */ (int nargs, Lisp_Object *args)) { - Lisp_Object bit_vector = Qnil; + Lisp_Object bit_vector; int elt; struct Lisp_Bit_Vector *p; @@ -1577,11 +1635,11 @@ CHECK_BIT (args[elt]); p = make_bit_vector_internal (nargs); - XSETBIT_VECTOR (bit_vector, p); for (elt = 0; elt < nargs; elt++) set_bit_vector_bit (p, elt, !ZEROP (args[elt])); + XSETBIT_VECTOR (bit_vector, p); return bit_vector; } @@ -1598,16 +1656,16 @@ { struct Lisp_Compiled_Function *b; Lisp_Object new; - int size = sizeof (struct Lisp_Compiled_Function); + size_t size = sizeof (struct Lisp_Compiled_Function); if (make_pure && check_purespace (size)) { - b = (struct Lisp_Compiled_Function *) (PUREBEG + pureptr); + b = (struct Lisp_Compiled_Function *) (PUREBEG + pure_bytes_used); set_lheader_implementation (&(b->lheader), lrecord_compiled_function); #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION b->lheader.pure = 1; #endif - pureptr += size; + pure_bytes_used += size; bump_purestat (&purestat_bytecode, size); } else @@ -1632,7 +1690,7 @@ } DEFUN ("make-byte-code", Fmake_byte_code, 4, MANY, 0, /* -Create a compiled-function object. +Return a new compiled-function object. Usage: (arglist instructions constants stack-size &optional doc-string interactive-spec) Note that, unlike all other emacs-lisp functions, calling this with five @@ -1654,8 +1712,8 @@ Lisp_Object instructions = args[1]; Lisp_Object constants = args[2]; Lisp_Object stack_size = args[3]; - Lisp_Object doc_string = ((nargs > 4) ? args[4] : Qnil); - Lisp_Object interactive = ((nargs > 5) ? args[5] : Qunbound); + Lisp_Object doc_string = (nargs > 4) ? args[4] : Qnil; + Lisp_Object interactive = (nargs > 5) ? args[5] : Qunbound; /* Don't purecopy the doc references in instructions because it's wasteful; they will get fixed up later. @@ -1846,14 +1904,14 @@ struct extent *e; ALLOCATE_FIXED_TYPE (extent, struct extent, e); - /* memset (e, 0, sizeof (struct extent)); */ + /* xzero (*e); */ set_lheader_implementation (&(e->lheader), lrecord_extent); extent_object (e) = Qnil; set_extent_start (e, -1); set_extent_end (e, -1); e->plist = Qnil; - memset (&e->flags, 0, sizeof (e->flags)); + xzero (e->flags); extent_face (e) = Qnil; e->flags.end_open = 1; /* default is for endpoints to behave like markers */ @@ -1892,7 +1950,7 @@ #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_marker 1000 DEFUN ("make-marker", Fmake_marker, 0, 0, 0, /* -Return a newly allocated marker which does not point at any place. +Return a new marker which does not point at any place. */ ()) { @@ -1964,12 +2022,9 @@ static int string_equal (Lisp_Object o1, Lisp_Object o2, int depth) { - Bytecount len = XSTRING_LENGTH (o1); - if (len != XSTRING_LENGTH (o2)) - return 0; - if (memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len)) - return 0; - return 1; + Bytecount len; + return (((len = XSTRING_LENGTH (o1)) == XSTRING_LENGTH (o2)) && + !memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len)); } DEFINE_BASIC_LRECORD_IMPLEMENTATION ("string", string, @@ -1989,9 +2044,10 @@ #endif /* LRECORD_STRING */ /* String blocks contain this many useful bytes. */ -#define STRING_CHARS_BLOCK_SIZE \ - (8192 - MALLOC_OVERHEAD - ((2 * sizeof (struct string_chars_block *)) \ - + sizeof (EMACS_INT))) +#define STRING_CHARS_BLOCK_SIZE \ +((Bytecount) (8192 - MALLOC_OVERHEAD - \ + ((2 * sizeof (struct string_chars_block *)) \ + + sizeof (EMACS_INT)))) /* Block header for small strings. */ struct string_chars_block { @@ -2157,8 +2213,8 @@ return; else { - EMACS_INT oldfullsize = STRING_FULLSIZE (string_length (s)); - EMACS_INT newfullsize = STRING_FULLSIZE (string_length (s) + delta); + Bytecount oldfullsize = STRING_FULLSIZE (string_length (s)); + Bytecount newfullsize = STRING_FULLSIZE (string_length (s) + delta); if (oldfullsize == newfullsize) { @@ -2240,7 +2296,7 @@ if (pos >= 0) { - Lisp_Object string = Qnil; + Lisp_Object string; XSETSTRING (string, s); /* We also have to adjust all of the extent indices after the @@ -2278,7 +2334,7 @@ #endif /* MULE */ DEFUN ("make-string", Fmake_string, 2, 2, 0, /* -Return a newly created string of length LENGTH, with each element being INIT. +Return a new string of length LENGTH, with each character being INIT. LENGTH must be an integer and INIT must be a character. */ (length, init)) @@ -2310,7 +2366,7 @@ } /* Take some raw memory, which MUST already be in internal format, - and package it up it into a Lisp string. */ + and package it up into a Lisp string. */ Lisp_Object make_string (CONST Bufbyte *contents, Bytecount length) { @@ -2332,7 +2388,7 @@ make_ext_string (CONST Extbyte *contents, EMACS_INT length, enum external_data_format fmt) { - CONST Bufbyte *intstr; + Bufbyte *intstr; Bytecount intlen; GET_CHARPTR_INT_DATA_ALLOCA (contents, length, fmt, intstr, intlen); @@ -2350,7 +2406,7 @@ build_ext_string (CONST char *str, enum external_data_format fmt) { /* Some strlen's crash and burn if passed null. */ - return make_ext_string ((Extbyte *) str, (str ? strlen(str) : 0), fmt); + return make_ext_string ((CONST Extbyte *) str, (str ? strlen(str) : 0), fmt); } Lisp_Object @@ -2432,12 +2488,12 @@ mark_lcrecord_list, internal_object_printer, 0, 0, 0, struct lcrecord_list); Lisp_Object -make_lcrecord_list (int size, +make_lcrecord_list (size_t size, CONST struct lrecord_implementation *implementation) { struct lcrecord_list *p = alloc_lcrecord_type (struct lcrecord_list, lrecord_lcrecord_list); - Lisp_Object val = Qnil; + Lisp_Object val; p->implementation = implementation; p->size = size; @@ -2480,7 +2536,7 @@ } else { - Lisp_Object val = Qnil; + Lisp_Object val; XSETOBJ (val, Lisp_Type_Record, alloc_lcrecord (list->size, list->implementation)); @@ -2529,10 +2585,8 @@ { Lisp_Object new; struct Lisp_String *s; - int size = (sizeof (struct Lisp_String) + ((no_need_to_copy_data) - ? 0 - /* + 1 for terminating 0 */ - : (length + 1))); + size_t size = sizeof (struct Lisp_String) + + (no_need_to_copy_data ? 0 : (length + 1)); /* + 1 for terminating 0 */ size = ALIGN_SIZE (size, ALIGNOF (Lisp_Object)); if (symbols_initialized && !pure_lossage) @@ -2551,7 +2605,7 @@ if (!check_purespace (size)) return make_string (data, length); - s = (struct Lisp_String *) (PUREBEG + pureptr); + s = (struct Lisp_String *) (PUREBEG + pure_bytes_used); #ifdef LRECORD_STRING set_lheader_implementation (&(s->lheader), lrecord_string); #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION @@ -2570,7 +2624,7 @@ set_string_byte (s, length, 0); } s->plist = Qnil; - pureptr += size; + pure_bytes_used += size; #ifdef PURESTAT bump_purestat (&purestat_string_all, size); @@ -2610,14 +2664,14 @@ if (!check_purespace (sizeof (struct Lisp_Cons))) return Fcons (Fpurecopy (car), Fpurecopy (cdr)); - c = (struct Lisp_Cons *) (PUREBEG + pureptr); + c = (struct Lisp_Cons *) (PUREBEG + pure_bytes_used); #ifdef LRECORD_CONS set_lheader_implementation (&(c->lheader), lrecord_cons); #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION c->lheader.pure = 1; #endif #endif - pureptr += sizeof (struct Lisp_Cons); + pure_bytes_used += sizeof (struct Lisp_Cons); bump_purestat (&purestat_cons, sizeof (struct Lisp_Cons)); c->car = Fpurecopy (car); @@ -2629,23 +2683,23 @@ Lisp_Object pure_list (int nargs, Lisp_Object *args) { - Lisp_Object foo = Qnil; + Lisp_Object val = Qnil; for (--nargs; nargs >= 0; nargs--) - foo = pure_cons (args[nargs], foo); - - return foo; + val = pure_cons (args[nargs], val); + + return val; } #ifdef LISP_FLOAT_TYPE -Lisp_Object +static Lisp_Object make_pure_float (double num) { struct Lisp_Float *f; Lisp_Object val; - /* Make sure that PUREBEG + pureptr is aligned on at least a sizeof + /* Make sure that PUREBEG + pure_bytes_used is aligned on at least a sizeof (double) boundary. Some architectures (like the sparc) require this, and I suspect that floats are rare enough that it's no tragedy for those that don't. */ @@ -2665,21 +2719,21 @@ */ int alignment = sizeof (float_data (f)); #endif /* !GNUC */ - char *p = ((char *) PUREBEG + pureptr); - - p = (char *) (((unsigned EMACS_INT) p + alignment - 1) & - alignment); - pureptr = p - (char *) PUREBEG; + char *p = ((char *) PUREBEG + pure_bytes_used); + + p = (char *) (((EMACS_UINT) p + alignment - 1) & - alignment); + pure_bytes_used = p - (char *) PUREBEG; } if (!check_purespace (sizeof (struct Lisp_Float))) return make_float (num); - f = (struct Lisp_Float *) (PUREBEG + pureptr); + f = (struct Lisp_Float *) (PUREBEG + pure_bytes_used); set_lheader_implementation (&(f->lheader), lrecord_float); #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION f->lheader.pure = 1; #endif - pureptr += sizeof (struct Lisp_Float); + pure_bytes_used += sizeof (struct Lisp_Float); bump_purestat (&purestat_float, sizeof (struct Lisp_Float)); float_next (f) = ((struct Lisp_Float *) -1); @@ -2691,26 +2745,26 @@ #endif /* LISP_FLOAT_TYPE */ Lisp_Object -make_pure_vector (EMACS_INT len, Lisp_Object init) +make_pure_vector (size_t len, Lisp_Object init) { Lisp_Object new; struct Lisp_Vector *v; - EMACS_INT size = (sizeof (struct Lisp_Vector) - + (len - 1) * sizeof (Lisp_Object)); + size_t size = (sizeof (struct Lisp_Vector) + + (len - 1) * sizeof (Lisp_Object)); init = Fpurecopy (init); if (!check_purespace (size)) return make_vector (len, init); - v = (struct Lisp_Vector *) (PUREBEG + pureptr); + v = (struct Lisp_Vector *) (PUREBEG + pure_bytes_used); #ifdef LRECORD_VECTOR set_lheader_implementation (&(v->header.lheader), lrecord_vector); #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION v->header.lheader.pure = 1; #endif #endif - pureptr += size; + pure_bytes_used += size; bump_purestat (&purestat_vector_all, size); v->size = len; @@ -2727,9 +2781,9 @@ void * alloc_pure_lrecord (int size, struct lrecord_implementation *implementation) { - struct lrecord_header *header = (void *) (PUREBEG + pureptr); - - if (pureptr + size > get_PURESIZE()) + struct lrecord_header *header = (void *) (PUREBEG + pure_bytes_used); + + if (pure_bytes_used + size > get_PURESIZE()) pure_storage_exhausted (); set_lheader_implementation (header, implementation); @@ -2861,7 +2915,7 @@ static void -puresize_adjust_h (long int puresize) +puresize_adjust_h (size_t puresize) { FILE *stream = fopen ("puresize-adjust.h", "w"); @@ -2873,7 +2927,7 @@ "/*\tDo not edit this file!\n" "\tAutomatically generated by XEmacs */\n" "# define PURESIZE_ADJUSTMENT (%ld)\n", - puresize - RAW_PURESIZE); + (long) (puresize - RAW_PURESIZE)); fclose (stream); } @@ -2888,33 +2942,36 @@ message ("\n****\tPure Lisp storage exhausted!\n" "\tPurespace usage: %ld of %ld\n" "****", - get_PURESIZE()+pure_lossage, (long) get_PURESIZE()); - if (die_if_pure_storage_exceeded) { - puresize_adjust_h (get_PURESIZE() + pure_lossage); + (long) get_PURESIZE() + pure_lossage, + (long) get_PURESIZE()); + if (die_if_pure_storage_exceeded) + { + puresize_adjust_h (get_PURESIZE() + pure_lossage); #ifdef HEAP_IN_DATA - sheap_adjust_h(); + sheap_adjust_h(); #endif - rc = -1; - } + rc = -1; + } } else { - int lost = (get_PURESIZE() - pureptr) / 1024; + size_t lost = (get_PURESIZE() - pure_bytes_used) / 1024; char buf[200]; /* extern Lisp_Object Vemacs_beta_version; */ /* This used to be NILP(Vemacs_beta_version) ? 512 : 4; */ #ifndef PURESIZE_SLOP #define PURESIZE_SLOP 0 #endif - int slop = PURESIZE_SLOP; + size_t slop = PURESIZE_SLOP; sprintf (buf, "Purespace usage: %ld of %ld (%d%%", - pureptr, (long) get_PURESIZE(), - (int) (pureptr / (get_PURESIZE() / 100.0) + 0.5)); + (long) pure_bytes_used, + (long) get_PURESIZE(), + (int) (pure_bytes_used / (get_PURESIZE() / 100.0) + 0.5)); if (lost > ((slop ? slop : 1) / 1024)) { sprintf (buf + strlen (buf), " -- %dk wasted", lost); if (die_if_pure_storage_exceeded) { - puresize_adjust_h (pureptr + slop); + puresize_adjust_h (pure_bytes_used + slop); #ifdef HEAP_IN_DATA sheap_adjust_h(); #endif @@ -2973,7 +3030,7 @@ buf, purestats[j]->nobjects, purestats[j]->nbytes, - (int) (purestats[j]->nbytes / (pureptr / 100.0) + 0.5)); + (int) (purestats[j]->nbytes / (pure_bytes_used / 100.0) + 0.5)); } } #endif /* PURESTAT */ @@ -3231,32 +3288,30 @@ } #endif /* unused */ -static int -pure_string_sizeof(Lisp_Object obj) +static size_t +pure_string_sizeof (Lisp_Object obj) { struct Lisp_String *ptr = XSTRING (obj); - int size = string_length (ptr); - - if (string_data (ptr) != - (unsigned char *) ptr + sizeof (struct Lisp_String)) + + if (string_data (ptr) != (Bufbyte *) ptr + sizeof (*ptr)) { /* string-data not allocated contiguously. Probably (better be!!) a pointer constant "C" data. */ - size = sizeof (struct Lisp_String); + return sizeof (*ptr); } else { - size = sizeof (struct Lisp_String) + size + 1; + size_t size = sizeof (*ptr) + string_length (ptr) + 1; size = ALIGN_SIZE (size, sizeof (Lisp_Object)); + return size; } - return size; } /* recurse arg isn't actually used */ -static int +static size_t pure_sizeof (Lisp_Object obj /*, int recurse */) { - int total = 0; + size_t total = 0; /*tail_recurse: */ if (!POINTER_TYPE_P (XTYPE (obj)) @@ -3272,9 +3327,7 @@ #ifndef LRECORD_STRING case Lisp_Type_String: - { - total += pure_string_sizeof (obj); - } + total += pure_string_sizeof (obj); break; #endif /* ! LRECORD_STRING */ @@ -3399,7 +3452,7 @@ lrecord_type_index (CONST struct lrecord_implementation *implementation) { int type_index = *(implementation->lrecord_type_index); - /* Have to do this circuitous and validation test because of problems + /* Have to do this circuitous validation test because of problems dumping out initialized variables (ie can't set xxx_type_index to -1 because that would make xxx_type_index read-only in a dumped emacs. */ if (type_index < 0 || type_index > max_lrecord_type @@ -3454,9 +3507,9 @@ } else { - unsigned int sz = (implementation->size_in_bytes_method - ? ((implementation->size_in_bytes_method) (h)) - : implementation->static_size); + size_t sz = (implementation->size_in_bytes_method + ? ((implementation->size_in_bytes_method) (h)) + : implementation->static_size); if (free_p) { @@ -4238,13 +4291,6 @@ /* Clearing for disksave. */ -extern Lisp_Object Vprocess_environment; -extern Lisp_Object Vdoc_directory; -extern Lisp_Object Vconfigure_info_directory; -extern Lisp_Object Vload_path; -extern Lisp_Object Vload_history; -extern Lisp_Object Vshell_file_name; - void disksave_object_finalization (void) { @@ -4281,9 +4327,9 @@ #if 0 /* I don't see any point in this. The purespace starts out all 0's */ /* Zero out the unused portion of purespace */ if (!pure_lossage) - memset ( (char *) (PUREBEG + pureptr), 0, + memset ( (char *) (PUREBEG + pure_bytes_used), 0, (((char *) (PUREBEG + get_PURESIZE())) - - ((char *) (PUREBEG + pureptr)))); + ((char *) (PUREBEG + pure_bytes_used)))); #endif /* Zero out the uninitialized (really, unused) part of the containers @@ -4325,20 +4371,19 @@ extern char *stack_bottom; int i; struct frame *f; - int speccount = specpdl_depth (); - Lisp_Object pre_gc_cursor = Qnil; + int speccount; + int cursor_changed; + Lisp_Object pre_gc_cursor; struct gcpro gcpro1; - int cursor_changed = 0; - - if (gc_in_progress != 0) + if (gc_in_progress + || gc_currently_forbidden + || in_display + || preparing_for_armageddon) return; - if (gc_currently_forbidden || in_display) - return; - - if (preparing_for_armageddon) - return; + pre_gc_cursor = Qnil; + cursor_changed = 0; /* This function cannot be called inside GC so we move to after the */ /* above tests */ @@ -4349,6 +4394,7 @@ /* Very important to prevent GC during any of the following stuff that might run Lisp code; otherwise, we'll likely have infinite GC recursion. */ + speccount = specpdl_depth (); record_unwind_protect (restore_gc_inhibit, make_int (gc_currently_forbidden)); gc_currently_forbidden = 1; @@ -4402,21 +4448,23 @@ /* Save a copy of the contents of the stack, for debugging. */ if (!purify_flag) { - i = &stack_top_variable - stack_bottom; - if (i < 0) i = -i; - if (i < MAX_SAVE_STACK) + /* Static buffer in which we save a copy of the C stack at each GC. */ + static char *stack_copy; + static size_t stack_copy_size; + + ptrdiff_t stack_diff = &stack_top_variable - stack_bottom; + size_t stack_size = (stack_diff > 0 ? stack_diff : -stack_diff); + if (stack_size < MAX_SAVE_STACK) { - if (stack_copy == 0) - stack_copy = (char *) malloc (stack_copy_size = i); - else if (stack_copy_size < i) - stack_copy = (char *) realloc (stack_copy, (stack_copy_size = i)); - if (stack_copy) + if (stack_copy_size < stack_size) { - if ((int) (&stack_top_variable - stack_bottom) > 0) - memcpy (stack_copy, stack_bottom, i); - else - memcpy (stack_copy, &stack_top_variable, i); + stack_copy = (char *) xrealloc (stack_copy, stack_size); + stack_copy_size = stack_size; } + + memcpy (stack_copy, + stack_diff > 0 ? stack_bottom : &stack_top_variable, + stack_size); } } #endif /* MAX_SAVE_STACK > 0 */ @@ -4552,7 +4600,7 @@ if (!breathing_space) { - breathing_space = (void *) malloc (4096 - MALLOC_OVERHEAD); + breathing_space = malloc (4096 - MALLOC_OVERHEAD); } UNGCPRO; @@ -4589,7 +4637,7 @@ DEFUN ("garbage-collect", Fgarbage_collect, 0, 0, "", /* Reclaim storage for Lisp objects no longer needed. -Returns info on amount of space in use: +Return info on amount of space in use: ((USED-CONSES . FREE-CONSES) (USED-SYMS . FREE-SYMS) (USED-MARKERS . FREE-MARKERS) USED-STRING-CHARS USED-VECTOR-SLOTS PLIST) @@ -4601,16 +4649,13 @@ ()) { Lisp_Object pl = Qnil; - Lisp_Object ret[6]; int i; #ifdef LRECORD_VECTOR int gc_count_vector_total_size = 0; #endif if (purify_flag && pure_lossage) - { - return Qnil; - } + return Qnil; garbage_collect_1 (); @@ -4708,16 +4753,16 @@ pl = gc_plist_hack ("conses-used", gc_count_num_cons_in_use, pl); /* The things we do for backwards-compatibility */ - ret[0] = Fcons (make_int (gc_count_num_cons_in_use), - make_int (gc_count_num_cons_freelist)); - ret[1] = Fcons (make_int (gc_count_num_symbol_in_use), - make_int (gc_count_num_symbol_freelist)); - ret[2] = Fcons (make_int (gc_count_num_marker_in_use), - make_int (gc_count_num_marker_freelist)); - ret[3] = make_int (gc_count_string_total_size); - ret[4] = make_int (gc_count_vector_total_size); - ret[5] = pl; - return Flist (6, ret); + return + list6 (Fcons (make_int (gc_count_num_cons_in_use), + make_int (gc_count_num_cons_freelist)), + Fcons (make_int (gc_count_num_symbol_in_use), + make_int (gc_count_num_symbol_freelist)), + Fcons (make_int (gc_count_num_marker_in_use), + make_int (gc_count_num_marker_freelist)), + make_int (gc_count_string_total_size), + make_int (gc_count_vector_total_size), + pl); } #undef HACK_O_MATIC @@ -4755,7 +4800,6 @@ (CONSOLEP (obj) && !CONSOLE_LIVE_P (XCONSOLE (obj))) || (EVENTP (obj) && !EVENT_LIVE_P (XEVENT (obj))) || (EXTENTP (obj) && !EXTENT_LIVE_P (XEXTENT (obj)))); - } #ifdef MEMORY_USAGE_STATS @@ -4792,11 +4836,11 @@ blocks are allocated in the minimum required size except that some minimum block size is imposed (e.g. 16 bytes). */ -int -malloced_storage_size (void *ptr, int claimed_size, +size_t +malloced_storage_size (void *ptr, size_t claimed_size, struct overhead_stats *stats) { - int orig_claimed_size = claimed_size; + size_t orig_claimed_size = claimed_size; #ifdef GNU_MALLOC @@ -4825,7 +4869,7 @@ } /* We have to come up with some average about the amount of blocks used. */ - if ((rand () & 4095) < claimed_size) + if ((size_t) (rand () & 4095) < claimed_size) claimed_size += 3 * sizeof (void *); } else @@ -4876,17 +4920,16 @@ return claimed_size; } -int -fixed_type_block_overhead (int size) +size_t +fixed_type_block_overhead (size_t size) { - int per_block = TYPE_ALLOC_SIZE (cons, unsigned char); - int overhead = 0; - int storage_size = malloced_storage_size (0, per_block, 0); + size_t per_block = TYPE_ALLOC_SIZE (cons, unsigned char); + size_t overhead = 0; + size_t storage_size = malloced_storage_size (0, per_block, 0); while (size >= per_block) { size -= per_block; overhead += sizeof (void *) + per_block - storage_size; - } if (rand () % per_block < size) overhead += sizeof (void *) + per_block - storage_size; @@ -4926,15 +4969,15 @@ * assigned to lrecord_subr so that those predefined indexes match * reality. */ - (void) lrecord_type_index (lrecord_subr); + lrecord_type_index (lrecord_subr); assert (*(lrecord_subr[0].lrecord_type_index) == 0); /* * The same is true for symbol_value_forward objects, except the * type is 1. */ - (void) lrecord_type_index (lrecord_symbol_value_forward); + lrecord_type_index (lrecord_symbol_value_forward); assert (*(lrecord_symbol_value_forward[0].lrecord_type_index) == 1); -#endif +#endif /* USE_INDEXED_LRECORD_IMPLEMENTATION */ symbols_initialized = 0; @@ -4942,7 +4985,7 @@ /* purify_flag 1 is correct even if CANNOT_DUMP. * loadup.el will set to nil at end. */ purify_flag = 1; - pureptr = 0; + pure_bytes_used = 0; pure_lossage = 0; breathing_space = 0; #ifndef LRECORD_VECTOR @@ -5050,7 +5093,7 @@ See also `consing-since-gc'. */ ); - DEFVAR_INT ("pure-bytes-used", &pureptr /* + DEFVAR_INT ("pure-bytes-used", &pure_bytes_used /* Number of bytes of sharable Lisp data allocated so far. */ );
--- a/src/backtrace.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/backtrace.h Mon Aug 13 10:28:48 2007 +0200 @@ -34,7 +34,7 @@ #define _XEMACS_BACKTRACE_H_ #include <setjmp.h> - + /* These definitions are used in eval.c and alloc.c */ struct backtrace
--- a/src/balloon-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/balloon-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1997 Douglas Keller This file is part of XEmacs.
--- a/src/balloon_help.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/balloon_help.c Mon Aug 13 10:28:48 2007 +0200 @@ -488,6 +488,24 @@ ============================================================================*/ +static void +balloon_help_destroy (void) +{ + assert (b_dpy != NULL); + b_dpy = NULL; + + destroy_window (b_dpy, b_win); + destroy_gc (b_dpy, b_gc); + + destroy_gc (b_dpy, b_shineGC); + destroy_gc (b_dpy, b_shadowGC); + + destroy_pixmap_mask (); + destroy_gc (b_dpy, b_maskGC); + + if (b_timer) XtRemoveTimeOut (b_timer); +} + void balloon_help_create (Display* dpy, Pixel fg, Pixel bg, Pixel shine, Pixel shadow, @@ -519,24 +537,6 @@ } void -balloon_help_destroy (void) -{ - assert (b_dpy != NULL); - b_dpy = NULL; - - destroy_window (b_dpy, b_win); - destroy_gc (b_dpy, b_gc); - - destroy_gc (b_dpy, b_shineGC); - destroy_gc (b_dpy, b_shadowGC); - - destroy_pixmap_mask (); - destroy_gc (b_dpy, b_maskGC); - - if (b_timer) XtRemoveTimeOut (b_timer); -} - -void balloon_help_set_delay (unsigned long milliseconds) { b_delay = milliseconds;
--- a/src/balloon_help.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/balloon_help.h Mon Aug 13 10:28:48 2007 +0200 @@ -28,7 +28,6 @@ void balloon_help_create (Display* dpy, Pixel fg, Pixel bg, Pixel shine, Pixel shadow, XFontStruct* font); -void balloon_help_destroy (void); void balloon_help_set_delay (unsigned long milliseconds); void balloon_help_show (CONST char* text); void balloon_help_hide (void);
--- a/src/blocktype.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/blocktype.c Mon Aug 13 10:28:48 2007 +0200 @@ -77,7 +77,7 @@ }; void * -Blocktype_newf (int elsize) +Blocktype_newf (size_t elsize) { Blocktype *b = xnew (Blocktype); b->elsize = max (elsize, sizeof (void *));
--- a/src/blocktype.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/blocktype.h Mon Aug 13 10:28:48 2007 +0200 @@ -34,7 +34,7 @@ int elsize; \ type *tempel -void *Blocktype_newf (int elsize); +void *Blocktype_newf (size_t elsize); void Blocktype_allocf (void *b); void Blocktype_free (void *bbb, void *el);
--- a/src/broken-sun.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/broken-sun.h Mon Aug 13 10:28:48 2007 +0200 @@ -34,135 +34,135 @@ /*********************** stdlib functions *********************/ -/* extern void * memchr (CONST void *, int, size_t); */ +/* void * memchr (CONST void *, int, size_t); */ -/* extern int memcmp (CONST void *, CONST void *, size_t); */ -/* extern void * memcpy (void *, CONST void *, size_t); */ -/* extern void * memmove (void *, CONST void *, size_t);*/ -/* extern void * memset (void *, int, int); */ -/* extern char * strcat (char *, CONST char *); */ -/* extern char * strchr (CONST char *, int); */ -/* extern int strcmp (CONST char *, CONST char *); */ -extern int strcasecmp (char *, char *); -extern void bzero (char *, int); -extern void bcopy (char *, char *, int); +/* int memcmp (CONST void *, CONST void *, size_t); */ +/* void * memcpy (void *, CONST void *, size_t); */ +/* void * memmove (void *, CONST void *, size_t);*/ +/* void * memset (void *, int, int); */ +/* char * strcat (char *, CONST char *); */ +/* char * strchr (CONST char *, int); */ +/* int strcmp (CONST char *, CONST char *); */ +int strcasecmp (char *, char *); +void bzero (char *, int); +void bcopy (char *, char *, int); /* Yes, they even left these functions out! */ -extern int tolower (int); -extern int toupper (int); +int tolower (int); +int toupper (int); /*********************** stdio functions *********************/ #include <stdio.h> /* else can't declare FILE */ -/* extern FILE *fopen (CONST char *, CONST char *); */ -/* extern FILE *freopen (CONST char *, CONST char *, FILE *); */ -extern FILE *tmpfile (void); -extern int fclose (FILE *); -extern char *fgets (char *, int, FILE *); -extern int fgetc (FILE *); -extern int fflush (FILE *); -extern int fprintf (FILE *, CONST char *, ...); -extern int fputc (char, FILE *); -extern int fputs (CONST char *, FILE *); -extern size_t fread (void *, size_t, size_t, FILE *); -extern int fscanf (FILE *, CONST char *, ...); -extern int fgetpos (FILE *, long *); -extern int fseek (FILE *, long, int); -extern int fsetpos (FILE *, CONST long *); -extern long ftell (FILE *); -extern size_t fwrite (CONST void *, size_t, size_t, FILE *); -extern char *gets (char *); -extern int pclose (FILE *); -extern void perror (CONST char *); -extern int printf (CONST char *, ...); -extern int puts (CONST char *); -extern int remove (CONST char *); -extern int rename (CONST char *, CONST char *); -extern int rewind (FILE *); -extern int scanf (CONST char *, ...); -extern int sscanf (CONST char *, CONST char *, ...); -extern void setbuf (FILE *, char *); -extern int setvbuf (FILE *, char *, int, size_t); -extern int ungetc (int, FILE *); -extern int vprintf (CONST char *, void *); -extern int vfprintf (FILE *, CONST char *, void *); -extern char *vsprintf (char *, CONST char *, void *); +/* FILE *fopen (CONST char *, CONST char *); */ +/* FILE *freopen (CONST char *, CONST char *, FILE *); */ +FILE *tmpfile (void); +int fclose (FILE *); +char *fgets (char *, int, FILE *); +int fgetc (FILE *); +int fflush (FILE *); +int fprintf (FILE *, CONST char *, ...); +int fputc (char, FILE *); +int fputs (CONST char *, FILE *); +size_t fread (void *, size_t, size_t, FILE *); +int fscanf (FILE *, CONST char *, ...); +int fgetpos (FILE *, long *); +int fseek (FILE *, long, int); +int fsetpos (FILE *, CONST long *); +long ftell (FILE *); +size_t fwrite (CONST void *, size_t, size_t, FILE *); +char *gets (char *); +int pclose (FILE *); +void perror (CONST char *); +int printf (CONST char *, ...); +int puts (CONST char *); +int remove (CONST char *); +int rename (CONST char *, CONST char *); +int rewind (FILE *); +int scanf (CONST char *, ...); +int sscanf (CONST char *, CONST char *, ...); +void setbuf (FILE *, char *); +int setvbuf (FILE *, char *, int, size_t); +int ungetc (int, FILE *); +int vprintf (CONST char *, void *); +int vfprintf (FILE *, CONST char *, void *); +char *vsprintf (char *, CONST char *, void *); /*********************** signal functions *********************/ -extern int sigblock (int); +int sigblock (int); #ifndef sigmask -extern int sigmask (int); +int sigmask (int); #endif -extern int sigsetmask (int); -extern int sigpause (int); +int sigsetmask (int); +int sigpause (int); /*********************** time functions ***********************/ struct timeval; struct timezone; -extern int utimes (CONST char *, struct timeval *); -extern void tzset (void); -extern time_t time (time_t *); -extern int gettimeofday (struct timeval *, struct timezone *); +int utimes (CONST char *, struct timeval *); +void tzset (void); +time_t time (time_t *); +int gettimeofday (struct timeval *, struct timezone *); /*********************** file-system functions *********************/ struct stat; #include </usr/include/sys/types.h> -extern int fsync (int); -extern int lstat (CONST char *, struct stat *); -extern int fchmod (int, mode_t); -extern char *mktemp (char *); -/* extern int creat (CONST char *, mode_t); better no decl than a conflicting one... */ -extern int symlink (CONST char *, CONST char *); -extern int readlink (CONST char *, char *, int); -extern void sync (void); -extern int select (int, fd_set *, fd_set *, fd_set *, struct timeval *); -extern char * getwd (char *); -/* extern int lseek (int, long, int); better no decl than a conflicting one... */ -extern int _filbuf (); -extern int _flsbuf (); +int fsync (int); +int lstat (CONST char *, struct stat *); +int fchmod (int, mode_t); +char *mktemp (char *); +/* int creat (CONST char *, mode_t); better no decl than a conflicting one... */ +int symlink (CONST char *, CONST char *); +int readlink (CONST char *, char *, int); +void sync (void); +int select (int, fd_set *, fd_set *, fd_set *, struct timeval *); +char * getwd (char *); +/* int lseek (int, long, int); better no decl than a conflicting one... */ +int _filbuf (); +int _flsbuf (); /**************** interprocess communication functions ******************/ -extern int recv (int, char *, int, int); -extern int socket (int, int, int); +int recv (int, char *, int, int); +int socket (int, int, int); struct sockaddr; -extern int connect (int, struct sockaddr *, int); -extern int bind (int, struct sockaddr *, int); -extern int listen (int, int); -extern int accept (int, struct sockaddr *, int *); -extern int gethostname (char *, int); +int connect (int, struct sockaddr *, int); +int bind (int, struct sockaddr *, int); +int listen (int, int); +int accept (int, struct sockaddr *, int *); +int gethostname (char *, int); struct rusage; -extern int wait3 (void *, int, struct rusage *); -extern int nice (int); -extern int killpg (int, int); -extern int system (char *); +int wait3 (void *, int, struct rusage *); +int nice (int); +int killpg (int, int); +int system (char *); /*********************** low-level OS functions *********************/ -extern int ioctl (int, int, ...); +int ioctl (int, int, ...); struct nlist; -extern int nlist (CONST char *, struct nlist *); -extern int munmap (void *, int); -extern int brk (void *); -extern void * sbrk (int); +int nlist (CONST char *, struct nlist *); +int munmap (void *, int); +int brk (void *); +void * sbrk (int); struct rlimit; -extern int getrlimit (int, struct rlimit *); -extern int getpagesize (void); -extern int shutdown (int, int); -extern int mprotect (void *, int, int); +int getrlimit (int, struct rlimit *); +int getpagesize (void); +int shutdown (int, int); +int mprotect (void *, int, int); /*********************** miscellaneous functions *********************/ -extern void tputs (CONST char *cp, int affcnt, void (*)(int)); -extern long random (void); -extern int srandom (int seed); +void tputs (CONST char *cp, int affcnt, void (*)(int)); +long random (void); +int srandom (int seed); #endif /* __GNUC__ */
--- a/src/buffer.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/buffer.c Mon Aug 13 10:28:48 2007 +0200 @@ -80,7 +80,6 @@ #ifdef REGION_CACHE_NEEDS_WORK #include "region-cache.h" #endif -#include "symeval.h" #include "syntax.h" #include "sysdep.h" /* for getwd */ #include "window.h" @@ -98,7 +97,7 @@ Lisp_Object Vbuffer_defaults; /* This structure marks which slots in a buffer have corresponding - default values in buffer_defaults. + default values in Vbuffer_defaults. Each such slot has a nonzero value in this structure. The value has only one nonzero bit. @@ -108,7 +107,7 @@ If a slot in this structure is 0, then there is a DEFVAR_BUFFER_LOCAL for the slot, but there is no default value for it; the corresponding - slot in buffer_defaults is not used except to initialize newly-created + slot in Vbuffer_defaults is not used except to initialize newly-created buffers. If a slot is -1, then there is a DEFVAR_BUFFER_LOCAL for it @@ -121,10 +120,7 @@ If a slot is -3, then there is no DEFVAR_BUFFER_LOCAL for it but there is a default which is used to initialize newly-creation - buffers and as a reset-value when local-vars are killed. - - - */ + buffers and as a reset-value when local-vars are killed. */ struct buffer buffer_local_flags; /* This structure holds the names of symbols whose values may be @@ -207,14 +203,6 @@ static void reset_buffer_local_variables (struct buffer *, int first_time); static void nuke_all_buffer_slots (struct buffer *b, Lisp_Object zap); -static Lisp_Object mark_buffer (Lisp_Object, void (*) (Lisp_Object)); -static void print_buffer (Lisp_Object, Lisp_Object, int); -/* We do not need a finalize method to handle a buffer's children list - because all buffers have `kill-buffer' applied to them before - they disappear, and the children removal happens then. */ -DEFINE_LRECORD_IMPLEMENTATION ("buffer", buffer, - mark_buffer, print_buffer, 0, 0, 0, - struct buffer); Lisp_Object make_buffer (struct buffer *buf) @@ -241,20 +229,11 @@ ((markobj) (buf->extent_info)); /* Don't mark normally through the children slot. - (Actually, in this case, it doesn't matter.) - */ + (Actually, in this case, it doesn't matter.) */ if (! EQ (buf->indirect_children, Qnull_pointer)) mark_conses_in_list (buf->indirect_children); - if (buf->base_buffer) - { - Lisp_Object base_buf_obj = Qnil; - - XSETBUFFER (base_buf_obj, buf->base_buffer); - return base_buf_obj; - } - else - return Qnil; + return buf->base_buffer ? make_buffer (buf->base_buffer) : Qnil; } static void @@ -284,25 +263,27 @@ } } +/* We do not need a finalize method to handle a buffer's children list + because all buffers have `kill-buffer' applied to them before + they disappear, and the children removal happens then. */ +DEFINE_LRECORD_IMPLEMENTATION ("buffer", buffer, + mark_buffer, print_buffer, 0, 0, 0, + struct buffer); DEFUN ("bufferp", Fbufferp, 1, 1, 0, /* -T if OBJECT is an editor buffer. +Return t if OBJECT is an editor buffer. */ (object)) { - if (BUFFERP (object)) - return Qt; - return Qnil; + return BUFFERP (object) ? Qt : Qnil; } DEFUN ("buffer-live-p", Fbuffer_live_p, 1, 1, 0, /* -T if OBJECT is an editor buffer that has not been deleted. +Return t if OBJECT is an editor buffer that has not been deleted. */ (object)) { - if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) - return Qt; - return Qnil; + return BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object)) ? Qt : Qnil; } static void @@ -333,8 +314,6 @@ Lisp_Object get_buffer (Lisp_Object name, int error_if_deleted_or_does_not_exist) { - Lisp_Object buf; - if (BUFFERP (name)) { if (!BUFFER_LIVE_P (XBUFFER (name))) @@ -347,6 +326,7 @@ } else { + Lisp_Object buf; struct gcpro gcpro1; CHECK_STRING (name); @@ -707,7 +687,7 @@ #undef MARKED_SLOT #if 0 #define STRING256_P(obj) \ - (STRINGP (obj) && string_char_length (XSTRING (obj)) == 256) + (STRINGP (obj) && XSTRING_CHAR_LENGTH (obj) == 256) /* If the standard case table has been altered and invalidated, fix up its insides first. */ if (!(STRING256_P(Vascii_upcase_table) && @@ -813,13 +793,8 @@ (buffer)) { struct buffer *buf = decode_buffer (buffer, 0); - struct buffer *base = buf->base_buffer; - Lisp_Object base_buffer = Qnil; - - if (! base) - return Qnil; - XSETBUFFER (base_buffer, base); - return base_buffer; + + return buf->base_buffer ? make_buffer (buf->base_buffer) : Qnil; } DEFUN ("buffer-indirect-children", Fbuffer_indirect_children, 0, 1, 0, /* @@ -1595,17 +1570,16 @@ } DEFUN ("set-buffer", Fset_buffer, 1, 1, 0, /* -Make the buffer BUFNAME current for editing operations. -BUFNAME may be a buffer or the name of an existing buffer. +Make the buffer BUFFER current for editing operations. +BUFFER may be a buffer or the name of an existing buffer. See also `save-excursion' when you want to make a buffer current temporarily. This function does not display the buffer, so its effect ends when the current command terminates. Use `switch-to-buffer' or `pop-to-buffer' to switch buffers permanently. */ - (bufname)) + (buffer)) { - Lisp_Object buffer; - buffer = get_buffer (bufname, 0); + buffer = get_buffer (buffer, 0); if (NILP (buffer)) error ("Selecting deleted or non-existent buffer"); set_buffer_internal (XBUFFER (buffer)); @@ -1624,7 +1598,7 @@ If START and END are equal, the range checked is [START, END] (i.e. closed on both ends); otherwise, the range checked is (START, END) -(open on both ends), except that extents that lie completely within +\(open on both ends), except that extents that lie completely within [START, END] are not checked. See `extent-in-region-p' for a fuller discussion. */ @@ -1729,7 +1703,7 @@ /* Prevent warnings, or suspension of auto saving, that would happen if future size is less than past size. Use of erase-buffer implies that the future text is not really related to the past text. */ - b->save_length = Qzero; + b->saved_size = Qzero; zmacs_region_stays = 0; return Qnil; @@ -1784,18 +1758,15 @@ int other; }; -static int +static size_t compute_buffer_text_usage (struct buffer *b, struct overhead_stats *ovstats) { - int malloc_use; - int was_requested; - int gap; - - was_requested = b->text->z - 1; - gap = b->text->gap_size + b->text->end_gap_size; - malloc_use = malloced_storage_size (b->text->beg, was_requested + gap, 0); - ovstats->gap_overhead += gap; - ovstats->was_requested += was_requested; + int was_requested = b->text->z - 1; + size_t gap = b->text->gap_size + b->text->end_gap_size; + size_t malloc_use = malloced_storage_size (b->text->beg, was_requested + gap, 0); + + ovstats->gap_overhead += gap; + ovstats->was_requested += was_requested; ovstats->malloc_overhead += malloc_use - (was_requested + gap); return malloc_use; } @@ -1804,22 +1775,22 @@ compute_buffer_usage (struct buffer *b, struct buffer_stats *stats, struct overhead_stats *ovstats) { - memset (stats, 0, sizeof (*stats)); - stats->other += malloced_storage_size (b, sizeof (struct buffer), ovstats); - stats->text += compute_buffer_text_usage (b, ovstats); + xzero (*stats); + stats->other += malloced_storage_size (b, sizeof (*b), ovstats); + stats->text += compute_buffer_text_usage (b, ovstats); stats->markers += compute_buffer_marker_usage (b, ovstats); stats->extents += compute_buffer_extent_usage (b, ovstats); } DEFUN ("buffer-memory-usage", Fbuffer_memory_usage, 1, 1, 0, /* Return stats about the memory usage of buffer BUFFER. -The values returned are in the form an alist of usage types and byte +The values returned are in the form of an alist of usage types and byte counts. The byte counts attempt to encompass all the memory used by the buffer (separate from the memory logically associated with a buffer or frame), including internal structures and any malloc() overhead associated with them. In practice, the byte counts are underestimated because certain memory usage is very hard to determine -(e.g. the amount of memory used inside the Xt library or inside the +\(e.g. the amount of memory used inside the Xt library or inside the X server) and because there is other stuff that might logically be associated with a window, buffer, or frame (e.g. window configurations, glyphs) but should not obviously be included in the usage counts. @@ -1834,24 +1805,23 @@ { struct buffer_stats stats; struct overhead_stats ovstats; + Lisp_Object val = Qnil; CHECK_BUFFER (buffer); /* dead buffers should be allowed, no? */ - memset (&ovstats, 0, sizeof (ovstats)); + xzero (ovstats); compute_buffer_usage (XBUFFER (buffer), &stats, &ovstats); - return nconc2 (list4 (Fcons (Qtext, make_int (stats.text)), - Fcons (Qmarkers, make_int (stats.markers)), - Fcons (Qextents, make_int (stats.extents)), - Fcons (Qother, make_int (stats.other))), - list5 (Qnil, - Fcons (Qactually_requested, - make_int (ovstats.was_requested)), - Fcons (Qmalloc_overhead, - make_int (ovstats.malloc_overhead)), - Fcons (Qgap_overhead, - make_int (ovstats.malloc_overhead)), - Fcons (Qdynarr_overhead, - make_int (ovstats.dynarr_overhead)))); + val = acons (Qtext, make_int (stats.text), val); + val = acons (Qmarkers, make_int (stats.markers), val); + val = acons (Qextents, make_int (stats.extents), val); + val = acons (Qother, make_int (stats.other), val); + val = Fcons (Qnil, val); + val = acons (Qactually_requested, make_int (ovstats.was_requested), val); + val = acons (Qmalloc_overhead, make_int (ovstats.malloc_overhead), val); + val = acons (Qgap_overhead, make_int (ovstats.gap_overhead), val); + val = acons (Qdynarr_overhead, make_int (ovstats.dynarr_overhead), val); + + return Fnreverse (val); } #endif /* MEMORY_USAGE_STATS */ @@ -2186,13 +2156,11 @@ defs->mirror_upcase_table = Vmirror_ascii_upcase_table; defs->mirror_case_canon_table = Vmirror_ascii_canon_table; defs->mirror_case_eqv_table = Vmirror_ascii_eqv_table; + defs->category_table = Vstandard_category_table; #endif /* MULE */ defs->syntax_table = Vstandard_syntax_table; defs->mirror_syntax_table = XCHAR_TABLE (Vstandard_syntax_table)->mirror_table; -#ifdef MULE - defs->category_table = Vstandard_category_table; -#endif defs->modeline_format = build_string ("%-"); /* reset in loaddefs.el */ defs->case_fold_search = Qt; defs->selective_display_ellipses = Qt; @@ -2200,7 +2168,7 @@ defs->ctl_arrow = Qt; defs->fill_column = make_int (70); defs->left_margin = Qzero; - defs->save_length = Qzero; /* lisp code wants int-or-nil */ + defs->saved_size = Qzero; /* lisp code wants int-or-nil */ defs->modtime = 0; defs->auto_save_modified = 0; defs->auto_save_failure_time = -1; @@ -2233,7 +2201,7 @@ buffer_local_flags.filename = always_local_no_default; buffer_local_flags.directory = always_local_no_default; buffer_local_flags.backed_up = always_local_no_default; - buffer_local_flags.save_length = always_local_no_default; + buffer_local_flags.saved_size = always_local_no_default; buffer_local_flags.auto_save_file_name = always_local_no_default; buffer_local_flags.read_only = always_local_no_default; @@ -2583,7 +2551,7 @@ Each buffer has its own value of this variable. */ ); - DEFVAR_BUFFER_LOCAL ("buffer-saved-size", save_length /* + DEFVAR_BUFFER_LOCAL ("buffer-saved-size", saved_size /* Length of current buffer when last read in, saved or auto-saved. 0 initially. Each buffer has its own value of this variable. @@ -2770,15 +2738,15 @@ DEFVAR_BUFFER_LOCAL() calls. */ #define MARKED_SLOT(slot) \ if ((XINT (buffer_local_flags.slot) != -2 && \ - XINT (buffer_local_flags.slot) != -3) \ + XINT (buffer_local_flags.slot) != -3) \ != !(NILP (XBUFFER (Vbuffer_local_symbols)->slot))) \ abort () #include "bufslots.h" #undef MARKED_SLOT { - Lisp_Object scratch = - Fset_buffer (Fget_buffer_create (QSscratch)); + Lisp_Object scratch = Fget_buffer_create (QSscratch); + Fset_buffer (scratch); /* Want no undo records for *scratch* until after Emacs is dumped */ Fbuffer_disable_undo (scratch); } @@ -2825,7 +2793,7 @@ do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ else unixtodos_filename (s); \ } while (0) - + CORRECT_DIR_SEPS(buf); #endif current_buffer->directory = build_string (buf);
--- a/src/buffer.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/buffer.h Mon Aug 13 10:28:48 2007 +0200 @@ -220,41 +220,18 @@ #define CONCHECK_BUFFER(x) CONCHECK_RECORD (x, buffer) #define BUFFER_LIVE_P(b) (!NILP ((b)->name)) -extern Lisp_Object Qbuffer_live_p; -#define CHECK_LIVE_BUFFER(x) \ - do { CHECK_BUFFER (x); \ - if (!BUFFER_LIVE_P (XBUFFER (x))) \ - dead_wrong_type_argument (Qbuffer_live_p, (x)); \ - } while (0) -#define CONCHECK_LIVE_BUFFER(x) \ - do { CONCHECK_BUFFER (x); \ - if (!BUFFER_LIVE_P (XBUFFER (x))) \ - x = wrong_type_argument (Qbuffer_live_p, (x)); \ - } while (0) - -#define BUFFER_OR_STRING_P(x) (BUFFERP (x) || STRINGP (x)) -extern Lisp_Object Qbuffer_or_string_p; -#define CHECK_BUFFER_OR_STRING(x) \ - do { if (!BUFFER_OR_STRING_P (x)) \ - dead_wrong_type_argument (Qbuffer_or_string_p, (x)); \ - } while (0) -#define CONCHECK_BUFFER_OR_STRING(x) \ - do { if (!BUFFER_OR_STRING_P (x)) \ - x = wrong_type_argument (Qbuffer_or_string_p, (x)); \ - } while (0) +#define CHECK_LIVE_BUFFER(x) do { \ + CHECK_BUFFER (x); \ + if (!BUFFER_LIVE_P (XBUFFER (x))) \ + dead_wrong_type_argument (Qbuffer_live_p, (x)); \ +} while (0) -#define CHECK_LIVE_BUFFER_OR_STRING(x) \ - do { CHECK_BUFFER_OR_STRING (x); \ - if (BUFFERP (x)) \ - CHECK_LIVE_BUFFER (x); \ - } while (0) -#define CONCHECK_LIVE_BUFFER_OR_STRING(x) \ - do { CONCHECK_BUFFER_OR_STRING (x); \ - if (BUFFERP (x)) \ - CONCHECK_LIVE_BUFFER (x); \ - } while (0) - +#define CONCHECK_LIVE_BUFFER(x) do { \ + CONCHECK_BUFFER (x); \ + if (!BUFFER_LIVE_P (XBUFFER (x))) \ + x = wrong_type_argument (Qbuffer_live_p, (x)); \ +} while (0) /* NOTE: In all the following macros, we follow these rules concerning @@ -265,20 +242,19 @@ This should probably be changed, but this follows the way that all the macros in lisp.h do things. 3) 'struct buffer *' arguments can be evaluated more than once. - 4) Nothing else can be evaluated more than once. Use MTxx - variables to prevent multiple evaluation. + 4) Nothing else can be evaluated more than once. Use inline + functions, if necessary, to prevent multiple evaluation. 5) An exception to (4) is that there are some macros below that may evaluate their arguments more than once. They are all denoted with the word "unsafe" in their name and are generally meant to be called only by other macros that have already stored the calling values in temporary variables. - */ /************************************************************************/ -/* */ -/* working with raw internal-format data */ -/* */ +/* */ +/* working with raw internal-format data */ +/* */ /************************************************************************/ /* Use these on contiguous strings of data. If the text you're @@ -431,25 +407,19 @@ #define inc_charptr_fun(ptr) real_inc_charptr_fun (ptr) #endif -#define REAL_INC_CHARPTR(ptr) do \ -{ \ - real_inc_charptr_fun (ptr); \ +#define REAL_INC_CHARPTR(ptr) ((void) (real_inc_charptr_fun (ptr))) + +#define INC_CHARPTR(ptr) do { \ + ASSERT_VALID_CHARPTR (ptr); \ + REAL_INC_CHARPTR (ptr); \ } while (0) -#define INC_CHARPTR(ptr) do \ -{ \ - ASSERT_VALID_CHARPTR (ptr); \ - REAL_INC_CHARPTR (ptr); \ -} while (0) - -#define REAL_DEC_CHARPTR(ptr) do \ -{ \ - (ptr)--; \ +#define REAL_DEC_CHARPTR(ptr) do { \ + (ptr)--; \ } while (!VALID_CHARPTR_P (ptr)) #ifdef ERROR_CHECK_BUFPOS -#define DEC_CHARPTR(ptr) do \ -{ \ +#define DEC_CHARPTR(ptr) do { \ CONST Bufbyte *__dcptr__ = (ptr); \ CONST Bufbyte *__dcptr2__ = __dcptr__; \ REAL_DEC_CHARPTR (__dcptr2__); \ @@ -463,16 +433,14 @@ #ifdef MULE -#define VALIDATE_CHARPTR_BACKWARD(ptr) do \ -{ \ +#define VALIDATE_CHARPTR_BACKWARD(ptr) do { \ while (!VALID_CHARPTR_P (ptr)) ptr--; \ } while (0) /* This needs to be trickier to avoid the possibility of running off the end of the string. */ -#define VALIDATE_CHARPTR_FORWARD(ptr) do \ -{ \ +#define VALIDATE_CHARPTR_FORWARD(ptr) do { \ Bufbyte *__vcfptr__ = (ptr); \ VALIDATE_CHARPTR_BACKWARD (__vcfptr__); \ if (__vcfptr__ != (ptr)) \ @@ -608,7 +576,7 @@ x = make_char (XINT (x)); \ else \ x = wrong_type_argument (Qcharacterp, x); \ - } while (0) +} while (0) #ifdef MULE # define MAX_EMCHAR_LEN 4 @@ -618,7 +586,7 @@ /*----------------------------------------------------------------------*/ -/* Accessor macros for important positions in a buffer */ +/* Accessor macros for important positions in a buffer */ /*----------------------------------------------------------------------*/ /* We put them here because some stuff below wants them before the @@ -648,7 +616,7 @@ #define BUF_PT(buf) ((buf)->bufpt + 0) /*----------------------------------------------------------------------*/ -/* Converting between positions and addresses */ +/* Converting between positions and addresses */ /*----------------------------------------------------------------------*/ /* Convert the address of a byte in the buffer into a position. */ @@ -691,7 +659,7 @@ BI_BUF_BYTE_ADDRESS_BEFORE (buf, bufpos_to_bytind (buf, pos)) /*----------------------------------------------------------------------*/ -/* Converting between byte indices and memory indices */ +/* Converting between byte indices and memory indices */ /*----------------------------------------------------------------------*/ INLINE int valid_memind_p (struct buffer *buf, Memind x); @@ -710,34 +678,22 @@ return (Memind) ((x > (buf)->text->gpt) ? (x + (buf)->text->gap_size) : x); } -#ifdef ERROR_CHECK_BUFPOS INLINE Bytind memind_to_bytind (struct buffer *buf, Memind x); INLINE Bytind memind_to_bytind (struct buffer *buf, Memind x) { +#ifdef ERROR_CHECK_BUFPOS assert (valid_memind_p (buf, x)); +#endif return (Bytind) ((x > (Memind) (buf)->text->gpt) ? x - (buf)->text->gap_size : x); } -#else - -INLINE Bytind memind_to_bytind (struct buffer *buf, Memind x); -INLINE Bytind -memind_to_bytind (struct buffer *buf, Memind x) -{ - return (Bytind) ((x > (Memind) (buf)->text->gpt) ? - x - (buf)->text->gap_size : - x); -} - -#endif - -#define memind_to_bufpos(buf, x) \ +#define memind_to_bufpos(buf, x) \ bytind_to_bufpos (buf, memind_to_bytind (buf, x)) -#define bufpos_to_memind(buf, x) \ +#define bufpos_to_memind(buf, x) \ bytind_to_memind (buf, bufpos_to_bytind (buf, x)) /* These macros generalize many standard buffer-position functions to @@ -756,22 +712,22 @@ /* Converting between Bufpos's and Bytinds, for a buffer-or-string. For strings, this maps to the bytecount<->charcount converters. */ -#define buffer_or_string_bufpos_to_bytind(obj, pos) \ - (BUFFERP (obj) ? bufpos_to_bytind (XBUFFER (obj), pos) : \ +#define buffer_or_string_bufpos_to_bytind(obj, pos) \ + (BUFFERP (obj) ? bufpos_to_bytind (XBUFFER (obj), pos) : \ (Bytind) charcount_to_bytecount (XSTRING_DATA (obj), pos)) -#define buffer_or_string_bytind_to_bufpos(obj, ind) \ - (BUFFERP (obj) ? bytind_to_bufpos (XBUFFER (obj), ind) : \ +#define buffer_or_string_bytind_to_bufpos(obj, ind) \ + (BUFFERP (obj) ? bytind_to_bufpos (XBUFFER (obj), ind) : \ (Bufpos) bytecount_to_charcount (XSTRING_DATA (obj), ind)) /* Similar for Bufpos's and Meminds. */ -#define buffer_or_string_bufpos_to_memind(obj, pos) \ - (BUFFERP (obj) ? bufpos_to_memind (XBUFFER (obj), pos) : \ +#define buffer_or_string_bufpos_to_memind(obj, pos) \ + (BUFFERP (obj) ? bufpos_to_memind (XBUFFER (obj), pos) : \ (Memind) charcount_to_bytecount (XSTRING_DATA (obj), pos)) -#define buffer_or_string_memind_to_bufpos(obj, ind) \ - (BUFFERP (obj) ? memind_to_bufpos (XBUFFER (obj), ind) : \ +#define buffer_or_string_memind_to_bufpos(obj, ind) \ + (BUFFERP (obj) ? memind_to_bufpos (XBUFFER (obj), ind) : \ (Bufpos) bytecount_to_charcount (XSTRING_DATA (obj), ind)) /************************************************************************/ @@ -851,7 +807,7 @@ /*----------------------------------------------------------------------*/ -/* working with byte indices */ +/* working with byte indices */ /*----------------------------------------------------------------------*/ #ifdef MULE @@ -863,20 +819,17 @@ #ifdef ERROR_CHECK_BUFPOS -# define ASSERT_VALID_BYTIND_UNSAFE(buf, x) do \ -{ \ +# define ASSERT_VALID_BYTIND_UNSAFE(buf, x) do { \ assert (BUFFER_LIVE_P (buf)); \ assert ((x) >= BI_BUF_BEG (buf) && x <= BI_BUF_Z (buf)); \ assert (VALID_BYTIND_P (buf, x)); \ } while (0) -# define ASSERT_VALID_BYTIND_BACKWARD_UNSAFE(buf, x) do \ -{ \ +# define ASSERT_VALID_BYTIND_BACKWARD_UNSAFE(buf, x) do { \ assert (BUFFER_LIVE_P (buf)); \ assert ((x) > BI_BUF_BEG (buf) && x <= BI_BUF_Z (buf)); \ assert (VALID_BYTIND_P (buf, x)); \ } while (0) -# define ASSERT_VALID_BYTIND_FORWARD_UNSAFE(buf, x) do \ -{ \ +# define ASSERT_VALID_BYTIND_FORWARD_UNSAFE(buf, x) do { \ assert (BUFFER_LIVE_P (buf)); \ assert ((x) >= BI_BUF_BEG (buf) && x < BI_BUF_Z (buf)); \ assert (VALID_BYTIND_P (buf, x)); \ @@ -968,7 +921,7 @@ #define BYTIND_INVALID ((Bytind) -1) /*----------------------------------------------------------------------*/ -/* Converting between buffer positions and byte indices */ +/* Converting between buffer positions and byte indices */ /*----------------------------------------------------------------------*/ #ifdef MULE @@ -1089,9 +1042,9 @@ /************************************************************************/ -/* */ -/* working with externally-formatted data */ -/* */ +/* */ +/* working with externally-formatted data */ +/* */ /************************************************************************/ /* Sometimes strings need to be converted into one or another @@ -1109,21 +1062,21 @@ circumstances, do not call these functions; call the front ends below. */ -CONST Extbyte *convert_to_external_format (CONST Bufbyte *ptr, - Bytecount len, - Extcount *len_out, - enum external_data_format fmt); -CONST Bufbyte *convert_from_external_format (CONST Extbyte *ptr, - Extcount len, - Bytecount *len_out, - enum external_data_format fmt); +Extbyte *convert_to_external_format (CONST Bufbyte *ptr, + Bytecount len, + Extcount *len_out, + enum external_data_format fmt); +Bufbyte *convert_from_external_format (CONST Extbyte *ptr, + Extcount len, + Bytecount *len_out, + enum external_data_format fmt); #else /* ! MULE */ #define convert_to_external_format(ptr, len, len_out, fmt) \ - (*(len_out) = (int) (len), (CONST Extbyte *) (ptr)) + (*(len_out) = (int) (len), (Extbyte *) (ptr)) #define convert_from_external_format(ptr, len, len_out, fmt) \ - (*(len_out) = (Bytecount) (len), (CONST Bufbyte *) (ptr)) + (*(len_out) = (Bytecount) (len), (Bufbyte *) (ptr)) #endif /* ! MULE */ @@ -1147,6 +1100,8 @@ as you are liable to lose embedded nulls and such. This could be a big problem for routines that want Unicode-formatted data, which is likely to have lots of embedded nulls in it. + (In the real world, though, external Unicode data will be UTF-8, + which will not have embedded nulls and is ASCII-compatible - martin) -- Functions that work with Lisp strings accept strings as Lisp Objects (as opposed to the `struct Lisp_String *' for some of the other @@ -1180,80 +1135,71 @@ #ifdef MULE -#define GET_CHARPTR_EXT_DATA_ALLOCA(ptr, len, fmt, stick_value_here, stick_len_here) \ -do \ +#define GET_CHARPTR_EXT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \ { \ - Bytecount __gceda_len_in__ = (len); \ - Extcount __gceda_len_out__; \ - CONST Bufbyte *__gceda_ptr_in__ = (ptr); \ - CONST Extbyte *__gceda_ptr_out__; \ - \ - __gceda_ptr_out__ = \ - convert_to_external_format (__gceda_ptr_in__, __gceda_len_in__, \ - &__gceda_len_out__, fmt); \ + Bytecount gceda_len_in = (Bytecount) (len); \ + Extcount gceda_len_out; \ + CONST Bufbyte *gceda_ptr_in = (ptr); \ + Extbyte *gceda_ptr_out = \ + convert_to_external_format (gceda_ptr_in, gceda_len_in, \ + &gceda_len_out, fmt); \ /* If the new string is identical to the old (will be the case most \ of the time), just return the same string back. This saves \ on alloca()ing, which can be useful on C alloca() machines and \ on stack-space-challenged environments. */ \ - \ - if (__gceda_len_in__ == __gceda_len_out__ && \ - !memcmp (__gceda_ptr_in__, __gceda_ptr_out__, __gceda_len_out__)) \ + \ + if (gceda_len_in == gceda_len_out && \ + !memcmp (gceda_ptr_in, gceda_ptr_out, gceda_len_out)) \ { \ - (stick_value_here) = (CONST Extbyte *) __gceda_ptr_in__; \ - (stick_len_here) = (Extcount) __gceda_len_in__; \ + (ptr_out) = (Extbyte *) gceda_ptr_in; \ + (len_out) = (Extcount) gceda_len_in; \ } \ else \ { \ - (stick_value_here) = (CONST Extbyte *) alloca(1 + __gceda_len_out__);\ - memcpy ((Extbyte *) stick_value_here, __gceda_ptr_out__, \ - 1 + __gceda_len_out__); \ - (stick_len_here) = (Extcount) __gceda_len_out__; \ + (ptr_out) = (Extbyte *) alloca (1 + gceda_len_out); \ + memcpy ((void *) ptr_out, gceda_ptr_out, 1 + gceda_len_out); \ + (len_out) = (Extcount) gceda_len_out; \ } \ } while (0) #else /* ! MULE */ -#define GET_CHARPTR_EXT_DATA_ALLOCA(ptr, len, fmt, stick_value_here, stick_len_here)\ -do \ -{ \ - (stick_value_here) = (CONST Extbyte *) (ptr); \ - (stick_len_here) = (Extcount) (len); \ +#define GET_CHARPTR_EXT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \ +{ \ + (ptr_out) = (Extbyte *) (ptr); \ + (len_out) = (Extcount) (len); \ } while (0) #endif /* ! MULE */ -#define GET_C_CHARPTR_EXT_DATA_ALLOCA(ptr, fmt, stick_value_here) \ -do \ -{ \ - Extcount __gcceda_ignored_len__; \ - CONST char *__gcceda_ptr_in__; \ - CONST Extbyte *__gcceda_ptr_out__; \ - \ - __gcceda_ptr_in__ = ptr; \ - GET_CHARPTR_EXT_DATA_ALLOCA ((CONST Extbyte *) __gcceda_ptr_in__, \ - strlen (__gcceda_ptr_in__), fmt, \ - __gcceda_ptr_out__, \ - __gcceda_ignored_len__); \ - (stick_value_here) = (CONST char *) __gcceda_ptr_out__; \ +#define GET_C_CHARPTR_EXT_DATA_ALLOCA(ptr, fmt, ptr_out) do \ +{ \ + Extcount gcceda_ignored_len; \ + CONST Bufbyte *gcceda_ptr_in = (CONST Bufbyte *) (ptr); \ + Extbyte *gcceda_ptr_out; \ + \ + GET_CHARPTR_EXT_DATA_ALLOCA (gcceda_ptr_in, \ + strlen ((char *) gcceda_ptr_in), \ + fmt, \ + gcceda_ptr_out, \ + gcceda_ignored_len); \ + (ptr_out) = (char *) gcceda_ptr_out; \ } while (0) -#define GET_C_CHARPTR_EXT_BINARY_DATA_ALLOCA(ptr, stick_value_here) \ - GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_BINARY, stick_value_here) -#define GET_CHARPTR_EXT_BINARY_DATA_ALLOCA(ptr, len, stick_value_here, stick_len_here) \ - GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_BINARY, stick_value_here, \ - stick_len_here) +#define GET_C_CHARPTR_EXT_BINARY_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_BINARY, ptr_out) +#define GET_CHARPTR_EXT_BINARY_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_BINARY, ptr_out, len_out) -#define GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA(ptr, stick_value_here) \ - GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_FILENAME, stick_value_here) -#define GET_CHARPTR_EXT_FILENAME_DATA_ALLOCA(ptr, len, stick_value_here, stick_len_here) \ - GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_FILENAME, stick_value_here, \ - stick_len_here) +#define GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_FILENAME, ptr_out) +#define GET_CHARPTR_EXT_FILENAME_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_FILENAME, ptr_out, len_out) -#define GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA(ptr, stick_value_here) \ - GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_CTEXT, stick_value_here) -#define GET_CHARPTR_EXT_CTEXT_DATA_ALLOCA(ptr, len, stick_value_here, stick_len_here) \ - GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_CTEXT, stick_value_here, \ - stick_len_here) +#define GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_CTEXT, ptr_out) +#define GET_CHARPTR_EXT_CTEXT_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_CTEXT, ptr_out, len_out) /* Maybe convert external charptr's data into internal format and store the result in alloca()'ed space. @@ -1269,80 +1215,71 @@ #ifdef MULE -#define GET_CHARPTR_INT_DATA_ALLOCA(ptr, len, fmt, stick_value_here, stick_len_here)\ -do \ +#define GET_CHARPTR_INT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \ { \ - Extcount __gcida_len_in__ = (len); \ - Bytecount __gcida_len_out__; \ - CONST Extbyte *__gcida_ptr_in__ = (ptr); \ - CONST Bufbyte *__gcida_ptr_out__; \ - \ - __gcida_ptr_out__ = \ - convert_from_external_format (__gcida_ptr_in__, __gcida_len_in__, \ - &__gcida_len_out__, fmt); \ + Extcount gcida_len_in = (Extcount) (len); \ + Bytecount gcida_len_out; \ + CONST Extbyte *gcida_ptr_in = (ptr); \ + Bufbyte *gcida_ptr_out = \ + convert_from_external_format (gcida_ptr_in, gcida_len_in, \ + &gcida_len_out, fmt); \ /* If the new string is identical to the old (will be the case most \ of the time), just return the same string back. This saves \ on alloca()ing, which can be useful on C alloca() machines and \ on stack-space-challenged environments. */ \ - \ - if (__gcida_len_in__ == __gcida_len_out__ && \ - !memcmp (__gcida_ptr_in__, __gcida_ptr_out__, __gcida_len_out__)) \ + \ + if (gcida_len_in == gcida_len_out && \ + !memcmp (gcida_ptr_in, gcida_ptr_out, gcida_len_out)) \ { \ - (stick_value_here) = (CONST Bufbyte *) __gcida_ptr_in__; \ - (stick_len_here) = (Bytecount) __gcida_len_in__; \ + (ptr_out) = (Bufbyte *) gcida_ptr_in; \ + (len_out) = (Bytecount) gcida_len_in; \ } \ else \ { \ - (stick_value_here) = (CONST Extbyte *) alloca (1 + __gcida_len_out__); \ - memcpy ((Bufbyte *) stick_value_here, __gcida_ptr_out__, \ - 1 + __gcida_len_out__); \ - (stick_len_here) = __gcida_len_out__; \ + (ptr_out) = (Extbyte *) alloca (1 + gcida_len_out); \ + memcpy ((void *) ptr_out, gcida_ptr_out, 1 + gcida_len_out); \ + (len_out) = gcida_len_out; \ } \ } while (0) #else /* ! MULE */ -#define GET_CHARPTR_INT_DATA_ALLOCA(ptr, len, fmt, stick_value_here, stick_len_here)\ -do \ -{ \ - (stick_value_here) = (CONST Bufbyte *) (ptr); \ - (stick_len_here) = (Bytecount) (len); \ +#define GET_CHARPTR_INT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \ +{ \ + (ptr_out) = (Bufbyte *) (ptr); \ + (len_out) = (Bytecount) (len); \ } while (0) #endif /* ! MULE */ -#define GET_C_CHARPTR_INT_DATA_ALLOCA(ptr, fmt, stick_value_here) \ -do \ -{ \ - Bytecount __gccida_ignored_len__; \ - CONST char *__gccida_ptr_in__; \ - CONST Bufbyte *__gccida_ptr_out__; \ - \ - __gccida_ptr_in__ = ptr; \ - GET_CHARPTR_INT_DATA_ALLOCA ((CONST Extbyte *) __gccida_ptr_in__, \ - strlen (__gccida_ptr_in__), fmt, \ - __gccida_ptr_out__, \ - __gccida_ignored_len__); \ - (stick_value_here) = (CONST char *) __gccida_ptr_out__; \ +#define GET_C_CHARPTR_INT_DATA_ALLOCA(ptr, fmt, ptr_out) do \ +{ \ + Bytecount gccida_ignored_len; \ + CONST Extbyte *gccida_ptr_in = (CONST Extbyte *) (ptr); \ + Bufbyte *gccida_ptr_out; \ + \ + GET_CHARPTR_INT_DATA_ALLOCA (gccida_ptr_in, \ + strlen ((char *) gccida_ptr_in), \ + fmt, \ + gccida_ptr_out, \ + gccida_ignored_len); \ + (ptr_out) = gccida_ptr_out; \ } while (0) -#define GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA(ptr, stick_value_here) \ - GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_BINARY, stick_value_here) -#define GET_CHARPTR_INT_BINARY_DATA_ALLOCA(ptr, len, stick_value_here, stick_len_here) \ - GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_BINARY, stick_value_here, \ - stick_len_here) +#define GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_BINARY, ptr_out) +#define GET_CHARPTR_INT_BINARY_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_BINARY, ptr_out, len_out) -#define GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA(ptr, stick_value_here) \ - GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_FILENAME, stick_value_here) -#define GET_CHARPTR_INT_FILENAME_DATA_ALLOCA(ptr, len, stick_value_here, stick_len_here) \ - GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_FILENAME, stick_value_here, \ - stick_len_here) +#define GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_FILENAME, ptr_out) +#define GET_CHARPTR_INT_FILENAME_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_FILENAME, ptr_out, len_out) -#define GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA(ptr, stick_value_here) \ - GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_CTEXT, stick_value_here) -#define GET_CHARPTR_INT_CTEXT_DATA_ALLOCA(ptr, len, stick_value_here, stick_len_here) \ - GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_CTEXT, stick_value_here, \ - stick_len_here) +#define GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_CTEXT, ptr_out) +#define GET_CHARPTR_INT_CTEXT_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_CTEXT, ptr_out, len_out) /* Maybe convert Lisp string's data into ext-format and store the result in @@ -1357,56 +1294,49 @@ middle of the arguments to the function call and you are unbelievably hosed.) */ -#define GET_STRING_EXT_DATA_ALLOCA(s, fmt, stick_value_here, stick_len_here)\ -do \ -{ \ - Extcount __gseda_len__; \ - CONST Extbyte *__gseda_ptr__; \ - struct Lisp_String *__gseda_s__ = XSTRING (s); \ - \ - __gseda_ptr__ = convert_to_external_format (string_data (__gseda_s__), \ - string_length (__gseda_s__), \ - &__gseda_len__, fmt); \ - (stick_value_here) = (CONST Extbyte *) alloca (1 + __gseda_len__); \ - memcpy ((Extbyte *) stick_value_here, __gseda_ptr__, 1 + __gseda_len__); \ - (stick_len_here) = __gseda_len__; \ +#define GET_STRING_EXT_DATA_ALLOCA(s, fmt, ptr_out, len_out) do \ +{ \ + Extcount gseda_len_out; \ + struct Lisp_String *gseda_s = XSTRING (s); \ + Extbyte * gseda_ptr_out = \ + convert_to_external_format (string_data (gseda_s), \ + string_length (gseda_s), \ + &gseda_len_out, fmt); \ + (ptr_out) = (Extbyte *) alloca (1 + gseda_len_out); \ + memcpy ((void *) ptr_out, gseda_ptr_out, 1 + gseda_len_out); \ + (len_out) = gseda_len_out; \ } while (0) -#define GET_C_STRING_EXT_DATA_ALLOCA(s, fmt, stick_value_here) \ -do \ +#define GET_C_STRING_EXT_DATA_ALLOCA(s, fmt, ptr_out) do \ { \ - Extcount __gcseda_ignored_len__; \ - CONST Extbyte *__gcseda_ptr__; \ + Extcount gcseda_ignored_len; \ + Extbyte *gcseda_ptr_out; \ \ - GET_STRING_EXT_DATA_ALLOCA (s, fmt, __gcseda_ptr__, \ - __gcseda_ignored_len__); \ - (stick_value_here) = (CONST char *) __gcseda_ptr__; \ + GET_STRING_EXT_DATA_ALLOCA (s, fmt, gcseda_ptr_out, \ + gcseda_ignored_len); \ + (ptr_out) = (char *) gcseda_ptr_out; \ } while (0) -#define GET_STRING_BINARY_DATA_ALLOCA(s, stick_value_here, stick_len_here) \ - GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_BINARY, stick_value_here, \ - stick_len_here) -#define GET_C_STRING_BINARY_DATA_ALLOCA(s, stick_value_here) \ - GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_BINARY, stick_value_here) +#define GET_STRING_BINARY_DATA_ALLOCA(s, ptr_out, len_out) \ + GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_BINARY, ptr_out, len_out) +#define GET_C_STRING_BINARY_DATA_ALLOCA(s, ptr_out) \ + GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_BINARY, ptr_out) -#define GET_STRING_FILENAME_DATA_ALLOCA(s, stick_value_here, stick_len_here) \ - GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_FILENAME, stick_value_here, \ - stick_len_here) -#define GET_C_STRING_FILENAME_DATA_ALLOCA(s, stick_value_here) \ - GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_FILENAME, stick_value_here) +#define GET_STRING_FILENAME_DATA_ALLOCA(s, ptr_out, len_out) \ + GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_FILENAME, ptr_out, len_out) +#define GET_C_STRING_FILENAME_DATA_ALLOCA(s, ptr_out) \ + GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_FILENAME, ptr_out) -#define GET_STRING_OS_DATA_ALLOCA(s, stick_value_here, stick_len_here) \ - GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_OS, stick_value_here, \ - stick_len_here) -#define GET_C_STRING_OS_DATA_ALLOCA(s, stick_value_here) \ - GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_OS, stick_value_here) +#define GET_STRING_OS_DATA_ALLOCA(s, ptr_out, len_out) \ + GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_OS, ptr_out, len_out) +#define GET_C_STRING_OS_DATA_ALLOCA(s, ptr_out) \ + GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_OS, ptr_out) -#define GET_STRING_CTEXT_DATA_ALLOCA(s, stick_value_here, stick_len_here) \ - GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_CTEXT, stick_value_here, \ - stick_len_here) -#define GET_C_STRING_CTEXT_DATA_ALLOCA(s, stick_value_here) \ - GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_CTEXT, stick_value_here) +#define GET_STRING_CTEXT_DATA_ALLOCA(s, ptr_out, len_out) \ + GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_CTEXT, ptr_out, len_out) +#define GET_C_STRING_CTEXT_DATA_ALLOCA(s, ptr_out) \ + GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_CTEXT, ptr_out) @@ -1435,12 +1365,10 @@ #define XCHARSET_COLUMNS(cs) 1 #define XCHARSET_DIMENSION(cs) 1 #define REP_BYTES_BY_FIRST_BYTE(fb) 1 -#define BREAKUP_CHAR(ch, charset, byte1, byte2)\ -do \ -{ \ - (charset) = Vcharset_ascii; \ - (byte1) = (ch); \ - (byte2) = 0; \ +#define BREAKUP_CHAR(ch, charset, byte1, byte2) do { \ + (charset) = Vcharset_ascii; \ + (byte1) = (ch); \ + (byte2) = 0; \ } while (0) #define BYTE_ASCII_P(byte) 1 @@ -1591,21 +1519,32 @@ (b, BI_BUF_FLOOR_OF_IGNORE_ACCESSIBLE (b, bufpos_to_bytind (b, n))) - - extern struct buffer *current_buffer; -/* This structure holds the default values of the buffer-local variables - defined with DEFVAR_BUFFER_LOCAL, that have special slots in each buffer. - The default value occupies the same slot in this structure - as an individual buffer's value occupies in that buffer. - Setting the default value also goes through the alist of buffers - and stores into each buffer that does not say it has a local value. */ +EXFUN (Fbuffer_disable_undo, 1); +EXFUN (Fbuffer_modified_p, 1); +EXFUN (Fbuffer_name, 1); +EXFUN (Fcurrent_buffer, 0); +EXFUN (Ferase_buffer, 1); +EXFUN (Fget_buffer, 1); +EXFUN (Fget_buffer_create, 1); +EXFUN (Fget_file_buffer, 1); +EXFUN (Fkill_buffer, 1); +EXFUN (Fother_buffer, 3); +EXFUN (Frecord_buffer, 1); +EXFUN (Fset_buffer, 1); +EXFUN (Fset_buffer_modified_p, 2); -extern Lisp_Object Vbuffer_defaults; +extern Lisp_Object QSscratch, Qafter_change_function, Qafter_change_functions; +extern Lisp_Object Qbefore_change_function, Qbefore_change_functions; +extern Lisp_Object Qbuffer_or_string_p, Qdefault_directory, Qfirst_change_hook; +extern Lisp_Object Qpermanent_local, Vafter_change_function; +extern Lisp_Object Vafter_change_functions, Vbefore_change_function; +extern Lisp_Object Vbefore_change_functions, Vbuffer_alist, Vbuffer_defaults; +extern Lisp_Object Vinhibit_read_only, Vtransient_mark_mode; /* This structure marks which slots in a buffer have corresponding - default values in buffer_defaults. + default values in Vbuffer_defaults. Each such slot has a nonzero value in this structure. The value has only one nonzero bit. @@ -1615,7 +1554,7 @@ If a slot in this structure is zero, then even though there may be a DEFVAR_BUFFER_LOCAL for the slot, there is no default value for it; - and the corresponding slot in buffer_defaults is not used. */ + and the corresponding slot in Vbuffer_defaults is not used. */ extern struct buffer buffer_local_flags; @@ -1675,6 +1614,9 @@ Bufbyte_dynarr *dyn); Bufbyte *convert_emchar_string_into_malloced_string (Emchar *arr, int nels, Bytecount *len_out); +/* from marker.c */ +void init_buffer_markers (struct buffer *b); +void uninit_buffer_markers (struct buffer *b); /* flags for get_buffer_pos_char(), get_buffer_range_char(), etc. */ /* At most one of GB_COERCE_RANGE and GB_NO_ERROR_IF_BAD should be @@ -1769,7 +1711,7 @@ (MIRROR_TRT_TABLE_AS_STRING (table)[ch1] = (Bufbyte) (ch2)) #endif -# define IN_TRT_TABLE_DOMAIN(c) (((unsigned EMACS_INT) (c)) <= 255) +# define IN_TRT_TABLE_DOMAIN(c) (((EMACS_UINT) (c)) <= 255) #ifdef MULE #define MIRROR_DOWNCASE_TABLE_AS_STRING(buf) \
--- a/src/bufslots.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/bufslots.h Mon Aug 13 10:28:48 2007 +0200 @@ -50,7 +50,7 @@ /* Length of file when last read or saved. This is not in the struct buffer_text because it's not used in indirect buffers at all. */ - MARKED_SLOT (save_length); + MARKED_SLOT (saved_size); /* File name used for auto-saving this buffer. This is not in the struct buffer_text
--- a/src/bytecode.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/bytecode.c Mon Aug 13 10:28:48 2007 +0200 @@ -308,8 +308,7 @@ /* Initialize the pc-register and convert the string into a fixed-width format for easier processing. */ - massaged_code = alloca_array (Emchar, - 1 + string_char_length (XSTRING (bytestr))); + massaged_code = alloca_array (Emchar, 1 + XSTRING_CHAR_LENGTH (bytestr)); massaged_code_len = convert_bufbyte_string_into_emchar_string (XSTRING_DATA (bytestr), XSTRING_LENGTH (bytestr), @@ -577,7 +576,7 @@ case Bcondition_case: v1 = POP; /* handlers */ v2 = POP; /* bodyform */ - TOP = Fcondition_case_3 (v2, TOP, v1); + TOP = condition_case_3 (v2, TOP, v1); break; case Btemp_output_buffer_setup: @@ -614,29 +613,29 @@ goto docar; case Bsymbolp: - TOP = ((SYMBOLP (TOP)) ? Qt : Qnil); + TOP = SYMBOLP (TOP) ? Qt : Qnil; break; case Bconsp: - TOP = ((CONSP (TOP)) ? Qt : Qnil); + TOP = CONSP (TOP) ? Qt : Qnil; break; case Bstringp: - TOP = ((STRINGP (TOP)) ? Qt : Qnil); + TOP = STRINGP (TOP) ? Qt : Qnil; break; case Blistp: - TOP = CONSP (TOP) || NILP (TOP) ? Qt : Qnil; + TOP = LISTP (TOP) ? Qt : Qnil; break; case Beq: v1 = POP; - TOP = ((EQ_WITH_EBOLA_NOTICE (v1, TOP)) ? Qt : Qnil); + TOP = EQ_WITH_EBOLA_NOTICE (v1, TOP) ? Qt : Qnil; break; case Bold_eq: v1 = POP; - TOP = ((HACKEQ_UNSAFE (v1, TOP)) ? Qt : Qnil); + TOP = HACKEQ_UNSAFE (v1, TOP) ? Qt : Qnil; break; case Bmemq: @@ -790,10 +789,8 @@ #ifdef LISP_FLOAT_TYPE if (FLOATP (v1) || FLOATP (v2)) { - double f1, f2; - - f1 = (FLOATP (v1) ? float_data (XFLOAT (v1)) : XINT (v1)); - f2 = (FLOATP (v2) ? float_data (XFLOAT (v2)) : XINT (v2)); + double f1 = (FLOATP (v1) ? float_data (XFLOAT (v1)) : XINT (v1)); + double f2 = (FLOATP (v2) ? float_data (XFLOAT (v2)) : XINT (v2)); TOP = (f1 == f2 ? Qt : Qnil); } else @@ -1130,11 +1127,11 @@ break; case Bnumberp: - TOP = ((INT_OR_FLOATP (TOP)) ? Qt : Qnil); + TOP = INT_OR_FLOATP (TOP) ? Qt : Qnil; break; case Bintegerp: - TOP = ((INTP (TOP)) ? Qt : Qnil); + TOP = INTP (TOP) ? Qt : Qnil; break; default: @@ -1176,9 +1173,9 @@ DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter /* A vector of vectors which holds a histogram of byte-code usage. -(aref (aref byte-code-meter 0) CODE) indicates how many times the byte +\(aref (aref byte-code-meter 0) CODE) indicates how many times the byte opcode CODE has been executed. -(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0, +\(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0, indicates how many times the byte opcodes CODE1 and CODE2 have been executed in succession. */ );
--- a/src/bytecode.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/bytecode.h Mon Aug 13 10:28:48 2007 +0200 @@ -83,6 +83,10 @@ #define CHECK_COMPILED_FUNCTION(x) CHECK_RECORD (x, compiled_function) #define CONCHECK_COMPILED_FUNCTION(x) CONCHECK_RECORD (x, compiled_function) +EXFUN (Fbyte_code, 3); + +extern Lisp_Object Qbyte_code; + /* total 1765 internal 101 doc-and-int 775 doc-only 389 int-only 42 neither 559 no doc slot, no int slot overhead : (* 1765 0) = 0
--- a/src/callint.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/callint.c Mon Aug 13 10:28:48 2007 +0200 @@ -149,7 +149,7 @@ garden-variety version, so why not make it a subr? */ /* #### Move it to another file! */ DEFUN ("quote-maybe", Fquote_maybe, 1, 1, 0, /* -Quote EXPR iff it is not self quoting. +Quote EXPR if it is not self quoting. */ (expr)) { @@ -162,7 +162,7 @@ || VECTORP (expr) || KEYWORDP (expr) || BIT_VECTORP (expr) - || (CONSP (expr) && EQ(XCAR (expr), Qlambda))) + || (CONSP (expr) && EQ (XCAR (expr), Qlambda))) ? expr : list2 (Qquote, expr)); } @@ -981,7 +981,6 @@ defsymbol (&Qevents_to_keys, "events-to-keys"); defsymbol (&Qcommand_debug_status, "command-debug-status"); defsymbol (&Qenable_recursive_minibuffers, "enable-recursive-minibuffers"); - defsymbol (&Qcommand_debug_status, "command-debug-status"); defsymbol (&Quser_variable_p, "user-variable-p"); defsymbol (&Qcurrent_prefix_arg, "current-prefix-arg");
--- a/src/callproc.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/callproc.c Mon Aug 13 10:28:48 2007 +0200 @@ -265,8 +265,7 @@ || EQ (buffer, Qt) || ZEROP (buffer))) { - Lisp_Object spec_buffer; - spec_buffer = buffer; + Lisp_Object spec_buffer = buffer; buffer = Fget_buffer (buffer); /* Mention the buffer name for a better error message. */ if (NILP (buffer)) @@ -345,15 +344,15 @@ fd_error = open (NULL_DEVICE, O_WRONLY | OPEN_BINARY); else if (STRINGP (error_file)) { + fd_error = open ((CONST char *) XSTRING_DATA (error_file), #ifdef DOS_NT - fd_error = open (XSTRING_DATA (error_file), O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, - S_IREAD | S_IWRITE); + S_IREAD | S_IWRITE #else /* not DOS_NT */ - fd_error = open (XSTRING_DATA (error_file), O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, - CREAT_MODE); + CREAT_MODE #endif /* not DOS_NT */ + ); } if (fd_error < 0) @@ -625,9 +624,8 @@ { REGISTER Lisp_Object tem; REGISTER char **new_env; - REGISTER int new_length; + REGISTER int new_length = 0; - new_length = 0; for (tem = Vprocess_environment; (CONSP (tem) && STRINGP (XCAR (tem))); @@ -855,7 +853,6 @@ { /* This function can GC */ REGISTER char *sh; - Lisp_Object tempdir; Vprocess_environment = Qnil; /* jwz: always initialize Vprocess_environment, so that egetenv() works @@ -877,25 +874,25 @@ sh = egetenv ("COMSPEC"); { char *tem; - /* - ** If COMSPEC has been set, then convert the - ** DOS formatted name into a UNIX format. Then - ** create a LISP object. - */ + /* + ** If COMSPEC has been set, then convert the + ** DOS formatted name into a UNIX format. Then + ** create a LISP object. + */ if (sh) - { - tem = (char *) alloca (strlen (sh) + 1); - dostounix_filename (strcpy (tem, sh)); - Vshell_file_name = build_string (tem); - } - /* - ** Odd, no COMSPEC, so let's default to our - ** best guess for NT. - */ - else - { - Vshell_file_name = build_string ("/WINNT/system32/cmd.exe"); - } + { + tem = (char *) alloca (strlen (sh) + 1); + dostounix_filename (strcpy (tem, sh)); + Vshell_file_name = build_string (tem); + } + /* + ** Odd, no COMSPEC, so let's default to our + ** best guess for NT. + */ + else + { + Vshell_file_name = build_string ("/WINNT/system32/cmd.exe"); + } } #else /* not WINDOWSNT */ sh = (char *) egetenv ("SHELL");
--- a/src/casefiddle.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/casefiddle.c Mon Aug 13 10:28:48 2007 +0200 @@ -56,7 +56,7 @@ if (STRINGP (obj)) { Charcount i; - Charcount len = string_char_length (XSTRING (obj)); + Charcount len = XSTRING_CHAR_LENGTH (obj); obj = Fcopy_sequence (obj); for (i = 0; i < len; i++) {
--- a/src/casetab.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/casetab.c Mon Aug 13 10:28:48 2007 +0200 @@ -53,20 +53,19 @@ static void compute_trt_inverse (Lisp_Object trt, Lisp_Object inverse); -#define STRING256_P(obj) \ - (STRINGP (obj) && string_char_length (XSTRING (obj)) == 256) +#define STRING256_P(obj) (STRINGP (obj) && XSTRING_CHAR_LENGTH (obj) == 256) DEFUN ("case-table-p", Fcase_table_p, 1, 1, 0, /* -Return t iff ARG is a case table. +Return t if ARG is a case table. See `set-case-table' for more information on these data structures. */ (table)) { Lisp_Object down, up, canon, eqv; - down = Fcar_safe (table); - up = Fcar_safe (Fcdr_safe (table)); - canon = Fcar_safe (Fcdr_safe (Fcdr_safe (table))); - eqv = Fcar_safe (Fcdr_safe (Fcdr_safe (Fcdr_safe (table)))); + if (!CONSP (table)) return Qnil; down = XCAR (table); table = XCDR (table); + if (!CONSP (table)) return Qnil; up = XCAR (table); table = XCDR (table); + if (!CONSP (table)) return Qnil; canon = XCAR (table); table = XCDR (table); + if (!CONSP (table)) return Qnil; eqv = XCAR (table); return (STRING256_P (down) && (NILP (up) || STRING256_P (up)) @@ -91,15 +90,12 @@ */ (buffer)) { - Lisp_Object down, up, canon, eqv; struct buffer *buf = decode_buffer (buffer, 0); - down = buf->downcase_table; - up = buf->upcase_table; - canon = buf->case_canon_table; - eqv = buf->case_eqv_table; - - return Fcons (down, Fcons (up, Fcons (canon, Fcons (eqv, Qnil)))); + return list4 (buf->downcase_table, + buf->upcase_table, + buf->case_canon_table, + buf->case_eqv_table); } DEFUN ("standard-case-table", Fstandard_case_table, 0, 0, 0, /* @@ -108,11 +104,10 @@ */ ()) { - return Fcons (Vascii_downcase_table, - Fcons (Vascii_upcase_table, - Fcons (Vascii_canon_table, - Fcons (Vascii_eqv_table, - Qnil)))); + return list4 (Vascii_downcase_table, + Vascii_upcase_table, + Vascii_canon_table, + Vascii_eqv_table); } static Lisp_Object set_case_table (Lisp_Object table, int standard); @@ -194,15 +189,15 @@ static Lisp_Object set_case_table (Lisp_Object table, int standard) { - Lisp_Object down, up, canon, eqv; + Lisp_Object down, up, canon, eqv, tail = table; struct buffer *buf = current_buffer; check_case_table (table); - down = Fcar_safe (table); - up = Fcar_safe (Fcdr_safe (table)); - canon = Fcar_safe (Fcdr_safe (Fcdr_safe (table))); - eqv = Fcar_safe (Fcdr_safe (Fcdr_safe (Fcdr_safe (table)))); + down = XCAR (tail); tail = XCDR (tail); + up = XCAR (tail); tail = XCDR (tail); + canon = XCAR (tail); tail = XCDR (tail); + eqv = XCAR (tail); if (NILP (up)) {
--- a/src/chartab.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/chartab.c Mon Aug 13 10:28:48 2007 +0200 @@ -90,15 +90,6 @@ #ifdef MULE -static Lisp_Object mark_char_table_entry (Lisp_Object, void (*) (Lisp_Object)); -static int char_table_entry_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long char_table_entry_hash (Lisp_Object obj, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("char-table-entry", char_table_entry, - mark_char_table_entry, internal_object_printer, - 0, char_table_entry_equal, - char_table_entry_hash, - struct Lisp_Char_Table_Entry); - static Lisp_Object mark_char_table_entry (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -134,17 +125,13 @@ return internal_array_hash (cte->level2, 96, depth); } +DEFINE_LRECORD_IMPLEMENTATION ("char-table-entry", char_table_entry, + mark_char_table_entry, internal_object_printer, + 0, char_table_entry_equal, + char_table_entry_hash, + struct Lisp_Char_Table_Entry); #endif /* MULE */ -static Lisp_Object mark_char_table (Lisp_Object, void (*) (Lisp_Object)); -static void print_char_table (Lisp_Object, Lisp_Object, int); -static int char_table_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long char_table_hash (Lisp_Object obj, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("char-table", char_table, - mark_char_table, print_char_table, 0, - char_table_equal, char_table_hash, - struct Lisp_Char_Table); - static Lisp_Object mark_char_table (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -431,6 +418,11 @@ return hashval; } +DEFINE_LRECORD_IMPLEMENTATION ("char-table", char_table, + mark_char_table, print_char_table, 0, + char_table_equal, char_table_hash, + struct Lisp_Char_Table); + DEFUN ("char-table-p", Fchar_table_p, 1, 1, 0, /* Return non-nil if OBJECT is a char table. @@ -580,14 +572,14 @@ } DEFUN ("make-char-table", Fmake_char_table, 1, 1, 0, /* -Make a new, empty char table of type TYPE. +Return a new, empty char table of type TYPE. Currently recognized types are 'char, 'category, 'display, 'generic, and 'syntax. See `valid-char-table-type-p'. */ (type)) { struct Lisp_Char_Table *ct; - Lisp_Object obj = Qnil; + Lisp_Object obj; enum char_table_type ty = symbol_to_char_table_type (type); ct = alloc_lcrecord_type (struct Lisp_Char_Table, lrecord_char_table); @@ -595,8 +587,8 @@ if (ty == CHAR_TABLE_TYPE_SYNTAX) { ct->mirror_table = Fmake_char_table (Qgeneric); - fill_char_table (XCHAR_TABLE (ct->mirror_table), - make_int (Spunct)); + fill_char_table (XCHAR_TABLE (ct->mirror_table), + make_int (Spunct)); } else ct->mirror_table = Qnil; @@ -616,14 +608,15 @@ static Lisp_Object make_char_table_entry (Lisp_Object initval) { - struct Lisp_Char_Table_Entry *cte; - Lisp_Object obj = Qnil; + Lisp_Object obj; int i; + struct Lisp_Char_Table_Entry *cte = + alloc_lcrecord_type (struct Lisp_Char_Table_Entry, + lrecord_char_table_entry); - cte = alloc_lcrecord_type (struct Lisp_Char_Table_Entry, - lrecord_char_table_entry); for (i = 0; i < 96; i++) cte->level2[i] = initval; + XSETCHAR_TABLE_ENTRY (obj, cte); return obj; } @@ -632,7 +625,7 @@ copy_char_table_entry (Lisp_Object entry) { struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (entry); - Lisp_Object obj = Qnil; + Lisp_Object obj; int i; struct Lisp_Char_Table_Entry *ctenew = alloc_lcrecord_type (struct Lisp_Char_Table_Entry, @@ -661,7 +654,7 @@ (old_table)) { struct Lisp_Char_Table *ct, *ctnew; - Lisp_Object obj = Qnil; + Lisp_Object obj; int i; CHECK_CHAR_TABLE (old_table); @@ -1602,7 +1595,8 @@ #endif ctbl = XCHAR_TABLE (table); temp = get_char_table (ch, ctbl); - if (EQ (temp, Qnil)) return not; + if (NILP (temp)) + return not; designator -= ' '; return bit_vector_bit (XBIT_VECTOR (temp), designator) ? !not : not; @@ -1611,8 +1605,8 @@ DEFUN ("check-category-at", Fcheck_category_at, 2, 4, 0, /* Return t if category of a character at POS includes DESIGNATOR, else return nil. Optional third arg specifies which buffer -(defaulting to current), and fourth specifies the CATEGORY-TABLE, -(defaulting to the buffer's category table). +\(defaulting to current), and fourth specifies the CATEGORY-TABLE, +\(defaulting to the buffer's category table). */ (pos, designator, buffer, category_table)) {
--- a/src/chartab.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/chartab.h Mon Aug 13 10:28:48 2007 +0200 @@ -186,6 +186,11 @@ Lisp_Object val, void *arg), void *arg); void prune_syntax_tables (int (*obj_marked_p) (Lisp_Object)); + +EXFUN (Fcopy_char_table, 1); +EXFUN (Fmake_char_table, 1); +EXFUN (Fput_char_table, 3); + extern Lisp_Object Vall_syntax_tables; @@ -194,32 +199,33 @@ int check_category_char(Emchar ch, Lisp_Object ctbl, unsigned int designator, unsigned int not); -extern Lisp_Object Qcategory_table_p, Qcategory_designator_p; -extern Lisp_Object Qcategory_table_value_p; - extern Lisp_Object Vstandard_category_table; #define CATEGORY_DESIGNATORP(x) \ (CHARP (x) && XCHAR (x) >= 32 && XCHAR (x) <= 126) -#define CHECK_CATEGORY_DESIGNATOR(x) \ - do { if (!CATEGORY_DESIGNATORP (x)) \ - dead_wrong_type_argument (Qcategory_designator_p, (x)); } while (0) -#define CONCHECK_CATEGORY_DESIGNATOR(x) \ - do { if (!CATEGORY_DESIGNATORP (x)) \ - x = wrong_type_argument (Qcategory_designator_p, (x)); } while (0) +#define CHECK_CATEGORY_DESIGNATOR(x) do { \ + if (!CATEGORY_DESIGNATORP (x)) \ + dead_wrong_type_argument (Qcategory_designator_p, x); \ +} while (0) + +#define CONCHECK_CATEGORY_DESIGNATOR(x) do { \ + if (!CATEGORY_DESIGNATORP (x)) \ + x = wrong_type_argument (Qcategory_designator_p, x); \ +} while (0) #define CATEGORY_TABLE_VALUEP(x) \ (NILP (x) || (BIT_VECTORP (x) && (bit_vector_length (XBIT_VECTOR (x)) == 95))) -#define CHECK_CATEGORY_TABLE_VALUE(x) \ - do { if (!CATEGORY_TABLE_VALUEP (x)) \ - dead_wrong_type_argument (Qcategory_table_value_p, (x)); } \ - while (0) -#define CONCHECK_CATEGORY_TABLE_VALUE(x) \ - do { if (!CATEGORY_TABLE_VALUEP (x)) \ - x = wrong_type_argument (Qcategory_table_value_p, (x)); } \ - while (0) +#define CHECK_CATEGORY_TABLE_VALUE(x) do { \ + if (!CATEGORY_TABLE_VALUEP (x)) \ + dead_wrong_type_argument (Qcategory_table_value_p, x); \ +} while (0) + +#define CONCHECK_CATEGORY_TABLE_VALUE(x) do { \ + if (!CATEGORY_TABLE_VALUEP (x)) \ + x = wrong_type_argument (Qcategory_table_value_p, x); \ +} while (0) #endif /* MULE */
--- a/src/cm.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/cm.c Mon Aug 13 10:28:48 2007 +0200 @@ -46,8 +46,7 @@ static int cm_cost_counter; /* sums up costs */ -void evalcost (int c); -void +static void evalcost (int c) { cm_cost_counter++; @@ -459,7 +458,7 @@ void Wcm_clear (void) { - memset (&Wcm, 0, sizeof Wcm); + xzero (Wcm); UP = 0; BC = 0; }
--- a/src/cm.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/cm.h Mon Aug 13 10:28:48 2007 +0200 @@ -174,12 +174,11 @@ #define losecursor() (curX = -1, curY = -1) extern int cost; -extern void evalcost (int c); -extern void cmputc (int c); +void cmputc (int c); void cmcheckmagic (void); -extern void cm_cost_init (struct console *c); -extern void cmgoto (int, int); -extern void Wcm_clear (void); -extern int Wcm_init (void); +void cm_cost_init (struct console *c); +void cmgoto (int, int); +void Wcm_clear (void); +int Wcm_init (void); #endif /* _XEMACS_CM_H_ */
--- a/src/cmdloop.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/cmdloop.c Mon Aug 13 10:28:48 2007 +0200 @@ -63,7 +63,10 @@ /* Variable defined in Lisp. */ Lisp_Object Qerrors_deactivate_region; +Lisp_Object Qtop_level; + static Lisp_Object command_loop_1 (Lisp_Object dummy); +EXFUN (Fcommand_loop_1, 0); /* There are two possible command loops -- one written entirely in C and one written mostly in Lisp, except stuff written in C for
--- a/src/cmds.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/cmds.c Mon Aug 13 10:28:48 2007 +0200 @@ -420,9 +420,8 @@ if (!NILP (Vself_insert_face) && EQ (Vlast_command, Vself_insert_face_command)) { - Lisp_Object before, after; - XSETINT (before, BUF_PT (buf) - 1); - XSETINT (after, BUF_PT (buf)); + Lisp_Object before = make_int (BUF_PT (buf) - 1); + Lisp_Object after = make_int (BUF_PT (buf)); Fput_text_property (before, after, Qface, Vself_insert_face, Qnil); Fput_text_property (before, after, Qstart_open, Qt, Qnil); Fput_text_property (before, after, Qend_open, Qnil, Qnil);
--- a/src/commands.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/commands.h Mon Aug 13 10:28:48 2007 +0200 @@ -92,8 +92,6 @@ achieving the same functionality (e.g. use select()). */ /* extern int immediate_quit; Nonzero means ^G can quit instantly */ -extern Lisp_Object Vexecuting_macro; - /* Nonzero if input is coming from the keyboard */ #define INTERACTIVE (NILP (Vexecuting_macro) && !noninteractive) @@ -102,11 +100,6 @@ extern int modeline_changed; -/* Nonzero means reading single-character input with prompt - so put cursor on minibuffer after the prompt. */ - -extern int cursor_in_echo_area; - extern Lisp_Object recent_keys_ring; extern int recent_keys_ring_index; @@ -116,7 +109,6 @@ extern Lisp_Object Vcommand_loop; /* #endif */ DECLARE_DOESNT_RETURN (initial_command_loop (Lisp_Object)); -DOESNT_RETURN initial_command_loop (Lisp_Object); Lisp_Object call_command_loop (Lisp_Object catch_errors); extern int command_loop_level;
--- a/src/config.h.in Mon Aug 13 10:27:41 2007 +0200 +++ b/src/config.h.in Mon Aug 13 10:28:48 2007 +0200 @@ -32,19 +32,20 @@ #ifndef NOT_C_CODE #ifdef __GNUC__ -#undef alloca #define alloca __builtin_alloca +#elif HAVE_ALLOCA_H +#include <alloca.h> #elif defined(_AIX) #pragma alloca -#elif HAVE_ALLOCA_H -#include <alloca.h> +#elif ! defined (alloca) +char *alloca(); #endif -#endif /* NOT C */ +#endif /* C code */ /* Use this to add code in a structured way to FSF-maintained source files so as to make it obvious where XEmacs changes are. */ -#define XEMACS +#define XEMACS 1 /* Allow s&m files to differentiate OS versions without having multiple files to maintain. */ @@ -240,12 +241,6 @@ #undef HAVE_GETPGRP #undef GETPGRP_VOID -#undef SIZEOF_SHORT -#undef SIZEOF_INT -#undef SIZEOF_LONG -#undef SIZEOF_LONG_LONG -#undef SIZEOF_VOID_P - #undef HAVE_INVERSE_HYPERBOLIC #undef HAVE_CBRT @@ -363,8 +358,6 @@ #undef CURSES_H_PATH #undef TERM_H_PATH -#define LOWTAGS - /* Define USE_ASSERTIONS if you want the abort() to be changed to assert(). If the assertion fails, assert_failed() will be called. This is recommended for general use because it gives more info about the crash @@ -469,31 +462,23 @@ compiling-running-crashing. */ #undef NO_DOC_FILE -/* To eliminate use of `const' in the XEmacs sources, - do `#define CONST_IS_LOSING' */ -#undef CONST_IS_LOSING +/* Defined by AC_C_CONST in configure.in */ +#undef const + +#define CONST const -# undef CONST -# ifdef CONST_IS_LOSING -# define CONST -# else -# define CONST const -# endif /* CONST */ +/* If defined, use unions instead of ints. A few systems (DEC Alpha) + seem to require this, probably because something with the int + definitions isn't right with 64-bit systems. */ +#undef USE_UNION_TYPE -/* If not defined, use unions instead of ints. A few systems (DEC Alpha) - seem to require this, probably because something with the int - definitions isn't right with 64-bit systems. - - (It's NO_UNION_TYPE instead of USE_UNION_TYPE for historical reasons.) */ -#undef NO_UNION_TYPE - -/* The next two options are turned on by --with-gung=yes */ /* If defined, use a minimal number of tagbits. This allows usage of more advanced versions of malloc (like the Doug Lea new GNU malloc) and larger integers. */ +/* --use-minimal-tagbits */ #undef USE_MINIMAL_TAGBITS -/* #### Document me. */ +/* --use-indexed-lrecord-implementation */ #undef USE_INDEXED_LRECORD_IMPLEMENTATION /* The configuration script defines opsysfile to be the name of the @@ -510,9 +495,6 @@ #endif #undef config_opsysfile #include config_opsysfile -#if defined (__cplusplus) && !defined (NOT_C_CODE) -} -#endif /* The configuration script defines machfile to be the name of the m/...h file that describes the machine you are using. The file is @@ -524,6 +506,9 @@ See m/template.h for documentation on writing m/...h files. */ #undef config_machfile #include config_machfile +#if defined (__cplusplus) && !defined (NOT_C_CODE) +} +#endif #if defined (USE_SYSTEM_MALLOC) && !defined (SYSTEM_MALLOC) #define SYSTEM_MALLOC @@ -657,6 +642,7 @@ # define ENCAPSULATE_CHDIR # define ENCAPSULATE_MKDIR # define ENCAPSULATE_OPENDIR +# define ENCAPSULATE_CLOSEDIR # define ENCAPSULATE_READDIR # define ENCAPSULATE_RMDIR @@ -701,17 +687,26 @@ #define listen Rlisten #endif /* HAVE_SOCKS && !DO_NOT_SOCKSIFY */ -#ifndef SHORTBITS -#define SHORTBITS (8 * SIZEOF_SHORT) +#undef SIZEOF_SHORT +#undef SIZEOF_INT +#undef SIZEOF_LONG +#undef SIZEOF_LONG_LONG +#undef SIZEOF_VOID_P + +#ifndef BITS_PER_CHAR +#define BITS_PER_CHAR 8 #endif -#ifndef INTBITS -#define INTBITS (8 * SIZEOF_INT) -#endif -#ifndef LONGBITS -#define LONGBITS (8 * SIZEOF_LONG) -#endif +#define SHORTBITS (SIZEOF_SHORT * BITS_PER_CHAR) +#define INTBITS (SIZEOF_INT * BITS_PER_CHAR) +#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) #ifndef NOT_C_CODE +#ifdef __cplusplus +#define HAVE_INLINE 1 +#define INLINE inline +#else /* not C++ */ /* Does the keyword `inline' exist? */ #undef HAVE_INLINE #undef inline @@ -729,8 +724,27 @@ # else # define INLINE static # endif /* HAVE_INLINE */ +#endif /* not C++ */ #endif /* C code */ +#if defined (__cplusplus) && !defined (NOT_C_CODE) +/* Avoid C++ keywords used as ordinary C identifiers */ +#define class c_class +#define new c_new +#define this c_this +#define catch c_catch +#endif /* C++ */ + +/* Strictly speaking, only int or unsigned int are valid types in a + bitfield. In practice, we would like to use enums as bitfields. + The following should just result in warning avoidance: + warning: nonportable bit-field type */ +#if !(defined (__SUNPRO_C) && __STDC__ == 1) +#define enum_field(enumeration_type) enum enumeration_type +#else +#define enum_field(enumeration_type) unsigned int +#endif + /* We want to avoid saving the signal mask if possible, because that necessitates a system call. */ #ifdef HAVE_SIGSETJMP
--- a/src/console-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -23,7 +23,7 @@ /* Authorship: Ben Wing: January 1996, for 19.14. - Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0 */ #include <config.h>
--- a/src/console-msw.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console-msw.h Mon Aug 13 10:28:48 2007 +0200 @@ -26,7 +26,7 @@ Ultimately based on FSF, then later on JWZ work for Lemacs. Rewritten over time by Ben Wing and Chuck Thompson. - Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. */ #ifndef _XEMACS_CONSOLE_MSW_H_ @@ -143,6 +143,7 @@ #define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd) #define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc) +#define FRAME_MSWINDOWS_CDC(f) (FRAME_MSWINDOWS_DATA (f)->cdc) #define FRAME_MSWINDOWS_MENU_HASHTABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hashtable) #define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum) #define MSWINDOWS_FRAME_CHARWIDTH(f) (FRAME_MSWINDOWS_DATA (f)->charwidth)
--- a/src/console-stream.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console-stream.c Mon Aug 13 10:28:48 2007 +0200 @@ -34,6 +34,7 @@ #include "frame.h" #include "redisplay.h" #include "sysdep.h" +#include "sysfile.h" #include "window.h" DEFINE_CONSOLE_TYPE (stream); @@ -47,14 +48,10 @@ static void allocate_stream_console_struct (struct console *con) { - if (!con->console_data) - { - con->console_data = xnew_and_zero (struct stream_console); - } + if (!CONSOLE_STREAM_DATA (con)) + CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console); else - { - memset(con->console_data, 0, sizeof (struct stream_console)); - } + xzero (*CONSOLE_STREAM_DATA (con)); } static void @@ -67,7 +64,7 @@ if (NILP (tty) || internal_equal (tty, Vstdio_str, 0)) { - infd = stdin; + infd = stdin; outfd = stdout; errfd = stderr; } @@ -81,7 +78,7 @@ } allocate_stream_console_struct (con); - CONSOLE_STREAM_DATA (con)->infd = infd; + CONSOLE_STREAM_DATA (con)->infd = infd; CONSOLE_STREAM_DATA (con)->outfd = outfd; CONSOLE_STREAM_DATA (con)->errfd = errfd; } @@ -91,7 +88,7 @@ { struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); - DEVICE_INFD (d) = fileno (CONSOLE_STREAM_DATA (con)->infd); + DEVICE_INFD (d) = fileno (CONSOLE_STREAM_DATA (con)->infd); DEVICE_OUTFD (d) = fileno (CONSOLE_STREAM_DATA (con)->outfd); init_baud_rate (d); init_one_device (d); @@ -106,11 +103,10 @@ static void free_stream_console_struct (struct console *con) { - struct stream_console *tcon = (struct stream_console *) con->console_data; - if (tcon) + if (CONSOLE_STREAM_DATA (con)) { - xfree (tcon); - con->console_data = NULL; + xfree (CONSOLE_STREAM_DATA (con)); + CONSOLE_STREAM_DATA (con) = NULL; } } @@ -134,10 +130,7 @@ stream_semi_canonicalize_console_connection (Lisp_Object connection, Error_behavior errb) { - if (NILP (connection)) - return Vstdio_str; - - return connection; + return NILP (connection) ? Vstdio_str : connection; } Lisp_Object @@ -176,8 +169,8 @@ static void stream_init_frame_1 (struct frame *f, Lisp_Object props) { +#if 0 struct device *d = XDEVICE (FRAME_DEVICE (f)); -#if 0 if (!NILP (DEVICE_FRAME_LIST (d))) error ("Only one frame allowed on stream devices"); #endif @@ -355,10 +348,11 @@ Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; } - else { - /* Re-initialize the FILE fields of the console. */ - stream_init_console (XCONSOLE (Vterminal_console), Qnil); - if (noninteractive) - event_stream_select_console (XCONSOLE (Vterminal_console)); - } + else + { + /* Re-initialize the FILE fields of the console. */ + stream_init_console (XCONSOLE (Vterminal_console), Qnil); + if (noninteractive) + event_stream_select_console (XCONSOLE (Vterminal_console)); + } }
--- a/src/console-stream.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console-stream.h Mon Aug 13 10:28:48 2007 +0200 @@ -36,14 +36,14 @@ int needs_newline; }; -#define CONSOLE_STREAM_DATA(d) CONSOLE_TYPE_DATA (d, stream) +#define CONSOLE_STREAM_DATA(con) CONSOLE_TYPE_DATA (con, stream) -extern Lisp_Object stream_semi_canonicalize_console_connection(Lisp_Object, - Error_behavior); -extern Lisp_Object stream_canonicalize_console_connection(Lisp_Object, - Error_behavior); -extern Lisp_Object stream_semi_canonicalize_device_connection(Lisp_Object, - Error_behavior); -extern Lisp_Object stream_canonicalize_device_connection(Lisp_Object, - Error_behavior); +Lisp_Object stream_semi_canonicalize_console_connection(Lisp_Object, + Error_behavior); +Lisp_Object stream_canonicalize_console_connection(Lisp_Object, + Error_behavior); +Lisp_Object stream_semi_canonicalize_device_connection(Lisp_Object, + Error_behavior); +Lisp_Object stream_canonicalize_device_connection(Lisp_Object, + Error_behavior); #endif /* _XEMACS_CONSOLE_STREAM_H_ */
--- a/src/console-tty.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console-tty.c Mon Aug 13 10:28:48 2007 +0200 @@ -29,12 +29,12 @@ #include "console-tty.h" #include "console-stream.h" -#include "events.h" /* for Vcontrolling_terminal */ #include "faces.h" #include "frame.h" #include "lstream.h" #include "redisplay.h" #include "sysdep.h" +#include "sysfile.h" #ifdef FILE_CODING #include "file-coding.h" #endif @@ -47,13 +47,12 @@ Lisp_Object Qterminal_type; Lisp_Object Qcontrolling_process; -extern Lisp_Object Vstdio_str; /* in console-stream.c */ static void allocate_tty_console_struct (struct console *con) { /* zero out all slots except the lisp ones ... */ - con->console_data = xnew_and_zero (struct tty_console); + CONSOLE_TTY_DATA (con) = xnew_and_zero (struct tty_console); CONSOLE_TTY_DATA (con)->terminal_type = Qnil; CONSOLE_TTY_DATA (con)->instream = Qnil; CONSOLE_TTY_DATA (con)->outstream = Qnil; @@ -63,14 +62,15 @@ tty_init_console (struct console *con, Lisp_Object props) { Lisp_Object tty = CONSOLE_CONNECTION (con); - Lisp_Object terminal_type = Qnil, controlling_process = Qnil; - int infd, outfd; + Lisp_Object terminal_type = Qnil; + Lisp_Object controlling_process = Qnil; + struct tty_console *tty_con; struct gcpro gcpro1, gcpro2; GCPRO2 (terminal_type, controlling_process); terminal_type = Fplist_get (props, Qterminal_type, Qnil); - controlling_process = Fplist_get(props, Qcontrolling_process, Qnil); + controlling_process = Fplist_get (props, Qcontrolling_process, Qnil); /* Determine the terminal type */ @@ -78,7 +78,7 @@ CHECK_STRING (terminal_type); else { - char *temp_type = (char *) getenv ("TERM"); + char *temp_type = getenv ("TERM"); if (!temp_type) { @@ -95,40 +95,39 @@ /* Open the specified console */ allocate_tty_console_struct (con); + tty_con = CONSOLE_TTY_DATA (con); + if (internal_equal (tty, Vstdio_str, 0)) { - infd = fileno (stdin); - outfd = fileno (stdout); - CONSOLE_TTY_DATA (con)->is_stdio = 1; + tty_con->infd = fileno (stdin); + tty_con->outfd = fileno (stdout); + tty_con->is_stdio = 1; } else { - infd = outfd = open ((char *) XSTRING_DATA (tty), O_RDWR); - if (infd < 0) + tty_con->infd = tty_con->outfd = + open ((char *) XSTRING_DATA (tty), O_RDWR); + if (tty_con->infd < 0) error ("Unable to open tty %s", XSTRING_DATA (tty)); - CONSOLE_TTY_DATA (con)->is_stdio = 0; + tty_con->is_stdio = 0; } - CONSOLE_TTY_DATA (con)->infd = infd; - CONSOLE_TTY_DATA (con)->outfd = outfd; - CONSOLE_TTY_DATA (con)->instream = make_filedesc_input_stream (infd, 0, - -1, 0); - CONSOLE_TTY_DATA (con)->outstream = make_filedesc_output_stream (outfd, 0, - -1, 0); + tty_con->instream = make_filedesc_input_stream (tty_con->infd, 0, -1, 0); + tty_con->outstream = make_filedesc_output_stream (tty_con->outfd, 0, -1, 0); #ifdef MULE - CONSOLE_TTY_DATA (con)->instream = - make_decoding_input_stream (XLSTREAM (CONSOLE_TTY_DATA (con)->instream), + tty_con->instream = + make_decoding_input_stream (XLSTREAM (tty_con->instream), Fget_coding_system (Vkeyboard_coding_system)); - Lstream_set_character_mode (XLSTREAM (CONSOLE_TTY_DATA (con)->instream)); - CONSOLE_TTY_DATA (con)->outstream = - make_encoding_output_stream (XLSTREAM (CONSOLE_TTY_DATA (con)->outstream), + Lstream_set_character_mode (XLSTREAM (tty_con->instream)); + tty_con->outstream = + make_encoding_output_stream (XLSTREAM (tty_con->outstream), Fget_coding_system (Vterminal_coding_system)); #endif /* MULE */ - CONSOLE_TTY_DATA (con)->terminal_type = terminal_type; - CONSOLE_TTY_DATA (con)->controlling_process = controlling_process; + tty_con->terminal_type = terminal_type; + tty_con->controlling_process = controlling_process; #ifdef HAVE_GPM - connect_to_gpm(con); + connect_to_gpm (con); #endif if (NILP (CONSOLE_NAME (con))) @@ -145,18 +144,18 @@ be the foreground process group of two TTY's (in that case it would have two controlling TTY's, which is not allowed). */ - EMACS_GET_TTY_PROCESS_GROUP (infd, &tty_pg); + EMACS_GET_TTY_PROCESS_GROUP (tty_con->infd, &tty_pg); cfd = open ("/dev/tty", O_RDWR, 0); EMACS_GET_TTY_PROCESS_GROUP (cfd, &controlling_tty_pg); close (cfd); if (tty_pg == controlling_tty_pg) { - CONSOLE_TTY_DATA (con)->controlling_terminal = 1; + tty_con->controlling_terminal = 1; XSETCONSOLE (Vcontrolling_terminal, con); munge_tty_process_group (); } else - CONSOLE_TTY_DATA (con)->controlling_terminal = 0; + tty_con->controlling_terminal = 0; } UNGCPRO; @@ -165,9 +164,10 @@ static void tty_mark_console (struct console *con, void (*markobj) (Lisp_Object)) { - ((markobj) (CONSOLE_TTY_DATA (con)->terminal_type)); - ((markobj) (CONSOLE_TTY_DATA (con)->instream)); - ((markobj) (CONSOLE_TTY_DATA (con)->outstream)); + struct tty_console *tty_con = CONSOLE_TTY_DATA (con); + ((markobj) (tty_con->terminal_type)); + ((markobj) (tty_con->instream)); + ((markobj) (tty_con->outstream)); } static int @@ -179,16 +179,16 @@ static void free_tty_console_struct (struct console *con) { - struct tty_console *tcon = (struct tty_console *) con->console_data; - if (tcon && tcon->term_entry_buffer) /* allocated in term_init () */ + struct tty_console *tty_con = CONSOLE_TTY_DATA (con); + if (tty_con) { - xfree (tcon->term_entry_buffer); - tcon->term_entry_buffer = NULL; - } - if (tcon) - { - xfree (tcon); - con->console_data = NULL; + if (tty_con->term_entry_buffer) /* allocated in term_init () */ + { + xfree (tty_con->term_entry_buffer); + tty_con->term_entry_buffer = NULL; + } + xfree (tty_con); + CONSOLE_TTY_DATA (con) = NULL; } } @@ -224,8 +224,9 @@ return CONSOLE_TTY_DATA (decode_tty_console (console))->terminal_type; } -DEFUN ("console-tty-controlling-process", Fconsole_tty_controlling_process, 0, 1, 0, /* -Return the controlling process of TTY console CONSOLE. +DEFUN ("console-tty-controlling-process", + Fconsole_tty_controlling_process, 0, 1, 0, /* +Return the controlling process of tty console CONSOLE. */ (console)) { @@ -233,84 +234,70 @@ } #ifdef MULE -DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system, 0, 2, 0, /* -Set the coding system of tty console CONSOLE to CODESYS. -CONSOLE defaults to the selected console. -CODESYS defaults to the value of `terminal-coding-system'. -*/ - (console, codesys)) -{ - struct console *con = decode_tty_console (console); - codesys = NILP (codesys) ? - Vterminal_coding_system : - Fget_coding_system (codesys); - if (!NILP(codesys)) { - set_encoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (con)->outstream), - codesys); - } - return Qnil; -} -#endif /* MULE */ - -/* redefine coding system for console tty */ -#ifdef MULE -DEFUN ("console-tty-input-coding-system", Fconsole_tty_input_coding_system, 1, 1, 0, /* -Return TTY CONSOLE's input coding system. +DEFUN ("console-tty-input-coding-system", + Fconsole_tty_input_coding_system, 0, 1, 0, /* +Return the input coding system of tty console CONSOLE. */ (console)) { - struct console *con = decode_tty_console (console); - return decoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (con)->instream)); + return decoding_stream_coding_system + (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->instream)); } -DEFUN ("set-console-tty-input-coding-system", Fset_console_tty_input_coding_system, 0, 2, 0, /* -Set the coding system of tty input of console CONSOLE to CODESYS. +DEFUN ("set-console-tty-input-coding-system", + Fset_console_tty_input_coding_system, 0, 2, 0, /* +Set the input coding system of tty console CONSOLE to CODESYS. CONSOLE defaults to the selected console. CODESYS defaults to the value of `keyboard-coding-system'. */ (console, codesys)) { - struct console *con; - if (!NILP(console)) { - con = decode_tty_console (console); - codesys = NILP (codesys) ? - Vkeyboard_coding_system : - Fget_coding_system (codesys); - set_encoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (con)->instream), - codesys); - } + set_decoding_stream_coding_system + (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->instream), + Fget_coding_system (NILP (codesys) ? Vkeyboard_coding_system : codesys)); return Qnil; } -DEFUN ("console-tty-output-coding-system", Fconsole_tty_output_coding_system, 1, 1, 0, /* +DEFUN ("console-tty-output-coding-system", + Fconsole_tty_output_coding_system, 0, 1, 0, /* Return TTY CONSOLE's output coding system. */ (console)) { - struct console *con = decode_tty_console (console); - return encoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (con)->outstream) ); + return encoding_stream_coding_system + (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream)); } -DEFUN ("set-console-tty-output-coding-system", Fset_console_tty_output_coding_system, 0, 2, 0, /* +DEFUN ("set-console-tty-output-coding-system", + Fset_console_tty_output_coding_system, 0, 2, 0, /* Set the coding system of tty output of console CONSOLE to CODESYS. CONSOLE defaults to the selected console. CODESYS defaults to the value of `terminal-coding-system'. */ (console, codesys)) { - struct console *con; - if (!NILP(console)) { - con = decode_tty_console (console); - codesys = NILP (codesys) ? - Vterminal_coding_system : - Fget_coding_system (codesys); - set_encoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (con)->outstream), - codesys); - } + set_encoding_stream_coding_system + (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream), + Fget_coding_system (NILP (codesys) ? Vterminal_coding_system : codesys)); return Qnil; } +/* ### Move this function to lisp */ +DEFUN ("set-console-tty-coding-system", + Fset_console_tty_coding_system, 0, 2, 0, /* +Set the input and output coding systems of tty console CONSOLE to CODESYS. +CONSOLE defaults to the selected console. +If CODESYS is nil, the values of `keyboard-coding-system' and +`terminal-coding-system' will be used for the input and +output coding systems of CONSOLE. +*/ + (console, codesys)) +{ + Fset_console_tty_input_coding_system (console, codesys); + Fset_console_tty_output_coding_system (console, codesys); + return Qnil; +} #endif /* MULE */ @@ -360,7 +347,7 @@ DEFSUBR (Fconsole_tty_input_coding_system); DEFSUBR (Fset_console_tty_input_coding_system); DEFSUBR (Fset_console_tty_coding_system); -#endif +#endif /* MULE */ } void
--- a/src/console-tty.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console-tty.h Mon Aug 13 10:28:48 2007 +0200 @@ -103,7 +103,7 @@ CONST char *home; /* home, ho */ CONST char *low_left; /* ll, ll */ CONST char *car_return; /* cr, cr */ - + /* parameterized local cursor movement */ CONST char *multi_up; /* cuu, UP */ CONST char *multi_down; /* cud, DO */ @@ -160,7 +160,7 @@ CONST char *end_underline; /* rmul, ue */ CONST char *begin_alternate; /* smacs, as */ CONST char *end_alternate; /* rmacs, ae */ - + CONST char *turn_on_reverse; /* rev, mr */ CONST char *turn_on_blinking; /* blink, mb */ CONST char *turn_on_bold; /* bold, md */ @@ -179,7 +179,7 @@ CONST char *orig_pair; /* op, op */ } sd; - + /* costs of various operations */ struct { @@ -255,25 +255,20 @@ extern FILE *termscript; +EXFUN (Fconsole_tty_controlling_process, 1); /****************** Prototypes from cm.c *******************/ /* #### Verify that all of these are still needed. */ -extern void cm_cost_init (struct console *c); -extern void cmputc (int c); -extern void cmgoto (struct frame *f, int row, int col); +void cm_cost_init (struct console *c); +void cmputc (int c); +void cmgoto (struct frame *f, int row, int col); extern struct console *cmputc_console; void send_string_to_tty_console (struct console *c, unsigned char *str, int len); -/*************** Prototypes from event-tty.c ****************/ - -extern void init_event_tty_late (void); - - - /*************** Prototypes from redisplay-tty.c ****************/ enum term_init_status @@ -285,13 +280,13 @@ TTY_INIT_SUCCESS }; -extern int init_tty_for_redisplay (struct device *d, char *terminal_type); +int init_tty_for_redisplay (struct device *d, char *terminal_type); /* #### These should probably be methods. */ void set_tty_modes (struct console *c); void reset_tty_modes (struct console *c); /* Used in sysdep.c to properly clear and position the cursor when exiting. */ -extern void tty_redisplay_shutdown (struct console *c); +void tty_redisplay_shutdown (struct console *c); /* called from console-stream.c */ Lisp_Object tty_semi_canonicalize_console_connection (Lisp_Object connection,
--- a/src/console-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -126,7 +126,7 @@ { if (elt + 1 == argc) { - suppress_early_backtrace = 1; + suppress_early_error_handler_backtrace = 1; error ("-display specified with no arg"); } else
--- a/src/console-x.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console-x.h Mon Aug 13 10:28:48 2007 +0200 @@ -238,6 +238,18 @@ #define DEVICE_XATOM_CHARSET_REGISTRY(d) (DEVICE_X_DATA (d)->Xatom_CHARSET_REGISTRY) #define DEVICE_XATOM_CHARSET_ENCODING(d) (DEVICE_X_DATA (d)->Xatom_CHARSET_ENCODING) +#define Xt_SET_VALUE(widget, resource, value) do { \ + Arg al; \ + XtSetArg (al, resource, value); \ + XtSetValues (widget, &al, 1); \ +} while (0) + +#define Xt_GET_VALUE(widget, resource, location) do { \ + Arg al; \ + XtSetArg (al, resource, location); \ + XtGetValues (widget, &al, 1); \ +} while (0) + /* The maximum number of widgets that can be displayed above the text area at one time. Currently no more than 3 will ever actually be displayed (menubar, psheet, debugger panel). */ @@ -373,7 +385,6 @@ struct frame *x_any_widget_or_parent_to_frame (struct device *d, Widget widget); struct frame *decode_x_frame (Lisp_Object); -Display *get_x_display (Lisp_Object); struct frame *x_window_to_frame (struct device *d, Window); struct device *get_device_from_display (Display *dpy); struct device *decode_x_device (Lisp_Object); @@ -429,10 +440,6 @@ #define HANDLING_X_ERROR(dpy, body) \ ( expect_x_error ((dpy)), (body), signal_if_x_error ((dpy), 0)) -Lisp_Object x_atom_to_symbol (struct device *d, Atom atom); -Atom symbol_to_x_atom (struct device *d, Lisp_Object sym, - int only_if_exists); - #ifdef HAVE_XIM /* Locale */ void Initialize_Locale (void);
--- a/src/console.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console.c Mon Aug 13 10:28:48 2007 +0200 @@ -49,9 +49,9 @@ variables defined with DEFVAR_CONSOLE_LOCAL, that have special slots in each console. The default value occupies the same slot in this structure as an individual console's value occupies in - that console. Setting the default value also goes through the alist - of consoles and stores into each console that does not say it has a - local value. */ + that console. Setting the default value also goes through the + list of consoles and stores into each console that does not say + it has a local value. */ Lisp_Object Vconsole_defaults; /* This structure marks which slots in a console have corresponding @@ -92,18 +92,9 @@ Lisp_Object Vconsole_type_list; -MAC_DEFINE (struct console *, MTconsole_data) -MAC_DEFINE (struct console_methods *, MTcontype_meth_or_given) - console_type_entry_dynarr *the_console_type_entry_dynarr; -static Lisp_Object mark_console (Lisp_Object, void (*) (Lisp_Object)); -static void print_console (Lisp_Object, Lisp_Object, int); -DEFINE_LRECORD_IMPLEMENTATION ("console", console, - mark_console, print_console, 0, 0, 0, - struct console); - static Lisp_Object mark_console (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -145,11 +136,14 @@ write_c_string (buf, printcharfun); } +DEFINE_LRECORD_IMPLEMENTATION ("console", console, + mark_console, print_console, 0, 0, 0, + struct console); static struct console * allocate_console (void) { - Lisp_Object console = Qnil; + Lisp_Object console; struct console *con = alloc_lcrecord_type (struct console, lrecord_console); struct gcpro gcpro1; @@ -185,10 +179,8 @@ int i; for (i = 0; i < Dynarr_length (the_console_type_entry_dynarr); i++) - { - if (EQ (type, Dynarr_at (the_console_type_entry_dynarr, i).symbol)) - return Dynarr_at (the_console_type_entry_dynarr, i).meths; - } + if (EQ (type, Dynarr_at (the_console_type_entry_dynarr, i).symbol)) + return Dynarr_at (the_console_type_entry_dynarr, i).meths; maybe_signal_simple_error ("Invalid console type", type, Qconsole, errb); @@ -198,9 +190,7 @@ int valid_console_type_p (Lisp_Object type) { - if (decode_console_type (type, ERROR_ME_NOT)) - return 1; - return 0; + return decode_console_type (type, ERROR_ME_NOT) != 0; } DEFUN ("valid-console-type-p", Fvalid_console_type_p, 1, 1, 0, /* @@ -209,10 +199,7 @@ */ (console_type)) { - if (valid_console_type_p (console_type)) - return Qt; - else - return Qnil; + return valid_console_type_p (console_type) ? Qt : Qnil; } DEFUN ("console-type-list", Fconsole_type_list, 0, 0, 0, /* @@ -306,9 +293,7 @@ */ (object)) { - if (!CONSOLEP (object)) - return Qnil; - return Qt; + return CONSOLEP (object) ? Qt : Qnil; } DEFUN ("console-live-p", Fconsole_live_p, 1, 1, 0, /* @@ -316,9 +301,7 @@ */ (object)) { - if (!CONSOLEP (object) || !CONSOLE_LIVE_P (XCONSOLE (object))) - return Qnil; - return Qt; + return CONSOLEP (object) && CONSOLE_LIVE_P (XCONSOLE (object)) ? Qt : Qnil; } DEFUN ("console-type", Fconsole_type, 0, 1, 0, /* @@ -359,10 +342,10 @@ } Lisp_Object -make_console (struct console *c) +make_console (struct console *con) { - Lisp_Object console = Qnil; - XSETCONSOLE (console, c); + Lisp_Object console; + XSETCONSOLE (console, con); return console; } @@ -418,8 +401,7 @@ if (!NILP (type)) { - struct console_methods *conmeths = decode_console_type (type, - ERROR_ME); + struct console_methods *conmeths = decode_console_type (type, ERROR_ME); canon = canonicalize_console_connection (conmeths, connection, ERROR_ME_NOT); if (UNBOUNDP (canon)) @@ -477,18 +459,18 @@ { /* This function can GC */ struct console *con; - Lisp_Object console = Qnil; + Lisp_Object console; struct gcpro gcpro1; - GCPRO1 (console); - console = Ffind_console (connection, type); if (!NILP (console)) - RETURN_UNGCPRO (console); + return console; con = allocate_console (); XSETCONSOLE (console, con); + GCPRO1 (console); + con->conmeths = decode_console_type (type, ERROR_ME); CONSOLE_NAME (con) = name; @@ -601,7 +583,7 @@ int called_from_kill_emacs, int from_io_error) { /* This function can GC */ - Lisp_Object console = Qnil; + Lisp_Object console; struct gcpro gcpro1; /* OK to delete an already-deleted console. */ @@ -794,11 +776,9 @@ */ (console)) { - struct console *con = decode_console (console); + Lisp_Object type = CONSOLE_TYPE (decode_console (console)); - if (EQ (CONSOLE_TYPE (con), Qtty) || EQ (CONSOLE_TYPE (con), Qstream)) - return Qnil; - return Qt; + return !EQ (type, Qtty) && !EQ (type, Qstream) ? Qt : Qnil; } @@ -812,12 +792,14 @@ { reinit_initial_console (); - if (!no_redraw_on_reenter) + if (!no_redraw_on_reenter && + CONSOLEP (console) && + CONSOLE_LIVE_P (XCONSOLE (console))) { - if (CONSOLEP (console) && CONSOLE_LIVE_P (XCONSOLE (console))) - MARK_FRAME_CHANGED - (XFRAME (DEVICE_SELECTED_FRAME - (XDEVICE (CONSOLE_SELECTED_DEVICE (XCONSOLE (console)))))); + struct frame *f = + XFRAME (DEVICE_SELECTED_FRAME + (XDEVICE (CONSOLE_SELECTED_DEVICE (XCONSOLE (console))))); + MARK_FRAME_CHANGED (f); } return Qnil; } @@ -910,9 +892,6 @@ # endif #endif /* BSD */ } -#ifdef HAVE_TTY -extern Lisp_Object Fconsole_tty_controlling_process(Lisp_Object console); -#endif DEFUN ("suspend-console", Fsuspend_console, 0, 1, "", /* Suspend a console. For tty consoles, it sends a signal to suspend @@ -928,75 +907,71 @@ (console)) { #ifdef HAVE_TTY - struct console *c; - - c = decode_console (console); + struct console *con = decode_console (console); - if (CONSOLE_TTY_P (c)) - { - /* - * hide all the unhidden frames so the display code won't update - * them while the console is suspended. - */ - Lisp_Object device = CONSOLE_SELECTED_DEVICE (c); - if (!NILP (device)) - { - struct device *d = XDEVICE (device); - Lisp_Object frame_list = DEVICE_FRAME_LIST (d); - while (CONSP (frame_list)) - { - struct frame *f = XFRAME (XCAR (frame_list)); - if (FRAME_REPAINT_P (f)) - f->visible = -1; - frame_list = XCDR (frame_list); - } - } - reset_one_console (c); - event_stream_unselect_console (c); - sys_suspend_process(XINT(Fconsole_tty_controlling_process(console))); - } + if (CONSOLE_TTY_P (con)) + { + /* + * hide all the unhidden frames so the display code won't update + * them while the console is suspended. + */ + Lisp_Object device = CONSOLE_SELECTED_DEVICE (con); + if (!NILP (device)) + { + struct device *d = XDEVICE (device); + Lisp_Object frame_list = DEVICE_FRAME_LIST (d); + while (CONSP (frame_list)) + { + struct frame *f = XFRAME (XCAR (frame_list)); + if (FRAME_REPAINT_P (f)) + f->visible = -1; + frame_list = XCDR (frame_list); + } + } + reset_one_console (con); + event_stream_unselect_console (con); + sys_suspend_process (XINT (Fconsole_tty_controlling_process (console))); + } +#endif /* HAVE_TTY */ -#endif return Qnil; } DEFUN ("resume-console", Fresume_console, 1, 1, "", /* -Re-initialize a previously suspended console. For tty consoles, -do stuff to the tty to make it sane again. +Re-initialize a previously suspended console. +For tty consoles, do stuff to the tty to make it sane again. */ (console)) { #ifdef HAVE_TTY - struct console *c; - - c = decode_console (console); + struct console *con = decode_console (console); - if (CONSOLE_TTY_P (c)) - { - /* raise the selected frame */ - Lisp_Object device = CONSOLE_SELECTED_DEVICE (c); - if (!NILP (device)) - { - struct device *d = XDEVICE (device); - Lisp_Object frame = DEVICE_SELECTED_FRAME (d); - if (!NILP (frame)) - { - /* force the frame to be cleared */ - SET_FRAME_CLEAR (XFRAME (frame)); - Fraise_frame (frame); - } - } - init_one_console (c); - event_stream_select_console (c); + if (CONSOLE_TTY_P (con)) + { + /* raise the selected frame */ + Lisp_Object device = CONSOLE_SELECTED_DEVICE (con); + if (!NILP (device)) + { + struct device *d = XDEVICE (device); + Lisp_Object frame = DEVICE_SELECTED_FRAME (d); + if (!NILP (frame)) + { + /* force the frame to be cleared */ + SET_FRAME_CLEAR (XFRAME (frame)); + Fraise_frame (frame); + } + } + init_one_console (con); + event_stream_select_console (con); #ifdef SIGWINCH - /* The same as in Fsuspend_emacs: it is possible that a size - change occurred while we were suspended. Assume one did just - to be safe. It won't hurt anything if one didn't. */ - asynch_device_change_pending++; + /* The same as in Fsuspend_emacs: it is possible that a size + change occurred while we were suspended. Assume one did just + to be safe. It won't hurt anything if one didn't. */ + asynch_device_change_pending++; #endif - } + } +#endif /* HAVE_TTY */ -#endif return Qnil; } @@ -1017,17 +992,10 @@ (ignored, flow, meta, quit, console)) { struct console *con = decode_console (console); - int meta_key = 1; - - if (CONSOLE_TTY_P (con)) - { - if (NILP (meta)) - meta_key = 0; - else if (EQ (meta, Qt)) - meta_key = 1; - else - meta_key = 2; - } + int meta_key = (!CONSOLE_TTY_P (con) ? 1 : + EQ (meta, Qnil) ? 0 : + EQ (meta, Qt) ? 1 : + 2); if (!NILP (quit)) { @@ -1036,6 +1004,7 @@ ((unsigned int) XCHAR (quit)) & (meta_key ? 0377 : 0177); } +#ifdef HAVE_TTY if (CONSOLE_TTY_P (con)) { reset_one_console (con); @@ -1043,6 +1012,7 @@ TTY_FLAGS (con).meta_key = meta_key; init_one_console (con); } +#endif return Qnil; } @@ -1065,16 +1035,22 @@ */ (console)) { - Lisp_Object val[4]; struct console *con = decode_console (console); + Lisp_Object flow, meta, quit; - val[0] = Qnil; - val[1] = CONSOLE_TTY_P (con) && TTY_FLAGS (con).flow_control ? Qt : Qnil; - val[2] = (!CONSOLE_TTY_P (con) || TTY_FLAGS (con).meta_key == 1) ? - Qt : TTY_FLAGS (con).meta_key == 2 ? Qzero : Qnil; - val[3] = make_char (CONSOLE_QUIT_CHAR (con)); +#ifdef HAVE_TTY + flow = CONSOLE_TTY_P (con) && TTY_FLAGS (con).flow_control ? Qt : Qnil; + meta = (!CONSOLE_TTY_P (con) ? Qt : + TTY_FLAGS (con).meta_key == 1 ? Qt : + TTY_FLAGS (con).meta_key == 2 ? Qzero : + Qnil); +#else + flow = Qnil; + meta = Qt; +#endif + quit = make_char (CONSOLE_QUIT_CHAR (con)); - return Flist (sizeof (val) / sizeof (val[0]), val); + return list4 (Qnil, flow, meta, quit); } @@ -1199,7 +1175,7 @@ = { { { symbol_value_forward_lheader_initializer, \ (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ SYMVAL_CONST_SELECTED_CONSOLE_FORWARD }, magicfun }; \ - defvar_console_local ((lname), &I_hate_C); \ + defvar_console_local ((lname), &I_hate_C); \ } while (0) #define DEFVAR_CONSOLE_DEFAULTS(lname, field_name) do { \
--- a/src/console.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/console.h Mon Aug 13 10:28:48 2007 +0200 @@ -273,24 +273,17 @@ #define CONTYPE_METH(meth, m, args) (((meth)->m##_method) args) /* Call a void-returning console method, if it exists */ -#define MAYBE_CONTYPE_METH(meth, m, args) \ -do { \ +#define MAYBE_CONTYPE_METH(meth, m, args) do { \ struct console_methods *_maybe_contype_meth_meth = (meth); \ if (HAS_CONTYPE_METH_P (_maybe_contype_meth_meth, m)) \ CONTYPE_METH (_maybe_contype_meth_meth, m, args); \ } while (0) -MAC_DECLARE_EXTERN (struct console_methods *, MTcontype_meth_or_given) - /* Call a console method, if it exists; otherwise return - the specified value */ -#define CONTYPE_METH_OR_GIVEN(meth, m, args, given) \ -MAC_BEGIN \ - MAC_DECLARE (struct console_methods *, \ - MTcontype_meth_or_given, meth) \ - HAS_CONTYPE_METH_P (MTcontype_meth_or_given, m) ? \ - CONTYPE_METH (MTcontype_meth_or_given, m, args) : (given) \ -MAC_END + the specified value - meth is multiply evaluated. */ +#define CONTYPE_METH_OR_GIVEN(meth, m, args, given) \ + (HAS_CONTYPE_METH_P (meth, m) ? \ + CONTYPE_METH (meth, m, args) : (given)) /* Call an int-returning console method, if it exists; otherwise return 0 */ @@ -394,49 +387,49 @@ #define CHECK_CONSOLE(x) CHECK_RECORD (x, console) #define CONCHECK_CONSOLE(x) CONCHECK_RECORD (x, console) -#define CHECK_LIVE_CONSOLE(x) \ - do { CHECK_CONSOLE (x); \ - if (! CONSOLEP (x) \ - || ! CONSOLE_LIVE_P (XCONSOLE (x))) \ - dead_wrong_type_argument (Qconsole_live_p, (x)); } while (0) -#define CONCHECK_LIVE_CONSOLE(x) \ - do { CONCHECK_CONSOLE (x); \ - if (! CONSOLEP (x) \ - || ! CONSOLE_LIVE_P (XCONSOLE (x))) \ - x = wrong_type_argument (Qconsole_live_p, (x)); } while (0) +#define CHECK_LIVE_CONSOLE(x) do { \ + CHECK_CONSOLE (x); \ + if (! CONSOLE_LIVE_P (XCONSOLE (x))) \ + dead_wrong_type_argument (Qconsole_live_p, (x)); \ +} while (0) +#define CONCHECK_LIVE_CONSOLE(x) do { \ + CONCHECK_CONSOLE (x); \ + if (! CONSOLE_LIVE_P (XCONSOLE (x))) \ + x = wrong_type_argument (Qconsole_live_p, (x)); \ +} while (0) #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type) #ifdef ERROR_CHECK_TYPECHECK -MAC_DECLARE_EXTERN (struct console *, MTconsole_data) -# define CONSOLE_TYPE_DATA(con, type) \ -MAC_BEGIN \ - MAC_DECLARE (struct console *, MTconsole_data, con) \ - assert (CONSOLE_TYPE_P (MTconsole_data, type)) \ - MAC_SEP \ - (struct type##_console *) MTconsole_data->console_data \ -MAC_END +INLINE struct console * +error_check_console_type (struct console *con, Lisp_Object sym); +INLINE struct console * +error_check_console_type (struct console *con, Lisp_Object sym) +{ + assert (EQ (CONSOLE_TYPE (con), sym)); + return con; +} +# define CONSOLE_TYPE_DATA(con, type) \ + (*(struct type##_console **) \ + &(error_check_console_type (con, Q##type))->console_data) #else -# define CONSOLE_TYPE_DATA(con, type) \ - ((struct type##_console *) (con)->console_data) +# define CONSOLE_TYPE_DATA(con, type) \ + (*(struct type##_console **) &((con)->console_data)) #endif -#define CHECK_CONSOLE_TYPE(x, type) \ - do { \ - CHECK_CONSOLE (x); \ - if (!(CONSOLEP (x) && CONSOLE_TYPE_P (XCONSOLE (x), \ - type))) \ - dead_wrong_type_argument \ - (type##_console_methods->predicate_symbol, x); \ - } while (0) -#define CONCHECK_CONSOLE_TYPE(x, type) \ - do { \ - CONCHECK_CONSOLE (x); \ - if (!(CONSOLEP (x) && CONSOLE_TYPE_P (XCONSOLE (x), \ - type))) \ - x = wrong_type_argument \ - (type##_console_methods->predicate_symbol, x); \ - } while (0) +#define CHECK_CONSOLE_TYPE(x, type) do { \ + CHECK_CONSOLE (x); \ + if (! CONSOLE_TYPE_P (XCONSOLE (x), type)) \ + dead_wrong_type_argument \ + (type##_console_methods->predicate_symbol, x); \ +} while (0) +#define CONCHECK_CONSOLE_TYPE(x, type) do { \ + CONCHECK_CONSOLE (x); \ + if (!(CONSOLEP (x) && \ + CONSOLE_TYPE_P (XCONSOLE (x), type))) \ + x = wrong_type_argument \ + (type##_console_methods->predicate_symbol, x); \ +} while (0) /* #### These should be in the console-*.h files but there are too many places where the abstraction is broken. Need to @@ -480,18 +473,13 @@ #define CONSOLE_WIN_P(con) CONSOLE_TYPESYM_WIN_P (CONSOLE_TYPE (con)) -extern Lisp_Object Vconsole_list, Vselected_console, Vdefault_console; -extern Lisp_Object Qconsole_live_p; +EXFUN (Fconsole_disable_input, 1); +EXFUN (Fdelete_console, 2); +EXFUN (Fselect_console, 1); +EXFUN (Fselected_console, 0); -/* This structure holds the default values of the console-local - variables defined with DEFVAR_CONSOLE_LOCAL, that have special - slots in each console. The default value occupies the same slot - in this structure as an individual console's value occupies in - that console. Setting the default value also goes through the - list of consoles and stores into each console that does not say - it has a local value. */ - -extern Lisp_Object Vconsole_defaults; +extern Lisp_Object Qcreate_console_hook, Qdelete_console_hook; +extern Lisp_Object Vconsole_defaults, Vconsole_type_list, Vselected_console; /* This structure marks which slots in a console have corresponding default values in console_defaults. @@ -508,16 +496,6 @@ extern struct console console_local_flags; -extern Lisp_Object Vconsole_type_list; - -extern Lisp_Object Qtty, Qstream, Qdead; -#ifdef HAVE_X_WINDOWS -extern Lisp_Object Qx; -#endif /* HAVE_X_WINDOWS */ -#ifdef HAVE_MS_WINDOWS -extern Lisp_Object Qmswindows; -#endif /* HAVE_MS_WINDOWS */ - int valid_console_type_p (Lisp_Object type); #define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead))
--- a/src/data.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/data.c Mon Aug 13 10:28:48 2007 +0200 @@ -29,8 +29,8 @@ #include "buffer.h" #include "bytecode.h" +#include "syssignal.h" -#include "syssignal.h" #ifdef LISP_FLOAT_TYPE /* Need to define a differentiating symbol -- see sysfloat.h */ # define THIS_FILENAME data_c @@ -38,8 +38,8 @@ #endif /* LISP_FLOAT_TYPE */ Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; -Lisp_Object Qerror_conditions, Qerror_message, Qtop_level; -Lisp_Object Qsignal, Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range; +Lisp_Object Qerror_conditions, Qerror_message; +Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range; Lisp_Object Qvoid_variable, Qcyclic_variable_indirection; Lisp_Object Qvoid_function, Qcyclic_function_indirection; Lisp_Object Qsetting_constant, Qinvalid_read_syntax; @@ -50,26 +50,18 @@ Lisp_Object Qarith_error, Qrange_error, Qdomain_error; Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error; Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; -Lisp_Object Qintegerp, Qnatnump, Qsymbolp, Qkeywordp, Qlistp, Qconsp, Qsubrp; -Lisp_Object Qcharacterp, Qstringp, Qarrayp, Qsequencep, Qbufferp; -Lisp_Object Qcompiled_functionp; -Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp; +Lisp_Object Qintegerp, Qnatnump, Qsymbolp, Qkeywordp; +Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp; +Lisp_Object Qconsp, Qsubrp, Qcompiled_functionp; +Lisp_Object Qcharacterp, Qstringp, Qarrayp, Qsequencep, Qvectorp; +Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qbufferp; Lisp_Object Qinteger_or_char_p, Qinteger_char_or_marker_p; -Lisp_Object Qbit_vectorp, Qbitp; - -/* Qstring, Qinteger, Qsymbol, Qvector defined in general.c */ -Lisp_Object Qcons, Qkeyword; - -Lisp_Object Qcdr; - -Lisp_Object Qignore; +Lisp_Object Qnumberp, Qnumber_or_marker_p, Qnumber_char_or_marker_p; +Lisp_Object Qbit_vectorp, Qbitp, Qcons, Qkeyword, Qcdr, Qignore; #ifdef LISP_FLOAT_TYPE Lisp_Object Qfloatp; #endif -Lisp_Object Qnumberp, Qnumber_or_marker_p, Qnumber_char_or_marker_p; - -Lisp_Object Qweak_listp; #ifdef DEBUG_XEMACS @@ -157,25 +149,9 @@ check_int_range (int val, int min, int max) { if (val < min || val > max) - args_out_of_range_3 (make_int (val), make_int (min), - make_int (max)); + args_out_of_range_3 (make_int (val), make_int (min), make_int (max)); } -#ifndef make_int -Lisp_Object -make_int (EMACS_INT num) -{ - Lisp_Object val; -#ifdef USE_MINIMAL_TAGBITS - XSETINT(val, num); -#else - /* Don't use XSETINT here -- it's defined in terms of make_int (). */ - XSETOBJ (val, Lisp_Type_Int, num); -#endif - return val; -} -#endif /* ! defined (make_int) */ - /* On some machines, XINT needs a temporary location. Here it is, in case it is needed. */ @@ -193,26 +169,11 @@ return num & ((1L << VALBITS) - 1); } -/* characters do not need to sign extend so there's no need for special - futzing like with ints. */ -#ifndef make_char -Lisp_Object -make_char (Emchar num) -{ - Lisp_Object val; -#ifdef USE_MINIMAL_TAGBITS - XSETCHAR (val, num); -#else - XSETOBJ (val, Lisp_Type_Char, num); -#endif - return val; -} -#endif /* ! make_char */ /* Data type predicates */ DEFUN ("eq", Feq, 2, 2, 0, /* -T if the two args are the same Lisp object. +Return t if the two args are the same Lisp object. */ (obj1, obj2)) { @@ -220,7 +181,7 @@ } DEFUN ("old-eq", Fold_eq, 2, 2, 0, /* -T if the two args are (in most cases) the same Lisp object. +Return t if the two args are (in most cases) the same Lisp object. Special kludge: A character is considered `old-eq' to its equivalent integer even though they are not the same object and are in fact of different @@ -238,7 +199,7 @@ } DEFUN ("null", Fnull, 1, 1, 0, /* -T if OBJECT is nil. +Return t if OBJECT is nil. */ (object)) { @@ -246,7 +207,7 @@ } DEFUN ("consp", Fconsp, 1, 1, 0, /* -T if OBJECT is a cons cell. +Return t if OBJECT is a cons cell. */ (object)) { @@ -254,7 +215,7 @@ } DEFUN ("atom", Fatom, 1, 1, 0, /* -T if OBJECT is not a cons cell. This includes nil. +Return t if OBJECT is not a cons cell. Atoms include nil. */ (object)) { @@ -262,23 +223,31 @@ } DEFUN ("listp", Flistp, 1, 1, 0, /* -T if OBJECT is a list. This includes nil. +Return t if OBJECT is a list. Lists includes nil. */ (object)) { - return CONSP (object) || NILP (object) ? Qt : Qnil; + return LISTP (object) ? Qt : Qnil; } DEFUN ("nlistp", Fnlistp, 1, 1, 0, /* -T if OBJECT is not a list. Lists include nil. +Return t if OBJECT is not a list. Lists include nil. */ (object)) { - return CONSP (object) || NILP (object) ? Qnil : Qt; + return LISTP (object) ? Qnil : Qt; +} + +DEFUN ("true-list-p", Ftrue_list_p, 1, 1, 0, /* +Return t if OBJECT is a non-dotted, i.e. nil-terminated, list. +*/ + (object)) +{ + return TRUE_LIST_P (object) ? Qt : Qnil; } DEFUN ("symbolp", Fsymbolp, 1, 1, 0, /* -T if OBJECT is a symbol. +Return t if OBJECT is a symbol. */ (object)) { @@ -286,7 +255,7 @@ } DEFUN ("keywordp", Fkeywordp, 1, 1, 0, /* -T if OBJECT is a keyword. +Return t if OBJECT is a keyword. */ (object)) { @@ -294,7 +263,7 @@ } DEFUN ("vectorp", Fvectorp, 1, 1, 0, /* -T if OBJECT is a vector. +REturn t if OBJECT is a vector. */ (object)) { @@ -302,7 +271,7 @@ } DEFUN ("bit-vector-p", Fbit_vector_p, 1, 1, 0, /* -T if OBJECT is a bit vector. +Return t if OBJECT is a bit vector. */ (object)) { @@ -310,7 +279,7 @@ } DEFUN ("stringp", Fstringp, 1, 1, 0, /* -T if OBJECT is a string. +Return t if OBJECT is a string. */ (object)) { @@ -318,31 +287,31 @@ } DEFUN ("arrayp", Farrayp, 1, 1, 0, /* -T if OBJECT is an array (string, vector, or bit vector). +Return t if OBJECT is an array (string, vector, or bit vector). */ (object)) { - return (VECTORP (object) || - STRINGP (object) || - BIT_VECTORP (object)) + return (VECTORP (object) || + STRINGP (object) || + BIT_VECTORP (object)) ? Qt : Qnil; } DEFUN ("sequencep", Fsequencep, 1, 1, 0, /* -T if OBJECT is a sequence (list or array). +Return t if OBJECT is a sequence (list or array). */ (object)) { - return (CONSP (object) || - NILP (object) || - VECTORP (object) || - STRINGP (object) || - BIT_VECTORP (object)) + return (CONSP (object) || + NILP (object) || + VECTORP (object) || + STRINGP (object) || + BIT_VECTORP (object)) ? Qt : Qnil; } DEFUN ("markerp", Fmarkerp, 1, 1, 0, /* -T if OBJECT is a marker (editor pointer). +Return t if OBJECT is a marker (editor pointer). */ (object)) { @@ -350,7 +319,7 @@ } DEFUN ("subrp", Fsubrp, 1, 1, 0, /* -T if OBJECT is a built-in function. +Return t if OBJECT is a built-in function. */ (object)) { @@ -395,7 +364,7 @@ } DEFUN ("compiled-function-p", Fcompiled_function_p, 1, 1, 0, /* -t if OBJECT is a byte-compiled function object. +Return t if OBJECT is a byte-compiled function object. */ (object)) { @@ -404,7 +373,7 @@ DEFUN ("characterp", Fcharacterp, 1, 1, 0, /* -t if OBJECT is a character. +Return t if OBJECT is a character. Unlike in XEmacs v19 and Emacs, a character is its own primitive type. Any character can be converted into an equivalent integer using `char-to-int'. To convert the other way, use `int-to-char'; however, @@ -464,7 +433,7 @@ } DEFUN ("char-int-p", Fchar_int_p, 1, 1, 0, /* -t if OBJECT is an integer that can be converted into a character. +Return t if OBJECT is an integer that can be converted into a character. See `char-to-int'. */ (object)) @@ -473,7 +442,7 @@ } DEFUN ("char-or-char-int-p", Fchar_or_char_int_p, 1, 1, 0, /* -t if OBJECT is a character or an integer that can be converted into one. +Return t if OBJECT is a character or an integer that can be converted into one. */ (object)) { @@ -481,7 +450,7 @@ } DEFUN ("char-or-string-p", Fchar_or_string_p, 1, 1, 0, /* -t if OBJECT is a character (or a char-int) or a string. +Return t if OBJECT is a character (or a char-int) or a string. It is semi-hateful that we allow a char-int here, as it goes against the name of this function, but it makes the most sense considering the other steps we take to maintain compatibility with the old character/integer @@ -493,7 +462,7 @@ } DEFUN ("integerp", Fintegerp, 1, 1, 0, /* -t if OBJECT is an integer. +Return t if OBJECT is an integer. */ (object)) { @@ -501,7 +470,7 @@ } DEFUN ("integer-or-marker-p", Finteger_or_marker_p, 1, 1, 0, /* -t if OBJECT is an integer or a marker (editor pointer). +Return t if OBJECT is an integer or a marker (editor pointer). */ (object)) { @@ -509,7 +478,7 @@ } DEFUN ("integer-or-char-p", Finteger_or_char_p, 1, 1, 0, /* -t if OBJECT is an integer or a character. +Return t if OBJECT is an integer or a character. */ (object)) { @@ -517,7 +486,7 @@ } DEFUN ("integer-char-or-marker-p", Finteger_char_or_marker_p, 1, 1, 0, /* -t if OBJECT is an integer, character or a marker (editor pointer). +Return t if OBJECT is an integer, character or a marker (editor pointer). */ (object)) { @@ -525,7 +494,7 @@ } DEFUN ("natnump", Fnatnump, 1, 1, 0, /* -t if OBJECT is a nonnegative integer. +Return t if OBJECT is a nonnegative integer. */ (object)) { @@ -533,7 +502,7 @@ } DEFUN ("bitp", Fbitp, 1, 1, 0, /* -t if OBJECT is a bit (0 or 1). +Return t if OBJECT is a bit (0 or 1). */ (object)) { @@ -541,7 +510,7 @@ } DEFUN ("numberp", Fnumberp, 1, 1, 0, /* -t if OBJECT is a number (floating point or integer). +Return t if OBJECT is a number (floating point or integer). */ (object)) { @@ -549,7 +518,7 @@ } DEFUN ("number-or-marker-p", Fnumber_or_marker_p, 1, 1, 0, /* -t if OBJECT is a number or a marker. +Return t if OBJECT is a number or a marker. */ (object)) { @@ -557,7 +526,7 @@ } DEFUN ("number-char-or-marker-p", Fnumber_char_or_marker_p, 1, 1, 0, /* -t if OBJECT is a number, character or a marker. +Return t if OBJECT is a number, character or a marker. */ (object)) { @@ -569,7 +538,7 @@ #ifdef LISP_FLOAT_TYPE DEFUN ("floatp", Ffloatp, 1, 1, 0, /* -t if OBJECT is a floating point number. +Return t if OBJECT is a floating point number. */ (object)) { @@ -610,7 +579,7 @@ else if (NILP (list)) return Qnil; else - list = wrong_type_argument (Qconsp, list); + list = wrong_type_argument (Qlistp, list); } } @@ -635,12 +604,12 @@ else if (NILP (list)) return Qnil; else - list = wrong_type_argument (Qconsp, list); + list = wrong_type_argument (Qlistp, list); } } DEFUN ("cdr-safe", Fcdr_safe, 1, 1, 0, /* -Return the cdr of OBJECT if it is a cons cell, or else nil. +Return the cdr of OBJECT if it is a cons cell, else nil. */ (object)) { @@ -648,7 +617,7 @@ } DEFUN ("setcar", Fsetcar, 2, 2, 0, /* -Set the car of CONSCELL to be NEWCAR. Returns NEWCAR. +Set the car of CONSCELL to be NEWCAR. Return NEWCAR. */ (conscell, newcar)) { @@ -661,7 +630,7 @@ } DEFUN ("setcdr", Fsetcdr, 2, 2, 0, /* -Set the cdr of CONSCELL to be NEWCDR. Returns NEWCDR. +Set the cdr of CONSCELL to be NEWCDR. Return NEWCDR. */ (conscell, newcdr)) { @@ -753,7 +722,7 @@ } else if (STRINGP (array)) { - if (idxval >= string_char_length (XSTRING (array))) goto lose; + if (idxval >= XSTRING_CHAR_LENGTH (array)) goto lose; return make_char (string_char (XSTRING (array), idxval)); } #ifdef LOSING_BYTECODE @@ -805,7 +774,7 @@ else /* string */ { CHECK_CHAR_COERCE_INT (newval); - if (idxval >= string_char_length (XSTRING (array))) goto lose; + if (idxval >= XSTRING_CHAR_LENGTH (array)) goto lose; set_string_char (XSTRING (array), idxval, XCHAR (newval)); bump_string_modiff (array); } @@ -1016,8 +985,8 @@ #ifdef LISP_FLOAT_TYPE if (FLOATP (num1) || FLOATP (num2)) { - double f1 = (FLOATP (num1)) ? float_data (XFLOAT (num1)) : XINT (num1); - double f2 = (FLOATP (num2)) ? float_data (XFLOAT (num2)) : XINT (num2); + double f1 = FLOATP (num1) ? float_data (XFLOAT (num1)) : XINT (num1); + double f2 = FLOATP (num2) ? float_data (XFLOAT (num2)) : XINT (num2); switch (comparison) { @@ -1046,7 +1015,7 @@ } DEFUN ("=", Feqlsign, 2, 2, 0, /* -T if two args, both numbers, characters or markers, are equal. +Return t if two args, both numbers, characters or markers, are equal. */ (num1, num2)) { @@ -1054,7 +1023,7 @@ } DEFUN ("<", Flss, 2, 2, 0, /* -T if first arg is less than second arg. +Return t if first arg is less than second arg. Both must be numbers, characters or markers. */ (num1, num2)) @@ -1063,7 +1032,7 @@ } DEFUN (">", Fgtr, 2, 2, 0, /* -T if first arg is greater than second arg. +Return t if first arg is greater than second arg. Both must be numbers, characters or markers. */ (num1, num2)) @@ -1072,7 +1041,7 @@ } DEFUN ("<=", Fleq, 2, 2, 0, /* -T if first arg is less than or equal to second arg. +Return t if first arg is less than or equal to second arg. Both must be numbers, characters or markers. */ (num1, num2)) @@ -1081,7 +1050,7 @@ } DEFUN (">=", Fgeq, 2, 2, 0, /* -T if first arg is greater than or equal to second arg. +Return t if first arg is greater than or equal to second arg. Both must be numbers, characters or markers. */ (num1, num2)) @@ -1090,7 +1059,7 @@ } DEFUN ("/=", Fneq, 2, 2, 0, /* -T if first arg is not equal to second arg. +Return t if first arg is not equal to second arg. Both must be numbers, characters or markers. */ (num1, num2)) @@ -1114,7 +1083,7 @@ } xxxDEFUN ("=", Feqlsign, 1, MANY, 0, /* -T if all the arguments are equal. +Return t if all the arguments are equal. The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) @@ -1123,7 +1092,7 @@ } xxxDEFUN ("<", Flss, 1, MANY, 0, /* -T if the sequence of arguments is monotonically increasing. +Return t if the sequence of arguments is monotonically increasing. The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) @@ -1132,7 +1101,7 @@ } xxxDEFUN (">", Fgtr, 1, MANY, 0, /* -T if the sequence of arguments is monotonically decreasing. +Return t if the sequence of arguments is monotonically decreasing. The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) @@ -1141,7 +1110,7 @@ } xxxDEFUN ("<=", Fleq, 1, MANY, 0, /* -T if the sequence of arguments is monotonically nondecreasing. +Return t if the sequence of arguments is monotonically nondecreasing. The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) @@ -1150,7 +1119,7 @@ } xxxDEFUN (">=", Fgeq, 1, MANY, 0, /* -T if the sequence of arguments is monotonically nonincreasing. +Return t if the sequence of arguments is monotonically nonincreasing. The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) @@ -1159,7 +1128,7 @@ } xxxDEFUN ("/=", Fneq, 1, MANY, 0, /* -T if the sequence of arguments is monotonically increasing. +Return t if the sequence of arguments is monotonically increasing. The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) @@ -1169,7 +1138,7 @@ #endif /* 0 - disabled for now */ DEFUN ("zerop", Fzerop, 1, 1, 0, /* -T if NUMBER is zero. +Return t if NUMBER is zero. */ (number)) { @@ -1180,7 +1149,7 @@ return float_data (XFLOAT (number)) == 0.0 ? Qt : Qnil; #endif /* LISP_FLOAT_TYPE */ - return XINT (number) == 0 ? Qt : Qnil; + return EQ (number, Qzero) ? Qt : Qnil; } /* Convert between a 32-bit value and a cons of two 16-bit values. @@ -1240,21 +1209,13 @@ static int digit_to_number (int character, int base) { - int digit; + /* Assumes ASCII */ + int digit = ((character >= '0' && character <= '9') ? character - '0' : + (character >= 'a' && character <= 'z') ? character - 'a' + 10 : + (character >= 'A' && character <= 'Z') ? character - 'A' + 10 : + -1); - if (character >= '0' && character <= '9') - digit = character - '0'; - else if (character >= 'a' && character <= 'z') - digit = character - 'a' + 10; - else if (character >= 'A' && character <= 'Z') - digit = character - 'A' + 10; - else - return -1; - - if (digit >= base) - return -1; - else - return digit; + return digit >= base ? -1 : digit; } DEFUN ("string-to-number", Fstring_to_number, 1, 2, 0, /* @@ -1297,14 +1258,13 @@ if (b == 10) { /* Use the system-provided functions for base 10. */ - Lisp_Object value; - if (sizeof (int) == sizeof (EMACS_INT)) - XSETINT (value, atoi (p)); - else if (sizeof (long) == sizeof (EMACS_INT)) - XSETINT (value, atol (p)); - else - abort (); - return value; +#if SIZEOF_EMACS_INT == SIZEOF_INT + return make_int (atoi (p)); +#elif SIZEOF_EMACS_INT == SIZEOF_LONG + return make_int (atol (p)); +#elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG + return make_int (atoll (p)); +#endif } else { @@ -1657,18 +1617,12 @@ */ (value, count)) { - Lisp_Object val; - CHECK_INT_COERCE_CHAR (value); CHECK_INT (count); - { - int C_count = XINT (count); - /* EMACS_UINT C_value = (EMACS_UINT) XUINT (value);*/ - EMACS_UINT C_value = (EMACS_UINT) XUINT (value); - XSETINT (val, C_count > 0 ? C_value << C_count : C_value >> -C_count); - } - return val; + return make_int (XINT (count) > 0 ? + XUINT (value) << XINT (count) : + XUINT (value) >> -XINT (count)); } DEFUN ("1+", Fadd1, 1, 1, 0, /* @@ -1724,15 +1678,6 @@ remove them. This is analogous to weak hashtables; see the explanation there for more info. */ -static Lisp_Object mark_weak_list (Lisp_Object, void (*) (Lisp_Object)); -static void print_weak_list (Lisp_Object, Lisp_Object, int); -static int weak_list_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long weak_list_hash (Lisp_Object obj, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, - mark_weak_list, print_weak_list, - 0, weak_list_equal, weak_list_hash, - struct weak_list); - static Lisp_Object Vall_weak_lists; /* Gemarke es nicht!!! */ static Lisp_Object encode_weak_list_type (enum weak_list_type type); @@ -1779,7 +1724,7 @@ Lisp_Object make_weak_list (enum weak_list_type type) { - Lisp_Object result = Qnil; + Lisp_Object result; struct weak_list *wl = alloc_lcrecord_type (struct weak_list, lrecord_weak_list); @@ -1791,6 +1736,10 @@ return result; } +DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, + mark_weak_list, print_weak_list, + 0, weak_list_equal, weak_list_hash, + struct weak_list); /* -- we do not mark the list elements (either the elements themselves or the cons cells that hold them) in the normal marking phase. @@ -2076,7 +2025,7 @@ } DEFUN ("make-weak-list", Fmake_weak_list, 0, 1, 0, /* -Create a new weak list. +Return a new weak list object of type TYPE. A weak list object is an object that contains a list. This list behaves like any other list except that its elements do not count towards garbage collection -- if the only pointer to an object in inside a weak @@ -2237,15 +2186,11 @@ { defsymbol (&Qcons, "cons"); defsymbol (&Qkeyword, "keyword"); - /* Qstring, Qinteger, Qsymbol, Qvector defined in general.c */ - defsymbol (&Qquote, "quote"); defsymbol (&Qlambda, "lambda"); - defsymbol (&Qsignal, "signal"); - defsymbol (&Qtop_level, "top-level"); defsymbol (&Qignore, "ignore"); - defsymbol (&Qlistp, "listp"); + defsymbol (&Qtrue_list_p, "true-list-p"); defsymbol (&Qconsp, "consp"); defsymbol (&Qsubrp, "subrp"); defsymbol (&Qsymbolp, "symbolp"); @@ -2266,17 +2211,15 @@ defsymbol (&Qinteger_or_marker_p, "integer-or-marker-p"); defsymbol (&Qinteger_or_char_p, "integer-or-char-p"); defsymbol (&Qinteger_char_or_marker_p, "integer-char-or-marker-p"); + defsymbol (&Qnumberp, "numberp"); + defsymbol (&Qnumber_or_marker_p, "number-or-marker-p"); + defsymbol (&Qnumber_char_or_marker_p, "number-char-or-marker-p"); + defsymbol (&Qcdr, "cdr"); + defsymbol (&Qweak_listp, "weak-list-p"); #ifdef LISP_FLOAT_TYPE defsymbol (&Qfloatp, "floatp"); #endif /* LISP_FLOAT_TYPE */ - defsymbol (&Qnumberp, "numberp"); - defsymbol (&Qnumber_or_marker_p, "number-or-marker-p"); - defsymbol (&Qnumber_char_or_marker_p, "number-char-or-marker-p"); - - defsymbol (&Qcdr, "cdr"); - - defsymbol (&Qweak_listp, "weak-list-p"); DEFSUBR (Fwrong_type_argument); @@ -2285,6 +2228,7 @@ DEFSUBR (Fnull); DEFSUBR (Flistp); DEFSUBR (Fnlistp); + DEFSUBR (Ftrue_list_p); DEFSUBR (Fconsp); DEFSUBR (Fatom); DEFSUBR (Fchar_or_string_p);
--- a/src/database.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/database.c Mon Aug 13 10:28:48 2007 +0200 @@ -26,11 +26,12 @@ #include <config.h> #include "lisp.h" +#include "sysfile.h" #include <errno.h> #ifndef HAVE_DATABASE -#error database.c being compiled, but HAVE_DATABASE not defined! -#endif /* HAVE_DATABASE */ +#error HAVE_DATABASE not defined!! +#endif #include "database.h" /* Our include file */ @@ -56,9 +57,7 @@ # define DB_VERSION_MAJOR 1 #endif /* DB_VERSION_MAJOR */ Lisp_Object Qberkeley_db; -Lisp_Object Qhash; -Lisp_Object Qbtree; -Lisp_Object Qrecno; +Lisp_Object Qhash, Qbtree, Qrecno, Qunknown; #endif /* HAVE_BERKELEY_DB */ #ifdef HAVE_DBM @@ -70,23 +69,21 @@ typedef enum { DB_DBM, DB_BERKELEY, DB_IS_UNKNOWN } XEMACS_DB_TYPE; -struct database; -typedef struct database database; +struct Lisp_Database; typedef struct { - CONST char * (*get_subtype) (struct database *); - CONST char * (*get_type) (struct database *); - Lisp_Object (*get) (struct database *, Lisp_Object); - int (*put) (struct database *, Lisp_Object, Lisp_Object, Lisp_Object); - int (*rem) (struct database *, Lisp_Object); - void (*map) (struct database *, Lisp_Object); - Lisp_Object (*get_lisp_type) (struct database *); - void (*close) (struct database *); - Lisp_Object (*last_error) (struct database *); + Lisp_Object (*get_subtype) (struct Lisp_Database *); + Lisp_Object (*get_type) (struct Lisp_Database *); + Lisp_Object (*get) (struct Lisp_Database *, Lisp_Object); + int (*put) (struct Lisp_Database *, Lisp_Object, Lisp_Object, Lisp_Object); + int (*rem) (struct Lisp_Database *, Lisp_Object); + void (*map) (struct Lisp_Database *, Lisp_Object); + void (*close) (struct Lisp_Database *); + Lisp_Object (*last_error) (struct Lisp_Database *); } DB_FUNCS; -struct database +struct Lisp_Database { struct lcrecord_header header; Lisp_Object fname; @@ -107,58 +104,51 @@ #endif }; -#define XDATABASE(x) XRECORD (x, database, struct database) +#define XDATABASE(x) XRECORD (x, database, struct Lisp_Database) #define XSETDATABASE(x, p) XSETRECORD (x, p, database) #define DATABASEP(x) RECORDP (x, database) #define GC_DATABASEP(x) GC_RECORDP (x, database) #define CHECK_DATABASE(x) CHECK_RECORD (x, database) #define CONCHECK_DATABASE(x) CONCHECK_RECORD (x, database) #define DATABASE_LIVE_P(x) (x->live_p) -static Lisp_Object mark_database (Lisp_Object, void (*) (Lisp_Object)); -static void print_database (Lisp_Object, Lisp_Object, int); -static void finalize_database (void *, int); -DEFINE_LRECORD_IMPLEMENTATION ("database", database, - mark_database, print_database, - finalize_database, 0, 0, - struct database); #define CHECK_LIVE_DATABASE(db) do { \ - CHECK_DATABASE(db); \ + CHECK_DATABASE (db); \ if (!DATABASE_LIVE_P (XDATABASE(db))) \ signal_simple_error ("Attempting to access closed database", db); \ } while (0) -static struct database * +static struct Lisp_Database * allocate_database (void) { - struct database *dbase = - alloc_lcrecord_type (struct database, lrecord_database); + struct Lisp_Database *db = + alloc_lcrecord_type (struct Lisp_Database, lrecord_database); - dbase->fname = Qnil; - dbase->live_p = 0; + db->fname = Qnil; + db->live_p = 0; #ifdef HAVE_BERKELEY_DB - dbase->db_handle = NULL; + db->db_handle = NULL; #endif #ifdef HAVE_DBM - dbase->dbm_handle = NULL; + db->dbm_handle = NULL; #endif - dbase->access_ = 0; - dbase->mode = 0; - dbase->dberrno = 0; - dbase->type = DB_IS_UNKNOWN; + db->access_ = 0; + db->mode = 0; + db->dberrno = 0; + db->type = DB_IS_UNKNOWN; #ifdef MULE - dbase->coding_system = Fget_coding_system (Qbinary); + db->coding_system = Fget_coding_system (Qbinary); #endif - return dbase; + return db; } static Lisp_Object mark_database (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - struct database *dbase = XDATABASE (obj); + struct Lisp_Database *db = XDATABASE (obj); - ((markobj) (dbase->fname)); + ((markobj) (db->fname)); return Qnil; } @@ -166,27 +156,27 @@ print_database (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { char buf[64]; - struct database *dbase = XDATABASE (obj); + struct Lisp_Database *db = XDATABASE (obj); if (print_readably) - error ("printing unreadable object #<database 0x%x>", dbase->header.uid); + error ("printing unreadable object #<database 0x%x>", db->header.uid); write_c_string ("#<database \"", printcharfun); - print_internal (dbase->fname, printcharfun, 0); + print_internal (db->fname, printcharfun, 0); sprintf (buf, "\" (%s/%s/%s) 0x%x>", - dbase->funcs->get_type (dbase), - dbase->funcs->get_subtype (dbase), - (!DATABASE_LIVE_P (dbase) ? "closed" : - (dbase->access_ & O_WRONLY) ? "writeonly" : - (dbase->access_ & O_RDWR) ? "readwrite" : "readonly"), - dbase->header.uid); + (char *) string_data (XSYMBOL (db->funcs->get_type (db))->name), + (char *) string_data (XSYMBOL (db->funcs->get_subtype (db))->name), + (!DATABASE_LIVE_P (db) ? "closed" : + (db->access_ & O_WRONLY) ? "writeonly" : + (db->access_ & O_RDWR) ? "readwrite" : "readonly"), + db->header.uid); write_c_string (buf, printcharfun); } static void finalize_database (void *header, int for_disksave) { - struct database *db = (struct database *) header; + struct Lisp_Database *db = (struct Lisp_Database *) header; if (for_disksave) { @@ -194,64 +184,69 @@ XSETOBJ (obj, Lisp_Type_Record, (void *) db); signal_simple_error - ("Can't dump an emacs containing window system objects", obj); + ("Can't dump an emacs containing database objects", obj); } db->funcs->close (db); } +DEFINE_LRECORD_IMPLEMENTATION ("database", database, + mark_database, print_database, + finalize_database, 0, 0, + struct Lisp_Database); + DEFUN ("close-database", Fclose_database, 1, 1, 0, /* -Close database OBJ. +Close database DATABASE. */ - (obj)) + (database)) { - CHECK_LIVE_DATABASE (obj); - XDATABASE (obj)->funcs->close (XDATABASE (obj)); - XDATABASE (obj)->live_p = 0; + struct Lisp_Database *db; + CHECK_LIVE_DATABASE (database); + db = XDATABASE (database); + db->funcs->close (db); + db->live_p = 0; return Qnil; } DEFUN ("database-type", Fdatabase_type, 1, 1, 0, /* -Return the type of database OBJ. +Return the type of database DATABASE. */ - (obj)) + (database)) { - CHECK_DATABASE (obj); + CHECK_DATABASE (database); - return XDATABASE (obj)->funcs->get_lisp_type (XDATABASE (obj)); + return XDATABASE (database)->funcs->get_type (XDATABASE (database)); } DEFUN ("database-subtype", Fdatabase_subtype, 1, 1, 0, /* -Return the subtype of database OBJ, if any. +Return the subtype of database DATABASE, if any. */ - (obj)) + (database)) { - CHECK_DATABASE (obj); + CHECK_DATABASE (database); - return intern (XDATABASE (obj)->funcs->get_subtype (XDATABASE (obj))); + return XDATABASE (database)->funcs->get_subtype (XDATABASE (database)); } DEFUN ("database-live-p", Fdatabase_live_p, 1, 1, 0, /* -Return t iff OBJ is an active database, else nil. +Return t if OBJ is an active database. */ (obj)) { - CHECK_DATABASE (obj); - - return DATABASE_LIVE_P (XDATABASE (obj)) ? Qt : Qnil; + return DATABASEP (obj) && DATABASE_LIVE_P (XDATABASE (obj)) ? Qt : Qnil; } DEFUN ("database-file-name", Fdatabase_file_name, 1, 1, 0, /* -Return the filename associated with the database OBJ. +Return the filename associated with the database DATABASE. */ - (obj)) + (database)) { - CHECK_DATABASE (obj); + CHECK_DATABASE (database); - return XDATABASE (obj)->fname; + return XDATABASE (database)->fname; } DEFUN ("databasep", Fdatabasep, 1, 1, 0, /* -Return t iff OBJ is a database, else nil. +Return t if OBJ is a database. */ (obj)) { @@ -260,7 +255,7 @@ #ifdef HAVE_DBM static void -dbm_map (struct database *db, Lisp_Object func) +dbm_map (struct Lisp_Database *db, Lisp_Object func) { datum keydatum, valdatum; Lisp_Object key, val; @@ -277,7 +272,7 @@ } static Lisp_Object -dbm_get (struct database *db, Lisp_Object key) +dbm_get (struct Lisp_Database *db, Lisp_Object key) { datum keydatum, valdatum; @@ -291,7 +286,7 @@ } static int -dbm_put (struct database *db, +dbm_put (struct Lisp_Database *db, Lisp_Object key, Lisp_Object val, Lisp_Object replace) { datum keydatum, valdatum; @@ -306,7 +301,7 @@ } static int -dbm_remove (struct database *db, Lisp_Object key) +dbm_remove (struct Lisp_Database *db, Lisp_Object key) { datum keydatum; @@ -317,31 +312,25 @@ } static Lisp_Object -dbm_lisp_type (struct database *db) +dbm_type (struct Lisp_Database *db) { return Qdbm; } -static CONST char * -dbm_type (struct database *db) +static Lisp_Object +dbm_subtype (struct Lisp_Database *db) { - return "dbm"; -} - -static CONST char * -dbm_subtype (struct database *db) -{ - return "nil"; + return Qnil; } static Lisp_Object -dbm_lasterr (struct database *dbp) +dbm_lasterr (struct Lisp_Database *db) { - return lisp_strerror (dbp->dberrno); + return lisp_strerror (db->dberrno); } static void -dbm_closeit (struct database *db) +dbm_closeit (struct Lisp_Database *db) { if (db->dbm_handle) { @@ -358,7 +347,6 @@ dbm_put, dbm_remove, dbm_map, - dbm_lisp_type, dbm_closeit, dbm_lasterr }; @@ -366,40 +354,34 @@ #ifdef HAVE_BERKELEY_DB static Lisp_Object -berkdb_lisp_type (struct database *db) +berkdb_type (struct Lisp_Database *db) { return Qberkeley_db; } -static CONST char * -berkdb_type (struct database *db) -{ - return "berkeley"; -} - -static CONST char * -berkdb_subtype (struct database *db) +static Lisp_Object +berkdb_subtype (struct Lisp_Database *db) { if (!db->db_handle) - return "nil"; + return Qnil; switch (db->db_handle->type) { - case DB_BTREE: return "btree"; - case DB_HASH: return "hash"; - case DB_RECNO: return "recno"; - default: return "unknown"; + case DB_BTREE: return Qbtree; + case DB_HASH: return Qhash; + case DB_RECNO: return Qrecno; + default: return Qunknown; } } static Lisp_Object -berkdb_lasterr (struct database *dbp) +berkdb_lasterr (struct Lisp_Database *db) { - return lisp_strerror (dbp->dberrno); + return lisp_strerror (db->dberrno); } static Lisp_Object -berkdb_get (struct database *db, Lisp_Object key) +berkdb_get (struct Lisp_Database *db, Lisp_Object key) { /* #### Needs mule-izing */ DBT keydatum, valdatum; @@ -407,8 +389,8 @@ #if DB_VERSION_MAJOR == 2 /* Always initialize keydatum, valdatum. */ - memset(&keydatum, 0, sizeof(keydatum)); - memset(&valdatum, 0, sizeof(valdatum)); + xzero (keydatum); + xzero (valdatum); #endif /* DV_VERSION_MAJOR = 2 */ keydatum.data = XSTRING_DATA (key); @@ -433,7 +415,7 @@ } static int -berkdb_put (struct database *db, +berkdb_put (struct Lisp_Database *db, Lisp_Object key, Lisp_Object val, Lisp_Object replace) @@ -443,8 +425,8 @@ #if DB_VERSION_MAJOR == 2 /* Always initalize keydatum, valdatum. */ - memset(&keydatum, 0, sizeof(keydatum)); - memset(&valdatum, 0, sizeof(valdatum)); + xzero (keydatum); + xzero (valdatum); #endif /* DV_VERSION_MAJOR = 2 */ keydatum.data = XSTRING_DATA (key); @@ -465,14 +447,14 @@ } static int -berkdb_remove (struct database *db, Lisp_Object key) +berkdb_remove (struct Lisp_Database *db, Lisp_Object key) { DBT keydatum; int status; #if DB_VERSION_MAJOR == 2 /* Always initialize keydatum. */ - memset(&keydatum, 0, sizeof(keydatum)); + xzero (keydatum); #endif /* DV_VERSION_MAJOR = 2 */ keydatum.data = XSTRING_DATA (key); @@ -497,7 +479,7 @@ } static void -berkdb_map (struct database *db, Lisp_Object func) +berkdb_map (struct Lisp_Database *db, Lisp_Object func) { DBT keydatum, valdatum; Lisp_Object key, val; @@ -517,8 +499,8 @@ #else DBC *dbcp; /* Initialize the key/data pair so the flags aren't set. */ - memset(&keydatum, 0, sizeof(keydatum)); - memset(&valdatum, 0, sizeof(valdatum)); + xzero (keydatum); + xzero (valdatum); status = dbp->cursor (dbp, NULL, &dbcp); for (status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_FIRST); @@ -535,7 +517,7 @@ } static void -berkdb_close (struct database *db) +berkdb_close (struct Lisp_Database *db) { if (db->db_handle) { @@ -558,37 +540,38 @@ berkdb_put, berkdb_remove, berkdb_map, - berkdb_lisp_type, berkdb_close, berkdb_lasterr }; #endif /* HAVE_BERKELEY_DB */ DEFUN ("database-last-error", Fdatabase_last_error, 0, 1, 0, /* -Return the last error associated with database OBJ. +Return the last error associated with DATABASE. */ - (obj)) + (database)) { - if (NILP (obj)) + if (NILP (database)) return lisp_strerror (errno); - CHECK_DATABASE (obj); + CHECK_DATABASE (database); - return XDATABASE (obj)->funcs->last_error (XDATABASE (obj)); + return XDATABASE (database)->funcs->last_error (XDATABASE (database)); } DEFUN ("open-database", Fopen_database, 1, 5, 0, /* -Open database FILE, using database method TYPE and SUBTYPE, with -access rights ACCESS and permissions MODE. ACCESS can be any +Return a new database object opened on FILE. +Optional arguments TYPE and SUBTYPE specify the database type. +Optional argument ACCESS specifies the access rights, which may be any combination of 'r' 'w' and '+', for read, write, and creation flags. +Optional argument MODE gives the permissions to use when opening FILE, +and defaults to 0755. */ (file, type, subtype, access_, mode)) { /* This function can GC */ - Lisp_Object retval = Qnil; int modemask; int accessmask = 0; - struct database *dbase = NULL; + struct Lisp_Database *db = NULL; char *filename; struct gcpro gcpro1, gcpro2; @@ -611,12 +594,13 @@ if (strchr (acc, '+')) accessmask |= O_CREAT; - if (strchr (acc, 'r') && strchr (acc, 'w')) - accessmask |= O_RDWR; - else if (strchr (acc, 'w')) - accessmask |= O_WRONLY; - else - accessmask |= O_RDONLY; + { + char *rp = strchr (acc, 'r'); + char *wp = strchr (acc, 'w'); + if (rp && wp) accessmask |= O_RDWR; + else if (wp) accessmask |= O_WRONLY; + else accessmask |= O_RDONLY; + } } if (NILP (mode)) @@ -632,14 +616,14 @@ #ifdef HAVE_DBM if (NILP (type) || EQ (type, Qdbm)) { - DBM *dbm = dbm_open (filename, accessmask, modemask); - if (!dbm) + DBM *dbase = dbm_open (filename, accessmask, modemask); + if (!dbase) return Qnil; - dbase = allocate_database (); - dbase->dbm_handle = dbm; - dbase->type = DB_DBM; - dbase->funcs = &ndbm_func_block; + db = allocate_database (); + db->dbm_handle = dbase; + db->type = DB_DBM; + db->funcs = &ndbm_func_block; goto db_done; } #endif /* HAVE_DBM */ @@ -648,7 +632,7 @@ if (NILP (type) || EQ (type, Qberkeley_db)) { DBTYPE real_subtype; - DB *db; + DB *dbase; #if DB_VERSION_MAJOR != 1 int status; #endif @@ -663,38 +647,37 @@ signal_simple_error ("Unsupported subtype", subtype); #if DB_VERSION_MAJOR == 1 - db = dbopen (filename, accessmask, modemask, real_subtype, NULL); - if (!db) + dbase = dbopen (filename, accessmask, modemask, real_subtype, NULL); + if (!dbase) return Qnil; #else /* Berkeley DB Version 2 has only the accessmask DB_CREATE and DB_RDONLY, other flags shouldn't be set */ if (NILP (access_)) - { - accessmask = DB_CREATE; - } + accessmask = DB_CREATE; else { char *acc; CHECK_STRING (access_); acc = (char *) XSTRING_DATA (access_); accessmask = 0; - + if (strchr (acc, '+')) accessmask |= DB_CREATE; if (strchr (acc, 'r') && !strchr (acc, 'w')) accessmask |= DB_RDONLY; } - status = db_open (filename, real_subtype, accessmask, modemask, NULL , NULL, &db); + status = db_open (filename, real_subtype, accessmask, + modemask, NULL , NULL, &dbase); if (status) return Qnil; #endif /* DB_VERSION_MAJOR */ - - dbase = allocate_database (); - dbase->db_handle = db; - dbase->type = DB_BERKELEY; - dbase->funcs = &berk_func_block; + + db = allocate_database (); + db->db_handle = dbase; + db->type = DB_BERKELEY; + db->funcs = &berk_func_block; goto db_done; } #endif /* HAVE_BERKELEY_DB */ @@ -703,28 +686,31 @@ return Qnil; db_done: - dbase->live_p = 1; - dbase->fname = file; - dbase->mode = modemask; - dbase->access_ = accessmask; - XSETDATABASE (retval, dbase); + db->live_p = 1; + db->fname = file; + db->mode = modemask; + db->access_ = accessmask; - return retval; + { + Lisp_Object retval; + XSETDATABASE (retval, db); + return retval; + } } DEFUN ("put-database", Fput_database, 3, 4, 0, /* -Store KEY and VAL in DATABASE. If optional fourth arg REPLACE is -non-nil, replace any existing entry in the database. +Store KEY and VALUE in DATABASE. +If optional fourth arg REPLACE is non-nil, +replace any existing entry in the database. */ - (key, val, dbase, replace)) + (key, value, database, replace)) { - CHECK_LIVE_DATABASE (dbase); + CHECK_LIVE_DATABASE (database); CHECK_STRING (key); - CHECK_STRING (val); - + CHECK_STRING (value); { - int status = - XDATABASE (dbase)->funcs->put (XDATABASE (dbase), key, val, replace); + struct Lisp_Database *db = XDATABASE (database); + int status = db->funcs->put (db, key, value, replace); return status ? Qt : Qnil; } } @@ -732,27 +718,28 @@ DEFUN ("remove-database", Fremove_database, 2, 2, 0, /* Remove KEY from DATABASE. */ - (key, dbase)) + (key, database)) { - CHECK_LIVE_DATABASE (dbase); + CHECK_LIVE_DATABASE (database); CHECK_STRING (key); - - return XDATABASE (dbase)->funcs->rem (XDATABASE (dbase), key) ? Qt : Qnil; + { + struct Lisp_Database *db = XDATABASE (database); + int status = db->funcs->rem (db, key); + return status ? Qt : Qnil; + } } DEFUN ("get-database", Fget_database, 2, 3, 0, /* -Find value for KEY in DATABASE. +Return value for KEY in DATABASE. If there is no corresponding value, return DEFAULT (defaults to nil). */ - (key, dbase, default_)) + (key, database, default_)) { - - CHECK_LIVE_DATABASE (dbase); + CHECK_LIVE_DATABASE (database); CHECK_STRING (key); - { - Lisp_Object retval = - XDATABASE (dbase)->funcs->get (XDATABASE (dbase), key); + struct Lisp_Database *db = XDATABASE (database); + Lisp_Object retval = db->funcs->get (db, key); return NILP (retval) ? default_ : retval; } } @@ -761,17 +748,17 @@ Map FUNCTION over entries in DATABASE, calling it with two args, each key and value in the database. */ - (function, dbase)) + (function, database)) { - CHECK_LIVE_DATABASE (dbase); + CHECK_LIVE_DATABASE (database); - XDATABASE (dbase)->funcs->map (XDATABASE (dbase), function); + XDATABASE (database)->funcs->map (XDATABASE (database), function); return Qnil; } void -syms_of_dbm (void) +syms_of_database (void) { defsymbol (&Qdatabasep, "databasep"); #ifdef HAVE_DBM @@ -782,6 +769,7 @@ defsymbol (&Qhash, "hash"); defsymbol (&Qbtree, "btree"); defsymbol (&Qrecno, "recno"); + defsymbol (&Qunknown, "unknown"); #endif DEFSUBR (Fopen_database); @@ -799,7 +787,7 @@ } void -vars_of_dbm (void) +vars_of_database (void) { #ifdef HAVE_DBM Fprovide (Qdbm);
--- a/src/database.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/database.h Mon Aug 13 10:28:48 2007 +0200 @@ -1,6 +1,29 @@ -#ifndef _XEMACS_DBM_H -#define _XEMACS_DBM_H +/* Header file for database functions + Copyright (C) 1995 Sun Microsystems, Inc. + +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. -DECLARE_LRECORD (database, struct database); +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. */ + +/* This file is only necessary to get INLINE handling correct. + See inline.c */ + +#ifndef _XEMACS_DATABASE_H +#define _XEMACS_DATABASE_H + +DECLARE_LRECORD (database, struct Lisp_Database); #endif
--- a/src/dbxrc Mon Aug 13 10:27:41 2007 +0200 +++ b/src/dbxrc Mon Aug 13 10:28:48 2007 +0200 @@ -1,102 +1,298 @@ # -*- ksh -*- +# Copyright (C) 1998 Free Software Foundation, Inc. + +# 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. + +# Author: Martin Buchholz + # You can use this file to debug XEmacs using Sun WorkShop's dbx. # Add the contents of this file to $HOME/.dbxrc or # Source the contents of this file with something like: # test -r ./dbxrc && . ./dbxrc +# Some functions defined here require a running process, but most +# don't. Considerable effort has been expended to this end. + +# See also the comments in gdbinit. + +# See also the question of the XEmacs FAQ, titled +# "How to Debug an XEmacs problem with a debugger". + ignore POLL ignore IO +document lbt << 'end' +Usage: lbt +Print the current Lisp stack trace. +Requires a running xemacs process. +end + function lbt { - call Fbacktrace (Qexternal_debugging_output, Qt) + call debug_backtrace() } -function dp { +document ldp << 'end' +Usage: ldp lisp_object +Print a Lisp Object value using the Lisp printer. +Requires a running xemacs process. +end + +function ldp { call debug_print ($1); } -function xptr { - print ("$1"<<4) & 0xFFFFFFF) +# A bug in dbx prevents string variables from having values beginning with `-'!! +function XEmacsInit { + eval $(echo $(whatis -t `alloc.c`dbg_constants) | \ + perl -e 'print "@{[map {s/=(-\d+)/sprintf(q[=0x%x],$1)/oge; /\w+=[0-9a-fx]+/og} <>]}\n"') + xemacs_initted=yes + #printvar dbg_valbits dbg_valmask +} + +function printvar { + for i in $*; do eval "echo $i=\$$i"; done +} + +document decode_object << 'end' +Usage: decode_object lisp_object +Extract implementation information from a Lisp Object. +Defines variables $val, $type and $imp. +end + +# Various dbx bugs cause ugliness in following code +function decode_object { + test -z "$xemacs_initted" && XEmacsInit + obj=$[*(void**)(&$1)] + test "$obj" = "(nil)" && obj="0x0" + if test $dbg_USE_MINIMAL_TAGBITS = 1; then + if test $[(int)($obj & 1)] = 1; then + # It's an int + val=$[(long)(((unsigned long long)$obj) >> 1)] + type=$dbg_Lisp_Type_Int + else + type=$[(int)(((void*)$obj) & $dbg_typemask)] + if test $type = $dbg_Lisp_Type_Char; then + val=$[(void*)(long)(((unsigned long long)($obj & $dbg_valmask)) >> $dbg_gctypebits)] + else + # It's a record pointer + val=$[(void*)$obj] + fi + fi + else + # not dbg_USE_MINIMAL_TAGBITS + val=$[(void*)($obj & $dbg_valmask)] + test "$val" = "(nil)" && val="0x0" + type=$[(int)(((unsigned long long)($obj & $dbg_typemask)) >> ($dbg_valbits + 1))] + fi + + if test $type = $dbg_Lisp_Type_Record; then + typeset lheader="((struct lrecord_header *) $val)" + if test $dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1; then + imp=$[(void*)(lrecord_implementations_table[$lheader->type])] + else + imp=$[(void*)($lheader->implementation)] + fi + else + imp="0xdeadbeef" + fi + #printvar obj val type imp } function xint { - print ((int)($1 << 4))>>4; + decode_object "$*" + print (long) ($val) +} + +function xtype { + decode_object "$*" + if test $type = $dbg_Lisp_Type_Int; then echo "int" + elif test $type = $dbg_Lisp_Type_Char; then echo "char" + elif test $type = $dbg_Lisp_Type_Symbol; then echo "symbol" + elif test $type = $dbg_Lisp_Type_String; then echo "string" + elif test $type = $dbg_Lisp_Type_Vector; then echo "vector" + elif test $type = $dbg_Lisp_Type_Cons; then echo "cons" + else + echo "record type with name: $[((struct lrecord_implementation *)$imp)->name]" + fi } -#function xstring { -# print *(struct Lisp_String *) ($1 & 0xFFFFFFF); -# #print ((struct Lisp_String *) ($1 & 0xFFFFFFF))->_data; -#} +document run-temacs << 'end' +Usage: run-temacs +Run temacs interactively, like xemacs. +Use this with debugging tools (like purify) that cannot deal with dumping, +or when temacs builds successfully, but xemacs does not. +end -function xlisp { - print $1 ($2 & 0xFFFFFFF); - #print ((struct Lisp_String *) ($1 & 0xFFFFFFF))->_data; +function run-temacs { + run -batch -l loadup.el run-temacs -q } -function defxlisp { - eval "function $1 { print $2 (\$1 & 0xFFFFFFF) ; }" +document update-elc << 'end' +Usage: update-elc +Run the elc compilation part of the build procedure. +Use when debugging temacs, not xemacs! +Use this when temacs builds successfully, but xemacs does not. +end + +function update-elc { + export EMACSLOADPATH=../lisp/ + run -batch -l update-elc.el } -function defxstruct { - defxlisp "$1" "*(struct $2 *)" +function pstruct { + xstruct="((struct $1 *) $val)" + print $xstruct + print *$xstruct +} + +function lrecord_type_p { + if eval test -z \"\$lrecord_$1\" && test $imp = $[(void*)(&lrecord_$1)]; then return 0; else return 1; fi } -defxstruct xstring 'Lisp_String' -defxstruct xlstream 'lstream' -defxstruct xsubr 'Lisp_Subr' -defxstruct xbitvec 'Lisp_Bit_Vector' -defxstruct xbuffer 'buffer' -defxstruct xbytecode 'Lisp_Bytecode' -defxstruct xcharset 'Lisp_Charset' -defxstruct xchartab 'Lisp_Char_Table' -defxstruct xchartabentry 'Lisp_Char_Table_Entry' -defxstruct xcodesys 'Lisp_Coding_System' -defxstruct xcolorinst 'Lisp_Color_Instance' -defxstruct xcons 'Lisp_Cons' -defxstruct xdevice 'device' -defxstruct xevent 'Lisp_Event' -defxstruct xextent 'extent' -defxstruct xextentaux 'extent_auxilliary' -defxstruct xfloat 'Lisp_Float' -defxstruct xfontinst 'Lisp_Font_Instance' -defxstruct xframe 'frame' -defxstruct xglyph 'Lisp_Glyph' -defxstruct xhashtable 'hashtable_struct' -defxstruct ximageinst 'Lisp_Image_Instance' -defxstruct xkeymap 'keymap' -defxstruct xmarker 'Lisp_Marker' -defxstruct xmenubardata 'menubar_data' -defxstruct xopaque 'Lisp_Opaque' -defxstruct xprocess 'Lisp_Process' -defxstruct xrangetab 'Lisp_Range_Table' -defxstruct xspec 'Lisp_Specifier' -defxstruct xsubwindow 'Lisp_Subwindow' -defxstruct xsymbol 'Lisp_Symbol' -defxstruct xtoolbarbutton 'toolbar_button' -defxstruct xtoolbardata 'toolbar_data' -defxstruct xtooltalkmess 'Lisp_Tooltalk_Message' -defxstruct xtooltalkpatt 'Lisp_Tooltalk_Pattern' -defxstruct xvector 'Lisp_Vector' -defxstruct xwindow 'window' -defxstruct xwindowconfig 'window_config' +document pobj << 'end' +Usage: pobj lisp_object +Print the internal C structure of a underlying Lisp Object. +end + +function pobj { + decode_object $1 + if test $type = $dbg_Lisp_Type_Int; then + print -f"Integer: %d" $val + elif test $type = $dbg_Lisp_Type_Char; then + if $val < 128; then + print -f"Char: %c" $val + else + print -f"Char: %d" $val + fi + elif test $type = $dbg_Lisp_Type_String || lrecord_type_p string; then + pstruct Lisp_String + elif test $type = $dbg_Lisp_Type_Cons || lrecord_type_p cons; then + pstruct Lisp_Cons + elif test $type = $dbg_Lisp_Type_Symbol || lrecord_type_p symbol; then + pstruct Lisp_Symbol + echo "Symbol name: $[(char *)($xstruct->name->_data)]" + elif test $type = $dbg_Lisp_Type_Vector || lrecord_type_p vector; then + pstruct Lisp_Vector + echo "Vector of length $[$xstruct->size]" + elif lrecord_type_p bit_vector; then + pstruct Lisp_Bit_Vector + elif lrecord_type_p buffer; then + pstruct buffer + elif lrecord_type_p char_table; then + pstruct Lisp_Char_Table + elif lrecord_type_p char_table_entry; then + pstruct Lisp_Char_Table_Entry + elif lrecord_type_p charset; then + pstruct Lisp_Charset + elif lrecord_type_p coding_system; then + pstruct Lisp_Coding_System + elif lrecord_type_p color_instance; then + pstruct Lisp_Color_Instance + elif lrecord_type_p command_builder; then + pstruct command_builder + elif lrecord_type_p compiled_function; then + pstruct Lisp_Compiled_Function + elif lrecord_type_p console; then + pstruct console + elif lrecord_type_p database; then + pstruct database + elif lrecord_type_p device; then + pstruct device + elif lrecord_type_p event; then + pstruct Lisp_Event + elif lrecord_type_p extent; then + pstruct extent + elif lrecord_type_p extent_auxiliary; then + pstruct extent_auxiliary + elif lrecord_type_p extent_info; then + pstruct extent_info + elif lrecord_type_p face; then + pstruct Lisp_Face + elif lrecord_type_p float; then + pstruct Lisp_Float + elif lrecord_type_p font_instance; then + pstruct Lisp_Font_Instance + elif lrecord_type_p frame; then + pstruct frame + elif lrecord_type_p glyph; then + pstruct Lisp_Glyph + elif lrecord_type_p hashtable; then + pstruct hashtable + elif lrecord_type_p image_instance; then + pstruct Lisp_Image_Instance + elif lrecord_type_p keymap; then + pstruct keymap + elif lrecord_type_p lcrecord_list; then + pstruct lcrecord_list + elif lrecord_type_p lstream; then + pstruct lstream + elif lrecord_type_p marker; then + pstruct Lisp_Marker + elif lrecord_type_p opaque; then + pstruct Lisp_Opaque + elif lrecord_type_p opaque_list; then + pstruct Lisp_Opaque_List + elif lrecord_type_p popup_data; then + pstruct popup_data + elif lrecord_type_p process; then + pstruct Lisp_Process + elif lrecord_type_p range_table; then + pstruct Lisp_Range_Table + elif lrecord_type_p specifier; then + pstruct Lisp_Specifier + elif lrecord_type_p subr; then + pstruct Lisp_Subr + elif lrecord_type_p symbol_value_buffer_local; then + pstruct symbol_value_buffer_local + elif lrecord_type_p symbol_value_forward; then + pstruct symbol_value_forward + elif lrecord_type_p symbol_value_lisp_magic; then + pstruct symbol_value_lisp_magic + elif lrecord_type_p symbol_value_varalias; then + pstruct symbol_value_varalias + elif lrecord_type_p toolbar_button; then + pstruct toolbar_button + elif lrecord_type_p toolbar_data; then + pstruct toolbar_data + elif lrecord_type_p tooltalk_message; then + pstruct Lisp_Tooltalk_Message + elif lrecord_type_p tooltalk_pattern; then + pstruct Lisp_Tooltalk_Pattern + elif lrecord_type_p weak_list; then + pstruct weak_list + elif lrecord_type_p window; then + pstruct window + elif lrecord_type_p window_configuration; then + pstruct window_config + else + echo "Unknown Lisp Object type" + print $1 + fi +} function pproc { print *(`process.c`struct Lisp_Process*)$1 ; - dp "(`process.c`struct Lisp_Process*)$1->name" ; - dp "(`process.c`struct Lisp_Process*)$1->command" ; -} - -function xtype { - print (enum Lisp_Type) (($1 >> 28) & 7) + ldp "(`process.c`struct Lisp_Process*)$1->name" ; + ldp "(`process.c`struct Lisp_Process*)$1->command" ; } dbxenv suppress_startup_message 4.0 -function dp_args { - dp "*(((Lisp_Object*)($1))+0)" - dp "*(((Lisp_Object*)($1))+1)" -} - function dp_core { print ((struct x_frame *)(((struct frame*)(Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget->core }
--- a/src/debug.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/debug.c Mon Aug 13 10:28:48 2007 +0200 @@ -42,8 +42,6 @@ Lisp_Object Qredisplay, Qbuffers, Qfaces; Lisp_Object Qwindows, Qframes, Qdevices; -/* Lisp_Object Qbyte_code; in bytecode.c */ - struct debug_classes active_debug_classes; enum debug_loop @@ -218,4 +216,3 @@ to emacs.c. */ xemacs_debug_loop (INIT, Qnil, Qnil); } -
--- a/src/debug.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/debug.h Mon Aug 13 10:28:48 2007 +0200 @@ -53,8 +53,8 @@ unsigned int types_of_byte_code; }; -extern Lisp_Object Qredisplay, Qbuffers, Qextents, Qfaces; -extern Lisp_Object Qwindows, Qframes, Qdevices, Qbyte_code; +extern Lisp_Object Qbuffers, Qdevices, Qfaces, Qframes, Qredisplay, Qwindows; + extern struct debug_classes active_debug_classes; #define DASSERT(class, desired_type, action, assertion) do \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/depend Mon Aug 13 10:28:48 2007 +0200 @@ -0,0 +1,200 @@ +## This file automatically generated by make-src-depend. Do not modify. + +LISP_H = lisp.h config.h lrecord.h lisp-disunion.h lisp-union.h symsinit.h symeval.h +#ifdef HAVE_MS_WINDOWS +console-msw.o: $(LISP_H) conslots.h console-msw.h console.h events.h opaque.h systime.h +device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h mule-charset.h scrollbar.h specifier.h sysdep.h systime.h toolbar.h +dired-msw.o: $(LISP_H) buffer.h bufslots.h msdos.h mule-charset.h ndir.h nt.h regex.h sysdir.h sysfile.h +event-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events-mod.h events.h frame.h frameslots.h menubar-msw.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysproc.h systime.h syswait.h toolbar.h +frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h events.h faces.h frame.h frameslots.h mule-charset.h scrollbar.h specifier.h systime.h toolbar.h +glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h imgproc.h insdel.h lstream.h msdos.h mule-charset.h nt.h objects-msw.h objects.h opaque.h scrollbar.h specifier.h sysfile.h toolbar.h +menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h gui.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h +objects-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h insdel.h mule-charset.h objects-msw.h objects.h specifier.h +redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h toolbar.h window.h +scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h systime.h toolbar.h window.h +select-msw.o: $(LISP_H) conslots.h console-msw.h console.h +#endif +#ifdef HAVE_X_WINDOWS +balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h xintrinsic.h +console-x.o: $(LISP_H) conslots.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 conslots.h console-x.h console.h device.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h msdos.h mule-charset.h nt.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h toolbar.h window.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h +dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h xintrinsic.h +frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h toolbar.h window.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h +glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h conslots.h console-x.h console.h device.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h imgproc.h insdel.h lstream.h msdos.h mule-charset.h nt.h objects-x.h objects.h opaque.h scrollbar.h specifier.h sysfile.h toolbar.h xintrinsic.h xmu.h +gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h gui-x.h gui.h mule-charset.h opaque.h scrollbar.h specifier.h toolbar.h xintrinsic.h +input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h xintrinsic.h +input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h xintrinsic.h +menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h xintrinsic.h +objects-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h insdel.h mule-charset.h objects-x.h objects.h specifier.h xintrinsic.h +redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h systime.h toolbar.h window.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h +scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h redisplay.h scrollbar-x.h scrollbar.h specifier.h toolbar.h window.h xintrinsic.h +toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h +#endif +#ifdef HAVE_DATABASE +database.o: $(LISP_H) database.h msdos.h nt.h sysfile.h +#endif +#ifdef MULE +mule-canna.o: $(LISP_H) buffer.h bufslots.h file-coding.h mule-charset.h +mule-ccl.o: $(LISP_H) buffer.h bufslots.h file-coding.h mule-ccl.h mule-charset.h +mule-charset.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h lstream.h mule-charset.h +mule-coding.o: $(LISP_H) buffer.h bufslots.h elhash.h insdel.h lstream.h mule-ccl.h mule-charset.h mule-coding.h +mule-mcpath.o: $(LISP_H) buffer.h bufslots.h msdos.h mule-charset.h nt.h sysfile.h +mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h mule-charset.h redisplay.h scrollbar.h sysdep.h window.h +mule.o: $(LISP_H) regex.h +#endif +#ifdef EXTERNAL_WIDGET +ExternalClient-Xlib.o: extw-Xlib.h +ExternalClient.o: ExternalClient.h ExternalClientP.h config.h extw-Xlib.h extw-Xt.h xintrinsicp.h +ExternalShell.o: ExternalShell.h ExternalShellP.h config.h extw-Xlib.h extw-Xt.h xintrinsic.h xintrinsicp.h +extw-Xlib.o: config.h extw-Xlib.h +extw-Xt.o: config.h extw-Xlib.h extw-Xt.h +#endif +EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h +EmacsManager.o: EmacsManager.h EmacsManagerP.h config.h xintrinsicp.h xmmanagerp.h +EmacsShell-sub.o: EmacsShell.h EmacsShellP.h config.h xintrinsic.h xintrinsicp.h +EmacsShell.o: EmacsShell.h ExternalShell.h config.h xintrinsicp.h +abbrev.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h redisplay.h scrollbar.h syntax.h window.h +alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h device.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h msdos.h mule-charset.h nt.h puresize.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h toolbar.h window.h +alloca.o: config.h +balloon_help.o: balloon_help.h config.h xintrinsic.h +blocktype.o: $(LISP_H) blocktype.h +buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h insdel.h msdos.h mule-charset.h nt.h process.h redisplay.h scrollbar.h specifier.h syntax.h sysdep.h sysfile.h toolbar.h window.h +bytecode.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h syntax.h +callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h events.h insdel.h mule-charset.h redisplay.h scrollbar.h systime.h window.h +callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lstream.h msdos.h mule-charset.h nt.h paths.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h window.h +casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h syntax.h +casetab.o: $(LISP_H) buffer.h bufslots.h mule-charset.h opaque.h +chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h mule-charset.h syntax.h +cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h +cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h +cmds.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h syntax.h +console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h +console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h gpmevent.h lstream.h msdos.h mule-charset.h nt.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h +console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h +data.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h mule-charset.h sysfloat.h syssignal.h +debug.o: $(LISP_H) bytecode.h debug.h +device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h +device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h +dialog.o: $(LISP_H) +dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h msdos.h mule-charset.h ndir.h nt.h opaque.h regex.h sysdir.h sysfile.h +dll.o: $(LISP_H) buffer.h bufslots.h mule-charset.h sysdll.h +doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h msdos.h mule-charset.h nt.h sysfile.h +doprnt.o: $(LISP_H) buffer.h bufslots.h lstream.h mule-charset.h +dynarr.o: $(LISP_H) +ecrt0.o: config.h +editfns.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h insdel.h line-number.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syspwd.h systime.h toolbar.h window.h +eldap.o: $(LISP_H) +elhash.o: $(LISP_H) bytecode.h elhash.h hash.h +emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h msdos.h mule-charset.h nt.h paths.h process.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h +eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h mule-charset.h opaque.h +event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-tty.h console-x.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h xintrinsic.h xintrinsicp.h +event-stream.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h gui-x.h insdel.h keymap.h lstream.h macros.h msdos.h mule-charset.h nt.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h xintrinsic.h +event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h process.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h +event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h gpmevent.h lstream.h msdos.h mule-charset.h nt.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h +events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h xintrinsic.h +extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h hash.h insdel.h keymap.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h toolbar.h +faces.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h hash.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h xintrinsic.h +file-coding.o: $(LISP_H) buffer.h bufslots.h elhash.h file-coding.h insdel.h lstream.h mule-ccl.h mule-charset.h +fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h insdel.h lstream.h msdos.h mule-charset.h ndir.h nt.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h +filelock.o: $(LISP_H) buffer.h bufslots.h msdos.h mule-charset.h ndir.h nt.h paths.h sysdir.h sysfile.h syspwd.h syssignal.h +filemode.o: $(LISP_H) msdos.h nt.h sysfile.h +floatfns.o: $(LISP_H) sysfloat.h syssignal.h +fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h mule-charset.h scrollbar.h specifier.h systime.h toolbar.h +font-lock.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h mule-charset.h syntax.h +frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h +frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h menubar.h msdos.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h toolbar.h window.h +free-hook.o: $(LISP_H) hash.h +general.o: $(LISP_H) +getloadavg.o: $(LISP_H) +glyphs.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h +gmalloc.o: config.h getpagesize.h +gpmevent.o: $(LISP_H) conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h sysdep.h syssignal.h systime.h systty.h +gui.o: $(LISP_H) gui.h +hash.o: $(LISP_H) elhash.h hash.h +hftctl.o: $(LISP_H) +hpplay.o: $(LISP_H) +imgproc.o: $(LISP_H) imgproc.h +indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h +inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h database.h device.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h keymap.h lstream.h mule-charset.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h syntax.h systime.h toolbar.h tooltalk.h window.h xintrinsic.h +input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h scrollbar.h specifier.h toolbar.h xintrinsic.h +insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h insdel.h line-number.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h +intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h +keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h insdel.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h +libsst.o: $(LISP_H) libsst.h +line-number.o: $(LISP_H) buffer.h bufslots.h insdel.h line-number.h mule-charset.h +linuxplay.o: $(LISP_H) syssignal.h +lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h file-coding.h insdel.h lstream.h msdos.h mule-charset.h nt.h opaque.h paths.h sysfile.h sysfloat.h +lstream.o: $(LISP_H) buffer.h bufslots.h insdel.h lstream.h msdos.h mule-charset.h nt.h sysfile.h +macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h keymap.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h +malloc.o: config.h getpagesize.h +marker.o: $(LISP_H) buffer.h bufslots.h mule-charset.h +md5.o: $(LISP_H) buffer.h bufslots.h file-coding.h insdel.h lstream.h mule-charset.h +menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h gui.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h +minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h +msdos.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h msdos.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h +nas.o: $(LISP_H) syssignal.h +nt.o: $(LISP_H) nt.h ntheap.h sysproc.h syssignal.h systime.h +ntheap.o: $(LISP_H) ntheap.h +ntplay.o: config.h +ntproc.o: $(LISP_H) nt.h ntheap.h process.h sysproc.h syssignal.h systime.h syswait.h +objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h mule-charset.h objects-tty.h objects.h specifier.h syssignal.h systty.h +objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h +offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h +opaque.o: $(LISP_H) opaque.h +print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h insdel.h lstream.h mule-charset.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h +process-unix.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lstream.h msdos.h mule-charset.h nt.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h +process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lstream.h msdos.h mule-charset.h nt.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h +profile.o: $(LISP_H) backtrace.h bytecode.h hash.h syssignal.h systime.h +pure.o: $(LISP_H) puresize-adjust.h puresize.h +ralloc.o: $(LISP_H) getpagesize.h +rangetab.o: $(LISP_H) +realpath.o: config.h +redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h faces.h frame.h frameslots.h glyphs.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h toolbar.h window.h +redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h +redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h window.h +regex.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h regex.h syntax.h +scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h +search.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h opaque.h regex.h syntax.h +sgiplay.o: $(LISP_H) libst.h +sheap.o: $(LISP_H) sheap-adjust.h +signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h +sound.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h mule-charset.h redisplay.h sysdep.h xintrinsic.h +specifier.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h toolbar.h window.h +strcat.o: config.h +strcmp.o: config.h +strcpy.o: config.h +strftime.o: $(LISP_H) +sunOS-fix.o: config.h +sunplay.o: $(LISP_H) sysdep.h syssignal.h +sunpro.o: $(LISP_H) +symbols.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h elhash.h mule-charset.h +syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h syntax.h +sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h msdos.h mule-charset.h ndir.h nt.h ntheap.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h +sysdll.o: config.h sysdll.h +termcap.o: $(LISP_H) conslots.h console.h device.h +terminfo.o: config.h +toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h +tooltalk.o: $(LISP_H) buffer.h bufslots.h elhash.h mule-charset.h process.h tooltalk.h +tparam.o: config.h +undo.o: $(LISP_H) buffer.h bufslots.h extents.h mule-charset.h +unexaix.o: $(LISP_H) getpagesize.h +unexalpha.o: config.h +unexapollo.o: config.h +unexconvex.o: config.h getpagesize.h +unexcw.o: config.h msdos.h nt.h sysfile.h +unexec.o: $(LISP_H) getpagesize.h +unexelf.o: config.h +unexelfsgi.o: $(LISP_H) +unexenix.o: config.h +unexfreebsd.o: config.h +unexhp9k3.o: config.h sysdep.h +unexhp9k800.o: config.h +unexmips.o: config.h getpagesize.h +unexnt.o: ntheap.h +unexsunos4.o: config.h +vm-limit.o: $(LISP_H) mem-limits.h +widget.o: $(LISP_H) buffer.h bufslots.h insdel.h mule-charset.h +window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h +xgccache.o: $(LISP_H) hash.h xgccache.h +xmu.o: config.h +xselect.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h mule-charset.h objects-x.h objects.h opaque.h scrollbar.h specifier.h systime.h toolbar.h xintrinsic.h
--- a/src/device-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/device-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -25,7 +25,7 @@ Original authors: Jamie Zawinski and the FSF Rewritten by Ben Wing and Chuck Thompson. - Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. */
--- a/src/device-tty.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/device-tty.c Mon Aug 13 10:28:48 2007 +0200 @@ -69,22 +69,22 @@ { #if 0 case TTY_UNABLE_OPEN_DATABASE: - suppress_early_backtrace = 1; + suppress_early_error_handler_backtrace = 1; error ("Can't access terminal information database"); break; #endif case TTY_TYPE_UNDEFINED: - suppress_early_backtrace = 1; + suppress_early_error_handler_backtrace = 1; error ("Terminal type `%s' undefined (or can't access database?)", XSTRING_DATA (terminal_type)); break; case TTY_TYPE_INSUFFICIENT: - suppress_early_backtrace = 1; + suppress_early_error_handler_backtrace = 1; error ("Terminal type `%s' not powerful enough to run Emacs", XSTRING_DATA (terminal_type)); break; case TTY_SIZE_UNSPECIFIED: - suppress_early_backtrace = 1; + suppress_early_error_handler_backtrace = 1; error ("Can't determine window size of terminal"); break; case TTY_INIT_SUCCESS:
--- a/src/device-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/device-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -95,8 +95,6 @@ {"-fontset", "*FontSet", XrmoptionSepArg, NULL}, }; -static void validify_resource_string (char *str); - /* Functions to synchronize mirroring resources and specifiers */ int in_resource_setting; int in_specifier_change_function; @@ -149,7 +147,7 @@ return XDEVICE (device); } -Display * +static Display * get_x_display (Lisp_Object device) { return DEVICE_X_DISPLAY (decode_x_device (device)); @@ -202,7 +200,7 @@ "You should always use \".geometry\" or \"*EmacsFrame.geometry\" instead.\n", app_name, (char *) value.addr, app_class, (char *) value.addr); - suppress_early_backtrace = 1; + suppress_early_error_handler_backtrace = 1; error ("Invalid geometry resource"); } } @@ -227,7 +225,7 @@ } static int -have_xemacs_resources_in_xrdb(char *disp_name) +have_xemacs_resources_in_xrdb (CONST char *disp_name) { Display *dpy; char *xdefs, *key; @@ -248,7 +246,7 @@ dpy = XOpenDisplay(disp_name); if (!dpy) return 0; - + xdefs = XResourceManagerString(dpy); /* don't free - owned by X */ for (found = 0; xdefs && *xdefs; ) { if (strncmp(xdefs, key, len) == 0 && @@ -260,11 +258,32 @@ while (*xdefs && *xdefs++ != '\n') /* find start of next entry.. */ ; } - + XCloseDisplay(dpy); return found; } +/* Only the characters [-_A-Za-z0-9] are allowed in the individual + components of a resource. Convert invalid characters to `-' */ + +static char valid_resource_char_p[256]; + +static void +validify_resource_component (char *str, size_t len) +{ + for (; len; len--, str++) + if (!valid_resource_char_p[(unsigned char) (*str)]) + *str = '-'; +} + +static void +Dynarr_add_validified_lisp_string (char_dynarr *cda, Lisp_Object str) +{ + Bytecount len = XSTRING_LENGTH (str); + Dynarr_add_many (cda, (char *) XSTRING_DATA (str), len); + validify_resource_component (Dynarr_atp (cda, Dynarr_length (cda) - len), len); +} + static void x_init_device (struct device *d, Lisp_Object props) { @@ -274,7 +293,8 @@ Widget app_shell; int argc; char **argv; - CONST char *app_class, *app_name; + CONST char *app_class; + CONST char *app_name; CONST char *disp_name; Arg xargs[6]; Cardinal numargs; @@ -296,12 +316,12 @@ XSTRING_LENGTH (Vx_emacs_application_class) > 0) GET_C_STRING_CTEXT_DATA_ALLOCA (Vx_emacs_application_class, app_class); else { - app_class = (NILP(Vx_emacs_application_class) && - have_xemacs_resources_in_xrdb(disp_name)) + app_class = (NILP (Vx_emacs_application_class) && + have_xemacs_resources_in_xrdb (disp_name)) ? "XEmacs" : "Emacs"; /* need to update Vx_emacs_application_class: */ - Vx_emacs_application_class = build_string(app_class); + Vx_emacs_application_class = build_string (app_class); } slow_down_interrupts (); @@ -313,7 +333,7 @@ if (dpy == 0) { - suppress_early_backtrace = 1; + suppress_early_error_handler_backtrace = 1; signal_simple_error ("X server not responding\n", display); } @@ -362,7 +382,7 @@ /* colons and periods can't appear in individual elements of resource strings */ - XtGetApplicationNameAndClass (dpy, &app_name, &app_class); + XtGetApplicationNameAndClass (dpy, (char **) &app_name, (char **) &app_class); /* search for a matching visual if requested by the user, or setup the display default */ numargs = 0; { @@ -447,7 +467,8 @@ DEVICE_X_COLORMAP (d) = cmap; DEVICE_X_DEPTH (d) = depth; - validify_resource_string ((char *) XSTRING_DATA (DEVICE_NAME (d))); + validify_resource_component ((char *) XSTRING_DATA (DEVICE_NAME (d)), + XSTRING_LENGTH (DEVICE_NAME (d))); app_shell = XtAppCreateShell (NULL, app_class, applicationShellWidgetClass, dpy, xargs, numargs); @@ -457,7 +478,7 @@ XIM_init_device(d); #endif /* HAVE_XIM */ - /* Realize the app_shell so that it's window exists for GC creation purposes, + /* Realize the app_shell so that its window exists for GC creation purposes, and set it to the size of the root window for child placement purposes */ { Screen *scrn = ScreenOfDisplay(dpy, screen); @@ -598,51 +619,51 @@ /* handle X errors */ /************************************************************************/ -static CONST char *events[] = -{ - "0: ERROR!", - "1: REPLY", - "KeyPress", - "KeyRelease", - "ButtonPress", - "ButtonRelease", - "MotionNotify", - "EnterNotify", - "LeaveNotify", - "FocusIn", - "FocusOut", - "KeymapNotify", - "Expose", - "GraphicsExpose", - "NoExpose", - "VisibilityNotify", - "CreateNotify", - "DestroyNotify", - "UnmapNotify", - "MapNotify", - "MapRequest", - "ReparentNotify", - "ConfigureNotify", - "ConfigureRequest", - "GravityNotify", - "ResizeRequest", - "CirculateNotify", - "CirculateRequest", - "PropertyNotify", - "SelectionClear", - "SelectionRequest", - "SelectionNotify", - "ColormapNotify", - "ClientMessage", - "MappingNotify", - "LASTEvent" -}; - CONST char * x_event_name (int event_type) { - if (event_type < 0) return 0; - if (event_type >= countof (events)) return 0; + static CONST char *events[] = + { + "0: ERROR!", + "1: REPLY", + "KeyPress", + "KeyRelease", + "ButtonPress", + "ButtonRelease", + "MotionNotify", + "EnterNotify", + "LeaveNotify", + "FocusIn", + "FocusOut", + "KeymapNotify", + "Expose", + "GraphicsExpose", + "NoExpose", + "VisibilityNotify", + "CreateNotify", + "DestroyNotify", + "UnmapNotify", + "MapNotify", + "MapRequest", + "ReparentNotify", + "ConfigureNotify", + "ConfigureRequest", + "GravityNotify", + "ResizeRequest", + "CirculateNotify", + "CirculateRequest", + "PropertyNotify", + "SelectionClear", + "SelectionRequest", + "SelectionNotify", + "ColormapNotify", + "ClientMessage", + "MappingNotify", + "LASTEvent" + }; + + if (event_type < 0 || event_type >= countof (events)) + return NULL; return events [event_type]; } @@ -953,21 +974,8 @@ #endif /* 0 */ -/* Only the characters [-_A-Za-z0-9] are allowed in the individual - sections of a resource. Convert invalid characters to -. */ - -static void -validify_resource_string (char *str) -{ - while (*str) - { - if (!strchr ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789-_", *str)) - *str = '-'; - str++; - } -} +static char_dynarr *name_char_dynarr; +static char_dynarr *class_char_dynarr; /* Given a locale and device specification from x-get-resource or x-get-resource-prefix, return the resource prefix and display to @@ -975,11 +983,9 @@ static void x_get_resource_prefix (Lisp_Object locale, Lisp_Object device, - Display **display_out, char *name_out, - char *class_out) + Display **display_out, char_dynarr *name, + char_dynarr *class) { - char *appname, *appclass; - if (NILP (locale)) locale = Qglobal; if (NILP (Fvalid_specifier_locale_p (locale))) @@ -1011,35 +1017,41 @@ *display_out = DEVICE_X_DISPLAY (XDEVICE (device)); - XtGetApplicationNameAndClass (*display_out, &appname, &appclass); - strcpy (name_out, appname); - strcpy (class_out, appclass); - validify_resource_string (name_out); - validify_resource_string (class_out); + { + char *appname, *appclass; + int name_len, class_len; + XtGetApplicationNameAndClass (*display_out, &appname, &appclass); + name_len = strlen (appname); + class_len = strlen (appclass); + Dynarr_add_many (name , appname, name_len); + Dynarr_add_many (class, appclass, class_len); + validify_resource_component (Dynarr_atp (name, 0), name_len); + validify_resource_component (Dynarr_atp (class, 0), class_len); + } if (EQ (locale, Qglobal)) return; if (BUFFERP (locale)) { - strcat (name_out, ".buffer."); + Dynarr_add_literal_string (name, ".buffer."); /* we know buffer is live; otherwise we got an error above. */ - strcat (name_out, (CONST char *) XSTRING_DATA (Fbuffer_name (locale))); - strcat (class_out, ".EmacsLocaleType.EmacsBuffer"); + Dynarr_add_validified_lisp_string (name, Fbuffer_name (locale)); + Dynarr_add_literal_string (class, ".EmacsLocaleType.EmacsBuffer"); } else if (FRAMEP (locale)) { - strcat (name_out, ".frame."); + Dynarr_add_literal_string (name, ".frame."); /* we know frame is live; otherwise we got an error above. */ - strcat (name_out, (CONST char *) XSTRING_DATA (Fframe_name (locale))); - strcat (class_out, ".EmacsLocaleType.EmacsFrame"); + Dynarr_add_validified_lisp_string (name, Fframe_name (locale)); + Dynarr_add_literal_string (class, ".EmacsLocaleType.EmacsFrame"); } else { assert (DEVICEP (locale)); - strcat (name_out, ".device."); + Dynarr_add_literal_string (name, ".device."); /* we know device is live; otherwise we got an error above. */ - strcat (name_out, (CONST char *) XSTRING_DATA (Fdevice_name (locale))); - strcat (class_out, ".EmacsLocaleType.EmacsDevice"); + Dynarr_add_validified_lisp_string (name, Fdevice_name (locale)); + Dynarr_add_literal_string (class, ".EmacsLocaleType.EmacsDevice"); } return; } @@ -1048,11 +1060,11 @@ Retrieve an X resource from the resource manager. The first arg is the name of the resource to retrieve, such as "font". -The second arg is the class of the resource to retrieve, like "Font". -The third arg should be one of the symbols 'string, 'integer, 'natnum, or +The second arg is the class of the resource to retrieve, such as "Font". +The third arg must be one of the symbols 'string, 'integer, 'natnum, or 'boolean, specifying the type of object that the database is searched for. The fourth arg is the locale to search for the resources on, and can - currently be a a buffer, a frame, a device, or 'global. If omitted, it + currently be a buffer, a frame, a device, or 'global. If omitted, it defaults to 'global. The fifth arg is the device to search for the resources on. (The resource database for a particular device is constructed by combining non-device- @@ -1128,8 +1140,7 @@ */ (name, class, type, locale, device, no_error)) { - /* #### fixed limit, could be overflowed */ - char name_string[2048], class_string[2048]; + char* name_string, *class_string; char *raw_result; XrmDatabase db; Display *display; @@ -1139,28 +1150,25 @@ CHECK_STRING (class); CHECK_SYMBOL (type); - if (!EQ (type, Qstring) && - !EQ (type, Qboolean) && - !EQ (type, Qinteger) && - !EQ (type, Qnatnum)) - return maybe_signal_continuable_error - (Qwrong_type_argument, - list2 (build_translated_string - ("should be string, integer, natnum or boolean"), - type), - Qresource, errb); + Dynarr_reset (name_char_dynarr); + Dynarr_reset (class_char_dynarr); - x_get_resource_prefix (locale, device, &display, name_string, - class_string); + x_get_resource_prefix (locale, device, &display, + name_char_dynarr, class_char_dynarr); if (!display) return Qnil; db = XtDatabase (display); - strcat (name_string, "."); - strcat (name_string, (CONST char *) XSTRING_DATA (name)); - strcat (class_string, "."); - strcat (class_string, (CONST char *) XSTRING_DATA (class)); + Dynarr_add (name_char_dynarr, '.'); + Dynarr_add_lisp_string (name_char_dynarr, name); + Dynarr_add (class_char_dynarr, '.'); + Dynarr_add_lisp_string (class_char_dynarr, class); + Dynarr_add (name_char_dynarr, '\0'); + Dynarr_add (class_char_dynarr, '\0'); + + name_string = Dynarr_atp (name_char_dynarr, 0); + class_string = Dynarr_atp (class_char_dynarr, 0); { XrmValue xrm_value; @@ -1196,14 +1204,13 @@ !strcasecmp (raw_result, "false") || !strcasecmp (raw_result, "no")) return Fcons (Qnil, Qnil); - else if (!strcasecmp (raw_result, "on") || - !strcasecmp (raw_result, "true") || - !strcasecmp (raw_result, "yes")) + if (!strcasecmp (raw_result, "on") || + !strcasecmp (raw_result, "true") || + !strcasecmp (raw_result, "yes")) return Fcons (Qt, Qnil); - else - return maybe_continuable_error (Qresource, errb, - "can't convert %s: %s to a Boolean", - name_string, raw_result); + return maybe_continuable_error + (Qresource, errb, + "can't convert %s: %s to a Boolean", name_string, raw_result); } else if (EQ (type, Qinteger) || EQ (type, Qnatnum)) { @@ -1212,21 +1219,23 @@ if (1 != sscanf (raw_result, "%d%c", &i, &c)) return maybe_continuable_error (Qresource, errb, - "can't convert %s: %s to an integer", - name_string, raw_result); + "can't convert %s: %s to an integer", name_string, raw_result); else if (EQ (type, Qnatnum) && i < 0) return maybe_continuable_error (Qresource, errb, - "invalid numerical value %d for resource %s", - i, name_string); + "invalid numerical value %d for resource %s", i, name_string); else return make_int (i); } else - abort (); - - /* Can't get here. */ - return Qnil; /* shut up compiler */ + { + return maybe_signal_continuable_error + (Qwrong_type_argument, + list2 (build_translated_string + ("should be string, integer, natnum or boolean"), + type), + Qresource, errb); + } } DEFUN ("x-get-resource-prefix", Fx_get_resource_prefix, 1, 2, 0, /* @@ -1241,14 +1250,20 @@ */ (locale, device)) { - /* #### fixed limit, could be overflowed */ - char name[1024], class[1024]; Display *display; - x_get_resource_prefix (locale, device, &display, name, class); + Dynarr_reset (name_char_dynarr ); + Dynarr_reset (class_char_dynarr); + + x_get_resource_prefix (locale, device, &display, + name_char_dynarr, class_char_dynarr); if (!display) return Qnil; - return Fcons (build_string (name), build_string (class)); + + return Fcons (make_string ((Bufbyte *) Dynarr_atp (name_char_dynarr, 0), + Dynarr_length (name_char_dynarr)), + make_string ((Bufbyte *) Dynarr_atp (class_char_dynarr, 0), + Dynarr_length (class_char_dynarr))); } DEFUN ("x-put-resource", Fx_put_resource, 1, 2, 0, /* @@ -1269,7 +1284,8 @@ if (strspn (str, /* Only the following chars are allowed before the colon */ " \t.*?abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-") != colon_pos - str) + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-") + != (size_t) (colon_pos - str)) goto invalid; if (DEVICE_X_P (d)) @@ -1314,9 +1330,8 @@ case DirectColor: return intern ("direct-color"); default: error ("display has an unknown visual class"); + return Qnil; /* suppress compiler warning */ } - - return Qnil; /* suppress compiler warning */ } DEFUN ("x-display-visual-depth", Fx_display_visual_depth, 0, 1, 0, /* @@ -1649,6 +1664,17 @@ CONSOLE_HAS_METHOD (x, device_mm_height); CONSOLE_HAS_METHOD (x, device_bitplanes); CONSOLE_HAS_METHOD (x, device_color_cells); + + { + /* Initialize variables to speed up X resource interactions */ + CONST char *valid_resource_chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + while (*valid_resource_chars) + valid_resource_char_p[(unsigned int) (*valid_resource_chars++)] = 1; + + name_char_dynarr = Dynarr_new (char); + class_char_dynarr = Dynarr_new (char); + } } void @@ -1667,7 +1693,7 @@ consulted and the value will be set according to whether any resources are found for the application class `XEmacs'. If the user has set any resources for the XEmacs application class, the XEmacs process will use -the application class `XEmacs'. Otherwise, the XEmacs process will use +the application class `XEmacs'. Otherwise, the XEmacs process will use the application class `Emacs' which is backwards compatible to previous XEmacs versions but may conflict with resources intended for GNU Emacs. */ );
--- a/src/device.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/device.c Mon Aug 13 10:28:48 2007 +0200 @@ -63,15 +63,7 @@ Lisp_Object Vdevice_class_list; -MAC_DEFINE (struct device *, MTdevice_data) - -static Lisp_Object mark_device (Lisp_Object, void (*) (Lisp_Object)); -static void print_device (Lisp_Object, Lisp_Object, int); -DEFINE_LRECORD_IMPLEMENTATION ("device", device, - mark_device, print_device, 0, 0, 0, - struct device); - static Lisp_Object mark_device (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -128,6 +120,9 @@ write_c_string (buf, printcharfun); } +DEFINE_LRECORD_IMPLEMENTATION ("device", device, + mark_device, print_device, 0, 0, 0, + struct device); int valid_device_class_p (Lisp_Object class) @@ -214,14 +209,6 @@ return XDEVICE (device); } -Lisp_Object -make_device (struct device *d) -{ - Lisp_Object device = Qnil; - XSETDEVICE (device, d); - return device; -} - DEFUN ("dfw-device", Fdfw_device, 1, 1, 0, /* Given a device, frame, or window, return the associated device. Return nil otherwise. @@ -296,9 +283,7 @@ */ (device, frame)) { - struct device *d = decode_device (device); - - XSETDEVICE (device, d); + XSETDEVICE (device, decode_device (device)); CHECK_LIVE_FRAME (frame); if (! EQ (device, FRAME_DEVICE (XFRAME (frame)))) @@ -354,10 +339,6 @@ return DEVICE_CONSOLE (decode_device (device)); } -#ifdef HAVE_X_WINDOWS -extern Lisp_Object Vdefault_x_device; -#endif - #ifdef HAVE_WINDOW_SYSTEM static void @@ -491,7 +472,7 @@ } static Lisp_Object -delete_deviceless_console(Lisp_Object console) +delete_deviceless_console (Lisp_Object console) { if (NILP (XCONSOLE (console)->device_list)) Fdelete_console (console, Qnil); @@ -499,7 +480,7 @@ } DEFUN ("make-device", Fmake_device, 2, 3, 0, /* -Create a new device of type TYPE, attached to connection CONNECTION. +Return a new device of type TYPE, attached to connection CONNECTION. The valid values for CONNECTION are device-specific; however, CONNECTION is generally a string. (Specifically, for X devices, @@ -560,10 +541,10 @@ { Lisp_Object conconnect = - CONTYPE_METH_OR_GIVEN (conmeths, - device_to_console_connection, - (connection, ERROR_ME), - connection); + (HAS_CONTYPE_METH_P (conmeths, device_to_console_connection)) ? + CONTYPE_METH (conmeths, device_to_console_connection, + (connection, ERROR_ME)) : + connection; console = create_console (name, type, conconnect, props); } @@ -576,12 +557,10 @@ d->devmeths = con->conmeths; DEVICE_NAME (d) = name; - DEVICE_CONNECTION (d) = semi_canonicalize_device_connection (conmeths, - connection, - ERROR_ME); - DEVICE_CANON_CONNECTION (d) = canonicalize_device_connection (conmeths, - connection, - ERROR_ME); + DEVICE_CONNECTION (d) = + semi_canonicalize_device_connection (conmeths, connection, ERROR_ME); + DEVICE_CANON_CONNECTION (d) = + canonicalize_device_connection (conmeths, connection, ERROR_ME); MAYBE_DEVMETH (d, init_device, (d, props)); @@ -618,7 +597,7 @@ static Lisp_Object find_other_device (Lisp_Object device, int on_same_console) { - Lisp_Object devcons = Qnil, concons = Qnil; + Lisp_Object devcons = Qnil, concons; Lisp_Object console = DEVICE_CONSOLE (XDEVICE (device)); /* look for a non-stream device */ @@ -695,7 +674,7 @@ { /* This function can GC */ struct console *c; - Lisp_Object device = Qnil; + Lisp_Object device; struct gcpro gcpro1; /* OK to delete an already-deleted device. */ @@ -873,7 +852,21 @@ signal_simple_error ("Cannot change the class of this device", device); if (!EQ (class, Qcolor) && !EQ (class, Qmono) && !EQ (class, Qgrayscale)) signal_simple_error ("Must be color, mono, or grayscale", class); - DEVICE_CLASS (d) = class; + if (! EQ (DEVICE_CLASS (d), class)) + { + Lisp_Object frmcons; + DEVICE_CLASS (d) = class; + DEVICE_FRAME_LOOP (frmcons, d) + { + struct frame *f = XFRAME (XCAR (frmcons)); + + recompute_all_cached_specifiers_in_frame (f); + MARK_FRAME_FACES_CHANGED (f); + MARK_FRAME_GLYPHS_CHANGED (f); + MARK_FRAME_TOOLBARS_CHANGED (f); + f->menubar_changed = 1; + } + } return Qnil; }
--- a/src/device.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/device.h Mon Aug 13 10:28:48 2007 +0200 @@ -222,28 +222,30 @@ #define CHECK_DEVICE(x) CHECK_RECORD (x, device) #define CONCHECK_DEVICE(x) CONCHECK_RECORD (x, device) -#define CHECK_LIVE_DEVICE(x) \ - do { CHECK_DEVICE (x); \ - if (! DEVICEP (x) \ - || ! DEVICE_LIVE_P (XDEVICE (x))) \ - dead_wrong_type_argument (Qdevice_live_p, (x)); } while (0) -#define CONCHECK_LIVE_DEVICE(x) \ - do { CONCHECK_DEVICE (x); \ - if (! DEVICEP (x) \ - || ! DEVICE_LIVE_P (XDEVICE (x))) \ - x = wrong_type_argument (Qdevice_live_p, (x)); } while (0) +#define CHECK_LIVE_DEVICE(x) do { \ + CHECK_DEVICE (x); \ + if (! DEVICE_LIVE_P (XDEVICE (x))) \ + dead_wrong_type_argument (Qdevice_live_p, (x)); \ +} while (0) +#define CONCHECK_LIVE_DEVICE(x) do { \ + CONCHECK_DEVICE (x); \ + if (! DEVICE_LIVE_P (XDEVICE (x))) \ + x = wrong_type_argument (Qdevice_live_p, (x)); \ +} while (0) #define DEVICE_TYPE_P(d, type) EQ (DEVICE_TYPE (d), Q##type) #ifdef ERROR_CHECK_TYPECHECK -MAC_DECLARE_EXTERN (struct device *, MTdevice_data) +INLINE struct device * +error_check_device_type (struct device *d, Lisp_Object sym); +INLINE struct device * +error_check_device_type (struct device *d, Lisp_Object sym) +{ + assert (EQ (DEVICE_TYPE (d), sym)); + return d; +} # define DEVICE_TYPE_DATA(d, type) \ -MAC_BEGIN \ - MAC_DECLARE (struct device *, MTdevice_data, d) \ - assert (DEVICE_TYPE_P (MTdevice_data, type)) \ - MAC_SEP \ - (struct type##_device *) MTdevice_data->device_data \ -MAC_END + ((struct type##_device *) (error_check_device_type (d, Q##type))->device_data) #else # define DEVICE_TYPE_DATA(d, type) \ ((struct type##_device *) (d)->device_data) @@ -288,13 +290,15 @@ #define DEVICE_WIN_P(dev) CONSOLE_TYPESYM_WIN_P (DEVICE_TYPE (dev)) -extern Lisp_Object Vdefault_device; -extern Lisp_Object Qdelete_device; -extern Lisp_Object Qdevice_live_p; +EXFUN (Fdevice_console, 1); +EXFUN (Fdevice_name, 1); +EXFUN (Fmake_device, 3); +EXFUN (Fselected_device, 1); +extern Lisp_Object Qcreate_device_hook, Qdelete_device_hook, Qgrayscale; +extern Lisp_Object Qinit_post_tty_win, Qmono, Vdefault_x_device; extern Lisp_Object Vdevice_class_list; -extern Lisp_Object Qcolor, Qgrayscale, Qmono; int valid_device_class_p (Lisp_Object class); #define DEVICE_LIVE_P(d) (!EQ (DEVICE_TYPE (d), Qdead)) @@ -321,51 +325,46 @@ #define DEVICE_ON_CONSOLE_P(d) ((d)->on_console_p) #define DEVICE_CONNECTED_TO_NAS_P(d) ((d)->connected_to_nas_p) -#define LOCK_DEVICE(d) do { (d)->locked = 1; } while (0) -#define UNLOCK_DEVICE(d) do { (d)->locked = 0; } while (0) +#define LOCK_DEVICE(d) ((void) ((d)->locked = 1)) +#define UNLOCK_DEVICE(d) ((void) ((d)->locked = 0)) #define INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE(d) \ - (d)->pixel_to_glyph_cache.valid = 0 + ((void) ((d)->pixel_to_glyph_cache.valid = 0)) #define INVALIDATE_PIXEL_TO_GLYPH_CACHE do { \ Lisp_Object _devcons_, _concons_; \ DEVICE_LOOP_NO_BREAK (_devcons_, _concons_) \ - INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE (XDEVICE (XCONS (_devcons_)->car));\ + INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE (XDEVICE (XCAR (_devcons_)));\ } while (0) -#define MARK_DEVICE_FACES_CHANGED(d) do { \ - faces_changed = 1; \ - (d)->faces_changed = 1; } while (0) +#define MARK_DEVICE_FACES_CHANGED(d) \ + ((void) (faces_changed = (d)->faces_changed = 1)) -#define MARK_DEVICE_GLYPHS_CHANGED(d) do { \ - glyphs_changed = 1; \ - (d)->glyphs_changed = 1; } while (0) +#define MARK_DEVICE_GLYPHS_CHANGED(d) \ + ((void) (glyphs_changed = (d)->glyphs_changed = 1)) -#define MARK_DEVICE_TOOLBARS_CHANGED(d) do { \ - toolbar_changed = 1; \ - (d)->toolbar_changed = 1; } while (0) +#define MARK_DEVICE_TOOLBARS_CHANGED(d) \ + ((void) (toolbar_changed = (d)->toolbar_changed = 1)) -#define MARK_DEVICE_SIZE_CHANGED(d) do { \ - size_changed = 1; \ - (d)->size_changed = 1; } while (0) +#define MARK_DEVICE_SIZE_CHANGED(d) \ + ((void) (size_changed = (d)->size_changed = 1)) -#define MARK_DEVICE_FRAMES_FACES_CHANGED(d) do { \ - Lisp_Object frmcons; \ - DEVICE_FRAME_LOOP (frmcons, d) \ - XFRAME (XCONS (frmcons)->car)->faces_changed = 1; \ - MARK_DEVICE_FACES_CHANGED (d); } while (0) +#define MARK_DEVICE_FRAMES_FACES_CHANGED(d) do { \ + struct device *mdffc_d = (d); \ + Lisp_Object frmcons; \ + DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ + XFRAME (XCAR (frmcons))->faces_changed = 1; \ + MARK_DEVICE_FACES_CHANGED (mdffc_d); \ +} while (0) -#define MARK_DEVICE_FRAME_CHANGED(d) do { \ - frame_changed = 1; \ - (d)->frame_changed = 1; } while (0) +#define MARK_DEVICE_FRAME_CHANGED(d) \ + ((void) (frame_changed = (d)->frame_changed = 1)) -#define MARK_DEVICE_WINDOWS_CHANGED(d) do { \ - windows_changed = 1; \ - (d)->windows_changed = 1; } while (0) +#define MARK_DEVICE_WINDOWS_CHANGED(d) \ + ((void) (windows_changed = (d)->windows_changed = 1)) -#define MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED(d) do { \ - windows_structure_changed = 1; \ - (d)->windows_structure_changed = 1; } while (0) +#define MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED(d) \ + ((void) (windows_structure_changed = (d)->windows_structure_changed = 1)) /* This turns out to be used heavily so we make it a macro to make it inline. Also, the majority of the time the object will turn out to @@ -390,7 +389,6 @@ void select_device_1 (Lisp_Object); struct device *decode_device (Lisp_Object); -Lisp_Object make_device (struct device *d); void handle_asynch_device_change (void); void call_critical_lisp_code (struct device *d, Lisp_Object function, Lisp_Object object);
--- a/src/dialog-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/dialog-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -249,7 +249,7 @@ struct frame *f = selected_frame (); widget_value *data; Widget parent, dbox; - Lisp_Object frame = Qnil; + Lisp_Object frame; XSETFRAME (frame, f);
--- a/src/dired-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/dired-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -79,6 +79,7 @@ #include "sysdir.h" #include <windows.h> +#include <limits.h> #if ROUND_FILE_SIZES > 0 #include <math.h> /* for floor() */
--- a/src/dired.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/dired.c Mon Aug 13 10:28:48 2007 +0200 @@ -28,12 +28,10 @@ #include "elhash.h" #include "regex.h" #include "opaque.h" - #include "sysfile.h" #include "sysdir.h" Lisp_Object Vcompletion_ignored_extensions; - Lisp_Object Qdirectory_files; Lisp_Object Qfile_name_completion; Lisp_Object Qfile_name_all_completions; @@ -335,7 +333,7 @@ file = FILE_SYSTEM_CASE (file); #endif dirname = Fexpand_file_name (dirname, Qnil); - file_name_length = string_char_length (XSTRING (file)); + file_name_length = XSTRING_CHAR_LENGTH (file); /* With passcount = 0, ignore files that end in an ignored extension. If nothing found then try again with passcount = 1, don't ignore them. @@ -418,12 +416,12 @@ CHECK_STRING (elt); - skip = cclen - string_char_length (XSTRING (elt)); + skip = cclen - XSTRING_CHAR_LENGTH (elt); if (skip < 0) continue; if (0 > scmp (charptr_n_addr (d_name, skip), XSTRING_DATA (elt), - string_char_length (XSTRING (elt)))) + XSTRING_CHAR_LENGTH (elt))) { ignored_extension_p = 1; break; @@ -459,7 +457,7 @@ else { bestmatch = name; - bestmatchsize = string_char_length (XSTRING (name)); + bestmatchsize = XSTRING_CHAR_LENGTH (name); } NUNGCPRO; } @@ -480,7 +478,7 @@ of the actual match. */ if ((matchsize == cclen && matchsize + !!directoryp - < string_char_length (XSTRING (bestmatch))) + < XSTRING_CHAR_LENGTH (bestmatch)) || /* If there is no exact match ignoring case, prefer a match that does not change the case @@ -488,7 +486,7 @@ (((matchsize == cclen) == (matchsize + !!directoryp - == string_char_length (XSTRING (bestmatch)))) + == XSTRING_CHAR_LENGTH (bestmatch))) /* If there is more than one exact match aside from case, and one of them is exact including case, prefer that one. */ @@ -654,7 +652,7 @@ /* If the size is out of range, give back -1. */ /* #### Fix when Emacs gets bignums! */ if (XINT (values[7]) != s.st_size) - XSETINT (values[7], -1); + values[7] = make_int (-1); filemodestring (&s, modes); values[8] = make_string ((Bufbyte *) modes, 10); #if defined (BSD4_2) || defined (BSD4_3) /* file gid will be dir gid */
--- a/src/dll.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/dll.c Mon Aug 13 10:28:48 2007 +0200 @@ -47,13 +47,17 @@ #include <config.h> #include "lisp.h" -#include "emacsfns.h" #include "buffer.h" - -#include <stdio.h> #include "sysdll.h" #include <errno.h> +static void +maybe_call_library_function (dll_handle *handle, CONST char *funcname) +{ + void (*function)(void) = (void (*)(void)) dll_function (handle, funcname); + if (function) + (*function) (); +} DEFUN ("dll-open", Fdll_open, 1, 1, "FShared object: ", /* Load LIBRARY as a shared object file. @@ -72,17 +76,14 @@ { /* This function can GC */ dll_handle *handle; - char *file; - void (*function)(); + CONST char *filename; CHECK_STRING (library); library = Fexpand_file_name (library, Qnil); - file = XSTRING_DATA (library); - /* #### Is this right? */ - GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (file, file); + GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (XSTRING_DATA (library), filename); - handle = dll_open (file); + handle = (dll_handle *) dll_open (filename); if (handle == NULL) { signal_error (Qerror, @@ -104,17 +105,9 @@ Should we take care to execute the other two? My fingers are getting itchy! */ - function = dll_function (handle, "syms_of"); - if (function) - (*function) (); - - function = dll_function (handle, "vars_of"); - if (function) - (*function) (); - - function = dll_function (handle, "complex_vars_of"); - if (function) - (*function) (); + maybe_call_library_function (handle, "syms_of"); + maybe_call_library_function (handle, "vars_of"); + maybe_call_library_function (handle, "complex_vars_of"); return Qnil; }
--- a/src/doc.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/doc.c Mon Aug 13 10:28:48 2007 +0200 @@ -30,11 +30,9 @@ #include "bytecode.h" #include "insdel.h" #include "keymap.h" - #include "sysfile.h" - -Lisp_Object Vdoc_file_name; +Lisp_Object Vinternal_doc_file_name; Lisp_Object QSsubstitute; @@ -177,7 +175,7 @@ if (INTP (filepos)) { - file = Vdoc_file_name; + file = Vinternal_doc_file_name; position = XINT (filepos); } else if (CONSP (filepos) && INTP (XCDR (filepos))) @@ -450,7 +448,7 @@ if (fd < 0) report_file_error ("Opening doc string file", Fcons (build_string (name), Qnil)); - Vdoc_file_name = filename; + Vinternal_doc_file_name = filename; filled = 0; pos = 0; while (1) @@ -642,8 +640,9 @@ kludgily_ignore_lost_doc_p (Lisp_Object sym) { # define kludge_prefix "ad-Orig-" - return (string_length (XSYMBOL (sym)->name) > sizeof (kludge_prefix) && - !strncmp ((char *) string_data (XSYMBOL (sym)->name), kludge_prefix, + struct Lisp_String *name = XSYMBOL (sym)->name; + return (string_length (name) > (Bytecount) (sizeof (kludge_prefix)) && + !strncmp ((char *) string_data (name), kludge_prefix, sizeof (kludge_prefix) - 1)); # undef kludge_prefix } @@ -758,7 +757,7 @@ Bytecount idx; Bytecount bsize; Bufbyte *new; - Lisp_Object tem = Qnil; + Lisp_Object tem; Lisp_Object keymap; Bufbyte *start; Bytecount length; @@ -790,9 +789,11 @@ an overriding-local-map, `where-is-internal' will correctly note this, so there's no reason to do it here. Maybe FSFmacs `where-is-internal' is broken. */ + /* keymap = current_kboard->Voverriding_terminal_local_map; if (NILP (keymap)) keymap = Voverriding_local_map; + */ #endif strlength = XSTRING_LENGTH (str); @@ -885,8 +886,13 @@ case '{': case '<': { - Lisp_Object buffer = Fget_buffer_create (QSsubstitute); - struct buffer *buf_ = XBUFFER (buffer); + /* ### jump to label `subst_string|subst' crosses + initialization of `buffer|_buf' */ + Lisp_Object buffer; + struct buffer *buf_; + + buffer = Fget_buffer_create (QSsubstitute); + buf_ = XBUFFER (buffer); Fbuffer_disable_undo (buffer); Ferase_buffer (buffer); @@ -990,10 +996,10 @@ void vars_of_doc (void) { - DEFVAR_LISP ("internal-doc-file-name", &Vdoc_file_name /* + DEFVAR_LISP ("internal-doc-file-name", &Vinternal_doc_file_name /* Name of file containing documentation strings of built-in symbols. */ ); - Vdoc_file_name = Qnil; + Vinternal_doc_file_name = Qnil; QSsubstitute = build_string (" *substitute*"); staticpro (&QSsubstitute);
--- a/src/doprnt.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/doprnt.c Mon Aug 13 10:28:48 2007 +0200 @@ -149,7 +149,7 @@ *returned_num = -1; while (start != end && isdigit (*start)) { - if (arg_ptr - arg_convert >= sizeof (arg_convert) - 1) + if ((size_t) (arg_ptr - arg_convert) >= sizeof (arg_convert) - 1) error ("Format converter number too large"); *arg_ptr++ = *start++; } @@ -191,7 +191,7 @@ CONST Bufbyte *text_end; Bufbyte ch; - memset (&spec, 0, sizeof (spec)); + xzero (spec); if (fmt == fmt_end) return specs; text_end = (Bufbyte *) memchr (fmt, '%', fmt_end - fmt); @@ -261,7 +261,7 @@ spec.converter = '*'; RESOLVE_FLAG_CONFLICTS(spec); Dynarr_add (specs, spec); - memset (&spec, 0, sizeof (spec)); + xzero (spec); spec.argnum = ++prev_argnum; fmt++; } @@ -289,7 +289,7 @@ spec.forwarding_precision = 1; RESOLVE_FLAG_CONFLICTS(spec); Dynarr_add (specs, spec); - memset (&spec, 0, sizeof (spec)); + xzero (spec); spec.argnum = ++prev_argnum; fmt++; } @@ -361,7 +361,7 @@ REGISTER int i; int args_needed = get_args_needed (specs); - memset (&arg, 0, sizeof (union printf_arg)); + xzero (arg); for (i = 1; i <= args_needed; i++) { int j; @@ -480,11 +480,9 @@ continue; } - /* - * * as converter means the field width, precision was specified - * as an argument. Extract the data and forward it to the - * next spec, to which it will apply. - */ + /* The char '*' as converter means the field width, precision + was specified as an argument. Extract the data and forward + it to the next spec, to which it will apply. */ if (ch == '*') { struct printf_spec *nextspec = Dynarr_atp (specs, i + 1); @@ -530,7 +528,7 @@ E.g., in fileio.c, the return value of strerror() is never checked. We'll print (null), like some printf implementations do. Would it be better (and safe) - to signal an error instead? Or should we just use the + to signal an error instead? Or should we just use the empty string? -dkindred@cs.cmu.edu 8/1997 */ if (!string)
--- a/src/dynarr.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/dynarr.c Mon Aug 13 10:28:48 2007 +0200 @@ -133,7 +133,7 @@ multiplier = 1.5; for (newsize = dy->max; newsize < size;) - newsize = max (Dynarr_min_size, multiplier * newsize); + newsize = max (Dynarr_min_size, (int) (multiplier * newsize)); /* Don't do anything if the array is already big enough. */ if (newsize > dy->max) @@ -201,10 +201,10 @@ what was requested of it is returned in MALLOC_OVERHEAD in STATS. See the comment above the definition of this structure. */ -int +size_t Dynarr_memory_usage (void *d, struct overhead_stats *stats) { - int total = 0; + size_t total = 0; Dynarr *dy = (Dynarr *) d; /* We have to be a bit tricky here because not all of the @@ -213,8 +213,8 @@ if (dy->base) { - int malloc_used = malloced_storage_size (dy->base, - dy->elsize * dy->max, 0); + size_t malloc_used = malloced_storage_size (dy->base, + dy->elsize * dy->max, 0); /* #### This may or may not be correct. Some Dynarrs would prefer that we use dy->cur instead of dy->largest here. */ int was_requested = dy->elsize * dy->largest;
--- a/src/dynarr.h Mon Aug 13 10:27:41 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* Simple 'n' stupid dynamic-array module -- include file. - Copyright (C) 1993 Sun Microsystems, Inc. - -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. */ - -/* Written by Ben Wing, December 1993. */ - -#ifndef _XEMACS_DYNARR_H_ -#define _XEMACS_DYNARR_H_ - -#define Dynarr_declare(type) \ - type *base; \ - int elsize; \ - int cur; \ - int largest; \ - int max - -typedef struct dynarr -{ - Dynarr_declare (void); -} Dynarr; - -void *Dynarr_newf (int elsize); -void Dynarr_resize (void *dy, int size); -void Dynarr_insert_many (void *d, CONST void *el, int len, int start); -void Dynarr_delete_many (void *d, int start, int len); -void Dynarr_free (void *d); - -#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof(type))) -#define Dynarr_at(d, pos) ((d)->base[pos]) -#define Dynarr_atp(d, pos) (&Dynarr_at (d, pos)) -#define Dynarr_length(d) ((d)->cur) -#define Dynarr_largest(d) ((d)->largest) -#define Dynarr_reset(d) ((d)->cur = 0) -#define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur) -#define Dynarr_insert_many_at_start(d, el, len) \ - Dynarr_insert_many (d, el, len, 0) - -#define Dynarr_add(d, el) ( \ - (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : (void) 0, \ - ((d)->base)[(d)->cur++] = (el), \ - (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0) - -/* The following defines will get you into real trouble if you aren't - careful. But they can save a lot of execution time when used wisely. */ -#define Dynarr_increment(d) ((d)->cur++) -#define Dynarr_set_size(d, n) ((d)->cur = n) - -/* Minimum size in elements for dynamic array when resized; default is 32 */ -extern int Dynarr_min_size; - -#ifdef MEMORY_USAGE_STATS - -struct overhead_stats; - -int Dynarr_memory_usage (void *d, struct overhead_stats *stats); - -#endif - -#endif /* _XEMACS_DYNARR_H_ */
--- a/src/editfns.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/editfns.c Mon Aug 13 10:28:48 2007 +0200 @@ -28,6 +28,9 @@ #include <config.h> #include "lisp.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #include "buffer.h" #include "commands.h" @@ -59,9 +62,9 @@ /* It's useful to be able to set this as user customization, so we'll keep it. */ Lisp_Object Vuser_full_name; -Lisp_Object Fuser_full_name (Lisp_Object); +EXFUN (Fuser_full_name, 1); -extern char *get_system_name (void); +char *get_system_name (void); Lisp_Object Qformat; @@ -76,7 +79,7 @@ init_editfns (void) { /* Only used in removed code below. */ - Bufbyte *p; + char *p; environbuf = 0; @@ -88,7 +91,7 @@ return; #endif - if ((p = (Bufbyte *) getenv ("NAME"))) + if ((p = getenv ("NAME"))) /* I don't think it's the right thing to do the ampersand modification on NAME. Not that it matters anymore... -hniksic */ Vuser_full_name = build_ext_string (p, FORMAT_OS); @@ -142,8 +145,7 @@ static Lisp_Object buildmark (Bufpos val, Lisp_Object buffer) { - Lisp_Object mark; - mark = Fmake_marker (); + Lisp_Object mark = Fmake_marker (); Fset_marker (mark, make_int (val), buffer); return mark; } @@ -182,23 +184,17 @@ Bufpos bufpos_clip_to_bounds (Bufpos lower, Bufpos num, Bufpos upper) { - if (num < lower) - return lower; - else if (num > upper) - return upper; - else - return num; + return (num < lower ? lower : + num > upper ? upper : + num); } Bytind bytind_clip_to_bounds (Bytind lower, Bytind num, Bytind upper) { - if (num < lower) - return lower; - else if (num > upper) - return upper; - else - return num; + return (num < lower ? lower : + num > upper ? upper : + num); } /* @@ -411,9 +407,8 @@ struct buffer *buf = XBUFFER (buffer); /* Avoid signaling an error if the buffer is no longer alive. This is for consistency with save-excursion. */ - if (!BUFFER_LIVE_P (buf)) - return Qnil; - set_buffer_internal (buf); + if (BUFFER_LIVE_P (buf)) + set_buffer_internal (buf); return Qnil; } @@ -431,7 +426,7 @@ return unbind_to (speccount, Fprogn (args)); } -DEFUN ("buffer-size", Fbufsize, 0, 1, 0, /* +DEFUN ("buffer-size", Fbuffer_size, 0, 1, 0, /* Return the number of characters in BUFFER. If BUFFER is nil, the current buffer is assumed. */ @@ -516,7 +511,7 @@ } DEFUN ("bobp", Fbobp, 0, 1, 0, /* -Return T if point is at the beginning of the buffer. +Return t if point is at the beginning of the buffer. If the buffer is narrowed, this means the beginning of the narrowed part. If BUFFER is nil, the current buffer is assumed. */ @@ -527,7 +522,7 @@ } DEFUN ("eobp", Feobp, 0, 1, 0, /* -Return T if point is at the end of the buffer. +Return t if point is at the end of the buffer. If the buffer is narrowed, this means the end of the narrowed part. If BUFFER is nil, the current buffer is assumed. */ @@ -540,14 +535,12 @@ int beginning_of_line_p (struct buffer *b, Bufpos pt) { - if (pt <= BUF_BEGV (b)) - return 1; - return BUF_FETCH_CHAR (b, pt - 1) == '\n'; + return pt <= BUF_BEGV (b) || BUF_FETCH_CHAR (b, pt - 1) == '\n'; } DEFUN ("bolp", Fbolp, 0, 1, 0, /* -Return T if point is at the beginning of a line. +Return t if point is at the beginning of a line. If BUFFER is nil, the current buffer is assumed. */ (buffer)) @@ -558,16 +551,15 @@ } DEFUN ("eolp", Feolp, 0, 1, 0, /* -Return T if point is at the end of a line. +Return t if point is at the end of a line. `End of a line' includes point being at the end of the buffer. If BUFFER is nil, the current buffer is assumed. */ (buffer)) { struct buffer *b = decode_buffer (buffer, 1); - if (BUF_PT (b) == BUF_ZV (b) || BUF_FETCH_CHAR (b, BUF_PT (b)) == '\n') - return Qt; - return Qnil; + return (BUF_PT (b) == BUF_ZV (b) || BUF_FETCH_CHAR (b, BUF_PT (b)) == '\n') + ? Qt : Qnil; } DEFUN ("char-after", Fchar_after, 0, 2, 0, /* @@ -618,17 +610,16 @@ ()) { char *tmpdir; - #if defined(WINDOWSNT) || defined(MSDOS) - tmpdir = (char *) getenv ("TEMP"); + tmpdir = getenv ("TEMP"); if (!tmpdir) - tmpdir = (char *) getenv ("TMP"); + tmpdir = getenv ("TMP"); if (!tmpdir) - tmpdir = "/"; /* what should this be on NT/MSDOS ? */ + tmpdir = "/"; #else /* WINDOWSNT || MSDOS */ - tmpdir = (char *) getenv ("TMPDIR"); - if (!tmpdir) - tmpdir = "/tmp"; + tmpdir = getenv ("TMPDIR"); + if (!tmpdir) + tmpdir = "/tmp"; #endif return build_ext_string (tmpdir, FORMAT_FILENAME); @@ -649,25 +640,26 @@ if (!NILP (uid)) { CHECK_INT (uid); - pw = (struct passwd *) getpwuid (XINT (uid)); + pw = getpwuid (XINT (uid)); } else { - char *user_name; /* #### - when euid != uid, then LOGNAME and USER are leftovers from the old environment (I site observed behavior on sunos and linux), so the environment variables should be disregarded in that case. --Stig */ - user_name = getenv ("LOGNAME"); + char *user_name = getenv ("LOGNAME"); if (!user_name) + user_name = getenv ( #ifdef WINDOWSNT - user_name = (char *) getenv ("USERNAME"); /* it's USERNAME on NT */ -#else /* WINDOWSNT */ - user_name = (char *) getenv ("USER"); -#endif /* WINDOWSNT */ + "USERNAME" /* it's USERNAME on NT */ +#else + "USER" +#endif + ); if (user_name) return build_string (user_name); else - pw = (struct passwd *) getpwuid (geteuid ()); + pw = getpwuid (geteuid ()); } /* #### - I believe this should return nil instead of "unknown" when pw==0 */ return pw ? build_string (pw->pw_name) : Qnil; @@ -680,7 +672,7 @@ */ ()) { - struct passwd *pw = (struct passwd *) getpwuid (getuid ()); + struct passwd *pw = getpwuid (getuid ()); /* #### - I believe this should return nil instead of "unknown" when pw==0 */ #ifdef MSDOS @@ -744,15 +736,15 @@ /* #### - Stig sez: this should return nil instead of "unknown" when pw==0 */ /* Ben sez: bad idea because it's likely to break something */ #ifndef AMPERSAND_FULL_NAME - p = (char *) ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ - q = (char *) strchr ((char *) p, ','); + p = ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ + q = strchr (p, ','); #else - p = (char *) ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ - q = (char *) strchr ((char *) p, ','); + p = ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ + q = strchr (p, ','); #endif tem = ((!NILP (user) && !pw) ? Qnil - : make_ext_string ((unsigned char *) p, (q ? q - p : strlen (p)), + : make_ext_string ((Extbyte *) p, (q ? q - p : strlen (p)), FORMAT_OS)); #ifdef AMPERSAND_FULL_NAME @@ -815,14 +807,11 @@ ()) { EMACS_TIME t; - Lisp_Object result[3]; EMACS_GET_TIME (t); - XSETINT (result[0], (EMACS_SECS (t) >> 16) & 0xffff); - XSETINT (result[1], (EMACS_SECS (t) >> 0) & 0xffff); - XSETINT (result[2], EMACS_USECS (t)); - - return Flist (3, result); + return list3 (make_int ((EMACS_SECS (t) >> 16) & 0xffff), + make_int ((EMACS_SECS (t) >> 0) & 0xffff), + make_int (EMACS_USECS (t))); } DEFUN ("current-process-time", Fcurrent_process_time, 0, 0, 0, /* @@ -857,25 +846,27 @@ } +int lisp_to_time (Lisp_Object specified_time, time_t *result); int lisp_to_time (Lisp_Object specified_time, time_t *result) { + Lisp_Object high, low; + if (NILP (specified_time)) return time (result) != -1; - else - { - Lisp_Object high, low; - high = Fcar (specified_time); - CHECK_INT (high); - low = Fcdr (specified_time); - if (CONSP (low)) - low = XCAR (low); - CHECK_INT (low); - *result = (XINT (high) << 16) + (XINT (low) & 0xffff); - return *result >> 16 == XINT (high); - } + + CHECK_CONS (specified_time); + high = XCAR (specified_time); + low = XCDR (specified_time); + if (CONSP (low)) + low = XCAR (low); + CHECK_INT (high); + CHECK_INT (low); + *result = (XINT (high) << 16) + (XINT (low) & 0xffff); + return *result >> 16 == XINT (high); } +Lisp_Object time_to_lisp (time_t the_time); Lisp_Object time_to_lisp (time_t the_time) { @@ -935,7 +926,7 @@ (format_string, _time)) { time_t value; - int size; + size_t size; CHECK_STRING (format_string); @@ -1010,7 +1001,7 @@ This is the reverse operation of `decode-time', which see. ZONE defaults to the current time zone rule. This can be a string (as from `set-time-zone-rule'), or it can be a list -(as from `current-time-zone') or an integer (as from `decode-time') +\(as from `current-time-zone') or an integer (as from `decode-time') applied without consideration for daylight savings time. You can pass more than 7 arguments; then the first six arguments @@ -1155,16 +1146,15 @@ (specified_time)) { time_t value; - struct tm *t; + struct tm *t = NULL; if (lisp_to_time (specified_time, &value) && (t = gmtime (&value)) != 0) { - struct tm gmt; + struct tm gmt = *t; /* Make a copy, in case localtime modifies *t. */ long offset; char *s, buf[6]; - gmt = *t; /* Make a copy, in case localtime modifies *t. */ t = localtime (&value); offset = difftm (t, &gmt); s = 0; @@ -1195,7 +1185,7 @@ /* These two values are known to load tz files in buggy implementations, i.e. Solaris 1 executables running under either Solaris 1 or Solaris 2. Their values shouldn't matter in non-buggy implementations. - We don't use string literals for these strings, + We don't use string literals for these strings, since if a string in the environment is in readonly storage, it runs afoul of bugs in SVR4 and Solaris 2.3. See Sun bugs 1113095 and 1114114, ``Timezone routines @@ -1673,7 +1663,7 @@ get_buffer_range_char (buf, start, end, &pos, &stop, 0); CHECK_STRING (table); - size = string_char_length (XSTRING (table)); + size = XSTRING_CHAR_LENGTH (table); cnt = 0; mc_count = begin_multiple_change (buf, pos, stop); @@ -2020,7 +2010,6 @@ transpose_markers (Bufpos start1, Bufpos end1, Bufpos start2, Bufpos end2) { Charcount amt1, amt2, diff; - Bufpos mpos; Lisp_Object marker; struct buffer *buf = current_buffer; @@ -2054,7 +2043,7 @@ for (marker = BUF_MARKERS (buf); !NILP (marker); marker = XMARKER (marker)->chain) { - mpos = marker_position (marker); + Bufpos mpos = marker_position (marker); if (mpos >= start1 && mpos < end2) { if (mpos < end1) @@ -2143,7 +2132,7 @@ DEFSUBR (Fsave_excursion); DEFSUBR (Fsave_current_buffer); - DEFSUBR (Fbufsize); + DEFSUBR (Fbuffer_size); DEFSUBR (Fpoint_max); DEFSUBR (Fpoint_min); DEFSUBR (Fpoint_min_marker);
--- a/src/eldap.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/eldap.c Mon Aug 13 10:28:48 2007 +0200 @@ -29,18 +29,10 @@ - Netscape's LDAP SDK 1.0 (http://developer.netscape.com) */ - #include <config.h> - -#if defined (HAVE_LDAP) - -/* The entire file is within this conditional */ - #include "lisp.h" #include <errno.h> - -#include "eldap.h" #include <lber.h> #include <ldap.h> @@ -429,7 +421,6 @@ defsymbol (&Qderef, "deref"); defsymbol (&Qtimelimit, "timelimit"); defsymbol (&Qsizelimit, "sizelimit"); - defsymbol (&Qbase, "base"); defsymbol (&Qonelevel, "onelevel"); defsymbol (&Qsubtree, "subtree"); #ifdef LDAP_AUTH_KRBV41 @@ -462,5 +453,3 @@ Vldap_default_host = Qnil; Vldap_default_base = Qnil; } - -#endif /* HAVE_LDAP */
--- a/src/eldap.h Mon Aug 13 10:27:41 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* Definitions for the LDAP client interface for XEmacs. - Copyright (C) 1998 Free Software Foundation, Inc. - -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. */ - -/* Author: Oscar Figueiredo */ - - -#ifndef _XEMACS_ELDAP_H_ -#define _XEMACS_ELDAP_H_ - -#ifdef HAVE_LDAP - -#ifdef emacs - -Lisp_Object Fldap_search_internal (Lisp_Object search_plist); - -#endif /* emacs */ - -#endif /* HAVE_LDAP */ - -#endif /* _XEMACS_ELDAP_H_ */
--- a/src/elhash.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/elhash.c Mon Aug 13 10:28:48 2007 +0200 @@ -28,6 +28,10 @@ #include "elhash.h" #include "bytecode.h" +EXFUN (Fmake_weak_hashtable, 2); +EXFUN (Fmake_key_weak_hashtable, 2); +EXFUN (Fmake_value_weak_hashtable, 2); + Lisp_Object Qhashtablep, Qhashtable; Lisp_Object Qweak, Qkey_weak, Qvalue_weak, Qnon_weak; @@ -48,15 +52,6 @@ static Lisp_Object Vall_weak_hashtables; -static Lisp_Object mark_hashtable (Lisp_Object, void (*) (Lisp_Object)); -static void print_hashtable (Lisp_Object, Lisp_Object, int); -static int hashtable_equal (Lisp_Object t1, Lisp_Object t2, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("hashtable", hashtable, - mark_hashtable, print_hashtable, 0, - /* #### Implement hashtable_hash()! */ - hashtable_equal, 0, - struct hashtable); - static Lisp_Object mark_hashtable (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -257,6 +252,11 @@ } } +DEFINE_LRECORD_IMPLEMENTATION ("hashtable", hashtable, + mark_hashtable, print_hashtable, 0, + /* #### Implement hashtable_hash()! */ + hashtable_equal, 0, + struct hashtable); /* Pretty reading of hashtables. @@ -350,34 +350,29 @@ /* I'm not sure whether this can GC, but better safe than sorry. */ Lisp_Object hashtab = Qnil; Lisp_Object type = Qnil, test = Qnil, size = Qnil, data = Qnil; - Lisp_Object key, value; struct gcpro gcpro1; GCPRO1 (hashtab); while (!NILP (plist)) { - key = XCAR (plist); - plist = XCDR (plist); - value = XCAR (plist); - plist = XCDR (plist); - if (EQ (key, Qtype)) - type = value; - else if (EQ (key, Qtest)) - test = value; - else if (EQ (key, Qsize)) - size = value; - else if (EQ (key, Qdata)) - data = value; + Lisp_Object key, value; + key = XCAR (plist); plist = XCDR (plist); + value = XCAR (plist); plist = XCDR (plist); + + if (EQ (key, Qtype)) type = value; + else if (EQ (key, Qtest)) test = value; + else if (EQ (key, Qsize)) size = value; + else if (EQ (key, Qdata)) data = value; else abort (); } + if (NILP (type)) type = Qnon_weak; + if (NILP (size)) - { - /* Divide by two, because data is a plist. */ - XSETINT (size, XINT (Flength (data)) / 2); - } + /* Divide by two, because data is a plist. */ + size = make_int (XINT (Flength (data)) / 2); /* Create the hashtable. */ if (EQ (type, Qnon_weak)) @@ -394,10 +389,9 @@ /* And fill it with data. */ while (!NILP (data)) { - key = XCAR (data); - data = XCDR (data); - value = XCAR (data); - data = XCDR (data); + Lisp_Object key, value; + key = XCAR (data); data = XCDR (data); + value = XCAR (data); data = XCDR (data); Fputhash (key, value, hashtab); } @@ -637,7 +631,7 @@ } DEFUN ("make-hashtable", Fmake_hashtable, 1, 2, 0, /* -Make a hashtable of initial size SIZE. +Return a new hashtable object of initial size SIZE. Comparison between keys is done with TEST-FUN, which must be one of `eq', `eql', or `equal'. The default is `eql'; i.e. two keys must be the same object (or have the same floating-point value, for floats) @@ -654,10 +648,10 @@ } DEFUN ("copy-hashtable", Fcopy_hashtable, 1, 1, 0, /* -Make a new hashtable which contains the same keys and values -as the given table. The keys and values will not themselves be copied. +Return a new hashtable containing the same keys and values as HASHTABLE. +The keys and values will not themselves be copied. */ - (old_table)) + (hashtable)) { struct _C_hashtable old_htbl; struct _C_hashtable new_htbl; @@ -665,8 +659,8 @@ struct hashtable *new_ht; Lisp_Object result; - CHECK_HASHTABLE (old_table); - old_ht = XHASHTABLE (old_table); + CHECK_HASHTABLE (hashtable); + old_ht = XHASHTABLE (hashtable); ht_copy_to_c (old_ht, &old_htbl); /* we can't just call Fmake_hashtable() here because that will make a @@ -793,17 +787,10 @@ switch (XHASHTABLE (hashtable)->type) { - case HASHTABLE_WEAK: - return Qweak; - break; - case HASHTABLE_KEY_WEAK: - return Qkey_weak; - break; - case HASHTABLE_VALUE_WEAK: - return Qvalue_weak; - break; - default: - return Qnon_weak; + case HASHTABLE_WEAK: return Qweak; + case HASHTABLE_KEY_WEAK: return Qkey_weak; + case HASHTABLE_VALUE_WEAK: return Qvalue_weak; + default: return Qnon_weak; } } @@ -832,21 +819,21 @@ { /* #### Unused DESCRIPTION? */ if (SYMBOLP (function)) - { - if (NILP (function)) - return; - else - function = indirect_function (function, 1); - } + { + if (NILP (function)) + return; + else + function = indirect_function (function, 1); + } if (SUBRP (function) || COMPILED_FUNCTIONP (function)) return; else if (CONSP (function)) - { - Lisp_Object funcar = XCAR (function); - if ((SYMBOLP (funcar)) && (EQ (funcar, Qlambda) || - EQ (funcar, Qautoload))) - return; - } + { + Lisp_Object funcar = XCAR (function); + if ((SYMBOLP (funcar)) && (EQ (funcar, Qlambda) || + EQ (funcar, Qautoload))) + return; + } signal_error (Qinvalid_function, list1 (function)); } @@ -900,10 +887,7 @@ } void -elisp_map_remhash (int (*function) (CONST void *key, - CONST void *contents, - void *extra_arg), - Lisp_Object hashtable, +elisp_map_remhash (remhash_predicate function, Lisp_Object hashtable, void *closure) { struct _C_hashtable htbl; @@ -930,7 +914,7 @@ DEFUN ("make-weak-hashtable", Fmake_weak_hashtable, 1, 2, 0, /* -Make a fully weak hashtable of initial size SIZE. +Return a new fully weak hashtable object of initial size SIZE. A weak hashtable is one whose pointers do not count as GC referents: for any key-value pair in the hashtable, if the only remaining pointer to either the key or the value is in a weak hash table, then the pair @@ -949,7 +933,7 @@ } DEFUN ("make-key-weak-hashtable", Fmake_key_weak_hashtable, 1, 2, 0, /* -Make a key-weak hashtable of initial size SIZE. +Return a new key-weak hashtable object of initial size SIZE. A key-weak hashtable is similar to a fully-weak hashtable (see `make-weak-hashtable') except that a key-value pair will be removed only if the key remains unmarked outside of weak hashtables. The pair @@ -964,7 +948,7 @@ } DEFUN ("make-value-weak-hashtable", Fmake_value_weak_hashtable, 1, 2, 0, /* -Make a value-weak hashtable of initial size SIZE. +Return a new value-weak hashtable object of initial size SIZE. A value-weak hashtable is similar to a fully-weak hashtable (see `make-weak-hashtable') except that a key-value pair will be removed only if the value remains unmarked outside of weak hashtables. The pair will
--- a/src/elhash.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/elhash.h Mon Aug 13 10:28:48 2007 +0200 @@ -49,15 +49,9 @@ HASHTABLE_EQUAL }; -Lisp_Object Fmake_hashtable (Lisp_Object size, Lisp_Object test_fun); -Lisp_Object Fmake_weak_hashtable(Lisp_Object size, Lisp_Object test); -Lisp_Object Fmake_key_weak_hashtable(Lisp_Object size, Lisp_Object test); -Lisp_Object Fmake_value_weak_hashtable(Lisp_Object size, Lisp_Object test); -Lisp_Object Fcopy_hashtable (Lisp_Object old_table); -Lisp_Object Fgethash (Lisp_Object obj, Lisp_Object table, Lisp_Object default_); -Lisp_Object Fputhash (Lisp_Object obj, Lisp_Object val, Lisp_Object table); -Lisp_Object Fremhash (Lisp_Object obj, Lisp_Object table); -Lisp_Object Fhashtable_fullness (Lisp_Object table); +EXFUN (Fcopy_hashtable, 1); +EXFUN (Fhashtable_fullness, 1); +EXFUN (Fremhash, 2); Lisp_Object make_lisp_hashtable (int size, enum hashtable_type type,
--- a/src/emacs.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/emacs.c Mon Aug 13 10:28:48 2007 +0200 @@ -43,6 +43,10 @@ #include "sysfile.h" #include "systime.h" +#ifdef HAVE_SHLIB +#include "sysdll.h" +#endif + #if defined (HAVE_LOCALE_H) && \ (defined (I18N2) || defined (I18N3) || defined (I18N4)) #include <locale.h> @@ -63,9 +67,7 @@ #endif /* For PATH_EXEC */ -#include "paths.h" - -extern void memory_warnings (void *, void (*warnfun) (CONST char *)); +#include <paths.h> #if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC extern void *(*__malloc_hook)(size_t); @@ -85,8 +87,12 @@ # include <malloc.h> /* Preserves a pointer to the memory allocated that copies that static data inside glibc's malloc. */ -void *malloc_state_ptr; -#endif +static void *malloc_state_ptr; +#endif /* DOUG_LEA_MALLOC */ + +# ifdef REL_ALLOC +void r_alloc_reinit (void); +# endif /* Variable whose value is symbol giving operating system type. */ Lisp_Object Vsystem_type; @@ -154,7 +160,7 @@ /* If non-zero, then the early error handler will only print the error message and exit. */ -int suppress_early_backtrace; +int suppress_early_error_handler_backtrace; /* An address near the bottom of the stack. Tells GC how to save a copy of the stack. */ @@ -537,9 +543,8 @@ * unexnext.c are both completely undocumented, even in NS header files! * But hey, it solves all NS related memory problems, so who's * complaining? */ - if (initialized) - if (malloc_jumpstart (malloc_cookie) != 0) - printf ("malloc jumpstart failed!\n"); + if (initialized && malloc_jumpstart (malloc_cookie) != 0) + fprintf (stderr, "malloc jumpstart failed!\n"); #endif /* NeXT */ /* @@ -895,7 +900,7 @@ syms_of_marker (); syms_of_md5 (); #ifdef HAVE_DATABASE - syms_of_dbm (); + syms_of_database (); #endif #ifdef HAVE_MENUBARS syms_of_menubar (); @@ -946,9 +951,6 @@ syms_of_menubar_x (); #endif syms_of_xselect (); -#ifdef EPOCH - syms_of_epoch (); -#endif #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) syms_of_gui_x (); #endif @@ -1261,7 +1263,7 @@ vars_of_macros (); vars_of_md5 (); #ifdef HAVE_DATABASE - vars_of_dbm (); + vars_of_database (); #endif #ifdef HAVE_MENUBARS vars_of_menubar (); @@ -1319,9 +1321,6 @@ #endif vars_of_objects_x (); vars_of_xselect (); -#ifdef EPOCH - vars_of_epoch (); -#endif #ifdef HAVE_SCROLLBARS vars_of_scrollbar_x (); #endif @@ -1862,10 +1861,8 @@ static int run_temacs_argc; static char **run_temacs_argv; static char *run_temacs_args; -static int run_temacs_argv_size; -static int run_temacs_args_size; - -extern int gc_in_progress; +static size_t run_temacs_argv_size; +static size_t run_temacs_args_size; DEFUN ("running-temacs-p", Frunning_temacs_p, 0, 0, 0, /* True if running temacs. This means we are in the dumping stage. @@ -1982,7 +1979,7 @@ quantify_clear_data (); #endif /* QUANTIFY */ - suppress_early_backtrace = 0; + suppress_early_error_handler_backtrace = 0; lim_data = 0; /* force reinitialization of this variable */ /* Lisp_Object must fit in a word; check VALBITS and GCTYPEBITS */ @@ -2028,17 +2025,22 @@ #endif /* _SCO_DS */ vol_envp = environ; } -#ifdef RUN_TIME_REMAP - else - /* obviously no-one uses this because where it was before initalized was - *always* true */ +#ifdef RUN_TIME_REMAP + else + /* obviously no-one uses this because where it was before initalized was + *always* true */ run_time_remap (argv[0]); #endif #ifdef DOUG_LEA_MALLOC if (initialized && (malloc_state_ptr != NULL)) { - malloc_set_state (malloc_state_ptr); + int rc = malloc_set_state (malloc_state_ptr); + if (rc != 0) + { + fprintf (stderr, "malloc_set_state failed, rc = %d\n", rc); + abort (); + } #if 0 free (malloc_state_ptr); #endif @@ -2053,7 +2055,7 @@ r_alloc_reinit (); #endif } -#endif +#endif /* DOUG_LEA_MALLOC */ run_temacs_argc = -1; @@ -2062,6 +2064,20 @@ } +/* Dumping apparently isn't supported by versions of GCC >= 2.8. */ +/* The following needs conditionalization on whether either XEmacs or */ +/* various system shared libraries have been built and linked with */ +/* GCC >= 2.8. -slb */ +#if defined(GNU_MALLOC) +static void +voodoo_free_hook(void *mem) +{ + /* Disable all calls to free() when XEmacs is exiting and it doesn't */ + /* matter. */ + __free_hook = voodoo_free_hook; +} +#endif + DEFUN ("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. @@ -2116,6 +2132,10 @@ shut_down_emacs (0, ((STRINGP (arg)) ? arg : Qnil)); +#if defined(GNU_MALLOC) + __free_hook = voodoo_free_hook; +#endif + exit ((INTP (arg)) ? XINT (arg) : 0); /* NOTREACHED */ return Qnil; /* I'm sick of the compiler warning */ @@ -2282,6 +2302,7 @@ } #else /* not HAVE_SHM */ +extern void disable_free_hook (void); DEFUN ("dump-emacs", Fdump_emacs, 2, 2, 0, /* Dump current state of XEmacs into executable file FILENAME. @@ -2305,7 +2326,8 @@ /* When we're dumping, we can't use the debugging free() */ - disable_free_hook (); +#endif +#if 1 /* martin */ #endif CHECK_STRING (intoname); @@ -2355,26 +2377,29 @@ } #else /* not MSDOS and EMX */ { - CONST char *intoname_ext; - CONST char *symname_ext; + char *intoname_ext; + char *symname_ext; GET_C_STRING_FILENAME_DATA_ALLOCA (intoname, intoname_ext); if (STRINGP (symname)) GET_C_STRING_FILENAME_DATA_ALLOCA (symname, symname_ext); else symname_ext = 0; + + garbage_collect_1 (); #ifdef DOUG_LEA_MALLOC - malloc_state_ptr = malloc_get_state (); + malloc_state_ptr = malloc_get_state (); +#endif +#ifdef ERROR_CHECK_MALLOC + disable_free_hook (); #endif - /* here we break our rule that the filename conversion should - be performed at the actual time that the system call is made. - It's a whole lot easier to do the conversion here than to - modify all the unexec routines to ensure that filename - conversion is applied everywhere. Don't worry about memory - leakage because this call only happens once. */ - unexec ((char *) intoname_ext, (char *) symname_ext, - (uintptr_t) my_edata, - 0, 0); + /* here we break our rule that the filename conversion should + be performed at the actual time that the system call is made. + It's a whole lot easier to do the conversion here than to + modify all the unexec routines to ensure that filename + conversion is applied everywhere. Don't worry about memory + leakage because this call only happens once. */ + unexec (intoname_ext, symname_ext, (uintptr_t) my_edata, 0, 0); #ifdef DOUG_LEA_MALLOC free (malloc_state_ptr); #endif @@ -2395,19 +2420,18 @@ #endif DEFUN ("decode-path-internal", Fdecode_path_internal, 1, 1, 0, /* -Explode a colon-separated list of paths into a string list. +Explode a colon-separated list of paths into a list of strings. */ (cd_path)) { - if (NILP(cd_path)) - { - return Qnil; - } + if (NILP (cd_path)) + return Qnil; + CHECK_STRING (cd_path); - return (!XSTRING_LENGTH(cd_path)) ? - list1(Qnil) : - decode_path(XSTRING_DATA(cd_path)); + return !XSTRING_LENGTH (cd_path) ? + list1 (Qnil) : + decode_path ((char *) XSTRING_DATA (cd_path)); } Lisp_Object @@ -2416,7 +2440,7 @@ REGISTER CONST char *p; Lisp_Object lpath = Qnil; - if (!path || !strlen(path)) return Qnil; + if (!path || !strlen (path)) return Qnil; #if defined (MSDOS) || defined (WIN32) dostounix_filename (path); @@ -2478,7 +2502,7 @@ stderr_out ("Fatal error: assertion failed, file %s, line %d, %s\n", file, line, expr); #undef abort /* avoid infinite #define loop... */ -#if defined (_WIN32) && defined (DEBUG_XEMACS) +#if defined (WINDOWSNT) && defined (DEBUG_XEMACS) DebugBreak (); #elif !defined (ASSERTIONS_DONT_ABORT) abort (); @@ -2551,8 +2575,8 @@ vars_of_emacs (void) { DEFVAR_BOOL ("suppress-early-error-handler-backtrace", - &suppress_early_backtrace /* -Non-nil means early error handler shouldn't print a backtrace + &suppress_early_error_handler_backtrace /* +Non-nil means early error handler shouldn't print a backtrace. */ ); DEFVAR_LISP ("command-line-args", &Vcommand_line_args /* @@ -2584,7 +2608,7 @@ #endif DEFVAR_LISP ("system-type", &Vsystem_type /* -Value is symbol indicating type of operating system you are using. +Symbol indicating type of operating system you are using. */ ); Vsystem_type = intern (SYSTEM_TYPE); Fprovide (intern(SYSTEM_TYPE)); @@ -2593,7 +2617,7 @@ # define EMACS_CONFIGURATION "UNKNOWN" #endif DEFVAR_LISP ("system-configuration", &Vsystem_configuration /* -Value is string indicating configuration XEmacs was built for. +String naming the configuration XEmacs was built for. */ ); Vsystem_configuration = Fpurecopy (build_string (EMACS_CONFIGURATION));
--- a/src/emacsfns.h Mon Aug 13 10:27:41 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1857 +0,0 @@ -/* Various function declarations for XEmacs. - Used to be part of lisp.h - Copyright (C) 1985-1987, 1992-1994 Free Software Foundation, Inc. - -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: Mule 2.0. Divergent from FSF. */ - -#ifndef _EMACSFNS_H_ -#define _EMACSFNS_H_ - - -/* Defined in abbrev.c */ -extern Lisp_Object Vfundamental_mode_abbrev_table; -Lisp_Object Fexpand_abbrev (void); - - -/* Defined in alloc.c */ -void release_breathing_space (void); -Lisp_Object Fcons (Lisp_Object car, Lisp_Object cdr); -Lisp_Object noseeum_cons (Lisp_Object car, Lisp_Object cdr); -Lisp_Object Flist (int nargs, Lisp_Object *args); -Lisp_Object Fmake_list (Lisp_Object length, Lisp_Object init); -Lisp_Object Fmake_vector (Lisp_Object length, Lisp_Object init); -Lisp_Object make_vector (EMACS_INT length, Lisp_Object init); -Lisp_Object Fvector (int nargs, Lisp_Object *args); -Lisp_Object vector1 (Lisp_Object); -Lisp_Object vector2 (Lisp_Object, Lisp_Object); -Lisp_Object vector3 (Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object vector4 (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object); -Lisp_Object vector5 (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object); -Lisp_Object vector6 (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object vector7 (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object); -Lisp_Object vector8 (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object); -Lisp_Object make_bit_vector (EMACS_INT length, Lisp_Object init); -Lisp_Object make_bit_vector_from_byte_vector (unsigned char *bytevec, - EMACS_INT length); -Lisp_Object Fmake_bit_vector (Lisp_Object length, Lisp_Object init); -Lisp_Object Fmake_symbol (Lisp_Object name); -Lisp_Object Fmake_marker (void); -Lisp_Object noseeum_make_marker (void); -Lisp_Object Fmake_string (Lisp_Object length, Lisp_Object init); -void garbage_collect_1 (void); -Lisp_Object Fgarbage_collect (void); -Lisp_Object list1 (Lisp_Object); -Lisp_Object list2 (Lisp_Object, Lisp_Object); -Lisp_Object list3 (Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object list4 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object); -Lisp_Object list6 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object); - -DECLARE_DOESNT_RETURN (memory_full (void)); -void disksave_object_finalization (void); -extern int purify_flag; -extern int gc_currently_forbidden; -Lisp_Object restore_gc_inhibit (Lisp_Object); -extern EMACS_INT gc_generation_number[1]; -int purified (Lisp_Object); - -Lisp_Object build_string (CONST char *); -Lisp_Object build_ext_string (CONST char *str, - enum external_data_format fmt); -Lisp_Object build_translated_string (CONST char *); -Lisp_Object make_string (CONST Bufbyte *, Bytecount); -Lisp_Object make_ext_string (CONST Extbyte *contents, EMACS_INT length, - enum external_data_format fmt); -Lisp_Object make_uninit_string (Bytecount length); - -Lisp_Object make_float (double float_value); - -Lisp_Object Fmake_byte_code (int nargs, Lisp_Object *args); - -Lisp_Object Fpurecopy (Lisp_Object); -int purespace_usage (void); -void report_pure_usage (int report_impurities, - int die_if_pure_storage_exceeded); -Lisp_Object make_pure_string (CONST Bufbyte *, Bytecount len, - Lisp_Object plist, int nocopy); -Lisp_Object make_pure_pname (CONST Bufbyte *, Bytecount len, - int nocopy); -Lisp_Object pure_cons (Lisp_Object, Lisp_Object); -Lisp_Object pure_list (int nargs, Lisp_Object *args); -Lisp_Object make_pure_vector (EMACS_INT len, Lisp_Object init); - -void free_cons (struct Lisp_Cons *ptr); -void free_list (Lisp_Object list); -void free_alist (Lisp_Object alist); -void mark_conses_in_list (Lisp_Object obj); - -void free_marker (struct Lisp_Marker *ptr); - -#ifdef LISP_FLOAT_TYPE -Lisp_Object make_pure_float (double float_value); -/* void free_float (struct Lisp_Float *); */ -#endif - -int object_dead_p (Lisp_Object); - -#ifdef MEMORY_USAGE_STATS -int malloced_storage_size (void *ptr, int claimed_size, - struct overhead_stats *stats); -int fixed_type_block_overhead (int size); -#endif - - -/* Defined in buffer.c */ -Lisp_Object make_buffer (struct buffer *buf); -Lisp_Object Fset_buffer_left_margin_width (Lisp_Object width, - Lisp_Object buffer); -Lisp_Object Fset_buffer_right_margin_width (Lisp_Object width, - Lisp_Object buffer); -Lisp_Object Fbuffer_left_margin_width (Lisp_Object buffer); -Lisp_Object Fbuffer_right_margin_width (Lisp_Object buffer); -Lisp_Object Ferase_buffer (Lisp_Object buffer); -Lisp_Object Fbuffer_disable_undo (Lisp_Object buffer); -Lisp_Object Fkill_buffer (Lisp_Object buffer); -Lisp_Object Fbuffer_name (Lisp_Object buffer); -Lisp_Object Fget_buffer (Lisp_Object name); -Lisp_Object Fget_buffer_create (Lisp_Object name); -Lisp_Object Fget_file_buffer (Lisp_Object fn); -Lisp_Object get_truename_buffer (REGISTER Lisp_Object filename); -Lisp_Object Fset_buffer (Lisp_Object buffer); -Lisp_Object Fbarf_if_buffer_read_only (Lisp_Object buffer, - Lisp_Object s, Lisp_Object e); -Lisp_Object Fcurrent_buffer (void); -void switch_to_buffer (Lisp_Object buf, Lisp_Object norecord); -Lisp_Object Frecord_buffer (Lisp_Object); -Lisp_Object Fother_buffer (Lisp_Object buffer, Lisp_Object frame, - Lisp_Object visible_ok); -Lisp_Object Fbuffer_list (Lisp_Object frame); -Lisp_Object Fset_buffer_modified_p (Lisp_Object flag, - Lisp_Object buffer); -extern Lisp_Object QSscratch; /* "*scratch*" */ -extern Lisp_Object Qbuffer_file_name, Qbuffer_undo_list; -extern Lisp_Object Qdefault_directory; -extern int find_file_compare_truenames; -extern int find_file_use_truenames; -Lisp_Object Fbuffer_modified_p (Lisp_Object buffer); -Lisp_Object Fgenerate_new_buffer_name (Lisp_Object name, - Lisp_Object ignore); -Lisp_Object Frename_buffer (Lisp_Object name, Lisp_Object unique); - -/* Functions to call before and after each text change. */ -extern Lisp_Object Vbefore_change_functions; -extern Lisp_Object Qbefore_change_functions; -extern Lisp_Object Vafter_change_functions; -extern Lisp_Object Qafter_change_functions; - -/* #### Obsolete, for compatibility */ -extern Lisp_Object Vbefore_change_function; -extern Lisp_Object Qbefore_change_function; -extern Lisp_Object Vafter_change_function; -extern Lisp_Object Qafter_change_function; - -extern Lisp_Object Vfirst_change_hook; -extern Lisp_Object Qfirst_change_hook; -extern Lisp_Object Vinhibit_read_only; - -extern Lisp_Object Qpermanent_local, Qprotected_field; - - -/* Defined in bytecode.c */ -extern Lisp_Object Qbyte_code; -Lisp_Object Fbyte_code (Lisp_Object bytestr, - Lisp_Object constants_vector, - Lisp_Object maxdepth); - - -/* Defined in callint.c */ -extern Lisp_Object Vcommand_history; -extern Lisp_Object Qcall_interactively; -Lisp_Object Fcall_interactively (Lisp_Object fn, Lisp_Object record, - Lisp_Object keys); -Lisp_Object Fprefix_numeric_value (Lisp_Object prefix); -extern Lisp_Object Qread_from_minibuffer; -extern Lisp_Object Qenable_recursive_minibuffers; -extern Lisp_Object Qcompleting_read; -extern Lisp_Object Qread_file_name; -extern Lisp_Object Qread_directory_name; -extern Lisp_Object Qread_buffer; -extern Lisp_Object Qmouse_leave_buffer_hook; - - -/* Defined in callproc.c */ -extern Lisp_Object Vexec_path, Vexec_directory, Vdata_directory, - Vdata_directory_list, Vdoc_directory, Vsite_directory; - - -/* Defined in casefiddle.c */ -Lisp_Object Fupcase (Lisp_Object obj, Lisp_Object buffer); -Lisp_Object Fdowncase (Lisp_Object obj, Lisp_Object buffer); -Lisp_Object Fcapitalize (Lisp_Object obj, Lisp_Object buffer); -Lisp_Object Fupcase_initials (Lisp_Object obj, Lisp_Object buffer); -Lisp_Object Fupcase_region (Lisp_Object b, Lisp_Object e, - Lisp_Object buffer); -Lisp_Object Fdowncase_region (Lisp_Object b, Lisp_Object e, - Lisp_Object buffer); -Lisp_Object Fcapitalize_region (Lisp_Object b, Lisp_Object e, - Lisp_Object buffer); -Lisp_Object Fupcase_initials_region (Lisp_Object b, Lisp_Object e, - Lisp_Object buffer); -Lisp_Object Fupcase_word (Lisp_Object arg, Lisp_Object buffer); -Lisp_Object Fdowncase_word (Lisp_Object arg, Lisp_Object buffer); -Lisp_Object Fcapitalize_word (Lisp_Object arg, Lisp_Object buffer); - -extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table; -extern Lisp_Object Vascii_canon_table, Vascii_eqv_table; -extern Lisp_Object Vmirror_ascii_downcase_table, Vmirror_ascii_upcase_table; -extern Lisp_Object Vmirror_ascii_canon_table, Vmirror_ascii_eqv_table; - - -/* Defined in chartab.c */ -Lisp_Object Fmake_char_table (Lisp_Object type); -Lisp_Object Fput_char_table (Lisp_Object from, Lisp_Object to, - Lisp_Object table); -Lisp_Object Fcopy_char_table (Lisp_Object table); - - -/* Defined in cmdloop.c */ -Lisp_Object Frecursive_edit (void); -extern Lisp_Object Qdisabled, Qtop_level; -extern Lisp_Object Vdisabled_command_hook; -Lisp_Object Fcommand_loop_1 (void); -extern Lisp_Object Qreally_early_error_handler; - - -/* Defined in cmds.c */ -Lisp_Object Fforward_char (Lisp_Object n, Lisp_Object buffer); -Lisp_Object Fforward_line (Lisp_Object n, Lisp_Object buffer); -Lisp_Object Fend_of_line (Lisp_Object n, Lisp_Object buffer); -Lisp_Object Fbeginning_of_line (Lisp_Object n, Lisp_Object buffer); -extern Lisp_Object Qself_insert_command; - - -/* Defined in console.c */ -Lisp_Object Fset_input_mode (Lisp_Object interrupt, - Lisp_Object flow, - Lisp_Object meta, - Lisp_Object quit, - Lisp_Object console); -Lisp_Object Fselect_console (Lisp_Object); -Lisp_Object Fselected_console (void); -Lisp_Object Fdelete_console (Lisp_Object console, Lisp_Object force); -Lisp_Object Fconsole_type (Lisp_Object); -Lisp_Object Fconsole_name (Lisp_Object); -Lisp_Object Fconsole_enable_input (Lisp_Object console); -Lisp_Object Fconsole_disable_input (Lisp_Object console); -void stuff_buffered_input (Lisp_Object stuffstring); -extern Lisp_Object Qx, Qns, Qtty, Qstream; -extern Lisp_Object Qcreate_console_hook, Qdelete_console_hook; - - -/* Defined in data.c */ -extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; -extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level, Qsignal; -extern Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range; -extern Lisp_Object Qvoid_function, Qvoid_variable; -extern Lisp_Object Qcyclic_function_indirection, Qcyclic_variable_indirection; -extern Lisp_Object Qsetting_constant, Qinvalid_read_syntax; -extern Lisp_Object Qmalformed_list, Qmalformed_property_list; -extern Lisp_Object Qcircular_list, Qcircular_property_list; -extern Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch; -extern Lisp_Object Qio_error; -extern Lisp_Object Qend_of_file, Qarith_error; -extern Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; -extern Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error; -extern Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; - -extern Lisp_Object Qintegerp, Qnatnump, Qsymbolp, Qlistp, Qconsp; -extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp, Qsubrp; -extern Lisp_Object Qcharacterp, Qchar_or_string_p, Qmarkerp, Qvectorp; -extern Lisp_Object Qbitp, Qbit_vectorp; -extern Lisp_Object Qinteger_or_char_p; -extern Lisp_Object Qinteger_or_marker_p, Qboundp, Qfboundp; -extern Lisp_Object Qcons; -extern Lisp_Object Qcdr, Qignore; - -extern Lisp_Object Qnumberp, Qnumber_or_marker_p; -extern Lisp_Object Qnumber_char_or_marker_p; - -extern Lisp_Object Qvalues; -extern Lisp_Object Qprogn; -extern Lisp_Object Qstring_or_buffer_p; - -extern Lisp_Object Qfloatp; -Lisp_Object Ftruncate (Lisp_Object n); - -Lisp_Object Flistp (Lisp_Object x); - -Lisp_Object Fcar (Lisp_Object cons), Fcar_safe (Lisp_Object cons); -Lisp_Object Fcdr (Lisp_Object cons), Fcdr_safe (Lisp_Object cons); -Lisp_Object Fsetcar (Lisp_Object cons, Lisp_Object val); -Lisp_Object Fsetcdr (Lisp_Object cons, Lisp_Object val); -Lisp_Object Faref (Lisp_Object array, Lisp_Object idx); -Lisp_Object Faset (Lisp_Object array, Lisp_Object idx, Lisp_Object x); -Lisp_Object Farray_length (Lisp_Object array); -Lisp_Object Felt (Lisp_Object seq, Lisp_Object idx); - -Lisp_Object Fzerop (Lisp_Object); -Lisp_Object Fnumber_to_string (Lisp_Object num); -Lisp_Object Fstring_to_number (Lisp_Object str, Lisp_Object base); -Lisp_Object Fsubr_min_args (Lisp_Object subr); -Lisp_Object Fsubr_max_args (Lisp_Object subr); - -#ifndef make_int -Lisp_Object make_int (EMACS_INT); -#endif -#ifndef make_char -Lisp_Object make_char (Emchar num); -#endif -DECLARE_DOESNT_RETURN (pure_write_error (void)); -DECLARE_DOESNT_RETURN (args_out_of_range (Lisp_Object, Lisp_Object)); -DECLARE_DOESNT_RETURN (args_out_of_range_3 (Lisp_Object, Lisp_Object, - Lisp_Object)); -Lisp_Object wrong_type_argument (Lisp_Object pred, Lisp_Object value); -DECLARE_DOESNT_RETURN (dead_wrong_type_argument (Lisp_Object predicate, - Lisp_Object value)); -void check_int_range (int val, int min, int max); - -Lisp_Object word_to_lisp (unsigned int); -unsigned int lisp_to_word (Lisp_Object); - -Lisp_Object Fcompiled_function_instructions (Lisp_Object function); -Lisp_Object Fcompiled_function_constants (Lisp_Object function); -Lisp_Object Fcompiled_function_stack_depth (Lisp_Object function); -Lisp_Object Fcompiled_function_arglist (Lisp_Object function); -Lisp_Object Fcompiled_function_interactive (Lisp_Object function); -Lisp_Object Fcompiled_function_domain (Lisp_Object function); -Lisp_Object Fcompiled_function_annotation (Lisp_Object function); - -Lisp_Object Fquo (int nargs, Lisp_Object *args); -Lisp_Object Fsub1 (Lisp_Object num); -Lisp_Object Fadd1 (Lisp_Object num); - -Lisp_Object Fgtr (Lisp_Object num1, Lisp_Object num2); -Lisp_Object Flss (Lisp_Object num1, Lisp_Object num2); -Lisp_Object Fleq (Lisp_Object num1, Lisp_Object num2); -Lisp_Object Fgeq (Lisp_Object num1, Lisp_Object num2); - -Lisp_Object Fminus (int nargs, Lisp_Object *args); -Lisp_Object Fplus (int nargs, Lisp_Object *args); -Lisp_Object Fmin (int nargs, Lisp_Object *args); -Lisp_Object Fmax (int nargs, Lisp_Object *args); -Lisp_Object Ftimes (int nargs, Lisp_Object *args); -Lisp_Object Frem (Lisp_Object num1, Lisp_Object num2); - - -/* Defined in device.c */ -Lisp_Object Fmake_device (Lisp_Object type, Lisp_Object connection, - Lisp_Object params); -Lisp_Object Fselect_device (Lisp_Object device); -Lisp_Object Fset_device_selected_frame (Lisp_Object device, Lisp_Object frame); -Lisp_Object Fselected_device (Lisp_Object); -Lisp_Object Fdelete_device (Lisp_Object device, Lisp_Object force); -Lisp_Object Fdevice_console (Lisp_Object); -Lisp_Object Fdevice_name (Lisp_Object); -extern Lisp_Object Qgrayscale, Qmono; -extern Lisp_Object Qcreate_device_hook, Qdelete_device_hook; - -/* Defined in device-tty.c */ -extern Lisp_Object Qinit_post_tty_win; - -/* Defined in dialog.c */ -Lisp_Object Fpopup_dialog_box (Lisp_Object dbox_desc); - - -/* Defined in dired.c */ -Lisp_Object make_directory_hash_table (char *path); -Lisp_Object wasteful_word_to_lisp (unsigned int item); - - -/* Defined in doc.c */ -extern Lisp_Object Vdoc_file_name; -Lisp_Object Fsubstitute_command_keys (Lisp_Object string); -Lisp_Object Fdocumentation (Lisp_Object fun, Lisp_Object raw); -Lisp_Object Fdocumentation_property (Lisp_Object sym, Lisp_Object prop, - Lisp_Object raw); -Lisp_Object unparesseuxify_doc_string (int fd, EMACS_INT position, - char *name_nonreloc, - Lisp_Object name_reloc); -Lisp_Object read_doc_string (Lisp_Object filepos); - - -/* Defined in doprnt.c */ -Bytecount emacs_doprnt_c (Lisp_Object stream, - CONST Bufbyte *format_nonreloc, - Lisp_Object format_reloc, - Bytecount format_length, - ...); -Bytecount emacs_doprnt_va (Lisp_Object stream, - CONST Bufbyte *format_nonreloc, - Lisp_Object format_reloc, - Bytecount format_length, - va_list vargs); -Bytecount emacs_doprnt_lisp (Lisp_Object stream, - CONST Bufbyte *format_nonreloc, - Lisp_Object format_reloc, - Bytecount format_length, - int nargs, CONST Lisp_Object *largs); -Bytecount emacs_doprnt_lisp_2 (Lisp_Object stream, - CONST Bufbyte *format_nonreloc, - Lisp_Object format_reloc, - Bytecount format_length, - int nargs, ...); -Lisp_Object emacs_doprnt_string_c (CONST Bufbyte *format_nonreloc, - Lisp_Object format_reloc, - Bytecount format_length, - ...); -Lisp_Object emacs_doprnt_string_va (CONST Bufbyte *format_nonreloc, - Lisp_Object format_reloc, - Bytecount format_length, - va_list vargs); -Lisp_Object emacs_doprnt_string_lisp (CONST Bufbyte *format_nonreloc, - Lisp_Object format_reloc, - Bytecount format_length, - int nargs, - CONST Lisp_Object *largs); -Lisp_Object emacs_doprnt_string_lisp_2 (CONST Bufbyte *format_nonreloc, - Lisp_Object format_reloc, - Bytecount format_length, - int nargs, ...); - - -/* Defined in editfns.c */ -Bufpos bufpos_clip_to_bounds (Bufpos lower, Bufpos num, Bufpos upper); -Bytind bytind_clip_to_bounds (Bytind lower, Bytind num, Bytind upper); -Lisp_Object time_to_lisp (time_t the_time); -int lisp_to_time (Lisp_Object specified_time, time_t *result); -Lisp_Object Fwiden (Lisp_Object buffer); -Lisp_Object Fnarrow_to_region (Lisp_Object b, Lisp_Object e, - Lisp_Object buffer); -extern Lisp_Object Vprefix_arg, Vcurrent_prefix_arg; -extern Lisp_Object Qcurrent_prefix_arg; -Lisp_Object Fgoto_char (Lisp_Object pos, Lisp_Object buffer); -Lisp_Object Fpoint_min_marker (Lisp_Object buffer); -Lisp_Object Fpoint_max_marker (Lisp_Object buffer); -Lisp_Object Fpoint_min (Lisp_Object buffer); -Lisp_Object Fpoint_max (Lisp_Object buffer); -Lisp_Object Fpoint (Lisp_Object buffer); -Lisp_Object Fpoint_marker (Lisp_Object dont_copy_p, Lisp_Object buffer); -Lisp_Object Fmark_marker (Lisp_Object inactive_p, Lisp_Object buffer); -Lisp_Object Ffollowing_char (Lisp_Object buffer); -Lisp_Object Fpreceding_char (Lisp_Object buffer); -Lisp_Object Fchar_after (Lisp_Object pos, Lisp_Object buffer); -Lisp_Object Finsert (int nargs, Lisp_Object *args); -Lisp_Object Finsert_string (Lisp_Object string, Lisp_Object buffer); -Lisp_Object Finsert_char (Lisp_Object ch, Lisp_Object count, - Lisp_Object ignored, Lisp_Object buffer); -void buffer_insert1 (struct buffer *buf, Lisp_Object arg); -Lisp_Object Finsert_before_markers (int nargs, Lisp_Object *args); -Lisp_Object Finsert_buffer_substring (Lisp_Object buffer, - Lisp_Object b, Lisp_Object e); -Lisp_Object Fdelete_region (Lisp_Object b, Lisp_Object e, - Lisp_Object buffer); -Lisp_Object Feolp (Lisp_Object buffer); -Lisp_Object Feobp (Lisp_Object buffer); -Lisp_Object Fbolp (Lisp_Object buffer); -Lisp_Object Fbobp (Lisp_Object buffer); -Lisp_Object Fformat (int nargs, Lisp_Object *args); -Lisp_Object Fbuffer_substring (Lisp_Object start, Lisp_Object end, - Lisp_Object buffer); -Lisp_Object make_string_from_buffer (struct buffer *buf, - int pos, int length); -Lisp_Object save_excursion_save (void), save_restriction_save (void); -Lisp_Object save_excursion_restore (Lisp_Object info); -Lisp_Object save_restriction_restore (Lisp_Object info); -Lisp_Object Fchar_to_string (Lisp_Object ch); -Lisp_Object Fcurrent_time_seconds (Lisp_Object cons); -Lisp_Object Fgetenv (Lisp_Object var, Lisp_Object interactivep); -extern Lisp_Object Qpoint, Qmark, Qregion_beginning, Qregion_end; -extern Lisp_Object Qformat; - - -/* Defined in emacsfns.c */ -Lisp_Object save_current_buffer_restore (Lisp_Object buffer); - - - -/* Defined in elhash.c */ -Lisp_Object Fhashtablep (Lisp_Object obj); -Lisp_Object Fmake_hashtable (Lisp_Object size, Lisp_Object test_fun); -Lisp_Object Fcopy_hashtable (Lisp_Object old_table); -Lisp_Object Fgethash (Lisp_Object key, Lisp_Object table, - Lisp_Object def); -Lisp_Object Fremhash (Lisp_Object key, Lisp_Object table); -Lisp_Object Fputhash (Lisp_Object key, Lisp_Object val, - Lisp_Object table); -Lisp_Object Fclrhash (Lisp_Object table); -Lisp_Object Fhashtable_fullness (Lisp_Object table); -Lisp_Object Fmaphash (Lisp_Object function, Lisp_Object table); - -extern Lisp_Object Vcharacter_set_property; - - -/* Defined in emacs.c */ -DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (fatal (CONST char *fmt, - ...), - 1, 2); -int stderr_out (CONST char *fmt, ...) PRINTF_ARGS (1, 2); -int stdout_out (CONST char *fmt, ...) PRINTF_ARGS (1, 2); -SIGTYPE fatal_error_signal (int sig); -Lisp_Object make_arg_list (int argc, char **argv); -void make_argc_argv (Lisp_Object argv_list, int *argc, char ***argv); -void free_argc_argv (char **argv); -Lisp_Object decode_env_path (CONST char *evarname, CONST char *default_); -Lisp_Object decode_path (CONST char *path); -/* Nonzero means don't do interactive redisplay and don't change tty modes */ -extern int noninteractive; -Lisp_Object Fkill_emacs (Lisp_Object arg); -extern int preparing_for_armageddon; - -extern Lisp_Object Vcommand_line_args; -extern Lisp_Object Vinvocation_name; -extern Lisp_Object Vinvocation_directory; - -extern int emacs_priority; -extern int running_asynch_code; -extern int suppress_early_backtrace; - -extern Lisp_Object Qsave_buffers_kill_emacs; -extern Lisp_Object Qkill_emacs_hook; -extern Lisp_Object Frunning_temacs_p (void); - -/* Defined in eval.c */ -extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro; -extern Lisp_Object Vinhibit_quit, Vquit_flag, Qinhibit_quit, Qrun_hooks; -extern Lisp_Object Vautoload_queue; -Lisp_Object Fuser_variable_p (Lisp_Object); -Lisp_Object Finteractive_p (void); -Lisp_Object Fsignal (Lisp_Object signame, Lisp_Object data); -DECLARE_DOESNT_RETURN (signal_error (Lisp_Object sig, Lisp_Object data)); -void maybe_signal_error (Lisp_Object sig, Lisp_Object data, Lisp_Object class, - Error_behavior errb); -Lisp_Object maybe_signal_continuable_error (Lisp_Object sig, Lisp_Object data, - Lisp_Object class, - Error_behavior errb); -DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error (CONST char *fmt, - ...), - 1, 2); -void maybe_error (Lisp_Object class, Error_behavior errb, - CONST char *fmt, ...) PRINTF_ARGS (3, 4); -Lisp_Object continuable_error (CONST char *fmt, ...) PRINTF_ARGS (1, 2); -Lisp_Object maybe_continuable_error (Lisp_Object class, Error_behavior errb, - CONST char *fmt, ...) PRINTF_ARGS (3, 4); -DECLARE_DOESNT_RETURN (signal_simple_error (CONST char *, Lisp_Object)); -void maybe_signal_simple_error (CONST char *, Lisp_Object, - Lisp_Object class, Error_behavior errb); -Lisp_Object signal_simple_continuable_error (CONST char *, - Lisp_Object); -Lisp_Object maybe_signal_simple_continuable_error (CONST char *reason, - Lisp_Object frob, - Lisp_Object class, - Error_behavior errb); -DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error_with_frob - (Lisp_Object frob, - CONST char *fmt, ...), - 2, 3); -void maybe_error_with_frob (Lisp_Object frob, Lisp_Object class, - Error_behavior errb, - CONST char *fmt, ...) PRINTF_ARGS (4, 5); -Lisp_Object continuable_error_with_frob (Lisp_Object frob, CONST char *fmt, - ...) PRINTF_ARGS (2, 3); -Lisp_Object maybe_continuable_error_with_frob (Lisp_Object frob, - Lisp_Object class, - Error_behavior errb, - CONST char *fmt, - ...) PRINTF_ARGS (4, 5); -DECLARE_DOESNT_RETURN (signal_simple_error_2 (CONST char *, - Lisp_Object, Lisp_Object)); -void maybe_signal_simple_error_2 (CONST char *reason, Lisp_Object frob0, - Lisp_Object frob1, Lisp_Object class, - Error_behavior errb); -Lisp_Object signal_simple_continuable_error_2 (CONST char *, - Lisp_Object, - Lisp_Object); -Lisp_Object maybe_signal_simple_continuable_error_2 (CONST char *reason, - Lisp_Object frob0, - Lisp_Object frob1, - Lisp_Object class, - Error_behavior errb); -Lisp_Object Fprogn (Lisp_Object args); -Lisp_Object Fcommandp (Lisp_Object obj); -Lisp_Object Feval (Lisp_Object form); -Lisp_Object Fapply (int nargs, Lisp_Object *args); -Lisp_Object funcall_recording_as (Lisp_Object recorded_as, int nargs, - Lisp_Object *args); -Lisp_Object Ffuncall (int nargs, Lisp_Object *args); -Lisp_Object Fbacktrace (Lisp_Object stream, Lisp_Object detailed); -Lisp_Object run_hook_with_args_in_buffer (struct buffer *buf, int nargs, - Lisp_Object *args, - enum run_hooks_condition cond); -Lisp_Object run_hook_with_args (int nargs, Lisp_Object *args, - enum run_hooks_condition cond); -void va_run_hook_with_args (Lisp_Object hook_var, int nargs, ...); -void va_run_hook_with_args_in_buffer (struct buffer *buf, Lisp_Object hook_var, - int nargs, ...); -Lisp_Object run_hook (Lisp_Object hook); -Lisp_Object apply1 (Lisp_Object fn, Lisp_Object args); -Lisp_Object call0 (Lisp_Object fn); -Lisp_Object call1 (Lisp_Object fn, Lisp_Object a0); -Lisp_Object call2 (Lisp_Object fn, Lisp_Object a0, Lisp_Object a1); -Lisp_Object call3 (Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, Lisp_Object a2); -Lisp_Object call4 (Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, Lisp_Object a2, - Lisp_Object a3); -Lisp_Object call5 (Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, Lisp_Object a2, - Lisp_Object a3, Lisp_Object a4); -Lisp_Object call6 (Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, Lisp_Object a2, - Lisp_Object a3, Lisp_Object a4, Lisp_Object a5); -Lisp_Object call7 (Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, Lisp_Object a2, - Lisp_Object a3, Lisp_Object a4, Lisp_Object a5, - Lisp_Object a6); -Lisp_Object call8 (Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, Lisp_Object a2, - Lisp_Object a3, Lisp_Object a4, Lisp_Object a5, - Lisp_Object a6, Lisp_Object a7); -Lisp_Object call0_in_buffer (struct buffer *buf, Lisp_Object fn); -Lisp_Object call1_in_buffer (struct buffer *buf, Lisp_Object fn, - Lisp_Object a0); -Lisp_Object call2_in_buffer (struct buffer *buf, Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1); -Lisp_Object call3_in_buffer (struct buffer *buf, Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, - Lisp_Object a2); -Lisp_Object call4_in_buffer (struct buffer *buf, Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, - Lisp_Object a2, Lisp_Object a3); -Lisp_Object call5_in_buffer (struct buffer *buf, Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, - Lisp_Object a2, Lisp_Object a3, - Lisp_Object a4); -Lisp_Object call6_in_buffer (struct buffer *buf, Lisp_Object fn, - Lisp_Object a0, Lisp_Object a1, - Lisp_Object a2, Lisp_Object a3, - Lisp_Object a4, Lisp_Object a5); -Lisp_Object eval_in_buffer (struct buffer *buf, Lisp_Object form); -Lisp_Object call0_with_handler (Lisp_Object handler, Lisp_Object fn); -Lisp_Object call1_with_handler (Lisp_Object handler, Lisp_Object fn, - Lisp_Object a0); -Lisp_Object eval_in_buffer_trapping_errors (CONST char *warning_string, - struct buffer *buf, - Lisp_Object form); -Lisp_Object run_hook_trapping_errors (CONST char *warning_string, - Lisp_Object hook_symbol); -Lisp_Object safe_run_hook_trapping_errors (CONST char *warning_string, - Lisp_Object hook_symbol, - int allow_quit); -Lisp_Object call0_trapping_errors (CONST char *warning_string, - Lisp_Object function); -Lisp_Object call1_trapping_errors (CONST char *warning_string, - Lisp_Object function, - Lisp_Object object); -Lisp_Object call2_trapping_errors (CONST char *warning_string, - Lisp_Object function, - Lisp_Object object1, - Lisp_Object object2); -Lisp_Object call_with_suspended_errors (lisp_fn_t fun, - volatile Lisp_Object retval, - Lisp_Object class, - Error_behavior errb, - int nargs, ...); -/* C Code should be using internal_catch, record_unwind_p, condition_case_1 */ -/* Lisp_Object Fcatch (Lisp_Object args); */ -/* Lisp_Object Funwind_protect (Lisp_Object args); */ -/* Lisp_Object Fcondition_case (Lisp_Object args); */ -Lisp_Object Fthrow (Lisp_Object tag, Lisp_Object val); -Lisp_Object internal_catch (Lisp_Object tag, - Lisp_Object (*func) (Lisp_Object arg), - Lisp_Object arg, - int *threw); -Lisp_Object condition_case_1 (Lisp_Object handlers, - Lisp_Object (*bfun) (Lisp_Object barg), - Lisp_Object barg, - Lisp_Object (*hfun) (Lisp_Object val, - Lisp_Object harg), - Lisp_Object harg); -Lisp_Object Fcondition_case_3 (Lisp_Object bodyform, - Lisp_Object var, - Lisp_Object handlers); -Lisp_Object unbind_to (int n, Lisp_Object val); -void specbind (Lisp_Object symbol, Lisp_Object value); -void record_unwind_protect (Lisp_Object (*function) (Lisp_Object arg), - Lisp_Object arg); -void do_autoload (Lisp_Object fundef, Lisp_Object funname); -Lisp_Object un_autoload (Lisp_Object oldqueue); -void warn_when_safe_lispobj (Lisp_Object class, Lisp_Object level, - Lisp_Object obj); -void warn_when_safe (Lisp_Object class, Lisp_Object level, - CONST char *fmt, ...) PRINTF_ARGS (3, 4); -Lisp_Object Fcommand_execute (Lisp_Object cmd, Lisp_Object record, - Lisp_Object keys); -Lisp_Object Ffetch_bytecode (Lisp_Object object); - - -/* Defined in event-stream.c */ -Lisp_Object Fread_key_sequence (Lisp_Object prompt, Lisp_Object continue_echo, - Lisp_Object dont_downcase_last); -Lisp_Object Fsit_for (Lisp_Object seconds, Lisp_Object nodisp); -Lisp_Object Fsleep_for (Lisp_Object seconds); -Lisp_Object Faccept_process_output (Lisp_Object process, - Lisp_Object timeout_secs, - Lisp_Object timeout_msecs); -Lisp_Object Fnext_event (Lisp_Object event, Lisp_Object prompt); -Lisp_Object Fnext_command_event (Lisp_Object event, Lisp_Object prompt); -Lisp_Object Fdispatch_event (Lisp_Object event); -void wait_delaying_user_input (int (*predicate) (void *arg), - void *predicate_arg); -int detect_input_pending (void); -void enqueue_command_event (Lisp_Object event); -Lisp_Object dequeue_command_event (void); -Lisp_Object Fadd_timeout (Lisp_Object secs, - Lisp_Object function, Lisp_Object object, - Lisp_Object resignal); -Lisp_Object Fdisable_timeout (Lisp_Object id); -void reset_this_command_keys (Lisp_Object console, int clear_echo_area_p); -Lisp_Object Fenqueue_eval_event (Lisp_Object function, - Lisp_Object object); -Lisp_Object enqueue_misc_user_event (Lisp_Object channel, - Lisp_Object function, - Lisp_Object object); -extern Lisp_Object Qpre_command_hook, Qpost_command_hook; -Lisp_Object Fdiscard_input (void), Finput_pending_p (void); - - -/* Defined in event-Xt.c */ -extern Lisp_Object Qsans_modifiers; -void signal_special_Xt_user_event (Lisp_Object channel, - Lisp_Object function, - Lisp_Object object); - - -/* Defined in events.c */ -void clear_event_resource (void); -Lisp_Object Fmake_event (Lisp_Object, Lisp_Object); -Lisp_Object Fdeallocate_event (Lisp_Object event); -Lisp_Object Fcopy_event (Lisp_Object from, Lisp_Object to); -Lisp_Object allocate_event (void); -int event_to_character (struct Lisp_Event *event, - int allow_extra_modifiers, - int allow_meta, - int allow_non_ascii); -Lisp_Object Fcharacter_to_event (Lisp_Object ch, Lisp_Object event, - Lisp_Object console, - Lisp_Object use_console_meta_flag); -Lisp_Object Fevent_to_character (Lisp_Object e, - Lisp_Object allow_extra_modifiers, - Lisp_Object allow_meta, - Lisp_Object allow_non_ascii); -Lisp_Object Fevent_over_text_area_p (Lisp_Object event); -Lisp_Object Fevent_over_modeline_p (Lisp_Object event); -Lisp_Object Fevent_over_border_p (Lisp_Object event); -Lisp_Object Fevent_over_toolbar_p (Lisp_Object event); -Lisp_Object Fevent_window (Lisp_Object event); -Lisp_Object Fevent_buffer (Lisp_Object event); -Lisp_Object Fevent_button (Lisp_Object event); -Lisp_Object Fevent_function (Lisp_Object event); -Lisp_Object Fevent_glyph_extent (Lisp_Object event); -Lisp_Object Fevent_modeline_position (Lisp_Object event); -Lisp_Object Fevent_key (Lisp_Object event); -Lisp_Object Fevent_modifiers (Lisp_Object event); -Lisp_Object Fevent_modifier_bits (Lisp_Object event); -Lisp_Object Fevent_object (Lisp_Object event); -Lisp_Object Fevent_point (Lisp_Object event); -Lisp_Object Fevent_process (Lisp_Object event); -Lisp_Object Fevent_timestamp (Lisp_Object event); -Lisp_Object Fevent_x (Lisp_Object event); -Lisp_Object Fevent_y (Lisp_Object event); -Lisp_Object Fevent_x_pixel (Lisp_Object event); -Lisp_Object Fevent_y_pixel (Lisp_Object event); - -extern Lisp_Object QKbackspace, QKtab, QKlinefeed, QKreturn; -extern Lisp_Object QKescape, QKspace, QKdelete, QKnosymbol; - - -/* Defined in extents.c */ -Lisp_Object Fextentp (Lisp_Object obj); -Lisp_Object Fextent_object (Lisp_Object ext); -Lisp_Object Fextent_start_position (Lisp_Object ext); -Lisp_Object Fextent_end_position (Lisp_Object ext); -Lisp_Object Fextent_length (Lisp_Object ext); -Lisp_Object Fmake_extent (Lisp_Object from, Lisp_Object to, - Lisp_Object buffer); -Lisp_Object Fset_extent_endpoints (Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object); -Lisp_Object Fdelete_extent (Lisp_Object extent); -Lisp_Object Fdetach_extent (Lisp_Object); -Lisp_Object Fmap_extents (Lisp_Object function, - Lisp_Object buffer, - Lisp_Object from, Lisp_Object to, - Lisp_Object maparg, - Lisp_Object flags, - Lisp_Object property, - Lisp_Object value); -Lisp_Object Fextent_at (Lisp_Object pos, Lisp_Object buffer, - Lisp_Object flag, Lisp_Object before, - Lisp_Object at_flag); -Lisp_Object Fextent_face (Lisp_Object); -Lisp_Object Fset_extent_face (Lisp_Object, Lisp_Object); -Lisp_Object Fset_extent_begin_glyph (Lisp_Object extent, - Lisp_Object begin_glyph, - Lisp_Object layout); -Lisp_Object Fset_extent_end_glyph (Lisp_Object extent_obj, - Lisp_Object glyph, - Lisp_Object layout); -Lisp_Object Fset_extent_begin_glyph_layout (Lisp_Object extent, - Lisp_Object layout); -Lisp_Object Fset_extent_end_glyph_layout (Lisp_Object extent, - Lisp_Object layout); -Lisp_Object Fextent_begin_glyph_layout (Lisp_Object extent); -Lisp_Object Fextent_end_glyph_layout (Lisp_Object extent); -Lisp_Object Fset_extent_priority (Lisp_Object extent, Lisp_Object pri); -Lisp_Object Fset_extent_property (Lisp_Object,Lisp_Object,Lisp_Object); -Lisp_Object Fextent_property (Lisp_Object extent, Lisp_Object, - Lisp_Object default_); -Lisp_Object Fextent_properties (Lisp_Object extent); -Lisp_Object Fforce_highlight_extent (Lisp_Object extent, - Lisp_Object flag); -Lisp_Object Fhighlight_extent (Lisp_Object extent, Lisp_Object flag); -Lisp_Object Fset_extent_parent (Lisp_Object, Lisp_Object); - -Lisp_Object Fnext_single_property_change (Lisp_Object pos, - Lisp_Object prop, - Lisp_Object buffer, - Lisp_Object limit); -Lisp_Object Fprevious_single_property_change (Lisp_Object pos, - Lisp_Object prop, - Lisp_Object buffer, - Lisp_Object limit); -Lisp_Object Fput_text_property (Lisp_Object start, - Lisp_Object end, - Lisp_Object prop, - Lisp_Object value, - Lisp_Object object); -Lisp_Object Fextent_in_region_p(Lisp_Object extent, - Lisp_Object from, - Lisp_Object to, - Lisp_Object flags); - -extern Lisp_Object Qdetached, Qdestroyed, Qbegin_glyph, Qend_glyph; -extern Lisp_Object Qstart_open, Qend_open, Qread_only; -extern Lisp_Object Qunique, Qduplicable; -extern Lisp_Object Qoutside_margin, Qinside_margin, Qwhitespace; -extern Lisp_Object Qglyph_invisible; - - -/* Defined in faces.c */ -extern Lisp_Object Vbuilt_in_face_specifiers; -Lisp_Object Fface_name (Lisp_Object); - - -/* Defined in fileio.c */ -extern Lisp_Object Qfile_name_handler_alist; -extern Lisp_Object Qfile_error; -Lisp_Object Ffile_name_as_directory (Lisp_Object fn); -Lisp_Object Fexpand_file_name (Lisp_Object fn, Lisp_Object def); -Lisp_Object Ffile_name_nondirectory (Lisp_Object fn); -Lisp_Object Fsubstitute_in_file_name (Lisp_Object fn); -Lisp_Object Ffile_symlink_p (Lisp_Object fn); -Lisp_Object Ffile_truename (Lisp_Object name, Lisp_Object def); -Lisp_Object Ffile_name_nondirectory (Lisp_Object fn); -Lisp_Object Ffile_name_directory (Lisp_Object fn); -Lisp_Object Fdirectory_file_name (Lisp_Object fn); -Lisp_Object Ffile_directory_p (Lisp_Object fn); -Lisp_Object Ffile_readable_p (Lisp_Object fn); -Lisp_Object Ffile_name_absolute_p (Lisp_Object fn); -Lisp_Object Ffile_exists_p (Lisp_Object fn); -Lisp_Object Ffile_executable_p (Lisp_Object filename); -Lisp_Object Ffile_accessible_directory_p (Lisp_Object fn); -void record_auto_save (void); -void force_auto_save_soon (void); -Lisp_Object Ffind_file_name_handler (Lisp_Object filename, - Lisp_Object operation); -DECLARE_DOESNT_RETURN (report_file_error (CONST char *string, - Lisp_Object data)); -void maybe_report_file_error (CONST char *string, Lisp_Object data, - Lisp_Object class, Error_behavior errb); -DECLARE_DOESNT_RETURN (signal_file_error (CONST char *string, - Lisp_Object data)); -void maybe_signal_file_error (CONST char *string, Lisp_Object data, - Lisp_Object class, Error_behavior errb); -DECLARE_DOESNT_RETURN (signal_double_file_error (CONST char *string1, - CONST char *string2, - Lisp_Object data)); -void maybe_signal_double_file_error (CONST char *string1, CONST char *string2, - Lisp_Object data, Lisp_Object class, - Error_behavior errb); -DECLARE_DOESNT_RETURN (signal_double_file_error_2 (CONST char *string1, - CONST char *string2, - Lisp_Object data1, - Lisp_Object data2)); -void maybe_signal_double_file_error_2 (CONST char *string1, - CONST char *string2, Lisp_Object data1, - Lisp_Object data2, Lisp_Object class, - Error_behavior errb); -Lisp_Object lisp_strerror (int errnum); -Lisp_Object expand_and_dir_to_file (Lisp_Object fn, Lisp_Object def); -Lisp_Object Finsert_file_contents_internal (Lisp_Object filename, - Lisp_Object visit, - Lisp_Object beg, - Lisp_Object end, - Lisp_Object replace, - Lisp_Object codesys, - Lisp_Object used_codesys); -Lisp_Object Fdo_auto_save (Lisp_Object nomsg, Lisp_Object current_only); -Lisp_Object Fverify_visited_file_modtime (Lisp_Object buffer); -Lisp_Object Funhandled_file_name_directory (Lisp_Object filename); -Lisp_Object Fset_buffer_modtime (Lisp_Object buf, Lisp_Object in_time); -int read_allowing_quit (int fildes, void *buf, unsigned int nbyte); -int write_allowing_quit (int fildes, CONST void *buf, - unsigned int nbyte); -int internal_delete_file (Lisp_Object filename); - - -/* Defined in filelock.c */ -void lock_file (Lisp_Object fn); -void unlock_file (Lisp_Object fn); -void unlock_all_files (void); -Lisp_Object Flock_buffer (Lisp_Object fn); -Lisp_Object Funlock_buffer (void); -void unlock_buffer (struct buffer *buffer); -Lisp_Object Ffile_locked_p (Lisp_Object fn); - - -/* Defined in filemode.c */ -void filemodestring (struct stat *statp, char *str); - - -/* Defined in floatfns.c */ -double extract_float (Lisp_Object); -Lisp_Object Ffloat (Lisp_Object n); - - -/* Defined in fns.c */ -Lisp_Object list_sort (Lisp_Object list, - Lisp_Object lisp_arg, - int (*pred_fn) (Lisp_Object first, - Lisp_Object second, - Lisp_Object lisp_arg)); -Lisp_Object Fsort (Lisp_Object list, - Lisp_Object pred); -Lisp_Object merge (Lisp_Object org_l1, Lisp_Object org_l2, - Lisp_Object pred); - -extern Lisp_Object Qstring_lessp, Qidentity, Qyes_or_no_p; -extern Lisp_Object Vfeatures; -Lisp_Object Fidentity (Lisp_Object x); -Lisp_Object Frandom (Lisp_Object arg); -Lisp_Object Flength (Lisp_Object seq); -Lisp_Object Fstring_equal (Lisp_Object s1, Lisp_Object s2); -Lisp_Object Fstring_lessp (Lisp_Object s1, Lisp_Object s2); -Lisp_Object string_getprop (struct Lisp_String *s, - Lisp_Object property, - Lisp_Object default_); -void string_putprop (struct Lisp_String *s, Lisp_Object property, - Lisp_Object value); -void bump_string_modiff (Lisp_Object str); -Lisp_Object Fappend (int nargs, Lisp_Object *args); -Lisp_Object Fconcat (int nargs, Lisp_Object *args); -Lisp_Object Fvconcat (int nargs, Lisp_Object *args); -Lisp_Object Fcopy_sequence (Lisp_Object seq); -Lisp_Object Fsubstring (Lisp_Object str, Lisp_Object s, Lisp_Object e); -Lisp_Object Fnthcdr (Lisp_Object n, Lisp_Object list); -Lisp_Object Fnth (Lisp_Object n, Lisp_Object list); -Lisp_Object Fmember (Lisp_Object elt, Lisp_Object list); -Lisp_Object Fold_member (Lisp_Object measles_mumps, Lisp_Object and_rubella); -Lisp_Object Fmemq (Lisp_Object elt, Lisp_Object list); -Lisp_Object Fold_memq (Lisp_Object typhoid, Lisp_Object dysentery); -Lisp_Object memq_no_quit (Lisp_Object elt, Lisp_Object list); -Lisp_Object Fassoc (Lisp_Object elt, Lisp_Object list); -Lisp_Object assoc_no_quit (Lisp_Object key, Lisp_Object alist); -Lisp_Object Fassq (Lisp_Object key, Lisp_Object alist); -Lisp_Object Fold_assq (Lisp_Object syphilis, Lisp_Object gonorrhea); -Lisp_Object assq_no_quit (Lisp_Object key, Lisp_Object alist); -Lisp_Object Frassoc (Lisp_Object key, Lisp_Object alist); -Lisp_Object Frassq (Lisp_Object key, Lisp_Object alist); -Lisp_Object rassq_no_quit (Lisp_Object key, Lisp_Object alist); -Lisp_Object Fdelete (Lisp_Object elt, Lisp_Object list); -Lisp_Object Fdelq (Lisp_Object elt, Lisp_Object list); -Lisp_Object delq_no_quit (Lisp_Object elt, Lisp_Object list); -Lisp_Object delq_no_quit_and_free_cons (Lisp_Object elt, Lisp_Object list); -Lisp_Object Fremassoc (Lisp_Object elt, Lisp_Object list); -Lisp_Object remassoc_no_quit (Lisp_Object key, Lisp_Object list); -Lisp_Object Fremassq (Lisp_Object key, Lisp_Object alist); -Lisp_Object remassq_no_quit (Lisp_Object key, Lisp_Object alist); -Lisp_Object Fremrassoc (Lisp_Object key, Lisp_Object alist); -Lisp_Object Fremrassq (Lisp_Object key, Lisp_Object alist); -Lisp_Object remrassq_no_quit (Lisp_Object key, Lisp_Object alist); -Lisp_Object Freverse (Lisp_Object list), Fnreverse (Lisp_Object list); -Lisp_Object Fget (Lisp_Object sym, Lisp_Object prop, Lisp_Object def); -Lisp_Object Fput (Lisp_Object sym, Lisp_Object prop, Lisp_Object val); - -void pure_put (Lisp_Object sym, Lisp_Object prop, Lisp_Object val); -Lisp_Object Fremprop (Lisp_Object sym, Lisp_Object prop); -int plists_differ (Lisp_Object a, Lisp_Object b, int nil_means_not_present, - int laxp, int depth); -Lisp_Object internal_plist_get (Lisp_Object plist, Lisp_Object property); -void internal_plist_put (Lisp_Object *plist, Lisp_Object property, - Lisp_Object value); -int internal_remprop (Lisp_Object *plist, Lisp_Object property); -Lisp_Object external_plist_get (Lisp_Object *plist, Lisp_Object property, - int laxp, Error_behavior errb); -void external_plist_put (Lisp_Object *plist, Lisp_Object property, - Lisp_Object value, int laxp, Error_behavior errb); -int external_remprop (Lisp_Object *plist, Lisp_Object property, - int laxp, Error_behavior errb); -Lisp_Object Fequal (Lisp_Object one, Lisp_Object two); -Lisp_Object Fold_equal (Lisp_Object ebola, Lisp_Object marburg); -int internal_equal (Lisp_Object, Lisp_Object, int depth); -Lisp_Object Ffillarray (Lisp_Object array, Lisp_Object init); -Lisp_Object Fnconc (int nargs, Lisp_Object *args); -Lisp_Object Fmapcar (Lisp_Object fn, Lisp_Object seq); -Lisp_Object Ffeaturep (Lisp_Object name); -Lisp_Object Frequire (Lisp_Object name, Lisp_Object filename); -Lisp_Object Fprovide (Lisp_Object name); -Lisp_Object concat2 (Lisp_Object s1, Lisp_Object s2); -Lisp_Object concat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3); -Lisp_Object vconcat2 (Lisp_Object s1, Lisp_Object s2); -Lisp_Object vconcat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3); -Lisp_Object nconc2 (Lisp_Object l1, Lisp_Object l2); -Lisp_Object Fcopy_alist (Lisp_Object alist); -Lisp_Object Fcopy_tree (Lisp_Object arg, Lisp_Object vecp); -Lisp_Object Fplist_put (Lisp_Object plist, Lisp_Object prop, Lisp_Object val); -Lisp_Object Fplist_get (Lisp_Object plist, Lisp_Object prop, - Lisp_Object default_); -Lisp_Object Fcanonicalize_plist (Lisp_Object plist, - Lisp_Object infected_with_hemorrhagic_fever); -Lisp_Object Flax_plist_put (Lisp_Object plist, Lisp_Object prop, - Lisp_Object val); -Lisp_Object Flax_plist_get (Lisp_Object plist, Lisp_Object prop, - Lisp_Object default_); -Lisp_Object Flax_plist_remprop (Lisp_Object plist, Lisp_Object prop); -Lisp_Object Fcanonicalize_lax_plist (Lisp_Object plist, - Lisp_Object - infected_with_hemorrhagic_fever); -Lisp_Object Fdestructive_alist_to_plist (Lisp_Object alist); -Lisp_Object Fcheck_valid_plist (Lisp_Object); -Lisp_Object Fvalid_plist_p (Lisp_Object); -void check_losing_bytecode (CONST char *function, Lisp_Object seq); - - -/* Defined in font-lock.c */ -extern Lisp_Object Qcomment, Qblock_comment; -extern Lisp_Object Qbeginning_of_defun, Qend_of_defun; - - -/* Defined in frame.c */ -Lisp_Object Fframep (Lisp_Object obj); -Lisp_Object Fframe_live_p (Lisp_Object obj); -Lisp_Object Fselect_frame (Lisp_Object scr); -Lisp_Object Fselected_frame (Lisp_Object device); -Lisp_Object Fmake_frame (Lisp_Object props, Lisp_Object device); -Lisp_Object Fwindow_frame (Lisp_Object window); -Lisp_Object Fframe_root_window (Lisp_Object frame); -Lisp_Object Fframe_selected_window (Lisp_Object frame); -Lisp_Object Fframe_list (Lisp_Object device); -Lisp_Object Fframe_name (Lisp_Object frame); -Lisp_Object Fnext_frame (Lisp_Object frame, Lisp_Object miniframe, - Lisp_Object device); -Lisp_Object Fmouse_position (Lisp_Object device); -Lisp_Object Fmouse_pixel_position (Lisp_Object device); -Lisp_Object Fset_mouse_position (Lisp_Object window, - Lisp_Object x, Lisp_Object y); -Lisp_Object Fset_mouse_pixel_position (Lisp_Object window, - Lisp_Object x, Lisp_Object y); -Lisp_Object Fraise_frame (Lisp_Object frame); -Lisp_Object Fmake_frame_visible (Lisp_Object frame); -Lisp_Object Fmake_frame_invisible (Lisp_Object frame, - Lisp_Object ignored); -Lisp_Object Ficonify_frame (Lisp_Object frame); -Lisp_Object Fdeiconify_frame (Lisp_Object frame); -Lisp_Object Fframe_visible_p (Lisp_Object frame); -Lisp_Object Fframe_iconified_p (Lisp_Object frame); -Lisp_Object Fvisible_frame_list (Lisp_Object device); -Lisp_Object Fset_frame_height (Lisp_Object frame, - Lisp_Object rows, Lisp_Object pretend); -Lisp_Object Fset_frame_width (Lisp_Object frame, - Lisp_Object cols, Lisp_Object pretend); -Lisp_Object Fset_frame_size (Lisp_Object frame, - Lisp_Object cols, Lisp_Object rows, - Lisp_Object pretend); -Lisp_Object Fset_frame_position (Lisp_Object frame, - Lisp_Object xoffset, - Lisp_Object yoffset); -Lisp_Object Fdelete_frame (Lisp_Object frame, Lisp_Object force); -Lisp_Object Fset_frame_properties (Lisp_Object frame, Lisp_Object plist); -Lisp_Object Fframe_property (Lisp_Object frame, Lisp_Object property, - Lisp_Object default_); -Lisp_Object Fset_frame_pointer (Lisp_Object frame, Lisp_Object pointer); - -extern Lisp_Object Vcreate_frame_hook, Qcreate_frame_hook; -extern Lisp_Object Vmouse_enter_frame_hook, Qmouse_enter_frame_hook; -extern Lisp_Object Vmouse_leave_frame_hook, Qmouse_leave_frame_hook; -extern Lisp_Object Vmap_frame_hook, Qmap_frame_hook; -extern Lisp_Object Vunmap_frame_hook, Qunmap_frame_hook; -extern Lisp_Object Vmouse_motion_handler; -extern Lisp_Object Vsynchronize_minibuffers; - -extern Lisp_Object Qdrag_and_drop_functions; - -extern Lisp_Object Qframep, Qframe_live_p, Qdelete_frame; -extern Lisp_Object Qselect_frame_hook, Qdeselect_frame_hook; -extern Lisp_Object Qsynchronize_minibuffers; -extern Lisp_Object Qbuffer_predicate; - -extern Lisp_Object Qminibuffer; -extern Lisp_Object Qunsplittable; -extern Lisp_Object Qinternal_border_width; -extern Lisp_Object Qtop_toolbar_shadow_color; -extern Lisp_Object Qbottom_toolbar_shadow_color; -extern Lisp_Object Qbackground_toolbar_color; -extern Lisp_Object Qtop_toolbar_shadow_pixmap; -extern Lisp_Object Qbottom_toolbar_shadow_pixmap; -extern Lisp_Object Qtoolbar_shadow_thickness; -extern Lisp_Object Qscrollbar_placement; -extern Lisp_Object Qinter_line_space; -extern Lisp_Object Qvisual_bell; -extern Lisp_Object Qbell_volume; -extern Lisp_Object Qpointer_background; -extern Lisp_Object Qpointer_color; -extern Lisp_Object Qtext_pointer; -extern Lisp_Object Qspace_pointer; -extern Lisp_Object Qmodeline_pointer; -extern Lisp_Object Qgc_pointer; -extern Lisp_Object Qinitially_unmapped; -extern Lisp_Object Quse_backing_store; -extern Lisp_Object Qborder_color; -extern Lisp_Object Qborder_width; - -extern Lisp_Object Qvisible, Qiconic, Qinvisible, Qvisible_iconic; -extern Lisp_Object Qinvisible_iconic; -extern Lisp_Object Qnomini, Qvisible_nomini, Qiconic_nomini, Qinvisible_nomini; -extern Lisp_Object Qvisible_iconic_nomini, Qinvisible_iconic_nomini; - - - -/* Defined in frame-x.c */ -Lisp_Object Fx_window_id (Lisp_Object frame); -extern Lisp_Object Qpopup; - - -/* Defined in general.c */ -extern Lisp_Object Qactually_requested; -extern Lisp_Object Qafter; -extern Lisp_Object Qall; -extern Lisp_Object Qand; -extern Lisp_Object Qassoc; -extern Lisp_Object Qat; -extern Lisp_Object Qautodetect; -extern Lisp_Object Qundecided; -extern Lisp_Object Qbad_variable; -extern Lisp_Object Qbefore; -extern Lisp_Object Qbinary; -extern Lisp_Object Qblack; -extern Lisp_Object Qboolean; -extern Lisp_Object Qbottom; -extern Lisp_Object Qbuffer; -extern Lisp_Object Qbutton; -extern Lisp_Object Qcategory; -extern Lisp_Object Qcase; -extern Lisp_Object Qchannel; -extern Lisp_Object Qchar; -extern Lisp_Object Qcharacter; -extern Lisp_Object Qchars; -extern Lisp_Object Qcolor; -extern Lisp_Object Qcolumns; -extern Lisp_Object Qcommand; -extern Lisp_Object Qconsole; -extern Lisp_Object Qcritical; -extern Lisp_Object Qdata; -extern Lisp_Object Qdead; -extern Lisp_Object Qdelete; -extern Lisp_Object Qdelq; -extern Lisp_Object Qdefault; -extern Lisp_Object Qdevice; -extern Lisp_Object Qdimension; -extern Lisp_Object Qdisplay; -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) -extern Lisp_Object Qdnd_data; -#endif -extern Lisp_Object Qdoc_string; -extern Lisp_Object Qdynarr_overhead; -extern Lisp_Object Qempty; -extern Lisp_Object Qeq; -extern Lisp_Object Qequal; -extern Lisp_Object Qeql; -extern Lisp_Object Qeval; -extern Lisp_Object Qextents; -extern Lisp_Object Qface; -extern Lisp_Object Qfont; -extern Lisp_Object Qframe; -extern Lisp_Object Qfunction; -extern Lisp_Object Qgap_overhead; -extern Lisp_Object Qgeneric; -extern Lisp_Object Qgeometry; -extern Lisp_Object Qglobal; -extern Lisp_Object Qheight; -extern Lisp_Object Qhighlight; -extern Lisp_Object Qid; -extern Lisp_Object Qimage; -extern Lisp_Object Qinfo; -extern Lisp_Object Qinherit; -extern Lisp_Object Qinteger; -extern Lisp_Object Qinternal; -extern Lisp_Object Qkey; -extern Lisp_Object Qkey_assoc; -extern Lisp_Object Qkeyboard; -extern Lisp_Object Qkeymap; -extern Lisp_Object Qleft; -extern Lisp_Object Qlist; -extern Lisp_Object Qmagic; -extern Lisp_Object Qmalloc_overhead; -extern Lisp_Object Qmarkers; -extern Lisp_Object Qmax; -extern Lisp_Object Qmemory; -extern Lisp_Object Qmenubar; -extern Lisp_Object Qmessage; -extern Lisp_Object Qminus; -extern Lisp_Object Qmodifiers; -extern Lisp_Object Qmotion; -extern Lisp_Object Qname; -extern Lisp_Object Qnone; -extern Lisp_Object Qnot; -extern Lisp_Object Qnothing; -extern Lisp_Object Qnotice; -extern Lisp_Object Qobject; -extern Lisp_Object Qonly; -extern Lisp_Object Qor; -extern Lisp_Object Qother; -extern Lisp_Object Qpath; -extern Lisp_Object Qpointer; -extern Lisp_Object Qprint; -extern Lisp_Object Qprocess; -extern Lisp_Object Qprovide; -extern Lisp_Object Qrassoc; -extern Lisp_Object Qrassq; -extern Lisp_Object Qrequire; -extern Lisp_Object Qresource; -extern Lisp_Object Qreturn; -extern Lisp_Object Qreverse; -extern Lisp_Object Qright; -extern Lisp_Object Qold_assoc; -extern Lisp_Object Qold_delete; -extern Lisp_Object Qold_delq; -extern Lisp_Object Qold_rassoc; -extern Lisp_Object Qold_rassq; -extern Lisp_Object Qsearch; -extern Lisp_Object Qsimple; -extern Lisp_Object Qsize; -extern Lisp_Object Qspace; -extern Lisp_Object Qspecifier; -extern Lisp_Object Qstream; -extern Lisp_Object Qstring; -extern Lisp_Object Qsymbol; -extern Lisp_Object Qsyntax; -extern Lisp_Object Qtest; -extern Lisp_Object Qtext; -extern Lisp_Object Qtimeout; -extern Lisp_Object Qtimestamp; -extern Lisp_Object Qtoolbar; -extern Lisp_Object Qtop; -extern Lisp_Object Qtty; -extern Lisp_Object Qtype; -extern Lisp_Object Qundefined; -extern Lisp_Object Qunimplemented; -extern Lisp_Object Qvalue_assoc; -extern Lisp_Object Qvector; -extern Lisp_Object Qwarning; -extern Lisp_Object Qwhite; -extern Lisp_Object Qwidth; -extern Lisp_Object Qwindow; -extern Lisp_Object Qwindow_system; -extern Lisp_Object Qx; -extern Lisp_Object Qy; - - -/* Defined in getloadavg.c */ -int getloadavg (double loadavg[], int nelem); - - -/* Defined in glyphs.c */ -Lisp_Object Fmake_glyph_internal (Lisp_Object type); -Lisp_Object Fmake_image_instance (Lisp_Object data, - Lisp_Object device, - Lisp_Object force_mono, - Lisp_Object no_error); -Lisp_Object Fimage_instance_p (Lisp_Object obj); -Lisp_Object Fimage_instance_type (Lisp_Object image_instance); -Lisp_Object Fglyph_type (Lisp_Object glyph); -extern Lisp_Object Qnothing, Qmono_pixmap, Qcolor_pixmap; -extern Lisp_Object Qsubwindow; -extern Lisp_Object Qformatted_string; -extern Lisp_Object Qicon; -extern Lisp_Object Qconst_glyph_variable; -extern Lisp_Object Qdisplay_table; -Error_behavior decode_error_behavior_flag (Lisp_Object no_error); -Lisp_Object encode_error_behavior_flag (Error_behavior errb); - - -/* Defined in glyphs-x.c */ -Lisp_Object Fcolorize_image_instance (Lisp_Object, Lisp_Object, - Lisp_Object); - - -/* Defined in indent.c */ -Lisp_Object Fvertical_motion (Lisp_Object lines, Lisp_Object window); -Lisp_Object Findent_to (Lisp_Object col, Lisp_Object mincol, - Lisp_Object buffer); -Lisp_Object Fcurrent_column (Lisp_Object buffer); -int bi_spaces_at_point (struct buffer *b, Bytind pos); -int column_at_point (struct buffer *buf, Bufpos pos, int cur_col); -int current_column (struct buffer *buf); -void invalidate_current_column (void); -Bufpos vmotion (struct window *w, Bufpos orig, int vtarget, - int *ret_vpos); - - -/* Defined in intl.c */ -Lisp_Object Fignore_defer_gettext (Lisp_Object obj); -Lisp_Object Fgettext (Lisp_Object string); -Lisp_Object Fdgettext (Lisp_Object domain, Lisp_Object string); -extern Lisp_Object Qdefer_gettext; -#ifdef I18N3 -extern Lisp_Object Vfile_domain; -#endif - - -/* Defined in keymap.c */ -Lisp_Object Fcurrent_local_map (Lisp_Object buffer); -Lisp_Object Fkeymapp (Lisp_Object); -Lisp_Object Fmake_sparse_keymap (Lisp_Object); -Lisp_Object Fkeymap_fullness (Lisp_Object keymap); -Lisp_Object Fkey_description (Lisp_Object key); -Lisp_Object Fsingle_key_description (Lisp_Object key); -Lisp_Object Ftext_char_description (Lisp_Object c); -Lisp_Object Fdefine_key (Lisp_Object keymap, Lisp_Object key, - Lisp_Object definition); -extern Lisp_Object Qmodeline_map; -extern Lisp_Object Vsingle_space_string; -extern Lisp_Object Qcontrol, Qctrl, Qmeta, Qsuper, Qhyper, Qalt, Qshift; -extern Lisp_Object Qkeymap, Qkeymapp; -void where_is_to_char (Lisp_Object definition, char *buffer); - - -/* Defined in lread.c */ -extern Lisp_Object Qvariable_documentation, Qstandard_input, Qread_char; -extern Lisp_Object Qvariable_domain; /* I18N3 */ -extern Lisp_Object Qload; -extern Lisp_Object Vstandard_input; -extern Lisp_Object Vvalues; -extern Lisp_Object Vcurrent_compiled_function_annotation; -extern Lisp_Object Vload_file_name_internal; -extern Lisp_Object Vload_file_name_internal_the_purecopy; -Lisp_Object Fread (Lisp_Object readcharfun); -Lisp_Object Fread_from_string (Lisp_Object string, - Lisp_Object start, Lisp_Object end); -Lisp_Object Fload_internal (Lisp_Object filename, - Lisp_Object missing_ok, - Lisp_Object nomessage, - Lisp_Object nosuffix, - Lisp_Object codesys, - Lisp_Object used_codesys); -void ebolify_bytecode_constants (Lisp_Object vector); -void close_load_descs (void); -int locate_file (Lisp_Object path, - Lisp_Object str, CONST char *suffix, - Lisp_Object *storeptr, int mode); -Lisp_Object Flocate_file_clear_hashing (Lisp_Object path); -int isfloat_string (CONST char *); - -/* Well, I've decided to enable this. -- ben */ -/* And I've decided to make it work right. -- sb */ -#define LOADHIST -/* Define the following symbol to enable load history of dumped files */ -#define LOADHIST_DUMPED -/* Define the following symbol to enable load history of C source */ -#define LOADHIST_BUILTIN - -#ifdef LOADHIST /* this is just a stupid idea */ -#define LOADHIST_ATTACH(x) \ - do { if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); } \ - while (0) -extern Lisp_Object Vcurrent_load_list; -extern Lisp_Object Vload_history; -#else /*! LOADHIST */ -# define LOADHIST_ATTACH(x) -#endif /*! LOADHIST */ - - -/* Defined in macros.c */ -Lisp_Object Fexecute_kbd_macro (Lisp_Object macro, - Lisp_Object prefixarg); - - -/* Defined in marker.c */ -Bytind bi_marker_position (Lisp_Object marker); -Bufpos marker_position (Lisp_Object marker); -void set_bi_marker_position (Lisp_Object marker, Bytind pos); -void set_marker_position (Lisp_Object marker, Bufpos pos); -void unchain_marker (Lisp_Object marker); -Lisp_Object Fset_marker (Lisp_Object marker, - Lisp_Object pos, Lisp_Object buffer); -Lisp_Object Fmarker_position (Lisp_Object m); -Lisp_Object Fmarker_buffer (Lisp_Object m); -Lisp_Object Fcopy_marker (Lisp_Object m, Lisp_Object type); -Lisp_Object noseeum_copy_marker (Lisp_Object m, Lisp_Object type); -Lisp_Object set_marker_restricted (Lisp_Object marker, - Lisp_Object pos, Lisp_Object buf); -#ifdef MEMORY_USAGE_STATS -int compute_buffer_marker_usage (struct buffer *b, - struct overhead_stats *ovstats); -#endif - - -/* Defined in menubar.c */ -Lisp_Object Fpopup_menu (Lisp_Object menu_desc, Lisp_Object event); -extern Lisp_Object Qcurrent_menubar; -extern Lisp_Object Qactivate_menubar_hook; -extern Lisp_Object Qmenu_no_selection_hook; -extern Lisp_Object Vactivate_menubar_hook; -extern int popup_menu_up_p; -extern Lisp_Object Qmouse_event_p; /* events.c */ -extern Lisp_Object Q_active, Q_suffix, Q_keys, Q_style, Q_selected; -extern Lisp_Object Q_filter, Q_config, Q_included; -extern Lisp_Object Q_accelerator; -extern Lisp_Object Qtoggle, Qradio; -extern Lisp_Object Vmenubar_configuration; -extern int menubar_show_keybindings; -extern Lisp_Object Vblank_menubar; -extern int popup_menu_titles; - - -/* Defined in minibuf.c */ -extern int minibuf_level; -Charcount scmp_1 (CONST Bufbyte *s1, CONST Bufbyte *s2, Charcount len, - int ignore_case); -#define scmp(s1, s2, len) scmp_1 (s1, s2, len, completion_ignore_case) -Lisp_Object Fread_from_minibuffer (Lisp_Object prompt, - Lisp_Object init, - Lisp_Object keymap, - Lisp_Object read_crock, - Lisp_Object hist); -extern int completion_ignore_case; -extern Lisp_Object Qcompletion_ignore_case; -extern Lisp_Object Vcompletion_regexp_list; -int regexp_ignore_completion_p (CONST Bufbyte *nonreloc, - Lisp_Object reloc, Bytecount offset, - Bytecount length); - -extern Lisp_Object Vminibuffer_zero; - -extern Lisp_Object Vecho_area_buffer; -Lisp_Object clear_echo_area (struct frame *f, Lisp_Object label, - int no_restore); -Lisp_Object clear_echo_area_from_print (struct frame *f, - Lisp_Object label, - int no_restore); -void echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, - Lisp_Object reloc, Bytecount offset, - Bytecount length, Lisp_Object type); -void echo_area_message (struct frame *f, CONST Bufbyte *nonreloc, - Lisp_Object reloc, Bytecount offset, - Bytecount length, Lisp_Object type); -Lisp_Object echo_area_status (struct frame *f); -int echo_area_active (struct frame *f); -Lisp_Object echo_area_contents (struct frame *f); -void message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, - Bytecount offset, Bytecount length); -void message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, - Bytecount offset, Bytecount length); -void message (CONST char *fmt, ...) PRINTF_ARGS (1, 2); -void message_append (CONST char *fmt, ...) PRINTF_ARGS (1, 2); -void message_no_translate (CONST char *fmt, ...) PRINTF_ARGS (1, 2); -void clear_message (void); - - -/* Defined in mule-*.c */ -Lisp_Object Ffind_charset (Lisp_Object charset); -Lisp_Object Fget_coding_system (Lisp_Object coding_system); -Lisp_Object Ffind_coding_system (Lisp_Object coding_system); -Lisp_Object Fcoding_system_property (Lisp_Object coding_system, - Lisp_Object property); -extern Lisp_Object Qmnemonic; - - -/* Defined in objects-tty.c */ -extern Lisp_Object Vtty_color_alist; -#if 0 -Lisp_Object Vtty_dynamic_color_fg; -Lisp_Object Vtty_dynamic_color_bg; -#endif - - -/* Defined in print.c */ -void write_string_to_stdio_stream (FILE *stream, struct console *con, - CONST Bufbyte *str, Bytecount offset, - Bytecount len, - enum external_data_format fmt); -extern Lisp_Object Vprin1_to_string_buffer; -Lisp_Object Fdisplay_error(Lisp_Object error_object, Lisp_Object stream); -Lisp_Object Fprin1 (Lisp_Object obj, Lisp_Object printcharfun); -Lisp_Object Fprinc (Lisp_Object obj, Lisp_Object printcharfun); -Lisp_Object Fprint (Lisp_Object obj, Lisp_Object printcharfun); -Lisp_Object Fprin1_to_string (Lisp_Object obj, Lisp_Object noescape); -Lisp_Object Fterpri (Lisp_Object printcharfun); -extern Lisp_Object Vstandard_output, Qstandard_output; -extern Lisp_Object Qexternal_debugging_output; -void debug_backtrace (void); -void debug_short_backtrace (int length); -void temp_output_buffer_setup (CONST char *bufname); -void temp_output_buffer_show (Lisp_Object buf, Lisp_Object same_scrn); -/* NOTE: Do not call this with the data of a Lisp_String. Use princ. - * Note: stream should be defaulted before calling - * (eg Qnil means stdout, not Vstandard_output, etc) */ -void write_c_string (CONST char *s, Lisp_Object printcharfun); -/* Same goes for this function. */ -void write_string_1 (CONST Bufbyte *s, Bytecount size, - Lisp_Object printcharfun); -extern void print_cons (Lisp_Object, Lisp_Object, int); -extern void print_vector (Lisp_Object, Lisp_Object, int); -extern void print_string (Lisp_Object, Lisp_Object, int); -void print_internal (Lisp_Object obj, - Lisp_Object printcharfun, - int escapeflag); -extern Lisp_Object Vprint_level; -extern Lisp_Object Vprint_length; -extern int print_escape_newlines; -extern int print_readably; -extern Lisp_Object Qprint_escape_newlines; -Lisp_Object internal_with_output_to_temp_buffer (CONST char *bufname, - Lisp_Object (*function) - (Lisp_Object args), - Lisp_Object args, - Lisp_Object same_frame); -void float_to_string (char *buf, double data); -void print_symbol (Lisp_Object, Lisp_Object stream, int escapeflag); -void print_compiled_function (Lisp_Object, Lisp_Object stream, int escapeflag); -void print_float (Lisp_Object, Lisp_Object stream, int escapeflag); -extern Lisp_Object Qprint_length, Qprint_string_length; -void internal_object_printer (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag); -extern Lisp_Object Ferror_message_string(Lisp_Object obj); - -/* Defined in process.c */ -Lisp_Object Fprocess_send_eof (Lisp_Object process); - - -/* Defined in profile.c */ -void mark_profiling_info (void (*markfun) (Lisp_Object)); -extern int profiling_active; -extern int profiling_redisplay_flag; - - -/* Defined in rangetab.c */ -Lisp_Object Fmake_range_table (void); -Lisp_Object Fput_range_table (Lisp_Object start, Lisp_Object end, - Lisp_Object val, Lisp_Object table); -Lisp_Object Fget_range_table (Lisp_Object pos, Lisp_Object table, - Lisp_Object default_); -Lisp_Object Fclear_range_table (Lisp_Object table); -void put_range_table (Lisp_Object table, EMACS_INT first, - EMACS_INT last, Lisp_Object val); -int unified_range_table_bytes_needed (Lisp_Object rangetab); -int unified_range_table_bytes_used (void *unrangetab); -void unified_range_table_copy_data (Lisp_Object rangetab, void *dest); -Lisp_Object unified_range_table_lookup (void *unrangetab, EMACS_INT pos, - Lisp_Object default_); -int unified_range_table_nentries (void *unrangetab); -void unified_range_table_get_range (void *unrangetab, int offset, - EMACS_INT *min, EMACS_INT *max, - Lisp_Object *val); - - -/* Defined in redisplay.c */ -Lisp_Object Fredraw_frame (Lisp_Object frame, Lisp_Object no_preempt); -Lisp_Object Fmessage_displayed_p (Lisp_Object return_string); -extern Lisp_Object Voverlay_arrow_position, Voverlay_arrow_string; -extern Lisp_Object Vbar_cursor; -extern Lisp_Object Qbar_cursor; -extern Lisp_Object Vwindow_system; -extern Lisp_Object Qcursor_in_echo_area; - - -/* Defined in search.c */ -struct re_pattern_buffer; -struct re_registers; -Lisp_Object Fstring_match (Lisp_Object regexp, - Lisp_Object string, Lisp_Object start, - Lisp_Object buffer); -Lisp_Object Fmatch_beginning (Lisp_Object n); -Lisp_Object Fmatch_end (Lisp_Object n); -Lisp_Object Fskip_chars_forward (Lisp_Object string, Lisp_Object lim, - Lisp_Object buffer); -Lisp_Object Fskip_chars_backward (Lisp_Object string, Lisp_Object lim, - Lisp_Object buffer); -Bufpos scan_buffer (struct buffer *buf, Emchar target, Bufpos start, - Bufpos end, int cnt, int *shortage, - int allow_quit); -Bufpos find_next_newline (struct buffer *buf, Bufpos from, int cnt); -Bufpos find_next_newline_no_quit (struct buffer *buf, Bufpos from, int cnt); -Bytind bi_find_next_newline_no_quit (struct buffer *buf, Bytind from, int cnt); -Bufpos find_before_next_newline (struct buffer *buf, Bufpos from, - Bufpos to, int cnt); -struct re_pattern_buffer *compile_pattern (Lisp_Object pattern, - struct re_registers *regp, - char *translate, int posix, - Error_behavior errb); -Bytecount fast_string_match (Lisp_Object regexp, CONST Bufbyte *nonreloc, - Lisp_Object reloc, Bytecount offset, - Bytecount length, int case_fold_search, - Error_behavior errb, int no_quit); -Bytecount fast_lisp_string_match (Lisp_Object regex, Lisp_Object string); -Lisp_Object Fre_search_forward (Lisp_Object string, Lisp_Object bound, - Lisp_Object no_error, - Lisp_Object count, - Lisp_Object buffer); -void restore_match_data (void); - - -/* Defined in signal.c */ -void init_interrupts_late (void); -extern int dont_check_for_quit; -void begin_dont_check_for_quit (void); -void emacs_sleep (int secs); - - -/* Defined in sound.c */ -Lisp_Object Fplay_sound (Lisp_Object sound, Lisp_Object volume, - Lisp_Object device); -Lisp_Object Fding (Lisp_Object arg, Lisp_Object sound, - Lisp_Object device); -void init_device_sound (struct device *d); -extern Lisp_Object Qnas; - - -/* Defined in specifier.c */ -Lisp_Object Fspecifier_instance (Lisp_Object specifier, - Lisp_Object locale, - Lisp_Object default_, - Lisp_Object no_fallback); -Lisp_Object Fspecifier_specs (Lisp_Object specifier, - Lisp_Object locale, - Lisp_Object tag_set, - Lisp_Object exact_p); -Lisp_Object Fspecifier_spec_list (Lisp_Object specifier, - Lisp_Object locale, - Lisp_Object tag_set, - Lisp_Object exact_p); -Lisp_Object Fmake_specifier (Lisp_Object type); -Lisp_Object Fadd_spec_to_specifier (Lisp_Object specifier, - Lisp_Object locale, - Lisp_Object instantiator, - Lisp_Object tag, - Lisp_Object how_to_add); -Lisp_Object Fvalid_specifier_locale_p (Lisp_Object locale); -Lisp_Object Fcopy_specifier (Lisp_Object specifier, - Lisp_Object dest, - Lisp_Object locale, - Lisp_Object tag_set, - Lisp_Object exact_p, - Lisp_Object how_to_add); -Lisp_Object Fremove_specifier (Lisp_Object specifier, - Lisp_Object locale, - Lisp_Object tag_set, - Lisp_Object exact_p); -Lisp_Object specifier_instance (Lisp_Object specifier, - Lisp_Object matchspec, - Lisp_Object domain, - Error_behavior errb, - int no_quit, - int no_fallback, - Lisp_Object depth); -Lisp_Object specifier_instance_no_quit (Lisp_Object specifier, - Lisp_Object matchspec, - Lisp_Object domain, - Error_behavior errb, - int no_fallback, - Lisp_Object depth); -Lisp_Object Fset_specifier_dirty_flag (Lisp_Object specifier); -extern Lisp_Object Qfallback; -extern Lisp_Object Qnatnum; - - -/* Defined in symbols.c */ -extern Lisp_Object Vobarray; -extern Lisp_Object Vpure_uninterned_symbol_table; -Lisp_Object Fintern (Lisp_Object str, Lisp_Object obarray); -Lisp_Object Fintern_soft (Lisp_Object str, Lisp_Object obarray); -int hash_string (CONST Bufbyte *, Bytecount len); -Lisp_Object intern (CONST char *); -Lisp_Object oblookup (Lisp_Object obarray, - CONST Bufbyte *, Bytecount len); -void map_obarray (Lisp_Object obarray, - int (*fn) (Lisp_Object sym, void *arg), - void *arg); -Lisp_Object Fboundp (Lisp_Object sym); -Lisp_Object Ffboundp (Lisp_Object); -Lisp_Object Ffset (Lisp_Object sym, Lisp_Object val); -Lisp_Object Fsymbol_plist (Lisp_Object sym); -Lisp_Object Fsetplist (Lisp_Object sym, Lisp_Object val); -Lisp_Object Fsymbol_function (Lisp_Object sym); -Lisp_Object Fsymbol_value (Lisp_Object sym); -Lisp_Object Fdefault_value (Lisp_Object sym); -Lisp_Object Fdefault_boundp (Lisp_Object sym); -Lisp_Object Fset (Lisp_Object sym, Lisp_Object val); -Lisp_Object Fset_default (Lisp_Object sym, Lisp_Object val); -Lisp_Object Fsymbol_name (Lisp_Object sym); -Lisp_Object Findirect_function (Lisp_Object object); -Lisp_Object indirect_function (Lisp_Object object, int errorp); -Lisp_Object symbol_value_in_buffer (Lisp_Object sym, Lisp_Object buf); -void kill_buffer_local_variables (struct buffer *buf); -Lisp_Object Fmake_local_variable (Lisp_Object object); -int symbol_value_buffer_local_info (Lisp_Object symbol, struct buffer *); -Lisp_Object find_symbol_value (Lisp_Object symbol); -Lisp_Object find_symbol_value_quickly (Lisp_Object symbol_cons, int find_it_p); -Lisp_Object top_level_value (Lisp_Object symbol); -Lisp_Object Fkill_local_variable (Lisp_Object symbol); -Lisp_Object Fmake_variable_buffer_local (Lisp_Object variable); -Lisp_Object Fbuilt_in_variable_type (Lisp_Object sym); -extern Lisp_Object Qconst_specifier; - -/* Defined in syntax.c */ -int scan_words (struct buffer *buf, int from, int count); -Lisp_Object Fforward_word (Lisp_Object n, Lisp_Object buffer); -Lisp_Object Fchar_syntax (Lisp_Object ch, Lisp_Object table); - - -/* Defined in sysdep.c, also declared in sysdep.h. - (These may be called via the open, etc macros instead...) - */ -#ifdef ENCAPSULATE_OPEN -int sys_open (CONST char *path, int oflag, ...); -#endif -#ifdef ENCAPSULATE_CLOSE -int sys_close (int fd); -#endif -#ifdef ENCAPSULATE_READ -int sys_read (int fildes, void *buf, unsigned int nbyte); -#endif -#ifdef ENCAPSULATE_WRITE -int sys_write (int fildes, CONST void *buf, unsigned int nbyte); -#endif - -#ifdef ENCAPSULATE_FOPEN -FILE *sys_fopen (CONST char *path, CONST char *type); -#endif -#ifdef ENCAPSULATE_FCLOSE -int sys_fclose (FILE *stream); -#endif -#ifdef ENCAPSULATE_FREAD -size_t sys_fread (void *ptr, size_t size, size_t nitem, FILE *stream); -#endif -#ifdef ENCAPSULATE_FWRITE -size_t sys_fwrite (CONST void *ptr, size_t size, size_t nitem, - FILE *stream); -#endif - -unsigned int sys_getuid (void); - -char *egetenv (CONST char *); -/* extern char *getenv (CONST char *); */ - - -/* Defined in undo.c */ -Lisp_Object Fundo_boundary (void); -Lisp_Object truncate_undo_list (Lisp_Object list, int min, int max); -void record_extent (Lisp_Object extent, int attached); -void record_insert (struct buffer *b, Bufpos beg, Charcount length); -void record_delete (struct buffer *b, Bufpos beg, Charcount length); -void record_change (struct buffer *b, Bufpos beg, Charcount length); -extern Lisp_Object Qinhibit_read_only; - - -/* Defined in unex*.c */ -int unexec (char *new_name, char *a_name, - uintptr_t data_start, - uintptr_t bss_start, - uintptr_t entry_address); -#ifdef RUN_TIME_REMAP -int run_time_remap (char *); -#endif - - -/* Defined in vm-limit.c */ -void memory_warnings (void *start, void (*warnfun) (CONST char *)); - - -/* Defined in window.c */ -extern Lisp_Object Qvisible; -extern Lisp_Object Qscroll_up, Qscroll_down; -Lisp_Object Fselected_window (Lisp_Object device); -Lisp_Object Fwindow_buffer (Lisp_Object window); -Lisp_Object Fwindow_lowest_p (Lisp_Object window); -Lisp_Object Fwindow_highest_p (Lisp_Object window); -Lisp_Object Fget_buffer_window (Lisp_Object buffer, - Lisp_Object frame, - Lisp_Object ignored); -Lisp_Object Fsave_window_excursion (Lisp_Object body); -Lisp_Object Fset_window_configuration (Lisp_Object config); -Lisp_Object save_window_excursion_unwind (Lisp_Object window_config); -Lisp_Object Fcurrent_window_configuration (Lisp_Object frame); -Lisp_Object display_buffer (Lisp_Object buffer, - Lisp_Object notthiswindow, - Lisp_Object overrideframe); -Lisp_Object Freplace_buffer_in_windows (Lisp_Object buffer); -Lisp_Object Fwindow_dedicated_p (Lisp_Object window); -Lisp_Object Fnext_window (Lisp_Object window, - Lisp_Object minibuf, - Lisp_Object all_frames, - Lisp_Object device); -Lisp_Object Fdelete_window (Lisp_Object window, Lisp_Object force); -Lisp_Object Fselect_window (Lisp_Object window); -Lisp_Object Fset_window_buffer (Lisp_Object window, - Lisp_Object buffer); -Lisp_Object Fsplit_window (Lisp_Object window, - Lisp_Object chsize, - Lisp_Object horflag); -Lisp_Object Frecenter (Lisp_Object arg, Lisp_Object window); -Lisp_Object Fmove_to_window_line (Lisp_Object arg, Lisp_Object window); -Lisp_Object Fbuffer_left_margin_pixwidth (Lisp_Object buffer); -Lisp_Object Fbuffer_right_margin_pixwidth (Lisp_Object buffer); -Lisp_Object Fset_window_hscroll (Lisp_Object window, Lisp_Object ncol); -Lisp_Object Fwindow_point (Lisp_Object window); -Lisp_Object Fset_window_point (Lisp_Object window, Lisp_Object pos); -Lisp_Object Fset_window_start (Lisp_Object window, Lisp_Object pos, - Lisp_Object noforce); -Lisp_Object Fwindow_start (Lisp_Object window); -Lisp_Object Fwindow_end (Lisp_Object window, Lisp_Object guarantee); - -#endif /* _EMACSFNS_H_ */
--- a/src/eval.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/eval.c Mon Aug 13 10:28:48 2007 +0200 @@ -32,7 +32,6 @@ #include "commands.h" #endif -#include "symeval.h" #include "backtrace.h" #include "bytecode.h" #include "buffer.h" @@ -51,9 +50,6 @@ #define POP_BACKTRACE(bt) \ do { backtrace_list = (bt).next; } while (0) -extern int profiling_active; -void profile_increase_call_count (Lisp_Object); - /* This is the list of current catches (and also condition-cases). This is a stack: the most recent catch is at the head of the list. Catches are created by declaring a 'struct catchtag' @@ -79,16 +75,12 @@ Lisp_Object Qinteractive, Qcommandp, Qdefun, Qprogn, Qvalues; Lisp_Object Vquit_flag, Vinhibit_quit; Lisp_Object Qand_rest, Qand_optional; -Lisp_Object Qdebug_on_error; -Lisp_Object Qstack_trace_on_error; -Lisp_Object Qdebug_on_signal; -Lisp_Object Qstack_trace_on_signal; +Lisp_Object Qdebug_on_error, Qstack_trace_on_error; +Lisp_Object Qdebug_on_signal, Qstack_trace_on_signal; Lisp_Object Qdebugger; Lisp_Object Qinhibit_quit; Lisp_Object Qrun_hooks; - Lisp_Object Qsetq; - Lisp_Object Qdisplay_warning; Lisp_Object Vpending_warnings, Vpending_warnings_tail; @@ -243,11 +235,6 @@ /* The subr and compiled-function types */ /**********************************************************************/ -static void print_subr (Lisp_Object, Lisp_Object, int); -DEFINE_LRECORD_IMPLEMENTATION ("subr", subr, - this_one_is_unmarkable, print_subr, 0, 0, 0, - struct Lisp_Subr); - static void print_subr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { @@ -267,19 +254,10 @@ printcharfun); } +DEFINE_LRECORD_IMPLEMENTATION ("subr", subr, + this_one_is_unmarkable, print_subr, 0, 0, 0, + struct Lisp_Subr); -static Lisp_Object mark_compiled_function (Lisp_Object, - void (*) (Lisp_Object)); -extern void print_compiled_function (Lisp_Object, Lisp_Object, int); -static int compiled_function_equal (Lisp_Object, Lisp_Object, int); -static unsigned long compiled_function_hash (Lisp_Object obj, int depth); -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function, - mark_compiled_function, - print_compiled_function, 0, - compiled_function_equal, - compiled_function_hash, - struct Lisp_Compiled_Function); - static Lisp_Object mark_compiled_function (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -300,14 +278,15 @@ { struct Lisp_Compiled_Function *b1 = XCOMPILED_FUNCTION (o1); struct Lisp_Compiled_Function *b2 = XCOMPILED_FUNCTION (o2); - return (b1->flags.documentationp == b2->flags.documentationp - && b1->flags.interactivep == b2->flags.interactivep - && b1->flags.domainp == b2->flags.domainp /* I18N3 */ - && internal_equal (b1->bytecodes, b2->bytecodes, depth + 1) - && internal_equal (b1->constants, b2->constants, depth + 1) - && internal_equal (b1->arglist, b2->arglist, depth + 1) - && internal_equal (b1->doc_and_interactive, - b2->doc_and_interactive, depth + 1)); + return + (b1->flags.documentationp == b2->flags.documentationp && + b1->flags.interactivep == b2->flags.interactivep && + b1->flags.domainp == b2->flags.domainp && /* I18N3 */ + internal_equal (b1->bytecodes, b2->bytecodes, depth + 1) && + internal_equal (b1->constants, b2->constants, depth + 1) && + internal_equal (b1->arglist, b2->arglist, depth + 1) && + internal_equal (b1->doc_and_interactive, + b2->doc_and_interactive, depth + 1)); } static unsigned long @@ -321,6 +300,12 @@ internal_hash (b->constants, depth + 1)); } +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function, + mark_compiled_function, + print_compiled_function, 0, + compiled_function_equal, + compiled_function_hash, + struct Lisp_Compiled_Function); /**********************************************************************/ /* Entering the debugger */ @@ -521,7 +506,7 @@ return Fbacktrace (stream, Qt); } -/* An error was signalled. Maybe call the debugger, if the `debug-on-error' +/* An error was signaled. Maybe call the debugger, if the `debug-on-error' etc. variables call for this. CONDITIONS is the list of conditions associated with the error being signalled. SIG is the actual error being signalled, and DATA is the associated data (these are exactly @@ -654,21 +639,23 @@ (args)) { /* This function can GC */ - Lisp_Object val = Qnil; + REGISTER Lisp_Object tail; struct gcpro gcpro1; GCPRO1 (args); - while (!NILP (args)) + LIST_LOOP (tail, args) { - val = Feval (XCAR (args)); + Lisp_Object val = Feval (XCAR (tail)); if (!NILP (val)) - break; - args = XCDR (args); + { + UNGCPRO; + return val; + } } UNGCPRO; - return val; + return Qnil; } DEFUN ("and", Fand, 0, UNEVALLED, 0, /* @@ -679,17 +666,16 @@ (args)) { /* This function can GC */ - Lisp_Object val = Qt; + REGISTER Lisp_Object tail, val = Qt; struct gcpro gcpro1; GCPRO1 (args); - while (!NILP (args)) + LIST_LOOP (tail, args) { - val = Feval (XCAR (args)); + val = Feval (XCAR (tail)); if (NILP (val)) break; - args = XCDR (args); } UNGCPRO; @@ -697,26 +683,26 @@ } DEFUN ("if", Fif, 2, UNEVALLED, 0, /* -(if COND THEN ELSE...): if COND yields non-nil, do THEN, else do ELSE... +\(if COND THEN ELSE...): if COND yields non-nil, do THEN, else do ELSE... Returns the value of THEN or the value of the last of the ELSE's. THEN must be one expression, but ELSE... can be zero or more expressions. If COND yields nil, and there are no ELSE's, the value is nil. */ - (args)) + (args)) { /* This function can GC */ - Lisp_Object cond; + Lisp_Object val; struct gcpro gcpro1; GCPRO1 (args); - cond = Feval (XCAR (args)); + + if (!NILP (Feval (XCAR (args)))) + val = Feval (XCAR (XCDR ((args)))); + else + val = Fprogn (XCDR (XCDR (args))); + UNGCPRO; - - args = XCDR (args); - - if (!NILP (cond)) - return Feval (XCAR (args)); - return Fprogn (XCDR (args)); + return val; } DEFUN ("cond", Fcond, 0, UNEVALLED, 0, /* @@ -732,104 +718,102 @@ (args)) { /* This function can GC */ - Lisp_Object val = Qnil; + REGISTER Lisp_Object tail; struct gcpro gcpro1; GCPRO1 (args); - while (!NILP (args)) + + LIST_LOOP (tail, args) { - Lisp_Object clause = XCAR (args); + Lisp_Object val; + Lisp_Object clause = XCAR (tail); + CHECK_CONS (clause); val = Feval (XCAR (clause)); if (!NILP (val)) { - if (!EQ (XCDR (clause), Qnil)) - val = Fprogn (XCDR (clause)); - break; + Lisp_Object clause_tail = XCDR (clause); + if (!NILP (clause_tail)) + { + CHECK_TRUE_LIST (clause_tail); + val = Fprogn (clause_tail); + } + UNGCPRO; + return val; } - args = XCDR (args); } UNGCPRO; - return val; + return Qnil; } DEFUN ("progn", Fprogn, 0, UNEVALLED, 0, /* -(progn BODY...): eval BODY forms sequentially and return value of last one. +\(progn BODY...): eval BODY forms sequentially and return value of last one. */ (args)) { /* This function can GC */ - Lisp_Object val = Qnil; + REGISTER Lisp_Object tail, val = Qnil; struct gcpro gcpro1; GCPRO1 (args); - while (!NILP (args)) - { - val = Feval (XCAR (args)); - args = XCDR (args); - } + LIST_LOOP (tail, args) + val = Feval (XCAR (tail)); UNGCPRO; return val; } DEFUN ("prog1", Fprog1, 1, UNEVALLED, 0, /* -(prog1 FIRST BODY...): eval FIRST and BODY sequentially; value from FIRST. +\(prog1 FIRST BODY...): eval FIRST and BODY sequentially; value from FIRST. The value of FIRST is saved during the evaluation of the remaining args, whose values are discarded. */ (args)) { /* This function can GC */ + REGISTER Lisp_Object tail = args; Lisp_Object val = Qnil; struct gcpro gcpro1, gcpro2; GCPRO2 (args, val); - val = Feval (XCAR (args)); - args = XCDR (args); - - while (!NILP (args)) - { - Feval (XCAR (args)); - args = XCDR (args); - } + val = Feval (XCAR (tail)); + + LIST_LOOP (tail, XCDR (tail)) + Feval (XCAR (tail)); UNGCPRO; return val; } DEFUN ("prog2", Fprog2, 2, UNEVALLED, 0, /* -(prog2 X Y BODY...): eval X, Y and BODY sequentially; value from Y. +\(prog2 X Y BODY...): eval X, Y and BODY sequentially; value from Y. The value of Y is saved during the evaluation of the remaining args, whose values are discarded. */ (args)) { /* This function can GC */ + REGISTER Lisp_Object tail = args; Lisp_Object val = Qnil; struct gcpro gcpro1, gcpro2; GCPRO2 (args, val); - Feval (XCAR (args)); - args = XCDR (args); - val = Feval (XCAR (args)); - args = XCDR (args); - - while (!NILP (args)) - { - Feval (XCAR (args)); - args = XCDR (args); - } + Feval (XCAR (tail)); + tail = XCDR (tail); + val = Feval (XCAR (tail)); + + LIST_LOOP (tail, XCDR (tail)) + Feval (XCAR (tail)); UNGCPRO; return val; } DEFUN ("let*", FletX, 1, UNEVALLED, 0, /* -(let* VARLIST BODY...): bind variables according to VARLIST then eval BODY. +\(let* VARLIST BODY...): bind variables according to VARLIST then eval BODY. The value of the last form in BODY is returned. Each element of VARLIST is a symbol (which is bound to nil) or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM). @@ -838,36 +822,46 @@ (args)) { /* This function can GC */ - Lisp_Object varlist, val, elt; + Lisp_Object varlist = XCAR (args); + Lisp_Object tail; int speccount = specpdl_depth_counter; - struct gcpro gcpro1, gcpro2, gcpro3; - - GCPRO3 (args, elt, varlist); - - varlist = Fcar (args); - while (!NILP (varlist)) + struct gcpro gcpro1; + + GCPRO1 (args); + + EXTERNAL_LIST_LOOP (tail, varlist) { + Lisp_Object elt = XCAR (tail); QUIT; - elt = Fcar (varlist); if (SYMBOLP (elt)) specbind (elt, Qnil); - else if (! NILP (Fcdr (Fcdr (elt)))) - signal_simple_error ("`let' bindings can have only one value-form", - elt); else { - val = Feval (Fcar (Fcdr (elt))); - specbind (Fcar (elt), val); + Lisp_Object sym, form; + CHECK_CONS (elt); + sym = XCAR (elt); + elt = XCDR (elt); + if (NILP (elt)) + form = Qnil; + else + { + CHECK_CONS (elt); + form = XCAR (elt); + elt = XCDR (elt); + if (!NILP (elt)) + signal_simple_error + ("`let' bindings can have only one value-form", + XCAR (tail)); + } + specbind (sym, Feval (form)); } - varlist = Fcdr (varlist); } UNGCPRO; - val = Fprogn (Fcdr (args)); - return unbind_to (speccount, val); + return unbind_to (speccount, Fprogn (XCDR (args))); } DEFUN ("let", Flet, 1, UNEVALLED, 0, /* -(let VARLIST BODY...): bind variables according to VARLIST then eval BODY. +\(let VARLIST BODY...): bind variables according to VARLIST then eval BODY. The value of the last form in BODY is returned. Each element of VARLIST is a symbol (which is bound to nil) or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM). @@ -876,68 +870,78 @@ (args)) { /* This function can GC */ - Lisp_Object *temps, tem; - REGISTER Lisp_Object elt, varlist; + Lisp_Object varlist = XCAR (args); + REGISTER Lisp_Object tail; + Lisp_Object *temps; int speccount = specpdl_depth_counter; - REGISTER int argnum; + REGISTER int argnum = 0; struct gcpro gcpro1, gcpro2; - varlist = Fcar (args); - - /* Make space to hold the values to give the bound variables */ - elt = Flength (varlist); - temps = alloca_array (Lisp_Object, XINT (elt)); + /* Make space to hold the values to give the bound variables. */ + { + int varcount = 0; + EXTERNAL_LIST_LOOP (tail, varlist) + varcount++; + temps = alloca_array (Lisp_Object, varcount); + } /* Compute the values and store them in `temps' */ GCPRO2 (args, *temps); gcpro2.nvars = 0; - for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist)) + LIST_LOOP (tail, varlist) { + Lisp_Object elt = XCAR (tail); QUIT; - elt = Fcar (varlist); if (SYMBOLP (elt)) - temps [argnum++] = Qnil; - else if (! NILP (Fcdr (Fcdr (elt)))) - signal_simple_error ("`let' bindings can have only one value-form", - elt); + temps[argnum++] = Qnil; else - temps [argnum++] = Feval (Fcar (Fcdr (elt))); - gcpro2.nvars = argnum; + { + CHECK_CONS (elt); + elt = XCDR (elt); + if (NILP (elt)) + temps[argnum++] = Qnil; + else + { + CHECK_CONS (elt); + temps[argnum++] = Feval (XCAR (elt)); + gcpro2.nvars = argnum; + + if (!NILP (XCDR (elt))) + signal_simple_error + ("`let' bindings can have only one value-form", + XCAR (tail)); + } + } } UNGCPRO; - varlist = Fcar (args); - for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist)) + argnum = 0; + LIST_LOOP (tail, varlist) { - elt = Fcar (varlist); - tem = temps[argnum++]; - if (SYMBOLP (elt)) - specbind (elt, tem); - else - specbind (Fcar (elt), tem); + Lisp_Object elt = XCAR (tail); + specbind (SYMBOLP (elt) ? elt : XCAR (elt), temps[argnum++]); } - elt = Fprogn (Fcdr (args)); - return unbind_to (speccount, elt); + return unbind_to (speccount, Fprogn (XCDR (args))); } DEFUN ("while", Fwhile, 1, UNEVALLED, 0, /* -(while TEST BODY...): if TEST yields non-nil, eval BODY... and repeat. +\(while TEST BODY...): if TEST yields non-nil, eval BODY... and repeat. The order of execution is thus TEST, BODY, TEST, BODY and so on until TEST returns nil. */ (args)) { /* This function can GC */ - Lisp_Object test, body, tem; + Lisp_Object tem; + Lisp_Object test = XCAR (args); + Lisp_Object body = XCDR (args); struct gcpro gcpro1, gcpro2; GCPRO2 (test, body); - test = Fcar (args); - body = Fcdr (args); while (tem = Feval (test), !NILP (tem)) { QUIT; @@ -949,7 +953,7 @@ } DEFUN ("setq", Fsetq, 0, UNEVALLED, 0, /* -(setq SYM VAL SYM VAL ...): set each SYM to the value of its VAL. +\(setq SYM VAL SYM VAL ...): set each SYM to the value of its VAL. The symbols SYM are variables; they are literal (not evaluated). The values VAL are expressions; they are evaluated. Thus, (setq x (1+ y)) sets `x' to the value of `(1+ y)'. @@ -960,16 +964,15 @@ (args)) { /* This function can GC */ - REGISTER Lisp_Object args_left; - REGISTER Lisp_Object val, sym; struct gcpro gcpro1; - - if (NILP (args)) - return Qnil; + Lisp_Object val = Qnil; + + GCPRO1 (args); { - REGISTER int i; - for (i = 0, val = args ; CONSP (val); val = XCDR (val)) + REGISTER int i = 0; + Lisp_Object args2; + for (args2 = args; !NILP (args2); args2 = XCDR (args2)) { i++; /* @@ -983,17 +986,13 @@ Fsignal (Qwrong_number_of_arguments, list2 (Qsetq, make_int(i))); } - args_left = args; - GCPRO1 (args); - - do + while (!NILP (args)) { - val = Feval (XCAR (XCDR (args_left))); - sym = XCAR (args_left); + Lisp_Object sym = XCAR (args); + val = Feval (XCAR (XCDR (args))); Fset (sym, val); - args_left = XCDR (XCDR (args_left)); + args = XCDR (XCDR (args)); } - while (CONSP (args_left)); UNGCPRO; return val; @@ -1004,7 +1003,7 @@ */ (args)) { - return Fcar (args); + return XCAR (args); } DEFUN ("function", Ffunction, 1, UNEVALLED, 0, /* @@ -1014,7 +1013,7 @@ */ (args)) { - return Fcar (args); + return XCAR (args); } @@ -1023,18 +1022,16 @@ /**********************************************************************/ DEFUN ("defun", Fdefun, 2, UNEVALLED, 0, /* -(defun NAME ARGLIST [DOCSTRING] BODY...): define NAME as a function. +\(defun NAME ARGLIST [DOCSTRING] BODY...): define NAME as a function. The definition is (lambda ARGLIST [DOCSTRING] BODY...). See also the function `interactive'. */ (args)) { /* This function can GC */ - Lisp_Object fn_name; - Lisp_Object defn; - - fn_name = Fcar (args); - defn = Fcons (Qlambda, Fcdr (args)); + Lisp_Object fn_name = XCAR (args); + Lisp_Object defn = Fcons (Qlambda, XCDR (args)); + if (purify_flag) defn = Fpurecopy (defn); Ffset (fn_name, defn); @@ -1043,7 +1040,7 @@ } DEFUN ("defmacro", Fdefmacro, 2, UNEVALLED, 0, /* -(defmacro NAME ARGLIST [DOCSTRING] BODY...): define NAME as a macro. +\(defmacro NAME ARGLIST [DOCSTRING] BODY...): define NAME as a macro. The definition is (macro lambda ARGLIST [DOCSTRING] BODY...). When the macro is called, as in (NAME ARGS...), the function (lambda ARGLIST BODY...) is applied to @@ -1053,11 +1050,9 @@ (args)) { /* This function can GC */ - Lisp_Object fn_name; - Lisp_Object defn; - - fn_name = Fcar (args); - defn = Fcons (Qmacro, Fcons (Qlambda, Fcdr (args))); + Lisp_Object fn_name = XCAR (args); + Lisp_Object defn = Fcons (Qmacro, Fcons (Qlambda, XCDR (args))); + if (purify_flag) defn = Fpurecopy (defn); Ffset (fn_name, defn); @@ -1066,7 +1061,7 @@ } DEFUN ("defvar", Fdefvar, 1, UNEVALLED, 0, /* -(defvar SYMBOL INITVALUE DOCSTRING): define SYMBOL as a variable. +\(defvar SYMBOL INITVALUE DOCSTRING): define SYMBOL as a variable. You are not required to define a variable in order to use it, but the definition can supply documentation and an initial value in a way that tags can recognize. @@ -1087,18 +1082,29 @@ (args)) { /* This function can GC */ - REGISTER Lisp_Object sym, tem, tail; - - sym = Fcar (args); - tail = Fcdr (args); - if (!NILP (Fcdr (Fcdr (tail)))) - error ("too many arguments"); - - if (!NILP (tail)) + Lisp_Object sym = XCAR (args); + + if (!NILP (args = XCDR (args))) { - tem = Fdefault_boundp (sym); - if (NILP (tem)) - Fset_default (sym, Feval (Fcar (Fcdr (args)))); + Lisp_Object val = XCAR (args); + + if (NILP (Fdefault_boundp (sym))) + Fset_default (sym, Feval (val)); + + if (!NILP (args = XCDR (args))) + { + Lisp_Object doc = XCAR (args); +#if 0 /* FSFmacs */ + /* #### We should probably do this but it might be dangerous */ + if (purify_flag) + doc = Fpurecopy (doc); + Fput (sym, Qvariable_documentation, doc); +#else + pure_put (sym, Qvariable_documentation, doc); +#endif + if (!NILP (args = XCDR (args))) + error ("too many arguments"); + } } #ifdef I18N3 @@ -1106,26 +1112,12 @@ pure_put (sym, Qvariable_domain, Vfile_domain); #endif - tail = Fcdr (Fcdr (args)); - if (!NILP (Fcar (tail))) - { - tem = Fcar (tail); -#if 0 /* FSFmacs */ - /* #### We should probably do this but it might be dangerous */ - if (purify_flag) - tem = Fpurecopy (tem); - Fput (sym, Qvariable_documentation, tem); -#else - pure_put (sym, Qvariable_documentation, tem); -#endif - } - LOADHIST_ATTACH (sym); return sym; } DEFUN ("defconst", Fdefconst, 2, UNEVALLED, 0, /* -(defconst SYMBOL INITVALUE DOCSTRING): define SYMBOL as a constant +\(defconst SYMBOL INITVALUE DOCSTRING): define SYMBOL as a constant variable. The intent is that programs do not change this value, but users may. Always sets the value of SYMBOL to the result of evalling INITVALUE. @@ -1144,33 +1136,31 @@ (args)) { /* This function can GC */ - REGISTER Lisp_Object sym, tem; - - sym = Fcar (args); - if (!NILP (Fcdr (Fcdr (Fcdr (args))))) - error ("too many arguments"); - - Fset_default (sym, Feval (Fcar (Fcdr (args)))); + Lisp_Object sym = XCAR (args); + Lisp_Object val = XCAR (args = XCDR (args)); + + Fset_default (sym, Feval (val)); + + if (!NILP (args = XCDR (args))) + { + Lisp_Object doc = XCAR (args); +#if 0 /* FSFmacs */ + /* #### We should probably do this but it might be dangerous */ + if (purify_flag) + doc = Fpurecopy (doc); + Fput (sym, Qvariable_documentation, doc); +#else + pure_put (sym, Qvariable_documentation, doc); +#endif + if (!NILP (args = XCDR (args))) + error ("too many arguments"); + } #ifdef I18N3 if (!NILP (Vfile_domain)) pure_put (sym, Qvariable_domain, Vfile_domain); #endif - tem = Fcar (Fcdr (Fcdr (args))); - - if (!NILP (tem)) -#if 0 /* FSFmacs */ - /* #### We should probably do this but it might be dangerous */ - { - if (purify_flag) - tem = Fpurecopy (tem); - Fput (sym, Qvariable_documentation, tem); - } -#else - pure_put (sym, Qvariable_documentation, tem); -#endif - LOADHIST_ATTACH (sym); return sym; } @@ -1283,7 +1273,7 @@ /**********************************************************************/ DEFUN ("catch", Fcatch, 1, UNEVALLED, 0, /* -(catch TAG BODY...): eval BODY allowing nonlocal exits using `throw'. +\(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'. If no throw happens, `catch' returns the value of the last BODY form. @@ -1296,9 +1286,9 @@ struct gcpro gcpro1; GCPRO1 (args); - tag = Feval (Fcar (args)); + tag = Feval (XCAR (args)); UNGCPRO; - return internal_catch (tag, Fprogn, Fcdr (args), 0); + return internal_catch (tag, Fprogn, XCDR (args), 0); } /* Set up a catch, then call C function FUNC on argument ARG. @@ -1309,7 +1299,7 @@ internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object arg), Lisp_Object arg, - int *threw) + int * volatile threw) { /* This structure is made part of the chain `catchlist'. */ struct catchtag c; @@ -1484,7 +1474,7 @@ */ DEFUN ("throw", Fthrow, 2, 2, 0, /* -(throw TAG VALUE): throw to the catch for TAG and return VALUE from it. +\(throw TAG VALUE): throw to the catch for TAG and return VALUE from it. Both TAG and VALUE are evalled. */ (tag, val)) @@ -1506,8 +1496,8 @@ Lisp_Object val; int speccount = specpdl_depth_counter; - record_unwind_protect (Fprogn, Fcdr (args)); - val = Feval (Fcar (args)); + record_unwind_protect (Fprogn, XCDR (args)); + val = Feval (XCAR (args)); return unbind_to (speccount, val); } @@ -1708,8 +1698,7 @@ condition-case except that it takes three arguments rather than a single list of arguments. */ Lisp_Object -Fcondition_case_3 (Lisp_Object bodyform, - Lisp_Object var, Lisp_Object handlers) +condition_case_3 (Lisp_Object bodyform, Lisp_Object var, Lisp_Object handlers) { /* This function can GC */ Lisp_Object val; @@ -1743,7 +1732,7 @@ error's condition names. If an error happens, the first applicable handler is run. As a special case, a CONDITION-NAME of t matches all errors, even those without the `error' condition name on them -(e.g. `quit'). +\(e.g. `quit'). The car of a handler may be a list of condition names instead of a single condition name. @@ -1769,9 +1758,9 @@ (args)) { /* This function can GC */ - return Fcondition_case_3 (Fcar (Fcdr (args)), - Fcar (args), - Fcdr (Fcdr (args))); + return condition_case_3 (XCAR (XCDR (args)), + XCAR (args), + XCDR (XCDR (args))); } DEFUN ("call-with-condition-handler", Fcall_with_condition_handler, 2, MANY, 0, /* @@ -1783,14 +1772,14 @@ was established. HANDLER should be a function of one argument, which is a cons of the args -(SIG . DATA) that were passed to `signal'. It is invoked whenever +\(SIG . DATA) that were passed to `signal'. It is invoked whenever `signal' is called (this differs from `condition-case', which allows you to specify which errors are trapped). If the handler function returns, `signal' continues as if the handler were never invoked. -(It continues to look for handlers established earlier than this one, +\(It continues to look for handlers established earlier than this one, and invokes the standard error-handler if none is found.) */ -(int nargs, Lisp_Object *args)) /* Note! Args side-effected! */ + (int nargs, Lisp_Object *args)) /* Note! Args side-effected! */ { /* This function can GC */ int speccount = specpdl_depth_counter; @@ -1854,7 +1843,6 @@ } extern int in_display; -extern int gc_in_progress; /****************** the workhorse error-signaling function ******************/ @@ -2151,7 +2139,7 @@ if (ERRB_EQ (errb, ERROR_ME)) return primitive_funcall (fun, nargs, args); - speccount = specpdl_depth (); + speccount = specpdl_depth_counter; if (NILP (class) || NILP (Vcurrent_warning_class)) { /* If we're currently calling for no warnings, then make it so. @@ -2187,9 +2175,9 @@ UNGCPRO; /* Use the returned value except in non-local exit, when RETVAL applies. */ - if (!threw) - retval = the_retval; - return unbind_to (speccount, retval); + /* Some perverse compilers require the perverse cast below. */ + return unbind_to (speccount, + threw ? *((Lisp_Object*) &(retval)) : the_retval); } } @@ -2499,7 +2487,7 @@ /**********************************************************************/ DEFUN ("commandp", Fcommandp, 1, 1, 0, /* -T if FUNCTION makes provisions for interactive calling. +Return t if FUNCTION makes provisions for interactive calling. This means it contains a description for how to read arguments to give it. The value is nil for an invalid function or a symbol with no function definition. @@ -2518,12 +2506,8 @@ */ (function)) { - REGISTER Lisp_Object fun; - REGISTER Lisp_Object funcar; - - fun = function; - - fun = indirect_function (fun, 0); + Lisp_Object fun = indirect_function (function, 0); + if (UNBOUNDP (fun)) return Qnil; @@ -2542,15 +2526,17 @@ /* Lists may represent commands. */ if (!CONSP (fun)) return Qnil; - funcar = Fcar (fun); - if (!SYMBOLP (funcar)) - return Fsignal (Qinvalid_function, list1 (fun)); - if (EQ (funcar, Qlambda)) - return Fassq (Qinteractive, Fcdr (Fcdr (fun))); - if (EQ (funcar, Qautoload)) - return Fcar (Fcdr (Fcdr (Fcdr (fun)))); - else - return Qnil; + { + Lisp_Object funcar = XCAR (fun); + if (!SYMBOLP (funcar)) + return Fsignal (Qinvalid_function, list1 (fun)); + if (EQ (funcar, Qlambda)) + return Fassq (Qinteractive, Fcdr (Fcdr (fun))); + if (EQ (funcar, Qautoload)) + return Fcar (Fcdr (Fcdr (Fcdr (fun)))); + else + return Qnil; + } } DEFUN ("command-execute", Fcommand_execute, 1, 3, 0, /* @@ -2594,7 +2580,7 @@ backtrace.args = &cmd; backtrace.nargs = 1; backtrace.evalargs = 0; - backtrace.pdlcount = specpdl_depth (); + backtrace.pdlcount = specpdl_depth_counter; backtrace.debug_on_exit = 0; PUSH_BACKTRACE (backtrace); @@ -2826,10 +2812,6 @@ int nargs, Lisp_Object args[]); static Lisp_Object apply_lambda (Lisp_Object fun, int nargs, Lisp_Object args); -#if 0 /* #### Not called anymore */ -static Lisp_Object funcall_subr (struct Lisp_Subr *sub, Lisp_Object args[]); -#endif - static int in_warnings; static Lisp_Object @@ -2839,46 +2821,50 @@ return Qnil; } -#define inline_funcall_subr(rv, subr, av) \ - do { \ - switch (subr->max_args) { \ - case 0: rv = (subr_function(subr))(); \ - break; \ - case 1: rv = (subr_function(subr))(av[0]); \ - break; \ - case 2: rv = (subr_function(subr))(av[0], av[1]); \ - break; \ - case 3: rv = (subr_function(subr))(av[0], av[1], av[2]); \ - break; \ - case 4: rv = (subr_function(subr))(av[0], av[1], av[2], av[3]); \ - break; \ - case 5: rv = (subr_function(subr))(av[0], av[1], av[2], av[3], av[4]); \ - break; \ - case 6: rv = (subr_function(subr))(av[0], av[1], av[2], av[3], av[4], \ - av[5]); \ - break; \ - case 7: rv = (subr_function(subr))(av[0], av[1], av[2], av[3], av[4], \ - av[5], av[6]); \ - break; \ - case 8: rv = (subr_function(subr))(av[0], av[1], av[2], av[3], av[4], \ - av[5], av[6], av[7]); \ - break; \ - case 9: rv = (subr_function(subr))(av[0], av[1], av[2], av[3], av[4], \ - av[5], av[6], av[7], av[8]); \ - break; \ - case 10: rv = (subr_function(subr))(av[0], av[1], av[2], av[3], av[4], \ - av[5], av[6], av[7], av[8], av[9]); \ - break; \ - case 11: rv = (subr_function(subr))(av[0], av[1], av[2], av[3], av[4], \ - av[5], av[6], av[7], av[8], av[9], \ - av[10]); \ - break; \ - case 12: rv = (subr_function(subr))(av[0], av[1], av[2], av[3], av[4], \ - av[5], av[6], av[7], av[8], av[9], \ - av[10], av[11]); \ - break; \ - } \ - } while (0) +#define AV_0(av) +#define AV_1(av) av[0] +#define AV_2(av) AV_1(av), av[1] +#define AV_3(av) AV_2(av), av[2] +#define AV_4(av) AV_3(av), av[3] +#define AV_5(av) AV_4(av), av[4] +#define AV_6(av) AV_5(av), av[5] +#define AV_7(av) AV_6(av), av[6] +#define AV_8(av) AV_7(av), av[7] + +#define PRIMITIVE_FUNCALL(fn, av, ac) \ +(((Lisp_Object (*)(EXFUN_##ac)) (fn)) (AV_##ac (av))) + +/* If subr's take more than 8 arguments, more cases need to be added + to this switch. (But don't do it - if you really need a SUBR with + more than 8 arguments, use max_args == MANY. + See the DEFUN macro in lisp.h) */ +#define inline_funcall_fn(rv, fn, av, ac) do { \ + switch (ac) { \ + case 0: rv = PRIMITIVE_FUNCALL(fn, av, 0); break; \ + case 1: rv = PRIMITIVE_FUNCALL(fn, av, 1); break; \ + case 2: rv = PRIMITIVE_FUNCALL(fn, av, 2); break; \ + case 3: rv = PRIMITIVE_FUNCALL(fn, av, 3); break; \ + case 4: rv = PRIMITIVE_FUNCALL(fn, av, 4); break; \ + case 5: rv = PRIMITIVE_FUNCALL(fn, av, 5); break; \ + case 6: rv = PRIMITIVE_FUNCALL(fn, av, 6); break; \ + case 7: rv = PRIMITIVE_FUNCALL(fn, av, 7); break; \ + case 8: rv = PRIMITIVE_FUNCALL(fn, av, 8); break; \ + default: abort(); rv = Qnil; break; \ + } \ +} while (0) + +#define inline_funcall_subr(rv, subr, av) do { \ + void (*fn)() = (void (*)()) (subr_function(subr)); \ + inline_funcall_fn (rv, fn, av, subr->max_args); \ +} while (0) + +static Lisp_Object +primitive_funcall (lisp_fn_t fn, int nargs, Lisp_Object args[]) +{ + Lisp_Object rv; + inline_funcall_fn (rv, fn, args, nargs); + return rv; +} DEFUN ("eval", Feval, 1, 1, 0, /* Evaluate FORM and return its value. @@ -2894,7 +2880,7 @@ while (!in_warnings && !NILP (Vpending_warnings)) { struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - int speccount = specpdl_depth (); + int speccount = specpdl_depth_counter; Lisp_Object this_warning_cons, this_warning, class, level, messij; record_unwind_protect (in_warnings_restore, Qnil); @@ -2922,15 +2908,11 @@ unbind_to (speccount, Qnil); } + if (SYMBOLP (form)) + return Fsymbol_value (form); + if (!CONSP (form)) - { - if (!SYMBOLP (form)) - return form; - - val = Fsymbol_value (form); - - return val; - } + return form; QUIT; if ((consing_since_gc > gc_cons_threshold) || always_gc) @@ -3015,7 +2997,7 @@ if (max_args == UNEVALLED) { backtrace.evalargs = 0; - val = ((subr_function (subr)) (args_left)); + val = ((Lisp_Object (*) (Lisp_Object)) (subr_function (subr))) (args_left); } else if (max_args == MANY) @@ -3081,7 +3063,7 @@ backtrace.nargs = nargs; /* val = funcall_subr (subr, argvals); */ - inline_funcall_subr(val, subr, argvals); + inline_funcall_subr (val, subr, argvals); } } else if (COMPILED_FUNCTIONP (fun)) @@ -3211,11 +3193,11 @@ argvals[i] = Qnil; /* val = funcall_subr (subr, argvals); */ - inline_funcall_subr(val, subr, argvals); + inline_funcall_subr (val, subr, argvals); } else /* val = funcall_subr (subr, args + 1); */ - inline_funcall_subr(val, subr, (&args[1])); + inline_funcall_subr (val, subr, (&args[1])); } else if (COMPILED_FUNCTIONP (fun)) val = funcall_lambda (fun, nargs, args + 1); @@ -3285,13 +3267,13 @@ if (CONSP (function)) { - Lisp_Object funcar = Fcar (function); + Lisp_Object funcar = XCAR (function); if (!SYMBOLP (funcar)) goto invalid_function; if (EQ (funcar, Qmacro)) { - function = Fcdr (function); + function = XCDR (function); goto retry; } if (EQ (funcar, Qautoload)) @@ -3300,7 +3282,7 @@ goto retry; } if (EQ (funcar, Qlambda)) - arglist = Fcar (Fcdr (function)); + arglist = Fcar (XCDR (function)); else goto invalid_function; } @@ -3348,13 +3330,13 @@ if (CONSP (function)) { - Lisp_Object funcar = Fcar (function); + Lisp_Object funcar = XCAR (function); if (!SYMBOLP (funcar)) goto invalid_function; if (EQ (funcar, Qmacro)) { - function = Fcdr (function); + function = XCDR (function); goto retry; } if (EQ (funcar, Qautoload)) @@ -3363,7 +3345,7 @@ goto retry; } if (EQ (funcar, Qlambda)) - arglist = Fcar (Fcdr (function)); + arglist = Fcar (XCDR (function)); else goto invalid_function; } @@ -3486,58 +3468,6 @@ } -/* Define proper types and argument lists simultaneously */ -#define PRIMITIVE_FUNCALL(n) ((Lisp_Object (*) (PRIMITIVE_FUNCALL_##n) -#define PRIMITIVE_FUNCALL_0 void)) (fn)) ( -#define PRIMITIVE_FUNCALL_1 Lisp_Object)) (fn)) (args[0] -#define PRIMITIVE_FUNCALL_2 Lisp_Object, PRIMITIVE_FUNCALL_1, args[1] -#define PRIMITIVE_FUNCALL_3 Lisp_Object, PRIMITIVE_FUNCALL_2, args[2] -#define PRIMITIVE_FUNCALL_4 Lisp_Object, PRIMITIVE_FUNCALL_3, args[3] -#define PRIMITIVE_FUNCALL_5 Lisp_Object, PRIMITIVE_FUNCALL_4, args[4] -#define PRIMITIVE_FUNCALL_6 Lisp_Object, PRIMITIVE_FUNCALL_5, args[5] -#define PRIMITIVE_FUNCALL_7 Lisp_Object, PRIMITIVE_FUNCALL_6, args[6] -#define PRIMITIVE_FUNCALL_8 Lisp_Object, PRIMITIVE_FUNCALL_7, args[7] -#define PRIMITIVE_FUNCALL_9 Lisp_Object, PRIMITIVE_FUNCALL_8, args[8] -#define PRIMITIVE_FUNCALL_10 Lisp_Object, PRIMITIVE_FUNCALL_9, args[9] -#define PRIMITIVE_FUNCALL_11 Lisp_Object, PRIMITIVE_FUNCALL_10, args[10] -#define PRIMITIVE_FUNCALL_12 Lisp_Object, PRIMITIVE_FUNCALL_11, args[11] - -static Lisp_Object -primitive_funcall (lisp_fn_t fn, int nargs, Lisp_Object args[]) -{ - switch (nargs) - { - case 0: return PRIMITIVE_FUNCALL(0); - case 1: return PRIMITIVE_FUNCALL(1); - case 2: return PRIMITIVE_FUNCALL(2); - case 3: return PRIMITIVE_FUNCALL(3); - case 4: return PRIMITIVE_FUNCALL(4); - case 5: return PRIMITIVE_FUNCALL(5); - case 6: return PRIMITIVE_FUNCALL(6); - case 7: return PRIMITIVE_FUNCALL(7); - case 8: return PRIMITIVE_FUNCALL(8); - case 9: return PRIMITIVE_FUNCALL(9); - case 10: return PRIMITIVE_FUNCALL(10); - case 11: return PRIMITIVE_FUNCALL(11); - case 12: return PRIMITIVE_FUNCALL(12); - } - - /* Someone has created a subr that takes more arguments than is - supported by this code. We need to either rewrite the subr to - use a different argument protocol, or add more cases to this - switch. */ - abort (); - return Qnil; /* suppress compiler warning */ -} - -#if 0 /* #### Not called anymore */ -static Lisp_Object -funcall_subr (struct Lisp_Subr *subr, Lisp_Object args[]) -{ - return primitive_funcall (subr_function (subr), subr->max_args, args); -} -#endif - /* FSFmacs has an extra arg EVAL_FLAG. If false, some of the statements below are not done. But it's always true in all the calls to apply_lambda(). */ @@ -3581,6 +3511,30 @@ return tem; } +DEFUN ("fetch-bytecode", Ffetch_bytecode, 1, 1, 0, /* +If byte-compiled OBJECT is lazy-loaded, fetch it now. +*/ + (object)) +{ + if (COMPILED_FUNCTIONP (object) + && CONSP (XCOMPILED_FUNCTION (object)->bytecodes)) + { + Lisp_Object tem = + read_doc_string (XCOMPILED_FUNCTION (object)->bytecodes); + if (!CONSP (tem)) + signal_simple_error ("invalid lazy-loaded byte code", tem); + /* v18 or v19 bytecode file. Need to Ebolify. */ + if (XCOMPILED_FUNCTION (object)->flags.ebolified + && VECTORP (XCDR (tem))) + ebolify_bytecode_constants (XCDR (tem)); + /* VERY IMPORTANT to purecopy here!!!!! + See load_force_doc_string_unwind. */ + XCOMPILED_FUNCTION (object)->bytecodes = Fpurecopy (XCAR (tem)); + XCOMPILED_FUNCTION (object)->constants = Fpurecopy (XCDR (tem)); + } + return object; +} + /* Apply a Lisp function FUN to the NARGS evaluated arguments in ARG_VECTOR and return the result of evaluation. FUN must be either a lambda-expression or a compiled-code object. */ @@ -3649,32 +3603,6 @@ } return unbind_to (speccount, val); } - -DEFUN ("fetch-bytecode", Ffetch_bytecode, 1, 1, 0, /* -If byte-compiled OBJECT is lazy-loaded, fetch it now. -*/ - (object)) -{ - Lisp_Object tem; - - if (COMPILED_FUNCTIONP (object) - && CONSP (XCOMPILED_FUNCTION (object)->bytecodes)) - { - tem = read_doc_string (XCOMPILED_FUNCTION (object)->bytecodes); - if (!CONSP (tem)) - signal_simple_error ("invalid lazy-loaded byte code", tem); - /* v18 or v19 bytecode file. Need to Ebolify. */ - if (XCOMPILED_FUNCTION (object)->flags.ebolified - && VECTORP (XCDR (tem))) - ebolify_bytecode_constants (XCDR (tem)); - /* VERY IMPORTANT to purecopy here!!!!! - See load_force_doc_string_unwind. */ - XCOMPILED_FUNCTION (object)->bytecodes = Fpurecopy (XCAR (tem)); - XCOMPILED_FUNCTION (object)->constants = Fpurecopy (XCDR (tem)); - } - return object; -} - /**********************************************************************/ /* Run hook variables in various ways. */ @@ -4127,68 +4055,72 @@ Lisp_Object call0_in_buffer (struct buffer *buf, Lisp_Object fn) { - int speccount = specpdl_depth (); - Lisp_Object val; - - if (current_buffer != buf) + if (current_buffer == buf) + return call0 (fn); + else { + Lisp_Object val; + int speccount = specpdl_depth_counter; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); set_buffer_internal (buf); + val = call0 (fn); + unbind_to (speccount, Qnil); + return val; } - val = call0 (fn); - unbind_to (speccount, Qnil); - return val; } Lisp_Object call1_in_buffer (struct buffer *buf, Lisp_Object fn, Lisp_Object arg0) { - int speccount = specpdl_depth (); - Lisp_Object val; - - if (current_buffer != buf) + if (current_buffer == buf) + return call1 (fn, arg0); + else { + Lisp_Object val; + int speccount = specpdl_depth_counter; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); set_buffer_internal (buf); + val = call1 (fn, arg0); + unbind_to (speccount, Qnil); + return val; } - val = call1 (fn, arg0); - unbind_to (speccount, Qnil); - return val; } Lisp_Object call2_in_buffer (struct buffer *buf, Lisp_Object fn, Lisp_Object arg0, Lisp_Object arg1) { - int speccount = specpdl_depth (); - Lisp_Object val; - - if (current_buffer != buf) + if (current_buffer == buf) + return call2 (fn, arg0, arg1); + else { + Lisp_Object val; + int speccount = specpdl_depth_counter; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); set_buffer_internal (buf); + val = call2 (fn, arg0, arg1); + unbind_to (speccount, Qnil); + return val; } - val = call2 (fn, arg0, arg1); - unbind_to (speccount, Qnil); - return val; } Lisp_Object call3_in_buffer (struct buffer *buf, Lisp_Object fn, Lisp_Object arg0, Lisp_Object arg1, Lisp_Object arg2) { - int speccount = specpdl_depth (); - Lisp_Object val; - - if (current_buffer != buf) + if (current_buffer == buf) + return call3 (fn, arg0, arg1, arg2); + else { + Lisp_Object val; + int speccount = specpdl_depth_counter; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); set_buffer_internal (buf); + val = call3 (fn, arg0, arg1, arg2); + unbind_to (speccount, Qnil); + return val; } - val = call3 (fn, arg0, arg1, arg2); - unbind_to (speccount, Qnil); - return val; } Lisp_Object @@ -4196,69 +4128,35 @@ Lisp_Object arg0, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { - int speccount = specpdl_depth (); - Lisp_Object val; - - if (current_buffer != buf) + if (current_buffer == buf) + return call4 (fn, arg0, arg1, arg2, arg3); + else { + Lisp_Object val; + int speccount = specpdl_depth_counter; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); set_buffer_internal (buf); - } - val = call4 (fn, arg0, arg1, arg2, arg3); - unbind_to (speccount, Qnil); - return val; -} - -Lisp_Object -call5_in_buffer (struct buffer *buf, Lisp_Object fn, - Lisp_Object arg0, Lisp_Object arg1, Lisp_Object arg2, - Lisp_Object arg3, Lisp_Object arg4) -{ - int speccount = specpdl_depth (); - Lisp_Object val; - - if (current_buffer != buf) - { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - set_buffer_internal (buf); + val = call4 (fn, arg0, arg1, arg2, arg3); + unbind_to (speccount, Qnil); + return val; } - val = call5 (fn, arg0, arg1, arg2, arg3, arg4); - unbind_to (speccount, Qnil); - return val; -} - -Lisp_Object -call6_in_buffer (struct buffer *buf, Lisp_Object fn, - Lisp_Object arg0, Lisp_Object arg1, Lisp_Object arg2, - Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5) -{ - int speccount = specpdl_depth (); - Lisp_Object val; - - if (current_buffer != buf) - { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - set_buffer_internal (buf); - } - val = call6 (fn, arg0, arg1, arg2, arg3, arg4, arg5); - unbind_to (speccount, Qnil); - return val; } Lisp_Object eval_in_buffer (struct buffer *buf, Lisp_Object form) { - int speccount = specpdl_depth (); - Lisp_Object val; - - if (current_buffer != buf) + if (current_buffer == buf) + return Feval (form); + else { + Lisp_Object val; + int speccount = specpdl_depth_counter; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); set_buffer_internal (buf); + val = Feval (form); + unbind_to (speccount, Qnil); + return val; } - val = Feval (form); - unbind_to (speccount, Qnil); - return val; } @@ -4375,9 +4273,9 @@ eval_in_buffer_trapping_errors (CONST char *warning_string, struct buffer *buf, Lisp_Object form) { - int speccount = specpdl_depth (); + int speccount = specpdl_depth_counter; Lisp_Object tem; - Lisp_Object buffer = Qnil; + Lisp_Object buffer; Lisp_Object cons; Lisp_Object opaque; struct gcpro gcpro1, gcpro2; @@ -4414,7 +4312,7 @@ Lisp_Object run_hook_trapping_errors (CONST char *warning_string, Lisp_Object hook_symbol) { - int speccount = specpdl_depth (); + int speccount; Lisp_Object tem; Lisp_Object opaque; struct gcpro gcpro1; @@ -4425,6 +4323,7 @@ if (NILP (tem) || UNBOUNDP (tem)) return Qnil; + speccount = specpdl_depth_counter; specbind (Qinhibit_quit, Qt); opaque = (warning_string ? make_opaque_ptr (warning_string) : Qnil); @@ -4448,7 +4347,7 @@ Lisp_Object hook_symbol, int allow_quit) { - int speccount = specpdl_depth (); + int speccount = specpdl_depth_counter; Lisp_Object tem; Lisp_Object cons = Qnil; struct gcpro gcpro1; @@ -4492,7 +4391,7 @@ Lisp_Object call0_trapping_errors (CONST char *warning_string, Lisp_Object function) { - int speccount = specpdl_depth (); + int speccount; Lisp_Object tem; Lisp_Object opaque = Qnil; struct gcpro gcpro1, gcpro2; @@ -4505,6 +4404,7 @@ } GCPRO2 (opaque, function); + speccount = specpdl_depth_counter; specbind (Qinhibit_quit, Qt); /* gc_currently_forbidden = 1; Currently no reason to do this; */ @@ -4539,7 +4439,7 @@ call1_trapping_errors (CONST char *warning_string, Lisp_Object function, Lisp_Object object) { - int speccount = specpdl_depth (); + int speccount = specpdl_depth_counter; Lisp_Object tem; Lisp_Object cons = Qnil; Lisp_Object opaque = Qnil; @@ -4576,7 +4476,7 @@ call2_trapping_errors (CONST char *warning_string, Lisp_Object function, Lisp_Object object1, Lisp_Object object2) { - int speccount = specpdl_depth (); + int speccount = specpdl_depth_counter; Lisp_Object tem; Lisp_Object cons = Qnil; Lisp_Object opaque = Qnil; @@ -4711,9 +4611,6 @@ } -/* Don't want to include buffer.h just for this */ -extern struct buffer *current_buffer; - void specbind (Lisp_Object symbol, Lisp_Object value) {
--- a/src/event-Xt.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/event-Xt.c Mon Aug 13 10:28:48 2007 +0200 @@ -121,10 +121,6 @@ void emacs_Xt_event_handler (Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch); -#ifdef EPOCH -void dispatch_epoch_event (struct frame *f, XEvent *event, Lisp_Object type); -#endif - static int last_quit_check_signal_tick_count; Lisp_Object Qkey_mapping; @@ -712,7 +708,7 @@ Let's hard-code in some knowledge of common keysyms introduced in recent X11 releases. Snarfed from X11/keysymdef.h - + Probably we should add some stuff here for X11R6. */ switch (keysym) { @@ -1120,7 +1116,7 @@ Lisp_Object l_type = Qnil, l_data = Qnil; Lisp_Object l_dndlist = Qnil, l_item = Qnil; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - + GCPRO4 (l_type, l_data, l_dndlist, l_item); if (! frame) @@ -1144,11 +1140,11 @@ if (state & Button3Mask) button = Button3; if (state & Button2Mask) button = Button2; if (state & Button1Mask) button = Button1; - + emacs_event->event.dnd_drop.modifiers = modifiers; emacs_event->event.dnd_drop.button = button; - DndDropCoordinates(FRAME_X_TEXT_WIDGET(frame), x_event, + DndDropCoordinates(FRAME_X_TEXT_WIDGET(frame), x_event, &(emacs_event->event.dnd_drop.x), &(emacs_event->event.dnd_drop.y) ); @@ -1199,10 +1195,10 @@ break; } -#endif +#endif /* HAVE_OFFIX_DND */ if (ev->message_type == DEVICE_XATOM_WM_PROTOCOLS (d) - && ev->data.l[0] == DEVICE_XATOM_WM_TAKE_FOCUS (d) - && ev->data.l[1] == 0) + && (Atom) (ev->data.l[0]) == DEVICE_XATOM_WM_TAKE_FOCUS (d) + && (Atom) (ev->data.l[1]) == 0) { ev->data.l[1] = DEVICE_X_LAST_SERVER_TIMESTAMP (d); } @@ -1322,7 +1318,7 @@ static void change_frame_visibility (struct frame *f, int is_visible) { - Lisp_Object frame = Qnil; + Lisp_Object frame; XSETFRAME (frame, f); @@ -1335,17 +1331,11 @@ the good 'ol double redisplay structure. */ MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); va_run_hook_with_args (Qmap_frame_hook, 1, frame); -#ifdef EPOCH - dispatch_epoch_event (f, event, Qx_map); -#endif } else if (FRAME_VISIBLE_P (f) && !is_visible) { FRAME_VISIBLE_P (f) = 0; va_run_hook_with_args (Qunmap_frame_hook, 1, frame); -#ifdef EPOCH - dispatch_epoch_event (f, event, Qx_unmap); -#endif } else if (FRAME_VISIBLE_P (f) * is_visible < 0) { @@ -1353,16 +1343,13 @@ if (FRAME_REPAINT_P(f)) MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); va_run_hook_with_args (Qmap_frame_hook, 1, frame); -#ifdef EPOCH - dispatch_epoch_event (f, event, Qx_map); -#endif } } static void handle_map_event (struct frame *f, XEvent *event) { - Lisp_Object frame = Qnil; + Lisp_Object frame; XSETFRAME (frame, f); if (event->type == MapNotify) @@ -1433,12 +1420,12 @@ handle_client_message (struct frame *f, XEvent *event) { struct device *d = XDEVICE (FRAME_DEVICE (f)); - Lisp_Object frame = Qnil; + Lisp_Object frame; XSETFRAME (frame, f); if (event->xclient.message_type == DEVICE_XATOM_WM_PROTOCOLS (d) && - event->xclient.data.l[0] == DEVICE_XATOM_WM_DELETE_WINDOW (d)) + (Atom) (event->xclient.data.l[0]) == DEVICE_XATOM_WM_DELETE_WINDOW (d)) { /* WM_DELETE_WINDOW is a misc-user event, but other ClientMessages, such as WM_TAKE_FOCUS, are eval events. That's because delete-window @@ -1453,7 +1440,7 @@ list3 (Qdelete_frame, frame, Qt)); } else if (event->xclient.message_type == DEVICE_XATOM_WM_PROTOCOLS (d) && - event->xclient.data.l[0] == DEVICE_XATOM_WM_TAKE_FOCUS (d)) + (Atom) event->xclient.data.l[0] == DEVICE_XATOM_WM_TAKE_FOCUS (d)) { handle_focus_event_1 (f, 1); #if 0 @@ -1476,9 +1463,6 @@ } #endif } -#ifdef EPOCH - dispatch_epoch_event (f, event, Qx_client_message); -#endif } static void @@ -1507,9 +1491,6 @@ case PropertyNotify: x_handle_property_notify (&event->xproperty); -#ifdef EPOCH - dispatch_epoch_event (f, event, Qx_property_change); -#endif break; case Expose: @@ -1938,7 +1919,7 @@ static void emacs_Xt_select_console (struct console *con) { - Lisp_Object console = Qnil; + Lisp_Object console; int infd; #ifdef HAVE_GPM int mousefd; @@ -1971,7 +1952,7 @@ static void emacs_Xt_unselect_console (struct console *con) { - Lisp_Object console = Qnil; + Lisp_Object console; int infd; #ifdef HAVE_GPM int mousefd; @@ -2046,7 +2027,7 @@ f = x_any_window_to_frame (get_device_from_display (display), window); if (f) { - char *buf = alloca (XSTRING_LENGTH (f->name) + 4); + char *buf = alloca_array (char, XSTRING_LENGTH (f->name) + 4); sprintf (buf, " \"%s\"", XSTRING_DATA (f->name)); write_string_to_stdio_stream (stderr, 0, (Bufbyte *) buf, 0, strlen (buf), FORMAT_TERMINAL);
--- a/src/event-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/event-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -27,7 +27,7 @@ Ultimately based on FSF. Rewritten by Ben Wing. - Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. */ #include <config.h> @@ -44,7 +44,6 @@ #endif #include "device.h" -#include "emacsfns.h" #include "events.h" #include "frame.h" #include "process.h" @@ -113,9 +112,9 @@ /* These are Lisp integers; see DEFVARS in this file for description. */ int mswindows_dynamic_frame_resize; int mswindows_num_mouse_buttons; -int mswindows_button2_max_skew_x; -int mswindows_button2_max_skew_y; -int mswindows_button2_chord_time; +int mswindows_mouse_button_max_skew_x; +int mswindows_mouse_button_max_skew_y; +int mswindows_mouse_button_tolerance; /* Number of wait handles */ static int mswindows_waitable_count=0; @@ -1276,10 +1275,10 @@ int interval; /* We get one third half system double click threshold */ - if (mswindows_button2_chord_time <= 0) + if (mswindows_mouse_button_tolerance <= 0) interval = GetDoubleClickTime () / 3; else - interval = mswindows_button2_chord_time; + interval = mswindows_mouse_button_tolerance; SetTimer (hwnd, BUTTON_2_TIMER_ID, interval, 0); } @@ -1288,15 +1287,15 @@ mswindows_button2_near_enough (POINTS p1, POINTS p2) { int dx, dy; - if (mswindows_button2_max_skew_x <= 0) + if (mswindows_mouse_button_max_skew_x <= 0) dx = GetSystemMetrics (SM_CXDOUBLECLK) / 2; else - dx = mswindows_button2_max_skew_x; + dx = mswindows_mouse_button_max_skew_x; - if (mswindows_button2_max_skew_y <= 0) + if (mswindows_mouse_button_max_skew_y <= 0) dy = GetSystemMetrics (SM_CYDOUBLECLK) / 2; else - dy = mswindows_button2_max_skew_y; + dy = mswindows_mouse_button_max_skew_y; return abs (p1.x - p2.x) < dx && abs (p1.y- p2.y)< dy; } @@ -1703,7 +1702,7 @@ */ ); /* The description copied verbatim from nt-emacs. (C) Geoff Voelker */ - DEFVAR_INT ("mswindows-mouse-button-tolerance", &mswindows_button2_chord_time /* + DEFVAR_INT ("mswindows-mouse-button-tolerance", &mswindows_mouse_button_tolerance /* *Analogue of double click interval for faking middle mouse events. The value is the minimum time in milliseconds that must elapse between left/right button down events before they are considered distinct events. @@ -1717,25 +1716,25 @@ Number of physical mouse buttons. */ ); - DEFVAR_INT ("mswindows-mouse-button-max-skew-x", &mswindows_button2_max_skew_x /* + DEFVAR_INT ("mswindows-mouse-button-max-skew-x", &mswindows_mouse_button_max_skew_x /* *Maximum horizontal distance in pixels between points in which left and right button clicks occured for them to be translated into single middle button event. Clicks must occur in time not longer than defined -by the variable mswindows-mouse-button-tolerance. +by the variable `mswindows-mouse-button-tolerance'. If negative or zero, currently set system default is used instead. */ ); - DEFVAR_INT ("mswindows-mouse-button-max-skew-y", &mswindows_button2_max_skew_y /* + DEFVAR_INT ("mswindows-mouse-button-max-skew-y", &mswindows_mouse_button_max_skew_y /* *Maximum vertical distance in pixels between points in which left and right button clicks occured for them to be translated into single middle button event. Clicks must occur in time not longer than defined -by the variable mswindows-mouse-button-tolerance. +by the variable `mswindows-mouse-button-tolerance'. If negative or zero, currently set system default is used instead. */ ); - mswindows_button2_max_skew_x = 0; - mswindows_button2_max_skew_y = 0; - mswindows_button2_chord_time = 0; + mswindows_mouse_button_max_skew_x = 0; + mswindows_mouse_button_max_skew_y = 0; + mswindows_mouse_button_tolerance = 0; } void
--- a/src/event-stream.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/event-stream.c Mon Aug 13 10:28:48 2007 +0200 @@ -70,6 +70,7 @@ #define lw_menu_active 0 #endif +#include "blocktype.h" #include "buffer.h" #include "commands.h" #include "device.h" @@ -137,6 +138,8 @@ do not execute it; call disabled-command-hook's value instead. */ Lisp_Object Qdisabled, Vdisabled_command_hook; +EXFUN (Fnext_command_event, 2); + static void pre_command_hook (void); static void post_command_hook (void); @@ -382,14 +385,6 @@ #define GC_COMMAND_BUILDERP(x) GC_RECORDP (x, command_builder) #define CHECK_COMMAND_BUILDER(x) CHECK_RECORD (x, command_builder) -static Lisp_Object mark_command_builder (Lisp_Object obj, - void (*markobj) (Lisp_Object)); -static void finalize_command_builder (void *header, int for_disksave); -DEFINE_LRECORD_IMPLEMENTATION ("command-builder", command_builder, - mark_command_builder, internal_object_printer, - finalize_command_builder, 0, 0, - struct command_builder); - static Lisp_Object mark_command_builder (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -413,6 +408,11 @@ } } +DEFINE_LRECORD_IMPLEMENTATION ("command-builder", command_builder, + mark_command_builder, internal_object_printer, + finalize_command_builder, 0, 0, + struct command_builder); + static void reset_command_builder_event_chain (struct command_builder *builder) { @@ -427,7 +427,7 @@ Lisp_Object allocate_command_builder (Lisp_Object console) { - Lisp_Object builder_obj = Qnil; + Lisp_Object builder_obj; struct command_builder *builder = alloc_lcrecord_type (struct command_builder, lrecord_command_builder); @@ -500,12 +500,10 @@ } } -int +static int event_stream_event_pending_p (int user) { - if (!event_stream) - return 0; - return event_stream->event_pending_p (user); + return event_stream && event_stream->event_pending_p (user); } static int @@ -538,7 +536,7 @@ void event_stream_next_event (struct Lisp_Event *event) { - Lisp_Object event_obj = Qnil; + Lisp_Object event_obj; check_event_stream_ok (EVENT_STREAM_READ); @@ -909,7 +907,8 @@ Lisp_Object frmcons, devcons, concons; FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) { - MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (XFRAME (XCAR (frmcons))); + struct frame *f = XFRAME (XCAR (frmcons)); + MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); } } @@ -959,7 +958,7 @@ } DEFUN ("input-pending-p", Finput_pending_p, 0, 0, 0, /* -T if command input is currently available with no waiting. +Return t if command input is currently available with no waiting. Actually, the value is nil only if we can be sure that no input is available. */ ()) @@ -1263,7 +1262,7 @@ event_stream_disable_wakeup (int id, int async_p) { struct timeout *timeout = 0; - Lisp_Object rest = Qnil; + Lisp_Object rest; Lisp_Object *timeout_list; if (async_p) @@ -1298,7 +1297,7 @@ event_stream_wakeup_pending_p (int id, int async_p) { struct timeout *timeout; - Lisp_Object rest = Qnil; + Lisp_Object rest; Lisp_Object timeout_list; int found = 0; @@ -1371,17 +1370,15 @@ static unsigned long lisp_number_to_milliseconds (Lisp_Object secs, int allow_0) { - unsigned long msecs; #ifdef LISP_FLOAT_TYPE double fsecs; CHECK_INT_OR_FLOAT (secs); fsecs = XFLOATINT (secs); #else long fsecs; - CHECK_INT_OR_FLOAT (secs); + CHECK_INT (secs); fsecs = XINT (secs); #endif - msecs = 1000 * fsecs; if (fsecs < 0) signal_simple_error ("timeout is negative", secs); if (!allow_0 && fsecs == 0) @@ -1389,7 +1386,8 @@ if (fsecs >= (((unsigned int) 0xFFFFFFFF) / 1000)) signal_simple_error ("timeout would exceed 32 bits when represented in milliseconds", secs); - return msecs; + + return (unsigned long) (1000 * fsecs); } DEFUN ("add-timeout", Fadd_timeout, 3, 4, 0, /* @@ -1543,13 +1541,13 @@ event read after all pending events. This only works on keyboard, mouse-click, misc-user, and eval events. */ -void +static void enqueue_command_event (Lisp_Object event) { enqueue_event (event, &command_event_queue, &command_event_queue_tail); } -Lisp_Object +static Lisp_Object dequeue_command_event (void) { return dequeue_event (&command_event_queue, &command_event_queue_tail); @@ -1799,7 +1797,10 @@ /* Mark the minibuffer as changed to make sure it gets updated properly if the echo area is active. */ - MARK_WINDOWS_CHANGED (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame)))); + { + struct window *w = XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame))); + MARK_WINDOWS_CHANGED (w); + } if (FRAMEP (focus_frame) && !EQ (frame, focus_frame)) { @@ -3516,7 +3517,7 @@ if (NILP (f->menubar_data)) error ("Frame has no menubar."); - + id = XPOPUP_DATA (f->menubar_data)->id; val = lw_get_all_values (id); val = val->contents; @@ -5183,8 +5184,8 @@ Vretry_undefined_key_binding_unshifted = Qt; #ifdef HAVE_XIM - DEFVAR_LISP ("Vcomposed_character_default_binding", - &Vretry_undefined_key_binding_unshifted /* + DEFVAR_LISP ("composed-character-default-binding", + &Vcomposed_character_default_binding /* The default keybinding to use for key events from composed input. Window systems frequently have ways to allow the user to compose single characters in a language using multiple keystrokes.
--- a/src/event-tty.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/event-tty.c Mon Aug 13 10:28:48 2007 +0200 @@ -25,7 +25,6 @@ #include <config.h> #include "lisp.h" -#include "blocktype.h" #include "device.h" #include "console-tty.h" #include "events.h" @@ -40,8 +39,6 @@ extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask; extern SELECT_TYPE process_only_mask, tty_only_mask; -extern Lisp_Object Qdelete_device; - static struct event_stream *tty_event_stream;
--- a/src/event-unixoid.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/event-unixoid.c Mon Aug 13 10:28:48 2007 +0200 @@ -37,12 +37,12 @@ #include "process.h" #include "sysdep.h" +#include "sysfile.h" #include "sysproc.h" /* select stuff */ #include "systime.h" #ifdef HAVE_GPM #include "gpmevent.h" -#include <gpm.h> #endif /* Mask of bits indicating the descriptors that we wait for input on. @@ -80,13 +80,13 @@ { unsigned char ch; int nread; - Lisp_Object console = Qnil; + Lisp_Object console; XSETCONSOLE (console, con); #ifdef HAVE_GPM if (fd == CONSOLE_TTY_MOUSE_FD (con)) { - return (handle_gpm_read (event,con,fd)); + return handle_gpm_read (event,con,fd); } #endif
--- a/src/events.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/events.c Mon Aug 13 10:28:48 2007 +0200 @@ -71,6 +71,9 @@ Lisp_Object Qdnd_drop; #endif +EXFUN (Fevent_x_pixel, 1); +EXFUN (Fevent_y_pixel, 1); + /* #### Ad-hoc hack. Should be part of define_lrecord_implementation */ void clear_event_resource (void) @@ -85,7 +88,7 @@ int i; struct Lisp_Event *event = XEVENT (ev); - for (i = 0; i < ((sizeof (struct Lisp_Event)) / sizeof (int)); i++) + for (i = 0; i < (int) (sizeof (struct Lisp_Event) / sizeof (int)); i++) ((int *) event) [i] = 0xdeadbeef; event->event_type = dead_event; event->channel = Qnil; @@ -97,7 +100,7 @@ void zero_event (struct Lisp_Event *e) { - memset (e, 0, sizeof (*e)); + xzero (*e); set_lheader_implementation (&(e->lheader), lrecord_event); e->event_type = empty_event; e->next = Qnil; @@ -390,7 +393,7 @@ DEFUN ("make-event", Fmake_event, 0, 2, 0, /* -Create a new event of type TYPE, with properties described by PLIST. +Return a new event of type TYPE, with properties described by PLIST. TYPE is a symbol, either `empty', `key-press', `button-press', `button-release', `motion' or `dnd-drop'. If TYPE is nil, it @@ -505,23 +508,22 @@ plist = Fcopy_sequence (plist); Fcanonicalize_plist (plist, Qnil); -#define WRONG_EVENT_TYPE_FOR_PROPERTY(prop) \ - error_with_frob (type, "Invalid event type for `%s' property", \ - string_data (symbol_name (XSYMBOL (keyword)))) +#define WRONG_EVENT_TYPE_FOR_PROPERTY(type, prop) \ + error_with_frob (prop, "Invalid property for %s event", \ + string_data (symbol_name (XSYMBOL (type)))) EXTERNAL_PROPERTY_LIST_LOOP (tail, keyword, value, plist) { - CHECK_SYMBOL (keyword); if (EQ (keyword, Qchannel)) { if (e->event_type == key_press_event) { - while (!CONSOLEP (value)) + if (!CONSOLEP (value)) value = wrong_type_argument (Qconsolep, value); } else if (e->event_type != misc_user_event) { - while (!FRAMEP (value)) + if (!FRAMEP (value)) value = wrong_type_argument (Qframep, value); } EVENT_CHANNEL (e) = value; @@ -529,20 +531,20 @@ else if (EQ (keyword, Qkey)) { if (e->event_type != key_press_event) - WRONG_EVENT_TYPE_FOR_PROPERTY (keyword); + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); if (!SYMBOLP (value) && !CHARP (value)) signal_simple_error ("Invalid event key", value); e->event.key.keysym = value; } else if (EQ (keyword, Qbutton)) { - CHECK_NATNUM (value); - check_int_range (XINT (value), 0, 7); if (e->event_type != button_press_event && e->event_type != button_release_event) { - WRONG_EVENT_TYPE_FOR_PROPERTY (keyword); + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); } + CHECK_NATNUM (value); + check_int_range (XINT (value), 0, 7); e->event.button.button = XINT (value); } else if (EQ (keyword, Qmodifiers)) @@ -554,7 +556,9 @@ && e->event_type != button_press_event && e->event_type != button_release_event && e->event_type != pointer_motion_event) - WRONG_EVENT_TYPE_FOR_PROPERTY (keyword); + { + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + } EXTERNAL_LIST_LOOP (modtail, value) { @@ -579,27 +583,27 @@ } else if (EQ (keyword, Qx)) { - /* Allow negative values, so we can specify toolbar - positions. */ - CHECK_INT (value); if (e->event_type != pointer_motion_event && e->event_type != button_press_event && e->event_type != button_release_event) { - WRONG_EVENT_TYPE_FOR_PROPERTY (keyword); + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); } + /* Allow negative values, so we can specify toolbar + positions. */ + CHECK_INT (value); coord_x = XINT (value); } else if (EQ (keyword, Qy)) { - /* Allow negative values; see above. */ - CHECK_INT (value); if (e->event_type != pointer_motion_event && e->event_type != button_press_event && e->event_type != button_release_event) { - WRONG_EVENT_TYPE_FOR_PROPERTY (keyword); + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); } + /* Allow negative values; see above. */ + CHECK_INT (value); coord_y = XINT (value); } else if (EQ (keyword, Qtimestamp)) @@ -610,36 +614,39 @@ else if (EQ (keyword, Qfunction)) { if (e->event_type != misc_user_event) - WRONG_EVENT_TYPE_FOR_PROPERTY (keyword); + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); e->event.eval.function = value; } else if (EQ (keyword, Qobject)) { if (e->event_type != misc_user_event) - WRONG_EVENT_TYPE_FOR_PROPERTY (keyword); + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); e->event.eval.object = value; } #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) else if (EQ (keyword, Qdnd_data)) { - Lisp_Object dnd_tail; + if (e->event_type != dnd_drop_event) + WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); + /* Value is either nil, or a list of (TYPE DATA). TYPE is an integer. DATA is a list. */ if (!NILP (value)) { + Lisp_Object dnd_tail; CHECK_CONS (value); /* To be changed to CHECK_SYMBOL. */ CHECK_NATNUM (XCAR (value)); CHECK_CONS (XCDR (value)); if (XINT (Flength (value)) != 2) - signal_simple_error ("should be a two-element list", value); - /* Check validity of DATA. */ + signal_simple_error ("Data should be a two-element list", value); + /* Check validity of DATA. */ EXTERNAL_LIST_LOOP (dnd_tail, XCAR (XCDR (value))) { /* Every element must be a string. */ CHECK_STRING (XCAR (dnd_tail)); } - /* And now, copy it all. */ + /* And now, copy it all to avoid corruption later. */ e->event.dnd_drop.data = Fcopy_tree (value, Qnil); } } @@ -653,7 +660,7 @@ { if (e->event_type == key_press_event) EVENT_CHANNEL (e) = Vselected_console; - else if (e->event_type != misc_user_event) + else EVENT_CHANNEL (e) = Fselected_frame (Qnil); } @@ -741,9 +748,6 @@ #if 0 { int i, len; - extern Lisp_Object Vlast_command_event; - extern Lisp_Object Vlast_input_event, Vunread_command_event; - extern Lisp_Object Vthis_command_keys, Vrecent_keys_ring; if (EQ (event, Vlast_command_event) || EQ (event, Vlast_input_event) || @@ -1152,8 +1156,8 @@ } DEFUN ("character-to-event", Fcharacter_to_event, 1, 4, 0, /* -Converts a keystroke specifier into an event structure, replete with -bucky bits. The keystroke is the first argument, and the event to fill +Convert keystroke CH into an event structure ,replete with bucky bits. +The keystroke is the first argument, and the event to fill in is the second. This function contains knowledge about what the codes ``mean'' -- for example, the number 9 is converted to the character ``Tab'', not the distinct character ``Control-I''. @@ -1747,7 +1751,7 @@ int pix_x = 0; int pix_y = 0; int result; - Lisp_Object frame = Qnil; + Lisp_Object frame; int ret_x, ret_y, ret_obj_x, ret_obj_y; struct window *ret_w; @@ -2069,7 +2073,7 @@ return result == OVER_TOOLBAR && TOOLBAR_BUTTONP (button) ? button : Qnil; #else - return Qnil; + return Qnil; #endif } @@ -2088,6 +2092,7 @@ */ (event)) { + again: CHECK_LIVE_EVENT (event); switch (XEVENT (event)->event_type) { @@ -2097,7 +2102,8 @@ case eval_event: return XEVENT (event)->event.eval.function; default: - return wrong_type_argument (intern ("timeout-or-eval-event-p"), event); + event = wrong_type_argument (intern ("timeout-or-eval-event-p"), event); + goto again; } } @@ -2158,53 +2164,52 @@ e = XEVENT (event); GCPRO1 (props); - props = Fcons (Qtimestamp, Fcons (Fevent_timestamp (event), props)); + props = cons3 (Qtimestamp, Fevent_timestamp (event), props); switch (e->event_type) { case process_event: - props = Fcons (Qprocess, Fcons (e->event.process.process, props)); + props = cons3 (Qprocess, e->event.process.process, props); break; case timeout_event: - props = Fcons (Qobject, Fcons (Fevent_object (event), props)); - props = Fcons (Qfunction, Fcons (Fevent_function (event), props)); - props = Fcons (Qid, Fcons (make_int (e->event.timeout.id_number), - props)); + props = cons3 (Qobject, Fevent_object (event), props); + props = cons3 (Qfunction, Fevent_function (event), props); + props = cons3 (Qid, make_int (e->event.timeout.id_number), props); break; case key_press_event: - props = Fcons (Qmodifiers, Fcons (Fevent_modifiers (event), props)); - props = Fcons (Qkey, Fcons (Fevent_key (event), props)); + props = cons3 (Qmodifiers, Fevent_modifiers (event), props); + props = cons3 (Qkey, Fevent_key (event), props); break; case button_press_event: case button_release_event: - props = Fcons (Qy, Fcons (Fevent_y_pixel (event), props)); - props = Fcons (Qx, Fcons (Fevent_x_pixel (event), props)); - props = Fcons (Qmodifiers, Fcons (Fevent_modifiers (event), props)); - props = Fcons (Qbutton, Fcons (Fevent_button (event), props)); + props = cons3 (Qy, Fevent_y_pixel (event), props); + props = cons3 (Qx, Fevent_x_pixel (event), props); + props = cons3 (Qmodifiers, Fevent_modifiers (event), props); + props = cons3 (Qbutton, Fevent_button (event), props); break; case pointer_motion_event: - props = Fcons (Qmodifiers, Fcons (Fevent_modifiers (event), props)); - props = Fcons (Qy, Fcons (Fevent_y_pixel (event), props)); - props = Fcons (Qx, Fcons (Fevent_x_pixel (event), props)); + props = cons3 (Qmodifiers, Fevent_modifiers (event), props); + props = cons3 (Qy, Fevent_y_pixel (event), props); + props = cons3 (Qx, Fevent_x_pixel (event), props); break; case misc_user_event: case eval_event: - props = Fcons (Qobject, Fcons (Fevent_object (event), props)); - props = Fcons (Qfunction, Fcons (Fevent_function (event), props)); + props = cons3 (Qobject, Fevent_object (event), props); + props = cons3 (Qfunction, Fevent_function (event), props); break; #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) case dnd_drop_event: - props = Fcons (Qy, Fcons (Fevent_y_pixel (event), props)); - props = Fcons (Qx, Fcons (Fevent_x_pixel (event), props)); - props = Fcons (Qmodifiers, Fcons (Fevent_modifiers (event), props)); - props = Fcons (Qbutton, Fcons (Fevent_button (event), props)); - props = Fcons (Qdnd_data, Fcons (Fevent_drag_and_drop_data (event), props)); + props = cons3 (Qy, Fevent_y_pixel (event), props); + props = cons3 (Qx, Fevent_x_pixel (event), props); + props = cons3 (Qmodifiers, Fevent_modifiers (event), props); + props = cons3 (Qbutton, Fevent_button (event), props); + props = cons3 (Qdnd_data, Fevent_drag_and_drop_data (event), props); break; #endif @@ -2221,7 +2226,7 @@ break; /* not reached; warning suppression */ } - props = Fcons (Qchannel, Fcons (Fevent_channel (event), props)); + props = cons3 (Qchannel, Fevent_channel (event), props); UNGCPRO; return props;
--- a/src/events.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/events.h Mon Aug 13 10:28:48 2007 +0200 @@ -116,7 +116,7 @@ create_stream_pair_cb These callbacks are called by process code to delete_stream_pair_cb create and delete a pait of input and output lstreams - which are used for subprocess I/O. + which are used for subprocess I/O. quitp_cb A handler function called from the `QUIT' macro which should check whether the quit character has been @@ -315,13 +315,13 @@ pair cannot be created. The second, USID_DONTHASH, indicates that streams are created, but the event stream does not wish to be able to find the process by its USID. Specifically, if an event stream implementation never calss - get_process_from_usid, this value should always be returned, to prevent + get_process_from_usid, this value should always be returned, to prevent accumulating useless information on USID to process relationship. */ /* typedef unsigned int USID; in lisp.h */ #define USID_ERROR ((USID)-1) -#define USID_DONTHASH ((USID)0) +#define USID_DONTHASH ((USID)0) struct Lisp_Event; @@ -493,19 +493,30 @@ #define EVENT_LIVE_P(a) (EVENT_TYPE (a) != dead_event) -#define CHECK_LIVE_EVENT(x) \ - do { CHECK_EVENT (x); \ - if (! EVENTP (x) \ - || ! EVENT_LIVE_P (XEVENT (x))) \ - dead_wrong_type_argument (Qevent_live_p, (x)); } while (0) -#define CONCHECK_LIVE_EVENT(x) \ - do { CONCHECK_EVENT (x); \ - if (! EVENTP (x) \ - || ! EVENT_LIVE_P (XEVENT (x))) \ - x = wrong_type_argument (Qevent_live_p, (x)); } while (0) +#define CHECK_LIVE_EVENT(x) do { \ + CHECK_EVENT (x); \ + if (! EVENT_LIVE_P (XEVENT (x))) \ + dead_wrong_type_argument (Qevent_live_p, (x)); \ +} while (0) +#define CONCHECK_LIVE_EVENT(x) do { \ + CONCHECK_EVENT (x); \ + if (! EVENT_LIVE_P (XEVENT (x))) \ + x = wrong_type_argument (Qevent_live_p, (x)); \ +} while (0) -extern Lisp_Object Qevent_live_p; +EXFUN (Fcharacter_to_event, 4); +EXFUN (Fdeallocate_event, 1); +EXFUN (Fevent_glyph_extent, 1); +EXFUN (Fevent_modeline_position, 1); +EXFUN (Fevent_over_modeline_p, 1); +EXFUN (Fevent_over_toolbar_p, 1); +EXFUN (Fevent_point, 1); +EXFUN (Fevent_window, 1); +EXFUN (Fmake_event, 2); + +extern Lisp_Object QKbackspace, QKdelete, QKescape, QKlinefeed, QKreturn; +extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property; /* Note: under X Windows, MOD_ALT is generated by the Alt key if there are both Alt and Meta keys. If there are no Meta keys, then Alt generates @@ -546,7 +557,6 @@ struct console *event_console_or_selected (Lisp_Object event); -int event_stream_event_pending_p (int user); void event_stream_next_event (struct Lisp_Event *event); void event_stream_handle_magic_event (struct Lisp_Event *event); void event_stream_select_console (struct console *c); @@ -624,8 +634,6 @@ extern int emacs_is_blocking; -extern Lisp_Object Vcontrolling_terminal; - extern volatile int sigint_happened; /* Define this if you want the tty event stream to be used when the
--- a/src/extents.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/extents.c Mon Aug 13 10:28:48 2007 +0200 @@ -224,6 +224,7 @@ #include "glyphs.h" #include "hash.h" #include "insdel.h" +#include "keymap.h" #include "opaque.h" #include "process.h" #include "redisplay.h" @@ -350,12 +351,6 @@ struct extent_auxiliary extent_auxiliary_defaults; -MAC_DEFINE (EXTENT, MTancestor_extent) -MAC_DEFINE (EXTENT, MTaux_extent) -MAC_DEFINE (EXTENT, MTplist_extent) -MAC_DEFINE (EXTENT, MTensure_extent) -MAC_DEFINE (EXTENT, MTset_extent) - /* ------------------------------- */ /* buffer-extent primitives */ /* ------------------------------- */ @@ -470,6 +465,10 @@ /* FSFmacs bogosity */ Lisp_Object Vdefault_text_properties; + +EXFUN (Fextent_properties, 1); +EXFUN (Fset_extent_property, 3); + /************************************************************************/ /* Generalized gap array */ @@ -732,14 +731,13 @@ int left = 0, right = GAP_ARRAY_NUM_ELS (ga); int oldfoundpos, foundpos; int found; - EXTENT e; while (left != right) { /* RIGHT might not point to a valid extent (i.e. it's at the end of the list), so NEWPOS must round down. */ unsigned int newpos = (left + right) >> 1; - e = EXTENT_GAP_ARRAY_AT (ga, newpos); + EXTENT e = EXTENT_GAP_ARRAY_AT (ga, (int) newpos); if (endp ? EXTENT_E_LESS (e, extent) : EXTENT_LESS (e, extent)) left = newpos+1; @@ -752,7 +750,7 @@ oldfoundpos = foundpos = left; while (foundpos < GAP_ARRAY_NUM_ELS (ga)) { - e = EXTENT_GAP_ARRAY_AT (ga, foundpos); + EXTENT e = EXTENT_GAP_ARRAY_AT (ga, foundpos); if (e == extent) { found = 1; @@ -912,12 +910,6 @@ /* Auxiliary extent structure */ /************************************************************************/ -static Lisp_Object mark_extent_auxiliary (Lisp_Object obj, - void (*markobj) (Lisp_Object)); -DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, - mark_extent_auxiliary, internal_object_printer, - 0, 0, 0, struct extent_auxiliary); - static Lisp_Object mark_extent_auxiliary (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -932,10 +924,14 @@ return data->parent; } +DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, + mark_extent_auxiliary, internal_object_printer, + 0, 0, 0, struct extent_auxiliary); + void allocate_extent_auxiliary (EXTENT ext) { - Lisp_Object extent_aux = Qnil; + Lisp_Object extent_aux; struct extent_auxiliary *data = alloc_lcrecord_type (struct extent_auxiliary, lrecord_extent_auxiliary); @@ -975,14 +971,6 @@ static void free_soe (struct stack_of_extents *soe); static void soe_invalidate (Lisp_Object obj); -static Lisp_Object mark_extent_info (Lisp_Object obj, - void (*markobj) (Lisp_Object)); -static void finalize_extent_info (void *header, int for_disksave); -DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, - mark_extent_info, internal_object_printer, - finalize_extent_info, 0, 0, - struct extent_info); - static Lisp_Object mark_extent_info (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -1006,7 +994,7 @@ for (i = 0; i < extent_list_num_els (list); i++) { struct extent *extent = extent_list_at (list, i, 0); - Lisp_Object exobj = Qnil; + Lisp_Object exobj; XSETEXTENT (exobj, extent); ((markobj) (exobj)); @@ -1036,10 +1024,15 @@ } } +DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, + mark_extent_info, internal_object_printer, + finalize_extent_info, 0, 0, + struct extent_info); + static Lisp_Object allocate_extent_info (void) { - Lisp_Object extent_info = Qnil; + Lisp_Object extent_info; struct extent_info *data = alloc_lcrecord_type (struct extent_info, lrecord_extent_info); @@ -1082,8 +1075,13 @@ { if (NILP (object)) XSETBUFFER (object, current_buffer); + else if (BUFFERP (object)) + CHECK_LIVE_BUFFER (object); + else if (STRINGP (object)) + ; else - CHECK_LIVE_BUFFER_OR_STRING (object); + dead_wrong_type_argument (Qbuffer_or_string_p, object); + return object; } @@ -1099,8 +1097,8 @@ return e; } -/* Given an extent object (string or buffer or nil), return its extent info. This may be - 0 for a string. */ +/* Given an extent object (string or buffer or nil), return its extent info. + This may be 0 for a string. */ static struct extent_info * buffer_or_string_extent_info (Lisp_Object object) @@ -1283,7 +1281,7 @@ XSETEXTENT (extent, e); print_extent_1 (buf, extent); - printf ("%s", buf); + fputs (buf, stdout); } static void @@ -1310,12 +1308,12 @@ for (i = 0; i < extent_list_num_els (sel); i++) { EXTENT e = extent_list_at (sel, i, endp); - printf ("\t"); + putchar ('\t'); print_extent_2 (e); } - printf ("\n"); + putchar ('\n'); } - printf ("\n"); + putchar ('\n'); } #endif @@ -1330,7 +1328,7 @@ #ifdef SOE_DEBUG printf ("Inserting into SOE: "); print_extent_2 (extent); - printf ("\n"); + putchar ('\n'); #endif if (!soe || soe->pos < extent_start (extent) || soe->pos > extent_end (extent)) @@ -1342,7 +1340,7 @@ } extent_list_insert (soe->extents, extent); #ifdef SOE_DEBUG - printf ("SOE afterwards is:\n"); + puts ("SOE afterwards is:"); soe_dump (obj); #endif } @@ -1357,19 +1355,19 @@ #ifdef SOE_DEBUG printf ("Deleting from SOE: "); print_extent_2 (extent); - printf ("\n"); + putchar ('\n'); #endif if (!soe || soe->pos < extent_start (extent) || soe->pos > extent_end (extent)) { #ifdef SOE_DEBUG - printf ("(not needed)\n\n"); + puts ("(not needed)\n"); #endif return; } extent_list_delete (soe->extents, extent); #ifdef SOE_DEBUG - printf ("SOE afterwards is:\n"); + puts ("SOE afterwards is:"); soe_dump (obj); #endif } @@ -1409,7 +1407,7 @@ else { #ifdef SOE_DEBUG - printf ("(not needed)\n\n"); + puts ("(not needed)\n"); #endif return; } @@ -1495,7 +1493,7 @@ soe->pos = pos; #ifdef SOE_DEBUG - printf ("SOE afterwards is:\n"); + puts ("SOE afterwards is:"); soe_dump (obj); #endif } @@ -1642,7 +1640,7 @@ !NILP (extent_end_glyph (anc)) || !NILP (extent_mouse_face (anc)) || !NILP (extent_invisible (anc)) || - !NILP (extent_initial_redisplay_function (anc)) || + !NILP (extent_initial_redisplay_function (anc)) || invisibility_change) extent_changed_for_redisplay (extent, descendants_too, invisibility_change); @@ -1716,9 +1714,7 @@ { Extent_List *el = extent_extent_list (e); int foundp; - int pos; - - pos = extent_list_locate (el, e, 0, &foundp); + int pos = extent_list_locate (el, e, 0, &foundp); assert (foundp); return real_extent_at_forward (el, pos+1, 0); } @@ -1729,9 +1725,7 @@ { Extent_List *el = extent_extent_list (e); int foundp; - int pos; - - pos = extent_list_locate (el, e, 1, &foundp); + int pos = extent_list_locate (el, e, 1, &foundp); assert (foundp); return real_extent_at_forward (el, pos+1, 1); } @@ -1764,9 +1758,7 @@ { Extent_List *el = extent_extent_list (e); int foundp; - int pos; - - pos = extent_list_locate (el, e, 0, &foundp); + int pos = extent_list_locate (el, e, 0, &foundp); assert (foundp); return real_extent_at_backward (el, pos-1, 0); } @@ -1777,9 +1769,7 @@ { Extent_List *el = extent_extent_list (e); int foundp; - int pos; - - pos = extent_list_locate (el, e, 1, &foundp); + int pos = extent_list_locate (el, e, 1, &foundp); assert (foundp); return real_extent_at_backward (el, pos-1, 1); } @@ -1942,8 +1932,7 @@ static void -map_extents_bytind (Bytind from, Bytind to, - int (*fn) (EXTENT extent, void *arg), void *arg, +map_extents_bytind (Bytind from, Bytind to, map_extents_fun fn, void *arg, Lisp_Object obj, EXTENT after, unsigned int flags) { Memind st, en; /* range we're mapping over */ @@ -2276,7 +2265,7 @@ } void -map_extents (Bufpos from, Bufpos to, int (*fn) (EXTENT extent, void *arg), +map_extents (Bufpos from, Bufpos to, map_extents_fun fn, void *arg, Lisp_Object obj, EXTENT after, unsigned int flags) { map_extents_bytind (buffer_or_string_bufpos_to_bytind (obj, from), @@ -2796,7 +2785,6 @@ struct glyph_block gb; gb.glyph = glyph; - gb.extent = Qnil; XSETEXTENT (gb.extent, e); Dynarr_add (ef->begin_glyphs, gb); } @@ -2812,7 +2800,6 @@ struct glyph_block gb; gb.glyph = glyph; - gb.extent = Qnil; XSETEXTENT (gb.extent, e); Dynarr_add (ef->end_glyphs, gb); } @@ -2872,9 +2859,9 @@ if (e == lhe) { Lisp_Object f; - /* memset isn't really necessary; we only deref `priority' + /* zeroing isn't really necessary; we only deref `priority' and `face' */ - memset (&dummy_lhe_extent, 0, sizeof (dummy_lhe_extent)); + xzero (dummy_lhe_extent); set_extent_priority (&dummy_lhe_extent, mouse_highlight_priority); /* Need to break up thefollowing expression, due to an */ @@ -2891,15 +2878,15 @@ Lisp_Object function = extent_initial_redisplay_function (e); Lisp_Object obj; - /* printf("initial redisplay function called!\n "); */ - - /* print_extent_2(e); - printf("\n"); */ - + /* printf ("initial redisplay function called!\n "); */ + + /* print_extent_2 (e); + printf ("\n"); */ + /* FIXME: One should probably inhibit the displaying of this extent to reduce flicker */ extent_in_red_event_p(e) = 1; - + /* call the function */ XSETEXTENT(obj,e); if(!NILP(function)) @@ -2971,7 +2958,7 @@ if (!NILP (extent_begin_glyph (anc))) *bp++ = '*'; *bp++ = (extent_start_open_p (anc) ? '(': '['); if (extent_detached_p (ext)) - sprintf (bp, "detached"); + strcpy (bp, "detached"); else { Bufpos from = XINT (Fextent_start_position (obj)); @@ -3272,37 +3259,31 @@ } DEFUN ("extentp", Fextentp, 1, 1, 0, /* -T if OBJECT is an extent. +Return t if OBJECT is an extent. */ (object)) { - if (EXTENTP (object)) - return Qt; - return Qnil; + return EXTENTP (object) ? Qt : Qnil; } DEFUN ("extent-live-p", Fextent_live_p, 1, 1, 0, /* -T if OBJECT is an extent and the extent has not been destroyed. +Return t if OBJECT is an extent that has not been destroyed. */ (object)) { - if (EXTENTP (object) && EXTENT_LIVE_P (XEXTENT (object))) - return Qt; - return Qnil; + return EXTENTP (object) && EXTENT_LIVE_P (XEXTENT (object)) ? Qt : Qnil; } DEFUN ("extent-detached-p", Fextent_detached_p, 1, 1, 0, /* -T if EXTENT is detached. +Return t if EXTENT is detached. */ (extent)) { - if (extent_detached_p (decode_extent (extent, 0))) - return Qt; - return Qnil; + return extent_detached_p (decode_extent (extent, 0)) ? Qt : Qnil; } DEFUN ("extent-object", Fextent_object, 1, 1, 0, /* -Return object (buffer or string) EXTENT refers to. +Return object (buffer or string) that EXTENT refers to. */ (extent)) { @@ -3650,12 +3631,10 @@ static void set_extent_openness (EXTENT extent, int start_open, int end_open) { - if (start_open == -1) - start_open = extent_start_open_p (extent); - if (end_open == -1) - end_open = extent_end_open_p (extent); - extent_start_open_p (extent) = start_open; - extent_end_open_p (extent) = end_open; + if (start_open != -1) + extent_start_open_p (extent) = start_open; + if (end_open != -1) + extent_end_open_p (extent) = end_open; /* changing the open/closedness of an extent does not affect redisplay. */ } @@ -3712,7 +3691,7 @@ destroy_extent (EXTENT extent) { Lisp_Object rest, nextrest, children; - Lisp_Object extent_obj = Qnil; + Lisp_Object extent_obj; if (!extent_detached_p (extent)) extent_detach (extent); @@ -3741,7 +3720,7 @@ */ (from, to, buffer_or_string)) { - Lisp_Object extent_obj = Qnil; + Lisp_Object extent_obj; Lisp_Object obj; obj = decode_buffer_or_string (buffer_or_string); @@ -3902,17 +3881,17 @@ /* I do so love that conditional operator ... */ retval |= - EQ (sym, Qend_closed) ? ME_END_CLOSED : - EQ (sym, Qstart_open) ? ME_START_OPEN : - EQ (sym, Qall_extents_closed) ? ME_ALL_EXTENTS_CLOSED : - EQ (sym, Qall_extents_open) ? ME_ALL_EXTENTS_OPEN : + EQ (sym, Qend_closed) ? ME_END_CLOSED : + EQ (sym, Qstart_open) ? ME_START_OPEN : + EQ (sym, Qall_extents_closed) ? ME_ALL_EXTENTS_CLOSED : + EQ (sym, Qall_extents_open) ? ME_ALL_EXTENTS_OPEN : EQ (sym, Qall_extents_closed_open) ? ME_ALL_EXTENTS_CLOSED_OPEN : EQ (sym, Qall_extents_open_closed) ? ME_ALL_EXTENTS_OPEN_CLOSED : - EQ (sym, Qstart_in_region) ? ME_START_IN_REGION : - EQ (sym, Qend_in_region) ? ME_END_IN_REGION : + EQ (sym, Qstart_in_region) ? ME_START_IN_REGION : + EQ (sym, Qend_in_region) ? ME_END_IN_REGION : EQ (sym, Qstart_and_end_in_region) ? ME_START_AND_END_IN_REGION : - EQ (sym, Qstart_or_end_in_region) ? ME_START_OR_END_IN_REGION : - EQ (sym, Qnegate_in_region) ? ME_NEGATE_IN_REGION : + EQ (sym, Qstart_or_end_in_region) ? ME_START_OR_END_IN_REGION : + EQ (sym, Qnegate_in_region) ? ME_NEGATE_IN_REGION : (signal_simple_error ("Invalid `map-extents' flag", sym), 0); flags = XCDR (flags); @@ -3927,18 +3906,15 @@ */ (extent, from, to, flags)) { - EXTENT ext; - Lisp_Object obj; Bytind start, end; - - ext = decode_extent (extent, DE_MUST_BE_ATTACHED); - obj = extent_object (ext); + EXTENT ext = decode_extent (extent, DE_MUST_BE_ATTACHED); + Lisp_Object obj = extent_object (ext); + get_buffer_or_string_range_byte (obj, from, to, &start, &end, GB_ALLOW_NIL | GB_ALLOW_PAST_ACCESSIBLE); - if (extent_in_region_p (ext, start, end, decode_map_extents_flags (flags))) - return Qt; - return Qnil; + return extent_in_region_p (ext, start, end, decode_map_extents_flags (flags)) ? + Qt : Qnil; } struct slow_map_extents_arg @@ -3973,10 +3949,7 @@ closure->result = call2 (closure->map_routine, extent_obj, closure->map_arg); - if (NILP (closure->result)) - return 0; - else - return 1; + return !NILP (closure->result); } DEFUN ("map-extents", Fmap_extents, 1, 8, 0, /* @@ -4176,10 +4149,7 @@ closure->prev_start = extent_endpoint_bytind (extent, 0); closure->prev_end = extent_endpoint_bytind (extent, 1); - if (NILP (closure->result)) - return 0; - else - return 1; + return !NILP (closure->result); } DEFUN ("map-extent-children", Fmap_extent_children, 1, 8, 0, /* @@ -4277,24 +4247,16 @@ static enum extent_at_flag decode_extent_at_flag (Lisp_Object at_flag) { - enum extent_at_flag fl; - if (NILP (at_flag)) - fl = EXTENT_AT_AFTER; - else - { - CHECK_SYMBOL (at_flag); - if (EQ (at_flag, Qafter)) - fl = EXTENT_AT_AFTER; - else if (EQ (at_flag, Qbefore)) - fl = EXTENT_AT_BEFORE; - else if (EQ (at_flag, Qat)) - fl = EXTENT_AT_AT; - else - signal_simple_error ("Invalid AT-FLAG in `extent-at'", at_flag); - } - - return fl; + return EXTENT_AT_AFTER; + + CHECK_SYMBOL (at_flag); + if (EQ (at_flag, Qafter)) return EXTENT_AT_AFTER; + if (EQ (at_flag, Qbefore)) return EXTENT_AT_BEFORE; + if (EQ (at_flag, Qat)) return EXTENT_AT_AT; + + signal_simple_error ("Invalid AT-FLAG in `extent-at'", at_flag); + return EXTENT_AT_AFTER; /* unreached */ } static int @@ -4347,7 +4309,7 @@ EXTENT before, enum extent_at_flag at_flag) { struct extent_at_arg closure; - Lisp_Object extent_obj = Qnil; + Lisp_Object extent_obj; /* it might be argued that invalid positions should cause errors, but the principle of least surprise dictates that @@ -4790,36 +4752,33 @@ } /* Do we need a lisp-level function ? */ -DEFUN ("set-extent-initial-redisplay-function", Fset_extent_initial_redisplay_function, - 2,2,0,/* +DEFUN ("set-extent-initial-redisplay-function", + Fset_extent_initial_redisplay_function, 2,2,0,/* Note: This feature is experimental! - + Set initial-redisplay-function of EXTENT to the function FUNCTION. The first time the EXTENT is (re)displayed, an eval event will be -dispatched calling FUNCTION with EXTENT as its only argument. +dispatched calling FUNCTION with EXTENT as its only argument. */ - (extent, function)) + (extent, function)) { EXTENT e = decode_extent(extent, DE_MUST_BE_ATTACHED); e = extent_ancestor (e); /* Is this needed? Macro also does chasing!*/ set_extent_initial_redisplay_function(e,function); extent_in_red_event_p(e) = 0; /* If the function changed we can spawn - new events */ + new events */ extent_changed_for_redisplay(e,1,0); /* Do we need to mark children too ?*/ - + return function; } - - - DEFUN ("extent-face", Fextent_face, 1, 1, 0, /* Return the name of the face in which EXTENT is displayed, or nil if the extent's face is unspecified. This might also return a list -of face names. +of face names. */ (extent)) { @@ -4895,7 +4854,7 @@ void set_extent_glyph (EXTENT extent, Lisp_Object glyph, int endp, - unsigned int layout) + glyph_layout layout) { extent = extent_ancestor (extent); @@ -4914,41 +4873,34 @@ } static Lisp_Object -glyph_layout_to_symbol (unsigned int layout) +glyph_layout_to_symbol (glyph_layout layout) { switch (layout) { - case GL_TEXT: return Qtext; + case GL_TEXT: return Qtext; case GL_OUTSIDE_MARGIN: return Qoutside_margin; - case GL_INSIDE_MARGIN: return Qinside_margin; - case GL_WHITESPACE: return Qwhitespace; - default: abort (); + case GL_INSIDE_MARGIN: return Qinside_margin; + case GL_WHITESPACE: return Qwhitespace; + default: + abort (); + return Qnil; /* unreached */ } - return Qnil; /* shut up compiler */ -} - -static unsigned int +} + +static glyph_layout symbol_to_glyph_layout (Lisp_Object layout_obj) { - unsigned int layout = 0; - if (NILP (layout_obj)) - layout = GL_TEXT; - else - { - CHECK_SYMBOL (layout_obj); - if (EQ (Qoutside_margin, layout_obj)) - layout = GL_OUTSIDE_MARGIN; - else if (EQ (Qinside_margin, layout_obj)) - layout = GL_INSIDE_MARGIN; - else if (EQ (Qwhitespace, layout_obj)) - layout = GL_WHITESPACE; - else if (EQ (Qtext, layout_obj)) - layout = GL_TEXT; - else - signal_simple_error ("unknown glyph layout type", layout_obj); - } - return layout; + return GL_TEXT; + + CHECK_SYMBOL (layout_obj); + if (EQ (layout_obj, Qoutside_margin)) return GL_OUTSIDE_MARGIN; + if (EQ (layout_obj, Qinside_margin)) return GL_INSIDE_MARGIN; + if (EQ (layout_obj, Qwhitespace)) return GL_WHITESPACE; + if (EQ (layout_obj, Qtext)) return GL_TEXT; + + signal_simple_error ("unknown glyph layout type", layout_obj); + return GL_TEXT; /* unreached */ } static Lisp_Object @@ -4956,7 +4908,7 @@ Lisp_Object layout_obj) { EXTENT extent = decode_extent (extent_obj, DE_MUST_HAVE_BUFFER); - unsigned int layout = symbol_to_glyph_layout (layout_obj); + glyph_layout layout = symbol_to_glyph_layout (layout_obj); /* Make sure we've actually been given a glyph or it's nil (meaning we're deleting a glyph from an extent). */ @@ -5050,22 +5002,22 @@ } DEFUN ("set-extent-priority", Fset_extent_priority, 2, 2, 0, /* -Changes the display priority of EXTENT. +Set the display priority of EXTENT to PRIORITY (an integer). When the extent attributes are being merged for display, the priority is used to determine which extent takes precedence in the event of a conflict (two extents whose faces both specify font, for example: the font of the extent with the higher priority will be used). Extents are created with priority 0; priorities may be negative. */ - (extent, pri)) + (extent, priority)) { EXTENT e = decode_extent (extent, 0); - CHECK_INT (pri); + CHECK_INT (priority); e = extent_ancestor (e); - set_extent_priority (e, XINT (pri)); + set_extent_priority (e, XINT (priority)); extent_maybe_changed_for_redisplay (e, 1, 0); - return pri; + return priority; } DEFUN ("extent-priority", Fextent_priority, 1, 1, 0, /* @@ -5316,9 +5268,8 @@ while (!NILP (plist)) { - property = Fcar (plist); - value = Fcar (Fcdr (plist)); - plist = Fcdr (Fcdr (plist)); + property = Fcar (plist); plist = Fcdr (plist); + value = Fcar (plist); plist = Fcdr (plist); Fset_extent_property (extent, property, value); } UNGCPRO; @@ -5378,13 +5329,9 @@ return extent_end_glyph (e); else { - Lisp_Object value; - - value = external_plist_get (extent_plist_addr (e), property, 0, - ERROR_ME); - if (UNBOUNDP (value)) - return default_; - return value; + Lisp_Object value = external_plist_get (extent_plist_addr (e), + property, 0, ERROR_ME); + return UNBOUNDP (value) ? default_ : value; } } @@ -5395,12 +5342,13 @@ (extent)) { EXTENT e, anc; - Lisp_Object result, face, anc_obj = Qnil; + Lisp_Object result, face, anc_obj; + enum glyph_layout layout; CHECK_EXTENT (extent); e = XEXTENT (extent); if (!EXTENT_LIVE_P (e)) - return Fcons (Qdestroyed, Fcons (Qt, Qnil)); + return cons3 (Qdestroyed, Qt, Qnil); anc = extent_ancestor (e); XSETEXTENT (anc_obj, anc); @@ -5408,55 +5356,60 @@ /* For efficiency, use the ancestor for all properties except detached */ result = extent_plist_slot (anc); - face = Fextent_face (anc_obj); - if (!NILP (face)) - result = Fcons (Qface, Fcons (face, result)); - face = Fextent_mouse_face (anc_obj); - if (!NILP (face)) - result = Fcons (Qmouse_face, Fcons (face, result)); - - /* For now continue to include this for backwards compatibility. */ - if (extent_begin_glyph_layout (anc) != GL_TEXT) - result = Fcons (Qglyph_layout, - glyph_layout_to_symbol (extent_begin_glyph_layout (anc))); - - if (extent_begin_glyph_layout (anc) != GL_TEXT) - result = Fcons (Qbegin_glyph_layout, - glyph_layout_to_symbol (extent_begin_glyph_layout (anc))); - if (extent_end_glyph_layout (anc) != GL_TEXT) - result = Fcons (Qend_glyph_layout, - glyph_layout_to_symbol (extent_end_glyph_layout (anc))); + + if (!NILP (face = Fextent_face (anc_obj))) + result = cons3 (Qface, face, result); + + if (!NILP (face = Fextent_mouse_face (anc_obj))) + result = cons3 (Qmouse_face, face, result); + + if ((layout = extent_begin_glyph_layout (anc)) != GL_TEXT) + { + Lisp_Object sym = glyph_layout_to_symbol (layout); + result = cons3 (Qglyph_layout, sym, result); /* compatibility */ + result = cons3 (Qbegin_glyph_layout, sym, result); + } + + if ((layout = extent_end_glyph_layout (anc)) != GL_TEXT) + result = cons3 (Qend_glyph_layout, glyph_layout_to_symbol (layout), result); if (!NILP (extent_end_glyph (anc))) - result = Fcons (Qend_glyph, Fcons (extent_end_glyph (anc), result)); + result = cons3 (Qend_glyph, extent_end_glyph (anc), result); + if (!NILP (extent_begin_glyph (anc))) - result = Fcons (Qbegin_glyph, Fcons (extent_begin_glyph (anc), result)); + result = cons3 (Qbegin_glyph, extent_begin_glyph (anc), result); if (extent_priority (anc) != 0) - result = Fcons (Qpriority, Fcons (make_int (extent_priority (anc)), - result)); + result = cons3 (Qpriority, make_int (extent_priority (anc)), result); if (!NILP (extent_initial_redisplay_function (anc))) - result = Fcons (Qinitial_redisplay_function, Fcons (extent_initial_redisplay_function (anc), result)); + result = cons3 (Qinitial_redisplay_function, + extent_initial_redisplay_function (anc), result); if (!NILP (extent_invisible (anc))) - result = Fcons (Qinvisible, Fcons (extent_invisible (anc), result)); + result = cons3 (Qinvisible, extent_invisible (anc), result); if (!NILP (extent_read_only (anc))) - result = Fcons (Qread_only, Fcons (extent_read_only (anc), result)); - -#define CONS_FLAG(flag, sym) if (extent_normal_field (anc, flag)) \ - result = Fcons (sym, Fcons (Qt, result)) - CONS_FLAG (end_open, Qend_open); - CONS_FLAG (start_open, Qstart_open); - CONS_FLAG (detachable, Qdetachable); - CONS_FLAG (duplicable, Qduplicable); - CONS_FLAG (unique, Qunique); -#undef CONS_FLAG + result = cons3 (Qread_only, extent_read_only (anc), result); + + if (extent_normal_field (anc, end_open)) + result = cons3 (Qend_open, Qt, result); + + if (extent_normal_field (anc, start_open)) + result = cons3 (Qstart_open, Qt, result); + + if (extent_normal_field (anc, detachable)) + result = cons3 (Qdetachable, Qt, result); + + if (extent_normal_field (anc, duplicable)) + result = cons3 (Qduplicable, Qt, result); + + if (extent_normal_field (anc, unique)) + result = cons3 (Qunique, Qt, result); /* detached is not an inherited property */ if (extent_detached_p (e)) - result = Fcons (Qdetached, Fcons (Qt, result)); + result = cons3 (Qdetached, Qt, result); return result; } @@ -5968,7 +5921,7 @@ } DEFUN ("get-text-property", Fget_text_property, 2, 4, 0, /* -Returns the value of the PROP property at the given position. +Return the value of the PROP property at the given position. Optional arg OBJECT specifies the buffer or string to look in, and defaults to the current buffer. Optional arg AT-FLAG controls what it means for a property to be "at" @@ -5982,7 +5935,7 @@ } DEFUN ("get-char-property", Fget_char_property, 2, 4, 0, /* -Returns the value of the PROP property at the given position. +Return the value of the PROP property at the given position. Optional arg OBJECT specifies the buffer or string to look in, and defaults to the current buffer. Optional arg AT-FLAG controls what it means for a property to be "at" @@ -6141,9 +6094,9 @@ (the invariant mentioned above) that extent has the proper endpoint setting, so we just use it. */ set_extent_openness (te, new_start != e_start ? - extent_start_open_p (e) : -1, + (int) extent_start_open_p (e) : -1, new_end != e_end ? - extent_end_open_p (e) : -1); + (int) extent_end_open_p (e) : -1); closure->changed_p = 1; } extent_detach (e); @@ -6274,7 +6227,7 @@ */ if (!NILP (value) && NILP (closure.the_extent)) { - Lisp_Object extent = Qnil; + Lisp_Object extent; XSETEXTENT (extent, make_extent_internal (object, start, end)); closure.changed_p = 1; @@ -6375,7 +6328,7 @@ DEFUN ("add-nonduplicable-text-properties", Fadd_nonduplicable_text_properties, 3, 4, 0, /* Add nonduplicable properties to the characters from START to END. -(The properties will not be copied when the characters are copied.) +\(The properties will not be copied when the characters are copied.) The third argument PROPS is a property list specifying the property values to add. The optional fourth argument, OBJECT, is the buffer or string containing the text and defaults to the current buffer. Returns t if @@ -6621,8 +6574,6 @@ defsymbol (&Qextentp, "extentp"); defsymbol (&Qextent_live_p, "extent-live-p"); - defsymbol (&Qend_closed, "end-closed"); - defsymbol (&Qstart_open, "start-open"); defsymbol (&Qall_extents_closed, "all-extents-closed"); defsymbol (&Qall_extents_open, "all-extents-open"); defsymbol (&Qall_extents_closed_open, "all-extents-closed-open"); @@ -6649,11 +6600,11 @@ defsymbol (&Qpriority, "priority"); defsymbol (&Qmouse_face, "mouse-face"); defsymbol (&Qinitial_redisplay_function,"initial-redisplay-function"); - + defsymbol (&Qglyph_layout, "glyph-layout"); /* backwards compatibility */ defsymbol (&Qbegin_glyph_layout, "begin-glyph-layout"); - defsymbol (&Qbegin_glyph_layout, "end-glyph-layout"); + defsymbol (&Qend_glyph_layout, "end-glyph-layout"); defsymbol (&Qoutside_margin, "outside-margin"); defsymbol (&Qinside_margin, "inside-margin"); defsymbol (&Qwhitespace, "whitespace"); @@ -6675,9 +6626,6 @@ DEFSUBR (Fextent_end_position); DEFSUBR (Fextent_object); DEFSUBR (Fextent_length); -#if 0 - DEFSUBR (Fstack_of_extents); -#endif DEFSUBR (Fmake_extent); DEFSUBR (Fcopy_extent);
--- a/src/extents.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/extents.h Mon Aug 13 10:28:48 2007 +0200 @@ -31,6 +31,15 @@ #define CHECK_EXTENT(x) CHECK_RECORD (x, extent) #define CONCHECK_EXTENT(x) CONCHECK_RECORD (x, extent) +/* the layouts for glyphs (extent->flags.glyph_layout). Must fit in 2 bits. */ +typedef enum glyph_layout +{ + GL_TEXT, + GL_OUTSIDE_MARGIN, + GL_INSIDE_MARGIN, + GL_WHITESPACE +} glyph_layout; + struct extent { struct lrecord_header lheader; @@ -41,53 +50,54 @@ buffer), Qt (destroyed extent) */ /* Extent properties are conceptually a plist, but the most common - props are implemented as bits instead of conses. - */ + props are implemented as bits instead of conses. */ struct - { - Lisp_Object face; + { + Lisp_Object face; + + /* These flags are simply an optimization for common boolean properties + which go onto the extent's property list. Any of them would work if + done in the normal way, but the space savings of doing these in this + way is significant. Note that if you add a flag, there are numerous + places in extents.c that need to know about it. - /* These flags are simply an optimization for common boolean properties - which go onto the extent's property list. Any of them would work if - done in the normal way, but the space savings of doing these in this - way is significant. Note that if you add a flag, there are numerous - places in extents.c that need to know about it. + Another consideration is that some of these properties are accessed + during redisplay, so it's good for access to them to be fast (a bit + reference instead of a search down a plist). - Another consideration is that some of these properties are accessed - during redisplay, so it's good for access to them to be fast (a bit - reference instead of a search down a plist). + `begin_glyph_layout' and `end_glyph_layout' are unusual in that + they have 4 states instead of 2. - `begin_glyph_layout' and `end_glyph_layout' are unusual in - that they have 4 states instead of 2. + Other special extent properties are stored in an auxiliary + structure that sits at the beginning of the plist. The has_aux + flag indicates whether this structure exists. The has_parent + flag is an optimization indicating whether the extent has a parent + (this could also be determined by looking in the aux structure). */ - Other special extent properties are stored in an auxiliary - structure that sits at the beginning of the plist. The has_aux - flag indicates whether this structure exists. The has_parent - flag is an optimization indicating whether the extent has a parent - (this could also be determined by looking in the aux structure). */ - - unsigned int begin_glyph_layout :2; /* 2 text, margins, or whitespace */ - unsigned int end_glyph_layout :2; /* 4 text, margins, or whitespace */ - unsigned int has_parent : 1; /* 5 extent has a parent */ - unsigned int has_aux : 1; /* 6 extent has an aux. structure */ - unsigned int start_open : 1; /* 7 insertion behavior at start */ - unsigned int end_open : 1; /* 8 insertion behavior at end */ - unsigned int unused9 : 1; /* 9 unused */ - unsigned int unique : 1; /* 10 there may be only one attached */ - unsigned int duplicable : 1; /* 11 copied to strings by kill/undo */ - unsigned int REPLICATING : 1; /* 12 invoke old extent-replica behav.*/ - /* Not used any more */ - unsigned int detachable : 1; /* 13 extent detaches if text deleted */ - unsigned int internal : 1; /* 14 used by map-extents etc. */ - unsigned int in_red_event : 1; /* 15 An event has been spawned for - initial redisplay. Not exported to - the lisp level */ - unsigned int unused16 : 1; /* 16 unused */ - /* --- Adding more flags will cause the extent struct grow by another - word. It's not clear that this would make a difference, however, - because on 32-bit machines things tend to get allocated in chunks - of 4 bytes. */ - } flags; + enum_field (glyph_layout) begin_glyph_layout :2; + /* 2 text, margins, or whitespace */ + enum_field (glyph_layout) end_glyph_layout :2; + /* 4 text, margins, or whitespace */ + unsigned int has_parent :1; /* 5 extent has a parent */ + unsigned int has_aux :1; /* 6 extent has an aux. structure */ + unsigned int start_open :1; /* 7 insertion behavior at start */ + unsigned int end_open :1; /* 8 insertion behavior at end */ + unsigned int unused9 :1; /* 9 unused */ + unsigned int unique :1; /* 10 there may be only one attached */ + unsigned int duplicable :1; /* 11 copied to strings by kill/undo */ + unsigned int REPLICATING :1; /* 12 invoke old extent-replica behav.*/ + /* Not used any more */ + unsigned int detachable :1; /* 13 extent detaches if text deleted */ + unsigned int internal :1; /* 14 used by map-extents etc. */ + unsigned int in_red_event :1; /* 15 An event has been spawned for + initial redisplay. + Not exported to the lisp level */ + unsigned int unused16 :1; /* 16 unused */ + /* --- Adding more flags will cause the extent struct to grow by another + word. It's not clear that this would make a difference, however, + because on 32-bit machines things tend to get allocated in chunks + of 4 bytes. */ + } flags; /* The plist may have an auxiliary structure as its first element */ Lisp_Object plist; }; @@ -103,12 +113,6 @@ ((endp) ? set_extent_end (e, val) : set_extent_start (e, val)) #define extent_detached_p(e) (extent_start (e) < 0) -/* the layouts for glyphs (extent->flags.glyph_layout). Must fit in 2 bits. */ -#define GL_TEXT 0 -#define GL_OUTSIDE_MARGIN 1 -#define GL_INSIDE_MARGIN 2 -#define GL_WHITESPACE 3 - /* Additional information that may be present in an extent. The idea is that fast access is provided to this information, but since (hopefully) most extents won't have this set on them, we usually don't need to @@ -158,8 +162,7 @@ }; DECLARE_LRECORD (extent_info, struct extent_info); -#define XEXTENT_INFO(x) \ - XRECORD (x, extent_info, struct extent_info) +#define XEXTENT_INFO(x) XRECORD (x, extent_info, struct extent_info) #define XSETEXTENT_INFO(x, p) XSETRECORD (x, p, extent_info) #define EXTENT_INFOP(x) RECORDP (x, extent_info) #define GC_EXTENT_INFOP(x) GC_RECORDP (x, extent_info) @@ -168,29 +171,7 @@ void flush_cached_extent_info (Lisp_Object extent_info); -/* Note that we take pains in all the macros below never to evaluate - the extent argument more than once. This may not be necessary - but is much less likely to introduce subtle bugs. */ - -MAC_DECLARE_EXTERN (EXTENT, MTancestor_extent) -MAC_DECLARE_EXTERN (EXTENT, MTaux_extent) -MAC_DECLARE_EXTERN (EXTENT, MTplist_extent) -MAC_DECLARE_EXTERN (EXTENT, MTensure_extent) -MAC_DECLARE_EXTERN (EXTENT, MTset_extent) - -/* extent_ancestor() chases all the parent links until there aren't any - more. extent_ancestor_1() does the same thing but it a function; - the following macro optimizes the most common case. */ - -#define extent_ancestor(e) \ -MAC_BEGIN \ - MAC_DECLARE (EXTENT, MTancestor_extent, e) \ - (MTancestor_extent->flags.has_parent ? \ - extent_ancestor_1 (MTancestor_extent) : \ - MTancestor_extent) \ -MAC_END - -/* a "normal" field is one that is stored in the `struct flags' structure +/* A "normal" field is one that is stored in the `struct flags' structure in an extent. an "aux" field is one that is stored in the extent's auxiliary structure. @@ -201,13 +182,16 @@ #define extent_no_chase_normal_field(e, field) ((e)->flags.field) -#define extent_no_chase_aux_field(e, field) \ -MAC_BEGIN \ - MAC_DECLARE (EXTENT, MTaux_extent, e) \ - (MTaux_extent->flags.has_aux ? \ - XEXTENT_AUXILIARY (XCONS (MTaux_extent->plist)->car)->field \ - : extent_auxiliary_defaults.field) \ -MAC_END +INLINE struct extent_auxiliary *extent_aux_or_default (EXTENT e); +INLINE struct extent_auxiliary * +extent_aux_or_default (EXTENT e) +{ + return e->flags.has_aux ? + XEXTENT_AUXILIARY (XCAR (e->plist)) : + & extent_auxiliary_defaults; +} + +#define extent_no_chase_aux_field(e, field) (extent_aux_or_default(e)->field) #define extent_normal_field(e, field) \ extent_no_chase_normal_field (extent_ancestor (e), field) @@ -215,29 +199,20 @@ #define extent_aux_field(e, field) \ extent_no_chase_aux_field (extent_ancestor (e), field) -#define ensure_extent_has_auxiliary(e) \ -MAC_BEGIN \ - MAC_DECLARE (EXTENT, MTensure_extent, e) \ - (MTensure_extent->flags.has_aux ? (void) 0 : \ - allocate_extent_auxiliary (MTensure_extent)) \ -MAC_END - -#define set_extent_no_chase_aux_field(e, field, value) \ -MAC_BEGIN \ - MAC_DECLARE (EXTENT, MTset_extent, e) \ - ensure_extent_has_auxiliary (MTset_extent) \ - MAC_SEP \ - XEXTENT_AUXILIARY (XCONS (MTset_extent->plist)->car)->field = \ - (value) \ -MAC_END +#define set_extent_no_chase_aux_field(e, field, value) do { \ + EXTENT sencaf_e = (e); \ + if (! sencaf_e->flags.has_aux) \ + allocate_extent_auxiliary (sencaf_e); \ + XEXTENT_AUXILIARY (XCAR (sencaf_e->plist))->field = (value);\ +} while (0) #define set_extent_no_chase_normal_field(e, field, value) \ extent_no_chase_normal_field (e, field) = (value) -#define set_extent_aux_field(e, field, value) \ +#define set_extent_aux_field(e, field, value) \ set_extent_no_chase_aux_field (extent_ancestor (e), field, value) -#define set_extent_normal_field(e, field, value) \ +#define set_extent_normal_field(e, field, value) \ set_extent_ancestor_normal_field (extent_no_chase (e), field, value) /* The `parent' and `children' fields are not affected by any @@ -256,41 +231,40 @@ #define extent_mouse_face(e) extent_aux_field (e, mouse_face) #define extent_initial_redisplay_function(e) extent_aux_field (e, initial_redisplay_function) -#define set_extent_begin_glyph(e, value) \ +#define set_extent_begin_glyph(e, value) \ set_extent_aux_field (e, begin_glyph, value) -#define set_extent_end_glyph(e, value) \ +#define set_extent_end_glyph(e, value) \ set_extent_aux_field (e, end_glyph, value) -#define set_extent_priority(e, value) \ +#define set_extent_priority(e, value) \ set_extent_aux_field (e, priority, value) -#define set_extent_invisible_1(e, value) \ +#define set_extent_invisible_1(e, value) \ set_extent_aux_field (e, invisible, value) -#define set_extent_read_only(e, value) \ +#define set_extent_read_only(e, value) \ set_extent_aux_field (e, read_only, value) -#define set_extent_mouse_face(e, value) \ +#define set_extent_mouse_face(e, value) \ set_extent_aux_field (e, mouse_face, value) -/* Use Fset_extent_initial_redisplay_function unless you know what you are ding */ -#define set_extent_initial_redisplay_function(e, value) \ +/* Use Fset_extent_initial_redisplay_function unless you know what you're doing */ +#define set_extent_initial_redisplay_function(e, value) \ set_extent_aux_field (e, initial_redisplay_function, value) -#define extent_face(e) extent_normal_field (e, face) -#define extent_begin_glyph_layout(e) \ - extent_normal_field (e, begin_glyph_layout) -#define extent_end_glyph_layout(e) extent_normal_field (e, end_glyph_layout) -#define extent_start_open_p(e) extent_normal_field (e, start_open) -#define extent_end_open_p(e) extent_normal_field (e, end_open) -#define extent_unique_p(e) extent_normal_field (e, unique) -#define extent_duplicable_p(e) extent_normal_field (e, duplicable) -#define extent_detachable_p(e) extent_normal_field (e, detachable) -#define extent_internal_p(e) extent_normal_field (e, internal) -#define extent_in_red_event_p(e) extent_normal_field (e, in_red_event) +#define extent_face(e) extent_normal_field (e, face) +#define extent_begin_glyph_layout(e) extent_normal_field (e, begin_glyph_layout) +#define extent_end_glyph_layout(e) extent_normal_field (e, end_glyph_layout) +#define extent_start_open_p(e) extent_normal_field (e, start_open) +#define extent_end_open_p(e) extent_normal_field (e, end_open) +#define extent_unique_p(e) extent_normal_field (e, unique) +#define extent_duplicable_p(e) extent_normal_field (e, duplicable) +#define extent_detachable_p(e) extent_normal_field (e, detachable) +#define extent_internal_p(e) extent_normal_field (e, internal) +#define extent_in_red_event_p(e) extent_normal_field (e, in_red_event) -#define extent_no_chase_plist_addr(e) \ -MAC_BEGIN \ - MAC_DECLARE (EXTENT, MTplist_extent, e) \ - (MTplist_extent->flags.has_aux ? \ - &XCONS (MTplist_extent->plist)->cdr : \ - &MTplist_extent->plist) \ -MAC_END +INLINE Lisp_Object * extent_no_chase_plist_addr (EXTENT e); +INLINE Lisp_Object * +extent_no_chase_plist_addr (EXTENT e) +{ + return e->flags.has_aux ? &XCDR (e->plist) : &e->plist; +} + #define extent_no_chase_plist(e) (*extent_no_chase_plist_addr (e)) #define extent_plist_addr(e) extent_no_chase_plist_addr (extent_ancestor (e)) @@ -322,16 +296,25 @@ #define EXTENT_LIVE_P(e) (!EQ (extent_object (e), Qt)) -#define CHECK_LIVE_EXTENT(x) \ - do { CHECK_EXTENT (x); \ - if (!EXTENT_LIVE_P (XEXTENT (x))) \ - dead_wrong_type_argument (Qextent_live_p, (x)); } while (0) -#define CONCHECK_LIVE_EXTENT(x) \ - do { CONCHECK_EXTENT (x); \ - if (!EXTENT_LIVE_P (XEXTENT (x))) \ - x = wrong_type_argument (Qextent_live_p, (x)); } while (0) +#define CHECK_LIVE_EXTENT(x) do { \ + CHECK_EXTENT (x); \ + if (!EXTENT_LIVE_P (XEXTENT (x))) \ + dead_wrong_type_argument (Qextent_live_p, (x)); \ +} while (0) +#define CONCHECK_LIVE_EXTENT(x) do { \ + CONCHECK_EXTENT (x); \ + if (!EXTENT_LIVE_P (XEXTENT (x))) \ + x = wrong_type_argument (Qextent_live_p, (x)); \ +} while (0) -extern Lisp_Object Qextent_live_p; +EXFUN (Fdetach_extent, 1); +EXFUN (Fextent_end_position, 1); +EXFUN (Fextent_object, 1); +EXFUN (Fextent_start_position, 1); +EXFUN (Fmake_extent, 3); +EXFUN (Fprevious_single_property_change, 4); +EXFUN (Fset_extent_endpoints, 4); +EXFUN (Fset_extent_parent, 2); extern int inside_undo; @@ -343,8 +326,6 @@ Bytind pos); void extent_fragment_delete (struct extent_fragment *ef); -extern Lisp_Object Vlast_highlighted_extent; - #ifdef emacs /* things other than emacs want the structs */ @@ -353,11 +334,22 @@ /* from extents.c */ EXTENT extent_ancestor_1 (EXTENT e); + +/* extent_ancestor() chases all the parent links until there aren't any + more. extent_ancestor_1() does the same thing but it a function; + the following optimizes the most common case. */ +INLINE EXTENT extent_ancestor (EXTENT e); +INLINE EXTENT +extent_ancestor (EXTENT e) +{ + return e->flags.has_parent ? extent_ancestor_1 (e) : e; +} + void allocate_extent_auxiliary (EXTENT ext); void init_buffer_extents (struct buffer *b); void uninit_buffer_extents (struct buffer *b); -void map_extents (Bufpos from, Bufpos to, int (*fn) (EXTENT extent, - void * arg), +typedef int (*map_extents_fun) (EXTENT extent, void *arg); +void map_extents (Bufpos from, Bufpos to, map_extents_fun fn, void *arg, Lisp_Object obj, EXTENT after, unsigned int flags); @@ -376,7 +368,7 @@ Bytind to, int destroy_them); void set_extent_glyph (EXTENT extent, Lisp_Object glyph, int endp, - unsigned int layout); + glyph_layout layout); void add_string_extents (Lisp_Object string, struct buffer *buf, Bytind opoint, Bytecount length);
--- a/src/faces.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/faces.c Mon Aug 13 10:28:48 2007 +0200 @@ -41,10 +41,8 @@ #include "specifier.h" #include "window.h" -/* Qfont, Qdoc_string, Qface defined in general.c */ Lisp_Object Qfacep; Lisp_Object Qforeground, Qbackground, Qdisplay_table; -/* Qhighlight, Qreverse defined in general.c */ Lisp_Object Qbackground_pixmap, Qunderline, Qdim; Lisp_Object Qblinking, Qstrikethru; @@ -73,19 +71,6 @@ Lisp_Object Vbuilt_in_face_specifiers; -static Lisp_Object mark_face (Lisp_Object, void (*) (Lisp_Object)); -static void print_face (Lisp_Object, Lisp_Object, int); -static int face_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long face_hash (Lisp_Object obj, int depth); -static Lisp_Object face_getprop (Lisp_Object obj, Lisp_Object prop); -static int face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value); -static int face_remprop (Lisp_Object obj, Lisp_Object prop); -static Lisp_Object face_plist (Lisp_Object obj); -DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, - mark_face, print_face, 0, face_equal, - face_hash, face_getprop, - face_putprop, face_remprop, - face_plist, struct Lisp_Face); static Lisp_Object mark_face (Lisp_Object obj, void (*markobj) (Lisp_Object)) @@ -261,25 +246,29 @@ static Lisp_Object face_plist (Lisp_Object obj) { - struct Lisp_Face *f = XFACE (obj); - Lisp_Object result = Qnil; + struct Lisp_Face *face = XFACE (obj); + Lisp_Object result = face->plist; - /* backwards order; we reverse it below */ - result = Fcons (f->foreground, Fcons (Qforeground, result)); - result = Fcons (f->background, Fcons (Qbackground, result)); - result = Fcons (f->font, Fcons (Qfont, result)); - result = Fcons (f->display_table, Fcons (Qdisplay_table, result)); - result = Fcons (f->background_pixmap, Fcons (Qbackground_pixmap, result)); - result = Fcons (f->underline, Fcons (Qunderline, result)); - result = Fcons (f->strikethru, Fcons (Qstrikethru, result)); - result = Fcons (f->highlight, Fcons (Qhighlight, result)); - result = Fcons (f->dim, Fcons (Qdim, result)); - result = Fcons (f->blinking, Fcons (Qblinking, result)); - result = Fcons (f->reverse, Fcons (Qreverse, result)); + result = cons3 (Qreverse, face->reverse, result); + result = cons3 (Qblinking, face->blinking, result); + result = cons3 (Qdim, face->dim, result); + result = cons3 (Qhighlight, face->highlight, result); + result = cons3 (Qstrikethru, face->strikethru, result); + result = cons3 (Qunderline, face->underline, result); + result = cons3 (Qbackground_pixmap, face->background_pixmap, result); + result = cons3 (Qdisplay_table, face->display_table, result); + result = cons3 (Qfont, face->font, result); + result = cons3 (Qbackground, face->background, result); + result = cons3 (Qforeground, face->foreground, result); - return nconc2 (Fnreverse (result), f->plist); + return result; } +DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, + mark_face, print_face, 0, face_equal, + face_hash, face_getprop, + face_putprop, face_remprop, + face_plist, struct Lisp_Face); /************************************************************************/ /* face read syntax */ @@ -435,7 +424,7 @@ { /* This function can GC */ Lisp_Object key, contents; - int *flag = flag_closure; + int *flag = (int *) flag_closure; CVOID_TO_LISP (key, hash_key); VOID_TO_LISP (contents, hash_contents); XFACE (contents)->dirty = *flag; @@ -764,8 +753,8 @@ } DEFUN ("make-face", Fmake_face, 1, 3, 0, /* -Defines and returns a new FACE described by DOC-STRING. -You can modify the font, color, etc of a face with the set-face- functions. +Define and return a new FACE described by DOC-STRING. +You can modify the font, color, etc of a face with the set-face-* functions. If the face already exists, it is unmodified. If TEMPORARY is non-nil, this face will cease to exist if not in use. */ @@ -1224,7 +1213,7 @@ Lisp_Object new_val = \ FACE_PROPERTY_INSTANCE (face, Q##field, domain, 1, Qzero); \ int bound = 1; \ - int new_val_int; \ + unsigned int new_val_int; \ if (UNBOUNDP (new_val)) \ { \ bound = 0; \ @@ -1304,7 +1293,7 @@ void reset_face_cachel (struct face_cachel *cachel) { - memset (cachel, 0, sizeof (struct face_cachel)); + xzero (*cachel); cachel->face = Qunbound; cachel->nfaces = 0; cachel->merged_faces = 0; @@ -1352,7 +1341,7 @@ if (EQ (cachel->face, face)) { - Lisp_Object window = Qnil; + Lisp_Object window; XSETWINDOW (window, w); if (!cachel->updated) update_face_cachel_data (cachel, window, face); @@ -1509,7 +1498,7 @@ struct face_cachel cachel; int len = Dynarr_length (ef->extents); face_index findex = 0; - Lisp_Object window = Qnil; + Lisp_Object window; XSETWINDOW (window, w); /* Optimize the default case. */ @@ -1620,7 +1609,7 @@ void update_frame_face_values (struct frame *f) { - Lisp_Object frm = Qnil; + Lisp_Object frm; XSETFRAME (frm, f); update_EmacsFrame (frm, Qforeground); @@ -1644,15 +1633,18 @@ if (WINDOWP (locale)) { - MARK_FRAME_FACES_CHANGED (XFRAME (XWINDOW (locale)->frame)); + struct frame *f = XFRAME (XWINDOW (locale)->frame); + MARK_FRAME_FACES_CHANGED (f); } else if (FRAMEP (locale)) { - MARK_FRAME_FACES_CHANGED (XFRAME (locale)); + struct frame *f = XFRAME (locale); + MARK_FRAME_FACES_CHANGED (f); } else if (DEVICEP (locale)) { - MARK_DEVICE_FRAMES_FACES_CHANGED (XDEVICE (locale)); + struct device *d = XDEVICE (locale); + MARK_DEVICE_FRAMES_FACES_CHANGED (d); } else { @@ -1684,9 +1676,9 @@ } DEFUN ("copy-face", Fcopy_face, 2, 6, 0, /* -Defines and returns a new face which is a copy of an existing one, -or makes an already-existing face be exactly like another. LOCALE, -TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'. +Define and return a new face which is a copy of an existing one, +or makes an already-existing face be exactly like another. +LOCALE, TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'. */ (old_face, new_name, locale, tag_set, exact_p, how_to_add)) { @@ -1857,30 +1849,22 @@ someone provides invalid values for the global specifications. */ { - Lisp_Object fg_inst_list = Qnil, bg_inst_list = Qnil; + Lisp_Object fg_fb = Qnil, bg_fb = Qnil; #ifdef HAVE_X_WINDOWS - fg_inst_list = Fcons (Fcons (list1 (Qx), build_string ("black")), - fg_inst_list); - bg_inst_list = Fcons (Fcons (list1 (Qx), build_string ("white")), - bg_inst_list); + fg_fb = acons (list1 (Qx), build_string ("black"), fg_fb); + bg_fb = acons (list1 (Qx), build_string ("white"), bg_fb); #endif #ifdef HAVE_TTY - fg_inst_list = Fcons (Fcons (list1 (Qtty), Fvector (0, 0)), - fg_inst_list); - bg_inst_list = Fcons (Fcons (list1 (Qtty), Fvector (0, 0)), - bg_inst_list); + fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb); + bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb); #endif #ifdef HAVE_MS_WINDOWS - fg_inst_list = Fcons (Fcons (list1 (Qmswindows), build_string ("black")), - fg_inst_list); - bg_inst_list = Fcons (Fcons (list1 (Qmswindows), build_string ("white")), - bg_inst_list); + fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb); + bg_fb = acons (list1 (Qmswindows), build_string ("white"), bg_fb); #endif - set_specifier_fallback (Fget (Vdefault_face, Qforeground, Qnil), - fg_inst_list); - set_specifier_fallback (Fget (Vdefault_face, Qbackground, Qnil), - bg_inst_list); + set_specifier_fallback (Fget (Vdefault_face, Qforeground, Qnil), fg_fb); + set_specifier_fallback (Fget (Vdefault_face, Qbackground, Qnil), bg_fb); } /* #### We may want to have different fallback values if NeXTstep
--- a/src/faces.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/faces.h Mon Aug 13 10:28:48 2007 +0200 @@ -24,7 +24,6 @@ #ifndef _XEMACS_FACES_H_ #define _XEMACS_FACES_H_ -#include "dynarr.h" #include "buffer.h" /* for NUM_LEADING_BYTES */ /* a struct Lisp_Face is the C object corresponding to a face. There @@ -255,14 +254,20 @@ struct overhead_stats *ovstats); #endif /* MEMORY_USAGE_STATS */ +EXFUN (Fface_name, 1); +EXFUN (Ffind_face, 1); +EXFUN (Fget_face, 1); + +extern Lisp_Object Qstrikethru, Vbuilt_in_face_specifiers, Vdefault_face; +extern Lisp_Object Vleft_margin_face, Vpointer_face, Vright_margin_face; +extern Lisp_Object Vtext_cursor_face; + void mark_all_faces_as_clean (void); void init_frame_faces (struct frame *f); void init_device_faces (struct device *d); void init_global_faces (struct device *d); face_index get_extent_fragment_face_cache_index (struct window *w, struct extent_fragment *ef); -Lisp_Object Ffind_face (Lisp_Object face_or_name); -Lisp_Object Fget_face (Lisp_Object face_or_name); void update_frame_face_values (struct frame *f); void face_property_was_changed (Lisp_Object face, Lisp_Object property, Lisp_Object locale); @@ -274,14 +279,6 @@ void default_face_height_and_width_1 (Lisp_Object domain, int *height, int *width); -extern Lisp_Object Qforeground, Qbackground, Qfont, Qdisplay_table; -extern Lisp_Object Qbackground_pixmap, Qunderline, Qhighlight, Qdim; -extern Lisp_Object Qstrikethru,Qblinking, Qreverse; - -extern Lisp_Object Vdefault_face, Vmodeline_face; -extern Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face; -extern Lisp_Object Vpointer_face; - #define FACE_CACHEL_FONT(cachel, charset) \ (cachel->font[XCHARSET_LEADING_BYTE (charset) - 128])
--- a/src/file-coding.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/file-coding.c Mon Aug 13 10:28:48 2007 +0200 @@ -142,9 +142,8 @@ but we have to do so now. */ unsigned int output_direction_sequence :1; }; -#endif -Lisp_Object Fcopy_coding_system (Lisp_Object old_coding_system, - Lisp_Object new_name); +#endif /* MULE */ +EXFUN (Fcopy_coding_system, 2); #ifdef MULE struct detection_state; static int detect_coding_sjis (struct detection_state *st, @@ -273,7 +272,7 @@ (markobj) (CODING_SYSTEM_CCL_DECODE (codesys)); (markobj) (CODING_SYSTEM_CCL_ENCODE (codesys)); break; -#endif +#endif /* MULE */ default: break; } @@ -320,7 +319,7 @@ c->iso2022.output_conv = 0; } break; -#endif +#endif /* MULE */ default: break; } @@ -356,7 +355,7 @@ static void setup_eol_coding_systems (struct Lisp_Coding_System *codesys) { - Lisp_Object codesys_obj = Qnil; + Lisp_Object codesys_obj; int len = string_length (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name); char *codesys_name = (char *) alloca (len + 7); int mlen = -1; @@ -373,23 +372,23 @@ if (STRINGP (CODING_SYSTEM_MNEMONIC (codesys))) { - mlen = XSTRING_LENGTH(CODING_SYSTEM_MNEMONIC (codesys)); + mlen = XSTRING_LENGTH (CODING_SYSTEM_MNEMONIC (codesys)); codesys_mnemonic = (char *) alloca (mlen + 7); memcpy (codesys_mnemonic, XSTRING_DATA (CODING_SYSTEM_MNEMONIC (codesys)), mlen); } -#define DEFINE_SUB_CODESYS(op_sys, op_sys_abbr, Type) do { \ - strcpy (codesys_name + len, "-" op_sys); \ - if (mlen != -1) \ - strcpy (codesys_mnemonic + mlen, op_sys_abbr); \ - codesys_name_sym = intern (codesys_name); \ - sub_codesys_obj = Fcopy_coding_system (codesys_obj, codesys_name_sym); \ - XCODING_SYSTEM_EOL_TYPE (sub_codesys_obj) = Type; \ - if (mlen != -1) \ - XCODING_SYSTEM_MNEMONIC(sub_codesys_obj) = \ - build_string(codesys_mnemonic); \ - CODING_SYSTEM_##Type (codesys) = sub_codesys_obj; \ +#define DEFINE_SUB_CODESYS(op_sys, op_sys_abbr, Type) do { \ + strcpy (codesys_name + len, "-" op_sys); \ + if (mlen != -1) \ + strcpy (codesys_mnemonic + mlen, op_sys_abbr); \ + codesys_name_sym = intern (codesys_name); \ + sub_codesys_obj = Fcopy_coding_system (codesys_obj, codesys_name_sym); \ + XCODING_SYSTEM_EOL_TYPE (sub_codesys_obj) = Type; \ + if (mlen != -1) \ + XCODING_SYSTEM_MNEMONIC(sub_codesys_obj) = \ + build_string (codesys_mnemonic); \ + CODING_SYSTEM_##Type (codesys) = sub_codesys_obj; \ } while (0) DEFINE_SUB_CODESYS("unix", "", EOL_LF); @@ -398,7 +397,7 @@ } DEFUN ("coding-system-p", Fcoding_system_p, 1, 1, 0, /* -T if OBJECT is a coding system. +Return t if OBJECT is a coding system. A coding system is an object that defines how text containing multiple character sets is encoded into a stream of (typically 8-bit) bytes. The coding system is used to decode the stream into a series of @@ -432,11 +431,13 @@ */ (coding_system_or_name)) { + if (CODING_SYSTEMP (coding_system_or_name)) + return coding_system_or_name; + if (NILP (coding_system_or_name)) coding_system_or_name = Qbinary; - if (CODING_SYSTEMP (coding_system_or_name)) - return coding_system_or_name; - CHECK_SYMBOL (coding_system_or_name); + else + CHECK_SYMBOL (coding_system_or_name); return Fgethash (coding_system_or_name, Vcoding_system_hashtable, Qnil); } @@ -535,7 +536,7 @@ CODING_SYSTEM_CCL_DECODE (codesys) = Qnil; CODING_SYSTEM_CCL_ENCODE (codesys) = Qnil; } -#endif +#endif /* MULE */ CODING_SYSTEM_NAME (codesys) = name; return codesys; @@ -581,21 +582,20 @@ unparse_charset_conversion_specs (charset_conversion_spec_dynarr *load_here) { int i; - Lisp_Object result = Qnil; + Lisp_Object result; if (!load_here) return Qnil; - for (i = 0; i < Dynarr_length (load_here); i++) + for (i = 0, result = Qnil; i < Dynarr_length (load_here); i++) { - struct charset_conversion_spec *ccs = - Dynarr_atp (load_here, i); + struct charset_conversion_spec *ccs = Dynarr_atp (load_here, i); result = Fcons (list2 (ccs->from_charset, ccs->to_charset), result); } return Fnreverse (result); } -#endif +#endif /* MULE */ DEFUN ("make-coding-system", Fmake_coding_system, 2, 4, 0, /* Register symbol NAME as a coding system. @@ -1002,13 +1002,8 @@ { Lisp_Object cs = XCODING_SYSTEM_ISO2022_INITIAL_CHARSET (coding_system, gnum); - - if (CHARSETP(cs)){ - return XCHARSET_NAME(cs); - } - else { - return Qnil; - } + + return CHARSETP (cs) ? XCHARSET_NAME (cs) : Qnil; } DEFUN ("coding-system-charset", Fcoding_system_charset, 2, 2, 0, /* @@ -1020,9 +1015,9 @@ coding_system = Fget_coding_system (coding_system); CHECK_INT (gnum); - return coding_system_charset(coding_system, XINT (gnum)); + return coding_system_charset (coding_system, XINT (gnum)); } -#endif +#endif /* MULE */ DEFUN ("coding-system-property", Fcoding_system_property, 2, 2, 0, /* Return the PROP property of CODING-SYSTEM. @@ -1501,7 +1496,7 @@ if (*eol_type_in_out == EOL_AUTODETECT) *eol_type_in_out = XCODING_SYSTEM_EOL_TYPE (*codesys_in_out); - memset (&decst, 0, sizeof (decst)); + xzero (decst); decst.eol_type = *eol_type_in_out; decst.mask = ~0; @@ -1559,7 +1554,7 @@ instream = make_encoding_input_stream (lb_istr, Fget_coding_system (Qbinary)); istr = XLSTREAM (instream); GCPRO2 (instream, lb_instream); - memset (&decst, 0, sizeof (decst)); + xzero (decst); decst.eol_type = EOL_AUTODETECT; decst.mask = ~0; while (1) @@ -1727,8 +1722,8 @@ struct detection_state decst; }; -static int decoding_reader (Lstream *stream, unsigned char *data, int size); -static int decoding_writer (Lstream *stream, CONST unsigned char *data, int size); +static int decoding_reader (Lstream *stream, unsigned char *data, size_t size); +static int decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size); static int decoding_rewinder (Lstream *stream); static int decoding_seekable_p (Lstream *stream); static int decoding_flusher (Lstream *stream); @@ -1762,7 +1757,7 @@ so we read data from the other end, decode it, and store it into DATA. */ static int -decoding_reader (Lstream *stream, unsigned char *data, int size) +decoding_reader (Lstream *stream, unsigned char *data, size_t size) { struct decoding_stream *str = DECODING_STREAM_DATA (stream); unsigned char *orig_data = data; @@ -1782,7 +1777,7 @@ most SIZE bytes, and delete the data from the runoff. */ if (Dynarr_length (str->runoff) > 0) { - int chunk = min (size, Dynarr_length (str->runoff)); + size_t chunk = min (size, (size_t) Dynarr_length (str->runoff)); memcpy (data, Dynarr_atp (str->runoff, 0), chunk); Dynarr_delete_many (str->runoff, 0, chunk); data += chunk; @@ -1824,7 +1819,7 @@ } static int -decoding_writer (Lstream *stream, CONST unsigned char *data, int size) +decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct decoding_stream *str = DECODING_STREAM_DATA (stream); int retval; @@ -1849,7 +1844,7 @@ #ifdef MULE if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_ISO2022) { - Lisp_Object coding_system = Qnil; + Lisp_Object coding_system; XSETCODING_SYSTEM (coding_system, str->codesys); reset_iso2022 (coding_system, &str->iso2022); } @@ -1857,7 +1852,7 @@ { setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_DECODE (str->codesys)); } -#endif +#endif /* MULE */ str->flags = str->ch = 0; } @@ -1904,7 +1899,7 @@ Lisp_Object decoding_stream_coding_system (Lstream *stream) { - Lisp_Object coding_system = Qnil; + Lisp_Object coding_system; struct decoding_stream *str = DECODING_STREAM_DATA (stream); XSETCODING_SYSTEM (coding_system, str->codesys); @@ -1937,7 +1932,7 @@ struct decoding_stream *str = DECODING_STREAM_DATA (lstr); Lisp_Object obj; - memset (str, 0, sizeof (*str)); + xzero (*str); str->other_end = stream; str->runoff = (unsigned_char_dynarr *) Dynarr_new (unsigned_char); str->eol_type = EOL_AUTODETECT; @@ -1987,7 +1982,7 @@ if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT || str->eol_type == EOL_AUTODETECT) { - Lisp_Object codesys = Qnil; + Lisp_Object codesys; XSETCODING_SYSTEM (codesys, str->codesys); detect_coding_type (&str->decst, src, n, @@ -2037,7 +2032,7 @@ case CODESYS_ISO2022: decode_coding_iso2022 (decoding, src, dst, n); break; -#endif +#endif /* MULE */ default: abort (); } @@ -2169,12 +2164,12 @@ /* Additional information (the state of the running CCL program) used by the CCL encoder. */ struct ccl_program ccl; -#endif +#endif /* MULE */ }; -static int encoding_reader (Lstream *stream, unsigned char *data, int size); +static int encoding_reader (Lstream *stream, unsigned char *data, size_t size); static int encoding_writer (Lstream *stream, CONST unsigned char *data, - int size); + size_t size); static int encoding_rewinder (Lstream *stream); static int encoding_seekable_p (Lstream *stream); static int encoding_flusher (Lstream *stream); @@ -2208,7 +2203,7 @@ so we read data from the other end, encode it, and store it into DATA. */ static int -encoding_reader (Lstream *stream, unsigned char *data, int size) +encoding_reader (Lstream *stream, unsigned char *data, size_t size) { struct encoding_stream *str = ENCODING_STREAM_DATA (stream); unsigned char *orig_data = data; @@ -2228,7 +2223,7 @@ most SIZE bytes, and delete the data from the runoff. */ if (Dynarr_length (str->runoff) > 0) { - int chunk = min (size, Dynarr_length (str->runoff)); + int chunk = min ((int) size, Dynarr_length (str->runoff)); memcpy (data, Dynarr_atp (str->runoff, 0), chunk); Dynarr_delete_many (str->runoff, 0, chunk); data += chunk; @@ -2270,7 +2265,7 @@ } static int -encoding_writer (Lstream *stream, CONST unsigned char *data, int size) +encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct encoding_stream *str = ENCODING_STREAM_DATA (stream); int retval; @@ -2292,9 +2287,9 @@ static void reset_encoding_stream (struct encoding_stream *str) { +#ifdef MULE switch (CODING_SYSTEM_TYPE (str->codesys)) { -#ifdef MULE case CODESYS_ISO2022: { int i; @@ -2316,10 +2311,10 @@ case CODESYS_CCL: setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_ENCODE (str->codesys)); break; -#endif default: break; } +#endif /* MULE */ str->flags = str->ch = 0; } @@ -2363,7 +2358,7 @@ Lisp_Object encoding_stream_coding_system (Lstream *stream) { - Lisp_Object coding_system = Qnil; + Lisp_Object coding_system; struct encoding_stream *str = ENCODING_STREAM_DATA (stream); XSETCODING_SYSTEM (coding_system, str->codesys); @@ -2387,7 +2382,7 @@ struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); Lisp_Object obj; - memset (str, 0, sizeof (*str)); + xzero (*str); str->runoff = Dynarr_new (unsigned_char); str->other_end = stream; set_encoding_stream_coding_system (lstr, codesys); @@ -3789,7 +3784,7 @@ unsigned int flags, ch; enum eol_type eol_type; struct decoding_stream *str = DECODING_STREAM_DATA (decoding); - Lisp_Object coding_system = Qnil; + Lisp_Object coding_system; unsigned_char_dynarr *real_dst = dst; CODING_STREAM_DECOMPOSE (str, flags, ch); @@ -4018,7 +4013,7 @@ struct encoding_stream *str, unsigned_char_dynarr *dst) { CONST char *inter94 = "()*+", *inter96= ",-./"; - int type; + unsigned int type; unsigned char final; Lisp_Object old_charset = str->iso2022.charset[reg]; @@ -4508,7 +4503,7 @@ Qnil) #endif -extern CONST Extbyte * +Extbyte * convert_to_external_format (CONST Bufbyte *ptr, Bytecount len, Extcount *len_out, @@ -4576,7 +4571,7 @@ return Dynarr_atp (conversion_out_dynarr, 0); } -extern CONST Bufbyte * +Bufbyte * convert_from_external_format (CONST Extbyte *ptr, Extcount len, Bytecount *len_out, @@ -4707,13 +4702,14 @@ defsymbol (&Qno_iso6429, "no-iso6429"); defsymbol (&Qinput_charset_conversion, "input-charset-conversion"); defsymbol (&Qoutput_charset_conversion, "output-charset-conversion"); + defsymbol (&Qshort, "short"); defsymbol (&Qno_ascii_eol, "no-ascii-eol"); defsymbol (&Qno_ascii_cntl, "no-ascii-cntl"); defsymbol (&Qseven, "seven"); defsymbol (&Qlock_shift, "lock-shift"); defsymbol (&Qescape_quoted, "escape-quoted"); -#endif +#endif /* MULE */ defsymbol (&Qencode, "encode"); defsymbol (&Qdecode, "decode"); @@ -4733,7 +4729,7 @@ "iso-8-2"); defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_LOCK_SHIFT], "iso-lock-shift"); -#endif /* MULE */ +#endif /* MULE */ defsymbol (&coding_category_symbol[CODING_CATEGORY_NO_CONVERSION], "no-conversion"); }
--- a/src/file-coding.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/file-coding.h Mon Aug 13 10:28:48 2007 +0200 @@ -220,15 +220,45 @@ CODING_SYSTEM_CCL_ENCODE (XCODING_SYSTEM (codesys)) #endif /* MULE */ -extern Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; +EXFUN (Fcoding_category_list, 0); +EXFUN (Fcoding_category_system, 1); +EXFUN (Fcoding_priority_list, 0); +EXFUN (Fcoding_system_charset, 2); +EXFUN (Fcoding_system_doc_string, 1); +EXFUN (Fcoding_system_list, 0); +EXFUN (Fcoding_system_name, 1); +EXFUN (Fcoding_system_p, 1); +EXFUN (Fcoding_system_property, 2); +EXFUN (Fcoding_system_type, 1); +EXFUN (Fcopy_coding_system, 2); +EXFUN (Fdecode_big5_char, 1); +EXFUN (Fdecode_coding_region, 4); +EXFUN (Fdecode_shift_jis_char, 1); +EXFUN (Fdetect_coding_region, 3); +EXFUN (Fencode_big5_char, 1); +EXFUN (Fencode_coding_region, 4); +EXFUN (Fencode_shift_jis_char, 1); +EXFUN (Ffind_coding_system, 1); +EXFUN (Fget_coding_system, 1); +EXFUN (Fmake_coding_system, 4); +EXFUN (Fset_coding_category_system, 2); +EXFUN (Fset_coding_priority_list, 1); +EXFUN (Fsubsidiary_coding_system, 2); -extern Lisp_Object Vkeyboard_coding_system; +extern Lisp_Object Qbig5, Qbuffer_file_coding_system, Qccl, Qcharset_g0; +extern Lisp_Object Qcharset_g1, Qcharset_g2, Qcharset_g3, Qcoding_system_error; +extern Lisp_Object Qcoding_system_p, Qcr, Qcrlf, Qctext, Qdecode, Qencode; +extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qescape_quoted; +extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; +extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output; +extern Lisp_Object Qinput_charset_conversion, Qiso2022, Qlf, Qlock_shift; +extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol, Qno_conversion; +extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion; +extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven; +extern Lisp_Object Qshift_jis, Qshort, Vcoding_system_for_read; +extern Lisp_Object Vcoding_system_for_write, Vcoding_system_hashtable; +extern Lisp_Object Vfile_name_coding_system, Vkeyboard_coding_system; extern Lisp_Object Vterminal_coding_system; -extern Lisp_Object Vcoding_system_for_read; -extern Lisp_Object Vcoding_system_for_write; -extern Lisp_Object Vpathname_coding_system; - -extern Lisp_Object Qescape_quoted; /* Flags indicating current state while converting code. */ @@ -454,22 +484,22 @@ } while (0) #endif /* MULE */ -extern Lisp_Object make_decoding_input_stream (Lstream *stream, - Lisp_Object codesys); -extern Lisp_Object make_encoding_input_stream (Lstream *stream, - Lisp_Object codesys); -extern Lisp_Object make_decoding_output_stream (Lstream *stream, - Lisp_Object codesys); -extern Lisp_Object make_encoding_output_stream (Lstream *stream, - Lisp_Object codesys); -extern Lisp_Object decoding_stream_coding_system (Lstream *stream); -extern Lisp_Object encoding_stream_coding_system (Lstream *stream); -extern void set_decoding_stream_coding_system (Lstream *stream, - Lisp_Object codesys); -extern void set_encoding_stream_coding_system (Lstream *stream, - Lisp_Object codesys); -extern void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, - enum eol_type *eol_type_in_out); +Lisp_Object make_decoding_input_stream (Lstream *stream, + Lisp_Object codesys); +Lisp_Object make_encoding_input_stream (Lstream *stream, + Lisp_Object codesys); +Lisp_Object make_decoding_output_stream (Lstream *stream, + Lisp_Object codesys); +Lisp_Object make_encoding_output_stream (Lstream *stream, + Lisp_Object codesys); +Lisp_Object decoding_stream_coding_system (Lstream *stream); +Lisp_Object encoding_stream_coding_system (Lstream *stream); +void set_decoding_stream_coding_system (Lstream *stream, + Lisp_Object codesys); +void set_encoding_stream_coding_system (Lstream *stream, + Lisp_Object codesys); +void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, + enum eol_type *eol_type_in_out); #ifndef MULE
--- a/src/fileio.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/fileio.c Mon Aug 13 10:28:48 2007 +0200 @@ -24,6 +24,7 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "events.h" @@ -73,6 +74,9 @@ #define DRIVE_LETTER(x) (tolower (x)) #endif /* WINDOWSNT */ +int lisp_to_time (Lisp_Object, time_t *); +Lisp_Object time_to_lisp (time_t); + /* Nonzero during writing of auto-save files */ static int auto_saving; @@ -290,23 +294,17 @@ Solaris include files declare the return value as ssize_t. Is that standard? */ int -read_allowing_quit (int fildes, void *buf, unsigned int nbyte) +read_allowing_quit (int fildes, void *buf, size_t size) { - int nread; QUIT; - - nread = sys_read_1 (fildes, buf, nbyte, 1); - return nread; + return sys_read_1 (fildes, buf, size, 1); } int -write_allowing_quit (int fildes, CONST void *buf, unsigned int nbyte) +write_allowing_quit (int fildes, CONST void *buf, size_t size) { - int nread; - QUIT; - nread = sys_write_1 (fildes, buf, nbyte, 1); - return nread; + return sys_write_1 (fildes, buf, size, 1); } @@ -512,7 +510,7 @@ A `directly usable' directory name is one that may be used without the intervention of any file handler. If FILENAME is a directly usable file itself, return -(file-name-directory FILENAME). +\(file-name-directory FILENAME). The `call-process' and `start-process' functions use this function to get a current directory to run processes in. */ @@ -871,7 +869,7 @@ #else /* not WINDOWSNT */ if (nm == XSTRING_DATA (name)) return name; - return build_string (nm); + return build_string ((char *) nm); #endif /* not WINDOWSNT */ } } @@ -1056,7 +1054,7 @@ { /* Get rid of any slash at the end of newdir, unless newdir is just // (an incomplete UNC name). */ - length = strlen (newdir); + length = strlen ((char *) newdir); if (length > 0 && IS_DIRECTORY_SEP (newdir[length - 1]) #ifdef WINDOWSNT && !(length == 2 && IS_DIRECTORY_SEP (newdir[0])) @@ -1074,7 +1072,7 @@ tlen = 0; /* Now concatenate the directory and name to new space in the stack frame */ - tlen += strlen (nm) + 1; + tlen += strlen ((char *) nm) + 1; #ifdef WINDOWSNT /* Add reserved space for drive name. (The Microsoft x86 compiler produces incorrect code if the following two lines are combined.) */ @@ -1088,12 +1086,12 @@ if (newdir) { if (nm[0] == 0 || IS_DIRECTORY_SEP (nm[0])) - strcpy (target, newdir); + strcpy ((char *) target, (char *) newdir); else - file_name_as_directory (target, newdir); + file_name_as_directory ((char *) target, (char *) newdir); } - strcat (target, nm); + strcat ((char *) target, (char *) nm); /* ASSERT (IS_DIRECTORY_SEP (target[0])) if not VMS */ @@ -1728,7 +1726,7 @@ if (!NILP (handler)) return (call2 (handler, Qmake_directory_internal, dirname_)); - if (XSTRING_LENGTH (dirname_) > (sizeof (dir) - 1)) + if (XSTRING_LENGTH (dirname_) > (Bytecount) (sizeof (dir) - 1)) { return Fsignal (Qfile_error, list3 (build_translated_string ("Creating directory"), @@ -2063,14 +2061,11 @@ CHECK_STRING (filename); ptr = XSTRING_DATA (filename); - if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' + return (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' #ifdef WINDOWSNT - || (IS_DRIVE (*ptr) && ptr[1] == ':' && IS_DIRECTORY_SEP (ptr[2])) + || (IS_DRIVE (*ptr) && ptr[1] == ':' && IS_DIRECTORY_SEP (ptr[2])) #endif - ) - return Qt; - else - return Qnil; + ) ? Qt : Qnil; } /* Return nonzero if file FILENAME exists and can be executed. */ @@ -2135,10 +2130,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_exists_p, abspath); - if (stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0) - return (Qt); - else - return (Qnil); + return stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0 ? Qt : Qnil; } DEFUN ("file-executable-p", Ffile_executable_p, 1, 1, 0, /* @@ -2164,8 +2156,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_executable_p, abspath); - return (check_executable ((char *) XSTRING_DATA (abspath)) - ? Qt : Qnil); + return check_executable ((char *) XSTRING_DATA (abspath)) ? Qt : Qnil; } DEFUN ("file-readable-p", Ffile_readable_p, 1, 1, 0, /* @@ -2786,7 +2777,7 @@ if (curpos == 0) break; /* How much can we scan in the next step? */ - trial = min (curpos, sizeof buffer); + trial = min (curpos, (Bufpos) sizeof (buffer)); if (lseek (fd, curpos - trial, 0) < 0) report_file_error ("Setting file position", list1 (filename)); @@ -2949,7 +2940,7 @@ } BUF_SAVE_MODIFF (buf) = BUF_MODIFF (buf); buf->auto_save_modified = BUF_MODIFF (buf); - buf->save_length = make_int (BUF_SIZE (buf)); + buf->saved_size = make_int (BUF_SIZE (buf)); #ifdef CLASH_DETECTION if (NILP (handler)) { @@ -3100,8 +3091,7 @@ if (visiting) { BUF_SAVE_MODIFF (current_buffer) = BUF_MODIFF (current_buffer); - current_buffer->save_length = - make_int (BUF_SIZE (current_buffer)); + current_buffer->saved_size = make_int (BUF_SIZE (current_buffer)); current_buffer->filename = visit_file; MARK_MODELINE_CHANGED; } @@ -3291,7 +3281,7 @@ if (visiting) { BUF_SAVE_MODIFF (current_buffer) = BUF_MODIFF (current_buffer); - current_buffer->save_length = make_int (BUF_SIZE (current_buffer)); + current_buffer->saved_size = make_int (BUF_SIZE (current_buffer)); current_buffer->filename = visit_file; MARK_MODELINE_CHANGED; } @@ -3436,7 +3426,7 @@ Lstream *instr = XLSTREAM (instream); Lstream *outstr = XLSTREAM (outstream); - while (NILP (*annot) || CONSP (*annot)) + while (LISTP (*annot)) { tem = Fcar_safe (Fcar (*annot)); if (INTP (tem)) @@ -3625,8 +3615,8 @@ Useful if the buffer was not read from the file normally or if the file itself has been changed for some known benign reason. An argument specifies the modification time value to use -(instead of that of the visited file), in the form of a list -(HIGH . LOW) or (HIGH LOW). +\(instead of that of the visited file), in the form of a list +\(HIGH . LOW) or (HIGH LOW). */ (time_list)) { @@ -3841,7 +3831,7 @@ && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) && b->auto_save_modified < BUF_MODIFF (b) /* -1 means we've turned off autosaving for a while--see below. */ - && XINT (b->save_length) >= 0 + && XINT (b->saved_size) >= 0 && (do_handled_files || NILP (Ffind_file_name_handler (b->auto_save_file_name, Qwrite_region)))) @@ -3857,13 +3847,13 @@ continue; if (!preparing_for_armageddon && - (XINT (b->save_length) * 10 + (XINT (b->saved_size) * 10 > (BUF_Z (b) - BUF_BEG (b)) * 13) /* A short file is likely to change a large fraction; spare the user annoying messages. */ - && XINT (b->save_length) > 5000 + && XINT (b->saved_size) > 5000 /* These messages are frequent and annoying for `*mail*'. */ - && !EQ (b->filename, Qnil) + && !NILP (b->filename) && NILP (no_message) && disable_auto_save_when_buffer_shrinks) { @@ -3876,7 +3866,7 @@ XSTRING_DATA (b->name)); /* Turn off auto-saving until there's a real save, and prevent any more warnings. */ - b->save_length = make_int (-1); + b->saved_size = make_int (-1); if (!gc_in_progress) Fsleep_for (make_int (1)); continue; @@ -3965,7 +3955,7 @@ continue; b->auto_save_modified = BUF_MODIFF (b); - b->save_length = make_int (BUF_SIZE (b)); + b->saved_size = make_int (BUF_SIZE (b)); EMACS_GET_TIME (after_time); /* If auto-save took more than 60 seconds, assume it was an NFS failure that got a timeout. */ @@ -4008,7 +3998,7 @@ ()) { current_buffer->auto_save_modified = BUF_MODIFF (current_buffer); - current_buffer->save_length = make_int (BUF_SIZE (current_buffer)); + current_buffer->saved_size = make_int (BUF_SIZE (current_buffer)); current_buffer->auto_save_failure_time = -1; return Qnil; }
--- a/src/filelock.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/filelock.c Mon Aug 13 10:28:48 2007 +0200 @@ -497,11 +497,11 @@ owner = current_lock_owner (lfname); if (owner <= 0) - return (Qnil); + return Qnil; else if (owner == getpid ()) - return (Qt); + return Qt; - return (lock_file_owner_name (lfname)); + return lock_file_owner_name (lfname); } void
--- a/src/floatfns.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/floatfns.c Mon Aug 13 10:28:48 2007 +0200 @@ -158,16 +158,7 @@ } } - -static Lisp_Object mark_float (Lisp_Object, void (*) (Lisp_Object)); -extern void print_float (Lisp_Object, Lisp_Object, int); -static int float_equal (Lisp_Object o1, Lisp_Object o2, int depth); -static unsigned long float_hash (Lisp_Object obj, int depth); -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("float", float, - mark_float, print_float, 0, float_equal, - float_hash, struct Lisp_Float); - static Lisp_Object mark_float (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -188,6 +179,9 @@ return (unsigned long) fmod (extract_float (obj), 4e9); } +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("float", float, + mark_float, print_float, 0, float_equal, + float_hash, struct Lisp_Float); /* Extract a Lisp number as a `double', or signal an error. */ @@ -456,7 +450,7 @@ if (y & 1) acc *= x; x *= x; - y = (unsigned EMACS_INT) y >> 1; + y = (EMACS_UINT) y >> 1; } } return (make_int (acc)); @@ -704,7 +698,7 @@ #ifdef HAVE_LOGB { Lisp_Object val; - IN_FLOAT (val = make_int (logb (f)), "logb", arg); + IN_FLOAT (val = make_int ((int) logb (f)), "logb", arg); return (val); } #else @@ -935,7 +929,7 @@ #endif /* FLOAT_CATCH_SIGILL */ -#ifdef HAVE_MATHERR +#if defined (HAVE_MATHERR) && !defined(__cplusplus) int matherr (struct exception *x) { @@ -959,7 +953,7 @@ case UNDERFLOW: Fsignal (Qunderflow_error, args); break; default: Fsignal (Qarith_error, args); break; } - return (1); /* don't set errno or print a message */ + return 1; /* don't set errno or print a message */ } #endif /* HAVE_MATHERR */ #endif /* LISP_FLOAT_TYPE */
--- a/src/fns.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/fns.c Mon Aug 13 10:28:48 2007 +0200 @@ -36,6 +36,10 @@ #include "lisp.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + #include "buffer.h" #include "bytecode.h" #include "commands.h" @@ -51,16 +55,7 @@ Lisp_Object Qstring_lessp; Lisp_Object Qidentity; -static Lisp_Object mark_bit_vector (Lisp_Object, void (*) (Lisp_Object)); -static void print_bit_vector (Lisp_Object, Lisp_Object, int); -static int bit_vector_equal (Lisp_Object o1, Lisp_Object o2, int depth); -static unsigned long bit_vector_hash (Lisp_Object obj, int depth); -static int internal_old_equal (Lisp_Object o1, Lisp_Object o2, int depth); - -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("bit-vector", bit_vector, - mark_bit_vector, print_bit_vector, 0, - bit_vector_equal, bit_vector_hash, - struct Lisp_Bit_Vector); +static int internal_old_equal (Lisp_Object, Lisp_Object, int); static Lisp_Object mark_bit_vector (Lisp_Object obj, void (*markobj) (Lisp_Object)) @@ -97,12 +92,10 @@ struct Lisp_Bit_Vector *v1 = XBIT_VECTOR (o1); struct Lisp_Bit_Vector *v2 = XBIT_VECTOR (o2); - if (bit_vector_length (v1) != bit_vector_length (v2)) - return 0; - - return !memcmp (v1->bits, v2->bits, - BIT_VECTOR_LONG_STORAGE (bit_vector_length (v1)) * - sizeof (long)); + return ((bit_vector_length (v1) == bit_vector_length (v2)) && + !memcmp (v1->bits, v2->bits, + BIT_VECTOR_LONG_STORAGE (bit_vector_length (v1)) * + sizeof (long))); } static unsigned long @@ -115,6 +108,11 @@ sizeof (long))); } +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("bit-vector", bit_vector, + mark_bit_vector, print_bit_vector, 0, + bit_vector_equal, bit_vector_hash, + struct Lisp_Bit_Vector); + DEFUN ("identity", Fidentity, 1, 1, 0, /* Return the argument unchanged. */ @@ -136,7 +134,6 @@ (limit)) { EMACS_INT val; - Lisp_Object lispy_val; unsigned long denominator; if (EQ (limit, Qt)) @@ -157,8 +154,8 @@ } else val = get_random (); - XSETINT (lispy_val, val); - return lispy_val; + + return make_int (val); } /* Random data-structure functions */ @@ -201,36 +198,34 @@ DEFUN ("length", Flength, 1, 1, 0, /* Return the length of vector, bit vector, list or string SEQUENCE. */ - (obj)) + (sequence)) { - Lisp_Object tail; - int i; - retry: - if (STRINGP (obj)) - return make_int (string_char_length (XSTRING (obj))); - else if (VECTORP (obj)) - return make_int (XVECTOR_LENGTH (obj)); - else if (BIT_VECTORP (obj)) - return make_int (bit_vector_length (XBIT_VECTOR (obj))); - else if (CONSP (obj)) + if (STRINGP (sequence)) + return make_int (XSTRING_CHAR_LENGTH (sequence)); + else if (CONSP (sequence)) { - for (i = 0, tail = obj; !NILP (tail); i++) + Lisp_Object tail; + int i = 0; + + EXTERNAL_LIST_LOOP (tail, sequence) { QUIT; - tail = Fcdr (tail); + i++; } return make_int (i); } - else if (NILP (obj)) - { - return Qzero; - } + else if (VECTORP (sequence)) + return make_int (XVECTOR_LENGTH (sequence)); + else if (NILP (sequence)) + return Qzero; + else if (BIT_VECTORP (sequence)) + return make_int (bit_vector_length (XBIT_VECTOR (sequence))); else { - check_losing_bytecode ("length", obj); - obj = wrong_type_argument (Qsequencep, obj); + check_losing_bytecode ("length", sequence); + sequence = wrong_type_argument (Qsequencep, sequence); goto retry; } } @@ -246,11 +241,10 @@ */ (list)) { - Lisp_Object tail, halftail, length; + Lisp_Object halftail = list; /* Used to detect circular lists. */ + Lisp_Object tail; int len = 0; - /* halftail is used to detect circular lists. */ - halftail = list; for (tail = list; CONSP (tail); tail = XCDR (tail)) { if (EQ (tail, halftail) && len != 0) @@ -260,14 +254,13 @@ halftail = XCDR (halftail); } - XSETINT (length, len); - return length; + return make_int (len); } /*** string functions. ***/ DEFUN ("string-equal", Fstring_equal, 2, 2, 0, /* -T if two strings have identical contents. +Return t if two strings have identical contents. Case is significant. Text properties are ignored. \(Under XEmacs, `equal' also ignores text properties and extents in strings, but this is not the case under FSF Emacs 19. In FSF Emacs 20 @@ -276,25 +269,32 @@ */ (s1, s2)) { - int len; + Bytecount len; + struct Lisp_String *p1, *p2; if (SYMBOLP (s1)) - XSETSTRING (s1, XSYMBOL (s1)->name); + p1 = XSYMBOL (s1)->name; + else + { + CHECK_STRING (s1); + p1 = XSTRING (s1); + } + if (SYMBOLP (s2)) - XSETSTRING (s2, XSYMBOL (s2)->name); - CHECK_STRING (s1); - CHECK_STRING (s2); - - len = XSTRING_LENGTH (s1); - if (len != XSTRING_LENGTH (s2) || - memcmp (XSTRING_DATA (s1), XSTRING_DATA (s2), len)) - return Qnil; - return Qt; + p2 = XSYMBOL (s2)->name; + else + { + CHECK_STRING (s2); + p2 = XSTRING (s2); + } + + return (((len = string_length (p1)) == string_length (p2)) && + !memcmp (string_data (p1), string_data (p2), len)) ? Qt : Qnil; } DEFUN ("string-lessp", Fstring_lessp, 2, 2, 0, /* -T if first arg string is less than second in lexicographic order. +Return t if first arg string is less than second in lexicographic order. If I18N2 support (but not Mule support) was compiled in, ordering is determined by the locale. (Case is significant for the default C locale.) In all other cases, comparison is simply done on a character-by- @@ -319,61 +319,65 @@ { struct Lisp_String *p1, *p2; Charcount end, len2; + int i; if (SYMBOLP (s1)) - XSETSTRING (s1, XSYMBOL (s1)->name); + p1 = XSYMBOL (s1)->name; + else + { + CHECK_STRING (s1); + p1 = XSTRING (s1); + } + if (SYMBOLP (s2)) - XSETSTRING (s2, XSYMBOL (s2)->name); - CHECK_STRING (s1); - CHECK_STRING (s2); - - p1 = XSTRING (s1); - p2 = XSTRING (s2); - end = string_char_length (XSTRING (s1)); - len2 = string_char_length (XSTRING (s2)); + p2 = XSYMBOL (s2)->name; + else + { + CHECK_STRING (s2); + p2 = XSTRING (s2); + } + + end = string_char_length (p1); + len2 = string_char_length (p2); if (end > len2) end = len2; - { - int i; - #if defined (I18N2) && !defined (MULE) - /* There is no hope of this working under Mule. Even if we converted - the data into an external format so that strcoll() processed it - properly, it would still not work because strcoll() does not - handle multiple locales. This is the fundamental flaw in the - locale model. */ - Bytecount bcend = charcount_to_bytecount (string_data (p1), end); - /* Compare strings using collation order of locale. */ - /* Need to be tricky to handle embedded nulls. */ - - for (i = 0; i < bcend; i += strlen((char *) string_data (p1) + i) + 1) - { - int val = strcoll ((char *) string_data (p1) + i, - (char *) string_data (p2) + i); - if (val < 0) - return Qt; - if (val > 0) - return Qnil; - } + /* There is no hope of this working under Mule. Even if we converted + the data into an external format so that strcoll() processed it + properly, it would still not work because strcoll() does not + handle multiple locales. This is the fundamental flaw in the + locale model. */ + Bytecount bcend = charcount_to_bytecount (string_data (p1), end); + /* Compare strings using collation order of locale. */ + /* Need to be tricky to handle embedded nulls. */ + + for (i = 0; i < bcend; i += strlen((char *) string_data (p1) + i) + 1) + { + int val = strcoll ((char *) string_data (p1) + i, + (char *) string_data (p2) + i); + if (val < 0) + return Qt; + if (val > 0) + return Qnil; + } #else /* not I18N2, or MULE */ - /* #### It is not really necessary to do this: We could compare - byte-by-byte and still get a reasonable comparison, since this - would compare characters with a charset in the same way. - With a little rearrangement of the leading bytes, we could - make most inter-charset comparisons work out the same, too; - even if some don't, this is not a big deal because inter-charset - comparisons aren't really well-defined anyway. */ - for (i = 0; i < end; i++) - { - if (string_char (p1, i) != string_char (p2, i)) - return string_char (p1, i) < string_char (p2, i) ? Qt : Qnil; - } + /* #### It is not really necessary to do this: We could compare + byte-by-byte and still get a reasonable comparison, since this + would compare characters with a charset in the same way. + With a little rearrangement of the leading bytes, we could + make most inter-charset comparisons work out the same, too; + even if some don't, this is not a big deal because inter-charset + comparisons aren't really well-defined anyway. */ + for (i = 0; i < end; i++) + { + if (string_char (p1, i) != string_char (p2, i)) + return string_char (p1, i) < string_char (p2, i) ? Qt : Qnil; + } #endif /* not I18N2, or MULE */ - /* Can't do i < len2 because then comparison between "foo" and "foo^@" - won't work right in I18N2 case */ - return end < len2 ? Qt : Qnil; - } + /* Can't do i < len2 because then comparison between "foo" and "foo^@" + won't work right in I18N2 case */ + return end < len2 ? Qt : Qnil; } DEFUN ("string-modified-tick", Fstring_modified_tick, 1, 1, 0, /* @@ -592,7 +596,7 @@ for (argnum = 0; argnum < nargs; argnum++) { Lisp_Object seq = args[argnum]; - if (CONSP (seq) || NILP (seq)) + if (LISTP (seq)) ; else if (VECTORP (seq) || STRINGP (seq) || BIT_VECTORP (seq)) ; @@ -791,19 +795,19 @@ */ (alist)) { - Lisp_Object tem; - - CHECK_LIST (alist); + Lisp_Object tail; + if (NILP (alist)) return alist; + CHECK_CONS (alist); + alist = concat (1, &alist, c_cons, 0); - for (tem = alist; CONSP (tem); tem = XCDR (tem)) + for (tail = alist; CONSP (tail); tail = XCDR (tail)) { - Lisp_Object car; - car = XCAR (tem); + Lisp_Object car = XCAR (tail); if (CONSP (car)) - XCAR (tem) = Fcons (XCAR (car), XCDR (car)); + XCAR (tail) = Fcons (XCAR (car), XCDR (car)); } return alist; } @@ -889,11 +893,7 @@ if (STRINGP (seq)) return Fsubstring (seq, from, to); - if (CONSP (seq) || NILP (seq)) - ; - else if (VECTORP (seq) || BIT_VECTORP (seq)) - ; - else + if (!LISTP (seq) && !VECTORP (seq) && !BIT_VECTORP (seq)) { check_losing_bytecode ("subseq", seq); seq = wrong_type_argument (Qsequencep, seq); @@ -959,17 +959,19 @@ DEFUN ("nthcdr", Fnthcdr, 2, 2, 0, /* -Take cdr N times on LIST, returns the result. +Take cdr N times on LIST, and return the result. */ (n, list)) { - REGISTER int i, num; - CHECK_INT (n); - num = XINT (n); - for (i = 0; i < num && !NILP (list); i++) + REGISTER int i; + CHECK_NATNUM (n); + for (i = XINT (n); i; i--) { + if (NILP (list)) + return list; + CHECK_CONS (list); + list = XCDR (list); QUIT; - list = Fcdr (list); } return list; } @@ -986,13 +988,13 @@ DEFUN ("elt", Felt, 2, 2, 0, /* Return element of SEQUENCE at index N. */ - (seq, n)) + (sequence, n)) { retry: CHECK_INT_COERCE_CHAR (n); /* yuck! */ - if (CONSP (seq) || NILP (seq)) + if (LISTP (sequence)) { - Lisp_Object tem = Fnthcdr (n, seq); + Lisp_Object tem = Fnthcdr (n, sequence); /* #### Utterly, completely, fucking disgusting. * #### The whole point of "elt" is that it operates on * #### sequences, and does error- (bounds-) checking. @@ -1005,25 +1007,25 @@ return Qnil; #else /* This is The Way Mly Says It Should Be. */ - args_out_of_range (seq, n); + args_out_of_range (sequence, n); #endif } - else if (STRINGP (seq) - || VECTORP (seq) - || BIT_VECTORP (seq)) - return Faref (seq, n); + else if (STRINGP (sequence) + || VECTORP (sequence) + || BIT_VECTORP (sequence)) + return Faref (sequence, n); #ifdef LOSING_BYTECODE - else if (COMPILED_FUNCTIONP (seq)) + else if (COMPILED_FUNCTIONP (sequence)) { int idx = XINT (n); if (idx < 0) { lose: - args_out_of_range (seq, n); + args_out_of_range (sequence, n); } /* Utter perversity */ { - struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (seq); + struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (sequence); switch (idx) { case COMPILED_ARGLIST: @@ -1052,8 +1054,8 @@ #endif /* LOSING_BYTECODE */ else { - check_losing_bytecode ("elt", seq); - seq = wrong_type_argument (Qsequencep, seq); + check_losing_bytecode ("elt", sequence); + sequence = wrong_type_argument (Qsequencep, sequence); goto retry; } } @@ -1064,12 +1066,12 @@ */ (elt, list)) { - REGISTER Lisp_Object tail, tem; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - tem = Fcar (tail); - if (internal_equal (elt, tem, 0)) - return tail; + CONCHECK_CONS (tail); + if (internal_equal (elt, XCAR (tail), 0)) + return tail; QUIT; } return Qnil; @@ -1083,12 +1085,12 @@ */ (elt, list)) { - REGISTER Lisp_Object tail, tem; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - tem = Fcar (tail); - if (internal_old_equal (elt, tem, 0)) - return tail; + CONCHECK_CONS (tail); + if (internal_old_equal (elt, XCAR (tail), 0)) + return tail; QUIT; } return Qnil; @@ -1100,11 +1102,13 @@ */ (elt, list)) { - REGISTER Lisp_Object tail, tem; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - tem = Fcar (tail); - if (EQ_WITH_EBOLA_NOTICE (elt, tem)) return tail; + REGISTER Lisp_Object tem; + CONCHECK_CONS (tail); + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) + return tail; QUIT; } return Qnil; @@ -1118,11 +1122,13 @@ */ (elt, list)) { - REGISTER Lisp_Object tail, tem; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - tem = Fcar (tail); - if (HACKEQ_UNSAFE (elt, tem)) return tail; + REGISTER Lisp_Object tem; + CONCHECK_CONS (tail); + if (tem = XCAR (tail), HACKEQ_UNSAFE (elt, tem)) + return tail; QUIT; } return Qnil; @@ -1131,11 +1137,12 @@ Lisp_Object memq_no_quit (Lisp_Object elt, Lisp_Object list) { - REGISTER Lisp_Object tail, tem; + REGISTER Lisp_Object tail; for (tail = list; CONSP (tail); tail = XCDR (tail)) { - tem = XCAR (tail); - if (EQ_WITH_EBOLA_NOTICE (elt, tem)) return tail; + REGISTER Lisp_Object tem; + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) + return tail; } return Qnil; } @@ -1147,13 +1154,13 @@ (key, list)) { /* This function can GC. */ - REGISTER Lisp_Object tail, elt; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - elt = Fcar (tail); - if (!CONSP (elt)) - continue; - if (internal_equal (XCAR (elt), key, 0)) + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_equal (XCAR (elt), key, 0)) return elt; QUIT; } @@ -1167,13 +1174,13 @@ (key, list)) { /* This function can GC. */ - REGISTER Lisp_Object tail, elt; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - elt = Fcar (tail); - if (!CONSP (elt)) - continue; - if (internal_old_equal (XCAR (elt), key, 0)) + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_old_equal (XCAR (elt), key, 0)) return elt; QUIT; } @@ -1195,16 +1202,13 @@ */ (key, list)) { - REGISTER Lisp_Object tail, elt, tem; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - elt = Fcar (tail); - if (!CONSP (elt)) - continue; - /* Note: we use a temporary variable to avoid multiple - evaluations of XCAR (elt). */ - tem = XCAR (elt); - if (EQ_WITH_EBOLA_NOTICE (key, tem)) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) return elt; QUIT; } @@ -1220,14 +1224,13 @@ */ (key, list)) { - REGISTER Lisp_Object tail, elt, tem; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - elt = Fcar (tail); - if (!CONSP (elt)) - continue; - tem = XCAR (elt); - if (HACKEQ_UNSAFE (key, tem)) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), HACKEQ_UNSAFE (key, tem))) return elt; QUIT; } @@ -1241,13 +1244,13 @@ assq_no_quit (Lisp_Object key, Lisp_Object list) { /* This cannot GC. */ - REGISTER Lisp_Object tail, elt, tem; + REGISTER Lisp_Object tail; for (tail = list; CONSP (tail); tail = XCDR (tail)) { + REGISTER Lisp_Object tem, elt; elt = XCAR (tail); - if (!CONSP (elt)) continue; - tem = XCAR (elt); - if (EQ_WITH_EBOLA_NOTICE (key, tem)) return elt; + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) + return elt; } return Qnil; } @@ -1259,13 +1262,12 @@ (key, list)) { REGISTER Lisp_Object tail; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + LIST_LOOP (tail, list) { REGISTER Lisp_Object elt; - elt = Fcar (tail); - if (!CONSP (elt)) - continue; - if (internal_equal (XCDR (elt), key, 0)) + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_equal (XCDR (elt), key, 0)) return elt; QUIT; } @@ -1279,13 +1281,12 @@ (key, list)) { REGISTER Lisp_Object tail; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + LIST_LOOP (tail, list) { REGISTER Lisp_Object elt; - elt = Fcar (tail); - if (!CONSP (elt)) - continue; - if (internal_old_equal (XCDR (elt), key, 0)) + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_old_equal (XCDR (elt), key, 0)) return elt; QUIT; } @@ -1298,14 +1299,13 @@ */ (key, list)) { - REGISTER Lisp_Object tail, elt, tem; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - elt = Fcar (tail); - if (!CONSP (elt)) - continue; - tem = XCDR (elt); - if (EQ_WITH_EBOLA_NOTICE (key, tem)) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCDR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) return elt; QUIT; } @@ -1318,14 +1318,13 @@ */ (key, list)) { - REGISTER Lisp_Object tail, elt, tem; - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - elt = Fcar (tail); - if (!CONSP (elt)) - continue; - tem = XCDR (elt); - if (HACKEQ_UNSAFE (key, tem)) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCDR (elt), HACKEQ_UNSAFE (key, tem))) return elt; QUIT; } @@ -1335,13 +1334,13 @@ Lisp_Object rassq_no_quit (Lisp_Object key, Lisp_Object list) { - REGISTER Lisp_Object tail, elt, tem; + REGISTER Lisp_Object tail; for (tail = list; CONSP (tail); tail = XCDR (tail)) { + REGISTER Lisp_Object elt, tem; elt = XCAR (tail); - if (!CONSP (elt)) continue; - tem = XCDR (elt); - if (EQ_WITH_EBOLA_NOTICE (key, tem)) return elt; + if (CONSP (elt) && (tem = XCDR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) + return elt; } return Qnil; } @@ -1357,22 +1356,22 @@ */ (elt, list)) { - REGISTER Lisp_Object tail, prev; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (!NILP (tail)) { - if (internal_equal (elt, Fcar (tail), 0)) + CONCHECK_CONS (tail); + if (internal_equal (elt, XCAR (tail), 0)) { if (NILP (prev)) - list = Fcdr (tail); + list = XCDR (tail); else - Fsetcdr (prev, Fcdr (tail)); + XCDR (prev) = XCDR (tail); } else prev = tail; - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } return list; @@ -1382,27 +1381,27 @@ Delete by side effect any occurrences of ELT as a member of LIST. The modified LIST is returned. Comparison is done with `old-equal'. If the first member of LIST is ELT, there is no way to remove it by side -effect; therefore, write `(setq foo (delete element foo))' to be sure +effect; therefore, write `(setq foo (old-delete element foo))' to be sure of changing the value of `foo'. */ (elt, list)) { - REGISTER Lisp_Object tail, prev; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (!NILP (tail)) { - if (internal_old_equal (elt, Fcar (tail), 0)) + CONCHECK_CONS (tail); + if (internal_old_equal (elt, XCAR (tail), 0)) { if (NILP (prev)) - list = Fcdr (tail); + list = XCDR (tail); else - Fsetcdr (prev, Fcdr (tail)); + XCDR (prev) = XCDR (tail); } else prev = tail; - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } return list; @@ -1417,24 +1416,23 @@ */ (elt, list)) { - REGISTER Lisp_Object tail, prev; - REGISTER Lisp_Object tem; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (!NILP (tail)) { - tem = Fcar (tail); - if (EQ_WITH_EBOLA_NOTICE (elt, tem)) + REGISTER Lisp_Object tem; + CONCHECK_CONS (tail); + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) { if (NILP (prev)) - list = Fcdr (tail); + list = XCDR (tail); else - Fsetcdr (prev, Fcdr (tail)); + XCDR (prev) = XCDR (tail); } else prev = tail; - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } return list; @@ -1444,29 +1442,28 @@ Delete by side effect any occurrences of ELT as a member of LIST. The modified LIST is returned. Comparison is done with `old-eq'. If the first member of LIST is ELT, there is no way to remove it by side -effect; therefore, write `(setq foo (delq element foo))' to be sure of +effect; therefore, write `(setq foo (old-delq element foo))' to be sure of changing the value of `foo'. */ (elt, list)) { - REGISTER Lisp_Object tail, prev; - REGISTER Lisp_Object tem; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (!NILP (tail)) { - tem = Fcar (tail); - if (HACKEQ_UNSAFE (elt, tem)) + REGISTER Lisp_Object tem; + CONCHECK_CONS (tail); + if (tem = XCAR (tail), HACKEQ_UNSAFE (elt, tem)) { if (NILP (prev)) - list = Fcdr (tail); + list = XCDR (tail); else - Fsetcdr (prev, Fcdr (tail)); + XCDR (prev) = XCDR (tail); } else prev = tail; - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } return list; @@ -1477,15 +1474,13 @@ Lisp_Object delq_no_quit (Lisp_Object elt, Lisp_Object list) { - REGISTER Lisp_Object tail, prev; - REGISTER Lisp_Object tem; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (CONSP (tail)) { - tem = XCAR (tail); - if (EQ_WITH_EBOLA_NOTICE (elt, tem)) + REGISTER Lisp_Object tem; + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) { if (NILP (prev)) list = XCDR (tail); @@ -1509,28 +1504,29 @@ Lisp_Object delq_no_quit_and_free_cons (Lisp_Object elt, Lisp_Object list) { - REGISTER Lisp_Object tail, prev; - REGISTER Lisp_Object tem; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + struct Lisp_Cons *cons_to_free = NULL; + while (CONSP (tail)) { - Lisp_Object cons_to_free = Qnil; - tem = XCAR (tail); - if (EQ_WITH_EBOLA_NOTICE (elt, tem)) + REGISTER Lisp_Object tem; + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) { if (NILP (prev)) list = XCDR (tail); else XCDR (prev) = XCDR (tail); - cons_to_free = tail; + cons_to_free = XCONS (tail); } else prev = tail; tail = XCDR (tail); - if (!NILP (cons_to_free)) - free_cons (XCONS (cons_to_free)); + if (cons_to_free) + { + free_cons (cons_to_free); + cons_to_free = NULL; + } } return list; } @@ -1544,23 +1540,24 @@ */ (key, list)) { - REGISTER Lisp_Object tail, prev; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (!NILP (tail)) { - Lisp_Object elt = Fcar (tail); + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); if (CONSP (elt) && internal_equal (key, XCAR (elt), 0)) { if (NILP (prev)) - list = Fcdr (tail); + list = XCDR (tail); else - Fsetcdr (prev, Fcdr (tail)); + XCDR (prev) = XCDR (tail); } else prev = tail; - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } return list; @@ -1583,23 +1580,24 @@ */ (key, list)) { - REGISTER Lisp_Object tail, prev; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (!NILP (tail)) { - Lisp_Object elt = Fcar (tail); - if (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (key, Fcar (elt))) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) { if (NILP (prev)) - list = Fcdr (tail); + list = XCDR (tail); else - Fsetcdr (prev, Fcdr (tail)); + XCDR (prev) = XCDR (tail); } else prev = tail; - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } return list; @@ -1610,15 +1608,14 @@ Lisp_Object remassq_no_quit (Lisp_Object key, Lisp_Object list) { - REGISTER Lisp_Object tail, prev; - REGISTER Lisp_Object tem; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (CONSP (tail)) { - tem = XCAR (tail); - if (CONSP (tem) && EQ_WITH_EBOLA_NOTICE (key, XCAR (tem))) + REGISTER Lisp_Object elt, tem; + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) { if (NILP (prev)) list = XCDR (tail); @@ -1641,23 +1638,24 @@ */ (value, list)) { - REGISTER Lisp_Object tail, prev; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (!NILP (tail)) { - Lisp_Object elt = Fcar (tail); + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); if (CONSP (elt) && internal_equal (value, XCDR (elt), 0)) { if (NILP (prev)) - list = Fcdr (tail); + list = XCDR (tail); else - Fsetcdr (prev, Fcdr (tail)); + XCDR (prev) = XCDR (tail); } else prev = tail; - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } return list; @@ -1672,23 +1670,24 @@ */ (value, list)) { - REGISTER Lisp_Object tail, prev; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (!NILP (tail)) { - Lisp_Object elt = Fcar (tail); - if (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (value, Fcdr (elt))) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (value, tem))) { if (NILP (prev)) - list = Fcdr (tail); + list = XCDR (tail); else - Fsetcdr (prev, Fcdr (tail)); + XCDR (prev) = XCDR (tail); } else prev = tail; - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } return list; @@ -1699,15 +1698,14 @@ Lisp_Object remrassq_no_quit (Lisp_Object value, Lisp_Object list) { - REGISTER Lisp_Object tail, prev; - REGISTER Lisp_Object tem; - - tail = list; - prev = Qnil; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + while (CONSP (tail)) { - tem = XCAR (tail); - if (CONSP (tem) && EQ_WITH_EBOLA_NOTICE (value, XCDR (tem))) + REGISTER Lisp_Object elt, tem; + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (value, tem))) { if (NILP (prev)) list = XCDR (tail); @@ -1722,23 +1720,23 @@ } DEFUN ("nreverse", Fnreverse, 1, 1, 0, /* -Reverse LIST by modifying cdr pointers. -Returns the beginning of the reversed list. +Reverse LIST by destructively modifying cdr pointers. +Return the beginning of the reversed list. Also see: `reverse'. */ (list)) { - Lisp_Object prev, tail, next; struct gcpro gcpro1, gcpro2; + REGISTER Lisp_Object prev = Qnil; + REGISTER Lisp_Object tail = list; /* We gcpro our args; see `nconc' */ - prev = Qnil; - tail = list; GCPRO2 (prev, tail); while (!NILP (tail)) { + REGISTER Lisp_Object next; QUIT; - CHECK_CONS (tail); + CONCHECK_CONS (tail); next = XCDR (tail); XCDR (tail) = prev; prev = tail; @@ -1749,17 +1747,21 @@ } DEFUN ("reverse", Freverse, 1, 1, 0, /* -Reverse LIST, copying. Returns the beginning of the reversed list. +Reverse LIST, copying. Return the beginning of the reversed list. See also the function `nreverse', which is used more often. */ (list)) { - Lisp_Object new; - - for (new = Qnil; CONSP (list); list = XCDR (list)) - new = Fcons (XCAR (list), new); - if (!NILP (list)) - list = wrong_type_argument (Qconsp, list); + REGISTER Lisp_Object tail; + Lisp_Object new = Qnil; + + for (tail = list; CONSP (tail); tail = XCDR (tail)) + { + new = Fcons (XCAR (tail), new); + QUIT; + } + if (!NILP (tail)) + dead_wrong_type_argument (Qlistp, tail); return new; } @@ -1774,14 +1776,12 @@ int (*pred_fn) (Lisp_Object, Lisp_Object, Lisp_Object lisp_arg)) { - Lisp_Object front, back; - Lisp_Object len, tem; struct gcpro gcpro1, gcpro2, gcpro3; - int length; - - front = list; - len = Flength (list); - length = XINT (len); + Lisp_Object back, tem; + Lisp_Object front = list; + Lisp_Object len = Flength (list); + int length = XINT (len); + if (length < 2) return list; @@ -2087,14 +2087,13 @@ internal_plist_put (Lisp_Object *plist, Lisp_Object property, Lisp_Object value) { - Lisp_Object tail = *plist; - - for (; !NILP (tail); tail = XCDR (XCDR (tail))) + Lisp_Object tail; + + for (tail = *plist; !NILP (tail); tail = XCDR (XCDR (tail))) { - struct Lisp_Cons *c = XCONS (tail); - if (EQ (c->car, property)) + if (EQ (XCAR (tail), property)) { - XCAR (c->cdr) = value; + XCAR (XCDR (tail)) = value; return; } } @@ -2648,9 +2647,7 @@ { Lisp_Object val = external_plist_get (&XSYMBOL (sym)->plist, propname, 0, ERROR_ME); - if (UNBOUNDP (val)) - return default_; - return val; + return UNBOUNDP (val) ? default_ : val; } static void @@ -2686,18 +2683,16 @@ return ptr; } -Lisp_Object +static Lisp_Object string_getprop (struct Lisp_String *s, Lisp_Object property, Lisp_Object default_) { Lisp_Object val = external_plist_get (string_plist_ptr (s), property, 0, ERROR_ME); - if (UNBOUNDP (val)) - return default_; - return val; + return UNBOUNDP (val) ? default_ : val; } -void +static void string_putprop (struct Lisp_String *s, Lisp_Object property, Lisp_Object value) { @@ -2902,30 +2897,23 @@ #ifndef LRECORD_VECTOR else if (VECTORP (o1)) { - int indice; + Lisp_Object *v1 = XVECTOR_DATA (o1); + Lisp_Object *v2 = XVECTOR_DATA (o2); int len = XVECTOR_LENGTH (o1); if (len != XVECTOR_LENGTH (o2)) return 0; - for (indice = 0; indice < len; indice++) - { - Lisp_Object v1, v2; - v1 = XVECTOR_DATA (o1) [indice]; - v2 = XVECTOR_DATA (o2) [indice]; - if (!internal_equal (v1, v2, depth + 1)) - return 0; - } + while (len--) + if (!internal_equal (*v1++, *v2++, depth + 1)) + return 0; return 1; } #endif #ifndef LRECORD_STRING else if (STRINGP (o1)) { - Bytecount len = XSTRING_LENGTH (o1); - if (len != XSTRING_LENGTH (o2)) - return 0; - if (memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len)) - return 0; - return 1; + Bytecount len; + return (((len = XSTRING_LENGTH (o1)) == XSTRING_LENGTH (o2)) && + !memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len)); } #endif else if (LRECORDP (o1)) @@ -3020,7 +3008,7 @@ } DEFUN ("equal", Fequal, 2, 2, 0, /* -T if two Lisp objects have similar structure and contents. +Return t if two Lisp objects have similar structure and contents. They must have the same data type. Conses are compared by comparing the cars and the cdrs. Vectors and strings are compared element by element. @@ -3032,7 +3020,7 @@ } DEFUN ("old-equal", Fold_equal, 2, 2, 0, /* -T if two Lisp objects have similar structure and contents. +Return t if two Lisp objects have similar structure and contents. They must have the same data type. \(Note, however, that an exception is made for characters and integers; this is known as the "char-int confoundance disease." See `eq' and @@ -3055,41 +3043,35 @@ retry: if (STRINGP (array)) { - Charcount len; + Emchar charval; + struct Lisp_String *s = XSTRING (array); + Charcount len = string_char_length (s); Charcount i; - Emchar charval; - struct Lisp_String *s; CHECK_CHAR_COERCE_INT (item); CHECK_IMPURE (array); charval = XCHAR (item); - s = XSTRING (array); - len = string_char_length (s); for (i = 0; i < len; i++) set_string_char (s, i, charval); bump_string_modiff (array); } else if (VECTORP (array)) { - Lisp_Object *p; - int len; - int i; + Lisp_Object *p = XVECTOR_DATA (array); + int len = XVECTOR_LENGTH (array); CHECK_IMPURE (array); - len = XVECTOR_LENGTH (array); - p = XVECTOR_DATA (array); - for (i = 0; i < len; i++) - p[i] = item; + while (len--) + *p++ = item; } else if (BIT_VECTORP (array)) { - struct Lisp_Bit_Vector *v; - int len; - int i; + struct Lisp_Bit_Vector *v = XBIT_VECTOR (array); + int len = bit_vector_length (v); + int bit; CHECK_BIT (item); CHECK_IMPURE (array); - v = XBIT_VECTOR (array); - len = bit_vector_length (v); - for (i = 0; i < len; i++) - set_bit_vector_bit (v, i, XINT (item)); + bit = XINT (item); + while (len--) + set_bit_vector_bit (v, len, bit); } else { @@ -3112,11 +3094,13 @@ Concatenate any number of lists by altering them. Only the last argument is not altered, and need not be a list. Also see: `append'. +If the first argument is nil, there is no way to modify it by side +effect; therefore, write `(setq foo (nconc foo list))' to be sure of +changing the value of `foo'. */ (int nargs, Lisp_Object *args)) { - int argnum; - Lisp_Object tail, tem, val; + int argnum = 0; struct gcpro gcpro1; /* The modus operandi in Emacs is "caller gc-protects args". @@ -3126,43 +3110,51 @@ callers out by protecting the args ourselves to save them a lot of temporary-variable grief. */ - again: - GCPRO1 (args[0]); gcpro1.nvars = nargs; - val = Qnil; - - for (argnum = 0; argnum < nargs; argnum++) + while (argnum < nargs) { - tem = args[argnum]; - if (NILP (tem)) continue; - - if (NILP (val)) - val = tem; - - if (argnum + 1 == nargs) break; - - if (!CONSP (tem)) + Lisp_Object val = args[argnum]; + if (CONSP (val)) { - tem = wrong_type_argument (Qlistp, tem); - goto again; - } - - while (CONSP (tem)) - { - tail = tem; - tem = XCDR (tail); - QUIT; - } - - tem = args[argnum + 1]; - Fsetcdr (tail, tem); - if (NILP (tem)) - args[argnum + 1] = tail; + /* Found the first cons, which will be our return value. */ + Lisp_Object last = val; + + for (argnum++; argnum < nargs; argnum++) + { + Lisp_Object next = args[argnum]; + redo: + if (CONSP (next) || argnum == nargs -1) + { + /* (setcdr (last val) next) */ + while (CONSP (XCDR (last))) + { + last = XCDR (last); + QUIT; + } + XCDR (last) = next; + } + else if (NILP (next)) + { + continue; + } + else + { + next = wrong_type_argument (next, Qlistp); + goto redo; + } + } + RETURN_UNGCPRO (val); + } + else if (NILP (val)) + argnum++; + else if (argnum == nargs - 1) /* last arg? */ + RETURN_UNGCPRO (val); + else + args[argnum] = wrong_type_argument (val, Qlistp); } - - RETURN_UNGCPRO (val); + RETURN_UNGCPRO (Qnil); /* No non-nil args provided. */ } @@ -3250,12 +3242,11 @@ (fn, seq, sep)) { int len = XINT (Flength (seq)); - int nargs; Lisp_Object *args; int i; struct gcpro gcpro1; - - nargs = len + len - 1; + int nargs = len + len - 1; + if (nargs < 0) return build_string (""); args = alloca_array (Lisp_Object, nargs); @@ -3332,25 +3323,25 @@ If the 5-minute or 15-minute load averages are not available, return a shortened list, containing only those averages which are available. -On some systems, this won't work due to permissions on /dev/kmem in -which case you can't use this. +On some systems, this won't work due to permissions on /dev/kmem, +in which case you can't use this. */ ()) { - double load_ave[10]; /* hey, just in case */ - int loads = getloadavg (load_ave, 3); - Lisp_Object ret; + double load_ave[3]; + int loads = getloadavg (load_ave, countof (load_ave)); if (loads == -2) error ("load-average not implemented for this operating system."); else if (loads < 0) error ("could not get load-average; check permissions."); - ret = Qnil; - while (loads > 0) - ret = Fcons (make_int ((int) (load_ave[--loads] * 100.0)), ret); - - return ret; + { + Lisp_Object ret = Qnil; + while (loads > 0) + ret = Fcons (make_int ((int) (load_ave[--loads] * 100.0)), ret); + return ret; + } } @@ -3397,19 +3388,17 @@ CHECK_SYMBOL (fexp); return NILP (Fmemq (fexp, Vfeatures)) ? Qnil : Qt; #else /* FEATUREP_SYNTAX */ - extern Lisp_Object Vemacs_major_version, Vemacs_minor_version; - extern Lisp_Object Qfeaturep; static double featurep_emacs_version; /* Brute force translation from Erik Naggum's lisp function. */ - if (SYMBOLP(fexp)) + if (SYMBOLP (fexp)) { /* Original definition */ return NILP (Fmemq (fexp, Vfeatures)) ? Qnil : Qt; } - else if (INTP(fexp) || FLOATP(fexp)) + else if (INTP (fexp) || FLOATP (fexp)) { - double d = extract_float(fexp); + double d = extract_float (fexp); if (featurep_emacs_version == 0.0) { @@ -3418,12 +3407,10 @@ } return featurep_emacs_version >= d ? Qt : Qnil; } - else if (CONSP(fexp)) + else if (CONSP (fexp)) { - Lisp_Object tem; - - tem = XCAR(fexp); - if (EQ(tem, Qnot)) + Lisp_Object tem = XCAR (fexp); + if (EQ (tem, Qnot)) { Lisp_Object negate; @@ -3434,17 +3421,17 @@ else return Fsignal (Qinvalid_read_syntax, list1 (tem)); } - else if (EQ(tem, Qand)) + else if (EQ (tem, Qand)) { - tem = XCDR(fexp); + tem = XCDR (fexp); /* Use Fcar/Fcdr for error-checking. */ while (!NILP (tem) && !NILP (call1 (Qfeaturep, Fcar (tem)))) { tem = Fcdr (tem); } - return NILP(tem) ? Qt : Qnil; + return NILP (tem) ? Qt : Qnil; } - else if (EQ(tem, Qor)) + else if (EQ (tem, Qor)) { tem = XCDR (fexp); /* Use Fcar/Fcdr for error-checking. */ @@ -3452,16 +3439,16 @@ { tem = Fcdr (tem); } - return NILP(tem) ? Qnil : Qt; + return NILP (tem) ? Qnil : Qt; } else { - return Fsignal(Qinvalid_read_syntax, list1(XCDR(fexp))); + return Fsignal (Qinvalid_read_syntax, list1 (XCDR (fexp))); } } else { - return Fsignal(Qinvalid_read_syntax, list1 (fexp)); + return Fsignal (Qinvalid_read_syntax, list1 (fexp)); } } #endif /* FEATUREP_SYNTAX */
--- a/src/font-lock.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/font-lock.c Mon Aug 13 10:28:48 2007 +0200 @@ -432,7 +432,7 @@ if (context_cache.needs_its_head_reexamined) { if (context_cache.depth == 0 - && context_cache.context == ccontext_none) + && context_cache.context == context_none) { /* We've found an anchor spot. Try to put the start of defun within 6000 chars of @@ -628,13 +628,12 @@ { switch (context) { - case context_none: return (Qnil); - case context_string: return (Qstring); - case context_comment: return (Qcomment); - case context_block_comment: return (Qblock_comment); - default: abort (); + case context_none: return Qnil; + case context_string: return Qstring; + case context_comment: return Qcomment; + case context_block_comment: return Qblock_comment; + default: abort (); return Qnil; /* suppress compiler warning */ } - return Qnil; /* suppress compiler warning */ } DEFUN ("buffer-syntactic-context", Fbuffer_syntactic_context, 0, 1, 0, /* @@ -678,8 +677,8 @@ DEFUN ("syntactically-sectionize", Fsyntactically_sectionize, 3, 4, 0, /* -Calls FUNCTION for each contiguous syntactic context in the region. -Calls the given function with four arguments: the start and end of the +Call FUNCTION for each contiguous syntactic context in the region. +Call the given function with four arguments: the start and end of the region, a symbol representing the syntactic context, and the current depth (as returned by the functions `buffer-syntactic-context' and `buffer-syntactic-context-depth'). When this function is called, the @@ -772,6 +771,6 @@ void vars_of_font_lock (void) { - memset (&context_cache, 0, sizeof (context_cache)); - memset (&bol_context_cache, 0, sizeof (bol_context_cache)); + xzero (context_cache); + xzero (bol_context_cache); }
--- a/src/frame-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/frame-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -25,7 +25,7 @@ Ultimately based on FSF. Substantially rewritten for XEmacs by Ben Wing. - Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. */ #include <config.h> @@ -33,6 +33,7 @@ #include "buffer.h" #include "console-msw.h" +#include "glyphs-msw.h" #include "events.h" #include "faces.h" #include "frame.h" @@ -325,6 +326,42 @@ } static void +mswindows_set_frame_icon (struct frame *f) +{ + if (IMAGE_INSTANCEP (f->icon) + && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (f->icon))) + { + if (!XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon)) + { + ICONINFO x_icon; + + x_icon.fIcon=TRUE; + x_icon.xHotspot=XIMAGE_INSTANCE_PIXMAP_HOTSPOT_X (f->icon); + x_icon.yHotspot=XIMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (f->icon); + x_icon.hbmMask=XIMAGE_INSTANCE_MSWINDOWS_BITMAP (f->icon); + x_icon.hbmColor=XIMAGE_INSTANCE_MSWINDOWS_MASK (f->icon); + + XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon)= + CreateIconIndirect (&x_icon); + } + + SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON, + (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon)); + } +} + +static void +mswindows_set_frame_pointer (struct frame *f) +{ +#if 0 + XDefineCursor (XtDisplay (FRAME_X_TEXT_WIDGET (f)), + XtWindow (FRAME_X_TEXT_WIDGET (f)), + XIMAGE_INSTANCE_X_CURSOR (f->pointer)); + XSync (XtDisplay (FRAME_X_TEXT_WIDGET (f)), 0); +#endif +} + +static void mswindows_raise_frame (struct frame *f) { BringWindowToTop (FRAME_MSWINDOWS_HANDLE(f)); @@ -530,8 +567,8 @@ CONSOLE_HAS_METHOD (mswindows, frame_visible_p); /* CONSOLE_HAS_METHOD (mswindows, frame_totally_visible_p); */ CONSOLE_HAS_METHOD (mswindows, frame_iconified_p); -/* CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); */ -/* CONSOLE_HAS_METHOD (mswindows, set_frame_icon); */ + CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); + CONSOLE_HAS_METHOD (mswindows, set_frame_icon); CONSOLE_HAS_METHOD (mswindows, get_frame_parent); CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits); } @@ -539,15 +576,6 @@ void syms_of_frame_mswindows (void) { -#if 0 /* XXX these are in general.c */ - defsymbol (&Qname, "name"); - defsymbol (&Qheight, "height"); - defsymbol (&Qwidth, "width"); - defsymbol (&Qtop, "top"); - defsymbol (&Qleft, "left"); -#endif - defsymbol (&Qinitially_unmapped, "initially-unmapped"); - defsymbol (&Qpopup, "popup"); } void
--- a/src/frame-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/frame-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -60,9 +60,10 @@ Lisp_Object Vdefault_x_frame_plist; Lisp_Object Qwindow_id; -Lisp_Object Qpopup; Lisp_Object Qx_resource_name; +EXFUN (Fx_window_id, 1); + /************************************************************************/ /* helper functions */ @@ -201,14 +202,12 @@ void x_wm_set_shell_iconic_p (Widget shell, int iconic_p) { - Arg al [1]; if (! XtIsWMShell (shell)) abort (); /* Because of questionable logic in Shell.c, this sequence can't work: w = XtCreatePopupShell (...); - XtSetArg (al, XtNiconic, True); - XtSetValues (w, al, 1); + Xt_SET_VALUE (w, XtNiconic, True); XtRealizeWidget (w); The iconic resource is only consulted at initialization time (when @@ -223,8 +222,7 @@ realization. This is true of MIT X11R5 patch level 25, at least. (Apparently some other versions of Xt don't have this bug?) */ - XtSetArg(al [0], XtNiconic, iconic_p); - XtSetValues (shell, al, 1); + Xt_SET_VALUE (shell, XtNiconic, iconic_p); EmacsShellSmashIconicHint (shell, iconic_p); } @@ -526,47 +524,35 @@ EmacsFrame w = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); Widget gw = (Widget) w; -#define FROB(propprop, value) \ -do { \ - if (EQ (property, propprop)) \ - return (value); \ -} while (0) - -#if 0 - if (EQ (property, Qleft) || EQ (property, Qtop)) - x_smash_bastardly_shell_position (shell); -#endif - if (EQ (property, Qleft) || EQ (property, Qtop)) + if (EQ (Qleft, property) || EQ (Qtop, property)) { Position x, y; if (!XtWindow(shell)) return Qzero; x_get_top_level_position (XtDisplay (shell), XtWindow (shell), &x, &y); - FROB (Qleft, make_int (x)); - FROB (Qtop, make_int (y)); + if (EQ (Qleft, property)) return make_int (x); + if (EQ (Qtop, property)) return make_int (y); } -#if 0 - FROB (Qleft, make_int (shell->core.x)); - FROB (Qtop, make_int (shell->core.y)); -#endif - FROB (Qborder_width, make_int (w->core.border_width)); - FROB (Qinternal_border_width, - make_int (w->emacs_frame.internal_border_width)); - FROB (Qborder_color, color_to_string (gw, w->core.border_pixel)); + if (EQ (Qborder_width, property)) + return make_int (w->core.border_width); + if (EQ (Qinternal_border_width, property)) + return make_int (w->emacs_frame.internal_border_width); + if (EQ (Qborder_color, property)) + return color_to_string (gw, w->core.border_pixel); #ifdef HAVE_TOOLBARS - FROB (Qtop_toolbar_shadow_color, - color_to_string (gw, w->emacs_frame.top_toolbar_shadow_pixel)); - FROB (Qbottom_toolbar_shadow_color, - color_to_string (gw, w->emacs_frame.bottom_toolbar_shadow_pixel)); - FROB (Qbackground_toolbar_color, - color_to_string (gw, w->emacs_frame.background_toolbar_pixel)); - FROB (Qtoolbar_shadow_thickness, - make_int (w->emacs_frame.toolbar_shadow_thickness)); + if (EQ (Qtop_toolbar_shadow_color, property)) + return color_to_string (gw, w->emacs_frame.top_toolbar_shadow_pixel); + if (EQ (Qbottom_toolbar_shadow_color, property)) + return color_to_string (gw, w->emacs_frame.bottom_toolbar_shadow_pixel); + if (EQ (Qbackground_toolbar_color, property)) + return color_to_string (gw, w->emacs_frame.background_toolbar_pixel); + if (EQ (Qtoolbar_shadow_thickness, property)) + return make_int (w->emacs_frame.toolbar_shadow_thickness); #endif /* HAVE_TOOLBARS */ - FROB (Qinter_line_space, make_int (w->emacs_frame.interline)); - FROB (Qwindow_id, Fx_window_id (make_frame (f))); - -#undef FROB + if (EQ (Qinter_line_space, property)) + return make_int (w->emacs_frame.interline); + if (EQ (Qwindow_id, property)) + return Fx_window_id (make_frame (f)); return Qunbound; } @@ -593,53 +579,45 @@ static Lisp_Object x_frame_properties (struct frame *f) { - Lisp_Object result = Qnil; + Lisp_Object props = Qnil; Widget shell = FRAME_X_SHELL_WIDGET (f); EmacsFrame w = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); Widget gw = (Widget) w; Position x, y; -#define FROB(propprop, value) \ -do { \ - Lisp_Object temtem = (value); \ - if (!NILP (temtem)) \ - /* backwards order; we reverse it below */ \ - result = Fcons (temtem, Fcons (propprop, result)); \ -} while (0) - -#if 0 - x_smash_bastardly_shell_position (shell); - FROB (Qleft, make_int (shell->core.x)); - FROB (Qtop, make_int (shell->core.y)); -#endif + props = cons3 (Qwindow_id, Fx_window_id (make_frame (f)), props); + props = cons3 (Qinter_line_space, make_int (w->emacs_frame.interline), props); + +#ifdef HAVE_TOOLBARS + props = cons3 (Qtoolbar_shadow_thickness, + make_int (w->emacs_frame.toolbar_shadow_thickness), + props); + props = cons3 (Qbackground_toolbar_color, + color_to_string (gw, w->emacs_frame.background_toolbar_pixel), + props); + props = cons3 (Qbottom_toolbar_shadow_color, + color_to_string (gw, w->emacs_frame.bottom_toolbar_shadow_pixel), + props); + props = cons3 (Qtop_toolbar_shadow_color, + color_to_string (gw, w->emacs_frame.top_toolbar_shadow_pixel), + props); +#endif /* HAVE_TOOLBARS */ + + props = cons3 (Qborder_color, + color_to_string (gw, w->core.border_pixel), props); + props = cons3 (Qinternal_border_width, + make_int (w->emacs_frame.internal_border_width), props); + props = cons3 (Qborder_width, make_int (w->core.border_width), props); + if (!XtWindow(shell)) x = y = 0; else x_get_top_level_position (XtDisplay (shell), XtWindow (shell), &x, &y); - FROB (Qleft, make_int (x)); - FROB (Qtop, make_int (y)); - - FROB (Qborder_width, make_int (w->core.border_width)); - FROB (Qinternal_border_width, - make_int (w->emacs_frame.internal_border_width)); - FROB (Qborder_color, color_to_string (gw, w->core.border_pixel)); -#ifdef HAVE_TOOLBARS - FROB (Qtop_toolbar_shadow_color, - color_to_string (gw, w->emacs_frame.top_toolbar_shadow_pixel)); - FROB (Qbottom_toolbar_shadow_color, - color_to_string (gw, w->emacs_frame.bottom_toolbar_shadow_pixel)); - FROB (Qbackground_toolbar_color, - color_to_string (gw, w->emacs_frame.background_toolbar_pixel)); - FROB (Qtoolbar_shadow_thickness, - make_int (w->emacs_frame.toolbar_shadow_thickness)); -#endif /* HAVE_TOOLBARS */ - FROB (Qinter_line_space, make_int (w->emacs_frame.interline)); - FROB (Qwindow_id, Fx_window_id (make_frame (f))); - -#undef FROB - - return result; + props = cons3 (Qtop, make_int (y), props); + props = cons3 (Qleft, make_int (x), props); + + return props; } @@ -654,7 +632,6 @@ Atom encoding = XA_STRING; String new_XtValue = (String) value; String old_XtValue = NULL; - Arg al[2]; #ifdef MULE Bufbyte *ptr; @@ -671,10 +648,10 @@ #endif /* MULE */ /* ### Caching is device-independent - belongs in update_frame_title. */ - XtSetArg (al[0], Xt_resource_name, &old_XtValue); - XtGetValues (FRAME_X_SHELL_WIDGET (f), al, 1); + Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue); if (!old_XtValue || strcmp (new_XtValue, old_XtValue)) { + Arg al[2]; XtSetArg (al[0], Xt_resource_name, new_XtValue); XtSetArg (al[1], Xt_resource_encoding_name, encoding); XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2); @@ -710,7 +687,6 @@ char uspos = !!(flags & (XValue | YValue)); char ussize = !!(flags & (WidthValue | HeightValue)); char *temp; - Arg al [1]; /* assign the correct size to the EmacsFrame widget ... */ EmacsFrameSetCharSize (FRAME_X_TEXT_WIDGET (f), w, h); @@ -735,8 +711,7 @@ else temp = NULL; - XtSetArg (al [0], XtNgeometry, temp); - XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 1); + Xt_SET_VALUE (FRAME_X_SHELL_WIDGET (f), XtNgeometry, temp); } /* Report to X that a frame property of frame S is being set or changed. @@ -755,7 +730,6 @@ Bool internal_border_width_specified = False; Lisp_Object tail; Widget w = FRAME_X_TEXT_WIDGET (f); - Arg al [10]; for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail))) { @@ -772,7 +746,7 @@ GET_C_STRING_CTEXT_DATA_ALLOCA (prop, extprop); if (STRINGP (val)) { - Extbyte *extval; + CONST Extbyte *extval; Extcount extvallen; GET_STRING_CTEXT_DATA_ALLOCA (val, extval, extvallen); @@ -856,18 +830,15 @@ if (int_p) { CHECK_INT (val); - XtSetArg (al [0], (char *) XSTRING_DATA (str), XINT (val)); - XtSetValues (w, al, 1); + Xt_SET_VALUE (w, (char *) XSTRING_DATA (str), XINT (val)); } else if (EQ (val, Qt)) { - XtSetArg (al [0], (char *) XSTRING_DATA (str), True); /* XtN...*/ - XtSetValues (w, al, 1); + Xt_SET_VALUE (w, (char *) XSTRING_DATA (str), True); /* XtN...*/ } else if (EQ (val, Qnil)) { - XtSetArg (al [0], (char *) XSTRING_DATA (str), False); /* XtN...*/ - XtSetValues (w, al, 1); + Xt_SET_VALUE (w, (char *) XSTRING_DATA (str), False); /* XtN...*/ } else { @@ -1223,12 +1194,12 @@ return Qnil; } len = XSTRING_LENGTH (XCAR (run)) + 1; - dnd_data = xrealloc (dnd_data, dnd_len + len); + dnd_data = (char *) xrealloc (dnd_data, dnd_len + len); strcpy (dnd_data + dnd_len - 1, (CONST char *)XSTRING_DATA (XCAR (run))); dnd_len += len; run = XCDR (run); } - + dnd_data[dnd_len - 1] = 0; /* the list-ending zero */ dnd_dealloc = 1; @@ -1355,7 +1326,7 @@ (f == XFRAME (XCAR (rest)) || !FRAME_X_P (XFRAME (XCAR (rest))))) rest = XCDR (rest); - return (NILP (rest)); + return NILP (rest); } /* Figure out what size the EmacsFrame widget should initially be, @@ -1388,7 +1359,6 @@ char *geom = 0, *ew_geom = 0; Boolean iconic_p = False, ew_iconic_p = False; - Arg al [2]; Widget wmshell = FRAME_X_SHELL_WIDGET (f); /* #### This may not be an ApplicationShell any more, with the 'popup @@ -1443,14 +1413,14 @@ if (!FRAME_X_TOP_LEVEL_FRAME_P (f)) { - XtSetArg (al [0], XtNgeometry, &ew_geom); - XtGetValues (ew, al, 1); + Xt_GET_VALUE (ew, XtNgeometry, &ew_geom); if (ew_geom) frame_flags = XParseGeometry (ew_geom, &frame_x, &frame_y, &frame_w, &frame_h); if (! (frame_flags & (WidthValue | HeightValue))) { + Arg al[2]; XtSetArg (al [0], XtNwidth, &frame_w); XtSetArg (al [1], XtNheight, &frame_h); XtGetValues (ew, al, 2); @@ -1465,6 +1435,7 @@ EmacsFrameSetCharSize (ew, frame_w, frame_h); if (frame_flags & (XValue | YValue)) { + Arg al[2]; XtSetArg (al [0], XtNwidth, &frame_w); XtSetArg (al [1], XtNheight, &frame_h); XtGetValues (ew, al, 2); @@ -1491,38 +1462,31 @@ treat that as the geometry of the frame. (Is this bogus? I'm not sure.) */ - XtSetArg (al [0], XtNgeometry, &ew_geom); - XtGetValues (ew, al, 1); + Xt_GET_VALUE (ew, XtNgeometry, &ew_geom); if (!ew_geom) { - XtSetArg (al [0], XtNgeometry, &geom); - XtGetValues (wmshell, al, 1); + Xt_GET_VALUE (wmshell, XtNgeometry, &geom); if (geom) { ew_geom = geom; - XtSetArg (al [0], XtNgeometry, ew_geom); - XtSetValues (ew, al, 1); + Xt_SET_VALUE (ew, XtNgeometry, ew_geom); } } /* If the Shell is iconic, then the EmacsFrame is iconic. (Is this bogus? I'm not sure.) */ - XtSetArg (al [0], XtNiconic, &ew_iconic_p); - XtGetValues (ew, al, 1); + Xt_GET_VALUE (ew, XtNiconic, &ew_iconic_p); if (!ew_iconic_p) { - XtSetArg (al [0], XtNiconic, &iconic_p); - XtGetValues (wmshell, al, 1); + Xt_GET_VALUE (wmshell, XtNiconic, &iconic_p); if (iconic_p) { ew_iconic_p = iconic_p; - XtSetArg (al [0], XtNiconic, iconic_p); - XtSetValues (ew, al, 1); + Xt_SET_VALUE (ew, XtNiconic, iconic_p); } } - XtSetArg (al [0], XtNgeometry, &geom); - XtGetValues (app_shell, al, 1); + Xt_GET_VALUE (app_shell, XtNgeometry, &geom); if (geom) app_flags = XParseGeometry (geom, &app_x, &app_y, &app_w, &app_h); @@ -1572,13 +1536,11 @@ /* If the AppShell is iconic, then the EmacsFrame is iconic. */ if (!ew_iconic_p) { - XtSetArg (al [0], XtNiconic, &iconic_p); - XtGetValues (app_shell, al, 1); + Xt_GET_VALUE (app_shell, XtNiconic, &iconic_p); if (iconic_p) { ew_iconic_p = iconic_p; - XtSetArg (al [0], XtNiconic, iconic_p); - XtSetValues (ew, al, 1); + Xt_SET_VALUE (ew, XtNiconic, iconic_p); } } } @@ -1668,14 +1630,19 @@ /* The scrollbar positioning is completely handled by redisplay. We just need to know which sides they are supposed to go on. */ unsigned char scrollbar_placement; - Arg al [1]; - - XtSetArg (al [0], XtNscrollBarPlacement, &scrollbar_placement); - XtGetValues (text, al, 1); - f->scrollbar_on_left = (scrollbar_placement == XtTOP_LEFT || - scrollbar_placement == XtBOTTOM_LEFT); - f->scrollbar_on_top = (scrollbar_placement == XtTOP_LEFT || - scrollbar_placement == XtTOP_RIGHT); + + Xt_GET_VALUE (text, XtNscrollBarPlacement, &scrollbar_placement); + switch (scrollbar_placement) + { + case XtTOP_LEFT: + f->scrollbar_on_left = 1, f->scrollbar_on_top = 1; break; + case XtBOTTOM_LEFT: + f->scrollbar_on_left = 1, f->scrollbar_on_top = 0; break; + case XtTOP_RIGHT: + f->scrollbar_on_left = 0, f->scrollbar_on_top = 1; break; + case XtBOTTOM_RIGHT: + f->scrollbar_on_left = 0, f->scrollbar_on_top = 0; break; + } f->scrollbar_y_offset = topbreadth + textbord; } #endif /* HAVE_SCROLLBARS */ @@ -1843,7 +1810,7 @@ XtSetArg (al[ac], XtNvisual, visual); ac++; XtSetArg (al[ac], XtNdepth, depth); ac++; XtSetArg (al[ac], XtNcolormap, cmap); ac++; - + container = XtCreateWidget ("container", emacsManagerWidgetClass, shell, al, ac); FRAME_X_CONTAINER_WIDGET (f) = container; @@ -1894,7 +1861,6 @@ { ShellWidget shell_widget = (ShellWidget) widget; XtGrabKind call_data = XtGrabNone; - Arg al [1]; XtCallCallbacks (widget, XtNpopupCallback, (XtPointer)&call_data); @@ -1907,11 +1873,9 @@ /* The XtSetValues below are not in XtPopup menu. We just want to make absolutely sure... */ - XtSetArg (al [0], XtNmappedWhenManaged, False); - XtSetValues (widget, al, 1); + Xt_SET_VALUE (widget, XtNmappedWhenManaged, False); XtRealizeWidget (widget); - XtSetArg (al [0], XtNmappedWhenManaged, True); - XtSetValues (widget, al, 1); + Xt_SET_VALUE (widget, XtNmappedWhenManaged, True); } #ifdef HAVE_CDE @@ -2133,10 +2097,8 @@ x_get_frame_parent (struct frame *f) { Widget parentwid = 0; - Arg al[1]; - - XtSetArg (al[0], XtNtransientFor, &parentwid); - XtGetValues (FRAME_X_SHELL_WIDGET (f), al, 1); + + Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), XtNtransientFor, &parentwid); /* find the frame whose wid is parentwid */ if (parentwid) { @@ -2526,15 +2488,12 @@ x_delete_frame (struct frame *f) { Widget w = FRAME_X_SHELL_WIDGET (f); - Lisp_Object frame; #ifndef HAVE_SESSION if (FRAME_X_TOP_LEVEL_FRAME_P (f)) x_wm_maybe_move_wm_command (f); #endif /* HAVE_SESSION */ - XSETFRAME (frame, f); - #ifdef EXTERNAL_WIDGET { Display *dpy = XtDisplay (w); @@ -2640,7 +2599,6 @@ syms_of_frame_x (void) { defsymbol (&Qwindow_id, "window-id"); - defsymbol (&Qpopup, "popup"); defsymbol (&Qx_resource_name, "x-resource-name"); DEFSUBR (Fx_window_id);
--- a/src/frame.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/frame.c Mon Aug 13 10:28:48 2007 +0200 @@ -125,15 +125,9 @@ static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val); -MAC_DEFINE (struct frame *, MTframe_data) +EXFUN (Fset_frame_properties, 2); -static Lisp_Object mark_frame (Lisp_Object, void (*) (Lisp_Object)); -static void print_frame (Lisp_Object, Lisp_Object, int); -DEFINE_LRECORD_IMPLEMENTATION ("frame", frame, - mark_frame, print_frame, 0, 0, 0, - struct frame); - static Lisp_Object mark_frame (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -184,6 +178,9 @@ write_c_string (buf, printcharfun); } +DEFINE_LRECORD_IMPLEMENTATION ("frame", frame, + mark_frame, print_frame, 0, 0, 0, + struct frame); static void nuke_all_frame_slots (struct frame *f) @@ -218,7 +215,7 @@ allocate_frame_core (Lisp_Object device) { /* This function can GC */ - Lisp_Object frame = Qnil; + Lisp_Object frame; Lisp_Object root_window; struct frame *f = alloc_lcrecord_type (struct frame, lrecord_frame); @@ -369,7 +366,7 @@ } DEFUN ("make-frame", Fmake_frame, 0, 2, "", /* -Create a new frame, displaying the current buffer. +Create and return a new frame, displaying the current buffer. Runs the functions listed in `create-frame-hook' after frame creation. Optional argument PROPS is a property list (a list of alternating @@ -587,7 +584,7 @@ Lisp_Object make_frame (struct frame *f) { - Lisp_Object frame = Qnil; + Lisp_Object frame; XSETFRAME (frame, f); return frame; } @@ -819,7 +816,8 @@ */ (frame)) { - return FRAME_ROOT_WINDOW (decode_frame (frame)); + struct frame *f = decode_frame (frame); + return FRAME_ROOT_WINDOW (f); } DEFUN ("frame-selected-window", Fframe_selected_window, 0, 1, 0, /* @@ -828,7 +826,8 @@ */ (frame)) { - return FRAME_SELECTED_WINDOW (decode_frame (frame)); + struct frame *f = decode_frame (frame); + return FRAME_SELECTED_WINDOW (f); } void @@ -1181,8 +1180,7 @@ -extern void free_window_mirror (struct window_mirror *mir); -extern void free_line_insertion_deletion_costs (struct frame *f); +/* extern void free_line_insertion_deletion_costs (struct frame *f); */ /* Return 1 if it is ok to delete frame F; 0 if all frames aside from F are invisible. @@ -1302,15 +1300,15 @@ Lisp_Object this = XCAR (frmcons); - if (! EQ (this, frame) - && EQ (frame, DEVMETH_OR_GIVEN(XDEVICE(XCAR(devcons)), - get_frame_parent, - (XFRAME(this)), - Qnil))) + if (! EQ (this, frame)) { - /* We've found a popup frame whose parent is this frame. */ - signal_simple_error - ("Attempt to delete a frame with live popups", frame); + struct device *devcons_d = XDEVICE (XCAR (devcons)); + if (EQ (frame, DEVMETH_OR_GIVEN (devcons_d, get_frame_parent, + (XFRAME (this)), + Qnil))) + /* We've found a popup frame whose parent is this frame. */ + signal_simple_error + ("Attempt to delete a frame with live popups", frame); } } } @@ -1621,6 +1619,77 @@ /* Return mouse position in character cell units. */ +static int +mouse_pixel_position_1 (struct device *d, Lisp_Object *frame, + int *x, int *y) +{ + switch (DEVMETH_OR_GIVEN (d, get_mouse_position, (d, frame, x, y), -1)) + { + case 1: + return 1; + + case 0: + *frame = Qnil; + break; + + case -1: + *frame = DEVICE_SELECTED_FRAME (d); + break; + + default: + abort (); /* method is incorrectly written */ + } + + return 0; +} + +DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 0, 1, 0, /* +Return a list (WINDOW X . Y) giving the current mouse window and position. +The position is given in pixel units, where (0, 0) is the +upper-left corner. + +DEVICE specifies the device on which to read the mouse position, and +defaults to the selected device. If the device is a mouseless terminal +or Emacs hasn't been programmed to read its mouse position, it returns +the device's selected window for WINDOW and nil for X and Y. +*/ + (device)) +{ + struct device *d = decode_device (device); + Lisp_Object frame; + Lisp_Object window; + Lisp_Object x = Qnil; + Lisp_Object y = Qnil; + int intx, inty; + + if (mouse_pixel_position_1 (d, &frame, &intx, &inty)) + { + struct window *w = + find_window_by_pixel_pos (intx, inty, XFRAME (frame)->root_window); + if (!w) + window = Qnil; + else + { + XSETWINDOW (window, w); + + /* Adjust the position to be relative to the window. */ + intx -= w->pixel_left; + inty -= w->pixel_top; + XSETINT (x, intx); + XSETINT (y, inty); + } + } + else + { + if (FRAMEP (frame)) + window = FRAME_SELECTED_WINDOW (XFRAME (frame)); + else + window = Qnil; + } + + return Fcons (window, Fcons (x, y)); +} + DEFUN ("mouse-position", Fmouse_position, 0, 1, 0, /* Return a list (WINDOW X . Y) giving the current mouse window and position. The position is given in character cells, where (0, 0) is the @@ -1668,78 +1737,6 @@ return val; } -static int -mouse_pixel_position_1 (struct device *d, Lisp_Object *frame, - int *x, int *y) -{ - switch (DEVMETH_OR_GIVEN (d, get_mouse_position, (d, frame, x, y), -1)) - { - case 1: - return 1; - - case 0: - *frame = Qnil; - break; - - case -1: - *frame = DEVICE_SELECTED_FRAME (d); - break; - - default: - abort (); /* method is incorrectly written */ - } - - return 0; -} - -DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 0, 1, 0, /* -Return a list (WINDOW X . Y) giving the current mouse window and position. -The position is given in pixel units, where (0, 0) is the -upper-left corner. - -DEVICE specifies the device on which to read the mouse position, and -defaults to the selected device. If the device is a mouseless terminal -or Emacs hasn't been programmed to read its mouse position, it returns -the device's selected window for WINDOW and nil for X and Y. -*/ - (device)) -{ - struct device *d = decode_device (device); - Lisp_Object frame; - Lisp_Object window; - Lisp_Object x, y; - int intx, inty; - - x = y = Qnil; - - if (mouse_pixel_position_1 (d, &frame, &intx, &inty)) - { - struct window *w = - find_window_by_pixel_pos (intx, inty, XFRAME (frame)->root_window); - if (!w) - window = Qnil; - else - { - XSETWINDOW (window, w); - - /* Adjust the position to be relative to the window. */ - intx -= w->pixel_left; - inty -= w->pixel_top; - XSETINT (x, intx); - XSETINT (y, inty); - } - } - else - { - if (FRAMEP (frame)) - window = FRAME_SELECTED_WINDOW (XFRAME (frame)); - else - window = Qnil; - } - - return Fcons (window, Fcons (x, y)); -} - DEFUN ("mouse-position-as-motion-event", Fmouse_position_as_motion_event, 0, 1, 0, /* Return the current mouse position as a motion event. This allows you to call the standard event functions such as @@ -1747,7 +1744,7 @@ DEVICE specifies the device on which to read the mouse position, and defaults to the selected device. If the mouse position can't be determined -(e.g. DEVICE is a TTY device), nil is returned instead of an event. +\(e.g. DEVICE is a TTY device), nil is returned instead of an event. */ (device)) { @@ -1918,7 +1915,7 @@ } DEFUN ("frame-totally-visible-p", Fframe_totally_visible_p, 0, 1, 0, /* -Return T if frame is not obscured by any other X windows, NIL otherwise. +Return t if frame is not obscured by any other window system windows. Always returns t for tty frames. */ (frame)) @@ -2147,7 +2144,7 @@ The following symbols etc. have predefined meanings: - name Name of the frame, used with X resources. + name Name of the frame. Used with X resources. Unchangeable after creation. height Height of the frame, in lines. @@ -2297,55 +2294,56 @@ (frame, property, default_)) { struct frame *f = decode_frame (frame); - int width, height; + Lisp_Object value; XSETFRAME (frame, f); property = get_property_alias (property); -#define FROB(propprop, value) \ -do { \ - if (EQ (property, propprop)) \ - return value; \ -} while (0) - - FROB (Qname, f->name); - - if (window_system_pixelated_geometry (frame)) + if (EQ (Qname, property)) return f->name; + + if (EQ (Qheight, property) || EQ (Qwidth, property)) { - pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), - &width, &height); + if (window_system_pixelated_geometry (frame)) + { + int width, height; + pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), + &width, &height); + return make_int (EQ (Qheight, property) ? height: width); + } + else + return make_int (EQ (Qheight, property) ? + FRAME_HEIGHT (f) : + FRAME_WIDTH (f)); } - else - { - height = FRAME_HEIGHT (f); - width = FRAME_WIDTH (f); - } - FROB (Qheight, make_int (height)); - FROB (Qwidth, make_int (width)); /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P. This is over-the-top bogosity, because it's inconsistent with the semantics of `minibuffer' when passed to `make-frame'. Returning Qt makes things consistent. */ - FROB (Qminibuffer, (FRAME_MINIBUF_ONLY_P (f) ? Qonly : - FRAME_HAS_MINIBUF_P (f) ? Qt : - FRAME_MINIBUF_WINDOW (f))); - FROB (Qunsplittable, FRAME_NO_SPLIT_P (f) ? Qt : Qnil); - FROB (Qbuffer_predicate, f->buffer_predicate); - -#undef FROB - - if (SYMBOLP (property) && EQ (Fbuilt_in_variable_type (property), - Qconst_specifier)) - return Fspecifier_instance (Fsymbol_value (property), frame, default_, Qnil); - if (SYMBOLP (property) && !NILP (Fget (property, Qconst_glyph_variable, - Qnil))) + if (EQ (Qminibuffer, property)) + return (FRAME_MINIBUF_ONLY_P (f) ? Qonly : + FRAME_HAS_MINIBUF_P (f) ? Qt : + FRAME_MINIBUF_WINDOW (f)); + if (EQ (Qunsplittable, property)) + return FRAME_NO_SPLIT_P (f) ? Qt : Qnil; + if (EQ (Qbuffer_predicate, property)) + return f->buffer_predicate; + + if (SYMBOLP (property)) { - Lisp_Object glyph = Fsymbol_value (property); - CHECK_GLYPH (glyph); - return Fspecifier_instance (XGLYPH_IMAGE (glyph), frame, default_, Qnil); + if (EQ (Fbuilt_in_variable_type (property), Qconst_specifier)) + return Fspecifier_instance (Fsymbol_value (property), + frame, default_, Qnil); + if (!NILP (Fget (property, Qconst_glyph_variable, Qnil))) + { + Lisp_Object glyph = Fsymbol_value (property); + CHECK_GLYPH (glyph); + return Fspecifier_instance (XGLYPH_IMAGE (glyph), + frame, default_, Qnil); + } } + if (VECTORP (property) && XVECTOR_LENGTH (property) == 2) { Lisp_Object face_prop = XVECTOR_DATA (property)[1]; @@ -2355,18 +2353,14 @@ face_prop, frame); } - { - Lisp_Object value; - - value = FRAMEMETH_OR_GIVEN (f, frame_property, (f, property), Qunbound); - if (!UNBOUNDP (value)) + if (HAS_FRAMEMETH_P (f, frame_property)) + if (!UNBOUNDP (value = FRAMEMETH (f, frame_property, (f, property)))) return value; - value = external_plist_get (&f->plist, property, 1, ERROR_ME); - if (!UNBOUNDP (value)) - return value; - return default_; - } + if (!UNBOUNDP (value = external_plist_get (&f->plist, property, 1, ERROR_ME))) + return value; + + return default_; } DEFUN ("frame-properties", Fframe_properties, 0, 1, 0, /* @@ -2378,62 +2372,59 @@ struct frame *f = decode_frame (frame); Lisp_Object result = Qnil; struct gcpro gcpro1; - int width, height; GCPRO1 (result); XSETFRAME (frame, f); -#define FROB(propprop, value) \ -do { \ - Lisp_Object temtem = (value); \ - if (!NILP (temtem)) \ - /* backwards order; we reverse it below */ \ - result = Fcons (temtem, Fcons (propprop, result)); \ -} while (0) - - FROB (Qname, f->name); - - if (window_system_pixelated_geometry (frame)) - { - pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), - &width, &height); - } - else - { - height = FRAME_HEIGHT (f); - width = FRAME_WIDTH (f); - } - FROB (Qheight, make_int (height)); - FROB (Qwidth, make_int (width)); - - /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P. + /* #### for the moment (since old code uses `frame-parameters'), + we call `copy-sequence' on f->plist. That allows frame-parameters + to destructively convert the plist into an alist, which is more + efficient than doing it non-destructively. At some point we + should remove the call to copy-sequence. */ + result = Fcopy_sequence (f->plist); + + /* #### should we be adding all the specifiers and glyphs? + That would entail having a list of them all. */ + if (HAS_FRAMEMETH_P (f, frame_properties)) + result = nconc2 (FRAMEMETH (f, frame_properties, (f)), result); + + if (!NILP (f->buffer_predicate)) + result = cons3 (Qbuffer_predicate, f->buffer_predicate, result); + + if (FRAME_NO_SPLIT_P (f)) + result = cons3 (Qunsplittable, Qt, result); + + /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P. This is over-the-top bogosity, because it's inconsistent with the semantics of `minibuffer' when passed to `make-frame'. Returning Qt makes things consistent. */ - FROB (Qminibuffer, (FRAME_MINIBUF_ONLY_P (f) ? Qonly : - FRAME_HAS_MINIBUF_P (f) ? Qt : - FRAME_MINIBUF_WINDOW (f))); - FROB (Qunsplittable, FRAME_NO_SPLIT_P (f) ? Qt : Qnil); - FROB (Qbuffer_predicate, f->buffer_predicate); - -#undef FROB - - /* #### should we be adding all the specifiers and glyphs? - That would entail having a list of them all. */ + result = cons3 (Qminibuffer, + (FRAME_MINIBUF_ONLY_P (f) ? Qonly : + FRAME_HAS_MINIBUF_P (f) ? Qt : + FRAME_MINIBUF_WINDOW (f)), + result); { - Lisp_Object value; - - value = FRAMEMETH_OR_GIVEN (f, frame_properties, (f), Qnil); - result = nconc2 (value, result); - /* #### for the moment (since old code uses `frame-parameters'), - we call `copy-sequence' on f->plist. That allows frame-parameters - to destructively convert the plist into an alist, which is more - efficient than doing it non-destructively. At some point we - should remove the call to copy-sequence. */ - result = nconc2 (Fnreverse (result), Fcopy_sequence (f->plist)); - RETURN_UNGCPRO (result); + int width, height; + + if (window_system_pixelated_geometry (frame)) + { + pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), + &width, &height); + } + else + { + height = FRAME_HEIGHT (f); + width = FRAME_WIDTH (f); + } + result = cons3 (Qwidth , make_int (width), result); + result = cons3 (Qheight, make_int (height), result); } + + result = cons3 (Qname, f->name, result); + + UNGCPRO; + return result; } @@ -2442,8 +2433,7 @@ */ (frame)) { - struct frame *f = decode_frame (frame); - return make_int (f->pixheight); + return make_int (decode_frame (frame)->pixheight); } DEFUN ("frame-pixel-width", Fframe_pixel_width, 0, 1, 0, /* @@ -2451,8 +2441,7 @@ */ (frame)) { - struct frame *f = decode_frame (frame); - return make_int (f->pixwidth); + return make_int (decode_frame (frame)->pixwidth); } DEFUN ("frame-name", Fframe_name, 0, 1, 0, /* @@ -2542,7 +2531,7 @@ } DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /* -Sets size of FRAME to COLS by ROWS. +Set the size of FRAME to COLS by ROWS. Optional fourth arg non-nil means that redisplay should use COLS by ROWS but that the idea of the actual size of the frame should not be changed. */ @@ -2567,7 +2556,7 @@ } DEFUN ("set-frame-position", Fset_frame_position, 3, 3, 0, /* -Sets position of FRAME in pixels to XOFFSET by YOFFSET. +Set position of FRAME in pixels to XOFFSET by YOFFSET. This is actually the position of the upper left corner of the frame. Negative values for XOFFSET or YOFFSET are interpreted relative to the rightmost or bottommost possible position (that stays within the screen). @@ -2953,7 +2942,7 @@ { if (f->icon_changed || f->windows_changed) { - Lisp_Object frame = Qnil; + Lisp_Object frame; Lisp_Object new_icon; XSETFRAME (frame, f); @@ -3221,7 +3210,11 @@ This can be overridden by arguments to `make-frame'. This must be a string. */ ); +#ifndef INFODOCK Vdefault_frame_name = Fpurecopy (build_string ("emacs")); +#else + Vdefault_frame_name = Fpurecopy (build_string ("InfoDock")); +#endif DEFVAR_LISP ("default-frame-plist", &Vdefault_frame_plist /* Plist of default values for frame creation, other than the first one.
--- a/src/frame.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/frame.h Mon Aug 13 10:28:48 2007 +0200 @@ -38,10 +38,6 @@ MAYBE_CONTYPE_METH ((f)->framemeths, m, args) #define FRAMEMETH_OR_GIVEN(f, m, args, given) \ CONTYPE_METH_OR_GIVEN((f)->framemeths, m, args, given) -#define MAYBE_INT_FRAMEMETH(f, m, args) \ - MAYBE_INT_CONTYPE_METH ((f)->framemeths, m, args) -#define MAYBE_LISP_FRAMEMETH(f, m, args) \ - MAYBE_LISP_CONTYPE_METH ((f)->framemeths, m, args) struct frame { @@ -188,12 +184,35 @@ unsigned int subwindows_being_displayed :1; }; -/* If this is non-nil, it is the frame that make-frame is currently - creating. We can't set the current frame to this in case the - debugger goes off because it would try and display to it. However, - there are some places which need to reference it which have no - other way of getting it if it isn't the selected frame. */ -extern Lisp_Object Vframe_being_created; +EXFUN (Fdelete_frame, 2); +EXFUN (Fframe_iconified_p, 1); +EXFUN (Fframe_name, 1); +EXFUN (Fframe_property, 3); +EXFUN (Fmake_frame, 2); +EXFUN (Fmake_frame_visible, 1); +EXFUN (Fraise_frame, 1); +EXFUN (Fselect_frame, 1); +EXFUN (Fset_frame_pointer, 2); +EXFUN (Fset_frame_position, 3); +EXFUN (Fset_frame_size, 4); + +extern Lisp_Object Qbackground_toolbar_color, Qbell_volume, Qborder_color; +extern Lisp_Object Qborder_width, Qbottom_toolbar_shadow_color; +extern Lisp_Object Qbottom_toolbar_shadow_pixmap, Qdelete_frame; +extern Lisp_Object Qdeselect_frame_hook, Qdrag_and_drop_functions, Qgc_pointer; +extern Lisp_Object Qiconic, Qinitially_unmapped, Qinter_line_space; +extern Lisp_Object Qinternal_border_width, Qinvisible, Qmap_frame_hook; +extern Lisp_Object Qminibuffer, Qmodeline_pointer, Qmouse_enter_frame_hook; +extern Lisp_Object Qmouse_leave_frame_hook, Qpointer_background; +extern Lisp_Object Qpointer_color, Qpopup, Qscrollbar_placement; +extern Lisp_Object Qselect_frame_hook, Qspace_pointer; +extern Lisp_Object Qsynchronize_minibuffers, Qtext_pointer; +extern Lisp_Object Qtoolbar_shadow_thickness, Qtop_toolbar_shadow_color; +extern Lisp_Object Qtop_toolbar_shadow_pixmap, Qunmap_frame_hook; +extern Lisp_Object Qunsplittable, Quse_backing_store, Qvisible, Qvisual_bell; +extern Lisp_Object Vframe_icon_title_format, Vframe_title_format; +extern Lisp_Object Vmouse_motion_handler; + DECLARE_LRECORD (frame, struct frame); #define XFRAME(x) XRECORD (x, frame, struct frame) @@ -203,28 +222,30 @@ #define CHECK_FRAME(x) CHECK_RECORD (x, frame) #define CONCHECK_FRAME(x) CONCHECK_RECORD (x, frame) -#define CHECK_LIVE_FRAME(x) \ - do { CHECK_FRAME (x); \ - if (! FRAMEP (x) \ - || ! FRAME_LIVE_P (XFRAME (x))) \ - dead_wrong_type_argument (Qframe_live_p, (x)); } while (0) -#define CONCHECK_LIVE_FRAME(x) \ - do { CONCHECK_FRAME (x); \ - if (! FRAMEP (x) \ - || ! FRAME_LIVE_P (XFRAME (x))) \ - x = wrong_type_argument (Qframe_live_p, (x)); } while (0) +#define CHECK_LIVE_FRAME(x) do { \ + CHECK_FRAME (x); \ + if (! FRAME_LIVE_P (XFRAME (x))) \ + dead_wrong_type_argument (Qframe_live_p, (x)); \ +} while (0) +#define CONCHECK_LIVE_FRAME(x) do { \ + CONCHECK_FRAME (x); \ + if (! FRAME_LIVE_P (XFRAME (x))) \ + x = wrong_type_argument (Qframe_live_p, (x)); \ +} while (0) #define FRAME_TYPE_P(f, type) EQ (FRAME_TYPE (f), Q##type) #ifdef ERROR_CHECK_TYPECHECK -MAC_DECLARE_EXTERN (struct frame *, MTframe_data) +INLINE struct frame * +error_check_frame_type (struct frame * f, Lisp_Object sym); +INLINE struct frame * +error_check_frame_type (struct frame * f, Lisp_Object sym) +{ + assert (EQ (FRAME_TYPE (f), sym)); + return f; +} # define FRAME_TYPE_DATA(f, type) \ -MAC_BEGIN \ - MAC_DECLARE (struct frame *, MTframe_data, f) \ - assert (FRAME_TYPE_P (MTframe_data, type)) \ - MAC_SEP \ - (struct type##_frame *) MTframe_data->frame_data \ -MAC_END + ((struct type##_frame *) (error_check_frame_type (f, Q##type))->frame_data) #else # define FRAME_TYPE_DATA(f, type) \ ((struct type##_frame *) (f)->frame_data) @@ -263,69 +284,99 @@ #define FRAME_WIN_P(frm) CONSOLE_TYPESYM_WIN_P (FRAME_TYPE (frm)) -extern Lisp_Object Qframe_live_p; -extern Lisp_Object Qframe_x_p, Qframe_tty_p; -extern Lisp_Object Vframe_title_format, Vframe_icon_title_format; - extern int frame_changed; -#define MARK_FRAME_FACES_CHANGED(f) do { \ - (f)->faces_changed = 1; \ - (f)->modiff++; \ - if (!NILP ((f)->device)) \ - MARK_DEVICE_FACES_CHANGED (XDEVICE ((f)->device)); \ - else \ - faces_changed = 1; } while (0) +#define MARK_FRAME_FACES_CHANGED(f) do { \ + struct frame *mffc_f = (f); \ + mffc_f->faces_changed = 1; \ + mffc_f->modiff++; \ + if (!NILP (mffc_f->device)) \ + { \ + struct device *mffc_d = XDEVICE (mffc_f->device); \ + MARK_DEVICE_FACES_CHANGED (mffc_d); \ + } \ + else \ + faces_changed = 1; \ +} while (0) -#define MARK_FRAME_GLYPHS_CHANGED(f) do { \ - (f)->glyphs_changed = 1; \ - (f)->modiff++; \ - if (!NILP ((f)->device)) \ - MARK_DEVICE_GLYPHS_CHANGED (XDEVICE ((f)->device)); \ - else \ - glyphs_changed = 1; } while (0) +#define MARK_FRAME_GLYPHS_CHANGED(f) do { \ + struct frame *mfgc_f = (f); \ + mfgc_f->glyphs_changed = 1; \ + mfgc_f->modiff++; \ + if (!NILP (mfgc_f->device)) \ + { \ + struct device *mfgc_d = XDEVICE (mfgc_f->device); \ + MARK_DEVICE_GLYPHS_CHANGED (mfgc_d); \ + } \ + else \ + glyphs_changed = 1; \ +} while (0) -#define MARK_FRAME_TOOLBARS_CHANGED(f) do { \ - (f)->toolbar_changed = 1; \ - (f)->modiff++; \ - if (!NILP ((f)->device)) \ - MARK_DEVICE_TOOLBARS_CHANGED (XDEVICE ((f)->device)); \ - else \ - toolbar_changed = 1; } while (0) +#define MARK_FRAME_TOOLBARS_CHANGED(f) do { \ + struct frame *mftc_f = (f); \ + mftc_f->toolbar_changed = 1; \ + mftc_f->modiff++; \ + if (!NILP (mftc_f->device)) \ + { \ + struct device *mftc_d = XDEVICE (mftc_f->device); \ + MARK_DEVICE_TOOLBARS_CHANGED (mftc_d); \ + } \ + else \ + toolbar_changed = 1; \ +} while (0) -#define MARK_FRAME_SIZE_CHANGED(f) do { \ - (f)->size_changed = 1; \ - (f)->size_change_pending = 1; \ - (f)->modiff++; \ - if (!NILP ((f)->device)) \ - MARK_DEVICE_SIZE_CHANGED (XDEVICE ((f)->device)); \ - else \ - size_changed = 1; } while (0) - -#define MARK_FRAME_CHANGED(f) do { \ - (f)->frame_changed = 1; \ - (f)->modiff++; \ - if (!NILP ((f)->device)) \ - MARK_DEVICE_FRAME_CHANGED (XDEVICE ((f)->device)); \ - else \ - frame_changed = 1; } while (0) +#define MARK_FRAME_SIZE_CHANGED(f) do { \ + struct frame *mfsc_f = (f); \ + mfsc_f->size_changed = 1; \ + mfsc_f->size_change_pending = 1; \ + mfsc_f->modiff++; \ + if (!NILP (mfsc_f->device)) \ + { \ + struct device *mfsc_d = XDEVICE (mfsc_f->device); \ + MARK_DEVICE_SIZE_CHANGED (mfsc_d); \ + } \ + else \ + size_changed = 1; \ +} while (0) -#define MARK_FRAME_WINDOWS_CHANGED(f) do { \ - (f)->windows_changed = 1; \ - (f)->modiff++; \ - if (!NILP ((f)->device)) \ - MARK_DEVICE_WINDOWS_CHANGED (XDEVICE ((f)->device)); \ - else \ - windows_changed = 1; } while (0) +#define MARK_FRAME_CHANGED(f) do { \ + struct frame *mfc_f = (f); \ + mfc_f->frame_changed = 1; \ + mfc_f->modiff++; \ + if (!NILP (mfc_f->device)) \ + { \ + struct device *mfc_d = XDEVICE (mfc_f->device); \ + MARK_DEVICE_FRAME_CHANGED (mfc_d); \ + } \ + else \ + frame_changed = 1; \ +} while (0) -#define MARK_FRAME_WINDOWS_STRUCTURE_CHANGED(f) do { \ - (f)->windows_structure_changed = 1; \ - (f)->modiff++; \ - if (!NILP ((f)->device)) \ - MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED (XDEVICE ((f)->device)); \ - else \ - windows_structure_changed = 1; } while (0) +#define MARK_FRAME_WINDOWS_CHANGED(f) do { \ + struct frame *mfwc_f = (f); \ + mfwc_f->windows_changed = 1; \ + mfwc_f->modiff++; \ + if (!NILP (mfwc_f->device)) \ + { \ + struct device *mfwc_d = XDEVICE (mfwc_f->device); \ + MARK_DEVICE_WINDOWS_CHANGED (mfwc_d); \ + } \ + else \ + windows_changed = 1; \ +} while (0) +#define MARK_FRAME_WINDOWS_STRUCTURE_CHANGED(f) do { \ + struct frame *fwsc_f = (f); \ + fwsc_f->windows_structure_changed = 1; \ + fwsc_f->modiff++; \ + if (!NILP (fwsc_f->device)) \ + { \ + struct device *fwsc_d = XDEVICE (fwsc_f->device); \ + MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED (fwsc_d); \ + } \ + else \ + windows_structure_changed = 1; \ +} while (0) #define SET_FRAME_CLEAR(f) MARK_FRAME_CHANGED (f); (f)->clear = 1 #define FRAME_DEVICE(f) ((f)->device) @@ -586,8 +637,6 @@ DEVICE_LOOP_NO_BREAK (devcons, concons) \ DEVICE_FRAME_LOOP (frmcons, XDEVICE (XCAR (devcons))) -extern Lisp_Object Vdefault_frame_name; - void update_frame_title (struct frame *f); Lisp_Object next_frame (Lisp_Object f, Lisp_Object frametype, Lisp_Object console);
--- a/src/free-hook.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/free-hook.c Mon Aug 13 10:28:48 2007 +0200 @@ -220,7 +220,7 @@ #endif EMACS_INT present = (EMACS_INT) gethash (ptr, pointer_table, - (void **) &size); + (CONST void **) &size); if (!present) { @@ -230,9 +230,7 @@ /* I originally wrote: "There's really no need to drop core." I have seen the error of my ways. -slb */ if (strict_free_check) - { - abort (); - } + abort (); #endif printf("Freeing unmalloc'ed memory at %p\n", ptr); __free_hook = check_free; @@ -246,9 +244,7 @@ #if !defined(__linux__) /* See above comment. */ if (strict_free_check) - { - abort (); - } + abort (); #endif printf("Freeing %p twice\n", ptr); __free_hook = check_free; @@ -353,7 +349,7 @@ void *result = malloc (size); if (!ptr) return result; - present = (EMACS_INT) gethash (ptr, pointer_table, (void **) &old_size); + present = (EMACS_INT) gethash (ptr, pointer_table, (CONST void **) &old_size); if (!present) { /* This can only happen by reallocing a pointer that didn't
--- a/src/gdbinit Mon Aug 13 10:27:41 2007 +0200 +++ b/src/gdbinit Mon Aug 13 10:28:48 2007 +0200 @@ -1,270 +1,400 @@ -# Some useful commands for debugging emacs with gdb 4.14.* or better. -# Install this as your .gdbinit file in your home directory. -# If you have an older version of gdb 4.x, consider using the -# file "gdbinit.pre-4.14" in the XEmacs src directory. -# If you're one of the few who has an XEmacs compiled with -# --use-union-type, you'll need to use the file "gdbinit.union". -# Currently that file is of the pre-4.14 variety, but it should -# be easy to update it to 4.14+, along the same lines as this file. +# -*- ksh -*- +# Copyright (C) 1998 Free Software Foundation, Inc. + +# 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. + +# Author: Martin Buchholz + +# Some useful commands for debugging emacs with gdb 4.16 or better. +# Install this as your .gdbinit file in your home directory, +# or source this file from your .gdbinit +# Configure xemacs with --debug, and compile with -g. # -# See also question 2.1.15 of the XEmacs FAQ, titled +# See also the question of the XEmacs FAQ, titled # "How to Debug an XEmacs problem with a debugger". +# +# This can be used to debug XEmacs no matter how the following are +# specified: + +# USE_UNION_TYPE +# USE_MINIMAL_TAGBITS +# USE_INDEXED_LRECORD_IMPLEMENTATION +# LRECORD_(SYMBOL|STRING|VECTOR) + +# (the above all have configure equivalents) + +# Some functions defined here require a running process, but most +# don't. Considerable effort has been expended to this end. + +# See the dbg_ C support code in src/alloc.c that allows the functions +# defined in this file to work correctly. set print union off set print pretty off -define temacs - run -batch -l loadup.el run-temacs -q +define decode_object + set $obj = (unsigned long) $arg0 + if dbg_USE_MINIMAL_TAGBITS + if $obj & 1 + # It's an int + set $val = $obj >> 1 + set $type = dbg_Lisp_Type_Int + else + set $type = $obj & dbg_typemask + if $type == dbg_Lisp_Type_Char + set $val = ($obj & dbg_valmask) >> dbg_gctypebits + else + # It's a record pointer + set $val = $obj + end + end + else + # not dbg_USE_MINIMAL_TAGBITS + set $val = $obj & dbg_valmask + set $type = ($obj & dbg_typemask) >> (dbg_valbits + 1) + end + + if $type == dbg_Lisp_Type_Record + set $lheader = (struct lrecord_header *) $val + if dbg_USE_INDEXED_LRECORD_IMPLEMENTATION + set $imp = lrecord_implementations_table[$lheader->type] + else + set $imp = $lheader->implementation + end + else + set $imp = -1 + end +end + +document decode_object +Usage: decode_object lisp_object +Extract implementation information from a Lisp Object. +Defines variables $val, $type and $imp. +end + +define xint +decode_object $arg0 +print ((long) $val) end -echo \n>>> Use the `temacs' command to run temacs\n\n +define xtype + decode_object $arg0 + if $type == dbg_Lisp_Type_Int + echo int\n + else + if $type == dbg_Lisp_Type_Char + echo char\n + else + if $type == dbg_Lisp_Type_Symbol + echo symbol\n + else + if $type == dbg_Lisp_Type_String + echo string\n + else + if $type == dbg_Lisp_Type_Vector + echo vector\n + else + if $type == dbg_Lisp_Type_Cons + echo cons\n + else + printf "record type: %s\n", $imp->name + # barf + end + end + end + end + end + end +end + +define run-temacs +run -batch -l loadup.el run-temacs -q +end + +document run-temacs +Usage: run-temacs +Run temacs interactively, like xemacs. +Use this with debugging tools (like purify) that cannot deal with dumping, +or when temacs builds successfully, but xemacs does not. +end + +define update-elc + set env EMACSLOADPATH=../lisp/ + set env EMACSBOOTSTRAPLOADPATH=../lisp/:.. + run -batch -l update-elc.el +end + +document update-elc +Usage: update-elc +Run the elc compilation part of the build procedure. +Use when debugging temacs, not xemacs! +Use this when temacs builds successfully, but xemacs does not. +end + +define dump-temacs + set env EMACSLOADPATH=../lisp/:.. + run -batch -l loadup.el dump +end + +document dump-temacs +Usage: dump-temacs +Run the dumping part of the build procedure. +Use when debugging temacs, not xemacs! +Use this when temacs builds successfully, but xemacs does not. +end # if you use Purify, do this: -# set env PURIFYOPTIONS -pointer-mask=0x0fffffff - -################ Print using the Lisp printer +# export PURIFYOPTIONS='-pointer-mask=0x0fffffff' -define p1 - call debug_print ($arg0) - printf "\n" +define ldp + printf "%s", "Lisp => " + call debug_print($arg0) +end + +document ldp +Usage: ldp lisp_object +Print a Lisp Object value using the Lisp printer. +Requires a running xemacs process. end define lbt -# "&" to compensate for GDB struct-passing bug -# but I've removed the &'s because it doesn't work with my GDB, -# and not having them works fine. -call Fbacktrace (Qexternal_debugging_output, Qt) -end - -################ Print using GDB built-ins - -define xint -print ((int)($arg0 << 4))>>4 -end - -define xbitvec -print (struct Lisp_Bit_Vector *) ($arg0 & 0xFFFFFFF) -end - -define xbuffer -print (struct buffer *) ($arg0 & 0xFFFFFFF) -end - -define xbytecode -print (struct Lisp_Bytecode *) ($arg0 & 0xFFFFFFF) +call debug_backtrace() end -define xcharset -print (struct Lisp_Charset *) ($arg0 & 0xFFFFFFF) -end - -define xchartab -print (struct Lisp_Char_Table *) ($arg0 & 0xFFFFFFF) -end - -define xchartabentry -print (struct Lisp_Char_Table_Entry *) ($arg0 & 0xFFFFFFF) -end - -define xcodesys -print (struct Lisp_Coding_System *) ($arg0 & 0xFFFFFFF) -end - -define xcolorinst -print (struct Lisp_Color_Instance *) ($arg0 & 0xFFFFFFF) -end - -define xcons -print (struct Lisp_Cons *) ($arg0 & 0xFFFFFFF) -end - -define xdevice -print (struct device *) ($arg0 & 0xFFFFFFF) -end - -define xevent -print (struct Lisp_Event *) ($arg0 & 0xFFFFFFF) +document lbt +Usage: lbt +Print the current Lisp stack trace. +Requires a running xemacs process. end -define xextent -print (struct extent *) ($arg0 & 0xFFFFFFF) -end - -define xextentaux -print (struct extent_auxiliary *) ($arg0 & 0xFFFFFFF) -end - -define xextentinfo -print (struct extent_info *) ($arg0 & 0xFFFFFFF) -end - -define xfloat -print (struct Lisp_Float *) ($arg0 & 0xFFFFFFF) -output (double) $arg0->data.d -echo \n -end - -define xfontinst -print (struct Lisp_Font_Instance *) ($arg0 & 0xFFFFFFF) -end - -define xframe -print (struct frame *) ($arg0 & 0xFFFFFFF) -end - -define xglyph -print (struct Lisp_Glyph *) ($arg0 & 0xFFFFFFF) +define wtype +print $arg0->core.widget_class->core_class.class_name end -define xhashtable -print (struct hashtable_struct *) ($arg0 & 0xFFFFFFF) -end - -define ximageinst -print (struct Lisp_Image_Instance *) ($arg0 & 0xFFFFFFF) -end - -define xkeymap -print (struct keymap *) ($arg0 & 0xFFFFFFF) +define xtname +print XrmQuarkToString(((Object)($arg0))->object.xrm_name) end -define xlstream -print (struct lstream *) ($arg0 & 0xFFFFFFF) -end - -define xmarker -print (struct Lisp_Marker *) ($arg0 & 0xFFFFFFF) -end +# GDB's command language makes you want to ... -define xmenubardata -print (struct menubar_data *) ($arg0 & 0xFFFFFFF) -end - -define xopaque -print (struct Lisp_Opaque *) ($arg0 & 0xFFFFFFF) -end - -define xprocess -print (struct Lisp_Process *) ($arg0 & 0xFFFFFFF) +define pstruct + set $xstruct = (struct $arg0 *) $val + print $xstruct + print *$xstruct end -define xrangetab -print (struct Lisp_Range_Table *) ($arg0 & 0xFFFFFFF) -end - -define xspec -print (struct Lisp_Specifier *) ($arg0 & 0xFFFFFFF) -end - -define xstring -print (struct Lisp_String *) ($arg0 & 0xFFFFFFF) -output (char *) $arg0->_data -echo \n -end - -define xsubr -print (struct Lisp_Subr *) ($arg0 & 0xFFFFFFF) -end - -define xsubwindow -print (struct Lisp_Subwindow *) ($arg0 & 0xFFFFFFF) -end - -define xsymbol -set $tem = (struct Lisp_Symbol *) ($arg0 & 0xFFFFFFF) -output $tem->name->_data -printf "\n" -print $tem -end - -define xtoolbarbutton -print (struct toolbar_button *) ($arg0 & 0xFFFFFFF) -end - -define xtoolbardata -print (struct toolbar_data *) ($arg0 & 0xFFFFFFF) -end - -define xtooltalkmess -print (struct Lisp_Tooltalk_Message *) ($arg0 & 0xFFFFFFF) -end - -define xtooltalkpatt -print (struct Lisp_Tooltalk_Pattern *) ($arg0 & 0xFFFFFFF) -end - -define xvector -print (struct Lisp_Vector *) ($arg0 & 0xFFFFFFF) -end - -define xwindow -print (struct window *) ($arg0 & 0xFFFFFFF) -end - -define xwindowconfig -print (struct window_config *) ($arg0 & 0xFFFFFFF) -end - -define xrecord - print ((struct lrecord_header *) ($arg0 & 0xFFFFFFF)) - output (((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation->name) - echo \n - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_symbol - xsymbol $arg0 +define pobj + decode_object $arg0 + if $type == dbg_Lisp_Type_Int + printf "Integer: %d\n", $val + else + if $type == dbg_Lisp_Type_Char + if $val < 128 + printf "Char: %c\n", $val + else + printf "Char: %d\n", $val + end + else + if $type == dbg_Lisp_Type_String || $imp == lrecord_string + pstruct Lisp_String + else + if $type == dbg_Lisp_Type_Cons || $imp == lrecord_cons + pstruct Lisp_Cons + else + if $type == dbg_Lisp_Type_Symbol || $imp == lrecord_symbol + pstruct Lisp_Symbol + printf "Symbol name: %s\n", $xstruct->name->_data + else + if $type == dbg_Lisp_Type_Vector || $imp == lrecord_vector + pstruct Lisp_Vector + printf "Vector of length %d\n", $xstruct->size + #print *($xstruct->_data) @ $xstruct->size + else + if $imp == lrecord_bit_vector + pstruct Lisp_Bit_Vector + else + if $imp == lrecord_buffer + pstruct buffer + else + if $imp == lrecord_char_table + pstruct Lisp_Char_Table + else + if $imp == lrecord_char_table_entry + pstruct Lisp_Char_Table_Entry + else + if $imp == lrecord_charset + pstruct Lisp_Charset + else + if $imp == lrecord_coding_system + pstruct Lisp_Coding_System + else + if $imp == lrecord_color_instance + pstruct Lisp_Color_Instance + else + if $imp == lrecord_command_builder + pstruct command_builder + else + if $imp == lrecord_compiled_function + pstruct Lisp_Compiled_Function + else + if $imp == lrecord_console + pstruct console + else + if $imp == lrecord_database + pstruct database + else + if $imp == lrecord_device + pstruct device + else + if $imp == lrecord_event + pstruct Lisp_Event + else + if $imp == lrecord_extent + pstruct extent + else + if $imp == lrecord_extent_auxiliary + pstruct extent_auxiliary + else + if $imp == lrecord_extent_info + pstruct extent_info + else + if $imp == lrecord_face + pstruct Lisp_Face + else + if $imp == lrecord_float + pstruct Lisp_Float + else + if $imp == lrecord_font_instance + pstruct Lisp_Font_Instance + else + if $imp == lrecord_frame + pstruct frame + else + if $imp == lrecord_glyph + pstruct Lisp_Glyph + else + if $imp == lrecord_hashtable + pstruct hashtable + else + if $imp == lrecord_image_instance + pstruct Lisp_Image_Instance + else + if $imp == lrecord_keymap + pstruct keymap else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_extent - xextent $arg0 + if $imp == lrecord_lcrecord_list + pstruct lcrecord_list + else + if $imp == lrecord_lstream + pstruct lstream else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_marker - xmarker $arg0 + if $imp == lrecord_marker + pstruct Lisp_Marker + else + if $imp == lrecord_opaque + pstruct Lisp_Opaque else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_event - xevent $arg0 + if $imp == lrecord_opaque_list + pstruct Lisp_Opaque_List + else + if $imp == lrecord_popup_data + pstruct popup_data else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_buffer - xbuffer $arg0 + if $imp == lrecord_process + pstruct Lisp_Process + else + if $imp == lrecord_range_table + pstruct Lisp_Range_Table else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_window - xwindow $arg0 + if $imp == lrecord_specifier + pstruct Lisp_Specifier + else + if $imp == lrecord_subr + pstruct Lisp_Subr else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_frame - xframe $arg0 + if $imp == lrecord_symbol_value_buffer_local + pstruct symbol_value_buffer_local + else + if $imp == lrecord_symbol_value_forward + pstruct symbol_value_forward else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_device - xdevice $arg0 + if $imp == lrecord_symbol_value_lisp_magic + pstruct symbol_value_lisp_magic + else + if $imp == lrecord_symbol_value_varalias + pstruct symbol_value_varalias else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_console - xconsole $arg0 + if $imp == lrecord_toolbar_button + pstruct toolbar_button else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_process - xprocess $arg0 + if $imp == lrecord_toolbar_data + pstruct toolbar_data else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_subr - xsubr $arg0 + if $imp == lrecord_tooltalk_message + pstruct Lisp_Tooltalk_Message else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_compiled_function - xbytecode $arg0 + if $imp == lrecord_tooltalk_pattern + pstruct Lisp_Tooltalk_Pattern else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_window_configuration - xwindowconfig $arg0 + if $imp == lrecord_weak_list + pstruct weak_list else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_float - xfloat $arg0 + if $imp == lrecord_window + pstruct window + else + if $imp == lrecord_window_configuration + pstruct window_config else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_opaque - xopaque $arg0 - else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_glyph - xglyph $arg0 - else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_keymap - xkeymap $arg0 - else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_lstream - xlstream $arg0 - else - if ((struct lrecord_header *) ($arg0 & 0xFFFFFFF))->implementation == lrecord_bit_vector - xbitvec $arg0 + echo Unknown Lisp Object type\n + print $arg0 + # Barf, gag, retch + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end end end end @@ -286,124 +416,7 @@ end end -define frob - if (enum Lisp_Type) (($arg0 >> 28) & 7) == Lisp_Int - xint $arg0 - else - if (enum Lisp_Type) (($arg0 >> 28) & 7) == Lisp_String - xstring $arg0 - else - if (enum Lisp_Type) (($arg0 >> 28) & 7) == Lisp_Cons - xcons $arg0 - else - if (enum Lisp_Type) (($arg0 >> 28) & 7) == Lisp_Vector - xvector $arg0 - else - if (enum Lisp_Type) (($arg0 >> 28) & 7) == Lisp_Record - xrecord $arg0 - else - printf "Unknown type?\n" - end - end - end - end - end -end - -################ Miscellaneous - -define xtype -# this is really xgctype, as we mask off the mark bit -output (enum Lisp_Type) (($arg0 >> 28) & 7) -echo \n -end - -define xmarkbit -print ($arg0 >> 31) -end - -define nilp -print $arg0 == Qnil -end - -define xcar - frob ((struct Lisp_Cons *) ($arg0 & 0xFFFFFFF))->car -end - -define xcdr - frob ((struct Lisp_Cons *) ($arg0 & 0xFFFFFFF))->cdr -end - -set $vector_length_mask = ~(1<<31) - -define string-length - print ((struct Lisp_String *) ($arg0 & 0xFFFFFFF))->_size & $vector_length_mask -end - -define string-contents - print (char *) ((struct Lisp_String *) ($ & 0xFFFFFFF))->_data -end - -define vector-length - print ((struct Lisp_Vector *) ($ & 0xFFFFFFF))->size & $vector_length_mask +document pobj +Usage: pobj lisp_object +Print the internal C structure of a underlying Lisp Object. end - -define vector-contents -set $tem = (struct Lisp_Vector *) ($ & 0xFFFFFFF) -print *($tem->contents) @ ($tem->size & $vector_length_mask) -set $ = $tem->contents -end - -define symbol-name -set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->name -# output *($tem->_data) @ ($tem->_size & $vector_length_mask) -output ($tem->_data) -echo \n -set $type = Lisp_String -echo \n -end - -define symbol-value -set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->value -end - -define symbol-function -set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->function -end - -define symbol-plist -set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->plist -end - -define wtype -p $->core.widget_class->core_class.class_name -end - -define xtname -print XrmQuarkToString(((Object)($))->object.xrm_name) -end - -# -# GDB, with the losing command-line parser that it has, -# cannot handle nested blocks. -# -define breaks - -br Fsignal -# command -# bt 3 -# p sig -# xsymbol -# end - -br Fkill_emacs -# command -# bt 3 -# end - -br assertion_failed -# command -# bt 3 -# end - -end
--- a/src/gdbinit.pre-4.14 Mon Aug 13 10:27:41 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,299 +0,0 @@ -# Some useful commands for debugging XEmacs with gdb 4.* or better. -# If you have gdb 4.14 or better, you should use the version provided -# for that debugger -- it's much easier to use. See that file -# (called "gdbinit" in the src/ directory of the XEmacs 19.14+ distribution) -# for more info. -# -# Used on machines with NO_UNION_TYPE defined (everyone except DEC Alpha). - -set print union off -set print pretty off - -define temacs -run -batch -l loadup.el run-temacs -q -end - -echo \n>>> Use the `temacs' command to run temacs\n\n - -# if you use Purify, do this: -# set env PURIFYOPTIONS -pointer-mask=0x0fffffff - -# was frob, but p1 is short for prin1 -define p1 -call debug_print ($) -end - -define lbt -call Fbacktrace (Qexternal_debugging_output, Qt) -end - - -set $vector_length_mask = ~(1<<31) - -define xtype -# this is really xgctype, as we mask off the mark bit -output (enum Lisp_Type) (($ >> 28) & 7) -echo \n -end - -define xint -print ((int)($1 << 4))>>4 -end - -define xmarkbit -print ($1 >> 31) -end - -define xrecord -print (struct lrecord_header *) ($ & 0xFFFFFFF) -output *($->implementation) -echo \n -end - -define xbitvec -print (struct Lisp_Bit_Vector *) ($ & 0xFFFFFFF) -end - -define xbuffer -print (struct buffer *) ($ & 0xFFFFFFF) -end - -define xbytecode -print (struct Lisp_Bytecode *) ($ & 0xFFFFFFF) -end - -define xcharset -print (struct Lisp_Charset *) ($ & 0xFFFFFFF) -end - -define xchartab -print (struct Lisp_Char_Table *) ($ & 0xFFFFFFF) -end - -define xchartabentry -print (struct Lisp_Char_Table_Entry *) ($ & 0xFFFFFFF) -end - -define xcodesys -print (struct Lisp_Coding_System *) ($ & 0xFFFFFFF) -end - -define xcolorinst -print (struct Lisp_Color_Instance *) ($ & 0xFFFFFFF) -end - -define xcons -print (struct Lisp_Cons *) ($ & 0xFFFFFFF) -end - -define xcursor -print (struct Lisp_Cursor *) ($ & 0xFFFFFFF) -end - -define xdevice -print (struct device *) ($ & 0xFFFFFFF) -end - -define xevent -print (struct Lisp_Event *) ($ & 0xFFFFFFF) -end - -define xextent -print (struct extent *) ($ & 0xFFFFFFF) -end - -define xextentaux -print (struct extent_auxiliary *) ($ & 0xFFFFFFF) -end - -define xextentinfo -print (struct extent_info *) ($ & 0xFFFFFFF) -end - -define xfloat -print (struct Lisp_Float *) ($ & 0xFFFFFFF) -output (double) $->data.d -echo \n -end - -define xfontinst -print (struct Lisp_Font_Instance *) ($ & 0xFFFFFFF) -end - -define xframe -print (struct frame *) ($ & 0xFFFFFFF) -end - -define xglyph -print (struct Lisp_Glyph *) ($ & 0xFFFFFFF) -end - -define xhashtable -print (struct hashtable_struct *) ($ & 0xFFFFFFF) -end - -define ximageinst -print (struct Lisp_Image_Instance *) ($ & 0xFFFFFFF) -end - -define xkeymap -print (struct keymap *) ($ & 0xFFFFFFF) -end - -define xlstream -print (struct lstream *) ($ & 0xFFFFFFF) -end - -define xmarker -print (struct Lisp_Marker *) ($ & 0xFFFFFFF) -end - -define xmenubardata -print (struct menubar_data *) ($ & 0xFFFFFFF) -end - -define xopaque -print (struct Lisp_Opaque *) ($ & 0xFFFFFFF) -end - -define xprocess -print (struct Lisp_Process *) ($ & 0xFFFFFFF) -end - -define xrangetab -print (struct Lisp_Range_Table *) ($ & 0xFFFFFFF) -end - -define xspec -print (struct Lisp_Specifier *) ($ & 0xFFFFFFF) -end - -define xstring -print (struct Lisp_String *) ($ & 0xFFFFFFF) -output (char *) $->_data -echo \n -end - -define xsubr -print (struct Lisp_Subr *) ($ & 0xFFFFFFF) -end - -define xsubwindow -print (struct Lisp_Subwindow *) ($ & 0xFFFFFFF) -end - -define xtoolbarbutton -print (struct toolbar_button *) ($ & 0xFFFFFFF) -end - -define xtoolbardata -print (struct toolbar_data *) ($ & 0xFFFFFFF) -end - -define xtooltalkmess -print (struct Lisp_Tooltalk_Message *) ($ & 0xFFFFFFF) -end - -define xtooltalkpatt -print (struct Lisp_Tooltalk_Pattern *) ($ & 0xFFFFFFF) -end - -define xvector -print (struct Lisp_Vector *) ($ & 0xFFFFFFF) -end - -define xwindow -print (struct window *) ($ & 0xFFFFFFF) -end - -define xwindowconfig -print (struct window_config *) ($ & 0xFFFFFFF) -end - -define nilp -print $ == Qnil -end - -define car -set $tem = ((struct Lisp_Cons *) ($ & 0xFFFFFFF))->car -end - -define cdr -set $tem = ((struct Lisp_Cons *) ($ & 0xFFFFFFF))->cdr -end - -define string-length -print ((struct Lisp_String *) ($ & 0xFFFFFFF))->_size & $vector_length_mask -end - -define string-contents -print (char *) ((struct Lisp_String *) ($ & 0xFFFFFFF))->_data -end - -define vector-length -print ((struct Lisp_Vector *) ($ & 0xFFFFFFF))->size & $vector_length_mask -end - -define vector-contents -set $tem = (struct Lisp_Vector *) ($ & 0xFFFFFFF) -print *($tem->contents) @ ($tem->size & $vector_length_mask) -set $ = $tem->contents -end - -define symbol-name -set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->name -# output *($tem->_data) @ ($tem->_size & $vector_length_mask) -output ($tem->_data) -echo \n -set $type = Lisp_String -echo \n -end - -define xsymbol -symbol-name -end - -define symbol-value -set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->value -end - -define symbol-function -set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->function -end - -define symbol-plist -set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->plist -end - -define wtype -p $->core.widget_class->core_class.class_name -end - -define xtname -print XrmQuarkToString(((Object)($))->object.xrm_name) -end - -# -# GDB, with the losing command-line parser that it has, -# cannot handle nested blocks. -# -define breaks - -br Fsignal -# command -# bt 3 -# p sig -# xsymbol -# end - -br Fkill_emacs -# command -# bt 3 -# end - -br assertion_failed -# command -# bt 3 -# end - -end
--- a/src/gdbinit.union Mon Aug 13 10:27:41 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,301 +0,0 @@ -# some useful commands for debugging emacs with gdb 4.* or better -# used on machines without NO_UNION_TYPE defined (only the Alpha now?) - -set print union off -set print pretty off - -define temacs -run -batch -l loadup.el run-temacs -q -end - -echo \n>>> Use the `temacs' command to run temacs\n\n - -# if you use Purify, do this: -# set env PURIFYOPTIONS -pointer-mask=0x0fffffff - -# was frob, but p1 is short for prin1 -define p1 -#call = Fprin1 ($tem, Qexternal_debugging_output) -# compensate for GDB struct-passing bug -set debug_temp = $ -call debug_print (&debug_temp) -printf "\n" -end - -define lbt -# "&" to compensate for GDB struct-passing bug -# but I've removed the &'s because it doesn't work with my GDB, -# and not having them works fine. -call Fbacktrace (Qexternal_debugging_output, Qt) -end - - -set $vector_length_mask = ~(1<<31) - -define xtype -# this is really xgctype, as we mask off the mark bit -output (enum Lisp_Type) ($.gu.type) -echo \n -end - -define xint -print ((int)($.s.val << 4))>>4 -end - -define xmarkbit -print $.gu.markbit -end - -define xrecord -print (struct lrecord_header *) $.gu.val -output *($->implementation) -echo \n -end - -define xbitvec -print (struct Lisp_Bit_Vector *) ($.gu.val) -end - -define xbuffer -print (struct buffer *) ($.gu.val) -end - -define xbytecode -print (struct Lisp_Bytecode *) ($.gu.val) -end - -define xcharset -print (struct Lisp_Charset *) ($.gu.val) -end - -define xchartab -print (struct Lisp_Char_Table *) ($.gu.val) -end - -define xchartabentry -print (struct Lisp_Char_Table_Entry *) ($.gu.val) -end - -define xcodesys -print (struct Lisp_Coding_System *) ($.gu.val) -end - -define xcolorinst -print (struct Lisp_Color_Instance *) ($.gu.val) -end - -define xcons -print (struct Lisp_Cons *) ($.gu.val) -end - -define xcursor -print (struct Lisp_Cursor *) ($.gu.val) -end - -define xdevice -print (struct device *) ($.gu.val) -end - -define xevent -print (struct Lisp_Event *) ($.gu.val) -end - -define xextent -print (struct extent *) ($.gu.val) -end - -define xextentaux -print (struct extent_auxiliary *) ($.gu.val) -end - -define xextentinfo -print (struct extent_info *) ($.gu.val) -end - -define xfloat -print (struct Lisp_Float *) ($.gu.val) -output (double) $->data.d -echo \n -end - -define xfontinst -print (struct Lisp_Font_Instance *) ($.gu.val) -end - -define xframe -print (struct frame *) ($.gu.val) -end - -define xglyph -print (struct Lisp_Glyph *) ($.gu.val) -end - -define xhashtable -print (struct hashtable_struct *) ($.gu.val) -end - -define ximageinst -print (struct Lisp_Image_Instance *) ($.gu.val) -end - -define xkeymap -print (struct keymap *) ($.gu.val) -end - -define xlstream -print (struct lstream *) ($.gu.val) -end - -define xmarker -print (struct Lisp_Marker *) ($.gu.val) -end - -define xmenubardata -print (struct menubar_data *) ($.gu.val) -end - -define xopaque -print (struct Lisp_Opaque *) ($.gu.val) -end - -define xprocess -print (struct Lisp_Process *) ($.gu.val) -end - -define xrangetab -print (struct Lisp_Range_Table *) ($.gu.val) -end - -define xspec -print (struct Lisp_Specifier *) ($.gu.val) -end - -define xstring -print (struct Lisp_String *) ($.gu.val) -output (char *) $->_data -echo \n -end - -define xsubr -print (struct Lisp_Subr *) ($.gu.val) -end - -define xsubwindow -print (struct Lisp_Subwindow *) ($.gu.val) -end - -define xtoolbarbutton -print (struct toolbar_button *) ($.gu.val) -end - -define xtoolbardata -print (struct toolbar_data *) ($.gu.val) -end - -define xtooltalkmess -print (struct Lisp_Tooltalk_Message *) ($.gu.val) -end - -define xtooltalkpatt -print (struct Lisp_Tooltalk_Pattern *) ($.gu.val) -end - -define xvector -print (struct Lisp_Vector *) ($.gu.val) -end - -define xwindow -print (struct window *) ($.gu.val) -end - -define xwindowconfig -print (struct window_config *) ($.gu.val) -end - -define nilp -print $ == Qnil -end - -define car -set $tem = ((struct Lisp_Cons *) $.gu.val)->car -end - -define cdr -set $tem = ((struct Lisp_Cons *) $.gu.val)->cdr -end - -define string-length -print ((struct Lisp_String *) $.gu.val)->_size & $vector_length_mask -end - -define string-contents -print (char *) ((struct Lisp_String *) $.gu.val)->_data -end - -define vector-length -print ((struct Lisp_Vector *) $.gu.val)->size & $vector_length_mask -end - -define vector-contents -set $tem = (struct Lisp_Vector *) $.gu.val -print *($tem->contents) @ ($tem->size & $vector_length_mask) -set $ = $tem->contents -end - -define symbol-name -set $tem = ((struct Lisp_Symbol *) $.gu.val)->name -# output *($tem->_data) @ ($tem->_size & $vector_length_mask) -output ($tem->_data) -echo \n -set $type = Lisp_String -echo \n -end - -define xsymbol -symbol-name -end - -define symbol-value -set $tem = ((struct Lisp_Symbol *) $.gu.val)->value -end - -define symbol-function -set $tem = ((struct Lisp_Symbol *) $.gu.val)->function -end - -define symbol-plist -set $tem = ((struct Lisp_Symbol *) $.gu.val)->plist -end - -define wtype -p $->core.widget_class->core_class.class_name -end - -define xtname -print XrmQuarkToString(((Object)($))->object.xrm_name) -end - -# -# GDB, with the losing command-line parser that it has, -# cannot handle nested blocks. -# -define breaks - -br Fsignal -# command -# bt 3 -# p sig -# xsymbol -# end - -br Fkill_emacs -# command -# bt 3 -# end - -br assertion_failed -# command -# bt 3 -# end - -end
--- a/src/general.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/general.c Mon Aug 13 10:28:48 2007 +0200 @@ -119,6 +119,7 @@ Lisp_Object Qother; Lisp_Object Qpath; Lisp_Object Qpointer; +Lisp_Object Qpopup; Lisp_Object Qprint; Lisp_Object Qprocess; Lisp_Object Qprovide; @@ -135,6 +136,7 @@ Lisp_Object Qold_rassoc; Lisp_Object Qold_rassq; Lisp_Object Qsearch; +Lisp_Object Qsignal; Lisp_Object Qsimple; Lisp_Object Qsize; Lisp_Object Qspace; @@ -166,7 +168,6 @@ void syms_of_general (void) { - defsymbol (&Qminus, "-"); defsymbol (&Qactually_requested, "actually-requested"); defsymbol (&Qafter, "after"); defsymbol (&Qall, "all"); @@ -255,6 +256,7 @@ defsymbol (&Qother, "other"); defsymbol (&Qpath, "path"); defsymbol (&Qpointer, "pointer"); + defsymbol (&Qpopup, "popup"); defsymbol (&Qprint, "print"); defsymbol (&Qprocess, "process"); defsymbol (&Qprovide, "provide"); @@ -270,6 +272,7 @@ defsymbol (&Qold_rassoc, "old-rassoc"); defsymbol (&Qold_rassq, "old-rassq"); defsymbol (&Qsearch, "search"); + defsymbol (&Qsignal, "signal"); defsymbol (&Qsimple, "simple"); defsymbol (&Qsize, "size"); defsymbol (&Qspace, "space");
--- a/src/getloadavg.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/getloadavg.c Mon Aug 13 10:28:48 2007 +0200 @@ -80,7 +80,8 @@ #endif #ifdef XEMACS -#include "lisp.h" /* for encapsulated open, close, read, write */ +#include "lisp.h" +#include "sysfile.h" /* for encapsulated open, close, read, write */ #endif /* XEMACS */ /* Exclude all the code except the test program at the end
--- a/src/getpagesize.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/getpagesize.h Mon Aug 13 10:28:48 2007 +0200 @@ -26,7 +26,7 @@ #define HAVE_GETPAGESIZE #endif #endif - + #ifndef HAVE_GETPAGESIZE #ifdef HAVE_UNISTD_H
--- a/src/glyphs-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/glyphs-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -79,7 +79,7 @@ * we start paletizing this is no longer true. The X versions of * this function quantises to 256 colours or bit masks down to a * long. Windows can actually handle rgb triples in the raw so I - * don't see much point trying to optimise down to the best + * don't see much point trying to optimize down to the best * structure - unless it has memory / color allocation implications * .... */ bmp_info=xnew_and_zero (BITMAPINFO); @@ -95,26 +95,29 @@ /* bitmap data needs to be in blue, green, red triples - in that order, eimage is in RGB format so we need to convert */ - *bmp_data = xnew_array_and_zero (unsigned char, width * height * 3); + *bmp_data = xnew_array_and_zero (unsigned char, bpline * height); *bit_count = width * height * 3; if (!bmp_data) { - xfree(bmp_info); + xfree (bmp_info); return NULL; } - for (i=0; i<width*height; i++) - { - (*bmp_data)[2]=*pic; - (*bmp_data)[1]= pic[1]; - **bmp_data = pic[2]; - (*bmp_data) += 3; + + ip = pic; + for (i = height-1; i >= 0; i--) { + dp = (*bmp_data) + (i * bpline); + for (j = 0; j < width; j++) { + dp[2] =*ip++; + dp[1] =*ip++; + *dp =*ip++; + dp += 3; } + } } else /* scale to 256 colors */ { - int rd,gr,bl, j; - unsigned char *ip, *dp; + int rd,gr,bl; quant_table *qtable; int bpline= (int)(~3UL & (unsigned long)(width +3)); /* Quantize the image and get a histogram while we're at it. @@ -124,11 +127,11 @@ /* use our quantize table to allocate the colors */ ncolors = qtable->num_active_colors; - bmp_info=(BITMAPINFO*)xmalloc_and_zero(sizeof(BITMAPINFOHEADER) + + bmp_info=(BITMAPINFO*)xmalloc_and_zero (sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * ncolors); if (!bmp_info) { - xfree(qtable); + xfree (qtable); return NULL; } @@ -357,6 +360,7 @@ find_keyword_in_vector (instantiator, Q_file); IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap; + IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = bitmap; IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth; IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight; IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; @@ -380,8 +384,8 @@ COLORREF color; /* the american spelling virus hits again .. */ COLORREF* colortbl; - memset (&xpmimage, 0, sizeof (xpmimage)); - memset (&xpminfo, 0, sizeof (xpmimage)); + xzero (xpmimage); + xzero (xpminfo); result = XpmCreateXpmImageFromBuffer ((char*)buffer, &xpmimage, @@ -621,6 +625,12 @@ if (IMAGE_INSTANCE_MSWINDOWS_BITMAP (p)) DeleteObject (IMAGE_INSTANCE_MSWINDOWS_BITMAP (p)); IMAGE_INSTANCE_MSWINDOWS_BITMAP (p) = 0; + if (IMAGE_INSTANCE_MSWINDOWS_MASK (p)) + DeleteObject (IMAGE_INSTANCE_MSWINDOWS_MASK (p)); + IMAGE_INSTANCE_MSWINDOWS_MASK (p) = 0; + if (IMAGE_INSTANCE_MSWINDOWS_ICON (p)) + DestroyIcon (IMAGE_INSTANCE_MSWINDOWS_ICON (p)); + IMAGE_INSTANCE_MSWINDOWS_ICON (p) = 0; } xfree (p->data);
--- a/src/glyphs-msw.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/glyphs-msw.h Mon Aug 13 10:28:48 2007 +0200 @@ -38,19 +38,26 @@ struct mswindows_image_instance_data { HBITMAP bitmap; + HBITMAP mask; + HICON icon; }; #define MSWINDOWS_IMAGE_INSTANCE_DATA(i) \ ((struct mswindows_image_instance_data *) (i)->data) #define IMAGE_INSTANCE_MSWINDOWS_BITMAP(i) \ -(MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmap) -#define IMAGE_INSTANCE_MSWINDOWS_MASK(i) 0 + (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmap) +#define IMAGE_INSTANCE_MSWINDOWS_MASK(i) \ + (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->mask) +#define IMAGE_INSTANCE_MSWINDOWS_ICON(i) \ + (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->icon) #define XIMAGE_INSTANCE_MSWINDOWS_BITMAP(i) \ IMAGE_INSTANCE_MSWINDOWS_BITMAP (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_MSWINDOWS_MASK(i) \ IMAGE_INSTANCE_MSWINDOWS_MASK (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_MSWINDOWS_ICON(i) \ + IMAGE_INSTANCE_MSWINDOWS_ICON (XIMAGE_INSTANCE (i)) #endif /* HAVE_MS_WINDOWS */ #endif /* _XEMACS_GLYPHS_MSW_H_ */
--- a/src/glyphs-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/glyphs-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -149,27 +149,28 @@ /************************************************************************/ /* image instance methods */ /************************************************************************/ -DOESNT_RETURN -signal_image_error(CONST char *reason, Lisp_Object frob) +static DOESNT_RETURN +signal_image_error (CONST char *reason, Lisp_Object frob) { - signal_error (Qimage_conversion_error, list2 (build_translated_string (reason), frob)); + signal_error (Qimage_conversion_error, + list2 (build_translated_string (reason), frob)); } -DOESNT_RETURN -signal_image_error_2 (CONST char *reason, - Lisp_Object frob0, Lisp_Object frob1) +static DOESNT_RETURN +signal_image_error_2 (CONST char *reason, Lisp_Object frob0, Lisp_Object frob1) { - signal_error (Qimage_conversion_error, list3 (build_translated_string (reason), frob0, - frob1)); + signal_error (Qimage_conversion_error, + list3 (build_translated_string (reason), frob0, frob1)); } /************************************************************************/ /* convert from a series of RGB triples to an XImage formated for the */ /* proper display */ /************************************************************************/ -XImage * -convert_EImage_to_XImage(Lisp_Object device, int width, int height, unsigned char *pic, - unsigned long **pixtbl, int *pixcount, int *npixels) +static XImage * +convert_EImage_to_XImage (Lisp_Object device, int width, int height, + unsigned char *pic, unsigned long **pixtbl, + int *pixcount, int *npixels) { Display *dpy; Colormap cmap; @@ -210,10 +211,10 @@ data = (unsigned char *) xmalloc (outimg->bytes_per_line * height); if (!data) { - XDestroyImage(outimg); + XDestroyImage (outimg); return NULL; } - outimg->data = data; + outimg->data = (char *) data; if (vis->class == PseudoColor) { @@ -736,7 +737,7 @@ Lstream_close (costr); #endif Lstream_close (ostr); - + UNGCPRO; Lstream_delete (istr); Lstream_delete (ostr); @@ -748,7 +749,7 @@ report_file_error ("Writing temp file", list1 (build_string (filename_out))); } -#endif +#endif /* 0 */ /************************************************************************/ @@ -921,28 +922,26 @@ { Lisp_Object width, height, bits; - CHECK_CONS (data); - if (!CONSP (XCDR (data)) || !CONSP (XCDR (XCDR (data))) || + if (!CONSP (data) || + !CONSP (XCDR (data)) || + !CONSP (XCDR (XCDR (data))) || !NILP (XCDR (XCDR (XCDR (data))))) signal_simple_error ("Must be list of 3 elements", data); - width = XCAR (data); + width = XCAR (data); height = XCAR (XCDR (data)); - bits = XCAR (XCDR (XCDR (data))); - - if (!INTP (width) || !INTP (height) || !STRINGP (bits)) - signal_simple_error ("Must be (width height bits)", - vector3 (width, height, bits)); - - if (XINT (width) <= 0) - signal_simple_error ("Width must be > 0", width); - - if (XINT (height) <= 0) - signal_simple_error ("Height must be > 0", height); - - if (((unsigned) (XINT (width) * XINT (height)) / 8) - > string_char_length (XSTRING (bits))) - signal_simple_error ("data is too short for W and H", + bits = XCAR (XCDR (XCDR (data))); + + CHECK_STRING (bits); + + if (!NATNUMP (width)) + signal_simple_error ("Width must be a natural number", width); + + if (!NATNUMP (height)) + signal_simple_error ("Height must be a natural number", height); + + if (((XINT (width) * XINT (height)) / 8) > XSTRING_CHAR_LENGTH (bits)) + signal_simple_error ("data is too short for width and height", vector3 (width, height, bits)); } @@ -1705,7 +1704,7 @@ retry: - memset (&xpmattrs, 0, sizeof (xpmattrs)); /* want XpmInitAttributes() */ + xzero (xpmattrs); /* want XpmInitAttributes() */ xpmattrs.valuemask = XpmReturnPixels; if (force_mono) { @@ -2119,7 +2118,7 @@ our_fill_input_buffer (j_decompress_ptr cinfo) { /* Insert a fake EOI marker */ - struct jpeg_source_mgr *src = (struct jpeg_source_mgr *) cinfo->src; + struct jpeg_source_mgr *src = cinfo->src; static JOCTET buffer[2]; buffer[0] = (JOCTET) 0xFF; @@ -2163,14 +2162,15 @@ { } -typedef struct { +typedef struct +{ struct jpeg_source_mgr pub; } our_jpeg_source_mgr; static void jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *data, unsigned int len) { - struct jpeg_source_mgr *src = NULL; + struct jpeg_source_mgr *src; if (cinfo->src == NULL) { /* first time for this JPEG object? */ @@ -2256,7 +2256,7 @@ /* Step -1: First record our unwind-protect, which will clean up after any exit, normal or not */ - memset (&unwind, 0, sizeof (unwind)); + xzero (unwind); unwind.dpy = dpy; unwind.cmap = cmap; record_unwind_protect (jpeg_instantiate_unwind, make_opaque_ptr (&unwind)); @@ -2330,7 +2330,7 @@ stack data it might allocate. Need to be able to convert and write out to a file. */ GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len); - jpeg_memory_src (&cinfo, bytes, len); + jpeg_memory_src (&cinfo, (JOCTET *) bytes, len); } #endif @@ -2476,9 +2476,9 @@ * Here the array is only one element long, but you could ask for * more than one scanline at a time if that's more convenient. */ - (void) jpeg_read_scanlines (&cinfo, row_buffer, 1); - - for (i = 0; i < cinfo.output_width; i++) + jpeg_read_scanlines (&cinfo, row_buffer, 1); + + for (i = 0; i < (int) cinfo.output_width; i++) XPutPixel (unwind.ximage, i, scanline, /* Let's make sure we avoid getting bit like what happened for GIF's. It's probably the @@ -2738,7 +2738,7 @@ cmap = DEVICE_X_COLORMAP (XDEVICE(device)); vis = DEVICE_X_VISUAL (XDEVICE(device)); - memset (&unwind, 0, sizeof (unwind)); + xzero (unwind); unwind.dpy = dpy; unwind.cmap = cmap; record_unwind_protect (gif_instantiate_unwind, make_opaque_ptr (&unwind)); @@ -2803,9 +2803,9 @@ int res; XColor color; - color.red = cmo->Colors[i].Red << 8; + color.red = cmo->Colors[i].Red << 8; color.green = cmo->Colors[i].Green << 8; - color.blue = cmo->Colors[i].Blue << 8; + color.blue = cmo->Colors[i].Blue << 8; color.flags = DoRed | DoGreen | DoBlue; res = allocate_nearest_color (dpy, cmap, vis, &color); @@ -2983,7 +2983,7 @@ #ifndef USE_TEMP_FILES_FOR_PNG_IMAGES struct png_memory_storage { - Extbyte *bytes; /* The data */ + CONST Extbyte *bytes; /* The data */ Extcount len; /* How big is it? */ int index; /* Where are we? */ }; @@ -3017,16 +3017,16 @@ static struct png_error_struct png_err_stct; static void -png_error_func(png_structp png_ptr, png_const_charp message) +png_error_func (png_structp png_ptr, png_const_charp msg) { - png_err_stct.err_str = message; + 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 message) +png_warning_func (png_structp png_ptr, png_const_charp msg) { - warn_when_safe (Qpng, Qinfo, "%s", message); + warn_when_safe (Qpng, Qinfo, "%s", msg); } struct png_unwind_data @@ -3116,7 +3116,7 @@ signal_image_error ("Error obtaining memory for png_read", instantiator); } - memset (&unwind, 0, sizeof (unwind)); + xzero (unwind); unwind.png_ptr = png_ptr; unwind.info_ptr = info_ptr; unwind.dpy = dpy; @@ -3145,7 +3145,7 @@ /* Initialize the IO layer and read in header information */ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - Extbyte *bytes; + CONST Extbyte *bytes; Extcount len; struct png_memory_storage tbr; /* Data to be read */ @@ -3219,9 +3219,9 @@ { for (y = 0; y < 216; y++) { - static_color_cube[y].red = (y % 6) * 255.0 / 5; - static_color_cube[y].green = ((y / 6) % 6) * 255.0 / 5; - static_color_cube[y].blue = (y / 36) * 255.0 / 5; + static_color_cube[y].red = (png_byte) ((y % 6) * 255.0 / 5); + static_color_cube[y].green = (png_byte) (((y / 6) % 6) * 255.0 / 5); + static_color_cube[y].blue = (png_byte) ((y / 36) * 255.0 / 5); } png_set_dither (png_ptr, static_color_cube, 216, 216, NULL, 1); } @@ -3242,9 +3242,9 @@ for (y = 0; y < info_ptr->num_palette; y++) { int res; - color.red = info_ptr->palette[y].red << 8; + color.red = info_ptr->palette[y].red << 8; color.green = info_ptr->palette[y].green << 8; - color.blue = info_ptr->palette[y].blue << 8; + color.blue = info_ptr->palette[y].blue << 8; color.flags = DoRed | DoGreen | DoBlue; res = allocate_nearest_color (dpy, cmap, vis, &color); if (res > 0 && res < 3) @@ -3261,9 +3261,9 @@ for (y = 0; y < 216; y++) { int res; - color.red = static_color_cube[y].red << 8; + color.red = static_color_cube[y].red << 8; color.green = static_color_cube[y].green << 8; - color.blue = static_color_cube[y].blue << 8; + color.blue = static_color_cube[y].blue << 8; color.flags = DoRed|DoGreen|DoBlue; res = allocate_nearest_color (dpy, cmap, vis, &color); if (res > 0 && res < 3) @@ -3385,9 +3385,9 @@ png_color_16 my_background, *image_background; /* ### how do I get the background of the current frame? */ - my_background.red = 0x7fff; + my_background.red = 0x7fff; my_background.green = 0x7fff; - my_background.blue = 0x7fff; + my_background.blue = 0x7fff; if (png_get_bKGD (png_ptr, info_ptr, &image_background)) png_set_background (png_ptr, image_background, @@ -3526,7 +3526,7 @@ tiff_memory_storage *mem = (tiff_memory_storage*)data; if (size > (mem->len - mem->index)) - return -1; + return (size_t) -1; memcpy(buf, mem->bytes + mem->index, size); mem->index = mem->index + size; return size; @@ -3664,7 +3664,7 @@ dpy = DEVICE_X_DISPLAY (XDEVICE (device)); cmap = DEVICE_X_COLORMAP (XDEVICE(device)); - memset (&unwind, 0, sizeof (unwind)); + xzero (unwind); unwind.dpy = dpy; unwind.cmap = cmap; record_unwind_protect (tiff_instantiate_unwind, make_opaque_ptr (&unwind)); @@ -3708,7 +3708,7 @@ TIFFGetField (unwind.tiff, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField (unwind.tiff, TIFFTAG_IMAGELENGTH, &height); - unwind.eimage = xmalloc (width * height * 3); + unwind.eimage = (unsigned char *) xmalloc (width * height * 3); /* ### This is little more than proof-of-concept/function testing. It needs to be reimplimented via scanline reads for both memory @@ -4307,15 +4307,6 @@ /************************************************************************/ Lisp_Object Qsubwindowp; -static Lisp_Object mark_subwindow (Lisp_Object, void (*) (Lisp_Object)); -static void print_subwindow (Lisp_Object, Lisp_Object, int); -static void finalize_subwindow (void *, int); -static int subwindow_equal (Lisp_Object o1, Lisp_Object o2, int depth); -static unsigned long subwindow_hash (Lisp_Object obj, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("subwindow", subwindow, - mark_subwindow, print_subwindow, - finalize_subwindow, subwindow_equal, - subwindow_hash, struct Lisp_Subwindow); static Lisp_Object mark_subwindow (Lisp_Object obj, void (*markobj) (Lisp_Object)) @@ -4386,6 +4377,11 @@ return XSUBWINDOW (obj)->subwindow; } +DEFINE_LRECORD_IMPLEMENTATION ("subwindow", subwindow, + mark_subwindow, print_subwindow, + finalize_subwindow, subwindow_equal, + subwindow_hash, struct Lisp_Subwindow); + /* #### PROBLEM: The display routines assume that the glyph is only being displayed in one buffer. If it is in two different buffers which are both being displayed simultaneously you will lose big time. @@ -4491,7 +4487,7 @@ XSTRING_DATA (data), XSTRING_LENGTH (data)); - return (property); + return property; } DEFUN ("subwindowp", Fsubwindowp, 1, 1, 0, /* @@ -4500,7 +4496,7 @@ */ (object)) { - return (SUBWINDOWP (object) ? Qt : Qnil); + return SUBWINDOWP (object) ? Qt : Qnil; } DEFUN ("subwindow-width", Fsubwindow_width, 1, 1, 0, /* @@ -4510,7 +4506,7 @@ (subwindow)) { CHECK_SUBWINDOW (subwindow); - return (make_int (XSUBWINDOW (subwindow)->width)); + return make_int (XSUBWINDOW (subwindow)->width); } DEFUN ("subwindow-height", Fsubwindow_height, 1, 1, 0, /* @@ -4520,7 +4516,7 @@ (subwindow)) { CHECK_SUBWINDOW (subwindow); - return (make_int (XSUBWINDOW (subwindow)->height)); + return make_int (XSUBWINDOW (subwindow)->height); } DEFUN ("subwindow-xid", Fsubwindow_xid, 1, 1, 0, /* @@ -4530,7 +4526,7 @@ (subwindow)) { CHECK_SUBWINDOW (subwindow); - return (make_int (XSUBWINDOW (subwindow)->subwindow)); + return make_int (XSUBWINDOW (subwindow)->subwindow); } DEFUN ("resize-subwindow", Fresize_subwindow, 1, 3, 0, /*
--- a/src/glyphs.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/glyphs.c Mon Aug 13 10:28:48 2007 +0200 @@ -41,42 +41,31 @@ Lisp_Object Qimage_conversion_error; Lisp_Object Qglyphp, Qcontrib_p, Qbaseline; - Lisp_Object Qbuffer_glyph_p, Qpointer_glyph_p, Qicon_glyph_p; - Lisp_Object Qnothing_image_instance_p, Qtext_image_instance_p; Lisp_Object Qmono_pixmap_image_instance_p; Lisp_Object Qcolor_pixmap_image_instance_p; Lisp_Object Qpointer_image_instance_p; Lisp_Object Qsubwindow_image_instance_p; - Lisp_Object Qconst_glyph_variable; - -/* Qtext, Qpointer defined in general.c */ Lisp_Object Qmono_pixmap, Qcolor_pixmap, Qsubwindow; +Lisp_Object Q_file, Q_data, Q_face; +Lisp_Object Qicon; +Lisp_Object Qformatted_string; Lisp_Object Vcurrent_display_table; -/* Declared in faces.c */ -extern Lisp_Object Qdisplay_table; - Lisp_Object Vtruncation_glyph, Vcontinuation_glyph, Voctal_escape_glyph; Lisp_Object Vcontrol_arrow_glyph, Vinvisible_text_glyph, Vhscroll_glyph; Lisp_Object Vxemacs_logo; - Lisp_Object Vthe_nothing_vector; - -Lisp_Object Q_file, Q_data, Q_face; - -Lisp_Object Qicon; - -/* Qnothing, Qstring, Qinherit in general.c */ +Lisp_Object Vimage_instantiator_format_list; +Lisp_Object Vimage_instance_type_list; +Lisp_Object Vglyph_type_list; + DEFINE_IMAGE_INSTANTIATOR_FORMAT (nothing); DEFINE_IMAGE_INSTANTIATOR_FORMAT (inherit); DEFINE_IMAGE_INSTANTIATOR_FORMAT (string); DEFINE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); -Lisp_Object Qformatted_string; - -MAC_DEFINE (struct image_instantiator_methods *, MTiiformat_meth_or_given) typedef struct image_instantiator_format_entry image_instantiator_format_entry; struct image_instantiator_format_entry @@ -93,17 +82,13 @@ image_instantiator_format_entry_dynarr * the_image_instantiator_format_entry_dynarr; -Lisp_Object Vimage_instantiator_format_list; - -Lisp_Object Vimage_instance_type_list; - -Lisp_Object Vglyph_type_list; - static Lisp_Object allocate_image_instance (Lisp_Object device); static void image_validate (Lisp_Object instantiator); static void glyph_property_was_changed (Lisp_Object glyph, Lisp_Object property, Lisp_Object locale); +EXFUN (Fimage_instance_type, 1); +EXFUN (Fglyph_type, 1); /**************************************************************************** @@ -140,9 +125,7 @@ static int valid_image_instantiator_format_p (Lisp_Object format) { - if (decode_image_instantiator_format (format, ERROR_ME_NOT)) - return 1; - return 0; + return (decode_image_instantiator_format (format, ERROR_ME_NOT) != 0); } DEFUN ("valid-image-instantiator-format-p", @@ -150,15 +133,12 @@ Given an IMAGE-INSTANTIATOR-FORMAT, return non-nil if it is valid. Valid formats are some subset of 'nothing, 'string, 'formatted-string, 'xpm, 'xbm, 'xface, 'gif, 'jpeg, 'png, 'tiff, 'cursor-font, 'font, -'autodetect, and 'subwindow, depending on how XEmacs was -compiled. +'autodetect, and 'subwindow, depending on how XEmacs was compiled. */ (image_instantiator_format)) { - if (valid_image_instantiator_format_p (image_instantiator_format)) - return Qt; - else - return Qnil; + return valid_image_instantiator_format_p (image_instantiator_format) ? + Qt : Qnil; } DEFUN ("image-instantiator-format-list", @@ -476,12 +456,14 @@ instantiate a new instance of the pixmap and the file will no longer exist (e.g. w3 pixmaps are almost always from temporary files). */ - instantiator = IIFORMAT_METH_OR_GIVEN - (decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], - ERROR_ME), - normalize, (instantiator, contype), instantiator); - - return instantiator; + { + struct image_instantiator_methods * meths = + decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], + ERROR_ME); + return IIFORMAT_METH_OR_GIVEN (meths, normalize, + (instantiator, contype), + instantiator); + } } static Lisp_Object @@ -490,24 +472,19 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask) { - Lisp_Object ii; + Lisp_Object ii = allocate_image_instance (device); + struct image_instantiator_methods *meths; struct gcpro gcpro1; - ii = allocate_image_instance (device); - GCPRO1 (ii); - { - struct image_instantiator_methods *meths = - decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], - ERROR_ME); - - if (!HAS_IIFORMAT_METH_P (meths, instantiate)) - signal_simple_error - ("Don't know how to instantiate this image instantiator?", - instantiator); - IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg, - pointer_bg, dest_mask, domain)); - } + meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], + ERROR_ME); + if (!HAS_IIFORMAT_METH_P (meths, instantiate)) + signal_simple_error + ("Don't know how to instantiate this image instantiator?", + instantiator); + IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg, + pointer_bg, dest_mask, domain)); UNGCPRO; return ii; @@ -519,16 +496,7 @@ ****************************************************************************/ Lisp_Object Qimage_instancep; -static Lisp_Object mark_image_instance (Lisp_Object, void (*) (Lisp_Object)); -static void print_image_instance (Lisp_Object, Lisp_Object, int); -static void finalize_image_instance (void *, int); -static int image_instance_equal (Lisp_Object o1, Lisp_Object o2, int depth); -static unsigned long image_instance_hash (Lisp_Object obj, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("image-instance", image_instance, - mark_image_instance, print_image_instance, - finalize_image_instance, image_instance_equal, - image_instance_hash, - struct Lisp_Image_Instance); + static Lisp_Object mark_image_instance (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -782,12 +750,18 @@ 0)); } +DEFINE_LRECORD_IMPLEMENTATION ("image-instance", image_instance, + mark_image_instance, print_image_instance, + finalize_image_instance, image_instance_equal, + image_instance_hash, + struct Lisp_Image_Instance); + static Lisp_Object allocate_image_instance (Lisp_Object device) { struct Lisp_Image_Instance *lp = alloc_lcrecord_type (struct Lisp_Image_Instance, lrecord_image_instance); - Lisp_Object val = Qnil; + Lisp_Object val; zero_lcrecord (lp); lp->device = device; @@ -976,7 +950,7 @@ } DEFUN ("make-image-instance", Fmake_image_instance, 1, 4, 0, /* -Create a new `image-instance' object. +Return a new `image-instance' object. Image-instance objects encapsulate the way a particular image (pixmap, etc.) is displayed on a particular device. In most circumstances, you @@ -1468,10 +1442,8 @@ static Lisp_Object image_instantiate_cache_result (Lisp_Object locative) { - Lisp_Object instance = Fcar (locative); - Lisp_Object instantiator = Fcar (Fcdr (locative)); - Lisp_Object subtable = Fcdr (Fcdr (locative)); - Fputhash (instantiator, instance, subtable); + /* locative = (instance instantiator . subtable) */ + Fputhash (XCAR (XCDR (locative)), XCAR (locative), XCDR (XCDR (locative))); free_cons (XCONS (XCDR (locative))); free_cons (XCONS (locative)); return Qnil; @@ -1718,10 +1690,8 @@ LIST_LOOP (rest, possible_console_types) { - Lisp_Object newinst; Lisp_Object contype = XCAR (rest); - - newinst = call_with_suspended_errors + Lisp_Object newinst = call_with_suspended_errors ((lisp_fn_t) normalize_image_instantiator, Qnil, Qimage, ERROR_ME_NOT, 3, instantiator, contype, make_int (XIMAGE_SPECIFIER_ALLOWED (specifier))); @@ -1913,26 +1883,10 @@ * Glyph Object * ****************************************************************************/ -static Lisp_Object mark_glyph (Lisp_Object, void (*) (Lisp_Object)); -static void print_glyph (Lisp_Object, Lisp_Object, int); -static int glyph_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long glyph_hash (Lisp_Object obj, int depth); -static Lisp_Object glyph_getprop (Lisp_Object obj, Lisp_Object prop); -static int glyph_putprop (Lisp_Object obj, Lisp_Object prop, - Lisp_Object value); -static int glyph_remprop (Lisp_Object obj, Lisp_Object prop); -static Lisp_Object glyph_plist (Lisp_Object obj); -DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("glyph", glyph, - mark_glyph, print_glyph, 0, - glyph_equal, glyph_hash, - glyph_getprop, glyph_putprop, - glyph_remprop, glyph_plist, - struct Lisp_Glyph); - static Lisp_Object mark_glyph (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - struct Lisp_Glyph *glyph = XGLYPH (obj); + struct Lisp_Glyph *glyph = XGLYPH (obj); ((markobj) (glyph->image)); ((markobj) (glyph->contrib_p)); @@ -1995,7 +1949,7 @@ glyph_getprop (Lisp_Object obj, Lisp_Object prop) { struct Lisp_Glyph *g = XGLYPH (obj); - + if (EQ (prop, Qimage)) return g->image; if (EQ (prop, Qcontrib_p)) return g->contrib_p; if (EQ (prop, Qbaseline)) return g->baseline; @@ -2042,18 +1996,24 @@ static Lisp_Object glyph_plist (Lisp_Object obj) { - struct Lisp_Glyph *g = XGLYPH (obj); - Lisp_Object result = Qnil; - - /* backwards order; we reverse it below */ - result = Fcons (g->image, Fcons (Qimage, result)); - result = Fcons (g->contrib_p, Fcons (Qcontrib_p, result)); - result = Fcons (g->baseline, Fcons (Qbaseline, result)); - result = Fcons (g->face, Fcons (Qface, result)); - - return nconc2 (Fnreverse (result), g->plist); + struct Lisp_Glyph *glyph = XGLYPH (obj); + Lisp_Object result = glyph->plist; + + result = cons3 (Qface, glyph->face, result); + result = cons3 (Qbaseline, glyph->baseline, result); + result = cons3 (Qcontrib_p, glyph->contrib_p, result); + result = cons3 (Qimage, glyph->image, result); + + return result; } +DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("glyph", glyph, + mark_glyph, print_glyph, 0, + glyph_equal, glyph_hash, + glyph_getprop, glyph_putprop, + glyph_remprop, glyph_plist, + struct Lisp_Glyph); + Lisp_Object allocate_glyph (enum glyph_type type, void (*after_change) (Lisp_Object glyph, Lisp_Object property, @@ -2156,7 +2116,7 @@ } DEFUN ("make-glyph-internal", Fmake_glyph_internal, 0, 1, 0, /* -Create a new, uninitialized glyph. +Create and return a new uninitialized glyph or type TYPE. TYPE specifies the type of the glyph; this should be one of `buffer', `pointer', or `icon', and defaults to `buffer'. The type of the glyph @@ -2539,7 +2499,7 @@ /* #### This should be || !cachel->updated */ if (NILP (cachel->glyph) || !EQ (cachel->glyph, glyph)) { - Lisp_Object window = Qnil; + Lisp_Object window; XSETWINDOW (window, w); @@ -2559,7 +2519,7 @@ { struct glyph_cachel new_cachel; - memset (&new_cachel, 0, sizeof (struct glyph_cachel)); + xzero (new_cachel); new_cachel.glyph = Qnil; update_glyph_cachel_data (w, glyph, &new_cachel); @@ -2661,7 +2621,7 @@ struct Lisp_Vector * get_display_table (struct window *w, face_index findex) { - Lisp_Object tem = Qnil; + Lisp_Object tem; tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex); if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE)
--- a/src/glyphs.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/glyphs.h Mon Aug 13 10:28:48 2007 +0200 @@ -26,33 +26,32 @@ #include "specifier.h" -/***************************************************************************** - * Image Instantiators * - *****************************************************************************/ +/************************************************************************/ +/* Image Instantiators */ +/************************************************************************/ struct image_instantiator_methods; /* Remember the distinction between image instantiator formats and image instance types. Here's an approximate mapping: - image instantiator format image instance type - ------------------------- ------------------- - nothing nothing - string text - formatted-string text - xbm mono-pixmap, color-pixmap, pointer - xpm color-pixmap, mono-pixmap, pointer - xface mono-pixmap, color-pixmap, pointer - gif color-pixmap - jpeg color-pixmap - png color-pixmap - tiff color-pixmap - cursor-font pointer - font pointer - subwindow subwindow - inherit mono-pixmap - autodetect mono-pixmap, color-pixmap, pointer, - text + image instantiator format image instance type + ------------------------- ------------------- + nothing nothing + string text + formatted-string text + xbm mono-pixmap, color-pixmap, pointer + xpm color-pixmap, mono-pixmap, pointer + xface mono-pixmap, color-pixmap, pointer + gif color-pixmap + jpeg color-pixmap + png color-pixmap + tiff color-pixmap + cursor-font pointer + font pointer + subwindow subwindow + inherit mono-pixmap + autodetect mono-pixmap, color-pixmap, pointer, text */ /* These are methods specific to a particular format of image instantiator @@ -120,19 +119,12 @@ IIFORMAT_METH (_maybe_iiformat_meth_mstruc, m, args); \ } while (0) -MAC_DECLARE_EXTERN (struct image_instantiator_methods *, - MTiiformat_meth_or_given) - /* Call a specifier method, if it exists; otherwise return the specified value */ -#define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ -MAC_BEGIN \ - MAC_DECLARE (struct image_instantiator_methods *, \ - MTiiformat_meth_or_given, mstruc) \ - HAS_IIFORMAT_METH_P (MTiiformat_meth_or_given, m) ? \ - IIFORMAT_METH (MTiiformat_meth_or_given, m, args) : (given) \ -MAC_END +#define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ + (HAS_IIFORMAT_METH_P (mstruc, m) ? \ + IIFORMAT_METH (mstruc, m, args) : (given)) /***** Defining new image-instantiator types *****/ @@ -145,7 +137,7 @@ #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \ do { \ format##_image_instantiator_methods = \ - xnew_and_zero (struct image_instantiator_methods); \ + xnew_and_zero (struct image_instantiator_methods); \ defsymbol (&Q##format, obj_name); \ format##_image_instantiator_methods->symbol = Q##format; \ format##_image_instantiator_methods->keywords = \ @@ -186,10 +178,6 @@ entry); \ } while (0) -extern Lisp_Object Qimage_conversion_error; - -extern Lisp_Object Q_data, Q_file; - void add_entry_to_image_instantiator_format_list (Lisp_Object symbol, struct image_instantiator_methods *meths); Lisp_Object find_keyword_in_vector (Lisp_Object vector, @@ -203,12 +191,11 @@ int given_dest_mask, int desired_dest_mask)); -/***************************************************************************** - * Image Specifier Object * - *****************************************************************************/ +/************************************************************************/ +/* Image Specifier Object */ +/************************************************************************/ DECLARE_SPECIFIER_TYPE (image); -extern Lisp_Object Qimage; #define XIMAGE_SPECIFIER(x) XSPECIFIER_TYPE (x, image) #define XSETIMAGE_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, image) #define IMAGE_SPECIFIERP(x) SPECIFIER_TYPEP (x, image) @@ -234,9 +221,9 @@ #define XIMAGE_SPECIFIER_ALLOWED(g) \ IMAGE_SPECIFIER_ALLOWED (XIMAGE_SPECIFIER (g)) -/***************************************************************************** - * Image Instance Object * - *****************************************************************************/ +/************************************************************************/ +/* Image Instance Object */ +/************************************************************************/ DECLARE_LRECORD (image_instance, struct Lisp_Image_Instance); #define XIMAGE_INSTANCE(x) \ @@ -265,12 +252,6 @@ #define IMAGE_POINTER_MASK (1 << 4) #define IMAGE_SUBWINDOW_MASK (1 << 5) -extern Lisp_Object Qnothing_image_instance_p, Qtext_image_instance_p; -extern Lisp_Object Qmono_pixmap_image_instance_p; -extern Lisp_Object Qcolor_pixmap_image_instance_p; -extern Lisp_Object Qpointer_image_instance_p; -extern Lisp_Object Qsubwindow_image_instance_p; - #define IMAGE_INSTANCE_TYPE_P(ii, type) \ (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type) @@ -406,9 +387,9 @@ #define XIMAGE_INSTANCE_PIXMAP_BG(i) \ IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i)) -/***************************************************************************** - * Glyph Object * - *****************************************************************************/ +/************************************************************************/ +/* Glyph Object */ +/************************************************************************/ enum glyph_type { @@ -444,8 +425,6 @@ #define CHECK_GLYPH(x) CHECK_RECORD (x, glyph) #define CONCHECK_GLYPH(x) CONCHECK_RECORD (x, glyph) -extern Lisp_Object Qbuffer_glyph_p, Qpointer_glyph_p, Qicon_glyph_p; - #define CHECK_BUFFER_GLYPH(x) do { \ CHECK_GLYPH (x); \ if (XGLYPH (x)->type != GLYPH_BUFFER) \ @@ -476,8 +455,10 @@ #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g)) #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g)) -extern Lisp_Object Vtruncation_glyph, Vcontinuation_glyph, Voctal_escape_glyph; -extern Lisp_Object Vcontrol_arrow_glyph, Vinvisible_text_glyph, Vhscroll_glyph; +extern Lisp_Object Q_data, Q_file, Qconst_glyph_variable; +extern Lisp_Object Qimage_conversion_error; +extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; +extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; extern Lisp_Object Vxemacs_logo; unsigned short glyph_width (Lisp_Object glyph, Lisp_Object frame_face, @@ -512,9 +493,9 @@ Lisp_Object property, Lisp_Object locale)); -/***************************************************************************** - * Glyph Cachels * - *****************************************************************************/ +/************************************************************************/ +/* Glyph Cachels */ +/************************************************************************/ typedef struct glyph_cachel glyph_cachel; struct glyph_cachel @@ -534,15 +515,15 @@ #define OCT_ESC_GLYPH_INDEX (glyph_index) 4 #define INVIS_GLYPH_INDEX (glyph_index) 5 -#define GLYPH_CACHEL(window, index) \ +#define GLYPH_CACHEL(window, index) \ Dynarr_atp (window->glyph_cachels, index) -#define GLYPH_CACHEL_GLYPH(window, index) \ +#define GLYPH_CACHEL_GLYPH(window, index) \ Dynarr_atp (window->glyph_cachels, index)->glyph -#define GLYPH_CACHEL_WIDTH(window, index) \ +#define GLYPH_CACHEL_WIDTH(window, index) \ Dynarr_atp (window->glyph_cachels, index)->width -#define GLYPH_CACHEL_ASCENT(window, index) \ +#define GLYPH_CACHEL_ASCENT(window, index) \ Dynarr_atp (window->glyph_cachels, index)->ascent -#define GLYPH_CACHEL_DESCENT(window, index) \ +#define GLYPH_CACHEL_DESCENT(window, index) \ Dynarr_atp (window->glyph_cachels, index)->descent void mark_glyph_cachels (glyph_cachel_dynarr *elements, @@ -554,9 +535,9 @@ struct overhead_stats *ovstats); #endif /* MEMORY_USAGE_STATS */ -/***************************************************************************** - * Display Tables * - *****************************************************************************/ +/************************************************************************/ +/* Display Tables */ +/************************************************************************/ #define DISP_TABLE_SIZE 256 #define DISP_CHAR_ENTRY(dp, c) ((c < (dp)->size) ? (dp)->contents[c] : Qnil)
--- a/src/gmalloc.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/gmalloc.c Mon Aug 13 10:28:48 2007 +0200 @@ -78,11 +78,7 @@ #endif #endif -#if defined(__GNU_LIBRARY__) || defined(__STDC__) #include <limits.h> -#else -#define CHAR_BIT 8 -#endif #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -96,32 +92,13 @@ { #endif -/* #### XEmacs change for Solaris */ -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) || \ - (defined (__STDC__) && defined (SOLARIS2)) || defined (WINDOWSNT) #undef __P #define __P(args) args #undef __ptr_t #define __ptr_t void * -#else /* Not C++ or ANSI C. */ -#undef __P -#define __P(args) () -#undef const -#define const -#undef __ptr_t -#define __ptr_t char * -#endif /* C++ or ANSI C. */ -#ifdef __STDC__ #include <stddef.h> #define __malloc_size_t size_t -#else -#ifdef OSF1 /* from grunwald@foobar.cs.colorado.edu */ -#define __malloc_size_t unsigned long -#else -#define __malloc_size_t unsigned int -#endif -#endif #ifndef NULL #define NULL 0
--- a/src/gpmevent.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/gpmevent.c Mon Aug 13 10:28:48 2007 +0200 @@ -2,14 +2,12 @@ #include <config.h> #include "lisp.h" +#include "console.h" #include "console-tty.h" #include "device.h" #include "events.h" #include "events-mod.h" -#include "process.h" #include "sysdep.h" -#include "sysproc.h" /* select stuff */ -#include "systime.h" #ifdef HAVE_GPM #include "gpmevent.h" @@ -20,23 +18,23 @@ #define KG_CTRL 2 #define KG_ALT 3 #else -#include <linux/keyboard.h> +#include <linux/keyboard.h> #endif -int handle_gpm_read(struct Lisp_Event *event, struct console *con, int fd) +int +handle_gpm_read (struct Lisp_Event *event, struct console *con, int fd) { Gpm_Event ev; - int modifiers,type,button; - - type = -1; - button = 1; + int modifiers = 0; + int type = -1; + int button = 1; if (!Gpm_GetEvent(&ev)) - return(0); - - event->timestamp = 0; - event->channel = CONSOLE_SELECTED_FRAME (con); - + return 0; + + event->timestamp = 0; + event->channel = CONSOLE_SELECTED_FRAME (con); + /* Whow, wouldn't named defines be NICE!?!?! */ modifiers = 0; @@ -64,9 +62,8 @@ switch (type) { case GPM_DOWN: case GPM_UP: - if (type == GPM_DOWN) - event->event_type = button_press_event; - else event->event_type = button_release_event; + event->event_type = + type == GPM_DOWN ? button_press_event : button_release_event; event->event.button.x = ev.x; event->event.button.y = ev.y; event->event.button.button = button; @@ -78,12 +75,13 @@ event->event.motion.y = ev.y; event->event.motion.modifiers = modifiers; default: - return (0); + return 0; } - return (1); + return 1; } -void connect_to_gpm(struct console *con) +void +connect_to_gpm (struct console *con) { /* Only do this if we are running after dumping and really interactive */ if (!noninteractive && initialized) {
--- a/src/gpmevent.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/gpmevent.h Mon Aug 13 10:28:48 2007 +0200 @@ -1,7 +1,7 @@ #ifndef _HAVE_GPM #define _HAVE_GPM -int handle_gpm_read(struct Lisp_Event *event, struct console *con, int fd); -void connect_to_gpm(struct console *con); +int handle_gpm_read (struct Lisp_Event *event, struct console *con, int fd); +void connect_to_gpm (struct console *con); #endif
--- a/src/gui-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/gui-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -44,7 +44,6 @@ /* we need a unique id for each popup menu, dialog box, and scrollbar */ static unsigned int lwlib_id_tick; -LWLIB_ID new_lwlib_id (void); LWLIB_ID new_lwlib_id (void) { @@ -61,11 +60,6 @@ #ifdef HAVE_POPUPS -static Lisp_Object mark_popup_data (Lisp_Object obj, - void (*markobj) (Lisp_Object)); -DEFINE_LRECORD_IMPLEMENTATION ("popup-data", popup_data, - mark_popup_data, internal_object_printer, - 0, 0, 0, struct popup_data); struct mark_widget_value_closure { @@ -112,6 +106,10 @@ return data->last_menubar_buffer; } +DEFINE_LRECORD_IMPLEMENTATION ("popup-data", popup_data, + mark_popup_data, internal_object_printer, + 0, 0, 0, struct popup_data); + /* This is like FRAME_MENUBAR_DATA (f), but contains an alist of (id . popup-data) for GCPRO'ing the callbacks of the popup menus and dialog boxes. */ @@ -122,7 +120,7 @@ { struct popup_data *pdata; Lisp_Object lid = make_int (id); - Lisp_Object lpdata = Qnil; + Lisp_Object lpdata; assert (NILP (assq_no_quit (lid, Vpopup_callbacks))); pdata = alloc_lcrecord_type (struct popup_data, lrecord_popup_data); @@ -229,7 +227,7 @@ { Lisp_Object fn, arg; Lisp_Object data; - Lisp_Object frame = Qnil; + Lisp_Object frame; struct device *d = get_device_from_display (XtDisplay (widget)); struct frame *f = x_any_widget_or_parent_to_frame (d, widget); @@ -325,7 +323,7 @@ using "===" in menubars to get double-etched lines */ if (*p == '!' || *p == '\0') return ((first == '-') - ? NULL /* single etched is the default */ + ? NULL /* single etched is the default */ : xstrdup ("shadowDoubleEtchedIn")); else if (*p == ':') return xstrdup (p+1); @@ -456,7 +454,7 @@ { CONST char *const_bogosity; Lisp_Object suffix2; - + /* Shortcut to avoid evaluating suffix each time */ if (STRINGP (suffix)) suffix2 = suffix;
--- a/src/gui-x.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/gui-x.h Mon Aug 13 10:28:48 2007 +0200 @@ -28,7 +28,7 @@ widget_value *xmalloc_widget_value (void); -extern LWLIB_ID new_lwlib_id (void); +LWLIB_ID new_lwlib_id (void); #ifdef HAVE_POPUPS
--- a/src/gui.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/gui.c Mon Aug 13 10:28:48 2007 +0200 @@ -57,14 +57,13 @@ first = s[0]; if (first != '-' && first != '=') return 0; - for (p = s; *p == first; p++); + for (p = s; *p == first; p++) + ; - if (*p == '!' || *p == ':' || *p == '\0') - return 1; - return 0; + return (*p == '!' || *p == ':' || *p == '\0'); } -/* +/* * Initialize the gui_item structure by setting all (GC-protected) * fields to their default values. The defaults are t for :active and * :included values, and nil for others. @@ -72,16 +71,16 @@ void gui_item_init (struct gui_item *pgui_item) { - pgui_item->name = Qnil; + pgui_item->name = Qnil; pgui_item->callback = Qnil; - pgui_item->suffix = Qnil; - pgui_item->active = Qt; + pgui_item->suffix = Qnil; + pgui_item->active = Qt; pgui_item->included = Qt; - pgui_item->config = Qunbound; - pgui_item->filter = Qnil; - pgui_item->style = Qnil; + pgui_item->config = Qunbound; + pgui_item->filter = Qnil; + pgui_item->style = Qnil; pgui_item->selected = Qnil; - pgui_item->keys = Qnil; + pgui_item->keys = Qnil; } /* @@ -89,31 +88,23 @@ * structure. If KEY is not a keyword, or is an unknown keyword, then * error is signaled. */ -void +void gui_item_add_keyval_pair (struct gui_item *pgui_item, Lisp_Object key, Lisp_Object val) { if (!KEYWORDP (key)) - error ("Not a keyword %S in gui item %S", key, pgui_item->name); + signal_simple_error_2 ("Non-keyword in gui item", key, pgui_item->name); - if (EQ (key, Q_suffix)) - pgui_item->suffix = val; - else if (EQ (key, Q_active)) - pgui_item->active = val; - else if (EQ (key, Q_included)) - pgui_item->included = val; - else if (EQ (key, Q_config)) - pgui_item->config = val; - else if (EQ (key, Q_filter)) - pgui_item->filter = val; - else if (EQ (key, Q_style)) - pgui_item->style = val; - else if (EQ (key, Q_selected)) - pgui_item->selected = val; - else if (EQ (key, Q_keys)) - pgui_item->keys = val; + if (EQ (key, Q_suffix)) pgui_item->suffix = val; + else if (EQ (key, Q_active)) pgui_item->active = val; + else if (EQ (key, Q_included)) pgui_item->included = val; + else if (EQ (key, Q_config)) pgui_item->config = val; + else if (EQ (key, Q_filter)) pgui_item->filter = val; + else if (EQ (key, Q_style)) pgui_item->style = val; + else if (EQ (key, Q_selected)) pgui_item->selected = val; + else if (EQ (key, Q_keys)) pgui_item->keys = val; else - error ("Unknown keyword %S in gui item %S", key, pgui_item->name); + signal_simple_error_2 ("Unknown keyword in gui item", key, pgui_item->name); } /* @@ -167,7 +158,7 @@ Lisp_Object val = contents [i++]; gui_item_add_keyval_pair (pgui_item, key, val); } - } + } } /* @@ -178,7 +169,7 @@ gui_item_active_p (CONST struct gui_item *pgui_item) { /* This function can call lisp */ - + /* Shortcut to avoid evaluating Qt each time */ return (EQ (pgui_item->active, Qt) || !NILP (Feval (pgui_item->active))); @@ -210,12 +201,12 @@ static DOESNT_RETURN signal_too_long_error (Lisp_Object name) { - error ("GUI item %s produces too long displayable string", name); + signal_simple_error ("GUI item produces too long displayable string", name); } /* - * Format "left flush" display portion of an item into BUF, guarded by - * maximum buffer size BUF_LEN. BUF_LEN does not count for terminating + * Format "left flush" display portion of an item into BUF, guarded by + * maximum buffer size BUF_LEN. BUF_LEN does not count for terminating * null character, so actual maximum size of buffer consumed is * BUF_LEN + 1 bytes. If buffer is not big enough, then error is * signaled. @@ -224,46 +215,45 @@ */ unsigned int gui_item_display_flush_left (CONST struct gui_item *pgui_item, - char* buf, unsigned int buf_len) + char* buf, Bytecount buf_len) { - unsigned int consumed; + char *p = buf; + Bytecount len; /* Copy item name first */ CHECK_STRING (pgui_item->name); - if (XSTRING_LENGTH (pgui_item->name) > buf_len) + len = XSTRING_LENGTH (pgui_item->name); + if (len > buf_len) signal_too_long_error (pgui_item->name); - strcpy (buf, XSTRING_DATA (pgui_item->name)); - buf += (consumed = XSTRING_LENGTH (pgui_item->name)); - buf_len -= consumed; + memcpy (p, XSTRING_DATA (pgui_item->name), len); + p += len; /* Add space and suffix, if there is a suffix. - * If suffix is not string evaluate it */ + * If suffix is not string evaluate it */ if (!NILP (pgui_item->suffix)) { - Lisp_Object suffix2; - + Lisp_Object suffix = pgui_item->suffix; /* Shortcut to avoid evaluating suffix each time */ - if (STRINGP (pgui_item->suffix)) - suffix2 = pgui_item->suffix; - else + if (!STRINGP (suffix)) { - suffix2 = Feval (pgui_item->suffix); - CHECK_STRING (suffix2); + suffix = Feval (suffix); + CHECK_STRING (suffix); } - - if (XSTRING_LENGTH (suffix2) + 1 > buf_len) + + len = XSTRING_LENGTH (suffix); + if (p + len + 1 > buf + buf_len) signal_too_long_error (pgui_item->name); - *(buf++) = ' '; - strcpy (buf, XSTRING_DATA (suffix2)); - consumed += XSTRING_LENGTH (suffix2) + 1; + *(p++) = ' '; + memcpy (p, XSTRING_DATA (suffix), len); + p += len; } - - return consumed; + *p = '\0'; + return p - buf; } /* - * Format "right flush" display portion of an item into BUF, guarded by - * maximum buffer size BUF_LEN. BUF_LEN does not count for terminating + * Format "right flush" display portion of an item into BUF, guarded by + * maximum buffer size BUF_LEN. BUF_LEN does not count for terminating * null character, so actual maximum size of buffer consumed is * BUF_LEN + 1 bytes. If buffer is not big enough, then error is * signaled. @@ -272,7 +262,7 @@ */ unsigned int gui_item_display_flush_right (CONST struct gui_item *pgui_item, - char* buf, unsigned int buf_len) + char* buf, Bytecount buf_len) { *buf = 0; @@ -286,7 +276,7 @@ CHECK_STRING (pgui_item->keys); if (XSTRING_LENGTH (pgui_item->keys) > buf_len) signal_too_long_error (pgui_item->name); - strcpy (buf, XSTRING_DATA (pgui_item->keys)); + strcpy (buf, (CONST char *) XSTRING_DATA (pgui_item->keys)); return XSTRING_LENGTH (pgui_item->keys); } @@ -294,7 +284,7 @@ if (SYMBOLP (pgui_item->callback)) { char buf2 [1024]; - unsigned int len; + Bytecount len; where_is_to_char (pgui_item->callback, buf2); len = strlen (buf2);
--- a/src/gui.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/gui.h Mon Aug 13 10:28:48 2007 +0200 @@ -56,7 +56,7 @@ * Rather than build a long chain of individual gcpro structs * that protect the slots individually, we protect all the * member slots by pretending the struct is an array. ANSI C - * requires tihs hack to work, ugly though it is. + * requires this hack to work, ugly though it is. */ #define GCPRO_GUI_ITEM(pgui_item) \ do { \ @@ -65,6 +65,9 @@ gcpro1.nvars = GUI_ITEM_GCPRO_COUNT; \ } while (0); +extern Lisp_Object Q_accelerator, Q_active, Q_config, Q_filter, Q_included; +extern Lisp_Object Q_keys, Q_selected, Q_suffix, Qradio, Qtoggle; + void gui_item_init (struct gui_item *pgui_item); void gui_item_add_keyval_pair (struct gui_item *pgui_item, Lisp_Object key, Lisp_Object val); @@ -72,9 +75,9 @@ int gui_item_active_p (CONST struct gui_item *pgui_item); int gui_item_included_p (CONST struct gui_item *pgui_item, Lisp_Object into); unsigned int gui_item_display_flush_left (CONST struct gui_item *pgui_item, - char* buf, unsigned int buf_len); + char* buf, Bytecount buf_len); unsigned int gui_item_display_flush_right (CONST struct gui_item *pgui_item, - char* buf, unsigned int buf_len); + char* buf, Bytecount buf_len); #endif /* HAVE_POPUPS */
--- a/src/hash.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/hash.c Mon Aug 13 10:28:48 2007 +0200 @@ -35,7 +35,7 @@ #include "hash.h" #include "elhash.h" -static CONST int +static CONST unsigned int primes []={ 13, 29, 37, 47, 59, 71, 89, 107, 131, 163, 197, 239, 293, 353, 431, 521, 631, @@ -53,13 +53,13 @@ string_hash (CONST void *xv) { unsigned int h = 0; - unsigned int g; unsigned CONST char *x = (unsigned CONST char *) xv; if (!x) return 0; while (*x != 0) { + unsigned int g; h = (h << 4) + *x++; if ((g = h & 0xf0000000) != 0) h = (h ^ (g >> 24)) ^ g; @@ -69,16 +69,16 @@ } unsigned long -memory_hash (CONST void *xv, int size) +memory_hash (CONST void *xv, size_t size) { unsigned int h = 0; - unsigned int g; unsigned CONST char *x = (unsigned CONST char *) xv; if (!x) return 0; while (size > 0) { + unsigned int g; h = (h << 4) + *x++; if ((g = h & 0xf0000000) != 0) h = (h ^ (g >> 24)) ^ g; @@ -100,14 +100,15 @@ } +/* ### Ever heard of binary search? */ static unsigned int prime_size (unsigned int size) { - unsigned int i; - CONST int lim = countof (primes); - for (i = 0; i < lim; i++) - if (size <= primes [i]) return primes [i]; - return primes [lim - 1]; + int i; + for (i = 0; i < countof (primes); i++) + if (size <= primes [i]) + return primes [i]; + return primes [countof (primes) - 1]; } static void rehash (hentry *harray, c_hashtable ht, unsigned int size); @@ -307,8 +308,8 @@ void expand_hashtable (c_hashtable hash, unsigned int needed_size) { - unsigned int hsize = hash->size; - int comfortable_size = (13 * needed_size) / 10; + size_t hsize = hash->size; + size_t comfortable_size = (13 * needed_size) / 10; if (hsize < comfortable_size) grow_hashtable (hash, comfortable_size + 1); }
--- a/src/hash.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/hash.h Mon Aug 13 10:28:48 2007 +0200 @@ -31,7 +31,7 @@ hentry *harray; long zero_set; void *zero_entry; - unsigned int size; /* size of the hasharray */ + size_t size; /* size of the hasharray */ unsigned int fullness; /* number of entries in the hashtable */ unsigned long (*hash_function) (CONST void *); int (*test_function) (CONST void *, CONST void *);
--- a/src/hpplay.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/hpplay.c Mon Aug 13 10:28:48 2007 +0200 @@ -36,7 +36,7 @@ directory of the audio software delivered on our machines. The path I found it under was /usr/audio/examples/player.c This file contained no credits and no copyrights. The original fileheader - is given below. + is given below. HISTORY lynbech - Feb 10, 1993: Created. ***/ @@ -48,9 +48,11 @@ * (well, only two are unsung) */ +#include <config.h> +#include "lisp.h" + #include <stdlib.h> #include <stdio.h> -#include <config.h> /* to get system rev level. */ #ifdef HPUX10 #include <Alib.h> #include <CUlib.h> @@ -59,10 +61,6 @@ #include <audio/CUlib.h> #endif /* !HPUX 10 */ -/* New Symbols */ -#include <config.h> -#include "lisp.h" - Lisp_Object Vhp_play_server; Lisp_Object Vhp_play_speaker; int play_gain; @@ -113,7 +111,7 @@ if (SYMBOLP (Vhp_play_speaker)) { speaker = (char *) (string_data (XSYMBOL (Vhp_play_speaker)->name)); - + /* * setup the playback parameters */ @@ -153,7 +151,7 @@ xid = APlaySBucket( audio, pSBucket, &playParams, NULL ); /* - * set close mode to prevent playback from stopping + * set close mode to prevent playback from stopping * when we close audio connection */ ASetCloseDownMode( audio, AKeepTransactions, &status ); @@ -291,6 +289,6 @@ void init_hpplay (void) { - if (getenv ("SPEAKER")) + if (getenv ("SPEAKER")) Vhp_play_speaker = intern (getenv ("SPEAKER")); }
--- a/src/imgproc.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/imgproc.c Mon Aug 13 10:28:48 2007 +0200 @@ -201,7 +201,7 @@ splitbox(quant_table *qt, Colorbox* ptr) { int hist2[B_LEN]; - int first, last; + int first = 0, last = 0; register Colorbox *new; register int *iptr, *histp; register int i, j;
--- a/src/indent.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/indent.c Mon Aug 13 10:28:48 2007 +0200 @@ -529,16 +529,39 @@ #endif /* 0 */ +/* Helper for vmotion_1 - compute vertical pixel motion between + START and END in the line start cache CACHE. This just sums + the line heights, including both the starting and ending lines. +*/ +static int +vpix_motion (line_start_cache_dynarr *cache, int start, int end) +{ + int i, vpix; + + assert (start <= end); + assert (start >= 0); + assert (end < Dynarr_length (cache)); + + vpix = 0; + for (i = start; i <= end; i++) + vpix += Dynarr_atp (cache, i)->height; + + return vpix; +} + /***************************************************************************** - vmotion + vmotion_1 Given a starting position ORIG, move point VTARGET lines in WINDOW. Returns the new value for point. If the arg ret_vpos is not nil, it is taken to be a pointer to an int and the number of lines actually moved is - returned in it. + returned in it. If the arg ret_vpix is not nil, it is taken to be a + pointer to an int and the vertical pixel height of the motion which + took place is returned in it. ****************************************************************************/ -Bufpos -vmotion (struct window *w, Bufpos orig, int vtarget, int *ret_vpos) +static Bufpos +vmotion_1 (struct window *w, Bufpos orig, int vtarget, + int *ret_vpos, int *ret_vpix) { struct buffer *b = XBUFFER (w->buffer); int elt; @@ -576,6 +599,8 @@ } if (ret_vpos) *ret_vpos = cur_line; + if (ret_vpix) + *ret_vpix = vpix_motion (w->line_start_cache, elt, cur_line + elt); return ret_pt; } else if (vtarget < 0) @@ -583,12 +608,16 @@ if (elt < -vtarget) { if (ret_vpos) *ret_vpos = -elt; + if (ret_vpix) + *ret_vpix = vpix_motion (w->line_start_cache, 0, elt); /* #### This should be BUF_BEGV (b), right? */ return Dynarr_atp (w->line_start_cache, 0)->start; } else { if (ret_vpos) *ret_vpos = vtarget; + if (ret_vpix) + *ret_vpix = vpix_motion (w->line_start_cache, elt + vtarget, elt); return Dynarr_atp (w->line_start_cache, elt + vtarget)->start; } } @@ -597,6 +626,8 @@ /* No vertical motion requested so we just return the position of the beginning of the current line. */ if (ret_vpos) *ret_vpos = 0; + if (ret_vpix) + *ret_vpix = vpix_motion (w->line_start_cache, elt, elt); return Dynarr_atp (w->line_start_cache, elt)->start; } @@ -604,6 +635,20 @@ RETURN_NOT_REACHED(0) /* shut up compiler */ } +/***************************************************************************** + vmotion + + Given a starting position ORIG, move point VTARGET lines in WINDOW. + Returns the new value for point. If the arg ret_vpos is not nil, it is + taken to be a pointer to an int and the number of lines actually moved is + returned in it. + ****************************************************************************/ +Bufpos +vmotion (struct window *w, Bufpos orig, int vtarget, int *ret_vpos) +{ + return vmotion_1 (w, orig, vtarget, ret_vpos, NULL); +} + DEFUN ("vertical-motion", Fvertical_motion, 1, 2, 0, /* Move to start of frame line LINES lines down. If LINES is negative, this is moving up. @@ -643,6 +688,43 @@ } } +DEFUN ("vertical-motion-pixels", Fvertical_motion_pixels, 1, 2, 0, /* +Move to start of frame line LINES lines down. +If LINES is negative, this is moving up. + +This function is identical in behavior to `vertical-motion' +except that the vertical pixel height of the motion which +took place is returned instead of the actual number of lines +moved. A motion of zero lines returns the height of the +current line. + +The optional second argument WINDOW specifies the window to use +for parameters such as width, horizontal scrolling, and so on. +The default is the selected window. Note that this function +sets WINDOW's buffer's point, not WINDOW's point. +*/ + (lines, window)) +{ + if (NILP (window)) + window = Fselected_window (Qnil); + CHECK_WINDOW (window); + { + Bufpos bufpos; + int vpix; + struct window *w = XWINDOW (window); + + CHECK_INT (lines); + + bufpos = vmotion_1 (XWINDOW (window), BUF_PT (XBUFFER (w->buffer)), + XINT (lines), NULL, &vpix); + + /* Note that the buffer's point is set, not the window's point. */ + BUF_SET_PT (XBUFFER (w->buffer), bufpos); + + return make_int (vpix); + } +} + void syms_of_indent (void) @@ -655,6 +737,7 @@ DEFSUBR (Fcompute_motion); #endif DEFSUBR (Fvertical_motion); + DEFSUBR (Fvertical_motion_pixels); } void
--- a/src/inline.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/inline.c Mon Aug 13 10:28:48 2007 +0200 @@ -34,16 +34,21 @@ `extern inline' business, so on those we just do `static inline'. */ +/* Note to maintainers: This file contains a list of all header files + that use the INLINE macro, either directly, or by using DECLARE_LRECORD. + i.e. the output of ``grep -l -w 'DECLARE_LRECORD|INLINE' *.h'' */ + #define DONT_EXTERN_INLINE_FUNCTIONS #include <config.h> #include "lisp.h" #include "buffer.h" #include "bytecode.h" +#include "chartab.h" #include "console.h" #include "device.h" +#include "elhash.h" #include "events.h" -#include "elhash.h" #include "extents.h" #include "faces.h" #include "frame.h" @@ -55,27 +60,29 @@ #include "process.h" #include "specifier.h" #include "syntax.h" +#include "window.h" + +#ifdef HAVE_TOOLBARS #include "toolbar.h" -#include "window.h" +#endif #ifdef HAVE_DATABASE #include "database.h" #endif + #ifdef HAVE_X_WINDOWS -#include "console-x.h" #include "glyphs-x.h" #include "gui-x.h" #endif + #ifdef FILE_CODING #include "file-coding.h" #endif + #ifdef TOOLTALK #include TT_C_H_PATH #include "tooltalk.h" #endif -#ifdef HAVE_LDAP -#include "eldap.h" -#endif
--- a/src/input-method-motif.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/input-method-motif.c Mon Aug 13 10:28:48 2007 +0200 @@ -92,10 +92,8 @@ void XIM_init_frame (struct frame *f) { - struct device *d = XDEVICE (FRAME_DEVICE (f)); Widget w = FRAME_X_TEXT_WIDGET (f); XPoint spot = {0,0}; - XFontSet fontset; XmFontList fontlist; XmFontListEntry fontlistEntry;
--- a/src/input-method-xlib.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/input-method-xlib.c Mon Aug 13 10:28:48 2007 +0200 @@ -245,8 +245,8 @@ if (style & XIMPreeditPosition) { /* Init spot to invalid values */ - XPoint *spot = &(FRAME_X_XIC_SPOT (f)); - spot->x = spot->y = -1; + XPoint *frame_spot = &(FRAME_X_XIC_SPOT (f)); + frame_spot->x = frame_spot->y = -1; } XIM_SetGeometry (f); @@ -475,8 +475,8 @@ }; #undef STYLE_INFO - CONST char *s = (char *) fromVal->addr; - CONST char *end = s + fromVal->size; + char *s = (char *) fromVal->addr; + char *end = s + fromVal->size; XIMStyles * CONST p = (XIMStyles *) toVal->addr; CONST char * CONST delimiter = " \t\n\r:;," ; CONST int max_styles = XtNumber(emacs_XIMStyleInfo);
--- a/src/insdel.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/insdel.c Mon Aug 13 10:28:48 2007 +0200 @@ -200,6 +200,7 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "device.h" @@ -1274,9 +1275,7 @@ signal_simple_error_2 ("start greater than end", from, to); else { - Bufpos temp; - - temp = *from_out; + Bufpos temp = *from_out; *from_out = *to_out; *to_out = temp; } @@ -1332,7 +1331,7 @@ get_string_pos_char (Lisp_Object string, Lisp_Object pos, unsigned int flags) { return get_string_pos_char_1 (string, pos, flags, - string_char_length (XSTRING (string))); + XSTRING_CHAR_LENGTH (string)); } Bytecount @@ -1350,7 +1349,7 @@ unsigned int flags) { Charcount min_allowed = 0; - Charcount max_allowed = string_char_length (XSTRING (string)); + Charcount max_allowed = XSTRING_CHAR_LENGTH (string); if (NILP (from) && (flags & GB_ALLOW_NIL)) *from_out = min_allowed; @@ -1375,9 +1374,7 @@ signal_simple_error_2 ("start greater than end", from, to); else { - Bufpos temp; - - temp = *from_out; + Bufpos temp = *from_out; *from_out = *to_out; *to_out = temp; } @@ -1453,7 +1450,7 @@ buffer_or_string_accessible_end_char (Lisp_Object object) { return STRINGP (object) ? - string_char_length (XSTRING (object)) : BUF_ZV (XBUFFER (object)); + XSTRING_CHAR_LENGTH (object) : BUF_ZV (XBUFFER (object)); } Bytind @@ -1479,7 +1476,7 @@ buffer_or_string_absolute_end_char (Lisp_Object object) { return STRINGP (object) ? - string_char_length (XSTRING (object)) : BUF_Z (XBUFFER (object)); + XSTRING_CHAR_LENGTH (object) : BUF_Z (XBUFFER (object)); } Bytind @@ -1877,8 +1874,8 @@ That won't work because so many places use `int'. */ if (BUF_Z (buf) - BUF_BEG (buf) + BUF_GAP_SIZE (buf) + increment - >= ((unsigned) 1 << (min (INTBITS, VALBITS) - 1))) - error ("Buffer exceeds maximum size"); + > (int) EMACS_INT_MAX) + error ("Maximum buffer size exceeded"); result = BUFFER_REALLOC (buf->text->beg, BI_BUF_Z (buf) - BI_BUF_BEG (buf) + @@ -2391,13 +2388,8 @@ #endif /* Make sure that point-max won't exceed the size of an emacs int. */ - { - Lisp_Object temp; - - XSETINT (temp, (int) (length + BUF_Z (buf))); - if ((int) (length + BUF_Z (buf)) != XINT (temp)) - error ("maximum buffer size exceeded"); - } + if ((length + BUF_Z (buf)) > (int) EMACS_INT_MAX) + error ("Maximum buffer size exceeded"); /* theoretically not necessary -- caller should GCPRO */ GCPRO1 (reloc); @@ -2581,7 +2573,7 @@ Bytind bi_from, bi_to; Bytecount bc_numdel; int shortage; - Lisp_Object bufobj = Qnil; + Lisp_Object bufobj; /* Defensive steps just in case a buffer gets deleted and a calling function doesn't notice it. */ @@ -2641,7 +2633,7 @@ /* ### Point used to be modified here, but this causes problems with MULE, as point is used to calculate bytinds, and if the offset in bc_numdel causes - point to move to a non first-byte location, causing some other function to + point to move to a non first-byte location, causing some other function to throw an assertion in ASSERT_VALID_BYTIND. I've moved the code to right after the other movements and adjustments, but before the gap is moved. -- jh 970813 */ @@ -2900,14 +2892,14 @@ void barf_if_buffer_read_only (struct buffer *buf, Bufpos from, Bufpos to) { - Lisp_Object buffer = Qnil; + Lisp_Object buffer; Lisp_Object iro; XSETBUFFER (buffer, buf); back: iro = (buf == current_buffer ? Vinhibit_read_only : symbol_value_in_buffer (Qinhibit_read_only, buffer)); - if (!NILP (iro) && !CONSP (iro)) + if (!LISTP (iro)) return; if (NILP (iro) && !NILP (buf->read_only)) { @@ -2985,14 +2977,17 @@ int emchar_string_displayed_columns (CONST Emchar *str, Charcount len) { +#ifdef MULE int cols = 0; int i; for (i = 0; i < len; i++) - cols += XCHARSET_COLUMNS (CHAR_CHARSET (str[i])); return cols; +#else /* not MULE */ + return len; +#endif } /* NOTE: Does not reset the Dynarr. */
--- a/src/insdel.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/insdel.h Mon Aug 13 10:28:48 2007 +0200 @@ -29,9 +29,8 @@ /* changing a buffer's text */ /************************************************************************/ -extern int begin_multiple_change (struct buffer *buf, Bufpos start, - Bufpos end); -extern void end_multiple_change (struct buffer *buf, int count); +int begin_multiple_change (struct buffer *buf, Bufpos start, Bufpos end); +void end_multiple_change (struct buffer *buf, int count); /* flags for functions below */ @@ -75,12 +74,10 @@ #define buffer_insert_from_buffer(buf, b, index, length) \ buffer_insert_from_buffer_1 (buf, -1, b, index, length, 0) -extern void buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, - int flags); -extern void buffer_replace_char (struct buffer *b, Bufpos pos, Emchar ch, - int not_real_change, int force_lock_check); - - +void buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, + int flags); +void buffer_replace_char (struct buffer *b, Bufpos pos, Emchar ch, + int not_real_change, int force_lock_check); /************************************************************************/ @@ -131,11 +128,10 @@ #define BUF_NEWLINE_WAS_DELETED(buf) \ ((buf)->changes->newline_was_deleted) -extern void buffer_extent_signal_changed_region (struct buffer *buf, - Bufpos start, - Bufpos end); -extern void buffer_reset_changes (struct buffer *buf); - +void buffer_extent_signal_changed_region (struct buffer *buf, + Bufpos start, + Bufpos end); +void buffer_reset_changes (struct buffer *buf); @@ -143,32 +139,24 @@ /* other related functions */ /************************************************************************/ -extern Memind do_marker_adjustment (Memind mpos, Memind from, - Memind to, int amount); +Memind do_marker_adjustment (Memind mpos, Memind from, + Memind to, int amount); -extern void fixup_internal_substring (CONST Bufbyte *nonreloc, - Lisp_Object reloc, - int offset, int *len); +void fixup_internal_substring (CONST Bufbyte *nonreloc, + Lisp_Object reloc, + int offset, int *len); /* In font-lock.c */ -extern void font_lock_maybe_update_syntactic_caches (struct buffer *buf, - Bufpos start, - Bufpos orig_end, - Bufpos new_end); -extern void font_lock_buffer_was_killed (struct buffer *buf); - -extern void barf_if_buffer_read_only (struct buffer *buf, Bufpos from, - Bufpos to); +void font_lock_maybe_update_syntactic_caches (struct buffer *buf, + Bufpos start, + Bufpos orig_end, + Bufpos new_end); +void font_lock_buffer_was_killed (struct buffer *buf); -/* In marker.c */ -void init_buffer_markers (struct buffer *b); -void uninit_buffer_markers (struct buffer *b); +void barf_if_buffer_read_only (struct buffer *buf, Bufpos from, + Bufpos to); -extern Lisp_Object make_string_from_buffer (struct buffer *buf, Bufpos pos, - Charcount length); -extern void init_buffer_text (struct buffer *b, int indirect_p); -extern void uninit_buffer_text (struct buffer *b, int indirect_p); - - +void init_buffer_text (struct buffer *b, int indirect_p); +void uninit_buffer_text (struct buffer *b, int indirect_p); #endif /* _XEMACS_INSDEL_H_ */
--- a/src/keymap.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/keymap.c Mon Aug 13 10:28:48 2007 +0200 @@ -218,14 +218,15 @@ Lisp_Object Vmeta_prefix_char; Lisp_Object Qkeymapp; - Lisp_Object Vsingle_space_string; - Lisp_Object Qsuppress_keymap; - Lisp_Object Qmodeline_map; Lisp_Object Qtoolbar_map; +EXFUN (Fkeymap_fullness, 1); +EXFUN (Fset_keymap_name, 2); +EXFUN (Fsingle_key_description, 1); + static void describe_command (Lisp_Object definition, Lisp_Object buffer); static void describe_map (Lisp_Object keymap, Lisp_Object elt_prefix, void (*elt_describer) (Lisp_Object, Lisp_Object), @@ -233,12 +234,13 @@ Lisp_Object shadow, int mice_only_p, Lisp_Object buffer); + Lisp_Object Qcontrol, Qctrl, Qmeta, Qsuper, Qhyper, Qalt, Qshift; -/* Lisp_Object Qsymbol; defined in general.c */ -Lisp_Object Qbutton0, Qbutton1, Qbutton2, Qbutton3, Qbutton4, Qbutton5, - Qbutton6, Qbutton7; -Lisp_Object Qbutton0up, Qbutton1up, Qbutton2up, Qbutton3up, Qbutton4up, - Qbutton5up, Qbutton6up, Qbutton7up; +Lisp_Object Qbutton0, Qbutton1, Qbutton2, Qbutton3; +Lisp_Object Qbutton4, Qbutton5, Qbutton6, Qbutton7; +Lisp_Object Qbutton0up, Qbutton1up, Qbutton2up, Qbutton3up; +Lisp_Object Qbutton4up, Qbutton5up, Qbutton6up, Qbutton7up; + #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) Lisp_Object Qdrop0, Qdrop1, Qdrop2, Qdrop3, Qdrop4, Qdrop5, Qdrop6, Qdrop7; #endif @@ -256,12 +258,6 @@ /* The keymap Lisp object */ /************************************************************************/ -static Lisp_Object mark_keymap (Lisp_Object, void (*) (Lisp_Object)); -static void print_keymap (Lisp_Object, Lisp_Object, int); -/* No need for keymap_equal #### Why not? */ -DEFINE_LRECORD_IMPLEMENTATION ("keymap", keymap, - mark_keymap, print_keymap, 0, 0, 0, - struct keymap); static Lisp_Object mark_keymap (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -296,6 +292,10 @@ write_c_string (buf, printcharfun); } +/* No need for keymap_equal #### Why not? */ +DEFINE_LRECORD_IMPLEMENTATION ("keymap", keymap, + mark_keymap, print_keymap, 0, 0, 0, + struct keymap); /************************************************************************/ /* Traversing keymaps and their parents */ @@ -753,7 +753,7 @@ static Lisp_Object make_keymap (int size) { - Lisp_Object result = Qnil; + Lisp_Object result; struct keymap *keymap = alloc_lcrecord_type (struct keymap, lrecord_keymap); XSETKEYMAP (result, keymap); @@ -812,7 +812,7 @@ } DEFUN ("keymap-parents", Fkeymap_parents, 1, 1, 0, /* -Return the `parent' keymaps of the given keymap, or nil. +Return the `parent' keymaps of KEYMAP, or nil. The parents of a keymap are searched for keybindings when a key sequence isn't bound in this one. `(current-global-map)' is the default parent of all keymaps. @@ -832,7 +832,7 @@ } DEFUN ("set-keymap-parents", Fset_keymap_parents, 2, 2, 0, /* -Sets the `parent' keymaps of the given keymap. +Set the `parent' keymaps of KEYMAP to PARENTS. The parents of a keymap are searched for keybindings when a key sequence isn't bound in this one. `(current-global-map)' is the default parent of all keymaps. @@ -897,7 +897,7 @@ } DEFUN ("set-keymap-prompt", Fset_keymap_prompt, 2, 2, 0, /* -Sets the `prompt' of KEYMAP to string NEW-PROMPT, or `nil' +Set the `prompt' of KEYMAP to string NEW-PROMPT, or `nil' if no prompt is desired. The prompt is shown in the echo-area when reading a key-sequence to be looked-up in this keymap. */ @@ -920,7 +920,7 @@ DEFUN ("keymap-prompt", Fkeymap_prompt, 1, 2, 0, /* -Return the `prompt' of the given keymap. +Return the `prompt' of KEYMAP. If non-nil, the prompt is shown in the echo-area when reading a key-sequence to be looked-up in this keymap. */ @@ -1875,7 +1875,7 @@ if (VECTORP (keys)) len = XVECTOR_LENGTH (keys); else if (STRINGP (keys)) - len = string_char_length (XSTRING (keys)); + len = XSTRING_CHAR_LENGTH (keys); else if (CHAR_OR_CHAR_INTP (keys) || SYMBOLP (keys) || CONSP (keys)) { if (!CONSP (keys)) keys = list1 (keys); @@ -2225,25 +2225,15 @@ { /* This function can GC */ if (VECTORP (keys)) - { - return lookup_keys (keymap, - XVECTOR_LENGTH (keys), - XVECTOR_DATA (keys), - !NILP (accept_default)); - } + return lookup_keys (keymap, + XVECTOR_LENGTH (keys), + XVECTOR_DATA (keys), + !NILP (accept_default)); else if (SYMBOLP (keys) || CHAR_OR_CHAR_INTP (keys) || CONSP (keys)) + return lookup_keys (keymap, 1, &keys, !NILP (accept_default)); + else if (STRINGP (keys)) { - return lookup_keys (keymap, 1, &keys, - !NILP (accept_default)); - } - else if (!STRINGP (keys)) - { - keys = wrong_type_argument (Qsequencep, keys); - return Flookup_key (keymap, keys, accept_default); - } - else /* STRINGP (keys) */ - { - int length = string_char_length (XSTRING (keys)); + int length = XSTRING_CHAR_LENGTH (keys); int i; struct key_data *raw_keys = alloca_array (struct key_data, length); if (length == 0) @@ -2257,6 +2247,11 @@ return raw_lookup_key (keymap, raw_keys, length, 0, !NILP (accept_default)); } + else + { + keys = wrong_type_argument (Qsequencep, keys); + return Flookup_key (keymap, keys, accept_default); + } } /* Given a key sequence, returns a list of keymaps to search for bindings. @@ -3007,7 +3002,7 @@ the keymap will ever be passed to the function more than once. The function will not be called on elements of this keymap's parents -(see the function `keymap-parents') or upon keymaps which are contained +\(see the function `keymap-parents') or upon keymaps which are contained within this keymap (multi-character definitions). It will be called on "meta" characters since they are not really two-character sequences. @@ -3321,7 +3316,7 @@ { Bufbyte buf[200]; Bufbyte *p; - unsigned int c; + Emchar c; Lisp_Object ctl_arrow = current_buffer->ctl_arrow; int ctl_p = !NILP (ctl_arrow); Emchar printable_min = (CHAR_OR_CHAR_INTP (ctl_arrow) @@ -3941,9 +3936,9 @@ if (EQ (map, c->self)) return Qzero; /* Not shadowed; terminate search */ - return (!NILP (keymap_lookup_directly (map, - c->raw_key->keysym, - c->raw_key->modifiers))) + return !NILP (keymap_lookup_directly (map, + c->raw_key->keysym, + c->raw_key->modifiers)) ? Qt : Qnil; }
--- a/src/keymap.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/keymap.h Mon Aug 13 10:28:48 2007 +0200 @@ -32,38 +32,31 @@ #define CHECK_KEYMAP(x) CHECK_RECORD (x, keymap) #define CONCHECK_KEYMAP(x) CONCHECK_RECORD (x, keymap) -extern Lisp_Object get_keymap (Lisp_Object object, int errorp, int autoload); -extern Lisp_Object event_binding (Lisp_Object event0, int accept_default); -extern Lisp_Object event_binding_in (Lisp_Object event0, Lisp_Object keymap, - int accept_default); -extern Lisp_Object munging_key_map_event_binding (Lisp_Object event0, - enum munge_me_out_the_door - munge); +EXFUN (Fkeymap_prompt, 2); +EXFUN (Fkeymapp, 1); +EXFUN (Fmake_keymap, 1); +EXFUN (Fwhere_is_internal, 5); -extern Lisp_Object Fkey_description (Lisp_Object keys); -extern Lisp_Object Fsingle_key_description (Lisp_Object key); -extern Lisp_Object Fwhere_is_internal (Lisp_Object definition, - Lisp_Object keymaps, - Lisp_Object firstonly, - Lisp_Object noindirect, - Lisp_Object event_or_keys); +extern Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qshift, Qsuper; +extern Lisp_Object Vmeta_prefix_char; + +Lisp_Object get_keymap (Lisp_Object object, int errorp, int autoload); +Lisp_Object event_binding (Lisp_Object event0, int accept_default); +Lisp_Object event_binding_in (Lisp_Object event0, Lisp_Object keymap, + int accept_default); -extern Lisp_Object Fkeymap_name (Lisp_Object keymap); -extern Lisp_Object Fset_keymap_name (Lisp_Object keymap, Lisp_Object name); -extern Lisp_Object Fkeymap_prompt (Lisp_Object keymap, Lisp_Object inherit); -extern Lisp_Object Fset_keymap_prompt (Lisp_Object keymap, Lisp_Object prompt); +Lisp_Object munging_key_map_event_binding (Lisp_Object event0, + enum munge_me_out_the_door munge); +int relevant_keymaps_to_search (Lisp_Object keys, + int max_maps, Lisp_Object maps[]); +void describe_map_tree (Lisp_Object startmap, int partial, + Lisp_Object shadow, Lisp_Object prefix, + int mice_only_p, Lisp_Object buffer); -extern int relevant_keymaps_to_search (Lisp_Object keys, - int max_maps, Lisp_Object maps[]); -extern void describe_map_tree (Lisp_Object startmap, int partial, - Lisp_Object shadow, Lisp_Object prefix, - int mice_only_p, Lisp_Object buffer); +void key_desc_list_to_event (Lisp_Object list, Lisp_Object event, + int allow_menu_events); -extern void key_desc_list_to_event (Lisp_Object list, Lisp_Object event, - int allow_menu_events); - -extern Lisp_Object Vmeta_prefix_char; -extern int event_matches_key_specifier_p (struct Lisp_Event *event, - Lisp_Object key_specifier); +int event_matches_key_specifier_p (struct Lisp_Event *event, + Lisp_Object key_specifier); #endif /* _XEMACS_KEYMAP_H_ */
--- a/src/linuxplay.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/linuxplay.c Mon Aug 13 10:28:48 2007 +0200 @@ -77,10 +77,11 @@ #else #include "lisp.h" #include "syssignal.h" +#include "sysfile.h" #define perror(str) message("audio: %s, %s ",str,strerror(errno)) #define warn(str) message("audio: %s ",GETTEXT(str)) #endif - + #ifdef __GNUC__ #define UNUSED(x) ((void)(x)) #else @@ -95,11 +96,20 @@ 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 this does not happen anyways... */ +enum wvState +{ wvMain, + wvSubchunk, + wvOutOfBlock, + wvSkipChunk, + wvSoundChunk, + wvFatal, + wvFatalNotify +}; + static union { struct { int align; - enum {wvMain,wvSubchunk,wvOutOfBlock,wvSkipChunk, - wvSoundChunk,wvFatal,wvFatalNotify} state; + enum wvState state; size_t left; unsigned char leftover[HEADERSZ]; signed long chunklength; @@ -186,9 +196,9 @@ if (rq > *sz) {rq = *sz; rc = 0;} memcpy(parsestate.wave.leftover+parsestate.wave.left, *data,rq); - parsestate.wave.left += rq; - ((unsigned char *)*data) += rq; - *sz -= rq; + parsestate.wave.left += rq; + (*(unsigned char **)data) += rq; + *sz -= rq; return(rc); } @@ -258,7 +268,7 @@ else { if (parsestate.wave.chunklength > 0 && *sz > 0) { *sz -= parsestate.wave.chunklength; - ((unsigned char *)*data) += parsestate.wave.chunklength; } + (*(unsigned char **)data) += parsestate.wave.chunklength; } parsestate.wave.state = wvOutOfBlock; } break; case wvSoundChunk: { @@ -267,7 +277,7 @@ alignment operation */ count = parsestate.wave.left; rq = HEADERSZ-count; - if (rq > parsestate.wave.chunklength) + if (rq > (size_t) parsestate.wave.chunklength) rq = parsestate.wave.chunklength; if (!waverequire(data,sz,rq)) { parsestate.wave.chunklength -= parsestate.wave.left - count; @@ -276,15 +286,15 @@ *outbuf = parsestate.wave.leftover; parsestate.wave.left = 0; return(rq); } - if (*sz >= parsestate.wave.chunklength) { + if (*sz >= (size_t) parsestate.wave.chunklength) { count = parsestate.wave.chunklength; rq = 0; } else { count = *sz; count -= rq = count % parsestate.wave.align; } *outbuf = *data; - ((unsigned char *)*data) += count; - *sz -= count; + (*(unsigned char **)data) += count; + *sz -= count; if ((parsestate.wave.chunklength -= count) < parsestate.wave.align) { parsestate.wave.state = wvOutOfBlock; /* Some broken software (e.g. SOX) attaches junk to the end of a sound @@ -317,7 +327,7 @@ it with the new data and return a sound chunk that is as big as a single entry */ if (parsestate.audio.left) { - if (parsestate.audio.left + *sz > parsestate.audio.align) { + if (parsestate.audio.left + *sz > (size_t) parsestate.audio.align) { int count; memmove(parsestate.audio.leftover + parsestate.audio.left, *data, @@ -354,7 +364,7 @@ header information and determine how many bytes we need to skip until the start of the sound chunk */ if (!parsestate.audio.skipping) { - unsigned char *header = *data; + unsigned char *header = (unsigned char *) *data; if (*sz < 8) { warn("Irrecoverable error while parsing Sun/DEC audio file"); return(0); } @@ -373,7 +383,7 @@ creation date. Make sure that we do not return less than one single sound sample entry to the caller; if this happens, rather decide to move those few bytes into the leftover buffer and deal with it later */ - if (*sz >= parsestate.audio.skipping) { + if (*sz >= (size_t) parsestate.audio.skipping) { /* Skip just the header information and return the sound chunk */ int rc = *sz - parsestate.audio.skipping; *outbuf = (char *)*data + parsestate.audio.skipping; @@ -415,12 +425,12 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) - *dest++ = (unsigned char)(((int)*((unsigned char *)src)++ + - (int)*((unsigned char *)src)++) / 2); + *dest++ = (unsigned char)(((int)*(src)++ + + (int)*(src)++) / 2); *data = src; return(rc); } @@ -430,18 +440,18 @@ { REGISTER unsigned char *src; REGISTER unsigned char *dest; - int rc,count; + int rc, count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) - *dest++ = (unsigned char)(((int)*((signed char *)src)++ + - (int)*((signed char *)src)++) / 2); + *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + + (int)*((signed char *)(src++))) / 2); *data = src; return(rc); } @@ -457,12 +467,12 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) - *dest++ = (unsigned char)(((int)*((signed char *)src)++ + - (int)*((signed char *)src)++) / 2) ^ 0x80; + *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + + (int)*((signed char *)(src++))) / 2) ^ 0x80; *data = src; return(rc); } @@ -478,11 +488,11 @@ if (count > SNDBUFSZ) { *sz -= SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) - *dest++ = *((unsigned char *)src)++ ^ 0x80; + *dest++ = *(src)++ ^ 0x80; *data = src; return(rc); } @@ -557,16 +567,16 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) /* it is not possible to directly interpolate between two ulaw encoded data bytes, thus we need to convert to linear format first and later we convert back to ulaw format */ - *dest++ = int2ulaw(ulaw2int[*((unsigned char *)src)++] + - ulaw2int[*((unsigned char *)src)++]); - *data = src; + *dest++ = int2ulaw(ulaw2int[*(src)++] + + ulaw2int[*(src)++]); + *data = src; return(rc); } @@ -583,18 +593,18 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; for (count /= 2; count--; ) { - i = ((int)(((unsigned char *)src)[0]) + - 256*(int)(((unsigned char *)src)[1]) + - (int)(((unsigned char *)src)[2]) + - 256*(int)(((unsigned char *)src)[3])) / 2; + i = ((int)(src[0]) + + 256*(int)(src[1]) + + (int)(src[2]) + + 256*(int)(src[3])) / 2; src += 4; *dest++ = (unsigned char)(i & 0xFF); *dest++ = (unsigned char)((i / 256) & 0xFF); } - *data = src; + *data = src; return(rc); } @@ -611,18 +621,18 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; for (count /= 2; count--; ) { - i = ((int)(((unsigned char *)src)[1]) + - 256*(int)(((unsigned char *)src)[0]) + - (int)(((unsigned char *)src)[3]) + - 256*(int)(((unsigned char *)src)[2])) / 2; + i = ((int)(src[1]) + + 256*(int)(src[0]) + + (int)(src[3]) + + 256*(int)(src[2])) / 2; src += 4; *dest++ = (unsigned char)((i / 256) & 0xFF); *dest++ = (unsigned char)(i & 0xFF); } - *data = src; + *data = src; return(rc); } @@ -637,13 +647,14 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) { *dest++ = (unsigned char)(((signed char *)src)[1] ^ (signed char)0x80); - ((char *)src) += 2; } - *data = src; + src += 2; + } + *data = src; return(rc); } @@ -658,13 +669,14 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) { *dest++ = (unsigned char)(((signed char *)src)[0] ^ (signed char)0x80); - ((char *)src) += 2; } - *data = src; + src += 2; + } + *data = src; return(rc); } @@ -680,14 +692,15 @@ if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) { *dest++ = (unsigned char)(((int)((signed char *)src)[1] + (int)((signed char *)src)[3]) / 2 ^ 0x80); - ((char *)src) += 4; } - *data = src; + src += 4; + } + *data = src; return(rc); } @@ -703,14 +716,15 @@ if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = *data; + src = (unsigned char *) *data; *outbuf = dest = linuxplay_sndbuf; while (count--) { *dest++ = (unsigned char)(((int)((signed char *)src)[0] + (int)((signed char *)src)[2]) / 2 ^ 0x80); - ((char *)src) += 4; } - *data = src; + src += 4; + } + *data = src; return(rc); } @@ -807,7 +821,7 @@ return(0); } /* Initialize sound hardware with prefered parameters */ - + /* If the sound hardware cannot support 16 bit format or requires a different byte sex then try to drop to 8 bit format */ @@ -839,7 +853,7 @@ return(0); } } /* The PCSP driver does not support reading of the sampling rate via the - SOUND_PCM_READ_RATE ioctl; determine "the_speed" here */ + SOUND_PCM_READ_RATE ioctl; determine "the_speed" here */ the_speed = speed; ioctl(audio_fd,SNDCTL_DSP_SPEED,&the_speed); /* The PCSP driver does not support reading of the mono/stereo flag, thus we assume, that failure to change this mode means we are in mono mode */ @@ -905,7 +919,7 @@ sprintf(buffer,"SNDCTL_DSP_SPEED (req: %d, rtn: %d)",speed,the_speed); perror(buffer); return(0); } - + /* Use the mixer device for setting the playback volume */ if (mixx_fd > 0) { int vol = *volume & 0xFF; @@ -1005,9 +1019,9 @@ device; repeat until all data has been processed */ rrtn = length; do { - for (pptr = data; (prtn = parsesndfile((void **)&pptr,&rrtn, + for (pptr = data; (prtn = parsesndfile((void **)&pptr,(size_t *)&rrtn, (void **)&optr)) > 0; ) - for (cptr = optr; (crtn = sndcnv((void **)&cptr,&prtn, + for (cptr = optr; (crtn = sndcnv((void **)&cptr,(size_t *) &prtn, (void **)&sptr)) > 0; ) { for (;;) { if ((wrtn = write(audio_fd,sptr,crtn)) < 0) {
--- a/src/lisp-disunion.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/lisp-disunion.h Mon Aug 13 10:28:48 2007 +0200 @@ -20,211 +20,143 @@ /* Synched up with: FSF 19.30. Split out from lisp.h. */ /* This file has diverged greatly from FSF Emacs. Syncing is no - longer desired or possible */ + longer desirable or possible */ /* - * Format of a non-union-type Lisp Object - * - * For the USE_MINIMAL_TAGBITS implementation: - * - * 3 2 1 0 - * bit 10987654321098765432109876543210 - * -------------------------------- - * VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTT - * - * For the non-USE_MINIMAL_TAGBITS implementation: - * - * 3 2 1 0 - * bit 10987654321098765432109876543210 - * -------------------------------- - * TTTMVVVVVVVVVVVVVVVVVVVVVVVVVVVV - * - * V = value bits - * T = type bits - * M = mark bits - * - * For integral Lisp types, i.e. integers and characters, the value - * bits are the Lisp object. - * - * The object is obtained by masking off the type and mark - * bits. In the USE_MINIMAL_TAGBITS implementation, bit 1 is - * used as a value bit by splitting the Lisp integer type into - * two subtypes, Lisp_Type_Int_Even and Lisp_Type_Int_Odd. By - * this trickery we get 31 bits for integers instead of 30. - * - * In the non-USE_MINIMAL_TAGBITS world, Lisp integers are 28 - * bits, or more properly (LONGBITS - GCTYPEBITS - 1) bits. - * - * For non-integral types, the value bits of Lisp_Object contain a - * pointer to structure containing the object. The pointer is - * obtained by masking off the type and mark bits. - * - * In the USE_MINIMAL_TAGBITS implementation, all - * pointer-based types are coalesced under a single type called - * Lisp_Type_Record. The type bits for this type are required - * by the implementation to be 00, just like the least - * significant bits of word-aligned struct pointers on 32-bit - * hardware. Because of this, Lisp_Object pointers don't have - * to be masked and are full-sized. - * - * In the non-USE_MINIMAL_TAGBITS implementation, the type and - * mark bits must be masked off and pointers are limited to 28 - * bits (really LONGBITS - GCTYPEBITS - 1 bits). - */ + Format of a non-union-type Lisp Object + + For the USE_MINIMAL_TAGBITS implementation: + + 3 2 1 0 + bit 10987654321098765432109876543210 + -------------------------------- + VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTT + + Integers are treated specially, and look like this: + + 3 2 1 0 + bit 10987654321098765432109876543210 + -------------------------------- + VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVT + + For the non-USE_MINIMAL_TAGBITS implementation: + + 3 2 1 0 + bit 10987654321098765432109876543210 + -------------------------------- + TTTMVVVVVVVVVVVVVVVVVVVVVVVVVVVV + + V = value bits + T = type bits + M = mark bits + + For integral Lisp types, i.e. integers and characters, the value + bits are the Lisp object. + + The object is obtained by masking off the type and mark + bits. In the USE_MINIMAL_TAGBITS implementation, bit 1 is + used as a value bit by splitting the Lisp integer type into + two subtypes, Lisp_Type_Int_Even and Lisp_Type_Int_Odd. By + this trickery we get 31 bits for integers instead of 30. + + In the non-USE_MINIMAL_TAGBITS world, Lisp integers are 28 bits, + or more properly (BITS_PER_EMACS_INT - GCTYPEBITS - 1) bits. -#ifdef USE_MINIMAL_TAGBITS -# define Qzero Lisp_Type_Int_Even -# define VALMASK (((1UL << (VALBITS)) - 1L) << (GCTYPEBITS)) -#else -# define Qzero Lisp_Type_Int -# define VALMASK ((1L << (VALBITS)) - 1L) -# define GCTYPEMASK ((1L << (GCTYPEBITS)) - 1L) -#endif + For non-integral types, the value bits of a Lisp_Object contain + a pointer to a structure containing the object. The pointer is + obtained by masking off the type and mark bits. + + In the USE_MINIMAL_TAGBITS implementation, all + pointer-based types are coalesced under a single type called + Lisp_Type_Record. The type bits for this type are required + by the implementation to be 00, just like the least + significant bits of word-aligned struct pointers on 32-bit + hardware. Because of this, Lisp_Object pointers don't have + to be masked and are full-sized. + + In the non-USE_MINIMAL_TAGBITS implementation, the type and + mark bits must be masked off and pointers are limited to 28 + bits (really BITS_PER_EMACS_INT - GCTYPEBITS - 1 bits). + + There are no mark bits in the USE_MINIMAL_TAGBITS implementation. + Integers and characters don't need to be marked. All other types + are lrecord-based, which means they get marked by incrementing + their ->implementation pointer. + + In the non-USE_MINIMAL_TAGBITS implementation, the markbit is stored + in the Lisp_Object itself. It is stored in the middle so that the + type bits can be obtained by simply shifting them. + + Outside of garbage collection, all mark bits are always zero. + + Here is a brief description of the following macros: + + XMARKBIT Extract the mark bit (non-USE_MINIMAL_TAGBITS) + XMARK Set the mark bit of this Lisp_Object (non-USE_MINIMAL_TAGBITS) + XUNMARK Clear the mark bit of this Lisp_Object (non-USE_MINIMAL_TAGBITS) + XTYPE The type bits of a Lisp_Object + XPNTRVAL The value bits of a Lisp_Object storing a pointer + XCHARVAL The value bits of a Lisp_Object storing a Emchar + XREALINT The value bits of a Lisp_Object storing an integer, signed + XUINT The value bits of a Lisp_Object storing an integer, unsigned + INTP Non-zero if this Lisp_Object an integer? + Qzero Lisp Integer 0 + EQ Non-zero if two Lisp_Objects are identical + GC_EQ Version of EQ used during garbage collection +*/ typedef EMACS_INT Lisp_Object; -#define Qnull_pointer 0 - -/* - * There are no mark bits in the USE_MINIMAL_TAGBITS implementation. - * Integers and characters don't need to be marked. All other types - * are lrecord-based, which means they get marked by incrementing - * their ->implementation pointer. - */ -#if GCMARKBITS > 0 - /* - * XMARKBIT accesses the markbit. Markbits are used only in particular - * slots of particular structure types. Other markbits are always - * zero. Outside of garbage collection, all mark bits are always zero. - */ -# define MARKBIT (1UL << (VALBITS)) -# define XMARKBIT(a) ((a) & (MARKBIT)) - -# define XMARK(a) ((void) ((a) |= (MARKBIT))) -# define XUNMARK(a) ((void) ((a) &= (~(MARKBIT)))) -#else -# define XUNMARK(a) DO_NOTHING -#endif - -/* - * Extract the type bits from a Lisp_Object. If using USE_MINIMAL_TAGBITS, - * the least significant two bits are the type bits. Otherwise the - * most significant GCTYPEBITS bits are the type bits. - * - * In the non-USE_MINIMAL_TAGBITS case, one needs to override this - * if there must be high bits set in data space. Masking the bits - * (doing the result of the below & ((1 << (GCTYPEBITS)) - 1) would - * work on all machines, but would penalize machines which don't - * need it) - */ -#ifdef USE_MINIMAL_TAGBITS -# define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT)(a)) & ~(VALMASK))) -#else -# define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT)(a)) >> ((VALBITS) + 1))) -#endif - -/* - * This applies only to the non-USE_MINIMAL_TAGBITS Lisp_Object. - * - * In the past, during garbage collection, XGCTYPE needed to be used - * for extracting types so that the mark bit was ignored. XGCTYPE - * did and exatr & operation to remove the mark bit. But the mark - * bit has been since moved so that the type bits could be extracted - * with a single shift operation, making XGCTYPE no more expensive - * than XTYPE, so the two operations are now equivalent. - */ -#ifndef XGCTYPE -# define XGCTYPE(a) XTYPE(a) -#endif - -#define EQ(x,y) ((x) == (y)) - -#ifdef USE_MINIMAL_TAGBITS -# define GC_EQ(x,y) EQ(x,y) -#else -# define GC_EQ(x,y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) -#endif - -/* - * Extract the value of a Lisp_Object as a signed integer. - * - * The right shifts below are non-portable because >> is allowed to - * sign extend or not signed extend signed integers depending on the - * compiler implementors preference. But this right-shifting of - * signed ints has been here forever, so the apparently reality is - * that all compilers of any consequence do sign extension, which is - * what is needed here. - */ -#ifndef XREALINT /* Some machines need to do this differently. */ -# ifdef USE_MINIMAL_TAGBITS -# define XREALINT(a) ((a) >> (LONGBITS-VALBITS-1)) -# else -# define XREALINT(a) (((a) << (LONGBITS-VALBITS)) >> (LONGBITS-VALBITS)) -# endif -#endif - -/* Extract the value of a Lisp integer as an unsigned integer. */ -#ifdef USE_MINIMAL_TAGBITS -# define XUINT(a) ((EMACS_UINT)(a) >> (LONGBITS-VALBITS-1)) -#else -# define XUINT(a) XPNTRVAL(a) -#endif - -/* - * Extract the pointer value bits of a pointer based type. - */ -#ifdef USE_MINIMAL_TAGBITS -# define XPNTRVAL(a) (a) /* This depends on Lisp_Type_Record == 0 */ -# define XCHARVAL(a) ((a) >> (LONGBITS-VALBITS)) -#else -# define XPNTRVAL(a) ((a) & VALMASK) -# define XCHARVAL(a) XPNTRVAL(a) -#endif - -#ifdef HAVE_SHM -/* In this representation, data is found in two widely separated segments. */ -extern int pure_size; -# define XPNTR(a) \ - (XPNTRVAL (a) | (XPNTRVAL (a) > pure_size ? DATA_SEG_BITS : PURE_SEG_BITS)) -# else /* not HAVE_SHM */ -# ifdef DATA_SEG_BITS -/* This case is used for the rt-pc. - In the diffs I was given, it checked for ptr = 0 - and did not adjust it in that case. - But I don't think that zero should ever be found - in a Lisp object whose data type says it points to something. */ -# define XPNTR(a) (XPNTRVAL (a) | DATA_SEG_BITS) -# else -# define XPNTR(a) XPNTRVAL (a) -# endif -#endif /* not HAVE_SHM */ - #ifdef USE_MINIMAL_TAGBITS -/* XSETINT depends on Lisp_Type_Int_Even == 1 and Lisp_Type_Int_Odd == 3 */ -# define XSETINT(var, value) \ - ((void) ((var) = ((value) << (LONGBITS-VALBITS-1)) + 1)) -# define XSETCHAR(var, value) \ - ((void) ((var) = ((value) << (LONGBITS-VALBITS)) + Lisp_Type_Char)) -# define XSETOBJ(var, type_tag, value) \ - ((void) ((var) = ((EMACS_UINT) (value)))) +# define XUNMARK(x) DO_NOTHING +# define make_obj(vartype, x) ((Lisp_Object) (x)) +# define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) + 1)) +# define make_char(x) ((Lisp_Object) (((x) << GCBITS) + Lisp_Type_Char)) +# define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS) +# define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK)) +# define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */ +# define XCHARVAL(x) ((x) >> GCBITS) +# define GC_EQ(x,y) EQ (x,y) +# define XREALINT(x) ((x) >> INT_GCBITS) +# define XUINT(x) ((EMACS_UINT)(x) >> INT_GCBITS) +# define INTP(x) ((EMACS_UINT)(x) & 1) +# define Qzero ((Lisp_Object) 1UL) -#else +#else /* !USE_MINIMAL_TAGBITS */ -# define XSETINT(a, b) XSETOBJ (a, Lisp_Type_Int, b) -# define XSETCHAR(var, value) XSETOBJ (var, Lisp_Type_Char, value) -# define XSETOBJ(var, type_tag, value) \ - ((void) ((var) = (((EMACS_UINT) (type_tag) << ((VALBITS) + 1)) \ - + ((EMACS_INT) (value) & VALMASK)))) -#endif +# define MARKBIT (1UL << VALBITS) +# define XMARKBIT(x) ((x) & MARKBIT) +# define XMARK(x) ((void) ((x) |= MARKBIT)) +# define XUNMARK(x) ((void) ((x) &= ~MARKBIT)) +# define make_obj(vartype, value) \ + ((Lisp_Object) (((EMACS_UINT) (vartype) << (VALBITS + GCMARKBITS)) \ + + ((EMACS_UINT) (value) & VALMASK))) +# define make_int(value) make_obj (Lisp_Type_Int, value) +# define make_char(value) make_obj (Lisp_Type_Char, value) +# define VALMASK ((1UL << VALBITS) - 1UL) +# define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) >> (VALBITS + GCMARKBITS))) +# define XPNTRVAL(x) ((x) & VALMASK) +# define XCHARVAL(x) XPNTRVAL(x) +# define GC_EQ(x,y) (((x) & ~MARKBIT) == ((y) & ~MARKBIT)) +# define XREALINT(x) (((x) << INT_GCBITS) >> INT_GCBITS) +# define XUINT(x) ((EMACS_UINT) ((x) & VALMASK)) +# define INTP(x) (XTYPE (x) == Lisp_Type_Int) +# define Qzero ((Lisp_Object) Lisp_Type_Int) -/* Use this for turning a (void *) into a Lisp_Object, as when the - Lisp_Object is passed into a toolkit callback function */ +#endif /* !USE_MINIMAL_TAGBITS */ + +#define Qnull_pointer 0 +#define XGCTYPE(x) XTYPE(x) +#define EQ(x,y) ((x) == (y)) +#define XSETINT(var, value) ((void) ((var) = make_int (value))) +#define XSETCHAR(var, value) ((void) ((var) = make_char (value))) +#define XSETOBJ(var, vartype, value) ((void) ((var) = make_obj (vartype, value))) + +/* Convert between a (void *) and a Lisp_Object, as when the + Lisp_Object is passed to a toolkit callback function */ #define VOID_TO_LISP(larg,varg) ((void) ((larg) = ((Lisp_Object) (varg)))) #define CVOID_TO_LISP VOID_TO_LISP - -/* Use this for turning a Lisp_Object into a (void *), as when the - Lisp_Object is passed into a toolkit callback function */ #define LISP_TO_VOID(larg) ((void *) (larg)) #define LISP_TO_CVOID(varg) ((CONST void *) (larg))
--- a/src/lisp-union.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/lisp-union.h Mon Aug 13 10:28:48 2007 +0200 @@ -19,217 +19,153 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with: FSF 19.30. Split out from lisp.h. */ +/* Divergent from FSF. */ + +/* Definition of Lisp_Object type as a union. + The declaration order of the objects within the struct members + of the union is dependent on ENDIAN-ness and USE_MINIMAL_TAGBITS. + See lisp-disunion.h for more details. */ typedef union Lisp_Object { + /* if non-valbits are at lower addresses */ +#if defined(WORDS_BIGENDIAN) == defined(USE_MINIMAL_TAGBITS) struct { -#if (!!defined (WORDS_BIGENDIAN) != !!defined (LOWTAGS)) - /* Big-endian lowtags, little-endian hightags */ - unsigned EMACS_INT type_mark: GCTYPEBITS + GCMARKBITS; - signed EMACS_INT val: VALBITS; -#else /* If WORDS_BIGENDIAN, or little-endian hightags */ - signed EMACS_INT val: VALBITS; - unsigned EMACS_INT mark_type: GCTYPEBITS + GCMARKBITS; -#endif /* BIG/LITTLE_ENDIAN vs HIGH/LOWTAGS */ + EMACS_UINT val : VALBITS; +#if GCMARKBITS > 0 + unsigned int markbit: GCMARKBITS; +#endif + enum_field (Lisp_Type) type : GCTYPEBITS; + } gu; + + struct + { + signed EMACS_INT val : INT_VALBITS; + unsigned int bits : INT_GCBITS; } s; + + struct + { + EMACS_UINT val : INT_VALBITS; + unsigned int bits : INT_GCBITS; + } u; +#else /* non-valbits are at higher addresses */ struct { -#if (!!defined (WORDS_BIGENDIAN) == !!defined (LOWTAGS)) - unsigned EMACS_INT val: VALBITS; + enum_field (Lisp_Type) type : GCTYPEBITS; +#if GCMARKBITS > 0 + unsigned int markbit: GCMARKBITS; #endif -#ifdef __GNUC__ /* Non-ANSI extension */ - enum Lisp_Type type: GCTYPEBITS; -#else - unsigned EMACS_INT type: GCTYPEBITS; -#endif /* __GNUC__ */ - /* The markbit is not really part of the value of a Lisp_Object, - and is always zero except during garbage collection. */ -#if GCMARKBITS > 0 - unsigned EMACS_INT markbit: GCMARKBITS; -#endif -#if (!!defined (WORDS_BIGENDIAN) != !!defined (LOWTAGS)) - unsigned EMACS_INT val: VALBITS; -#endif + EMACS_UINT val : VALBITS; } gu; -#ifdef USE_MINIMAL_TAGBITS + + struct + { + unsigned int bits : INT_GCBITS; + signed EMACS_INT val : INT_VALBITS; + } s; + struct { -#if (!!defined (WORDS_BIGENDIAN) != !!defined (LOWTAGS)) - unsigned bit: GCTYPEBITS - 1; -#endif - signed EMACS_INT val: VALBITS + 1; -#if (!!defined (WORDS_BIGENDIAN) == !!defined (LOWTAGS)) - unsigned bit: GCTYPEBITS - 1; -#endif - } si; - struct - { -#if (!!defined (WORDS_BIGENDIAN) != !!defined (LOWTAGS)) - unsigned bit: GCTYPEBITS - 1; -#endif - unsigned EMACS_INT val: VALBITS + 1; -#if (!!defined (WORDS_BIGENDIAN) == !!defined (LOWTAGS)) - unsigned bit: GCTYPEBITS - 1; -#endif - } u_i; -#endif /* USE_MINIMAL_TAGBITS */ + unsigned int bits : INT_GCBITS; + EMACS_UINT val : INT_VALBITS; + } u; + +#endif /* non-valbits are at higher addresses */ + EMACS_UINT ui; - EMACS_INT i; - /* GCC bites yet again. I fart in the general direction of - the GCC authors. + signed EMACS_INT i; - This was formerly declared 'void *v' etc. but that causes + /* This was formerly declared 'void *v' etc. but that causes GCC to accept any (yes, any) pointer as the argument of a function declared to accept a Lisp_Object. */ - struct __nosuchstruct__ *v; - CONST struct __nosuchstruct__ *cv; /* C wanks */ + struct nosuchstruct *v; + CONST struct nosuchstruct *cv; } Lisp_Object; -#ifndef USE_MINIMAL_TAGBITS -#ifndef XMAKE_LISP -#if (__GNUC__ > 1) -/* Use GCC's struct initializers feature */ -#define XMAKE_LISP(vartype,value) \ - ((union Lisp_Object) { gu: { markbit: 0, \ - type: (vartype), \ - val: ((unsigned EMACS_INT) value) } }) -#endif /* __GNUC__ */ -#endif /* !XMAKE_LISP */ +#define XCHARVAL(x) ((x).gu.val) + +#ifdef USE_MINIMAL_TAGBITS +# define XSETINT(var, value) do { \ + Lisp_Object *_xzx = &(var); \ + _xzx->s.val = (value); \ + _xzx->s.bits = 1; \ +} while (0) +# define XSETCHAR(var, value) do { \ + Lisp_Object *_xzx = &(var); \ + _xzx->gu.val = (EMACS_UINT) (value); \ + _xzx->gu.type = Lisp_Type_Char; \ +} while (0) +# define XSETOBJ(var, vartype, value) \ + ((void) ((var).ui = (EMACS_UINT) (value))) +# define XPNTRVAL(x) ((x).ui) +#else /* ! USE_MINIMAL_TAGBITS */ +# define XSETOBJ(var, vartype, value) do { \ + Lisp_Object *_xzx = &(var); \ + _xzx->gu.val = (EMACS_UINT) (value); \ + _xzx->gu.type = (vartype); \ + _xzx->gu.markbit = 0; \ +} while (0) +# define XSETINT(var, value) XSETOBJ (var, Lisp_Type_Int, value) +# define XSETCHAR(var, value) XSETOBJ (var, Lisp_Type_Char, value) +# define XPNTRVAL(x) ((x).gu.val) #endif /* ! USE_MINIMAL_TAGBITS */ -#ifdef XMAKE_LISP -#define Qzero (XMAKE_LISP (Lisp_Type_Int, 0)) -#define make_int(a) (XMAKE_LISP (Lisp_Type_Int, (a))) -#define make_char(a) (XMAKE_LISP (Lisp_Type_Char, (a))) -#else -extern Lisp_Object Qzero; -#endif - -extern Lisp_Object Qnull_pointer; - -#define EQ(x,y) ((x).v == (y).v) -#define GC_EQ(x,y) ((x).gu.val == (y).gu.val && (x).gu.type == (y).gu.type) +INLINE Lisp_Object make_int (EMACS_INT val); +INLINE Lisp_Object +make_int (EMACS_INT val) +{ + Lisp_Object obj; + XSETINT(obj, val); + return obj; +} -#define XTYPE(a) ((enum Lisp_Type) (a).gu.type) -#define XGCTYPE(a) XTYPE (a) +INLINE Lisp_Object make_char (Emchar val); +INLINE Lisp_Object +make_char (Emchar val) +{ + Lisp_Object obj; + XSETCHAR(obj, val); + return obj; +} -/* This was commented out a long time ago. I uncommented it, but it - makes the Alpha crash, and that's the only system that would use - this, so it stays commented out. */ -#if 0 /* EXPLICIT_SIGN_EXTEND */ -/* Make sure we sign-extend; compilers have been known to fail to do so. */ -#define XREALINT(a) (((a).i << ((LONGBITS) - (VALBITS))) >> ((LONGBITS) - (VALBITS))) -#else -#ifdef USE_MINIMAL_TAGBITS -# define XREALINT(a) ((a).si.val) -#else -# define XREALINT(a) ((a).s.val) -#endif -#endif /* EXPLICIT_SIGN_EXTEND */ +extern Lisp_Object Qnull_pointer, Qzero; + +#define XREALINT(x) ((x).s.val) +#define XUINT(x) ((x).u.val) +#define XTYPE(x) ((x).gu.type) +#define XGCTYPE(x) XTYPE (x) +#define EQ(x,y) ((x).v == (y).v) #ifdef USE_MINIMAL_TAGBITS -# define XUINT(a) ((a).u_i.val) +#define INTP(x) ((x).s.bits) +#define GC_EQ(x,y) EQ (x, y) #else -# define XUINT(a) XPNTRVAL(a) -#endif - -#ifdef USE_MINIMAL_TAGBITS -# define XPNTRVAL(a) ((a).ui) -# define XCHARVAL(a) ((a).gu.val) -#else -# define XPNTRVAL(a) ((a).gu.val) -# define XCHARVAL(a) XPNTRVAL(a) +#define INTP(x) (XTYPE(x) == Lisp_Type_Int) +#define GC_EQ(x,y) ((x).gu.val == (y).gu.val && XTYPE (x) == XTYPE (y)) #endif -#ifdef HAVE_SHM -/* In this representation, data is found in two widely separated segments. */ -extern int pure_size; -# define XPNTR(a) \ - ((void *)(XPNTRVAL(a)) | (XPNTRVAL(a) > pure_size ? DATA_SEG_BITS : PURE_SEG_BITS))) -#else /* not HAVE_SHM */ -# ifdef DATA_SEG_BITS -/* This case is used for the rt-pc and hp-pa. - In the diffs I was given, it checked for ptr = 0 - and did not adjust it in that case. - But I don't think that zero should ever be found - in a Lisp object whose data type says it points to something. - */ -# define XPNTR(a) ((void *)((XPNTRVAL(a)) | DATA_SEG_BITS)) -# else /* not DATA_SEG_BITS */ -# define XPNTR(a) ((void *) (XPNTRVAL(a))) -# endif /* not DATA_SEG_BITS */ -#endif /* not HAVE_SHM */ - -#ifdef USE_MINIMAL_TAGBITS -# define XSETINT(a, b) \ - do { Lisp_Object *_xzx = &(a) ; \ - (*_xzx).si.val = (b) ; \ - (*_xzx).si.bit = 1; \ - } while (0) -# define XSETCHAR(a, b) \ - do { Lisp_Object *_xzx = &(a) ; \ - (*_xzx).gu.val = (b) ; \ - (*_xzx).gu.type = Lisp_Type_Char; \ - } while (0) +#if GCMARKBITS > 0 +/* XMARKBIT accesses the markbit. Markbits are used only in + particular slots of particular structure types. Other markbits are + always zero. Outside of garbage collection, all mark bits are + always zero. */ +# define XMARKBIT(x) ((x).gu.markbit) +# define XMARK(x) ((void) (XMARKBIT (x) = 1)) +# define XUNMARK(x) ((void) (XMARKBIT (x) = 0)) #else -# define XSETINT(a, b) ((void) ((a) = make_int (b))) -# define XSETCHAR(a, b) ((void) ((a) = make_char (b))) +# define XUNMARK(x) DO_NOTHING #endif -/* XSETOBJ was formerly named XSET. The name change was made to catch - C code that attempts to use this macro. You should always use the - individual settor macros (XSETCONS, XSETBUFFER, etc.) instead. */ - -#ifdef USE_MINIMAL_TAGBITS -# define XSETOBJ(var, vartype, value) \ - ((void) ((var).ui = (EMACS_UINT)(value))) -#else -# ifdef XMAKE_LISP -# define XSETOBJ(a, type, b) ((void) ((a) = XMAKE_LISP (type, b))) -# else -/* This is haired up to avoid evaluating var twice... - This is necessary only in the "union" version. - The "int" version has never done double evaluation. - */ -/* XEmacs change: put the assignment to val first; otherwise you - can trip up the error_check_*() stuff */ -# define XSETOBJ(var, vartype, value) \ - do { \ - Lisp_Object *tmp_xset_var = &(var); \ - (*tmp_xset_var).s.val = ((EMACS_INT) (value)); \ - (*tmp_xset_var).gu.markbit = 0; \ - (*tmp_xset_var).gu.type = (vartype); \ - } while (0) -# endif /* ! XMAKE_LISP */ -#endif /* ! USE_MINIMAL_TAGBITS */ - -#if GCMARKBITS > 0 -/* - * XMARKBIT access the markbit. Markbits are used only in particular - * slots of particular structure types. Other markbits are always - * zero. Outside of garbage collection, all mark bits are always - * zero. - */ -# define XMARKBIT(a) ((a).gu.markbit) -# define XMARK(a) ((void) (XMARKBIT (a) = 1)) -# define XUNMARK(a) ((void) (XMARKBIT (a) = 0)) -#else -# define XUNMARK(a) DO_NOTHING -#endif - -/* Use this for turning a (void *) into a Lisp_Object, as when the - Lisp_Object is passed into a toolkit callback function */ +/* Convert between a (void *) and a Lisp_Object, as when the + Lisp_Object is passed to a toolkit callback function */ #define VOID_TO_LISP(larg,varg) \ - ((void) ((larg).v = (struct __nosuchstruct__ *) (varg))) + ((void) ((larg).v = (struct nosuchstruct *) (varg))) #define CVOID_TO_LISP(larg,varg) \ - ((void) ((larg).cv = (CONST struct __nosuchstruct__ *) (varg))) - -/* Use this for turning a Lisp_Object into a (void *), as when the - Lisp_Object is passed into a toolkit callback function */ + ((void) ((larg).cv = (CONST struct nosuchstruct *) (varg))) #define LISP_TO_VOID(larg) ((void *) ((larg).v)) #define LISP_TO_CVOID(larg) ((CONST void *) ((larg).cv))
--- a/src/lisp.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/lisp.h Mon Aug 13 10:28:48 2007 +0200 @@ -39,30 +39,65 @@ #include <stdio.h> /* NULL, etc. */ #include <ctype.h> #include <stdarg.h> -#include <limits.h> - -/* Define INT_MAX, DBL_DIG if not in limits.h */ -#ifndef INT_MAX -#define INT_MAX ((int) ((1U << (INTBITS - 1)) - 1)) -#endif -#ifndef DBL_DIG -#define DBL_DIG 16 -#endif - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifndef INCLUDED_FCNTL -# define INCLUDED_FCNTL -# include <fcntl.h> -#endif /* INCLUDED_FCNTL */ #ifdef __lucid # include <sysent.h> #endif -#include "blocktype.h" /* A generally useful include */ -#include "dynarr.h" /* A generally useful include */ +/* ---- Dynamic arrays ---- */ + +#define Dynarr_declare(type) \ + type *base; \ + int elsize; \ + int cur; \ + int largest; \ + int max + +typedef struct dynarr +{ + Dynarr_declare (void); +} Dynarr; + +void *Dynarr_newf (int elsize); +void Dynarr_resize (void *dy, int size); +void Dynarr_insert_many (void *d, CONST void *el, int len, int start); +void Dynarr_delete_many (void *d, int start, int len); +void Dynarr_free (void *d); + +#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof(type))) +#define Dynarr_at(d, pos) ((d)->base[pos]) +#define Dynarr_atp(d, pos) (&Dynarr_at (d, pos)) +#define Dynarr_length(d) ((d)->cur) +#define Dynarr_largest(d) ((d)->largest) +#define Dynarr_reset(d) ((d)->cur = 0) +#define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur) +#define Dynarr_insert_many_at_start(d, el, len) \ + Dynarr_insert_many (d, el, len, 0) +#define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof(s) - 1) +#define Dynarr_add_lisp_string(d, s) do { \ + struct Lisp_String *dyna_ls_s = XSTRING (s); \ + Dynarr_add_many (d, (char *) string_data (dyna_ls_s), \ + string_length (dyna_ls_s)); \ +} while (0) + +#define Dynarr_add(d, el) ( \ + (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : (void) 0, \ + ((d)->base)[(d)->cur++] = (el), \ + (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0) + +/* The following defines will get you into real trouble if you aren't + careful. But they can save a lot of execution time when used wisely. */ +#define Dynarr_increment(d) ((d)->cur++) +#define Dynarr_set_size(d, n) ((d)->cur = n) + +/* Minimum size in elements for dynamic array when resized; default is 32 */ +extern int Dynarr_min_size; + +#ifdef MEMORY_USAGE_STATS +struct overhead_stats; +size_t Dynarr_memory_usage (void *d, struct overhead_stats *stats); +#endif + #include "symsinit.h" /* compiler warning suppression */ /* Also define min() and max(). (Some compilers put them in strange @@ -76,95 +111,6 @@ #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif -/* Emacs needs to use its own definitions of certain system calls on - some systems (like SunOS 4.1 and USG systems, where the read system - call is interruptible but Emacs expects it not to be; and under - MULE, where all filenames need to be converted to external format). - To do this, we #define read to be sys_read, which is defined in - sysdep.c. We first #undef read, in case some system file defines - read as a macro. sysdep.c doesn't encapsulate read, so the call to - read inside of sys_read will do the right thing. - - DONT_ENCAPSULATE is used in files such as sysdep.c that want to - call the actual system calls rather than the encapsulated versions. - Those files can call sys_read to get the (possibly) encapsulated - versions. - - IMPORTANT: the redefinition of the system call must occur *after* the - inclusion of any header files that declare or define the system call; - otherwise lots of unfriendly things can happen. This goes for all - encapsulated system calls. - - We encapsulate the most common system calls here; we assume their - declarations are in one of the standard header files included above. - Other encapsulations are declared in the appropriate sys*.h file. */ - -#if defined (ENCAPSULATE_READ) && !defined (DONT_ENCAPSULATE) -# undef read -# define read sys_read -#endif -#if !defined (ENCAPSULATE_READ) && defined (DONT_ENCAPSULATE) -# define sys_read read -#endif - -#if defined (ENCAPSULATE_WRITE) && !defined (DONT_ENCAPSULATE) -# undef write -# define write sys_write -#endif -#if !defined (ENCAPSULATE_WRITE) && defined (DONT_ENCAPSULATE) -# define sys_write write -#endif - -#if defined (ENCAPSULATE_OPEN) && !defined (DONT_ENCAPSULATE) -# undef open -# define open sys_open -#endif -#if !defined (ENCAPSULATE_OPEN) && defined (DONT_ENCAPSULATE) -# define sys_open open -#endif - -#if defined (ENCAPSULATE_CLOSE) && !defined (DONT_ENCAPSULATE) -# undef close -# define close sys_close -#endif -#if !defined (ENCAPSULATE_CLOSE) && defined (DONT_ENCAPSULATE) -# define sys_close close -#endif - -/* Now the stdio versions ... */ - -#if defined (ENCAPSULATE_FREAD) && !defined (DONT_ENCAPSULATE) -# undef fread -# define fread sys_fread -#endif -#if !defined (ENCAPSULATE_FREAD) && defined (DONT_ENCAPSULATE) -# define sys_fread fread -#endif - -#if defined (ENCAPSULATE_FWRITE) && !defined (DONT_ENCAPSULATE) -# undef fwrite -# define fwrite sys_fwrite -#endif -#if !defined (ENCAPSULATE_FWRITE) && defined (DONT_ENCAPSULATE) -# define sys_fwrite fwrite -#endif - -#if defined (ENCAPSULATE_FOPEN) && !defined (DONT_ENCAPSULATE) -# undef fopen -# define fopen sys_fopen -#endif -#if !defined (ENCAPSULATE_FOPEN) && defined (DONT_ENCAPSULATE) -# define sys_fopen fopen -#endif - -#if defined (ENCAPSULATE_FCLOSE) && !defined (DONT_ENCAPSULATE) -# undef fclose -# define fclose sys_fclose -#endif -#if !defined (ENCAPSULATE_FCLOSE) && defined (DONT_ENCAPSULATE) -# define sys_fclose fclose -#endif - /* Memory allocation */ void malloc_warning (CONST char *); void *xmalloc (size_t size); @@ -172,12 +118,13 @@ void *xrealloc (void *, size_t size); char *xstrdup (CONST char *); /* generally useful */ -#define countof(x) (sizeof(x)/sizeof(x[0])) +#define countof(x) ((int) (sizeof(x)/sizeof(x[0]))) #define slot_offset(type, slot_name) \ ((unsigned) (((char *) (&(((type *)0)->slot_name))) - ((char *)0))) #define xnew(type) ((type *) xmalloc (sizeof (type))) #define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type))) #define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type))) +#define xzero(lvalue) ((void) memset (&(lvalue), 0, sizeof (lvalue))) #define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type))) #define XREALLOC_ARRAY(ptr, type, len) ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type)))) #define alloca_array(type, len) ((type *) alloca ((len) * sizeof (type))) @@ -194,8 +141,8 @@ /* Avoid side-effectualness. */ \ /* Dammit! Macros suffer from dynamic scope! */ \ /* We demand inline functions! */ \ - int do_realloc_needed_size = (needed_size); \ - int do_realloc_newsize = 0; \ + size_t do_realloc_needed_size = (needed_size); \ + size_t do_realloc_newsize = 0; \ while ((sizevar) < (do_realloc_needed_size)) { \ do_realloc_newsize = 2*(sizevar); \ if (do_realloc_newsize < 32) \ @@ -208,11 +155,11 @@ #ifdef ERROR_CHECK_MALLOC void xfree_1 (void *); -#define xfree(lvalue) do \ -{ \ - void **ptr = (void **) &(lvalue); \ - xfree_1 (*ptr); \ - *ptr = (void *) 0xDEADBEEF; \ +#define xfree(lvalue) do \ +{ \ + void **xfree_ptr = (void **) &(lvalue); \ + xfree_1 (*xfree_ptr); \ + *xfree_ptr = (void *) 0xDEADBEEF; \ } while (0) #else void xfree (void *); @@ -223,7 +170,7 @@ /* (This definition is here because system header file macros may want * to call bzero (eg FD_ZERO) */ #ifndef bzero -# define bzero(m, l) memset ((m), 0, (l)) +# define bzero(m, l) memset (m, 0, l) #endif #ifndef PRINTF_ARGS @@ -288,10 +235,14 @@ #define DO_NOTHING do {} while (0) #endif +#ifndef DECLARE_NOTHING +#define DECLARE_NOTHING struct nosuchstruct +#endif + /* We define assert iff USE_ASSERTIONS or DEBUG_XEMACS is defined. - Otherwise we it to NULL. Quantify has shown that the time the - assert checks take is measurable so let's not include them in - production binaries. */ + Otherwise we define it to be empty. Quantify has shown that the + time the assert checks take is measurable so let's not include them + in production binaries. */ #ifdef USE_ASSERTIONS /* Highly dubious kludge */ @@ -314,84 +265,6 @@ /*#define REGISTER register*/ /*#endif*/ -#if defined (__GNUC__) && (__GNUC__ >= 2) -/* Entomological studies have revealed that the following junk is - necessary under GCC. GCC has a compiler bug where incorrect - code will be generated if you use a global temporary variable - in a macro and the macro occurs twice in the same expression. - As it happens, we can avoid this problem using a GCC language - extension. Thus we play weird games with syntax to avoid having - to provide two definitions for lots of macros. - - The approximate way this works is as follows: - - 1. Use these macros whenever you want to avoid evaluating an - argument more than once in a macro. (It's almost always a - good idea to make your macros safe like this.) - 2. Choose a name for the temporary variable you will store - the parameter in. It should begin with `MT' and - be distinguishing, since it will (or may) be a global - variable. - 3. In the same header file as the macro, put in a - MAC_DECLARE_EXTERN for the temporary variable. This - resolves to an external variable declaration for some - compilers. - 4. Put a MAC_DEFINE for the variable in a C file somewhere. - This resolves to a variable definition for some compilers. - 5. Write your macro with no semicolons or commas in it. - Remember to use parentheses to surround macro arguments, - but you do not need to surround each separate statement - or the temporary variable with parentheses. - 6. Write your macro like this: - -#define foo(bar,baz) \ -MAC_BEGIN \ - MAC_DECLARE (struct frobozz *, MTfoobar, bar) \ - SOME_EXPRESSION \ - MAC_SEP \ - SOME OTHER EXPRESSION \ -MAC_END - - 7. You only need to use MAC_SEP if you have more than one - expression in the macro, not counting any MAC_DECLARE - statements. - - DONT_DECLARE_MAC_VARS is used in signal.c, for asynchronous signals. - All functions that may be called from within an asynchronous signal - handler must declare local variables (with MAC_DECLARE_LOCAL) for - the (normally global) variables used in these sorts of macros. - Otherwise, a signal could occur in the middle of processing one - of these macros and the signal handler could use the same macro, - resulting in the global variable getting overwritten and yielding - nasty evil crashes that are very difficult to track down. -*/ -# define MAC_BEGIN ({ -# define MAC_DECLARE(type, var, value) type var = (value); -# define MAC_SEP ; -# define MAC_END ; }) -# define MAC_DECLARE_EXTERN(type, var) -# define MAC_DECLARE_LOCAL(type, var) -# define MAC_DEFINE(type, var) -#else -# define MAC_BEGIN ( -# define MAC_DECLARE(type, var, value) var = (value), -# define MAC_SEP , -# define MAC_END ) -# ifdef DONT_DECLARE_MAC_VARS -# define MAC_DECLARE_EXTERN(type, var) -# else -# define MAC_DECLARE_EXTERN(type, var) extern type var; -# endif -# define MAC_DECLARE_LOCAL(type, var) type var; -# define MAC_DEFINE(type, var) type var; -#endif - -/* For Lo, the Lord didst appear and look upon the face of the code, - and the Lord was unhappy with the strange syntax that had come - into vogue with the cryptic name of "C". And so the Lord didst - decree, that from now on all programmers shall use Pascal syntax, - a syntax truly and in sooth ordained in heaven. Amen. */ - /************************************************************************/ /* typedefs */ @@ -449,7 +322,7 @@ typedef unsigned int glyph_index; -/* This is shared by process.h, events.h and others in future. +/* This is shared by process.h, events.h and others in future. See events.h for description */ typedef unsigned int USID; @@ -496,6 +369,11 @@ Dynarr_declare (Emchar); } Emchar_dynarr; +typedef struct +{ + Dynarr_declare (char); +} char_dynarr; + typedef unsigned char unsigned_char; typedef struct { @@ -689,7 +567,7 @@ # define POINTER_TYPE_P(type) \ ((type) != Lisp_Type_Int && (type) != Lisp_Type_Char) -#else +#else /* USE_MINIMAL_TAGBITS */ enum Lisp_Type { @@ -701,7 +579,7 @@ #define POINTER_TYPE_P(type) ((type) == Lisp_Type_Record) -#endif +#endif /* USE_MINIMAL_TAGBITS */ /* This should be the underlying type into which a Lisp_Object must fit. In a strict ANSI world, this must be `int', since ANSI says you can't @@ -710,44 +588,65 @@ longer of the two. (This also must be something into which a pointer to an arbitrary object will fit, modulo any DATA_SEG_BITS cruft.) */ +/* ### We should be using uintptr_t and SIZEOF_VOID_P here */ #if (LONGBITS > INTBITS) # define EMACS_INT long # define EMACS_UINT unsigned long +# define SIZEOF_EMACS_INT SIZEOF_LONG #else # define EMACS_INT int # define EMACS_UINT unsigned int +# define SIZEOF_EMACS_INT SIZEOF_INT #endif +#define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR) + /* Overridden by m/next.h */ #ifndef ASSERT_VALID_POINTER # define ASSERT_VALID_POINTER(pnt) (assert ((((EMACS_UINT) pnt) & 3) == 0)) #endif -/* These values are overridden by the m- file on some machines. */ -#ifndef GCTYPEBITS -# ifdef USE_MINIMAL_TAGBITS -# define GCTYPEBITS 2L -# else -# define GCTYPEBITS 3L -# endif -#endif - -/* Valid values for GCMARKBITS are 0 and 1. */ #ifdef USE_MINIMAL_TAGBITS -# define GCMARKBITS 0L +# define GCMARKBITS 0 +# define GCTYPEBITS 2 +# define GCBITS 2 +# define INT_GCBITS 1 #else -# define GCMARKBITS 1L -#endif - -#ifndef VALBITS -# define VALBITS ((LONGBITS)-(GCTYPEBITS)-(GCMARKBITS)) +# define GCMARKBITS 1 +# define GCTYPEBITS 3 +# define GCBITS 4 +# define INT_GCBITS GCBITS #endif -#ifdef NO_UNION_TYPE +#define INT_VALBITS (BITS_PER_EMACS_INT - INT_GCBITS) +#define VALBITS (BITS_PER_EMACS_INT - GCBITS) +#define EMACS_INT_MAX ((1UL << INT_VALBITS) -1UL) + +#ifdef USE_UNION_TYPE +# include "lisp-union.h" +#else /* !USE_UNION_TYPE */ # include "lisp-disunion.h" -#else /* !NO_UNION_TYPE */ -# include "lisp-union.h" -#endif /* !NO_UNION_TYPE */ +#endif /* !USE_UNION_TYPE */ + +#ifdef HAVE_SHM +/* In this representation, data is found in two widely separated segments. */ +extern int pure_size; +# define XPNTR(x) \ + ((void *)(XPNTRVAL(x)) | (XPNTRVAL(x) > pure_size ? DATA_SEG_BITS : PURE_SEG_BITS))) +#else /* not HAVE_SHM */ +# ifdef DATA_SEG_BITS +/* This case is used for the rt-pc and hp-pa. + In the diffs I was given, it checked for ptr = 0 + and did not adjust it in that case. + But I don't think that zero should ever be found + in a Lisp object whose data type says it points to something. + */ +# define XPNTR(x) ((void *)((XPNTRVAL(x)) | DATA_SEG_BITS)) +# else /* not DATA_SEG_BITS */ +# define XPNTR(x) ((void *) (XPNTRVAL(x))) +# endif /* not DATA_SEG_BITS */ +#endif /* not HAVE_SHM */ + /* WARNING WARNING WARNING. You must ensure on your own that proper GC protection is provided for the elements in this array. */ @@ -774,6 +673,7 @@ #endif /* OK, you can open them again */ + /************************************************************************/ /* Definitions of basic Lisp objects */ @@ -847,12 +747,19 @@ #define NILP(x) EQ (x, Qnil) #define GC_NILP(x) GC_EQ (x, Qnil) -#define CHECK_LIST(x) \ - do { if ((!CONSP (x)) && !NILP (x)) dead_wrong_type_argument (Qlistp, x); } while (0) -#define CONCHECK_LIST(x) \ - do { if ((!CONSP (x)) && !NILP (x)) x = wrong_type_argument (Qlistp, x); } while (0) #define XCAR(a) (XCONS (a)->car) #define XCDR(a) (XCONS (a)->cdr) +#define LISTP(x) (CONSP(x) || NILP(x)) + +#define CHECK_LIST(x) do { \ + if (!LISTP (x)) \ + dead_wrong_type_argument (Qlistp, x); \ +} while (0) + +#define CONCHECK_LIST(x) do { \ + if (!LISTP (x)) \ + x = wrong_type_argument (Qlistp, x); \ +} while (0) /* For a list that's known to be in valid list format -- will abort() if the list is not in valid format */ @@ -875,6 +782,22 @@ signal_simple_error ("Invalid list format", listp); \ else +extern Lisp_Object Qnil; + +INLINE int TRUE_LIST_P (Lisp_Object object); +INLINE int +TRUE_LIST_P (Lisp_Object object) +{ + while (CONSP (object)) + object = XCDR (object); + return NILP (object); +} + +#define CHECK_TRUE_LIST(object) do { \ + if (!TRUE_LIST_P (object)) \ + dead_wrong_type_argument (Qtrue_list_p, object); \ +} while (0) + /* For a property list (alternating keywords/values) that may not be in valid list format -- will signal an error if the list is not in valid format. CONSVAR is used to keep track of the iterations @@ -944,6 +867,7 @@ #define string_length(s) ((s)->_size) #define XSTRING_LENGTH(s) string_length (XSTRING (s)) +#define XSTRING_CHAR_LENGTH(s) string_char_length (XSTRING (s)) #define string_data(s) ((s)->_data + 0) #define XSTRING_DATA(s) string_data (XSTRING (s)) #define string_byte(s, i) ((s)->_data[i] + 0) @@ -1057,10 +981,15 @@ #define BITP(x) (INTP (x) && (XINT (x) == 0 || XINT (x) == 1)) #define GC_BITP(x) (GC_INTP (x) && (XINT (x) == 0 || XINT (x) == 1)) -#define CHECK_BIT(x) \ - do { if (!BITP (x)) dead_wrong_type_argument (Qbitp, x); } while (0) -#define CONCHECK_BIT(x) \ - do { if (!BITP (x)) x = wrong_type_argument (Qbitp, x); } while (0) +#define CHECK_BIT(x) do { \ + if (!BITP (x)) \ + dead_wrong_type_argument (Qbitp, x);\ +} while (0) + +#define CONCHECK_BIT(x) do { \ + if (!BITP (x)) \ + x = wrong_type_argument (Qbitp, x); \ +} while (0) #define bit_vector_length(v) ((v)->size) #define bit_vector_next(v) ((v)->next) @@ -1239,18 +1168,21 @@ #define XFLOATINT(n) extract_float (n) -#define CHECK_INT_OR_FLOAT(x) \ - do { if ( !INTP (x) && !FLOATP (x)) \ - dead_wrong_type_argument (Qnumberp, (x)); } while (0) -#define CONCHECK_INT_OR_FLOAT(x) \ - do { if ( !INTP (x) && !FLOATP (x)) \ - x = wrong_type_argument (Qnumberp, (x)); } while (0) +#define CHECK_INT_OR_FLOAT(x) do { \ + if (!INT_OR_FLOATP (x)) \ + dead_wrong_type_argument (Qnumberp, x); \ +} while (0) + +#define CONCHECK_INT_OR_FLOAT(x) do { \ + if (!INT_OR_FLOATP (x)) \ + x = wrong_type_argument (Qnumberp, x); \ +} while (0) /* These are always continuable because they change their arguments even when no error is signalled. */ -#define CHECK_INT_OR_FLOAT_COERCE_MARKER(x) do \ -{ if (INTP (x) || FLOATP (x)) \ +#define CHECK_INT_OR_FLOAT_COERCE_MARKER(x) do { \ + if (INT_OR_FLOATP (x)) \ ; \ else if (MARKERP (x)) \ x = make_int (marker_position (x)); \ @@ -1258,8 +1190,8 @@ x = wrong_type_argument (Qnumber_or_marker_p, x); \ } while (0) -#define CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER(x) do \ -{ if (INTP (x) || FLOATP (x)) \ +#define CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER(x) do { \ + if (INT_OR_FLOATP (x)) \ ; \ else if (CHARP (x)) \ x = make_int (XCHAR (x)); \ @@ -1292,15 +1224,9 @@ #endif /* not LISP_FLOAT_TYPE */ -#ifdef USE_MINIMAL_TAGBITS -# define INTP(x) \ - (XTYPE (x) == Lisp_Type_Int_Even || XTYPE(x) == Lisp_Type_Int_Odd) -# define GC_INTP(x) \ - (XGCTYPE (x) == Lisp_Type_Int_Even || XGCTYPE(x) == Lisp_Type_Int_Odd) -#else -# define INTP(x) (XTYPE (x) == Lisp_Type_Int) -# define GC_INTP(x) (XGCTYPE (x) == Lisp_Type_Int) -#endif +/*********** int ***********/ + +#define GC_INTP(x) INTP (x) #define ZEROP(x) EQ (x, Qzero) #define GC_ZEROP(x) GC_EQ (x, Qzero) @@ -1315,14 +1241,6 @@ return XREALINT (obj); } -#else - -#define XINT(obj) XREALINT (obj) - -#endif - -#ifdef ERROR_CHECK_TYPECHECK - INLINE EMACS_INT XCHAR_OR_INT (Lisp_Object obj); INLINE EMACS_INT XCHAR_OR_INT (Lisp_Object obj) @@ -1331,41 +1249,39 @@ return CHARP (obj) ? XCHAR (obj) : XINT (obj); } -#else - -#define XCHAR_OR_INT(obj) (CHARP ((obj)) ? XCHAR ((obj)) : XINT ((obj))) - -#endif - -#ifdef USE_MINIMAL_TAGBITS -/* - * can't use CHECK_NONRECORD and CONCHECK_NONRECORD here because in - * the USE_MINIMAL_TAGBITS implementation Lisp integers have two types. - */ -# define CHECK_INT(x) do { \ - if (! INTP (x)) \ - dead_wrong_type_argument (Qintegerp, x); \ - } while (0) -# define CONCHECK_INT(x) do { \ - if (! INTP (x)) \ - x = wrong_type_argument (Qintegerp, x); \ - } while (0) -#else -# define CHECK_INT(x) CHECK_NONRECORD (x, Lisp_Type_Int, Qintegerp) -# define CONCHECK_INT(x) CONCHECK_NONRECORD (x, Lisp_Type_Int, Qintegerp) -#endif +#else /* no error checking */ + +#define XINT(obj) XREALINT (obj) +#define XCHAR_OR_INT(obj) (CHARP (obj) ? XCHAR (obj) : XINT (obj)) + +#endif /* no error checking */ + +#define CHECK_INT(x) do { \ + if (!INTP (x)) \ + dead_wrong_type_argument (Qintegerp, x); \ +} while (0) + +#define CONCHECK_INT(x) do { \ + if (!INTP (x)) \ + x = wrong_type_argument (Qintegerp, x); \ +} while (0) #define NATNUMP(x) (INTP (x) && XINT (x) >= 0) #define GC_NATNUMP(x) (GC_INTP (x) && XINT (x) >= 0) -#define CHECK_NATNUM(x) \ - do { if (!NATNUMP (x)) dead_wrong_type_argument (Qnatnump, x); } while (0) -#define CONCHECK_NATNUM(x) \ - do { if (!NATNUMP (x)) x = wrong_type_argument (Qnatnump, x); } while (0) +#define CHECK_NATNUM(x) do { \ + if (!NATNUMP (x)) \ + dead_wrong_type_argument (Qnatnump, x); \ +} while (0) + +#define CONCHECK_NATNUM(x) do { \ + if (!NATNUMP (x)) \ + x = wrong_type_argument (Qnatnump, x); \ +} while (0) /* next three always continuable because they coerce their arguments. */ -#define CHECK_INT_COERCE_CHAR(x) do \ -{ if (INTP (x)) \ +#define CHECK_INT_COERCE_CHAR(x) do { \ + if (INTP (x)) \ ; \ else if (CHARP (x)) \ x = make_int (XCHAR (x)); \ @@ -1373,8 +1289,8 @@ x = wrong_type_argument (Qinteger_or_char_p, x); \ } while (0) -#define CHECK_INT_COERCE_MARKER(x) do \ -{ if (INTP (x)) \ +#define CHECK_INT_COERCE_MARKER(x) do { \ + if (INTP (x)) \ ; \ else if (MARKERP (x)) \ x = make_int (marker_position (x)); \ @@ -1382,8 +1298,8 @@ x = wrong_type_argument (Qinteger_or_marker_p, x); \ } while (0) -#define CHECK_INT_COERCE_CHAR_OR_MARKER(x) do \ -{ if (INTP (x)) \ +#define CHECK_INT_COERCE_CHAR_OR_MARKER(x) do { \ + if (INTP (x)) \ ; \ else if (CHARP (x)) \ x = make_int (XCHAR (x)); \ @@ -1485,7 +1401,7 @@ { struct lcrecord_header header; Lisp_Object free; - int size; + size_t size; CONST struct lrecord_implementation *implementation; }; @@ -1498,7 +1414,7 @@ Lcrecord lists should never escape to the Lisp level, so functions should not be doing this. */ -Lisp_Object make_lcrecord_list (int size, +Lisp_Object make_lcrecord_list (size_t size, CONST struct lrecord_implementation *implementation); Lisp_Object allocate_managed_lcrecord (Lisp_Object lcrecord_list); @@ -1532,10 +1448,26 @@ the function. The docstring for the function is placed as a "C" comment between the prompt and the `args' argument. make-docfile reads the - comment and creates the DOC file form it. + comment and creates the DOC file from it. */ -#define SUBR_MAX_ARGS 12 +#define EXFUN_0 void +#define EXFUN_1 Lisp_Object +#define EXFUN_2 Lisp_Object,Lisp_Object +#define EXFUN_3 Lisp_Object,Lisp_Object,Lisp_Object +#define EXFUN_4 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object +#define EXFUN_5 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object +#define EXFUN_6 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object, \ +Lisp_Object +#define EXFUN_7 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object, \ +Lisp_Object,Lisp_Object +#define EXFUN_8 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object, \ +Lisp_Object,Lisp_Object,Lisp_Object +#define EXFUN_MANY int, Lisp_Object* +#define EXFUN_UNEVALLED Lisp_Object +#define EXFUN(sym, maxargs) Lisp_Object sym (EXFUN_##maxargs) + +#define SUBR_MAX_ARGS 8 #define MANY -2 #define UNEVALLED -1 @@ -1549,7 +1481,7 @@ #endif #define DEFUN(lname, Fname, minargs, maxargs, prompt, arglist) \ - Lisp_Object Fname (DEFUN_##maxargs arglist) ; /* See below */ \ + Lisp_Object Fname (EXFUN_##maxargs); \ static struct Lisp_Subr S##Fname = { subr_lheader_initializer, \ minargs, maxargs, prompt, 0, lname, (lisp_fn_t) Fname }; \ Lisp_Object Fname (DEFUN_##maxargs arglist) @@ -1561,21 +1493,17 @@ #define DEFUN_MANY(named_int, named_Lisp_Object) named_int, named_Lisp_Object #define DEFUN_UNEVALLED(args) Lisp_Object args #define DEFUN_0() void -#define DEFUN_1(a) Lisp_Object a -#define DEFUN_2(a,b) DEFUN_1(a), Lisp_Object b -#define DEFUN_3(a,b,c) DEFUN_2(a,b), Lisp_Object c -#define DEFUN_4(a,b,c,d) DEFUN_3(a,b,c), Lisp_Object d -#define DEFUN_5(a,b,c,d,e) DEFUN_4(a,b,c,d), Lisp_Object e -#define DEFUN_6(a,b,c,d,e,f) DEFUN_5(a,b,c,d,e), Lisp_Object f -#define DEFUN_7(a,b,c,d,e,f,g) DEFUN_6(a,b,c,d,e,f), Lisp_Object g -#define DEFUN_8(a,b,c,d,e,f,g,h) DEFUN_7(a,b,c,d,e,f,g), Lisp_Object h -#define DEFUN_9(a,b,c,d,e,f,g,h,i) DEFUN_8(a,b,c,d,e,f,g,h), Lisp_Object i -#define DEFUN_10(a,b,c,d,e,f,g,h,i,j) DEFUN_9(a,b,c,d,e,f,g,h,i), Lisp_Object j -#define DEFUN_11(a,b,c,d,e,f,g,h,i,j,k) DEFUN_10(a,b,c,d,e,f,g,h,i,j), Lisp_Object k -#define DEFUN_12(a,b,c,d,e,f,g,h,i,j,k,l) DEFUN_11(a,b,c,d,e,f,g,h,i,j,k), Lisp_Object l +#define DEFUN_1(a) Lisp_Object a +#define DEFUN_2(a,b) DEFUN_1(a), Lisp_Object b +#define DEFUN_3(a,b,c) DEFUN_2(a,b), Lisp_Object c +#define DEFUN_4(a,b,c,d) DEFUN_3(a,b,c), Lisp_Object d +#define DEFUN_5(a,b,c,d,e) DEFUN_4(a,b,c,d), Lisp_Object e +#define DEFUN_6(a,b,c,d,e,f) DEFUN_5(a,b,c,d,e), Lisp_Object f +#define DEFUN_7(a,b,c,d,e,f,g) DEFUN_6(a,b,c,d,e,f), Lisp_Object g +#define DEFUN_8(a,b,c,d,e,f,g,h) DEFUN_7(a,b,c,d,e,f,g),Lisp_Object h /* WARNING: If you add defines here for higher values of maxargs, - make sure to also fix the clauses in primitive_funcall(), + make sure to also fix the clauses in inline_funcall_fn(), and change the define of SUBR_MAX_ARGS above. */ #include "symeval.h" @@ -1602,23 +1530,23 @@ void signal_quit (void); /* Nonzero if ought to quit now. */ -#define QUITP \ - ((quit_check_signal_happened ? check_quit () : 0), \ - (!NILP (Vquit_flag) && (NILP (Vinhibit_quit) \ +#define QUITP \ + ((quit_check_signal_happened ? check_quit () : 0), \ + (!NILP (Vquit_flag) && (NILP (Vinhibit_quit) \ || EQ (Vquit_flag, Qcritical)))) /* QUIT used to call QUITP, but there are some places where QUITP is called directly, and check_what_happened() should only be called when Emacs is actually ready to quit because it could do things like switch threads. */ -#define INTERNAL_QUITP \ - ((something_happened ? check_what_happened () : 0), \ - (!NILP (Vquit_flag) && \ +#define INTERNAL_QUITP \ + ((something_happened ? check_what_happened () : 0), \ + (!NILP (Vquit_flag) && \ (NILP (Vinhibit_quit) || EQ (Vquit_flag, Qcritical)))) -#define INTERNAL_REALLY_QUITP \ - (check_what_happened (), \ - (!NILP (Vquit_flag) && \ +#define INTERNAL_REALLY_QUITP \ + (check_what_happened (), \ + (!NILP (Vquit_flag) && \ (NILP (Vinhibit_quit) || EQ (Vquit_flag, Qcritical)))) /* Check quit-flag and quit if it is non-nil. Also do any other things @@ -1647,7 +1575,7 @@ #define LISP_HASH(obj) ((unsigned long) LISP_TO_VOID (obj)) unsigned long string_hash (CONST void *xv); -unsigned long memory_hash (CONST void *xv, int size); +unsigned long memory_hash (CONST void *xv, size_t size); unsigned long internal_hash (Lisp_Object obj, int depth); unsigned long internal_array_hash (Lisp_Object *arr, int size, int depth); @@ -1723,12 +1651,18 @@ #ifdef DEBUG_GCPRO -void debug_gcpro1 (); -void debug_gcpro2 (); -void debug_gcpro3 (); -void debug_gcpro4 (); -void debug_gcpro5 (); -void debug_ungcpro(); +void debug_gcpro1 (char *, int, struct gcpro *, Lisp_Object *); +void debug_gcpro2 (char *, int, struct gcpro *, struct gcpro *, + Lisp_Object *, Lisp_Object *); +void debug_gcpro3 (char *, int, struct gcpro *, struct gcpro *, struct gcpro *, + Lisp_Object *, Lisp_Object *, Lisp_Object *); +void debug_gcpro4 (char *, int, struct gcpro *, struct gcpro *, struct gcpro *, + struct gcpro *, Lisp_Object *, Lisp_Object *, Lisp_Object *, + Lisp_Object *); +void debug_gcpro5 (char *, int, struct gcpro *, struct gcpro *, struct gcpro *, + struct gcpro *, struct gcpro *, Lisp_Object *, Lisp_Object *, + Lisp_Object *, Lisp_Object *, Lisp_Object *); +void debug_ungcpro(char *, int, struct gcpro *); #define GCPRO1(v) \ debug_gcpro1 (__FILE__, __LINE__,&gcpro1,&v) @@ -1887,39 +1821,39 @@ #endif /* Evaluate expr, UNGCPRO, and then return the value of expr. */ -#define RETURN_UNGCPRO(expr) do \ -{ \ - Lisp_Object ret_ungc_val = (expr); \ - UNGCPRO; \ - RETURN__ ret_ungc_val; \ +#define RETURN_UNGCPRO(expr) do \ +{ \ + Lisp_Object ret_ungc_val = (expr); \ + UNGCPRO; \ + RETURN__ ret_ungc_val; \ } while (0) /* Evaluate expr, NUNGCPRO, UNGCPRO, and then return the value of expr. */ -#define RETURN_NUNGCPRO(expr) do \ -{ \ - Lisp_Object ret_ungc_val = (expr); \ - NUNGCPRO; \ - UNGCPRO; \ - RETURN__ ret_ungc_val; \ +#define RETURN_NUNGCPRO(expr) do \ +{ \ + Lisp_Object ret_ungc_val = (expr); \ + NUNGCPRO; \ + UNGCPRO; \ + RETURN__ ret_ungc_val; \ } while (0) /* Evaluate expr, NNUNGCPRO, NUNGCPRO, UNGCPRO, and then return the value of expr. */ -#define RETURN_NNUNGCPRO(expr) do \ -{ \ - Lisp_Object ret_ungc_val = (expr); \ - NNUNGCPRO; \ - NUNGCPRO; \ - UNGCPRO; \ - RETURN__ ret_ungc_val; \ +#define RETURN_NNUNGCPRO(expr) do \ +{ \ + Lisp_Object ret_ungc_val = (expr); \ + NNUNGCPRO; \ + NUNGCPRO; \ + UNGCPRO; \ + RETURN__ ret_ungc_val; \ } while (0) /* Evaluate expr, return it if it's not Qunbound. */ -#define RETURN_IF_NOT_UNBOUND(expr) do \ -{ \ - Lisp_Object ret_nunb_val = (expr); \ - if (!UNBOUNDP (ret_nunb_val)) \ - RETURN__ ret_nunb_val; \ +#define RETURN_IF_NOT_UNBOUND(expr) do \ +{ \ + Lisp_Object ret_nunb_val = (expr); \ + if (!UNBOUNDP (ret_nunb_val)) \ + RETURN__ ret_nunb_val; \ } while (0) /* Call staticpro (&var) to protect static variable `var'. */ @@ -1998,10 +1932,877 @@ typedef unsigned long long uintptr_t; #else /* Just pray. May break, may not. */ -typedef char *intptr_t; -typedef char *uintptr_t; +typedef long intptr_t; +typedef unsigned long uintptr_t; +#endif + +/* Defined in alloc.c */ +void release_breathing_space (void); +Lisp_Object noseeum_cons (Lisp_Object, Lisp_Object); +Lisp_Object make_vector (EMACS_INT, Lisp_Object); +Lisp_Object vector1 (Lisp_Object); +Lisp_Object vector2 (Lisp_Object, Lisp_Object); +Lisp_Object vector3 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object make_bit_vector (EMACS_INT, Lisp_Object); +Lisp_Object make_bit_vector_from_byte_vector (unsigned char *, EMACS_INT); +Lisp_Object noseeum_make_marker (void); +void garbage_collect_1 (void); +Lisp_Object acons (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object cons3 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object list1 (Lisp_Object); +Lisp_Object list2 (Lisp_Object, Lisp_Object); +Lisp_Object list3 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object list4 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object); +Lisp_Object list6 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object); +DECLARE_DOESNT_RETURN (memory_full (void)); +void disksave_object_finalization (void); +extern int purify_flag; +extern int gc_currently_forbidden; +Lisp_Object restore_gc_inhibit (Lisp_Object); +extern EMACS_INT gc_generation_number[1]; +int purified (Lisp_Object); +Lisp_Object build_string (CONST char *); +Lisp_Object build_ext_string (CONST char *, enum external_data_format); +Lisp_Object build_translated_string (CONST char *); +Lisp_Object make_string (CONST Bufbyte *, Bytecount); +Lisp_Object make_ext_string (CONST Extbyte *, EMACS_INT, + enum external_data_format); +Lisp_Object make_uninit_string (Bytecount); +Lisp_Object make_float (double); +size_t purespace_usage (void); +void report_pure_usage (int, int); +Lisp_Object make_pure_string (CONST Bufbyte *, Bytecount, Lisp_Object, int); +Lisp_Object make_pure_pname (CONST Bufbyte *, Bytecount, int); +Lisp_Object pure_cons (Lisp_Object, Lisp_Object); +Lisp_Object pure_list (int, Lisp_Object *); +Lisp_Object make_pure_vector (size_t, Lisp_Object); +void free_cons (struct Lisp_Cons *); +void free_list (Lisp_Object); +void free_alist (Lisp_Object); +void mark_conses_in_list (Lisp_Object); +void free_marker (struct Lisp_Marker *); +int object_dead_p (Lisp_Object); + +#ifdef MEMORY_USAGE_STATS +size_t malloced_storage_size (void *, size_t, struct overhead_stats *); +size_t fixed_type_block_overhead (size_t); +#endif + +/* Defined in buffer.c */ +Lisp_Object make_buffer (struct buffer *); +Lisp_Object get_truename_buffer (Lisp_Object); +void switch_to_buffer (Lisp_Object, Lisp_Object); +extern int find_file_compare_truenames; +extern int find_file_use_truenames; + +/* Defined in callproc.c */ +char *egetenv (CONST char *); + +/* Defined in console.c */ +void stuff_buffered_input (Lisp_Object); + +/* Defined in data.c */ +DECLARE_DOESNT_RETURN (pure_write_error (void)); +DECLARE_DOESNT_RETURN (args_out_of_range (Lisp_Object, Lisp_Object)); +DECLARE_DOESNT_RETURN (args_out_of_range_3 (Lisp_Object, Lisp_Object, + Lisp_Object)); +Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object); +DECLARE_DOESNT_RETURN (dead_wrong_type_argument (Lisp_Object, Lisp_Object)); +void check_int_range (int, int, int); +Lisp_Object word_to_lisp (unsigned int); +unsigned int lisp_to_word (Lisp_Object); + +/* Defined in dired.c */ +Lisp_Object make_directory_hash_table (char *); +Lisp_Object wasteful_word_to_lisp (unsigned int); + +/* Defined in doc.c */ +Lisp_Object unparesseuxify_doc_string (int, EMACS_INT, char *, Lisp_Object); +Lisp_Object read_doc_string (Lisp_Object); + +/* Defined in doprnt.c */ +Bytecount emacs_doprnt_c (Lisp_Object, CONST Bufbyte *, Lisp_Object, + Bytecount, ...); +Bytecount emacs_doprnt_va (Lisp_Object, CONST Bufbyte *, Lisp_Object, + Bytecount, va_list); +Bytecount emacs_doprnt_lisp (Lisp_Object, CONST Bufbyte *, Lisp_Object, + Bytecount, int, CONST Lisp_Object *); +Bytecount emacs_doprnt_lisp_2 (Lisp_Object, CONST Bufbyte *, Lisp_Object, + Bytecount, int, ...); +Lisp_Object emacs_doprnt_string_c (CONST Bufbyte *, Lisp_Object, + Bytecount, ...); +Lisp_Object emacs_doprnt_string_va (CONST Bufbyte *, Lisp_Object, + Bytecount, va_list); +Lisp_Object emacs_doprnt_string_lisp (CONST Bufbyte *, Lisp_Object, + Bytecount, int, CONST Lisp_Object *); +Lisp_Object emacs_doprnt_string_lisp_2 (CONST Bufbyte *, Lisp_Object, + Bytecount, int, ...); + +/* Defined in editfns.c */ +Bufpos bufpos_clip_to_bounds (Bufpos, Bufpos, Bufpos); +Bytind bytind_clip_to_bounds (Bytind, Bytind, Bytind); +void buffer_insert1 (struct buffer *, Lisp_Object); +Lisp_Object make_string_from_buffer (struct buffer *, int, int); +Lisp_Object save_excursion_save (void); +Lisp_Object save_restriction_save (void); +Lisp_Object save_excursion_restore (Lisp_Object); +Lisp_Object save_restriction_restore (Lisp_Object); + +/* Defined in emacsfns.c */ +Lisp_Object save_current_buffer_restore (Lisp_Object); + +/* Defined in emacs.c */ +DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (fatal (CONST char *, + ...), 1, 2); +int stderr_out (CONST char *, ...) PRINTF_ARGS (1, 2); +int stdout_out (CONST char *, ...) PRINTF_ARGS (1, 2); +SIGTYPE fatal_error_signal (int); +Lisp_Object make_arg_list (int, char **); +void make_argc_argv (Lisp_Object, int *, char ***); +void free_argc_argv (char **); +Lisp_Object decode_env_path (CONST char *, CONST char *); +Lisp_Object decode_path (CONST char *); +/* Nonzero means don't do interactive redisplay and don't change tty modes */ +extern int noninteractive; +extern int preparing_for_armageddon; +extern int emacs_priority; +extern int running_asynch_code; +extern int suppress_early_error_handler_backtrace; + +/* Defined in eval.c */ +DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, Lisp_Object)); +void maybe_signal_error (Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior); +Lisp_Object maybe_signal_continuable_error (Lisp_Object, Lisp_Object, + Lisp_Object, Error_behavior); +DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error (CONST char *, + ...), 1, 2); +void maybe_error (Lisp_Object, Error_behavior, CONST char *, + ...) PRINTF_ARGS (3, 4); +Lisp_Object continuable_error (CONST char *, ...) PRINTF_ARGS (1, 2); +Lisp_Object maybe_continuable_error (Lisp_Object, Error_behavior, + CONST char *, ...) PRINTF_ARGS (3, 4); +DECLARE_DOESNT_RETURN (signal_simple_error (CONST char *, Lisp_Object)); +void maybe_signal_simple_error (CONST char *, Lisp_Object, + Lisp_Object, Error_behavior); +Lisp_Object signal_simple_continuable_error (CONST char *, Lisp_Object); +Lisp_Object maybe_signal_simple_continuable_error (CONST char *, Lisp_Object, + Lisp_Object, Error_behavior); +DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error_with_frob + (Lisp_Object, CONST char *, + ...), 2, 3); +void maybe_error_with_frob (Lisp_Object, Lisp_Object, Error_behavior, + CONST char *, ...) PRINTF_ARGS (4, 5); +Lisp_Object continuable_error_with_frob (Lisp_Object, CONST char *, + ...) PRINTF_ARGS (2, 3); +Lisp_Object maybe_continuable_error_with_frob +(Lisp_Object, Lisp_Object, Error_behavior, CONST char *, ...) PRINTF_ARGS (4, 5); +DECLARE_DOESNT_RETURN (signal_simple_error_2 (CONST char *, + Lisp_Object, Lisp_Object)); +void maybe_signal_simple_error_2 (CONST char *, Lisp_Object, Lisp_Object, + Lisp_Object, Error_behavior); +Lisp_Object signal_simple_continuable_error_2 (CONST char *, + Lisp_Object, Lisp_Object); +Lisp_Object maybe_signal_simple_continuable_error_2 (CONST char *, Lisp_Object, + Lisp_Object, Lisp_Object, + Error_behavior); +Lisp_Object funcall_recording_as (Lisp_Object, int, Lisp_Object *); +Lisp_Object run_hook_with_args_in_buffer (struct buffer *, int, Lisp_Object *, + enum run_hooks_condition); +Lisp_Object run_hook_with_args (int, Lisp_Object *, enum run_hooks_condition); +void va_run_hook_with_args (Lisp_Object, int, ...); +void va_run_hook_with_args_in_buffer (struct buffer *, Lisp_Object, int, ...); +Lisp_Object run_hook (Lisp_Object); +Lisp_Object apply1 (Lisp_Object, Lisp_Object); +Lisp_Object call0 (Lisp_Object); +Lisp_Object call1 (Lisp_Object, Lisp_Object); +Lisp_Object call2 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object call3 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object call4 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object); +Lisp_Object call5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object); +Lisp_Object call6 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object call7 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object call8 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object); +Lisp_Object call0_in_buffer (struct buffer *, Lisp_Object); +Lisp_Object call1_in_buffer (struct buffer *, Lisp_Object, Lisp_Object); +Lisp_Object call2_in_buffer (struct buffer *, Lisp_Object, Lisp_Object, + Lisp_Object); +Lisp_Object call3_in_buffer (struct buffer *, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object); +Lisp_Object call4_in_buffer (struct buffer *, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object call5_in_buffer (struct buffer *, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object); +Lisp_Object call6_in_buffer (struct buffer *, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object); +Lisp_Object eval_in_buffer (struct buffer *, Lisp_Object); +Lisp_Object call0_with_handler (Lisp_Object, Lisp_Object); +Lisp_Object call1_with_handler (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object eval_in_buffer_trapping_errors (CONST char *, struct buffer *, + Lisp_Object); +Lisp_Object run_hook_trapping_errors (CONST char *, Lisp_Object); +Lisp_Object safe_run_hook_trapping_errors (CONST char *, Lisp_Object, int); +Lisp_Object call0_trapping_errors (CONST char *, Lisp_Object); +Lisp_Object call1_trapping_errors (CONST char *, Lisp_Object, Lisp_Object); +Lisp_Object call2_trapping_errors (CONST char *, + Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object call_with_suspended_errors (lisp_fn_t, volatile Lisp_Object, Lisp_Object, + Error_behavior, int, ...); +/* C Code should be using internal_catch, record_unwind_p, condition_case_1 */ +Lisp_Object internal_catch (Lisp_Object, Lisp_Object (*) (Lisp_Object), + Lisp_Object, int * volatile); +Lisp_Object condition_case_1 (Lisp_Object, + Lisp_Object (*) (Lisp_Object), + Lisp_Object, + Lisp_Object (*) (Lisp_Object, Lisp_Object), + Lisp_Object); +Lisp_Object condition_case_3 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object unbind_to (int, Lisp_Object); +void specbind (Lisp_Object, Lisp_Object); +void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); +void do_autoload (Lisp_Object, Lisp_Object); +Lisp_Object un_autoload (Lisp_Object); +void warn_when_safe_lispobj (Lisp_Object, Lisp_Object, Lisp_Object); +void warn_when_safe (Lisp_Object, Lisp_Object, CONST char *, + ...) PRINTF_ARGS (3, 4); + + +/* Defined in event-stream.c */ +void wait_delaying_user_input (int (*) (void *), void *); +int detect_input_pending (void); +void reset_this_command_keys (Lisp_Object, int); +Lisp_Object enqueue_misc_user_event (Lisp_Object, Lisp_Object, Lisp_Object); + +/* Defined in event-Xt.c */ +void signal_special_Xt_user_event (Lisp_Object, Lisp_Object, Lisp_Object); + + +/* Defined in events.c */ +void clear_event_resource (void); +Lisp_Object allocate_event (void); +int event_to_character (struct Lisp_Event *, int, int, int); + +/* Defined in fileio.c */ +void record_auto_save (void); +void force_auto_save_soon (void); +DECLARE_DOESNT_RETURN (report_file_error (CONST char *, Lisp_Object)); +void maybe_report_file_error (CONST char *, Lisp_Object, + Lisp_Object, Error_behavior); +DECLARE_DOESNT_RETURN (signal_file_error (CONST char *, Lisp_Object)); +void maybe_signal_file_error (CONST char *, Lisp_Object, + Lisp_Object, Error_behavior); +DECLARE_DOESNT_RETURN (signal_double_file_error (CONST char *, CONST char *, + Lisp_Object)); +void maybe_signal_double_file_error (CONST char *, CONST char *, + Lisp_Object, Lisp_Object, Error_behavior); +DECLARE_DOESNT_RETURN (signal_double_file_error_2 (CONST char *, CONST char *, + Lisp_Object, Lisp_Object)); +void maybe_signal_double_file_error_2 (CONST char *, CONST char *, + Lisp_Object, Lisp_Object, Lisp_Object, + Error_behavior); +Lisp_Object lisp_strerror (int); +Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object); +int read_allowing_quit (int, void *, size_t); +int write_allowing_quit (int, CONST void *, size_t); +int internal_delete_file (Lisp_Object); + +/* Defined in filelock.c */ +void lock_file (Lisp_Object); +void unlock_file (Lisp_Object); +void unlock_all_files (void); +void unlock_buffer (struct buffer *); + +/* Defined in filemode.c */ +void filemodestring (struct stat *, char *); + +/* Defined in floatfns.c */ +double extract_float (Lisp_Object); + +/* Defined in fns.c */ +Lisp_Object list_sort (Lisp_Object, Lisp_Object, + int (*) (Lisp_Object, Lisp_Object, Lisp_Object)); +Lisp_Object merge (Lisp_Object, Lisp_Object, Lisp_Object); + +void bump_string_modiff (Lisp_Object); +Lisp_Object memq_no_quit (Lisp_Object, Lisp_Object); +Lisp_Object assoc_no_quit (Lisp_Object, Lisp_Object); +Lisp_Object assq_no_quit (Lisp_Object, Lisp_Object); +Lisp_Object rassq_no_quit (Lisp_Object, Lisp_Object); +Lisp_Object delq_no_quit (Lisp_Object, Lisp_Object); +Lisp_Object delq_no_quit_and_free_cons (Lisp_Object, Lisp_Object); +Lisp_Object remassoc_no_quit (Lisp_Object, Lisp_Object); +Lisp_Object remassq_no_quit (Lisp_Object, Lisp_Object); +Lisp_Object remrassq_no_quit (Lisp_Object, Lisp_Object); + +void pure_put (Lisp_Object, Lisp_Object, Lisp_Object); +int plists_differ (Lisp_Object, Lisp_Object, int, int, int); +Lisp_Object internal_plist_get (Lisp_Object, Lisp_Object); +void internal_plist_put (Lisp_Object *, Lisp_Object, Lisp_Object); +int internal_remprop (Lisp_Object *, Lisp_Object); +Lisp_Object external_plist_get (Lisp_Object *, Lisp_Object, + int, Error_behavior); +void external_plist_put (Lisp_Object *, Lisp_Object, + Lisp_Object, int, Error_behavior); +int external_remprop (Lisp_Object *, Lisp_Object, int, Error_behavior); +int internal_equal (Lisp_Object, Lisp_Object, int); +Lisp_Object concat2 (Lisp_Object, Lisp_Object); +Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object vconcat2 (Lisp_Object, Lisp_Object); +Lisp_Object vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object nconc2 (Lisp_Object, Lisp_Object); +void check_losing_bytecode (CONST char *, Lisp_Object); + +/* Defined in getloadavg.c */ +int getloadavg (double[], int); + +/* Defined in glyphs.c */ +Error_behavior decode_error_behavior_flag (Lisp_Object); +Lisp_Object encode_error_behavior_flag (Error_behavior); + +/* Defined in indent.c */ +int bi_spaces_at_point (struct buffer *, Bytind); +int column_at_point (struct buffer *, Bufpos, int); +int current_column (struct buffer *); +void invalidate_current_column (void); +Bufpos vmotion (struct window *, Bufpos, int, int *); + +/* Defined in keymap.c */ +void where_is_to_char (Lisp_Object, char *); + +/* Defined in lread.c */ +void ebolify_bytecode_constants (Lisp_Object); +void close_load_descs (void); +int locate_file (Lisp_Object, Lisp_Object, CONST char *, Lisp_Object *, int); +int isfloat_string (CONST char *); + +/* Well, I've decided to enable this. -- ben */ +/* And I've decided to make it work right. -- sb */ +#define LOADHIST +/* Define the following symbol to enable load history of dumped files */ +#define LOADHIST_DUMPED +/* Define the following symbol to enable load history of C source */ +#define LOADHIST_BUILTIN + +#ifdef LOADHIST /* this is just a stupid idea */ +#define LOADHIST_ATTACH(x) \ + do { if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); } \ + while (0) +#else /*! LOADHIST */ +# define LOADHIST_ATTACH(x) +#endif /*! LOADHIST */ + +/* Defined in marker.c */ +Bytind bi_marker_position (Lisp_Object); +Bufpos marker_position (Lisp_Object); +void set_bi_marker_position (Lisp_Object, Bytind); +void set_marker_position (Lisp_Object, Bufpos); +void unchain_marker (Lisp_Object); +Lisp_Object noseeum_copy_marker (Lisp_Object, Lisp_Object); +Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object); +#ifdef MEMORY_USAGE_STATS +int compute_buffer_marker_usage (struct buffer *, struct overhead_stats *); #endif -#include "emacsfns.h" +/* Defined in menubar.c */ +extern int popup_menu_up_p; +extern int menubar_show_keybindings; +extern int popup_menu_titles; + +/* Defined in minibuf.c */ +extern int minibuf_level; +Charcount scmp_1 (CONST Bufbyte *, CONST Bufbyte *, Charcount, int); +#define scmp(s1, s2, len) scmp_1 (s1, s2, len, completion_ignore_case) +extern int completion_ignore_case; +int regexp_ignore_completion_p (CONST Bufbyte *, Lisp_Object, + Bytecount, Bytecount); +Lisp_Object clear_echo_area (struct frame *, Lisp_Object, int); +Lisp_Object clear_echo_area_from_print (struct frame *, Lisp_Object, int); +void echo_area_append (struct frame *, CONST Bufbyte *, Lisp_Object, + Bytecount, Bytecount, Lisp_Object); +void echo_area_message (struct frame *, CONST Bufbyte *, Lisp_Object, + Bytecount, Bytecount, Lisp_Object); +Lisp_Object echo_area_status (struct frame *); +int echo_area_active (struct frame *); +Lisp_Object echo_area_contents (struct frame *); +void message_internal (CONST Bufbyte *, Lisp_Object, Bytecount, Bytecount); +void message_append_internal (CONST Bufbyte *, Lisp_Object, + Bytecount, Bytecount); +void message (CONST char *, ...) PRINTF_ARGS (1, 2); +void message_append (CONST char *, ...) PRINTF_ARGS (1, 2); +void message_no_translate (CONST char *, ...) PRINTF_ARGS (1, 2); +void clear_message (void); + +/* Defined in print.c */ +void write_string_to_stdio_stream (FILE *, struct console *, + CONST Bufbyte *, Bytecount, Bytecount, + enum external_data_format); +void debug_print (Lisp_Object); +void debug_short_backtrace (int); +void temp_output_buffer_setup (CONST char *); +void temp_output_buffer_show (Lisp_Object, Lisp_Object); +/* NOTE: Do not call this with the data of a Lisp_String. Use princ. + * Note: stream should be defaulted before calling + * (eg Qnil means stdout, not Vstandard_output, etc) */ +void write_c_string (CONST char *, Lisp_Object); +/* Same goes for this function. */ +void write_string_1 (CONST Bufbyte *, Bytecount, Lisp_Object); +void print_cons (Lisp_Object, Lisp_Object, int); +void print_vector (Lisp_Object, Lisp_Object, int); +void print_string (Lisp_Object, Lisp_Object, int); +void print_internal (Lisp_Object, Lisp_Object, int); +void print_symbol (Lisp_Object, Lisp_Object, int); +void print_float (Lisp_Object, Lisp_Object, int); +void print_compiled_function (Lisp_Object, Lisp_Object, int); +extern int print_escape_newlines; +extern int print_readably; +Lisp_Object internal_with_output_to_temp_buffer (CONST char *, + Lisp_Object (*) (Lisp_Object), + Lisp_Object, Lisp_Object); +void float_to_string (char *, double); +void internal_object_printer (Lisp_Object, Lisp_Object, int); + +/* Defined in profile.c */ +void mark_profiling_info (void (*) (Lisp_Object)); +void profile_increase_call_count (Lisp_Object); +extern int profiling_active; +extern int profiling_redisplay_flag; + +/* Defined in rangetab.c */ +void put_range_table (Lisp_Object, EMACS_INT, EMACS_INT, Lisp_Object); +int unified_range_table_bytes_needed (Lisp_Object); +int unified_range_table_bytes_used (void *); +void unified_range_table_copy_data (Lisp_Object, void *); +Lisp_Object unified_range_table_lookup (void *, EMACS_INT, Lisp_Object); +int unified_range_table_nentries (void *); +void unified_range_table_get_range (void *, int, EMACS_INT *, EMACS_INT *, + Lisp_Object *); + +/* Defined in search.c */ +struct re_pattern_buffer; +struct re_registers; +Bufpos scan_buffer (struct buffer *, Emchar, Bufpos, Bufpos, int, int *, int); +Bufpos find_next_newline (struct buffer *, Bufpos, int); +Bufpos find_next_newline_no_quit (struct buffer *, Bufpos, int); +Bytind bi_find_next_newline_no_quit (struct buffer *, Bytind, int); +Bufpos find_before_next_newline (struct buffer *, Bufpos, Bufpos, int); +struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *, + char *, int, Error_behavior); +Bytecount fast_string_match (Lisp_Object, CONST Bufbyte *, + Lisp_Object, Bytecount, + Bytecount, int, Error_behavior, int); +Bytecount fast_lisp_string_match (Lisp_Object, Lisp_Object); +void restore_match_data (void); + +/* Defined in signal.c */ +void init_interrupts_late (void); +extern int dont_check_for_quit; +void begin_dont_check_for_quit (void); +void emacs_sleep (int); + +/* Defined in sound.c */ +void init_device_sound (struct device *); + +/* Defined in specifier.c */ +Lisp_Object specifier_instance (Lisp_Object, Lisp_Object, Lisp_Object, + Error_behavior, int, int, Lisp_Object); +Lisp_Object specifier_instance_no_quit (Lisp_Object, Lisp_Object, Lisp_Object, + Error_behavior, int, Lisp_Object); + +/* Defined in symbols.c */ +int hash_string (CONST Bufbyte *, Bytecount); +Lisp_Object intern (CONST char *); +Lisp_Object oblookup (Lisp_Object, CONST Bufbyte *, Bytecount); +void map_obarray (Lisp_Object, int (*) (Lisp_Object, void *), void *); +Lisp_Object indirect_function (Lisp_Object, int); +Lisp_Object symbol_value_in_buffer (Lisp_Object, Lisp_Object); +void kill_buffer_local_variables (struct buffer *); +int symbol_value_buffer_local_info (Lisp_Object, struct buffer *); +Lisp_Object find_symbol_value (Lisp_Object); +Lisp_Object find_symbol_value_quickly (Lisp_Object, int); +Lisp_Object top_level_value (Lisp_Object); + +/* Defined in syntax.c */ +int scan_words (struct buffer *, int, int); + +/* Defined in undo.c */ +Lisp_Object truncate_undo_list (Lisp_Object, int, int); +void record_extent (Lisp_Object, int); +void record_insert (struct buffer *, Bufpos, Charcount); +void record_delete (struct buffer *, Bufpos, Charcount); +void record_change (struct buffer *, Bufpos, Charcount); + +/* Defined in unex*.c */ +int unexec (char *, char *, uintptr_t, uintptr_t, uintptr_t); +#ifdef RUN_TIME_REMAP +int run_time_remap (char *); +#endif + +/* Defined in vm-limit.c */ +void memory_warnings (void *, void (*) (CONST char *)); + +/* Defined in window.c */ +Lisp_Object save_window_excursion_unwind (Lisp_Object); +Lisp_Object display_buffer (Lisp_Object, Lisp_Object, Lisp_Object); + +/* The following were machine generated 19980312 */ + + +EXFUN (Faccept_process_output, 3); +EXFUN (Fadd1, 1); +EXFUN (Fadd_spec_to_specifier, 5); +EXFUN (Fadd_timeout, 4); +EXFUN (Fappend, MANY); +EXFUN (Fapply, MANY); +EXFUN (Faref, 2); +EXFUN (Faset, 3); +EXFUN (Fassoc, 2); +EXFUN (Fassq, 2); +EXFUN (Fbacktrace, 2); +EXFUN (Fbeginning_of_line, 2); +EXFUN (Fbobp, 1); +EXFUN (Fbolp, 1); +EXFUN (Fboundp, 1); +EXFUN (Fbuffer_substring, 3); +EXFUN (Fbuilt_in_variable_type, 1); +EXFUN (Fbyte_code, 3); +EXFUN (Fcall_interactively, 3); +EXFUN (Fcanonicalize_lax_plist, 2); +EXFUN (Fcanonicalize_plist, 2); +EXFUN (Fcar, 1); +EXFUN (Fcar_safe, 1); +EXFUN (Fcdr, 1); +EXFUN (Fchar_after, 2); +EXFUN (Fchar_to_string, 1); +EXFUN (Fcheck_valid_plist, 1); +EXFUN (Fclear_range_table, 1); +EXFUN (Fclrhash, 1); +EXFUN (Fcoding_category_list, 0); +EXFUN (Fcoding_category_system, 1); +EXFUN (Fcoding_priority_list, 0); +EXFUN (Fcoding_system_charset, 2); +EXFUN (Fcoding_system_doc_string, 1); +EXFUN (Fcoding_system_list, 0); +EXFUN (Fcoding_system_name, 1); +EXFUN (Fcoding_system_p, 1); +EXFUN (Fcoding_system_property, 2); +EXFUN (Fcoding_system_type, 1); +EXFUN (Fcommand_execute, 3); +EXFUN (Fcommandp, 1); +EXFUN (Fcompiled_function_domain, 1); +EXFUN (Fconcat, MANY); +EXFUN (Fcons, 2); +EXFUN (Fcopy_alist, 1); +EXFUN (Fcopy_coding_system, 2); +EXFUN (Fcopy_event, 2); +EXFUN (Fcopy_marker, 2); +EXFUN (Fcopy_sequence, 1); +EXFUN (Fcopy_tree, 2); +EXFUN (Fcurrent_window_configuration, 1); +EXFUN (Fdecode_big5_char, 1); +EXFUN (Fdecode_coding_region, 4); +EXFUN (Fdecode_shift_jis_char, 1); +EXFUN (Fdefault_boundp, 1); +EXFUN (Fdefault_value, 1); +EXFUN (Fdefine_key, 3); +EXFUN (Fdelete_region, 3); +EXFUN (Fdelq, 2); +EXFUN (Fdestructive_alist_to_plist, 1); +EXFUN (Fdetect_coding_region, 3); +EXFUN (Fdgettext, 2); +EXFUN (Fding, 3); +EXFUN (Fdirectory_file_name, 1); +EXFUN (Fdisable_timeout, 1); +EXFUN (Fdiscard_input, 0); +EXFUN (Fdispatch_event, 1); +EXFUN (Fdisplay_error, 2); +EXFUN (Fdo_auto_save, 2); +EXFUN (Fdowncase, 2); +EXFUN (Felt, 2); +EXFUN (Fencode_big5_char, 1); +EXFUN (Fencode_coding_region, 4); +EXFUN (Fencode_shift_jis_char, 1); +EXFUN (Fend_of_line, 2); +EXFUN (Fenqueue_eval_event, 2); +EXFUN (Feobp, 1); +EXFUN (Feolp, 1); +EXFUN (Fequal, 2); +EXFUN (Ferror_message_string, 1); +EXFUN (Feval, 1); +EXFUN (Fevent_to_character, 4); +EXFUN (Fexecute_kbd_macro, 2); +EXFUN (Fexpand_abbrev, 0); +EXFUN (Fexpand_file_name, 2); +EXFUN (Fextent_at, 5); +EXFUN (Fextent_property, 3); +EXFUN (Ffboundp, 1); +EXFUN (Ffile_accessible_directory_p, 1); +EXFUN (Ffile_directory_p, 1); +EXFUN (Ffile_executable_p, 1); +EXFUN (Ffile_exists_p, 1); +EXFUN (Ffile_name_absolute_p, 1); +EXFUN (Ffile_name_as_directory, 1); +EXFUN (Ffile_name_directory, 1); +EXFUN (Ffile_name_nondirectory, 1); +EXFUN (Ffile_readable_p, 1); +EXFUN (Ffile_symlink_p, 1); +EXFUN (Ffile_truename, 2); +EXFUN (Ffind_coding_system, 1); +EXFUN (Ffind_file_name_handler, 2); +EXFUN (Ffollowing_char, 1); +EXFUN (Fformat, MANY); +EXFUN (Fforward_char, 2); +EXFUN (Fforward_line, 2); +EXFUN (Ffset, 2); +EXFUN (Ffuncall, MANY); +EXFUN (Fgeq, 2); +EXFUN (Fget, 3); +EXFUN (Fget_buffer_process, 1); +EXFUN (Fget_coding_system, 1); +EXFUN (Fget_process, 1); +EXFUN (Fget_range_table, 3); +EXFUN (Fgethash, 3); +EXFUN (Fgettext, 1); +EXFUN (Fgoto_char, 2); +EXFUN (Fgtr, 2); +EXFUN (Fhashtablep, 1); +EXFUN (Findent_to, 3); +EXFUN (Findirect_function, 1); +EXFUN (Finsert, MANY); +EXFUN (Finsert_buffer_substring, 3); +EXFUN (Finsert_char, 4); +EXFUN (Finsert_file_contents_internal, 7); +EXFUN (Finteractive_p, 0); +EXFUN (Fintern, 2); +EXFUN (Fintern_soft, 2); +EXFUN (Fkey_description, 1); +EXFUN (Fkill_emacs, 1); +EXFUN (Fkill_local_variable, 1); +EXFUN (Flax_plist_get, 3); +EXFUN (Flax_plist_remprop, 2); +EXFUN (Flength, 1); +EXFUN (Fleq, 2); +EXFUN (Flist, MANY); +EXFUN (Flistp, 1); +EXFUN (Flss, 2); +EXFUN (Fmake_byte_code, MANY); +EXFUN (Fmake_coding_system, 4); +EXFUN (Fmake_glyph_internal, 1); +EXFUN (Fmake_hashtable, 2); +EXFUN (Fmake_list, 2); +EXFUN (Fmake_marker, 0); +EXFUN (Fmake_range_table, 0); +EXFUN (Fmake_sparse_keymap, 1); +EXFUN (Fmake_string, 2); +EXFUN (Fmake_symbol, 1); +EXFUN (Fmake_vector, 2); +EXFUN (Fmapcar, 2); +EXFUN (Fmarker_buffer, 1); +EXFUN (Fmarker_position, 1); +EXFUN (Fmatch_beginning, 1); +EXFUN (Fmatch_end, 1); +EXFUN (Fmax, MANY); +EXFUN (Fmember, 2); +EXFUN (Fmemq, 2); +EXFUN (Fmin, MANY); +EXFUN (Fminus, MANY); +EXFUN (Fnarrow_to_region, 3); +EXFUN (Fnconc, MANY); +EXFUN (Fnext_event, 2); +EXFUN (Fnreverse, 1); +EXFUN (Fnthcdr, 2); +EXFUN (Fnumber_to_string, 1); +EXFUN (Fold_assq, 2); +EXFUN (Fold_equal, 2); +EXFUN (Fold_member, 2); +EXFUN (Fold_memq, 2); +EXFUN (Fplist_get, 3); +EXFUN (Fplist_put, 3); +EXFUN (Fplus, MANY); +EXFUN (Fpoint, 1); +EXFUN (Fpoint_marker, 2); +EXFUN (Fpoint_max, 1); +EXFUN (Fpoint_min, 1); +EXFUN (Fpreceding_char, 1); +EXFUN (Fprefix_numeric_value, 1); +EXFUN (Fprin1, 2); +EXFUN (Fprin1_to_string, 2); +EXFUN (Fprinc, 2); +EXFUN (Fprint, 2); +EXFUN (Fprocess_status, 1); +EXFUN (Fprogn, UNEVALLED); +EXFUN (Fprovide, 1); +EXFUN (Fpurecopy, 1); +EXFUN (Fput, 3); +EXFUN (Fput_range_table, 4); +EXFUN (Fput_text_property, 5); +EXFUN (Fputhash, 3); +EXFUN (Fquo, MANY); +EXFUN (Frassq, 2); +EXFUN (Fread, 1); +EXFUN (Fread_key_sequence, 3); +EXFUN (Freally_free, 1); +EXFUN (Frem, 2); +EXFUN (Fremassq, 2); +EXFUN (Fselected_frame, 1); +EXFUN (Fset, 2); +EXFUN (Fset_coding_category_system, 2); +EXFUN (Fset_coding_priority_list, 1); +EXFUN (Fset_default, 2); +EXFUN (Fset_marker, 3); +EXFUN (Fset_standard_case_table, 1); +EXFUN (Fsetcar, 2); +EXFUN (Fsetcdr, 2); +EXFUN (Fsignal, 2); +EXFUN (Fsit_for, 2); +EXFUN (Fskip_chars_backward, 3); +EXFUN (Fskip_chars_forward, 3); +EXFUN (Fsleep_for, 1); +EXFUN (Fsort, 2); +EXFUN (Fspecifier_spec_list, 4); +EXFUN (Fstring_equal, 2); +EXFUN (Fstring_lessp, 2); +EXFUN (Fstring_match, 4); +EXFUN (Fsub1, 1); +EXFUN (Fsubr_max_args, 1); +EXFUN (Fsubr_min_args, 1); +EXFUN (Fsubsidiary_coding_system, 2); +EXFUN (Fsubstitute_command_keys, 1); +EXFUN (Fsubstitute_in_file_name, 1); +EXFUN (Fsubstring, 3); +EXFUN (Fsymbol_function, 1); +EXFUN (Fsymbol_name, 1); +EXFUN (Fsymbol_plist, 1); +EXFUN (Fsymbol_value, 1); +EXFUN (Fthrow, 2); +EXFUN (Ftimes, MANY); +EXFUN (Ftruncate, 1); +EXFUN (Fundo_boundary, 0); +EXFUN (Funhandled_file_name_directory, 1); +EXFUN (Funlock_buffer, 0); +EXFUN (Fupcase, 2); +EXFUN (Fupcase_initials, 2); +EXFUN (Fupcase_initials_region, 3); +EXFUN (Fupcase_region, 3); +EXFUN (Fuser_login_name, 1); +EXFUN (Fvector, MANY); +EXFUN (Fverify_visited_file_modtime, 1); +EXFUN (Fvertical_motion, 2); +EXFUN (Fwiden, 1); + + +extern Lisp_Object Q_style, Qactually_requested, Qafter, Qall, Qand; +extern Lisp_Object Qarith_error, Qarrayp, Qassoc, Qat, Qautodetect, Qautoload; +extern Lisp_Object Qbackground, Qbackground_pixmap, Qbad_variable, Qbefore; +extern Lisp_Object Qbeginning_of_buffer, Qbig5, Qbinary, Qbitp, Qblinking; +extern Lisp_Object Qboolean, Qbottom, Qbuffer, Qbuffer_file_coding_system; +extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only, Qbutton; +extern Lisp_Object Qbyte_code, Qcall_interactively, Qcategory; +extern Lisp_Object Qcategory_designator_p, Qcategory_table_value_p, Qccl, Qcdr; +extern Lisp_Object Qchannel, Qchar, Qchar_or_string_p, Qcharacter, Qcharacterp; +extern Lisp_Object Qchars, Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; +extern Lisp_Object Qcircular_property_list, Qcoding_system_error; +extern Lisp_Object Qcoding_system_p, Qcolor, Qcolor_pixmap_image_instance_p; +extern Lisp_Object Qcolumns, Qcommand, Qcommandp, Qcompletion_ignore_case; +extern Lisp_Object Qconsole, Qconsole_live_p, Qconst_specifier, Qcr, Qcritical; +extern Lisp_Object Qcrlf, Qctext, Qcurrent_menubar; +extern Lisp_Object Qcyclic_variable_indirection, Qdata, Qdead, Qdecode; +extern Lisp_Object Qdefault, Qdefun, Qdelete, Qdelq, Qdevice, Qdevice_live_p; +extern Lisp_Object Qdim, Qdimension, Qdisabled, Qdisplay, Qdisplay_table; +extern Lisp_Object Qdnd_data, Qdoc_string, Qdomain_error, Qdynarr_overhead; +extern Lisp_Object Qempty, Qencode, Qend_of_buffer, Qend_of_file, Qend_open; +extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qeq, Qeql, Qequal; +extern Lisp_Object Qerror, Qerror_conditions, Qerror_message, Qescape_quoted; +extern Lisp_Object Qeval, Qevent_live_p, Qexit, Qextent_live_p, Qextents; +extern Lisp_Object Qexternal_debugging_output, Qface, Qfeaturep, Qfile_error; +extern Lisp_Object Qfont, Qforce_g0_on_output, Qforce_g1_on_output; +extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output, Qforeground; +extern Lisp_Object Qformat, Qframe, Qframe_live_p, Qfunction, Qgap_overhead; +extern Lisp_Object Qgeneric, Qgeometry, Qglobal, Qheight, Qhighlight; +extern Lisp_Object Qicon_glyph_p, Qid, Qidentity, Qimage, Qinfo, Qinherit; +extern Lisp_Object Qinhibit_quit, Qinhibit_read_only; +extern Lisp_Object Qinput_charset_conversion, Qinteger; +extern Lisp_Object Qinteger_char_or_marker_p, Qinteger_or_char_p; +extern Lisp_Object Qinteger_or_marker_p, Qintegerp, Qinteractive, Qinternal; +extern Lisp_Object Qinvalid_function, Qinvalid_read_syntax, Qio_error; +extern Lisp_Object Qiso2022, Qkey, Qkey_assoc, Qkeymap, Qlambda, Qleft, Qlf; +extern Lisp_Object Qlist, Qlistp, Qload, Qlock_shift, Qmacro, Qmagic; +extern Lisp_Object Qmalformed_property_list, Qmalloc_overhead, Qmark, Qmarkers; +extern Lisp_Object Qmax, Qmemory, Qmessage, Qminus, Qmnemonic, Qmodifiers; +extern Lisp_Object Qmono_pixmap_image_instance_p, Qmotion; +extern Lisp_Object Qmouse_leave_buffer_hook, Qmswindows, Qname, Qnas, Qnatnump; +extern Lisp_Object Qnil, Qno_ascii_cntl, Qno_ascii_eol, Qno_catch; +extern Lisp_Object Qno_conversion, Qno_iso6429, Qnone, Qnot, Qnothing; +extern Lisp_Object Qnothing_image_instance_p, Qnotice; +extern Lisp_Object Qnumber_char_or_marker_p, Qnumber_or_marker_p, Qnumberp; +extern Lisp_Object Qobject, Qold_assoc, Qold_delete, Qold_delq, Qold_rassoc; +extern Lisp_Object Qold_rassq, Qonly, Qor, Qother, Qoutput_charset_conversion; +extern Lisp_Object Qoverflow_error, Qpath, Qpoint, Qpointer, Qpointer_glyph_p; +extern Lisp_Object Qpointer_image_instance_p, Qpost_read_conversion; +extern Lisp_Object Qpre_write_conversion, Qprint, Qprint_length; +extern Lisp_Object Qprint_string_length, Qprocess, Qprogn, Qprovide, Qquit; +extern Lisp_Object Qquote, Qrange_error, Qrassoc, Qrassq, Qread_char; +extern Lisp_Object Qread_from_minibuffer, Qreally_early_error_handler; +extern Lisp_Object Qregion_beginning, Qregion_end, Qrequire, Qresource; +extern Lisp_Object Qreturn, Qreverse, Qright, Qrun_hooks, Qsans_modifiers; +extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, Qself_insert_command; +extern Lisp_Object Qsequencep, Qsetting_constant, Qseven, Qshift_jis, Qshort; +extern Lisp_Object Qsignal, Qsimple, Qsingularity_error, Qsize, Qspace; +extern Lisp_Object Qspecifier, Qstandard_input, Qstandard_output, Qstart_open; +extern Lisp_Object Qstream, Qstring, Qstring_lessp; +extern Lisp_Object Qsubwindow_image_instance_p, Qsymbol, Qsyntax, Qt, Qtest; +extern Lisp_Object Qtext, Qtext_image_instance_p, Qtimeout, Qtimestamp; +extern Lisp_Object Qtoolbar, Qtop, Qtop_level, Qtrue_list_p, Qtty, Qtype; +extern Lisp_Object Qunbound, Qundecided, Qundefined, Qunderflow_error; +extern Lisp_Object Qunderline, Qunimplemented, Qvalue_assoc, Qvalues; +extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvector; +extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning, Qwidth, Qwindow; +extern Lisp_Object Qwindow_live_p, Qwindow_system, Qwrong_number_of_arguments; +extern Lisp_Object Qwrong_type_argument, Qx, Qy, Qyes_or_no_p; +extern Lisp_Object Vactivate_menubar_hook, Vascii_canon_table; +extern Lisp_Object Vascii_downcase_table, Vascii_eqv_table; +extern Lisp_Object Vascii_upcase_table, Vautoload_queue, Vbinary_process_input; +extern Lisp_Object Vbinary_process_output, Vblank_menubar; +extern Lisp_Object Vcharset_ascii, Vcharset_composite, Vcharset_control_1; +extern Lisp_Object Vcoding_system_for_read, Vcoding_system_for_write; +extern Lisp_Object Vcoding_system_hashtable, Vcommand_history; +extern Lisp_Object Vcommand_line_args, Vconfigure_info_directory; +extern Lisp_Object Vconsole_list, Vcontrolling_terminal; +extern Lisp_Object Vcurrent_compiled_function_annotation, Vcurrent_load_list; +extern Lisp_Object Vcurrent_mouse_event, Vcurrent_prefix_arg, Vdata_directory; +extern Lisp_Object Vdisabled_command_hook, Vdoc_directory, Vinternal_doc_file_name; +extern Lisp_Object Vecho_area_buffer, Vemacs_major_version; +extern Lisp_Object Vemacs_minor_version, Vexec_directory, Vexec_path; +extern Lisp_Object Vexecuting_macro, Vfeatures, Vfile_domain; +extern Lisp_Object Vfile_name_coding_system, Vinhibit_quit; +extern Lisp_Object Vinvocation_directory, Vinvocation_name; +extern Lisp_Object Vkeyboard_coding_system, Vlast_command, Vlast_command_char; +extern Lisp_Object Vlast_command_event, Vlast_input_event; +extern Lisp_Object Vload_file_name_internal; +extern Lisp_Object Vload_file_name_internal_the_purecopy, Vload_history; +extern Lisp_Object Vload_path, Vmark_even_if_inactive, Vmenubar_configuration; +extern Lisp_Object Vminibuf_preprompt, Vminibuf_prompt, Vminibuffer_zero; +extern Lisp_Object Vmirror_ascii_canon_table, Vmirror_ascii_downcase_table; +extern Lisp_Object Vmirror_ascii_eqv_table, Vmirror_ascii_upcase_table; +extern Lisp_Object Vmswindows_downcase_file_names; +extern Lisp_Object Vmswindows_get_true_file_attributes, Vobarray; +extern Lisp_Object Vprint_length, Vprint_level, Vprocess_environment; +extern Lisp_Object Vpure_uninterned_symbol_table, Vquit_flag; +extern Lisp_Object Vrecent_keys_ring, Vshell_file_name, Vsite_directory; +extern Lisp_Object Vstandard_input, Vstandard_output, Vstdio_str; +extern Lisp_Object Vsynchronous_sounds, Vsystem_name, Vterminal_coding_system; +extern Lisp_Object Vthis_command_keys, Vunread_command_event; +extern Lisp_Object Vwin32_generate_fake_inodes, Vwin32_pipe_read_delay; +extern Lisp_Object Vx_initial_argv_list; + #endif /* _XEMACS_LISP_H_ */
--- a/src/lread.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/lread.c Mon Aug 13 10:28:48 2007 +0200 @@ -70,7 +70,7 @@ Lisp_Object Qlocate_file_hash_table; Lisp_Object Qfset; -int puke_on_fsf_keys; +int fail_on_bucky_bit_character_escapes; /* This symbol is also used in fns.c */ #define FEATUREP_SYNTAX @@ -207,6 +207,8 @@ static int saved_doc_string_position; #endif +EXFUN (Fread_from_string, 3); + /* When errors are signaled, the actual readcharfun should not be used as an argument if it is an lstream, so that lstreams don't escape to the Lisp level. */ @@ -573,7 +575,7 @@ int message_p = NILP (nomessage); /*#ifdef DEBUG_XEMACS*/ static Lisp_Object last_file_loaded; - int pure_usage = 0; + size_t pure_usage = 0; /*#endif*/ struct stat s1, s2; GCPRO3 (file, newer, found); @@ -857,11 +859,10 @@ CHECK_STRING (filename); if (!NILP (suffixes)) - { - CHECK_STRING (suffixes); - } - if (!(NILP (mode) || (INTP (mode) && XINT (mode) >= 0))) - mode = wrong_type_argument (Qnatnump, mode); + CHECK_STRING (suffixes); + if (!NILP (mode)) + CHECK_NATNUM (mode); + locate_file (path_list, filename, ((NILP (suffixes)) ? "" : (char *) (XSTRING_DATA (suffixes))), @@ -1063,6 +1064,33 @@ return Fnreverse (suffixtab); } +DEFUN ("locate-file-clear-hashing", Flocate_file_clear_hashing, 1, 1, 0, /* +Clear the hash records for the specified list of directories. +`locate-file' uses a hashing scheme to speed lookup, and will correctly +track the following environmental changes: + +-- changes of any sort to the list of directories to be searched. +-- addition and deletion of non-shadowing files (see below) from the + directories in the list. +-- byte-compilation of a .el file into a .elc file. + +`locate-file' will primarily get confused if you add a file that shadows +\(i.e. has the same name as) another file further down in the directory list. +In this case, you must call `locate-file-clear-hashing'. +*/ + (path)) +{ + Lisp_Object pathtail; + + for (pathtail = path; !NILP (pathtail); pathtail = Fcdr (pathtail)) + { + Lisp_Object pathel = Fcar (pathtail); + if (!purified (pathel)) + Fput (pathel, Qlocate_file_hash_table, Qnil); + } + return Qnil; +} + /* Search for a file whose name is STR, looking in directories in the Lisp list PATH, and trying suffixes from SUFFIX. SUFFIX is a string containing possible suffixes separated by colons. @@ -1166,32 +1194,6 @@ return val; } -DEFUN ("locate-file-clear-hashing", Flocate_file_clear_hashing, 1, 1, 0, /* -Clear the hash records for the specified list of directories. -`locate-file' uses a hashing scheme to speed lookup, and will correctly -track the following environmental changes: - --- changes of any sort to the list of directories to be searched. --- addition and deletion of non-shadowing files (see below) from the - directories in the list. --- byte-compilation of a .el file into a .elc file. - -`locate-file' will primarily get confused if you add a file that shadows -\(i.e. has the same name as) another file further down in the directory list. -In this case, you must call `locate-file-clear-hashing'. -*/ - (path)) -{ - Lisp_Object pathtail; - - for (pathtail = path; !NILP (pathtail); pathtail = Fcdr (pathtail)) - { - Lisp_Object pathel = Fcar (pathtail); - if (!purified (pathel)) - Fput (pathel, Qlocate_file_hash_table, Qnil); - } - return Qnil; -} #ifdef LOADHIST @@ -1627,7 +1629,8 @@ #define meta_modifier (0x800000) */ #define FSF_LOSSAGE(mask) \ - if (puke_on_fsf_keys || ((c = readchar (readcharfun)) != '-')) \ + if (fail_on_bucky_bit_character_escapes || \ + ((c = readchar (readcharfun)) != '-')) \ error ("Invalid escape character syntax"); \ c = readchar (readcharfun); \ if (c < 0) \ @@ -1862,7 +1865,7 @@ { CONST Bufbyte *lim = buf + len; CONST Bufbyte *p = buf; - unsigned EMACS_INT num = 0; + EMACS_UINT num = 0; int negativland = 0; if (*p == '-') @@ -1881,7 +1884,7 @@ for (; (p < lim) && (*p != '\0'); p++) { int c = *p; - unsigned EMACS_INT onum; + EMACS_UINT onum; if (isdigit (c)) c = c - '0'; @@ -1902,7 +1905,7 @@ } { - int int_result = negativland ? -(int)num : (int)num; + EMACS_INT int_result = negativland ? -num : num; Lisp_Object result = make_int (int_result); if (num && ((XINT (result) < 0) != negativland)) goto overflow; @@ -2217,7 +2220,7 @@ list1 (build_string ("Comma outside of backquote"))); #else /* #### - yuck....but this is reverse compatible. */ - /* mostly this is required by edebug, which does it's own + /* mostly this is required by edebug, which does its own annotated reading. We need to have an annotated_read function that records (with markers) the buffer positions of the elements that make up lists, then that @@ -2567,7 +2570,7 @@ /* If purifying, and string starts with \ newline, return zero instead. This is for doc strings that we are really going to find in lib-src/DOC.nn.nn */ - if (purify_flag && NILP (Vdoc_file_name) && cancel) + if (purify_flag && NILP (Vinternal_doc_file_name) && cancel) return Qzero; Lstream_flush (XLSTREAM (Vread_buffer_stream)); @@ -2843,7 +2846,7 @@ { if (purify_flag) { - if (NILP (Vdoc_file_name)) + if (NILP (Vinternal_doc_file_name)) /* We have not yet called Snarf-documentation, so assume this file is described in the DOC file and Snarf-documentation will fill in the right @@ -2958,7 +2961,7 @@ if (purify_flag && iii == COMPILED_DOC_STRING) { /* same as in read_list(). */ - if (NILP (Vdoc_file_name)) + if (NILP (Vinternal_doc_file_name)) make_byte_code_args[iii] = Qzero; else XCAR (make_byte_code_args[iii]) = @@ -3166,11 +3169,13 @@ */ ); Vsource_directory = Qnil; - DEFVAR_BOOL ("fail-on-bucky-bit-character-escapes", &puke_on_fsf_keys /* + /* Used to be named `puke-on-fsf-keys' */ + DEFVAR_BOOL ("fail-on-bucky-bit-character-escapes", + &fail_on_bucky_bit_character_escapes /* Whether `read' should signal an error when it encounters unsupported character escape syntaxes or just read them incorrectly. */ ); - puke_on_fsf_keys = 0; + fail_on_bucky_bit_character_escapes = 0; /* This must be initialized in init_lread otherwise it may start out with values saved when the image is dumped. */
--- a/src/lrecord.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/lrecord.h Mon Aug 13 10:28:48 2007 +0200 @@ -34,14 +34,13 @@ to process this object, or an index into an array of pointers to struct lrecord_implementations plus some other data bits. - lrecords are of two types: straight lrecords, and lcrecords. - Straight lrecords are used for those types of objects that - have their own allocation routines (typically allocated out of - 2K chunks of memory). These objects have a `struct - lrecord_header' at the top, containing only the bits needed to - find the lrecord_implementation for the object. There are - special routines in alloc.c to deal with each such object - type. + Lrecords are of two types: straight lrecords, and lcrecords. + Straight lrecords are used for those types of objects that have + their own allocation routines (typically allocated out of 2K chunks + of memory called `frob blocks'). These objects have a `struct + lrecord_header' at the top, containing only the bits needed to find + the lrecord_implementation for the object. There are special + routines in alloc.c to deal with each such object type. Lcrecords are used for less common sorts of objects that don't do their own allocation. Each such object is malloc()ed @@ -93,24 +92,26 @@ unsigned type:8; /* 1 if the object is marked during GC, 0 otherwise. */ unsigned mark:1; - /* 1 if the object was resides in pure (read-only) space */ + /* 1 if the object resides in pure (read-only) space */ unsigned pure:1; #else CONST struct lrecord_implementation *implementation; #endif }; - -#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION struct lrecord_implementation; int lrecord_type_index (CONST struct lrecord_implementation *implementation); + +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION +# define set_lheader_implementation(header,imp) do \ +{ \ + (header)->type = lrecord_type_index (imp); \ + (header)->mark = 0; \ + (header)->pure = 0; \ +} while (0) +#else # define set_lheader_implementation(header,imp) \ - do { (header)->type = lrecord_type_index((imp)); \ - (header)->mark = 0; \ - (header)->pure = 0; \ - } while (0) -#else -# define set_lheader_implementation(header,imp) (header)->implementation=(imp) + ((void) ((header)->implementation = (imp))) #endif struct lcrecord_header @@ -149,11 +150,11 @@ /* This as the value of lheader->implementation->finalizer * means that this record is already marked */ -extern void this_marks_a_marked_record (void *, int); +void this_marks_a_marked_record (void *, int); /* see alloc.c for an explanation */ -extern Lisp_Object this_one_is_unmarkable (Lisp_Object obj, - void (*markobj) (Lisp_Object)); +Lisp_Object this_one_is_unmarkable (Lisp_Object obj, + void (*markobj) (Lisp_Object)); struct lrecord_implementation { @@ -194,8 +195,8 @@ /* Only one of these is non-0. If both are 0, it means that this type is not instantiable by alloc_lcrecord(). */ - unsigned int static_size; - unsigned int (*size_in_bytes_method) (CONST void *header); + size_t static_size; + size_t (*size_in_bytes_method) (CONST void *header); /* A unique subtag-code (dynamically) assigned to this datatype. */ /* (This is a pointer so the rest of this structure can be read-only.) */ int *lrecord_type_index; @@ -207,9 +208,9 @@ int basic_p; }; +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION extern CONST struct lrecord_implementation *lrecord_implementations_table[]; -#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION # define XRECORD_LHEADER_IMPLEMENTATION(obj) \ (lrecord_implementations_table[XRECORD_LHEADER (obj)->type]) # define LHEADER_IMPLEMENTATION(lh) (lrecord_implementations_table[(lh)->type]) @@ -224,8 +225,8 @@ #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION # define MARKED_RECORD_P(obj) (gc_in_progress && XRECORD_LHEADER (obj)->mark) #else -# define MARKED_RECORD_P(obj) (gc_in_progress && \ - XRECORD_LHEADER (obj)->implementation->finalizer == \ +# define MARKED_RECORD_P(obj) (gc_in_progress && \ + XRECORD_LHEADER (obj)->implementation->finalizer == \ this_marks_a_marked_record) #endif @@ -272,58 +273,31 @@ #endif #define DEFINE_BASIC_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,structtype) \ -DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ -static int lrecord_##c_name##_lrecord_type_index; \ -CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name[2] = \ - { { name, marker, printer, nuker, equal, hash, \ - 0, 0, 0, 0, sizeof (structtype), 0, \ - &(lrecord_##c_name##_lrecord_type_index), 1 }, \ - { 0, 0, 0, this_marks_a_marked_record, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } } +DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,0,0,0,0,structtype) #define DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,structtype) \ -DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ -static int lrecord_##c_name##_lrecord_type_index; \ -CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name[2] = \ - { { name, marker, printer, nuker, equal, hash, \ - getprop, putprop, remprop, props, sizeof (structtype), 0, \ - &(lrecord_##c_name##_lrecord_type_index), 1 }, \ - { 0, 0, 0, this_marks_a_marked_record, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } } +MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,sizeof(structtype),0,1,structtype) #define DEFINE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,structtype) \ -DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ -static int lrecord_##c_name##_lrecord_type_index; \ -CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name[2] = \ - { { name, marker, printer, nuker, equal, hash, \ - 0, 0, 0, 0, sizeof (structtype), 0, \ - &(lrecord_##c_name##_lrecord_type_index), 0 }, \ - { 0, 0, 0, this_marks_a_marked_record, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } +DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,0,0,0,0,structtype) #define DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,structtype) \ -DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ -static int lrecord_##c_name##_lrecord_type_index; \ -CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name[2] = \ - { { name, marker, printer, nuker, equal, hash, \ - getprop, putprop, remprop, props, sizeof (structtype), 0, \ - &(lrecord_##c_name##_lrecord_type_index), 0 }, \ - { 0, 0, 0, this_marks_a_marked_record, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } +MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,sizeof (structtype),0,0,structtype) #define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,sizer,structtype) \ +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,0,0,0,0,sizer,structtype) + +#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,sizer,structtype) \ +MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,0,sizer,0,structtype) \ + +#define MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,size,sizer,basic_p,structtype) \ DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ static int lrecord_##c_name##_lrecord_type_index; \ CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name[2] = \ { { name, marker, printer, nuker, equal, hash, \ - 0, 0, 0, 0, 0, sizer, \ - &(lrecord_##c_name##_lrecord_type_index), 0 }, \ - { 0, 0, 0, this_marks_a_marked_record, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } - -#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,sizer,structtype) \ -DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ -static int lrecord_##c_name##_lrecord_type_index; \ -CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name[2] = \ - { { name, marker, printer, nuker, equal, hash, \ - getprop, putprop, remprop, props, 0, sizer, \ - &(lrecord_##c_name##_lrecord_type_index), 0 }, \ - { 0, 0, 0, this_marks_a_marked_record, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } + getprop, putprop, remprop, props, size, sizer, \ + &(lrecord_##c_name##_lrecord_type_index), basic_p }, \ + { 0, 0, 0, this_marks_a_marked_record, 0, 0, 0, 0, 0, 0, 0, 0, 0, basic_p } } #define LRECORDP(a) (XTYPE ((a)) == Lisp_Type_Record) #define XRECORD_LHEADER(a) ((struct lrecord_header *) XPNTR (a)) @@ -441,7 +415,7 @@ dead_wrong_type_argument (predicate, x); \ } while (0) -void *alloc_lcrecord (int size, CONST struct lrecord_implementation *); +void *alloc_lcrecord (size_t size, CONST struct lrecord_implementation *); #define alloc_lcrecord_type(type, lrecord_implementation) \ ((type *) alloc_lcrecord (sizeof (type), lrecord_implementation))
--- a/src/lstream.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/lstream.c Mon Aug 13 10:28:48 2007 +0200 @@ -26,6 +26,7 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "insdel.h" @@ -94,17 +95,17 @@ void Lstream_fungetc (Lstream *stream, int c) Function equivalents of the above macros. -int Lstream_read (Lstream *stream, void *data, int size) +int Lstream_read (Lstream *stream, void *data, size_t size) Read SIZE bytes of DATA from the stream. Return the number of bytes read. 0 means EOF. -1 means an error occurred and no bytes were read. -int Lstream_write (Lstream *stream, void *data, int size) +int Lstream_write (Lstream *stream, void *data, size_t size) Write SIZE bytes of DATA to the stream. Return the number of bytes written. -1 means an error occurred and no bytes were written. -void Lstream_unread (Lstream *stream, void *data, int size) +void Lstream_unread (Lstream *stream, void *data, size_t size) Push back SIZE bytes of DATA onto the input queue. The next call to Lstream_read() with the same size will read the same bytes back. Note that this will be the case even if @@ -129,23 +130,6 @@ Rewind the stream to the beginning. */ -#ifdef MULE -MAC_DEFINE (Emchar, MTlstream_emchar) -MAC_DEFINE (int, MTlstream_emcint) -#endif - -MAC_DEFINE (struct lstream *, MTlstream_data) - -static Lisp_Object mark_lstream (Lisp_Object, void (*) (Lisp_Object)); -static void print_lstream (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag); -static void finalize_lstream (void *header, int for_disksave); -static unsigned int sizeof_lstream (CONST void *header); -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("stream", lstream, - mark_lstream, print_lstream, - finalize_lstream, 0, 0, - sizeof_lstream, Lstream); - #define DEFAULT_BLOCK_BUFFERING_SIZE 512 #define MAX_READ_SIZE 512 @@ -153,10 +137,7 @@ mark_lstream (Lisp_Object obj, void (*markobj) (Lisp_Object)) { Lstream *lstr = XLSTREAM (obj); - if (lstr->imp->marker) - return (lstr->imp->marker) (obj, markobj); - else - return Qnil; + return lstr->imp->marker ? (lstr->imp->marker) (obj, markobj) : Qnil; } static void @@ -198,13 +179,18 @@ } } -static unsigned int +static size_t sizeof_lstream (CONST void *header) { CONST Lstream *lstr = (CONST Lstream *) header; return sizeof (*lstr) + lstr->imp->size - 1; } +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("stream", lstream, + mark_lstream, print_lstream, + finalize_lstream, 0, 0, + sizeof_lstream, Lstream); + void Lstream_set_buffering (Lstream *lstr, Lstream_buffering buffering, int buffering_size) @@ -278,7 +264,7 @@ Lstream_delete (Lstream *lstr) { int i; - Lisp_Object val = Qnil; + Lisp_Object val; XSETLSTREAM (val, lstr); for (i = 0; i < lstream_type_count; i++) @@ -293,9 +279,13 @@ abort (); } -static void -signal_simple_internal_error (CONST char *reason, Lisp_Object obj) +#define Lstream_internal_error(reason, lstr) \ + Lstream_signal_simple_error ("Internal error: " reason, lstr) + +static void Lstream_signal_simple_error (CONST char *reason, Lstream *lstr) { + Lisp_Object obj; + XSETLSTREAM (obj, lstr); signal_simple_error (reason, obj); } @@ -303,12 +293,7 @@ Lstream_reopen (Lstream *lstr) { if (lstr->flags & LSTREAM_FL_IS_OPEN) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream already open", obj); - } + Lstream_internal_error ("lstream already open", lstr); lstr->flags |= LSTREAM_FL_IS_OPEN; } @@ -323,26 +308,11 @@ { int size = lstr->out_buffer_ind; if (! (lstr->flags & LSTREAM_FL_IS_OPEN)) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream not open", obj); - } + Lstream_internal_error ("lstream not open", lstr); if (! (lstr->flags & LSTREAM_FL_WRITE)) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream not open for writing", obj); - } + Lstream_internal_error ("lstream not open for writing", lstr); if (!lstr->imp->writer) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream has no writer", obj); - } + Lstream_internal_error ("lstream has no writer", lstr); if (lstr->flags & LSTREAM_FL_NO_PARTIAL_CHARS) /* It's quite possible for us to get passed an incomplete @@ -370,15 +340,14 @@ } } - num_written = - (lstr->imp->writer) (lstr, lstr->out_buffer, size); + num_written = (lstr->imp->writer) (lstr, lstr->out_buffer, size); if (num_written == 0) /* If nothing got written, then just hold the data. This may occur, for example, if this stream does non-blocking I/O; the attempt to write the data might have resulted in an EWOULDBLOCK error. */ return 0; - else if (num_written >= lstr->out_buffer_ind) + else if (num_written >= (int) lstr->out_buffer_ind) lstr->out_buffer_ind = 0; else if (num_written > 0) { @@ -421,12 +390,12 @@ up until they can be written, so as to avoid losing data. */ static int -Lstream_adding (Lstream *lstr, int num, int force) +Lstream_adding (Lstream *lstr, size_t num, int force) { /* Compute the size that the outbuffer needs to be after the chars are added. */ - int size_needed = max (lstr->out_buffer_size, - num + lstr->out_buffer_ind); + size_t size_needed = max (lstr->out_buffer_size, + num + lstr->out_buffer_ind); /* Maybe chop it down so that we don't buffer more characters than our advertised buffering size. */ if (!force) @@ -441,24 +410,14 @@ /* Like Lstream_write(), but does not handle line-buffering correctly. */ static int -Lstream_write_1 (Lstream *lstr, CONST void *data, int size) +Lstream_write_1 (Lstream *lstr, CONST void *data, size_t size) { CONST unsigned char *p = (CONST unsigned char *) data; int off = 0; if (! (lstr->flags & LSTREAM_FL_IS_OPEN)) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream not open", obj); - } + Lstream_internal_error ("lstream not open", lstr); if (! (lstr->flags & LSTREAM_FL_WRITE)) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream not open for writing", obj); - } + Lstream_internal_error ("lstream not open for writing", lstr); { int couldnt_write_last_time = 0; @@ -511,17 +470,16 @@ line buffering. */ int -Lstream_write (Lstream *lstr, CONST void *data, int size) +Lstream_write (Lstream *lstr, CONST void *data, size_t size) { int i; CONST unsigned char *p = (CONST unsigned char *) data; - assert (size >= 0); if (size == 0) return size; if (lstr->buffering != LSTREAM_LINE_BUFFERED) return Lstream_write_1 (lstr, data, size); - for (i = 0; i < size; i++) + for (i = 0; i < (int) size; i++) { if (Lstream_putc (lstr, p[i]) < 0) break; @@ -539,29 +497,14 @@ } static int -Lstream_raw_read (Lstream *lstr, unsigned char *buffer, int size) +Lstream_raw_read (Lstream *lstr, unsigned char *buffer, size_t size) { if (! (lstr->flags & LSTREAM_FL_IS_OPEN)) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream not open", obj); - } + Lstream_internal_error ("lstream not open", lstr); if (! (lstr->flags & LSTREAM_FL_READ)) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream not open for reading", obj); - } + Lstream_internal_error ("lstream not open for reading", lstr); if (!lstr->imp->reader) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream has no reader", obj); - } + Lstream_internal_error ("lstream has no reader", lstr); return (lstr->imp->reader) (lstr, buffer, size); } @@ -588,14 +531,13 @@ } int -Lstream_read (Lstream *lstr, void *data, int size) +Lstream_read (Lstream *lstr, void *data, size_t size) { unsigned char *p = (unsigned char *) data; int off = 0; - int chunk; + size_t chunk; int error_occurred = 0; - assert (size >= 0); if (size == 0) return 0; @@ -604,7 +546,7 @@ if (chunk > 0) { /* The bytes come back in reverse order. */ - for (; off < chunk; off++) + for (; off < (int) chunk; off++) p[off] = lstr->unget_buffer[--lstr->unget_buffer_ind]; lstr->byte_count += chunk; size -= chunk; @@ -663,7 +605,7 @@ } void -Lstream_unread (Lstream *lstr, CONST void *data, int size) +Lstream_unread (Lstream *lstr, CONST void *data, size_t size) { int i; unsigned char *p = (unsigned char *) data; @@ -684,12 +626,7 @@ Lstream_rewind (Lstream *lstr) { if (!lstr->imp->rewinder) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream has no rewinder", obj); - } + Lstream_internal_error ("lstream has no rewinder", lstr); if (Lstream_flush (lstr) < 0) return -1; lstr->byte_count = 0; @@ -712,12 +649,7 @@ int rc; if (!lstr->flags & LSTREAM_FL_IS_OPEN) - { - Lisp_Object obj = Qnil; - XSETLSTREAM (obj, lstr); - signal_simple_internal_error - ("Internal error: lstream is not open", obj); - } + Lstream_internal_error ("lstream is not open", lstr); /* don't check errors here -- best not to risk file descriptor loss */ rc = Lstream_flush (lstr); @@ -838,7 +770,7 @@ static Lisp_Object make_stdio_stream_1 (FILE *stream, int flags, CONST char *mode) { - Lisp_Object obj = Qnil; + Lisp_Object obj; Lstream *lstr = Lstream_new (lstream_stdio, mode); struct stdio_stream *str = STDIO_STREAM_DATA (lstr); str->file = stream; @@ -861,7 +793,7 @@ } static int -stdio_reader (Lstream *stream, unsigned char *data, int size) +stdio_reader (Lstream *stream, unsigned char *data, size_t size) { struct stdio_stream *str = STDIO_STREAM_DATA (stream); size_t val = fread (data, 1, (size_t) size, str->file); @@ -871,10 +803,10 @@ } static int -stdio_writer (Lstream *stream, CONST unsigned char *data, int size) +stdio_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct stdio_stream *str = STDIO_STREAM_DATA (stream); - size_t val = fwrite (data, 1, (size_t) size, str->file); + size_t val = fwrite (data, 1, size, str->file); if (!val && ferror (str->file)) return -1; return (int) val; @@ -890,14 +822,12 @@ static int stdio_seekable_p (Lstream *stream) { + struct stat lestat; struct stdio_stream *str = STDIO_STREAM_DATA (stream); - { - struct stat lestat; - if (fstat (fileno (str->file), &lestat) < 0) - return 0; - return S_ISREG (lestat.st_mode); - } + if (fstat (fileno (str->file), &lestat) < 0) + return 0; + return S_ISREG (lestat.st_mode); } static int @@ -958,21 +888,18 @@ make_filedesc_stream_1 (int filedesc, int offset, int count, int flags, CONST char *mode) { - Lisp_Object obj = Qnil; + Lisp_Object obj; Lstream *lstr = Lstream_new (lstream_filedesc, mode); struct filedesc_stream *fstr = FILEDESC_STREAM_DATA (lstr); fstr->fd = filedesc; - fstr->closing = !!(flags & LSTR_CLOSING); - fstr->allow_quit = !!(flags & LSTR_ALLOW_QUIT); - fstr->blocked_ok = !!(flags & LSTR_BLOCKED_OK); + fstr->closing = !!(flags & LSTR_CLOSING); + fstr->allow_quit = !!(flags & LSTR_ALLOW_QUIT); + fstr->blocked_ok = !!(flags & LSTR_BLOCKED_OK); fstr->pty_flushing = !!(flags & LSTR_PTY_FLUSHING); fstr->blocking_error_p = 0; fstr->chars_sans_newline = 0; fstr->starting_pos = lseek (filedesc, offset, SEEK_CUR); - if (fstr->starting_pos < 0) - fstr->current_pos = 0; - else - fstr->current_pos = fstr->starting_pos; + fstr->current_pos = max (fstr->current_pos, 0); if (count < 0) fstr->end_pos = -1; else @@ -995,15 +922,16 @@ } static int -filedesc_reader (Lstream *stream, unsigned char *data, int size) +filedesc_reader (Lstream *stream, unsigned char *data, size_t size) { + int nread; struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream); if (str->end_pos >= 0) - size = min (size, str->end_pos - str->current_pos); - size = (str->allow_quit ? read_allowing_quit : read) (str->fd, data, size); - if (size > 0) - str->current_pos += size; - return size; + size = min (size, (size_t) (str->end_pos - str->current_pos)); + nread = (str->allow_quit ? read_allowing_quit : read) (str->fd, data, size); + if (nread > 0) + str->current_pos += nread; + return nread; } static int @@ -1021,7 +949,7 @@ } static int -filedesc_writer (Lstream *stream, CONST unsigned char *data, int size) +filedesc_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream); int retval; @@ -1221,7 +1149,7 @@ make_lisp_string_input_stream (Lisp_Object string, Bytecount offset, Bytecount len) { - Lisp_Object obj = Qnil; + Lisp_Object obj; Lstream *lstr; struct lisp_string_stream *str; @@ -1243,7 +1171,7 @@ } static int -lisp_string_reader (Lstream *stream, unsigned char *data, int size) +lisp_string_reader (Lstream *stream, unsigned char *data, size_t size) { struct lisp_string_stream *str = LISP_STRING_STREAM_DATA (stream); /* Don't lose if the string shrank past us ... */ @@ -1258,8 +1186,7 @@ if (stream->flags & LSTREAM_FL_NO_PARTIAL_CHARS) VALIDATE_CHARPTR_BACKWARD (start); offset = start - strstart; - size = min (size, str->end - offset); - assert (size >= 0); /* paranoia */ + size = min (size, (size_t) (str->end - offset)); memcpy (data, start, size); str->offset = offset + size; return size; @@ -1302,22 +1229,19 @@ { CONST unsigned char *inbuf; unsigned char *outbuf; - int size; - int offset; + size_t size; + size_t offset; }; DEFINE_LSTREAM_IMPLEMENTATION ("fixed-buffer", lstream_fixed_buffer, sizeof (struct fixed_buffer_stream)); Lisp_Object -make_fixed_buffer_input_stream (CONST unsigned char *buf, int size) +make_fixed_buffer_input_stream (CONST unsigned char *buf, size_t size) { - Lisp_Object obj = Qnil; - Lstream *lstr; - struct fixed_buffer_stream *str; - - lstr = Lstream_new (lstream_fixed_buffer, "r"); - str = FIXED_BUFFER_STREAM_DATA (lstr); + Lisp_Object obj; + Lstream *lstr = Lstream_new (lstream_fixed_buffer, "r"); + struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (lstr); str->inbuf = buf; str->size = size; XSETLSTREAM (obj, lstr); @@ -1325,14 +1249,11 @@ } Lisp_Object -make_fixed_buffer_output_stream (unsigned char *buf, int size) +make_fixed_buffer_output_stream (unsigned char *buf, size_t size) { - Lisp_Object obj = Qnil; - Lstream *lstr; - struct fixed_buffer_stream *str; - - lstr = Lstream_new (lstream_fixed_buffer, "w"); - str = FIXED_BUFFER_STREAM_DATA (lstr); + Lisp_Object obj; + Lstream *lstr = Lstream_new (lstream_fixed_buffer, "w"); + struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (lstr); str->outbuf = buf; str->size = size; XSETLSTREAM (obj, lstr); @@ -1340,7 +1261,7 @@ } static int -fixed_buffer_reader (Lstream *stream, unsigned char *data, int size) +fixed_buffer_reader (Lstream *stream, unsigned char *data, size_t size) { struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (stream); size = min (size, str->size - str->offset); @@ -1350,7 +1271,7 @@ } static int -fixed_buffer_writer (Lstream *stream, CONST unsigned char *data, int size) +fixed_buffer_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (stream); if (str->offset == str->size) @@ -1395,7 +1316,7 @@ struct resizing_buffer_stream { unsigned char *buf; - int allocked; + size_t allocked; int max_stored; int stored; }; @@ -1406,13 +1327,13 @@ Lisp_Object make_resizing_buffer_output_stream (void) { - Lisp_Object obj = Qnil; + Lisp_Object obj; XSETLSTREAM (obj, Lstream_new (lstream_resizing_buffer, "w")); return obj; } static int -resizing_buffer_writer (Lstream *stream, CONST unsigned char *data, int size) +resizing_buffer_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct resizing_buffer_stream *str = RESIZING_BUFFER_STREAM_DATA (stream); DO_REALLOC (str->buf, str->allocked, str->stored + size, unsigned char); @@ -1467,14 +1388,14 @@ Lisp_Object make_dynarr_output_stream (unsigned_char_dynarr *dyn) { - Lisp_Object obj = Qnil; + Lisp_Object obj; XSETLSTREAM (obj, Lstream_new (lstream_dynarr, "w")); DYNARR_STREAM_DATA (XLSTREAM (obj))->dyn = dyn; return obj; } static int -dynarr_writer (Lstream *stream, CONST unsigned char *data, int size) +dynarr_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct dynarr_stream *str = DYNARR_STREAM_DATA (stream); Dynarr_add_many (str->dyn, data, size); @@ -1519,7 +1440,7 @@ make_lisp_buffer_stream_1 (struct buffer *buf, Bufpos start, Bufpos end, int flags, CONST char *mode) { - Lisp_Object obj = Qnil; + Lisp_Object obj; Lstream *lstr; struct lisp_buffer_stream *str; Bufpos bmin, bmax; @@ -1557,7 +1478,7 @@ str = LISP_BUFFER_STREAM_DATA (lstr); { Lisp_Object marker; - Lisp_Object buffer = Qnil; + Lisp_Object buffer; XSETBUFFER (buffer, buf); marker = Fmake_marker (); @@ -1598,7 +1519,7 @@ } static int -lisp_buffer_reader (Lstream *stream, unsigned char *data, int size) +lisp_buffer_reader (Lstream *stream, unsigned char *data, size_t size) { struct lisp_buffer_stream *str = LISP_BUFFER_STREAM_DATA (stream); unsigned char *orig_data = data; @@ -1622,7 +1543,7 @@ BI_BUF_ZV (buf)); } - size = min (size, end - start); + size = min (size, (size_t) (end - start)); end = start + size; /* We cannot return a partial character. */ VALIDATE_BYTIND_BACKWARD (buf, end); @@ -1656,7 +1577,7 @@ } static int -lisp_buffer_writer (Lstream *stream, CONST unsigned char *data, int size) +lisp_buffer_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct lisp_buffer_stream *str = LISP_BUFFER_STREAM_DATA (stream); Bufpos pos;
--- a/src/lstream.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/lstream.h Mon Aug 13 10:28:48 2007 +0200 @@ -75,8 +75,8 @@ typedef struct lstream_implementation { CONST char *name; - int size; /* Number of additional bytes to be allocated with this - stream. Access this data using Lstream_data(). */ + size_t size; /* Number of additional bytes to be allocated with this + stream. Access this data using Lstream_data(). */ /* Read some data from the stream's end and store it into DATA, which can hold SIZE bytes. Return the number of bytes read. A return value of 0 means no bytes can be read at this time. This may @@ -95,7 +95,7 @@ /* The omniscient mly, blinded by the irresistable thrall of Common Lisp, thinks that it is bogus that the types and implementations of input and output streams are the same. */ - int (*reader) (Lstream *stream, unsigned char *data, int size); + int (*reader) (Lstream *stream, unsigned char *data, size_t size); /* Send some data to the stream's end. Data to be sent is in DATA and is SIZE bytes. Return the number of bytes sent. This function can send and return fewer bytes than is passed in; in @@ -106,7 +106,7 @@ data. (This is useful, e.g., of you're dealing with a non-blocking file descriptor and are getting EWOULDBLOCK errors.) This function can be NULL if the stream is input-only. */ - int (*writer) (Lstream *stream, CONST unsigned char *data, int size); + int (*writer) (Lstream *stream, CONST unsigned char *data, size_t size); /* Return non-zero if the last write operation on the stream resulted in an attempt to block (EWOULDBLOCK). If this method does not exists, the implementation returns 0 */ @@ -147,26 +147,26 @@ struct lcrecord_header header; CONST Lstream_implementation *imp; /* methods for this stream */ Lstream_buffering buffering; /* type of buffering in use */ - int buffering_size; /* number of bytes buffered */ + size_t buffering_size; /* number of bytes buffered */ unsigned char *in_buffer; /* holds characters read from stream end */ - int in_buffer_size; /* allocated size of buffer */ - int in_buffer_current; /* number of characters in buffer */ - int in_buffer_ind; /* pointer to next character to take from buffer */ + size_t in_buffer_size; /* allocated size of buffer */ + size_t in_buffer_current; /* number of characters in buffer */ + size_t in_buffer_ind; /* pointer to next character to take from buffer */ unsigned char *out_buffer; /* holds characters to write to stream end */ - int out_buffer_size; /* allocated size of buffer */ - int out_buffer_ind; /* pointer to next buffer spot to write a character */ + size_t out_buffer_size; /* allocated size of buffer */ + size_t out_buffer_ind; /* pointer to next buffer spot to write a character */ /* The unget buffer is more or less a stack -- things get pushed onto the end and read back from the end. Lstream_read() basically reads backwards from the end to get stuff; Lstream_unread() similarly has to push the data on backwards. */ unsigned char *unget_buffer; /* holds characters pushed back onto input */ - int unget_buffer_size; /* allocated size of buffer */ - int unget_buffer_ind; /* pointer to next buffer spot to write a character */ + size_t unget_buffer_size; /* allocated size of buffer */ + size_t unget_buffer_ind; /* pointer to next buffer spot to write a character */ - int byte_count; + size_t byte_count; long flags; /* Align pointer for 64 bit machines (kny) */ char data[1]; }; @@ -175,14 +175,19 @@ ((lstr)->imp == lstream_##type) #ifdef ERROR_CHECK_TYPECHECK -MAC_DECLARE_EXTERN (struct lstream *, MTlstream_data) -# define LSTREAM_TYPE_DATA(lstr, type) \ -MAC_BEGIN \ - MAC_DECLARE (struct lstream *, MTlstream_data, lstr) \ - assert (LSTREAM_TYPE_P (MTlstream_data, type)) \ - MAC_SEP \ - (struct type##_stream *) Lstream_data (MTlstream_data) \ -MAC_END +INLINE struct lstream * +error_check_lstream_type (struct lstream *stream, + CONST Lstream_implementation *imp); +INLINE struct lstream * +error_check_lstream_type (struct lstream *stream, + CONST Lstream_implementation *imp) +{ + assert (stream->imp == imp); + return stream; +} +# define LSTREAM_TYPE_DATA(lstr, type) \ + ((struct type##_stream *) \ + Lstream_data (error_check_lstream_type(lstr, lstream_##type))) #else # define LSTREAM_TYPE_DATA(lstr, type) \ ((struct type##_stream *) Lstream_data (lstr)) @@ -204,10 +209,10 @@ int Lstream_fputc (Lstream *lstr, int c); int Lstream_fgetc (Lstream *lstr); void Lstream_fungetc (Lstream *lstr, int c); -int Lstream_read (Lstream *lstr, void *data, int size); -int Lstream_write (Lstream *lstr, CONST void *data, int size); +int Lstream_read (Lstream *lstr, void *data, size_t size); +int Lstream_write (Lstream *lstr, CONST void *data, size_t size); int Lstream_was_blocked_p (Lstream *lstr); -void Lstream_unread (Lstream *lstr, CONST void *data, int size); +void Lstream_unread (Lstream *lstr, CONST void *data, size_t size); int Lstream_rewind (Lstream *lstr); int Lstream_seekable_p (Lstream *lstr); int Lstream_close (Lstream *lstr); @@ -252,7 +257,6 @@ #define Lstream_data(stream) ((void *) ((stream)->data)) #define Lstream_byte_count(stream) ((stream)->byte_count) - /************************************************************************/ /* working with an Lstream as a stream of Emchars */ @@ -260,34 +264,37 @@ #ifdef MULE -MAC_DECLARE_EXTERN (Emchar, MTlstream_emchar) -MAC_DECLARE_EXTERN (int, MTlstream_emcint) -/* In mule-charset.c */ -Emchar Lstream_get_emchar_1 (Lstream *lstr, int first_char); -int Lstream_fput_emchar (Lstream *lstr, Emchar ch); -void Lstream_funget_emchar (Lstream *lstr, Emchar ch); +#ifndef BYTE_ASCII_P +#include "mule-charset.h" +#endif + +INLINE Emchar Lstream_get_emchar (Lstream *stream); +INLINE Emchar +Lstream_get_emchar (Lstream *stream) +{ + int c = Lstream_getc (stream); + return BYTE_ASCII_P (c) ? (Emchar) c : + Lstream_get_emchar_1 (stream, c); +} -# define Lstream_get_emchar(stream) \ -MAC_BEGIN \ - MAC_DECLARE (int, MTlstream_emcint, Lstream_getc (stream)) \ - BYTE_ASCII_P (MTlstream_emcint) ? (Emchar) MTlstream_emcint : \ - Lstream_get_emchar_1 (stream, MTlstream_emcint) \ -MAC_END -# define Lstream_put_emchar(stream, ch) \ -MAC_BEGIN \ - MAC_DECLARE (Emchar, MTlstream_emchar, ch) \ - CHAR_ASCII_P (MTlstream_emchar) ? \ - Lstream_putc (stream, MTlstream_emchar) : \ - Lstream_fput_emchar (stream, MTlstream_emchar) \ -MAC_END -# define Lstream_unget_emchar(stream, ch) \ -MAC_BEGIN \ - MAC_DECLARE (Emchar, MTlstream_emchar, ch) \ - CHAR_ASCII_P (MTlstream_emchar) ? \ - Lstream_ungetc (stream, MTlstream_emchar) : \ - Lstream_funget_emchar (stream, MTlstream_emchar) \ -MAC_END +INLINE int Lstream_put_emchar (Lstream *stream, Emchar ch); +INLINE int +Lstream_put_emchar (Lstream *stream, Emchar ch) +{ + return CHAR_ASCII_P (ch) ? + Lstream_putc (stream, ch) : + Lstream_fput_emchar (stream, ch); +} +INLINE void Lstream_unget_emchar (Lstream *stream, Emchar ch); +INLINE void +Lstream_unget_emchar (Lstream *stream, Emchar ch) +{ + if (CHAR_ASCII_P (ch)) + Lstream_ungetc (stream, ch); + else + Lstream_funget_emchar (stream, ch); +} #else /* not MULE */ # define Lstream_get_emchar(stream) Lstream_getc (stream) @@ -296,7 +303,6 @@ #endif /* not MULE */ - /************************************************************************/ /* Lstream implementations */ @@ -334,9 +340,9 @@ Bytecount offset, Bytecount len); Lisp_Object make_fixed_buffer_input_stream (CONST unsigned char *buf, - int size); + size_t size); Lisp_Object make_fixed_buffer_output_stream (unsigned char *buf, - int size); + size_t size); CONST unsigned char *fixed_buffer_input_stream_ptr (Lstream *stream); unsigned char *fixed_buffer_output_stream_ptr (Lstream *stream); Lisp_Object make_resizing_buffer_output_stream (void);
--- a/src/m/README Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/README Mon Aug 13 10:28:48 2007 +0200 @@ -12,7 +12,7 @@ 1. Removed all code dealing with VALBITS and XSET*. These are handled differently in XEmacs. -2. Removed all defines of WORDS_BIG_ENDIAN. Now determined by configure. +2. Removed all defines of WORDS_BIGENDIAN. Now determined by configure. 3. Put #ifndef PURESIZE around all PURESIZE defines so that it can be overridden at configure time.
--- a/src/m/delta.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/delta.h Mon Aug 13 10:28:48 2007 +0200 @@ -105,7 +105,6 @@ /* Machine specific stuff */ #define HAVE_PTYS #define SYSV_PTYS -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ #define BROKEN_CLOSEDIR /* builtin closedir is interruptible */ #define memmove(t,f,s) safe_bcopy(f,t,s) /* for overlapping copies */ #undef KERNEL_FILE
--- a/src/m/delta88k.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/delta88k.h Mon Aug 13 10:28:48 2007 +0200 @@ -127,8 +127,6 @@ #define LIBS_SYSTEM "-lbsd -lg" #endif /* USG5_4 */ -/* #define NO_TERMIO */ /* mrb */ - #define NO_SIOCTL_H /* XEmacs change -- removed crap about random and bstring */
--- a/src/m/dpx2.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/dpx2.h Mon Aug 13 10:28:48 2007 +0200 @@ -181,9 +181,6 @@ #undef HAVE_CLOSEDIR #endif -/* Send signals to subprocesses by "typing" signal chars at them. */ -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - /* This is to prevent memory clobbering on the DPX/2 200. */ #define LD_SWITCH_MACHINE "-N -T32"
--- a/src/m/ibmps2-aix.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/ibmps2-aix.h Mon Aug 13 10:28:48 2007 +0200 @@ -98,10 +98,6 @@ #define C_DEBUG_SWITCH "-O" #endif -/* Send signals to subprocesses by "typing" special chars at them. */ - -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - /* AIX utimes allegedly causes SIGSEGV. */ #undef HAVE_UTIMES /* override configuration decision */
--- a/src/m/ibmrs6000.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/ibmrs6000.h Mon Aug 13 10:28:48 2007 +0200 @@ -20,7 +20,7 @@ /* Synched up with: FSF 19.31. */ -/* The following line tells the configuration script what sort of +/* The following line tells the configuration script what sort of operating system this machine is likely to run. USUAL-OPSYS="aix3-1" */ @@ -136,30 +136,3 @@ #undef NEED_PTEM_H #define ORDINARY_LINK - -#if 0 /* mrb */ -#ifndef USG5_4 -/* XEmacs change -- automatically add the correct path for smt.exp if - it exists. */ -/* marc@sti.com (Marc Pawliger) says ibmrs6000.inp is needed to avoid - linker error for updated X11R5 libraries, which references pthread library - which most machines don't have. We use the name .inp instead of .imp - because .inp is a better convention to use in make-dist for naming - random input files. */ -/* Avoid gcc 2.7.x collect2 bug by using /bin/ld instead. */ -#if __GNUC__ == 2 && __GNUC_MINOR__ == 7 -#ifdef AIX_SMT_EXP -#define LD_SWITCH_MACHINE "-B/bin/ -Wl,-bnso,-bnodelcsect,-bI:/lib/syscalls.exp,-bI:$(srcdir)/m/ibmrs6000.inp,AIX_SMT_EXP" -#else -#define LD_SWITCH_MACHINE "-B/bin/ -Wl,-bnso,-bnodelcsect,-bI:/lib/syscalls.exp,-bI:$(srcdir)/m/ibmrs6000.inp" -#endif -#else /* not gcc 2.7.x */ -#ifdef AIX_SMT_EXP -#define LD_SWITCH_MACHINE "-Wl,-bnso,-bnodelcsect,-bI:/lib/syscalls.exp,-bI:$(srcdir)/m/ibmrs6000.inp,AIX_SMT_EXP" -#else -#define LD_SWITCH_MACHINE "-Wl,-bnso,-bnodelcsect,-bI:/lib/syscalls.exp,-bI:$(srcdir)/m/ibmrs6000.inp" -#endif -#endif /* __GNUC__ == 2 && __GNUC_MINOR__ == 7 */ - -#endif /* USG5_4 */ -#endif /* mrb */
--- a/src/m/intel386.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/intel386.h Mon Aug 13 10:28:48 2007 +0200 @@ -150,17 +150,7 @@ #define LIB_STANDARD "/lib/386/Slibcfp.a /lib/386/Slibc.a" #else /* not XENIX */ -/* this brings in alloca() if we're using cc */ #ifdef USG -#if 0 /* mrb: -lPW is now autodetected, anyways */ -#ifndef LIB_STANDARD -#ifdef USG5_4 -#define LIB_STANDARD "-lc" -#else /* not USG5_4 */ -#define LIB_STANDARD "-lPW -lc" -#endif /* not USG5_4 */ -#endif /* LIB_STANDARD */ -#endif /* 0 */ #if 0 /* ALLOCA is now autodetected */ #define HAVE_ALLOCA
--- a/src/m/iris4d.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/iris4d.h Mon Aug 13 10:28:48 2007 +0200 @@ -118,7 +118,6 @@ #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ -/* #define LIBS_MACHINE "-lmld" */ /* mrb */ #define LIBS_DEBUG /* Define this if you have a fairly recent system,
--- a/src/m/iris5d.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/iris5d.h Mon Aug 13 10:28:48 2007 +0200 @@ -117,7 +117,6 @@ #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ -/* #define LIBS_MACHINE "-lsun -lmld" */ /* mrb */ #define LIBS_DEBUG /* Define this if you have a fairly recent system,
--- a/src/m/mips.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/mips.h Mon Aug 13 10:28:48 2007 +0200 @@ -129,7 +129,6 @@ #else /* not BSD */ #undef LIBS_MACHINE -/* #define LIBS_MACHINE "-lmld" */ /* mrb */ #define LD_SWITCH_MACHINE "-D 800000 -g3" #define START_FILES "pre-crt0.o /usr/lib/crt1.o" #define LIB_STANDARD "-lbsd -lc /usr/lib/crtn.o"
--- a/src/m/news-risc.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/news-risc.h Mon Aug 13 10:28:48 2007 +0200 @@ -9,7 +9,6 @@ /* NEWS-OS 5.0.2 */ #undef LIBS_MACHINE -/* #define LIBS_MACHINE "-lmld" */ /* mrb */ #ifdef __GNUC__ #define C_DEBUG_SWITCH "-g" @@ -46,7 +45,6 @@ /* Don't use the definitions in m/mips.h. */ #undef LINKER #undef LIBS_MACHINE -/* #define LIBS_MACHINE "-lmld" */ /* mrb */ #undef KERNEL_FILE #define KERNEL_FILE "/vmunix"
--- a/src/m/powerpc.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/powerpc.h Mon Aug 13 10:28:48 2007 +0200 @@ -56,42 +56,12 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) #else /* mklinux */ -#if 0 -/* The following line tells the configuration script what sort of - operating system this machine is likely to run. - USUAL-OPSYS="linux" */ - -/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word - is the most significant byte. */ - -#define WORDS_BIG_ENDIAN -#endif /* Define NO_ARG_ARRAY if you cannot take the address of the first of a * group of arguments and treat it as an array of the arguments. */ #define NO_ARG_ARRAY -#if 0 -/* Now define a symbol for the cpu type, if your compiler - does not define it automatically. */ - -/* #define IBMR2AIX */ - -/* Use type int rather than a union, to represent Lisp_Object */ -/* This is desirable for most machines. */ - -/* #define NO_UNION_TYPE */ - -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - -#define UNEXEC unexelf.o -#endif - /* Define addresses, macros, change some setup for dump */ #define NO_REMAP @@ -160,5 +130,5 @@ #undef NEED_PTEM_H #define ORDINARY_LINK -#define LD_SWITCH_MACHINE -T ${srcdir}/src/ppc.ldscript +/*#define LD_SWITCH_MACHINE -T ${srcdir}/src/ppc.ldscript*/ #endif
--- a/src/m/sgi-challenge.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/sgi-challenge.h Mon Aug 13 10:28:48 2007 +0200 @@ -128,7 +128,6 @@ #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ -/* #define LIBS_MACHINE "-lsun -lmld" */ /* mrb */ #define LIBS_DEBUG /* Define this if you have a fairly recent system,
--- a/src/m/tekxd88.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/tekxd88.h Mon Aug 13 10:28:48 2007 +0200 @@ -90,7 +90,6 @@ #undef LIB_X11_LIB /* Don't use shared libraries defined in usg5-3.h */ #undef LIBX11_SYSTEM -/* #define NO_TERMIO */ /* mrb */ #define HAVE_PTYS /* XD88 SysV has PTYs. */ #define SYSV_PTYS /* Requires <termios.h> */
--- a/src/m/windowsnt.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/m/windowsnt.h Mon Aug 13 10:28:48 2007 +0200 @@ -25,11 +25,6 @@ operating system this machine is likely to run. USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ -/* Define BIG_ENDIAN iff lowest-numbered byte in a word - is the most significant byte. */ - -/* #define BIG_ENDIAN */ - /* Define NO_ARG_ARRAY if you cannot take the address of the first of a * group of arguments and treat it as an array of the arguments. */
--- a/src/macros.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/macros.c Mon Aug 13 10:28:48 2007 +0200 @@ -232,10 +232,8 @@ static Lisp_Object pop_kbd_macro (Lisp_Object info) { - Lisp_Object tem; Vexecuting_macro = Fcar (info); - tem = Fcdr (info); - executing_macro_index = XINT (tem); + executing_macro_index = XINT (Fcdr (info)); return Qnil; }
--- a/src/macros.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/macros.h Mon Aug 13 10:28:48 2007 +0200 @@ -23,16 +23,16 @@ #ifndef _XEMACS_MACROS_H_ #define _XEMACS_MACROS_H_ -/* Kbd macro currently being executed (a string or vector) */ - -extern Lisp_Object Vexecuting_macro; - /* Index of next character to fetch from that macro */ extern int executing_macro_index; -extern void store_kbd_macro_event (Lisp_Object event); -extern void pop_kbd_macro_event (Lisp_Object event); -extern void finalize_kbd_macro_chars (struct console *con); +void store_kbd_macro_event (Lisp_Object event); +void pop_kbd_macro_event (Lisp_Object event); +void finalize_kbd_macro_chars (struct console *con); + +EXFUN (Fexecute_kbd_macro, 2); + +extern Lisp_Object Vexecuting_macro; #endif /* _XEMACS_MACROS_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/make-src-depend Mon Aug 13 10:28:48 2007 +0200 @@ -0,0 +1,137 @@ +: #-*- Perl -*- +# Copyright (C) 1998 Free Software Foundation, Inc. + +# 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. + +# Author: Martin Buchholz +eval 'exec perl -w -S $0 ${1+"$@"}' + if 0; + +use strict; +my ($myName, $srcdir, %exists, %uses, %generated_header); + +($myName = $0) =~ s@.*/@@; my $usage =" +Usage: $myName + +Generates Makefile dependencies for the XEmacs src directory. +The dependencies are written to stdout. +"; + +die $usage if @ARGV; + +($srcdir = $0) =~ s@[^/]+$@@; +chdir $srcdir or die "$srcdir: $!"; + +opendir SRCDIR, "." or die "$srcdir: $!"; +for (grep (/\.[ch]$/, readdir (SRCDIR))) { $exists{$_} = 1; } +closedir SRCDIR; + +for (qw (config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h)) { + $generated_header{$_} = 1; +} + +for my $file (keys %exists) { + open (FILE, $file) or die "$file: $!"; + undef $/; $_ = <FILE>; + RemoveComments ($_); + s/[ \t]+//g; + # Find include dependencies + for (/^\#include([^\n]+)/gm) { + if (m@^\"([A-Za-z0-9_-]+\.h)\"@) { + $uses{$file}{$1} = 1 if exists $exists{$1}; + } elsif (m@<([A-Za-z0-9_-]+\.h)>@) { + $uses{$file}{$1} = 1 if exists $generated_header{$1}; + } elsif (m@\"../lwlib/([A-Za-z0-9_-]+\.h)\"@) { + $uses{$file}{"\$(LWLIB_SRCDIR)/lwlib.h"} = 1; + } + } +} + +# Make transitive closure of %uses +while (1) { + my $changedP = 0; + for my $x (keys %uses) { + for my $y (keys %{$uses{$x}}) { + for my $z (keys %{$uses{$y}}) { + if (! exists $uses{$x}{$z}) { + $uses{$x}{$z} = 1; + $changedP = 1; + } + } + } + } + last if !$changedP; +} + +# Print file header +print +"## This file automatically generated by $myName. Do not modify. + +#ifdef USE_UNION_TYPE +LISP_UNION_H=lisp-union.h +#else +LISP_UNION_H=lisp-disunion.h +#endif +"; + +my @LISP_H = ('lisp.h', 'config.h', sort keys %{$uses{'lisp.h'}}); +#@LISP_H = grep (! /lisp-(dis)?union\.h/, @LISP_H); +print "LISP_H = @{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H)\n"; + +sub PrintDeps { + my $file = shift; + my $ofile = $file; $ofile =~ s/c$/o/; print "$ofile: "; + if (exists $uses{$file}{'lisp.h'}) { + delete @{%{$uses{$file}}}{@LISP_H}; + $uses{$file}{'$(LISP_H)'} = 1; + } + print "@{[sort keys %{$uses{$file}}]}\n"; +} + +sub PrintPatternDeps { + my ($pattern, $CPP_SYMBOL) = @_; + print "#ifdef $CPP_SYMBOL\n"; + for my $file (sort grep (/$pattern/ && /\.c$/, keys %uses)) { + PrintDeps($file); + delete $uses{$file}; + } + print "#endif\n"; +} + +PrintPatternDeps ('-msw', "HAVE_MS_WINDOWS"); +PrintPatternDeps ('-x', "HAVE_X_WINDOWS"); +PrintPatternDeps ('database', "HAVE_DATABASE"); +PrintPatternDeps ('^mule', "MULE"); +PrintPatternDeps ('^(?:External|extw-)', "EXTERNAL_WIDGET"); + +for my $file (sort grep (/\.c$/, keys %uses)) { PrintDeps($file); } + +sub RemoveComments { + $_[0] =~ + s{ ( + [^\"\'/]+ | + (?:\"[^\"\\]*(?:\\.[^\"\\]*)*\" [^\"\'/]*)+ | + (?:\'[^\'\\]*(?:\\.[^\'\\]*)*\' [^\"\'/]*)+ + ) + | / (?: + \*[^*]*\*+(?:[^/*][^*]*\*+)*/ + | + /[^\n]* + ) + }{defined $1 ? $1 : ""}gsxeo; +}
--- a/src/marker.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/marker.c Mon Aug 13 10:28:48 2007 +0200 @@ -35,15 +35,6 @@ #include "buffer.h" -static Lisp_Object mark_marker (Lisp_Object, void (*) (Lisp_Object)); -static void print_marker (Lisp_Object, Lisp_Object, int); -static int marker_equal (Lisp_Object, Lisp_Object, int); -static unsigned long marker_hash (Lisp_Object obj, int depth); -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("marker", marker, - mark_marker, print_marker, 0, - marker_equal, marker_hash, - struct Lisp_Marker); - static Lisp_Object mark_marker (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -68,7 +59,7 @@ char buf[200]; if (print_readably) - error ("printing unreadable object #<marker 0x%x>", marker); + error ("printing unreadable object #<marker 0x%lx>", (long) marker); write_c_string (GETTEXT ("#<marker "), printcharfun); if (!marker->buffer) @@ -79,7 +70,7 @@ write_c_string (buf, printcharfun); print_internal (marker->buffer->name, printcharfun, 0); } - sprintf (buf, " 0x%x>", marker); + sprintf (buf, " 0x%lx>", (long) marker); write_c_string (buf, printcharfun); } @@ -105,39 +96,39 @@ return hash; } +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("marker", marker, + mark_marker, print_marker, 0, + marker_equal, marker_hash, + struct Lisp_Marker); /* Operations on markers. */ DEFUN ("marker-buffer", Fmarker_buffer, 1, 1, 0, /* Return the buffer that MARKER points into, or nil if none. -Returns nil if MARKER points into a dead buffer. +Return nil if MARKER points into a dead buffer or doesn't point anywhere. */ (marker)) { - Lisp_Object buf; + struct buffer *buf; CHECK_MARKER (marker); - if (XMARKER (marker)->buffer) + /* Return marker's buffer only if it is not dead. */ + if ((buf = XMARKER (marker)->buffer) && BUFFER_LIVE_P (buf)) { - XSETBUFFER (buf, XMARKER (marker)->buffer); - /* Return marker's buffer only if it is not dead. */ - if (BUFFER_LIVE_P (XBUFFER (buf))) - return buf; + Lisp_Object buffer; + XSETBUFFER (buffer, buf); + return buffer; } return Qnil; } DEFUN ("marker-position", Fmarker_position, 1, 1, 0, /* Return the position MARKER points at, as a character number. -Returns `nil' if marker doesn't point anywhere. +Return `nil' if marker doesn't point anywhere. */ (marker)) { CHECK_MARKER (marker); - if (XMARKER (marker)->buffer) - { - return (make_int (marker_position (marker))); - } - return Qnil; + return XMARKER (marker)->buffer ? make_int (marker_position (marker)) : Qnil; } #if 0 /* useful debugging function */ @@ -278,7 +269,7 @@ /* This version of Fset_marker won't let the position be outside the visible part. */ -Lisp_Object +Lisp_Object set_marker_restricted (Lisp_Object marker, Lisp_Object pos, Lisp_Object buffer) { return set_marker_internal (marker, pos, buffer, 1); @@ -523,11 +514,10 @@ #endif } -void init_buffer_markers (struct buffer *b); void init_buffer_markers (struct buffer *b) { - Lisp_Object buf = Qnil; + Lisp_Object buf; XSETBUFFER (buf, b); b->mark = Fmake_marker (); @@ -536,7 +526,6 @@ Fset_marker (b->point_marker, make_int (1), buf); } -void uninit_buffer_markers (struct buffer *b); void uninit_buffer_markers (struct buffer *b) {
--- a/src/mem-limits.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mem-limits.h Mon Aug 13 10:28:48 2007 +0200 @@ -61,7 +61,7 @@ #include <sys/resource.h> #endif -#if defined(__bsdi__) || defined(__NetBSD__) +#if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__) #define BSD4_2 #endif @@ -94,11 +94,6 @@ typedef unsigned long SIZE; #endif -#ifdef NULL -#undef NULL -#endif -#define NULL ((POINTER) 0) - extern POINTER start_of_data (); #ifdef DATA_SEG_BITS #define EXCEEDS_LISP_PTR(ptr) \ @@ -114,14 +109,14 @@ #endif #endif -#else /* not emacs */ +#else /* not emacs */ extern char etext; #define start_of_data() &etext #endif /* not emacs */ #endif /* not _LIBC */ - + /* start of data space; can be changed by calling malloc_init */ static POINTER data_space_start; @@ -137,11 +132,11 @@ { if (!initialized) { - lim_data = -1; /* static_heap_size; */ + lim_data = (unsigned int) -1; /* static_heap_size; */ } else { - lim_data = -1; + lim_data = (unsigned int) -1; } } #else @@ -149,7 +144,7 @@ static void get_lim_data (void) { - lim_data = -1; + lim_data = (unsigned int) -1; } #else /* not NO_LIM_DATA */ @@ -158,7 +153,7 @@ static void get_lim_data (void) { - lim_data = -1; + lim_data = (unsigned int) -1; /* Use the ulimit call, if we seem to have it. */ #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX) @@ -167,7 +162,7 @@ /* If that didn't work, just use the macro's value. */ #ifdef ULIMIT_BREAK_VALUE - if (lim_data == -1) + if (lim_data == (unsigned int) -1) lim_data = ULIMIT_BREAK_VALUE; #endif
--- a/src/menubar-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/menubar-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -77,11 +77,11 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "commands.h" #include "console-msw.h" -#include "emacsfns.h" #include "elhash.h" #include "events.h" #include "frame.h"
--- a/src/menubar-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/menubar-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -750,7 +750,7 @@ Widget menu; struct Lisp_Event *eev = NULL; XEvent xev; - Lisp_Object frame = Qnil; + Lisp_Object frame; XSETFRAME (frame, f); CHECK_X_FRAME (frame); @@ -830,7 +830,7 @@ void vars_of_menubar_x (void) { - last_popup_menu_selection_callback_id = -1; + last_popup_menu_selection_callback_id = (LWLIB_ID) -1; #if defined (LWLIB_MENUBARS_LUCID) Fprovide (intern ("lucid-menubars"));
--- a/src/menubar.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/menubar.c Mon Aug 13 10:28:48 2007 +0200 @@ -106,7 +106,7 @@ { /* Menu descriptor should be a list */ CHECK_CONS (desc); - + /* First element may be menu name, although can be omitted. Let's think that if stuff begins with anything than a keyword or a list (submenu), this is a menu name, expected to be a stirng */ @@ -146,7 +146,7 @@ submenu, NOT expanded and NOT checked against :config and :included. Also, individual menu items are not looked for, only submenus. -See also 'find-menu-item' +See also 'find-menu-item'. */ (desc, path)) { @@ -188,7 +188,7 @@ } /* Submenu not found */ RETURN_UNGCPRO (Qnil); - + descend: /* Prepare for the next iteration */ gui_item_init (&gui_item); @@ -288,7 +288,7 @@ } DEFUN ("normalize-menu-item-name", Fnormalize_menu_item_name, 1, 2, 0, /* -Convert a menu item name string into normal form. Returns a new string. +Convert a menu item name string into normal form, and return the new string. Menu item names should be converted to normal form before being compared. */ (name, buffer))
--- a/src/menubar.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/menubar.h Mon Aug 13 10:28:48 2007 +0200 @@ -33,7 +33,7 @@ struct gui_item* pgui_item); Lisp_Object current_frame_menubar (CONST struct frame* f); -Lisp_Object Fmenu_find_real_submenu (Lisp_Object desc, Lisp_Object path); +EXFUN (Fmenu_find_real_submenu, 2); #endif /* HAVE_MENUBARS */
--- a/src/minibuf.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/minibuf.c Mon Aug 13 10:28:48 2007 +0200 @@ -351,7 +351,7 @@ bestmatch = Qnil; blength = 0; - slength = string_char_length (XSTRING (string)); + slength = XSTRING_CHAR_LENGTH (string); /* If ALIST is not a list, set TAIL just for gc pro. */ tail = alist; @@ -414,7 +414,7 @@ if (STRINGP (eltstring)) { - Charcount eltlength = string_char_length (XSTRING (eltstring)); + Charcount eltlength = XSTRING_CHAR_LENGTH (eltstring); if (slength <= eltlength && (0 > scmp (XSTRING_DATA (eltstring), XSTRING_DATA (string), @@ -554,7 +554,7 @@ return call3 (alist, string, pred, Qt); allmatches = Qnil; - slength = string_char_length (XSTRING (string)); + slength = XSTRING_CHAR_LENGTH (string); /* If ALIST is not a list, set TAIL just for gc pro. */ tail = alist; @@ -610,10 +610,10 @@ /* Is this element a possible completion? */ if (STRINGP (eltstring) - && (slength <= string_char_length (XSTRING (eltstring))) + && (slength <= XSTRING_CHAR_LENGTH (eltstring)) /* Reject alternatives that start with space unless the input starts with space. */ - && ((string_char_length (XSTRING (string)) > 0 && + && ((XSTRING_CHAR_LENGTH (string) > 0 && string_char (XSTRING (string), 0) == ' ') || string_char (XSTRING (eltstring), 0) != ' ') && (0 > scmp (XSTRING_DATA (eltstring),
--- a/src/msdos.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/msdos.c Mon Aug 13 10:28:48 2007 +0200 @@ -785,7 +785,7 @@ keyboard_map_all = always; dos_keyboard_layout = 1; - for (i = 0; i < (sizeof (keyboard_layout_list)/sizeof (struct keyboard_layout_list)); i++) + for (i = 0; i < countof (keyboard_layout_list); i++) if (code == keyboard_layout_list[i].country_code) { keyboard = keyboard_layout_list[i].keyboard_map; @@ -1217,7 +1217,7 @@ } else { - if (sc >= (sizeof (ibmpc_translate_map) / sizeof (short))) + if (sc >= countof (ibmpc_translate_map)) continue; if ((code = ibmpc_translate_map[sc]) == Ignore) continue;
--- a/src/mule-canna.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mule-canna.c Mon Aug 13 10:28:48 2007 +0200 @@ -798,7 +798,7 @@ } else { - endp = XCONS (endp)->cdr = Fcons (make_string (p, slen), Qnil); + endp = XCDR (endp) = Fcons (make_string (p, slen), Qnil); } p += slen + 1; }
--- a/src/mule-ccl.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mule-ccl.c Mon Aug 13 10:28:48 2007 +0200 @@ -21,8 +21,6 @@ /* Synched up with : FSF Emacs 20.2 */ -#include <stdio.h> - #ifdef emacs #include <config.h> @@ -34,6 +32,7 @@ #else /* not emacs */ +#include <stdio.h> #include "mulelib.h" #endif /* not emacs */ @@ -538,7 +537,7 @@ int i, j, op; int stack_idx = 0; - /* For the moment, we only support depth 256 of stack. */ + /* For the moment, we only support depth 256 of stack. */ struct ccl_prog_stack ccl_prog_stack_struct[256]; if (ic >= ccl->eof_ic) @@ -728,7 +727,7 @@ } CCL_INVALID_CMD; } - + ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; ccl_prog_stack_struct[stack_idx].ic = ic; stack_idx++; @@ -1062,7 +1061,7 @@ CHECK_SYMBOL (name); if (!NILP (ccl_prog)) CHECK_VECTOR (ccl_prog); - + for (i = 0; i < len; i++) { Lisp_Object slot = XVECTOR_DATA (Vccl_program_table)[i];
--- a/src/mule-charset.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mule-charset.c Mon Aug 13 10:28:48 2007 +0200 @@ -386,12 +386,6 @@ /* charset object */ /************************************************************************/ -static Lisp_Object mark_charset (Lisp_Object, void (*) (Lisp_Object)); -static void print_charset (Lisp_Object, Lisp_Object, int); -DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, - mark_charset, print_charset, 0, 0, 0, - struct Lisp_Charset); - static Lisp_Object mark_charset (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -433,6 +427,9 @@ write_c_string (buf, printcharfun); } +DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, + mark_charset, print_charset, 0, 0, 0, + struct Lisp_Charset); /* Make a new charset. */ static Lisp_Object @@ -441,10 +438,9 @@ Bufbyte final, unsigned char direction, Lisp_Object doc, Lisp_Object reg) { - struct Lisp_Charset *cs; - Lisp_Object obj = Qnil; - - cs = alloc_lcrecord_type (struct Lisp_Charset, lrecord_charset); + Lisp_Object obj; + struct Lisp_Charset *cs = + alloc_lcrecord_type (struct Lisp_Charset, lrecord_charset); XSETCHARSET (obj, cs); CHARSET_ID (cs) = id; @@ -521,7 +517,7 @@ */ (object)) { - return (CHARSETP (object) ? Qt : Qnil); + return CHARSETP (object) ? Qt : Qnil; } DEFUN ("find-charset", Ffind_charset, 1, 1, 0, /* @@ -534,8 +530,8 @@ { if (CHARSETP (charset_or_name)) return charset_or_name; + CHECK_SYMBOL (charset_or_name); - return Fgethash (charset_or_name, Vcharset_hashtable, Qnil); } @@ -601,7 +597,7 @@ */ (charset)) { - return (XCHARSET_NAME (Fget_charset (charset))); + return XCHARSET_NAME (Fget_charset (charset)); } DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /* @@ -927,7 +923,7 @@ if (EQ (prop, Qregistry)) return CHARSET_REGISTRY (cs); if (EQ (prop, Qccl_program)) return CHARSET_CCL_PROGRAM (cs); if (EQ (prop, Qdirection)) - return (CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l); + return CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l; if (EQ (prop, Qreverse_direction_charset)) { Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs);
--- a/src/mule-charset.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mule-charset.h Mon Aug 13 10:28:48 2007 +0200 @@ -584,31 +584,6 @@ #define REP_BYTES_BY_FIRST_BYTE(fb) (rep_bytes_by_first_byte[fb]) #endif -extern Lisp_Object Vcharset_ascii; -extern Lisp_Object Vcharset_control_1; -extern Lisp_Object Vcharset_latin_iso8859_1; -extern Lisp_Object Vcharset_latin_iso8859_2; -extern Lisp_Object Vcharset_latin_iso8859_3; -extern Lisp_Object Vcharset_latin_iso8859_4; -extern Lisp_Object Vcharset_cyrillic_iso8859_5; -extern Lisp_Object Vcharset_arabic_iso8859_6; -extern Lisp_Object Vcharset_greek_iso8859_7; -extern Lisp_Object Vcharset_hebrew_iso8859_8; -extern Lisp_Object Vcharset_latin_iso8859_9; -extern Lisp_Object Vcharset_thai_tis620; -extern Lisp_Object Vcharset_katakana_jisx0201; -extern Lisp_Object Vcharset_latin_jisx0201; -extern Lisp_Object Vcharset_japanese_jisx0208_1978; -extern Lisp_Object Vcharset_japanese_jisx0208; -extern Lisp_Object Vcharset_japanese_jisx0212; -extern Lisp_Object Vcharset_korean_ksc5601; -extern Lisp_Object Vcharset_chinese_gb2312; -extern Lisp_Object Vcharset_chinese_big5_1; -extern Lisp_Object Vcharset_chinese_big5_2; -extern Lisp_Object Vcharset_chinese_cns11643_1; -extern Lisp_Object Vcharset_chinese_cns11643_2; -extern Lisp_Object Vcharset_composite; - /************************************************************************/ /* Dealing with characters */ @@ -763,20 +738,24 @@ /* Composite characters */ /************************************************************************/ -extern Lisp_Object Vcomposite_char_int2string_hashtable; -extern Lisp_Object Vcomposite_char_string2int_hashtable; - Emchar lookup_composite_char (Bufbyte *str, int len); Lisp_Object composite_char_string (Emchar ch); - /************************************************************************/ /* Exported functions */ /************************************************************************/ -Lisp_Object Fget_charset (Lisp_Object); -Lisp_Object Ffind_charset (Lisp_Object); +EXFUN (Ffind_charset, 1); +EXFUN (Fget_charset, 1); + +extern Lisp_Object Vcharset_chinese_big5_1; +extern Lisp_Object Vcharset_chinese_big5_2; +extern Lisp_Object Vcharset_japanese_jisx0208; + +Emchar Lstream_get_emchar_1 (Lstream *stream, int first_char); +int Lstream_fput_emchar (Lstream *stream, Emchar ch); +void Lstream_funget_emchar (Lstream *stream, Emchar ch); int copy_internal_to_external (CONST Bufbyte *internal, Bytecount len, unsigned char *external);
--- a/src/mule-coding.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mule-coding.c Mon Aug 13 10:28:48 2007 +0200 @@ -142,8 +142,7 @@ unsigned int output_direction_sequence :1; }; -Lisp_Object Fcopy_coding_system (Lisp_Object old_coding_system, - Lisp_Object new_name); +EXFUN (Fcopy_coding_system, 2); struct detection_state; static int detect_coding_sjis (struct detection_state *st, CONST unsigned char *src, @@ -216,15 +215,6 @@ /* Coding system functions */ /************************************************************************/ -static Lisp_Object mark_coding_system (Lisp_Object, void (*) (Lisp_Object)); -static void print_coding_system (Lisp_Object, Lisp_Object, int); -static void finalize_coding_system (void *header, int for_disksave); - -DEFINE_LRECORD_IMPLEMENTATION ("coding-system", coding_system, - mark_coding_system, print_coding_system, - finalize_coding_system, - 0, 0, struct Lisp_Coding_System); - static Lisp_Object mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -321,6 +311,11 @@ } } +DEFINE_LRECORD_IMPLEMENTATION ("coding-system", coding_system, + mark_coding_system, print_coding_system, + finalize_coding_system, + 0, 0, struct Lisp_Coding_System); + static enum eol_type symbol_to_eol_type (Lisp_Object symbol) { @@ -350,7 +345,7 @@ static void setup_eol_coding_systems (struct Lisp_Coding_System *codesys) { - Lisp_Object codesys_obj = Qnil; + Lisp_Object codesys_obj; int len = string_length (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name); char *codesys_name = (char *) alloca (len + 7); Lisp_Object codesys_name_sym, sub_codesys_obj; @@ -376,7 +371,7 @@ } DEFUN ("coding-system-p", Fcoding_system_p, 1, 1, 0, /* -T if OBJECT is a coding system. +Return t if OBJECT is a coding system. A coding system is an object that defines how text containing multiple character sets is encoded into a stream of (typically 8-bit) bytes. The coding system is used to decode the stream into a series of @@ -969,13 +964,8 @@ { Lisp_Object cs = XCODING_SYSTEM_ISO2022_INITIAL_CHARSET (coding_system, gnum); - - if (CHARSETP(cs)){ - return XCHARSET_NAME(cs); - } - else { - return Qnil; - } + + return CHARSETP (cs) ? XCHARSET_NAME (cs) : Qnil; } DEFUN ("coding-system-charset", Fcoding_system_charset, 2, 2, 0, /* @@ -987,7 +977,7 @@ coding_system = Fget_coding_system (coding_system); CHECK_INT (gnum); - return coding_system_charset(coding_system, XINT (gnum)); + return coding_system_charset (coding_system, XINT (gnum)); } DEFUN ("coding-system-property", Fcoding_system_property, 2, 2, 0, /* @@ -1242,35 +1232,35 @@ int mask; struct - { - int mask; - int in_second_byte; - } + { + int mask; + int in_second_byte; + } big5; struct - { - int mask; - int in_second_byte; - } + { + int mask; + int in_second_byte; + } shift_jis; struct - { - int mask; - int initted; - struct iso2022_decoder iso; - unsigned int flags; - int high_byte_count; - unsigned int saw_single_shift:1; - } + { + int mask; + int initted; + struct iso2022_decoder iso; + unsigned int flags; + int high_byte_count; + unsigned int saw_single_shift:1; + } iso2022; struct - { - int seen_anything; - int just_saw_cr; - } + { + int seen_anything; + int just_saw_cr; + } eol; }; @@ -1463,7 +1453,7 @@ if (*eol_type_in_out == EOL_AUTODETECT) *eol_type_in_out = XCODING_SYSTEM_EOL_TYPE (*codesys_in_out); - memset (&decst, 0, sizeof (decst)); + xzero (decst); decst.eol_type = *eol_type_in_out; decst.mask = ~0; @@ -1521,7 +1511,7 @@ instream = make_encoding_input_stream (lb_istr, Fget_coding_system (Qbinary)); istr = XLSTREAM (instream); GCPRO2 (instream, lb_instream); - memset (&decst, 0, sizeof (decst)); + xzero (decst); decst.eol_type = EOL_AUTODETECT; decst.mask = ~0; while (1) @@ -1689,8 +1679,8 @@ struct detection_state decst; }; -static int decoding_reader (Lstream *stream, unsigned char *data, int size); -static int decoding_writer (Lstream *stream, CONST unsigned char *data, int size); +static int decoding_reader (Lstream *stream, unsigned char *data, size_t size); +static int decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size); static int decoding_rewinder (Lstream *stream); static int decoding_seekable_p (Lstream *stream); static int decoding_flusher (Lstream *stream); @@ -1723,7 +1713,7 @@ so we read data from the other end, decode it, and store it into DATA. */ static int -decoding_reader (Lstream *stream, unsigned char *data, int size) +decoding_reader (Lstream *stream, unsigned char *data, size_t size) { struct decoding_stream *str = DECODING_STREAM_DATA (stream); unsigned char *orig_data = data; @@ -1743,7 +1733,7 @@ most SIZE bytes, and delete the data from the runoff. */ if (Dynarr_length (str->runoff) > 0) { - int chunk = min (size, Dynarr_length (str->runoff)); + size_t chunk = min (size, (size_t) Dynarr_length (str->runoff)); memcpy (data, Dynarr_atp (str->runoff, 0), chunk); Dynarr_delete_many (str->runoff, 0, chunk); data += chunk; @@ -1785,7 +1775,7 @@ } static int -decoding_writer (Lstream *stream, CONST unsigned char *data, int size) +decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct decoding_stream *str = DECODING_STREAM_DATA (stream); int retval; @@ -1809,7 +1799,7 @@ { if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_ISO2022) { - Lisp_Object coding_system = Qnil; + Lisp_Object coding_system; XSETCODING_SYSTEM (coding_system, str->codesys); reset_iso2022 (coding_system, &str->iso2022); } @@ -1862,7 +1852,7 @@ Lisp_Object decoding_stream_coding_system (Lstream *stream) { - Lisp_Object coding_system = Qnil; + Lisp_Object coding_system; struct decoding_stream *str = DECODING_STREAM_DATA (stream); XSETCODING_SYSTEM (coding_system, str->codesys); @@ -1895,7 +1885,7 @@ struct decoding_stream *str = DECODING_STREAM_DATA (lstr); Lisp_Object obj; - memset (str, 0, sizeof (*str)); + xzero (*str); str->other_end = stream; str->runoff = (unsigned_char_dynarr *) Dynarr_new (unsigned_char); str->eol_type = EOL_AUTODETECT; @@ -1945,7 +1935,7 @@ if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT || str->eol_type == EOL_AUTODETECT) { - Lisp_Object codesys = Qnil; + Lisp_Object codesys; XSETCODING_SYSTEM (codesys, str->codesys); detect_coding_type (&str->decst, src, n, @@ -2127,9 +2117,9 @@ struct ccl_program ccl; }; -static int encoding_reader (Lstream *stream, unsigned char *data, int size); +static int encoding_reader (Lstream *stream, unsigned char *data, size_t size); static int encoding_writer (Lstream *stream, CONST unsigned char *data, - int size); + size_t size); static int encoding_rewinder (Lstream *stream); static int encoding_seekable_p (Lstream *stream); static int encoding_flusher (Lstream *stream); @@ -2162,7 +2152,7 @@ so we read data from the other end, encode it, and store it into DATA. */ static int -encoding_reader (Lstream *stream, unsigned char *data, int size) +encoding_reader (Lstream *stream, unsigned char *data, size_t size) { struct encoding_stream *str = ENCODING_STREAM_DATA (stream); unsigned char *orig_data = data; @@ -2182,7 +2172,7 @@ most SIZE bytes, and delete the data from the runoff. */ if (Dynarr_length (str->runoff) > 0) { - int chunk = min (size, Dynarr_length (str->runoff)); + int chunk = min ((int) size, Dynarr_length (str->runoff)); memcpy (data, Dynarr_atp (str->runoff, 0), chunk); Dynarr_delete_many (str->runoff, 0, chunk); data += chunk; @@ -2224,7 +2214,7 @@ } static int -encoding_writer (Lstream *stream, CONST unsigned char *data, int size) +encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct encoding_stream *str = ENCODING_STREAM_DATA (stream); int retval; @@ -2315,7 +2305,7 @@ Lisp_Object encoding_stream_coding_system (Lstream *stream) { - Lisp_Object coding_system = Qnil; + Lisp_Object coding_system; struct encoding_stream *str = ENCODING_STREAM_DATA (stream); XSETCODING_SYSTEM (coding_system, str->codesys); @@ -2339,7 +2329,7 @@ struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); Lisp_Object obj; - memset (str, 0, sizeof (*str)); + xzero (*str); str->runoff = Dynarr_new (unsigned_char); str->other_end = stream; set_encoding_stream_coding_system (lstr, codesys); @@ -3738,7 +3728,7 @@ unsigned int flags, ch; enum eol_type eol_type; struct decoding_stream *str = DECODING_STREAM_DATA (decoding); - Lisp_Object coding_system = Qnil; + Lisp_Object coding_system; unsigned_char_dynarr *real_dst = dst; CODING_STREAM_DECOMPOSE (str, flags, ch); @@ -3967,7 +3957,7 @@ struct encoding_stream *str, unsigned_char_dynarr *dst) { CONST char *inter94 = "()*+", *inter96= ",-./"; - int type; + unsigned int type; unsigned char final; Lisp_Object old_charset = str->iso2022.charset[reg]; @@ -4450,7 +4440,7 @@ ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM : \ Qnil) -extern CONST Extbyte * +CONST Extbyte * convert_to_external_format (CONST Bufbyte *ptr, Bytecount len, Extcount *len_out, @@ -4518,7 +4508,7 @@ return Dynarr_atp (conversion_out_dynarr, 0); } -extern CONST Bufbyte * +CONST Bufbyte * convert_from_external_format (CONST Extbyte *ptr, Extcount len, Bytecount *len_out,
--- a/src/mule-coding.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mule-coding.h Mon Aug 13 10:28:48 2007 +0200 @@ -437,20 +437,14 @@ sj2 = I2 - 2; \ } while (0) -extern Lisp_Object make_decoding_input_stream (Lstream *stream, - Lisp_Object codesys); -extern Lisp_Object make_encoding_input_stream (Lstream *stream, - Lisp_Object codesys); -extern Lisp_Object make_decoding_output_stream (Lstream *stream, - Lisp_Object codesys); -extern Lisp_Object make_encoding_output_stream (Lstream *stream, - Lisp_Object codesys); -extern Lisp_Object decoding_stream_coding_system (Lstream *stream); -extern Lisp_Object encoding_stream_coding_system (Lstream *stream); -extern void set_decoding_stream_coding_system (Lstream *stream, - Lisp_Object codesys); -extern void set_encoding_stream_coding_system (Lstream *stream, - Lisp_Object codesys); -extern void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, - enum eol_type *eol_type_in_out); +Lisp_Object make_decoding_input_stream (Lstream *stream, Lisp_Object codesys); +Lisp_Object make_encoding_input_stream (Lstream *stream, Lisp_Object codesys); +Lisp_Object make_decoding_output_stream (Lstream *stream, Lisp_Object codesys); +Lisp_Object make_encoding_output_stream (Lstream *stream, Lisp_Object codesys); +Lisp_Object decoding_stream_coding_system (Lstream *stream); +Lisp_Object encoding_stream_coding_system (Lstream *stream); +void set_decoding_stream_coding_system (Lstream *stream, Lisp_Object codesys); +void set_encoding_stream_coding_system (Lstream *stream, Lisp_Object codesys); +void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, + enum eol_type *eol_type_in_out); #endif /* _XEMACS_MULE_CODING_H_ */
--- a/src/mule-wnnfns.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mule-wnnfns.c Mon Aug 13 10:28:48 2007 +0200 @@ -582,7 +582,7 @@ } DEFUN ("wnn-server-zenkouho", Fwnn_zenkouho, 2, 2, 0, /* -Get zenkouho at BUNSETSU-NUMBER. Second argument DAI is T +Get zenkouho at BUNSETSU-NUMBER. Second argument DAI is t. if dai-bunsetsu, NIL if sho-bunsetsu. Return the current offset of zenkouho. */ (bunNo, dai)) @@ -614,7 +614,7 @@ DEFUN ("wnn-server-get-zenkouho", Fwnn_get_zenkouho, 1, 1, 0, /* -Get kanji string of KOUHO-NUMBER +Get kanji string of KOUHO-NUMBER. */ (kouhoNo)) { @@ -642,7 +642,7 @@ } DEFUN ("wnn-server-zenkouho-suu", Fwnn_zenkouho_suu, 0, 0, 0, /* -Return the number of zen kouho +Return the number of zen kouho. */ ()) { @@ -652,7 +652,7 @@ } DEFUN ("wnn-server-dai-top", Fwnn_dai_top, 1, 1, 0, /* -Return T if bunsetsu BUN-NUMBER is dai-bunsetsu. +Return t if bunsetsu BUN-NUMBER is dai-bunsetsu. */ (bunNo)) {
--- a/src/mule.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/mule.c Mon Aug 13 10:28:48 2007 +0200 @@ -48,7 +48,7 @@ error ("Too complicated regular expression for word!"); for (i = 0; i < len; i++) { - temp =XCONS (pattern)->car; + temp = XCAR (pattern); CHECK_VECTOR (temp); CHECK_STRING (XVECTOR_DATA (temp)[0]); s = XSTRING (XVECTOR_DATA (temp)[0]); @@ -80,7 +80,7 @@ wordbuf[i]->syntax = 0; wordbuf[i]->not_bol = wordbuf[i]->not_eol = 0; #endif /* EMACS19_REGEXP */ - pattern = XCONS (pattern)->cdr; + pattern = XCDR (pattern); } for (; i < MAXWORDBUF && wordbuf[i]; i++) {
--- a/src/nas.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/nas.c Mon Aug 13 10:28:48 2007 +0200 @@ -51,6 +51,11 @@ * be sure all play has finished. */ +#ifdef emacs +#include <config.h> +#include "lisp.h" +#endif + #if __STDC__ || defined (STDC_HEADERS) # include <stdlib.h> # include <stdarg.h> @@ -62,9 +67,10 @@ #endif #include <stdio.h> -#include <config.h> /* for CONST in syssignal.h (neal@ctd.comsat.com) */ #include "syssignal.h" +#undef LITTLE_ENDIAN +#undef BIG_ENDIAN #include <audio/audiolib.h> #include <audio/soundlib.h> #include <audio/snd.h> @@ -72,9 +78,6 @@ #ifdef emacs -# include <config.h> -# include "lisp.h" - # define XTOOLKIT # define XTEVENTS # define ROBUST_PLAY
--- a/src/ndir.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/ndir.h Mon Aug 13 10:28:48 2007 +0200 @@ -32,26 +32,26 @@ /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */ struct direct /* data from readdir() */ - { - long d_ino; /* inode number of entry */ - unsigned short d_reclen; /* length of this record */ - unsigned short d_namlen; /* length of string in d_name */ - char d_name[MAXNAMLEN+1]; /* name of file */ - }; +{ + long d_ino; /* inode number of entry */ + unsigned short d_reclen; /* length of this record */ + unsigned short d_namlen; /* length of string in d_name */ + char d_name[MAXNAMLEN+1]; /* name of file */ +}; typedef struct - { - int dd_fd; /* file descriptor */ - int dd_loc; /* offset in block */ - int dd_size; /* amount of valid data */ - char dd_buf[DIRBLKSIZ]; /* directory block */ - } DIR; /* stream data from opendir() */ +{ + int dd_fd; /* file descriptor */ + int dd_loc; /* offset in block */ + int dd_size; /* amount of valid data */ + char dd_buf[DIRBLKSIZ]; /* directory block */ +} DIR; /* stream data from opendir() */ -extern DIR *opendir (CONST char *filename); -extern int closedir (DIR *dirp); -extern struct direct *readdir (DIR *dirp); -extern struct direct *readdirver (DIR *dirp); -extern long telldir (DIR *dirp); -extern void seekdir (DIR *dirp, long loc); +DIR *opendir (CONST char *filename); +int closedir (DIR *dirp); +struct direct *readdir (DIR *dirp); +struct direct *readdirver (DIR *dirp); +long telldir (DIR *dirp); +void seekdir (DIR *dirp, long loc); #define rewinddir( dirp ) seekdir( dirp, 0L )
--- a/src/nt.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/nt.c Mon Aug 13 10:28:48 2007 +0200 @@ -638,7 +638,7 @@ "TERM", }; - for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++) + for (i = 0; i < countof (env_vars); i++) { if (!getenv (env_vars[i]) && (lpval = nt_get_resource (env_vars[i], &dwType)) != NULL) @@ -1248,13 +1248,13 @@ } int -sys_chmod (const char * path, int mode) +sys_chmod (const char * path, mode_t mode) { return _chmod (map_win32_filename (path, NULL), mode); } int -sys_creat (const char * path, int mode) +sys_creat (const char * path, mode_t mode) { return _creat (map_win32_filename (path, NULL), mode); } @@ -2428,7 +2428,7 @@ } int -sys_read (int fd, char * buffer, unsigned int count) +sys_read (int fd, char * buffer, size_t count) { int nchars; int to_read; @@ -2576,7 +2576,7 @@ /* For now, don't bother with a non-blocking mode */ int -sys_write (int fd, const void * buffer, unsigned int count) +sys_write (int fd, const void * buffer, size_t count) { int nchars;
--- a/src/ntheap.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/ntheap.c Mon Aug 13 10:28:48 2007 +0200 @@ -23,13 +23,12 @@ /* Adapted for XEmacs by David Hobley <david@spook-le0.cia.com.au> */ /* Synced with FSF Emacs 19.34.6 by Marc Paquette <marcpa@cam.org> */ -#include "config.h" +#include <config.h> +#include "lisp.h" /* for VALMASK */ #include <stdlib.h> -#include <stdio.h> #include "ntheap.h" -#include "lisp.h" /* for VALMASK */ /* This gives us the page size and the size of the allocation unit on NT. */ SYSTEM_INFO sysinfo_cache;
--- a/src/ntproc.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/ntproc.c Mon Aug 13 10:28:48 2007 +0200 @@ -119,13 +119,13 @@ for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--) if (!CHILD_ACTIVE (cp)) - goto Initialise; + goto Initialize; if (child_proc_count == MAX_CHILDREN) return NULL; cp = &child_procs[child_proc_count++]; - Initialise: - memset (cp, 0, sizeof(*cp)); + Initialize: + xzero (*cp); cp->fd = -1; cp->pid = -1; cp->procinfo.hProcess = NULL; @@ -284,7 +284,7 @@ if (cp == NULL) abort (); - memset (&start, 0, sizeof (start)); + xzero (start); start.cb = sizeof (start); #ifdef HAVE_NTGUI
--- a/src/objects-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/objects-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -28,7 +28,7 @@ /* Authorship: Jamie Zawinski, Chuck Thompson, Ben Wing - Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. */ @@ -36,6 +36,7 @@ #include <config.h> #include "lisp.h" +#include "hash.h" #include "console-msw.h" #include "objects-msw.h" @@ -744,7 +745,7 @@ for (i=1; i<strlen(name); i++) { - if (!isxdigit (name[i])) + if (!isxdigit ((int)name[i])) return(-1); } if (strlen(name)==7) @@ -780,7 +781,7 @@ name++; *c = '\0'; - for(i=0; i<(sizeof (mswindows_X_color_map) / sizeof (colormap_t)); i++) + for (i=0; i< countof (mswindows_X_color_map); i++) if (!stricmp (nospaces, mswindows_X_color_map[i].name)) return (mswindows_X_color_map[i].colorref); }
--- a/src/objects-msw.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/objects-msw.h Mon Aug 13 10:28:48 2007 +0200 @@ -27,7 +27,7 @@ Ultimately based on FSF. Rewritten by Ben Wing. - Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. */
--- a/src/objects-tty.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/objects-tty.h Mon Aug 13 10:28:48 2007 +0200 @@ -46,4 +46,7 @@ #define FONT_INSTANCE_TTY_CHARSET(c) (TTY_FONT_INSTANCE_DATA (c)->charset) +extern Lisp_Object Vtty_color_alist, Vtty_dynamic_color_bg; +extern Lisp_Object Vtty_dynamic_color_fg; + #endif /* _XEMACS_OBJECTS_TTY_H_ */
--- a/src/objects-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/objects-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -36,7 +36,7 @@ #include "device.h" #include "insdel.h" -int handle_nonfull_spec_fonts; +int x_handle_non_fully_specified_fonts; /************************************************************************/ @@ -152,7 +152,7 @@ /* JH: I can't believe there's no way to go backwards from a colormap ID and get its visual and number of entries, but X apparently isn't built that way... */ - int no_cells = visual->map_entries; + int no_cells = visual->map_entries; int nearest; long nearest_delta, trial_delta; int x; @@ -161,7 +161,7 @@ for (x = 0; x < no_cells; x++) cells[x].pixel = x; - + /* read the current colormap */ XQueryColors (display, colormap, cells, no_cells); nearest = 0; @@ -219,7 +219,7 @@ cmap = DEVICE_X_COLORMAP(d); visual = DEVICE_X_VISUAL (d); - memset (color, 0, sizeof (*color)); + xzero (*color); { CONST Extbyte *extname; Extcount extnamelen; @@ -262,7 +262,7 @@ /* Don't allocate the data until we're sure that we will succeed, or the finalize method may get fucked. */ c->data = xnew (struct x_color_instance_data); - if (result == 3) + if (result == 3) COLOR_INSTANCE_X_DEALLOC (c) = 0; else COLOR_INSTANCE_X_DEALLOC (c) = 1; @@ -289,7 +289,7 @@ { if (DEVICE_LIVE_P (XDEVICE (c->device))) { - if (COLOR_INSTANCE_X_DEALLOC (c)) + if (COLOR_INSTANCE_X_DEALLOC (c)) { XFreeColors (DEVICE_X_DISPLAY (XDEVICE (c->device)), DEVICE_X_COLORMAP (XDEVICE (c->device)), &COLOR_INSTANCE_X_COLOR (c).pixel, 1, 0); @@ -392,7 +392,7 @@ { /* following change suggested by Ted Phelps <phelps@dstc.edu.au> */ unsigned int def_char = 'n'; /*xf->default_char;*/ - int byte1, byte2; + unsigned int byte1, byte2; once_more: byte1 = def_char >> 8; @@ -402,8 +402,10 @@ { /* Old versions of the R5 font server have garbage (>63k) as def_char. 'n' might not be a valid character. */ - if (byte1 < xf->min_byte1 || byte1 > xf->max_byte1 || - byte2 < xf->min_char_or_byte2 || byte2 > xf->max_char_or_byte2) + if (byte1 < xf->min_byte1 || + byte1 > xf->max_byte1 || + byte2 < xf->min_char_or_byte2 || + byte2 > xf->max_char_or_byte2) f->width = 0; else f->width = xf->per_char[(byte1 - xf->min_byte1) * @@ -440,7 +442,7 @@ defined that we could almost just get rid of this damn flag and make it an assertion. */ f->proportional_p = (xf->min_bounds.width != xf->max_bounds.width || - (handle_nonfull_spec_fonts && + (x_handle_non_fully_specified_fonts && !xf->all_chars_exist)); return 1; @@ -778,7 +780,7 @@ } if (NILP (FONT_INSTANCE_X_TRUENAME (f))) { - Lisp_Object font_instance = Qnil; + Lisp_Object font_instance; XSETFONT_INSTANCE (font_instance, f); maybe_signal_simple_error ("couldn't determine font truename", @@ -917,8 +919,7 @@ /* find a font spec that matches font spec FONT and also matches (the registry of) CHARSET. */ static Lisp_Object -x_find_charset_font (Lisp_Object device, Lisp_Object font, - Lisp_Object charset) +x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset) { char **names; int count = 0; @@ -930,16 +931,16 @@ names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)), patternext, MAX_FONT_COUNT, &count); + /* ### This code seems awfully bogus -- mrb */ for (i = 0; i < count; i ++) { - CONST char *intname; + CONST Bufbyte *intname; GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA (names[i], intname); if (x_font_spec_matches_charset (XDEVICE (device), charset, - (unsigned char *) intname, - Qnil, 0, -1)) + intname, Qnil, 0, -1)) { - result = build_string (intname); + result = build_string ((char *) intname); break; } } @@ -997,7 +998,8 @@ void vars_of_objects_x (void) { - DEFVAR_BOOL ("x-handle-non-fully-specified-fonts",&handle_nonfull_spec_fonts /* + DEFVAR_BOOL ("x-handle-non-fully-specified-fonts", + &x_handle_non_fully_specified_fonts /* If this is true then fonts which do not have all characters specified will be considered to be proportional width even if they are actually fixed-width. If this is not done then characters which are supposed to @@ -1008,7 +1010,7 @@ fixed-width fonts. Since most people don't use characters which could cause problems this is set to nil by default. */ ); - handle_nonfull_spec_fonts = 0; + x_handle_non_fully_specified_fonts = 0; } void
--- a/src/objects.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/objects.c Mon Aug 13 10:28:48 2007 +0200 @@ -55,16 +55,6 @@ ****************************************************************************/ Lisp_Object Qcolor_instancep; -static Lisp_Object mark_color_instance (Lisp_Object, void (*) (Lisp_Object)); -static void print_color_instance (Lisp_Object, Lisp_Object, int); -static void finalize_color_instance (void *, int); -static int color_instance_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long color_instance_hash (Lisp_Object obj, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("color-instance", color_instance, - mark_color_instance, print_color_instance, - finalize_color_instance, color_instance_equal, - color_instance_hash, - struct Lisp_Color_Instance); static Lisp_Object mark_color_instance (Lisp_Object obj, void (*markobj) (Lisp_Object)) @@ -136,12 +126,22 @@ LISP_HASH (obj))); } +DEFINE_LRECORD_IMPLEMENTATION ("color-instance", color_instance, + mark_color_instance, print_color_instance, + finalize_color_instance, color_instance_equal, + color_instance_hash, + struct Lisp_Color_Instance); + DEFUN ("make-color-instance", Fmake_color_instance, 1, 3, 0, /* -Creates a new `color-instance' object of the specified color. -DEVICE specifies the device this object applies to and defaults to the -selected device. An error is signalled if the color is unknown or cannot -be allocated; however, if NOERROR is non-nil, nil is simply returned in -this case. (And if NOERROR is other than t, a warning may be issued.) +Return a new `color-instance' object named NAME (a string). + +Optional argument DEVICE specifies the device this object applies to +and defaults to the selected device. + +An error is signaled if the color is unknown or cannot be allocated; +however, if optional argument NO-ERROR is non-nil, nil is simply +returned in this case. (And if NO-ERROR is other than t, a warning may +be issued.) The returned object is a normal, first-class lisp object. The way you `deallocate' the color is the way you deallocate any other lisp object: @@ -153,7 +153,7 @@ { struct Lisp_Color_Instance *c; Lisp_Object val; - int retval = 0; + int retval; CHECK_STRING (name); XSETDEVICE (device, decode_device (device)); @@ -161,13 +161,11 @@ c = alloc_lcrecord_type (struct Lisp_Color_Instance, lrecord_color_instance); c->name = name; c->device = device; - c->data = 0; retval = MAYBE_INT_DEVMETH (XDEVICE (device), initialize_color_instance, (c, name, device, decode_error_behavior_flag (no_error))); - if (!retval) return Qnil; @@ -195,7 +193,7 @@ DEFUN ("color-instance-rgb-components", Fcolor_instance_rgb_components, 1, 1, 0, /* Return a three element list containing the red, green, and blue color components of COLOR-INSTANCE, or nil if unknown. -Component values range from 0-65535. +Component values range from 0 to 65535. */ (color_instance)) { @@ -206,10 +204,10 @@ if (NILP (c->device)) return Qnil; - else - return MAYBE_LISP_DEVMETH (XDEVICE (c->device), - color_instance_rgb_components, - (c)); + + return MAYBE_LISP_DEVMETH (XDEVICE (c->device), + color_instance_rgb_components, + (c)); } DEFUN ("valid-color-name-p", Fvalid_color_name_p, 1, 2, 0, /* @@ -236,15 +234,6 @@ ***************************************************************************/ Lisp_Object Qfont_instancep; -static Lisp_Object mark_font_instance (Lisp_Object, void (*) (Lisp_Object)); -static void print_font_instance (Lisp_Object, Lisp_Object, int); -static void finalize_font_instance (void *, int); -static int font_instance_equal (Lisp_Object o1, Lisp_Object o2, int depth); -static unsigned long font_instance_hash (Lisp_Object obj, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("font-instance", font_instance, - mark_font_instance, print_font_instance, - finalize_font_instance, font_instance_equal, - font_instance_hash, struct Lisp_Font_Instance); static Lisp_Object font_instance_truename_internal (Lisp_Object xfont, Error_behavior errb); @@ -310,8 +299,13 @@ depth + 1); } +DEFINE_LRECORD_IMPLEMENTATION ("font-instance", font_instance, + mark_font_instance, print_font_instance, + finalize_font_instance, font_instance_equal, + font_instance_hash, struct Lisp_Font_Instance); + DEFUN ("make-font-instance", Fmake_font_instance, 1, 3, 0, /* -Creates a new `font-instance' object of the specified name. +Return a new `font-instance' object named NAME. DEVICE specifies the device this object applies to and defaults to the selected device. An error is signalled if the font is unknown or cannot be allocated; however, if NOERROR is non-nil, nil is simply returned in @@ -391,7 +385,7 @@ Return the descent in pixels of FONT-INSTANCE. The returned value is the maximum descent for all characters in the font, where a character's descent is the number of pixels below the baseline. -(Many characters to do not have any descent. Typical characters with a +\(Many characters to do not have any descent. Typical characters with a descent are lowercase p and lowercase g.) */ (font_instance)) @@ -425,15 +419,15 @@ Error_behavior errb) { struct Lisp_Font_Instance *f = XFONT_INSTANCE (font_instance); - return DEVMETH_OR_GIVEN (XDEVICE (f->device), font_instance_truename, - (f, errb), f->name); + struct device *d = XDEVICE (f->device); + return DEVMETH_OR_GIVEN (d, font_instance_truename, (f, errb), f->name); } DEFUN ("font-instance-truename", Ffont_instance_truename, 1, 1, 0, /* Return the canonical name of FONT-INSTANCE. Font names are patterns which may match any number of fonts, of which the first found is used. This returns an unambiguous name for that font -(but not necessarily its only unambiguous name). +\(but not necessarily its only unambiguous name). */ (font_instance)) { @@ -625,7 +619,7 @@ } DEFUN ("color-specifier-p", Fcolor_specifier_p, 1, 1, 0, /* -Return non-nil if OBJECT is a color specifier. +Return t if OBJECT is a color specifier. Valid instantiators for color specifiers are:
--- a/src/objects.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/objects.h Mon Aug 13 10:28:48 2007 +0200 @@ -44,7 +44,6 @@ (COLOR_SPECIFIER_DATA (g)->face_property) DECLARE_SPECIFIER_TYPE (color); -extern Lisp_Object Qcolor; #define XCOLOR_SPECIFIER(x) XSPECIFIER_TYPE (x, color) #define XSETCOLOR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, color) #define COLOR_SPECIFIERP(x) SPECIFIER_TYPEP (x, color) @@ -70,7 +69,6 @@ (FONT_SPECIFIER_DATA (g)->face_property) DECLARE_SPECIFIER_TYPE (font); -extern Lisp_Object Qfont; #define XFONT_SPECIFIER(x) XSPECIFIER_TYPE (x, font) #define XSETFONT_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, font) #define FONT_SPECIFIERP(x) SPECIFIER_TYPEP (x, font) @@ -122,10 +120,7 @@ #define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance) #define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance) -Lisp_Object Fmake_color_instance (Lisp_Object name, Lisp_Object device, - Lisp_Object no_error); -Lisp_Object Fcolor_instance_p (Lisp_Object obj); -Lisp_Object Fcolor_instance_name (Lisp_Object obj); +EXFUN (Fmake_color_instance, 3); extern Lisp_Object Vthe_null_color_instance; @@ -161,11 +156,10 @@ Bytecount length); #endif -Lisp_Object Fmake_font_instance (Lisp_Object name, Lisp_Object device, - Lisp_Object no_error); -Lisp_Object Ffont_instance_p (Lisp_Object obj); -Lisp_Object Ffont_instance_name (Lisp_Object obj); -Lisp_Object Ffont_instance_truename (Lisp_Object obj); +EXFUN (Fmake_font_instance, 3); +EXFUN (Ffont_instance_name, 1); +EXFUN (Ffont_instance_p, 1); +EXFUN (Ffont_instance_truename, 1); extern Lisp_Object Vthe_null_font_instance;
--- a/src/offix.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/offix.c Mon Aug 13 10:28:48 2007 +0200 @@ -51,10 +51,10 @@ #include "offix-cursors.h" /*=============================================================== CursorData - * CursorData contains all the data for the cursors bitmaps - *==========================================================================*/ + * CursorData contains all the data for the cursors bitmaps + *==========================================================================*/ typedef struct -{ +{ int Width,Height; unsigned char *ImageData,*MaskData; int HotSpotX,HotSpotY; @@ -81,11 +81,11 @@ { url_width,url_height,url_bits,url_mask_bits, url_x_hot,url_y_hot }, { mime_width,mime_height,mime_bits,mime_mask_bits, - mime_x_hot,mime_y_hot } + mime_x_hot,mime_y_hot } }; /* Local prototypes */ -int DndIsDragging(void); +int DndIsDragging(void); void DndStartAction(Widget widget, XtPointer data, XEvent *event, @@ -101,7 +101,8 @@ * released. After that send a Drag And Drop ClientMessage event. Returns * non-zero if a drop did take place. *===========================================================================*/ -int DndHandleDragging(Widget widget,XEvent *event) +int +DndHandleDragging(Widget widget,XEvent *event) { XEvent Event; Window root = RootWindowOfScreen(XtScreenOfObject(widget)); @@ -118,7 +119,7 @@ GrabModeSync,GrabModeAsync,root, DndCursor[DataType].CursorID, CurrentTime); - + /* Wait for button release */ Dragging=1; RootFlag=0; while(Dragging) @@ -153,7 +154,7 @@ } else Target=DispatchWindow=XtWindow(MainWidget); - + /* Now build the event structure */ DropX=Event.xbutton.x_root; DropY=Event.xbutton.y_root; @@ -167,13 +168,13 @@ Event.xclient.data.l[2] = (long)XtWindow(widget); Event.xclient.data.l[3] = DropX + 65536L*(long)DropY; Event.xclient.data.l[4] = 1; - + /* Send the drop message */ XSendEvent(dpy,DispatchWindow,True,NoEventMask,&Event); /* Send an old style version of the message just in case */ Event.xclient.message_type = OldDndProtocol; XSendEvent(dpy,DispatchWindow,True,NoEventMask,&Event); - + #ifdef DEBUG fprintf(stderr,"ClientMessage sent to 0x%x(0x%x).\n", DispatchWindow,Target); @@ -193,7 +194,7 @@ int JunkInt; unsigned long WinState,JunkLong; unsigned char *Property; - + XGetWindowProperty(dpy,XtWindow(widget),WM_STATE, 0L,2L,False,AnyPropertyType, &JunkAtom,&JunkInt,&WinState,&JunkLong, @@ -218,23 +219,23 @@ screen = DefaultScreen(dpy); colormap= DefaultColormap(dpy,screen); root = DefaultRootWindow(dpy); - + Black.pixel=BlackPixel(dpy,screen); White.pixel=WhitePixel(dpy,screen); XQueryColor(dpy,colormap,&Black); XQueryColor(dpy,colormap,&White); - + for(i=1;i!=DndEND;i++) { DndCursor[i].ImagePixmap= XCreateBitmapFromData(dpy,root, - DndCursor[i].ImageData, + (char *) DndCursor[i].ImageData, DndCursor[i].Width, DndCursor[i].Height); DndCursor[i].MaskPixmap= XCreateBitmapFromData(dpy,root, - DndCursor[i].MaskData, + (char *) DndCursor[i].MaskData, DndCursor[i].Width, DndCursor[i].Height); DndCursor[i].CursorID= @@ -244,16 +245,16 @@ DndCursor[i].HotSpotX, DndCursor[i].HotSpotY); } - + DndCursor[0].CursorID=XCreateFontCursor(dpy,XC_question_arrow); - + /* These two are for older versions */ OldDndProtocol=XInternAtom(dpy,"DndProtocol",FALSE); OldDndSelection=XInternAtom(dpy,"DndSelection",FALSE); /* Now the correct stuff */ DndProtocol=XInternAtom(dpy,"_DND_PROTOCOL",FALSE); DndSelection=XInternAtom(dpy,"_DND_SELECTION",FALSE); - + WM_STATE=XInternAtom(dpy,"WM_STATE",True); Dragging=0; DragPrecision=10; @@ -261,26 +262,31 @@ MainWidget=shell; } -int DndIsDragging(void) { return Dragging; } +int +DndIsDragging(void) +{ + return Dragging; +} /*================================================================= DndSetData * Updates the selection data. *===========================================================================*/ -void DndSetData(int Type,unsigned char *Data,unsigned long Size) +void +DndSetData(int Type,unsigned char *Data,unsigned long Size) { Window root = DefaultRootWindow(dpy); int AuxSize; unsigned char *AuxData; unsigned long BackSize=Size; - + if (DataOK) return; - + /* Set the data type -- allow any type */ DataType = Type; - + /* Set the data */ AuxData = Data; - AuxSize = ( Size <= INT_MAX ? (int)Size : INT_MAX ); + AuxSize = ( Size <= INT_MAX ? (int)Size : INT_MAX ); XChangeProperty(dpy,root,DndSelection,XA_STRING,8, PropModeReplace,Data,AuxSize); for(Size-=(unsigned long)AuxSize;Size;Size-=(unsigned long)AuxSize) @@ -290,11 +296,11 @@ XChangeProperty(dpy,root,DndSelection,XA_STRING,8, PropModeAppend,Data,AuxSize); } - + /* Set the data for old DND version */ Size = BackSize; AuxData = Data; - AuxSize = ( Size <= INT_MAX ? (int)Size : INT_MAX ); + AuxSize = ( Size <= INT_MAX ? (int)Size : INT_MAX ); XChangeProperty(dpy,root,OldDndSelection,XA_STRING,8, PropModeReplace,Data,AuxSize); for(Size-=(unsigned long)AuxSize;Size;Size-=(unsigned long)AuxSize) @@ -304,7 +310,7 @@ XChangeProperty(dpy,root,OldDndSelection,XA_STRING,8, PropModeAppend,Data,AuxSize); } - + /* Everything is now ok */ DataOK=1; } @@ -312,18 +318,19 @@ /*================================================================== DndGetData * Return a pointer to the current data. Se HOWTO for more details. *===========================================================================*/ -void DndGetData(XEvent *event, unsigned char **Data,unsigned long *Size) +void +DndGetData(XEvent *event, unsigned char **Data,unsigned long *Size) { Window root = DefaultRootWindow(dpy); - + Atom ActualType,ActualDndSelection; int ActualFormat; unsigned long RemainingBytes; - + ActualDndSelection=(DndProtocolVersion(event) == 0L ? OldDndSelection : DndSelection ); - + XGetWindowProperty(dpy,root,ActualDndSelection, 0L,1000000L, FALSE,AnyPropertyType, @@ -333,28 +340,31 @@ } /*================================== DndDataType DndDragButtons DndSourceWidget - * + * * Return information about the Dnd event received. If a non-dnd event is * passed, the function DndDataType returns DndNotDnd, and the others * return zero. *===========================================================================*/ -int DndDataType(XEvent *event) +int +DndDataType(XEvent *event) { int Type; - + if(!DndIsDropMessage(event)) return DndNotDnd; Type=(int)(event->xclient.data.l[0]); if(Type>=DndEND) Type=DndUnknown; return Type; } -unsigned int DndDragButtons(XEvent *event) +unsigned int +DndDragButtons(XEvent *event) { if(!DndIsDropMessage(event)) return 0; return (unsigned int)(event->xclient.data.l[1]); } -Window DndSourceWindow(XEvent *event) +Window +DndSourceWindow(XEvent *event) { if(!DndIsDropMessage(event)) return 0; if(DndProtocolVersion(event)<__DragAndDropH__) @@ -363,14 +373,15 @@ return (Window)(event->xclient.data.l[2]); } -void DndDropRootCoordinates(XEvent *event,int *x,int *y) +void +DndDropRootCoordinates(XEvent *event,int *x,int *y) { if(!DndIsDropMessage(event)) { *x=0; *y=0; return; } - + /* If it is an old protocol version we try to get the coordinates using the current pointer position. Of course, the pointer may have moved since the drop, but there's nothing we can do about it. @@ -380,7 +391,7 @@ Window root_return,child_return; int win_x_return,win_y_return; unsigned int mask_return; - + XQueryPointer(dpy,DefaultRootWindow(dpy), &root_return,&child_return,x,y, &win_x_return,&win_y_return,&mask_return); @@ -391,11 +402,12 @@ *y=(int)((long)(event->xclient.data.l[3])/65536); } -void DndDropCoordinates(Widget widget,XEvent *event,int *x,int *y) +void +DndDropCoordinates(Widget widget,XEvent *event,int *x,int *y) { int root_x,root_y; Window child_return; - + DndDropRootCoordinates(event,&root_x,&root_y); XTranslateCoordinates(dpy,DefaultRootWindow(dpy), XtWindow(widget), @@ -404,13 +416,15 @@ &child_return); } -long DndProtocolVersion(XEvent *event) +long +DndProtocolVersion(XEvent *event) { if(!DndIsDropMessage(event)) return -1L; return event->xclient.data.l[4]; } -int DndIsDropMessage(XEvent *event) +int +DndIsDropMessage(XEvent *event) { if(event->xclient.type != ClientMessage) return 0; if(event->xclient.message_type == OldDndProtocol && @@ -419,8 +433,9 @@ return 0; } -void DndChangeCursor(int Type,int width,int height,char *image,char *mask, - int hot_x,int hot_y) +void +DndChangeCursor(int Type,int width,int height,char *image,char *mask, + int hot_x,int hot_y) { DndCursor[Type].ImagePixmap= XCreateBitmapFromData(dpy,DefaultRootWindow(dpy),
--- a/src/offix.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/offix.h Mon Aug 13 10:28:48 2007 +0200 @@ -36,7 +36,7 @@ void DndSetData(int Type, unsigned char *Data, unsigned long Size); void DndGetData(XEvent *event, unsigned char **Data, unsigned long *Size); - + int DndIsIcon(Widget widget); int DndDataType(XEvent *event); unsigned int DndDragButtons(XEvent *event); @@ -47,7 +47,7 @@ XEvent *event, int *x, int *y); -void +void DndDropRootCoordinates(XEvent *event, int *x, int *y);
--- a/src/opaque.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/opaque.c Mon Aug 13 10:28:48 2007 +0200 @@ -52,18 +52,6 @@ create GC junk. */ Lisp_Object Vopaque_ptr_free_list; -static Lisp_Object mark_opaque (Lisp_Object, void (*) (Lisp_Object)); -static unsigned int sizeof_opaque (CONST void *header); -static void print_opaque (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag); -static int equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int depth); -static unsigned long hash_opaque (Lisp_Object obj, int depth); - -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("opaque", opaque, - mark_opaque, print_opaque, 0, - equal_opaque, hash_opaque, - sizeof_opaque, struct Lisp_Opaque); - static Lisp_Object mark_opaque (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -99,7 +87,7 @@ write_c_string (buf, printcharfun); } -static unsigned int +static size_t sizeof_opaque (CONST void *header) { CONST struct Lisp_Opaque *p = (CONST struct Lisp_Opaque *) header; @@ -158,10 +146,10 @@ return memory_hash (XOPAQUE_DATA(obj), XOPAQUE_SIZE(obj)); } -static Lisp_Object mark_opaque_list (Lisp_Object, void (*) (Lisp_Object)); -DEFINE_LRECORD_IMPLEMENTATION ("opaque-list", opaque_list, - mark_opaque_list, internal_object_printer, - 0, 0, 0, struct Lisp_Opaque_List); +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("opaque", opaque, + mark_opaque, print_opaque, 0, + equal_opaque, hash_opaque, + sizeof_opaque, struct Lisp_Opaque); static Lisp_Object mark_opaque_list (Lisp_Object obj, void (*markobj) (Lisp_Object)) @@ -177,7 +165,7 @@ Lisp_Object (*markfun) (Lisp_Object obj, void (*markobj) (Lisp_Object))) { - Lisp_Object val = Qnil; + Lisp_Object val; struct Lisp_Opaque_List *p = alloc_lcrecord_type (struct Lisp_Opaque_List, lrecord_opaque_list); @@ -188,6 +176,10 @@ return val; } +DEFINE_LRECORD_IMPLEMENTATION ("opaque-list", opaque_list, + mark_opaque_list, internal_object_printer, + 0, 0, 0, struct Lisp_Opaque_List); + Lisp_Object allocate_managed_opaque (Lisp_Object opaque_list, CONST void *data) {
--- a/src/print.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/print.c Mon Aug 13 10:28:48 2007 +0200 @@ -36,12 +36,18 @@ #include "console-stream.h" #include "extents.h" #include "frame.h" -#include "emacsfns.h" #include "insdel.h" #include "lstream.h" +#include "sysfile.h" #endif /* not standalone */ +#include <float.h> +/* Define if not in float.h */ +#ifndef DBL_DIG +#define DBL_DIG 16 +#endif + static void print_error_message (Lisp_Object data, Lisp_Object stream); Lisp_Object Vstandard_output, Qstandard_output; @@ -258,7 +264,7 @@ { Lstream *str = Lstream_new (lstream_print, "w"); struct print_stream *ps = get_print_stream (str); - Lisp_Object val = Qnil; + Lisp_Object val; Lstream_set_character_mode (str); ps->file = file; @@ -288,7 +294,7 @@ } static int -print_writer (Lstream *stream, CONST unsigned char *data, int size) +print_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct print_stream *ps = get_print_stream (stream); @@ -331,7 +337,7 @@ return Qnil; printcharfun = canonicalize_printcharfun (printcharfun); - if (EQ (printcharfun, Qnil)) + if (NILP (printcharfun)) { stdio_stream = stdout; } @@ -475,23 +481,22 @@ struct gcpro gcpro1; Lisp_Object name; int speccount = specpdl_depth (); - Lisp_Object buf, val; + Lisp_Object val; #ifdef I18N3 /* #### should set the buffer to be translating. See print_internal(). */ #endif GCPRO1 (args); - name = Feval (Fcar (args)); + name = Feval (XCAR (args)); UNGCPRO; CHECK_STRING (name); temp_output_buffer_setup ((char *) XSTRING_DATA (name)); - buf = Vstandard_output; - val = Fprogn (Fcdr (args)); + val = Fprogn (XCDR (args)); - temp_output_buffer_show (buf, Qnil); + temp_output_buffer_show (Vstandard_output, Qnil); return unbind_to (speccount, val); } @@ -610,7 +615,6 @@ return obj; } -#include "emacsfns.h" /* Synched with Emacs 19.34 -- underlying implementation (incarnated in print_error_message) is completely divergent, though. */ @@ -908,7 +912,7 @@ obj = XCDR (obj); } } - if (!NILP (obj) && !CONSP (obj)) + if (!LISTP (obj)) { write_c_string (" . ", printcharfun); print_internal (obj, printcharfun, escapeflag); @@ -1548,8 +1552,8 @@ static int debug_print_length = 50; static int debug_print_level = 15; Lisp_Object debug_temp; -void debug_print_no_newline (Lisp_Object debug_print_obj); -void + +static void debug_print_no_newline (Lisp_Object debug_print_obj) { /* This function can GC */ @@ -1582,16 +1586,17 @@ UNGCPRO; } -void debug_print (Lisp_Object debug_print_obj); void debug_print (Lisp_Object debug_print_obj) { debug_print_no_newline (debug_print_obj); - stderr_out ("\r\n"); + stderr_out ("\n"); fflush (stderr); } /* Debugging kludge -- unbuffered */ +/* This function provided for the benefit of the debugger. */ +void debug_backtrace (void); void debug_backtrace (void) {
--- a/src/process-unix.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/process-unix.c Mon Aug 13 10:28:48 2007 +0200 @@ -320,14 +320,14 @@ int count = 0; #endif - memset (address, 0, sizeof (*address)); + xzero (*address); while (1) { #ifdef TRY_AGAIN if (count++ > 10) break; #ifndef BROKEN_CYGWIN - h_errno = 0; + h_errno = 0; #endif #endif /* Some systems can't handle SIGIO/SIGALARM in gethostbyname. */ @@ -647,7 +647,7 @@ /* Process implementation methods */ /**********************************************************************/ -/* +/* * Allocate and initialize Lisp_Process->process_data */ @@ -705,7 +705,7 @@ /* * Fork off a subprocess. P is a pointer to newly created subprocess * object. If this function signals, the caller is responsible for - * deleting (and finalizing) the process object. + * deleting (and finalizing) the process object. * * The method must return PID of the new proces, a (positive??? ####) number * which fits into Lisp_Int. No return value indicates an error, the method @@ -1126,12 +1126,13 @@ } static void -unix_send_process (volatile Lisp_Object proc, struct lstream* lstream) +unix_send_process (Lisp_Object proc, struct lstream* lstream) { /* Use volatile to protect variables from being clobbered by longjmp. */ SIGTYPE (*volatile old_sigpipe) (int) = 0; - volatile struct Lisp_Process *p = XPROCESS (proc); - + volatile Lisp_Object vol_proc = proc; + struct Lisp_Process *volatile p = XPROCESS (proc); + if (!SETJMP (send_process_frame)) { /* use a reasonable-sized buffer (somewhere around the size of the @@ -1160,7 +1161,7 @@ /* This is a real error. Blocking errors are handled specially inside of the filedesc stream. */ report_file_error ("writing to process", - list1 (proc)); + list1 (vol_proc)); while (Lstream_was_blocked_p (XLSTREAM (p->pipe_outstream))) { /* Buffer is full. Wait, accepting input; @@ -1182,11 +1183,11 @@ p->core_dumped = 0; p->tick++; process_tick++; - deactivate_process (proc); + deactivate_process (vol_proc); error ("SIGPIPE raised on process %s; closed it", XSTRING_DATA (p->name)); } - + old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); Lstream_flush (XLSTREAM (DATA_OUTSTREAM(p))); signal (SIGPIPE, old_sigpipe); @@ -1245,7 +1246,7 @@ old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, SIG_IGN); usid = event_stream_delete_stream_pair (p->pipe_instream, p->pipe_outstream); signal (SIGPIPE, old_sigpipe); - + UNIX_DATA(p)->infd = -1; return usid; @@ -1354,19 +1355,25 @@ else { /* gid may be a pid, or minus a pgrp's number */ -#ifdef TIOCSIGSEND +#if defined (TIOCSIGNAL) || defined (TIOCSIGSEND) if (current_group) - kill_retval = ioctl (UNIX_DATA(p)->infd, TIOCSIGSEND, signo); + { +#ifdef (TIOCSIGNAL) + kill_retval = ioctl (UNIX_DATA(p)->infd, TIOCSIGNAL, signo); +#else /* ! defined (TIOCSIGNAL) */ + kill_retval = ioctl (UNIX_DATA(p)->infd, TIOCSIGSEND, signo); +#endif /* ! defined (TIOCSIGNAL) */ + } else kill_retval = kill (- XINT (p->pid), signo) ? errno : 0; -#else /* ! defined (TIOCSIGSEND) */ +#else /* ! (defined (TIOCSIGNAL) || defined (TIOCSIGSEND)) */ kill_retval = EMACS_KILLPG (-gid, signo) ? errno : 0; -#endif /* ! defined (TIOCSIGSEND) */ +#endif /* ! (defined (TIOCSIGNAL) || defined (TIOCSIGSEND)) */ } if (kill_retval < 0 && errno == EINVAL) - error ("Signal number %d is invalid for this system", make_int (signo)); -} + error ("Signal number %d is invalid for this system", signo); +} /* * Kill any process in the system given its PID. @@ -1411,7 +1418,7 @@ else /* #### any clue what to do here? */ return host; -} +} /* open a TCP network connection to a given HOST/SERVICE. Treated exactly like a normal process when reading and writing. Only @@ -1428,7 +1435,7 @@ volatile int port; volatile int retry = 0; int retval; - + CHECK_STRING (host); if (!EQ (family, Qtcpip)) @@ -1532,7 +1539,7 @@ *vinfd = (void*)inch; *voutfd = (void*)outch; -} +} #ifdef HAVE_MULTICAST @@ -1570,16 +1577,16 @@ volatile int retry = 0; CHECK_STRING (dest); - + CHECK_NATNUM (port); theport = htons ((unsigned short) XINT (port)); - + CHECK_NATNUM (ttl); thettl = (unsigned char) XINT (ttl); - + if ((udp = getprotobyname ("udp")) == NULL) error ("No info available for UDP protocol"); - + /* Init the sockets. Yes, I need 2 sockets. I couldn't duplicate one. */ if ((rs = socket (PF_INET, SOCK_DGRAM, udp->p_proto)) < 0) report_file_error ("error creating socket", list1(name)); @@ -1588,22 +1595,22 @@ close (rs); report_file_error ("error creating socket", list1(name)); } - + /* This will be used for both sockets */ bzero(&sa, sizeof(sa)); - sa.sin_family = AF_INET; + sa.sin_family = AF_INET; sa.sin_port = theport; sa.sin_addr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); /* Socket configuration for reading ------------------------ */ - + /* Multiple connections from the same machine. This must be done before bind. If it fails, it shouldn't be fatal. The only consequence is that people won't be able to connect twice from the same machine. */ if (setsockopt (rs, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof (one)) < 0) warn_when_safe (Qmulticast, Qwarning, "Cannot reuse socket address"); - + /* bind socket name */ if (bind (rs, (struct sockaddr *)&sa, sizeof(sa))) { @@ -1611,7 +1618,7 @@ close (ws); report_file_error ("error binding socket", list2(name, port)); } - + /* join multicast group */ imr.imr_multiaddr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); imr.imr_interface.s_addr = htonl (INADDR_ANY); @@ -1622,19 +1629,19 @@ close (rs); report_file_error ("error adding membership", list2(name, dest)); } - + /* Socket configuration for writing ----------------------- */ - + /* Normaly, there's no 'connect' in multicast, since we use preferentialy 'sendto' and 'recvfrom'. However, in order to handle this connection in the process-like way it is done for TCP, we must be able to use 'write' instead of 'sendto'. Consequently, we 'connect' this socket. */ - + /* See open-network-stream-internal for comments on this part of the code */ slow_down_interrupts (); - + loop: - + /* A system call interrupted with a SIGALRM or SIGIO comes back here, with can_break_system_calls reset to 0. */ SETJMP (break_system_call_jump); @@ -1645,7 +1652,7 @@ /* In case something really weird happens ... */ slow_down_interrupts (); } - + /* Break out of connect with a signal (it isn't otherwise possible). Thus you don't get screwed with a hung network. */ can_break_system_calls = 1; @@ -1654,11 +1661,11 @@ if (ret == -1 && errno != EISCONN) { int xerrno = errno; - + if (errno == EINTR) goto loop; if (errno == EADDRINUSE && retry < 20) - { + { /* A delay here is needed on some FreeBSD systems, and it is harmless, since this retrying takes time anyway and should be infrequent. @@ -1669,26 +1676,26 @@ retry++; goto loop; } - + close (rs); close (ws); speed_up_interrupts (); - + errno = xerrno; report_file_error ("error connecting socket", list2(name, port)); } - + speed_up_interrupts (); - + /* scope */ - if (setsockopt (ws, IPPROTO_IP, IP_MULTICAST_TTL, + if (setsockopt (ws, IPPROTO_IP, IP_MULTICAST_TTL, (char *) &thettl, sizeof (thettl)) < 0) { close (rs); close (ws); report_file_error ("error setting ttl", list2(name, ttl)); } - + set_socket_nonblocking_maybe (rs, theport, "udp"); *vinfd = (void*)rs;
--- a/src/process.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/process.c Mon Aug 13 10:28:48 2007 +0200 @@ -68,7 +68,7 @@ (name of name of port we are connected to . foreign host name) */ /* Valid values of process->status_symbol */ -Lisp_Object Qrun, Qstop; /* Qexit from eval.c, Qsignal from data.c. */ +Lisp_Object Qrun, Qstop; /* Qrun => Qopen, Qexit => Qclosed for "network connection" processes */ Lisp_Object Qopen, Qclosed; /* Protocol families */ @@ -105,12 +105,6 @@ Lisp_Object Vprocess_list; -static Lisp_Object mark_process (Lisp_Object, void (*) (Lisp_Object)); -static void print_process (Lisp_Object, Lisp_Object, int); -static void finalize_process (void *, int); -DEFINE_LRECORD_IMPLEMENTATION ("process", process, - mark_process, print_process, finalize_process, - 0, 0, struct Lisp_Process); static Lisp_Object mark_process (Lisp_Object obj, void (*markobj) (Lisp_Object)) @@ -186,6 +180,9 @@ } } +DEFINE_LRECORD_IMPLEMENTATION ("process", process, + mark_process, print_process, finalize_process, + 0, 0, struct Lisp_Process); /************************************************************************/ /* basic process accessors */ @@ -471,7 +468,7 @@ if (usid == USID_ERROR) report_file_error ("Setting up communication with subprocess", Qnil); - + if (usid != USID_DONTHASH) { Lisp_Object proc = Qnil; @@ -657,7 +654,7 @@ generalized connection function. Both UNIX ans Win32 support BSD sockets, and there are many extensions - availalble (Sockets 2 spec). + availalble (Sockets 2 spec). A todo is define a consistent set of properties abstracting a network connection. -kkm @@ -685,7 +682,7 @@ Fourth arg SERVICE is name of the service desired, or an integer specifying a port number to connect to. Fifth argument FAMILY is a protocol family. When omitted, 'tcp/ip -(Internet protocol family TCP/IP) is assumed. +\(Internet protocol family TCP/IP) is assumed. */ (name, buffer, host, service, family)) { @@ -707,7 +704,7 @@ open_network_stream is mandatory */ PROCMETH (open_network_stream, (name, host, service, family, &inch, &outch)); - + if (!NILP (buffer)) buffer = Fget_buffer_create (buffer); proc = make_process_internal (name); @@ -756,7 +753,7 @@ open_network_stream is mandatory */ PROCMETH (open_multicast_group, (name, dest, port, ttl, &inch, &outch)); - + if (!NILP (buffer)) buffer = Fget_buffer_create (buffer); @@ -766,9 +763,9 @@ XPROCESS (proc)->pid = Fcons (port, dest); XPROCESS (proc)->buffer = buffer; init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, 0); - + event_stream_select_process (XPROCESS (proc)); - + UNGCPRO; return proc; } @@ -1929,10 +1926,6 @@ defsymbol (&Qprocessp, "processp"); defsymbol (&Qrun, "run"); defsymbol (&Qstop, "stop"); - defsymbol (&Qsignal, "signal"); - /* Qexit is already defined by syms_of_eval - * defsymbol (&Qexit, "exit"); - */ defsymbol (&Qopen, "open"); defsymbol (&Qclosed, "closed");
--- a/src/process.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/process.h Mon Aug 13 10:28:48 2007 +0200 @@ -33,7 +33,7 @@ #define kill_buffer_processes(x) 0 #define close_process_descs() 0 #define init_xemacs_process() 0 -extern void wait_without_blocking (void); +void wait_without_blocking (void); #else /* not NO_SUBPROCESSES */ @@ -50,24 +50,7 @@ #ifdef emacs -Lisp_Object Fget_process (Lisp_Object name); -Lisp_Object Fget_buffer_process (Lisp_Object name); -Lisp_Object Fprocessp (Lisp_Object object); -Lisp_Object Fprocess_status (Lisp_Object process); -Lisp_Object Fkill_process (Lisp_Object process, - Lisp_Object current_group); -Lisp_Object Fdelete_process (Lisp_Object process); -Lisp_Object Fopen_network_stream_internal (Lisp_Object name, - Lisp_Object buffer, - Lisp_Object host, - Lisp_Object service, - Lisp_Object family); -Lisp_Object Fopen_multicast_group_internal (Lisp_Object name, - Lisp_Object buffer, - Lisp_Object dest, - Lisp_Object port, - Lisp_Object ttl); -Lisp_Object Fprocess_kill_without_query (Lisp_Object, Lisp_Object); +EXFUN (Fprocess_kill_without_query, 2); Lisp_Object connect_to_file_descriptor (Lisp_Object name, Lisp_Object buffer, @@ -109,7 +92,8 @@ #define network_connection_p(x) 0 #endif -extern Lisp_Object Qrun, Qexit, Qopen, Qclosed; +extern Lisp_Object Qclosed, Qmulticast, Qopen, Qrun, Qstop, Qtcpip; +extern Lisp_Object Vprocess_connection_type, Vprocess_list; /* Report all recent events of a change in process status (either run the sentinel or output a message).
--- a/src/pure.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/pure.c Mon Aug 13 10:28:48 2007 +0200 @@ -18,25 +18,19 @@ /* Synched up with: FSF 19.30. Split out of alloc.c. */ #include <config.h> +#include "lisp.h" #include "puresize.h" -#include "lisp.h" /* Moved from puresize.h to here so alloc.c does not get recompiled */ # include <puresize-adjust.h> #define PURESIZE ((RAW_PURESIZE) + (PURESIZE_ADJUSTMENT)) -long int -get_PURESIZE(void) +size_t +get_PURESIZE (void) { return PURESIZE; } -Lisp_Object pure[PURESIZE / sizeof (Lisp_Object)] - /* Force linker to put it into data space! */ -#ifdef NO_UNION_TYPE - = {0}; -#else - /* Need this many braces to convince GCC not to complain */ - = {{{0}}}; -#endif +/* Force linker to put it into data space! */ +EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = { (EMACS_INT) 0};
--- a/src/puresize.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/puresize.h Mon Aug 13 10:28:48 2007 +0200 @@ -163,6 +163,7 @@ #endif /* !RAW_PURESIZE */ -extern long int get_PURESIZE(void); +size_t get_PURESIZE (void); +extern EMACS_INT pure[]; #endif /* PURESIZE_H */
--- a/src/ralloc.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/ralloc.c Mon Aug 13 10:28:48 2007 +0200 @@ -27,12 +27,18 @@ rather than all of them. This means allowing for a possible hole between the first bloc and the end of malloc storage. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifdef HAVE_UNISTD_H +#include <unistd.h> /* for getpagesize() */ +#endif + #ifdef emacs -#include <config.h> -#include "lisp.h" /* Needed for VALBITS. */ - -#undef NULL +#include "lisp.h" +#include <malloc.h> /* The important properties of this type are that 1) it's a pointer, and 2) arithmetic on it should work as if the size of the object pointed @@ -51,13 +57,13 @@ typedef unsigned long SIZE; #ifdef DOUG_LEA_MALLOC -#define M_TOP_PAD -2 -extern int mallopt (); +#define M_TOP_PAD -2 #endif #include "getpagesize.h" #include <string.h> +void refill_memory_reserve (void); #else /* Not emacs. */ @@ -72,6 +78,7 @@ #endif /* emacs. */ +void init_ralloc (void); #define safe_bcopy(x, y, z) memmove (y, x, z) #define NIL ((POINTER) 0) @@ -91,7 +98,7 @@ /* Declarations for working with the malloc, ralloc, and system breaks. */ /* Function to set the real break value. */ -static POINTER (*real_morecore) (); +static POINTER (*real_morecore) (long size); /* The break value, as seen by malloc (). */ static POINTER virtual_break_value; @@ -99,9 +106,6 @@ /* The break value, viewed by the relocatable blocs. */ static POINTER break_value; -/* The REAL (i.e., page aligned) break value of the process. */ -static POINTER page_break_value; - /* This is the size of a page. We round memory requests to this boundary. */ static int page_size; @@ -135,7 +139,7 @@ We try to make just one heap and make it larger as necessary. But sometimes we can't do that, because we can't get contiguous space to add onto the heap. When that happens, we start a new heap. */ - + typedef struct heap { struct heap *next; @@ -209,8 +213,7 @@ /* Find the heap that ADDRESS falls within. */ static heap_ptr -find_heap (address) - POINTER address; +find_heap (POINTER address) { heap_ptr heap; @@ -383,6 +386,7 @@ /* Return the total size in use by relocating allocator, above where malloc gets space. */ +long r_alloc_size_in_use (void); long r_alloc_size_in_use () { @@ -466,21 +470,18 @@ /* Calculate new locations of blocs in the list beginning with BLOC, relocating it to start at ADDRESS, in heap HEAP. If enough space is not presently available in our reserve, call obtain for - more space. - + more space. + Store the new location of each bloc in its new_data field. Do not touch the contents of blocs or break_value. */ static int -relocate_blocs (bloc, heap, address) - bloc_ptr bloc; - heap_ptr heap; - POINTER address; +relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address) { register bloc_ptr b = bloc; /* No need to ever call this if arena is frozen, bug somewhere! */ - if (r_alloc_freeze_level) + if (r_alloc_freeze_level) abort(); while (b) @@ -505,7 +506,7 @@ /* Add up the size of all the following blocs. */ while (tb != NIL_BLOC) { - if (tb->variable) + if (tb->variable) s += tb->size; tb = tb->next; @@ -522,7 +523,7 @@ /* Record the new address of this bloc and update where the next bloc can start. */ b->new_data = address; - if (b->variable) + if (b->variable) address += b->size; b = b->next; } @@ -530,13 +531,13 @@ return 1; } +#if 0 /* unused */ /* Reorder the bloc BLOC to go before bloc BEFORE in the doubly linked list. This is necessary if we put the memory of space of BLOC before that of BEFORE. */ static void -reorder_bloc (bloc, before) - bloc_ptr bloc, before; +reorder_bloc (bloc_ptr bloc, bloc_ptr before) { bloc_ptr prev, next; @@ -559,14 +560,13 @@ before->prev = bloc; bloc->next = before; } +#endif /* unused */ /* Update the records of which heaps contain which blocs, starting with heap HEAP and bloc BLOC. */ static void -update_heap_bloc_correspondence (bloc, heap) - bloc_ptr bloc; - heap_ptr heap; +update_heap_bloc_correspondence (bloc_ptr bloc, heap_ptr heap) { register bloc_ptr b; @@ -628,9 +628,7 @@ that come after BLOC in memory. */ static int -resize_bloc (bloc, size) - bloc_ptr bloc; - SIZE size; +resize_bloc (bloc_ptr bloc, SIZE size) { register bloc_ptr b; heap_ptr heap; @@ -638,7 +636,7 @@ SIZE old_size; /* No need to ever call this if arena is frozen, bug somewhere! */ - if (r_alloc_freeze_level) + if (r_alloc_freeze_level) abort(); if (bloc == NIL_BLOC || size == bloc->size) @@ -680,8 +678,8 @@ { b->size = 0; b->data = b->new_data; - } - else + } + else { safe_bcopy (b->data, b->new_data, b->size); *b->variable = b->data = b->new_data; @@ -707,8 +705,8 @@ { b->size = 0; b->data = b->new_data; - } - else + } + else { safe_bcopy (b->data, b->new_data, b->size); *b->variable = b->data = b->new_data; @@ -736,7 +734,7 @@ bloc->variable = (POINTER *) NIL; return; } - + resize_bloc (bloc, 0); if (bloc == first_bloc && bloc == last_bloc) @@ -792,6 +790,7 @@ __morecore hook values - in particular, __default_morecore in the GNU malloc package. */ +POINTER r_alloc_sbrk (long size); POINTER r_alloc_sbrk (long size) { @@ -847,7 +846,7 @@ if (first_heap->bloc_start < new_bloc_start) { /* This is no clean solution - no idea how to do it better. */ - if (r_alloc_freeze_level) + if (r_alloc_freeze_level) return NIL; /* There is a bug here: if the above obtain call succeeded, but the @@ -942,6 +941,7 @@ If we can't allocate the necessary memory, set *PTR to zero, and return zero. */ +POINTER r_alloc (POINTER *ptr, SIZE size); POINTER r_alloc (POINTER *ptr, SIZE size) { @@ -965,6 +965,7 @@ /* Free a bloc of relocatable storage whose data is pointed to by PTR. Store 0 in *PTR to show there's no block allocated. */ +void r_alloc_free (POINTER *ptr); void r_alloc_free (POINTER *ptr) { @@ -999,6 +1000,7 @@ If more memory cannot be allocated, then leave *PTR unchanged, and return zero. */ +POINTER r_re_alloc (POINTER *ptr, SIZE size); POINTER r_re_alloc (POINTER *ptr, SIZE size) { @@ -1009,7 +1011,7 @@ if (!*ptr) return r_alloc (ptr, size); - if (!size) + if (!size) { r_alloc_free (ptr); return r_alloc (ptr, 0); @@ -1019,12 +1021,12 @@ if (bloc == NIL_BLOC) abort (); - if (size < bloc->size) + if (size < bloc->size) { /* Wouldn't it be useful to actually resize the bloc here? */ /* I think so too, but not if it's too expensive... */ - if ((bloc->size - MEM_ROUNDUP (size) >= page_size) - && r_alloc_freeze_level == 0) + if ((bloc->size - MEM_ROUNDUP (size) >= page_size) + && r_alloc_freeze_level == 0) { resize_bloc (bloc, MEM_ROUNDUP (size)); /* Never mind if this fails, just do nothing... */ @@ -1046,7 +1048,7 @@ else return NIL; } - else + else { if (! resize_bloc (bloc, MEM_ROUNDUP (size))) return NIL; @@ -1060,9 +1062,9 @@ guaranteed to hold still until thawed, even if this means that malloc must return a null pointer. */ +void r_alloc_freeze (long size); void -r_alloc_freeze (size) - long size; +r_alloc_freeze (long size) { if (! r_alloc_initialized) init_ralloc (); @@ -1078,26 +1080,27 @@ r_alloc_sbrk (-size); } +void r_alloc_thaw (void); void r_alloc_thaw () { - if (! r_alloc_initialized) + if (! r_alloc_initialized) init_ralloc (); if (--r_alloc_freeze_level < 0) abort (); - /* This frees all unused blocs. It is not too inefficient, as the resize - and bcopy is done only once. Afterwards, all unreferenced blocs are + /* This frees all unused blocs. It is not too inefficient, as the resize + and bcopy is done only once. Afterwards, all unreferenced blocs are already shrunk to zero size. */ - if (!r_alloc_freeze_level) + if (!r_alloc_freeze_level) { bloc_ptr *b = &first_bloc; - while (*b) - if (!(*b)->variable) - free_bloc (*b); - else + while (*b) + if (!(*b)->variable) + free_bloc (*b); + else b = &(*b)->next; } } @@ -1105,10 +1108,13 @@ /* The hook `malloc' uses for the function which gets more space from the system. */ -extern POINTER (*__morecore) (); +/* extern POINTER (*__morecore) (long size); */ /* Initialize various things for memory allocation. */ +#define SET_FUN_PTR(fun_ptr, fun_val) \ + (*((void **) (&fun_ptr)) = ((void *) (fun_val))) + void init_ralloc (void) { @@ -1116,8 +1122,8 @@ return; r_alloc_initialized = 1; - real_morecore = __morecore; - __morecore = r_alloc_sbrk; + SET_FUN_PTR (real_morecore, __morecore); + SET_FUN_PTR (__morecore, r_alloc_sbrk); first_heap = last_heap = &heap_base; first_heap->next = first_heap->prev = NIL_HEAP; @@ -1162,15 +1168,16 @@ /* Reinitialize the morecore hook variables after restarting a dumped Emacs. This is needed when using Doug Lea's malloc from GNU libc. */ +void r_alloc_reinit (void); void r_alloc_reinit () { /* Only do this if the hook has been reset, so that we don't get an infinite loop, in case Emacs was linked statically. */ - if (__morecore != r_alloc_sbrk) + if ( ((void*) __morecore) != (void *) (r_alloc_sbrk)) { - real_morecore = __morecore; - __morecore = r_alloc_sbrk; + SET_FUN_PTR (real_morecore, __morecore); + SET_FUN_PTR (__morecore, r_alloc_sbrk); } } #if 0 @@ -1411,7 +1418,7 @@ /* We settle for a standard doubly-linked-list. The dynarr type isn't very amenable to deletion of items in the middle, so we conjure up yet another stupid datastructure. The structure is maintained as a - ring, and the singleton ring has the sole element as it's left and + ring, and the singleton ring has the sole element as its left and right neighbours. */ static void init_MHASH_table (void); /* Forward reference */ @@ -1498,7 +1505,7 @@ struct { int n_hits; /* How many addresses map to this? */ MMAP_HANDLE handle; /* What is the current handle? */ - VM_ADDR addr; /* What is it's VM address? */ + VM_ADDR addr; /* What is its VM address? */ } MHASH_HITS[ MHASH_PRIME ]; static void @@ -1527,7 +1534,7 @@ return ((hval >= 0) ? hval : MHASH_PRIME + hval); } -/* Add a VM address with it's corresponding handle to the table. */ +/* Add a VM address with its corresponding handle to the table. */ static void MHASH_ADD (VM_ADDR addr, MMAP_HANDLE h) { @@ -1559,18 +1566,18 @@ /* If we're metering, we introduce some extra symbols to aid the noble cause of bloating XEmacs core size. */ -Lisp_Object Qmm_times_mapped; -Lisp_Object Qmm_pages_mapped; -Lisp_Object Qmm_times_unmapped; -Lisp_Object Qmm_times_remapped; -Lisp_Object Qmm_didnt_copy; -Lisp_Object Qmm_pages_copied; -Lisp_Object Qmm_average_bumpval; -Lisp_Object Qmm_wastage; -Lisp_Object Qmm_live_pages; -Lisp_Object Qmm_addr_looked_up; -Lisp_Object Qmm_hash_worked; -Lisp_Object Qmm_addrlist_size; +static Lisp_Object Qmmap_times_mapped; +static Lisp_Object Qmmap_pages_mapped; +static Lisp_Object Qmmap_times_unmapped; +static Lisp_Object Qmmap_times_remapped; +static Lisp_Object Qmmap_didnt_copy; +static Lisp_Object Qmmap_pages_copied; +static Lisp_Object Qmmap_average_bumpval; +static Lisp_Object Qmmap_wastage; +static Lisp_Object Qmmap_live_pages; +static Lisp_Object Qmmap_addr_looked_up; +static Lisp_Object Qmmap_hash_worked; +static Lisp_Object Qmmap_addrlist_size; #define M_Map 0 /* How many times allocated? */ #define M_Pages_Map 1 /* How many pages allocated? */ @@ -1594,34 +1601,35 @@ DEFUN ("mmap-allocator-status", Fmmap_allocator_status, 0, 0, 0, /* Return some information about mmap-based allocator. - mmap-addrlist-size: number of entries in address picking list. - mmap-times-mapped: number of times r_alloc was called. - mmap-pages-mapped: number of pages mapped by r_alloc calls only. - mmap-times-unmapped: number of times r_free was called. - mmap-times-remapped: number of times r_re_alloc was called. - mmap-didnt-copy: number of times re-alloc didn\'t have to move the block. - mmap-pages-copied: total number of pages copied. - mmap-average-bumpval: average increase in size demanded to re-alloc. - mmap-wastage: total number of bytes allocated, but not currently in use. - mmap-live-pages: total number of pages live. +mmap-times-mapped: number of times r_alloc was called. +mmap-pages-mapped: number of pages mapped by r_alloc calls only. +mmap-times-unmapped: number of times r_free was called. +mmap-times-remapped: number of times r_re_alloc was called. +mmap-didnt-copy: number of times re-alloc did NOT have to move the block. +mmap-pages-copied: total number of pages copied. +mmap-average-bumpval: average increase in size demanded to re-alloc. +mmap-wastage: total number of bytes allocated, but not currently in use. +mmap-live-pages: total number of pages live. +mmap-addr-looked-up: total number of times needed to check if addr is in block. +mmap-hash-worked: total number of times the simple hash check worked. +mmap-addrlist-size: number of entries in address picking list. */ ()) { - Lisp_Object result; + Lisp_Object result = Qnil; - result = Fcons (Fcons (Qmm_addrlist_size, MLVAL (M_Addrlist_Size)), Qnil); - result = Fcons (Fcons (Qmm_hash_worked, MLVAL (M_Hash_Worked)), result); - result = Fcons (Fcons (Qmm_addr_looked_up, MLVAL (M_Address_Lookup)), result); - result = Fcons (Fcons (Qmm_live_pages, MLVAL (M_Live_Pages)), result); - result = Fcons (Fcons (Qmm_wastage, MLVAL (M_Wastage)), result); - result = Fcons (Fcons (Qmm_average_bumpval, MLVAL (M_Average_Bumpval)), - result); - result = Fcons (Fcons (Qmm_pages_copied, MLVAL (M_Copy_Pages)), result); - result = Fcons (Fcons (Qmm_didnt_copy, MLVAL (M_Didnt_Copy)), result); - result = Fcons (Fcons (Qmm_times_remapped, MLVAL (M_Remap)), result); - result = Fcons (Fcons (Qmm_times_unmapped, MLVAL (M_Unmap)), result); - result = Fcons (Fcons (Qmm_pages_mapped, MLVAL (M_Pages_Map)), result); - result = Fcons (Fcons (Qmm_times_mapped, MLVAL (M_Map)), result); + result = cons3 (Qmmap_addrlist_size, MLVAL (M_Addrlist_Size), result); + result = cons3 (Qmmap_hash_worked, MLVAL (M_Hash_Worked), result); + result = cons3 (Qmmap_addr_looked_up, MLVAL (M_Address_Lookup), result); + result = cons3 (Qmmap_live_pages, MLVAL (M_Live_Pages), result); + result = cons3 (Qmmap_wastage, MLVAL (M_Wastage), result); + result = cons3 (Qmmap_average_bumpval,MLVAL (M_Average_Bumpval), result); + result = cons3 (Qmmap_pages_copied, MLVAL (M_Copy_Pages), result); + result = cons3 (Qmmap_didnt_copy, MLVAL (M_Didnt_Copy), result); + result = cons3 (Qmmap_times_remapped, MLVAL (M_Remap), result); + result = cons3 (Qmmap_times_unmapped, MLVAL (M_Unmap), result); + result = cons3 (Qmmap_pages_mapped, MLVAL (M_Pages_Map), result); + result = cons3 (Qmmap_times_mapped, MLVAL (M_Map), result); return result; } @@ -1671,7 +1679,7 @@ which can be successfully mmapped, or until there are no free blocks of the given size left. - Note that this scheme, given it's first-fit strategy, is prone to + Note that this scheme, given its first-fit strategy, is prone to fragmentation of the first part of memory earmarked for this purpose. [ACP Vol I]. We can't use the workaround of using a randomized first fit because we don't want to presume too much @@ -2030,18 +2038,18 @@ syms_of_ralloc (void) { #ifdef MMAP_METERING - defsymbol (&Qmm_times_mapped, "mmap-times-mapped"); - defsymbol (&Qmm_pages_mapped, "mmap-pages-mapped"); - defsymbol (&Qmm_times_unmapped, "mmap-times-unmapped"); - defsymbol (&Qmm_times_remapped, "mmap-times-remapped"); - defsymbol (&Qmm_didnt_copy, "mmap-didnt-copy"); - defsymbol (&Qmm_pages_copied, "mmap-pages-copied"); - defsymbol (&Qmm_average_bumpval, "mmap-average-bumpval"); - defsymbol (&Qmm_wastage, "mmap-wastage"); - defsymbol (&Qmm_live_pages, "mmap-live-pages"); - defsymbol (&Qmm_addr_looked_up, "mmap-had-to-look-up-address"); - defsymbol (&Qmm_hash_worked, "mmap-hash-table-worked"); - defsymbol (&Qmm_addrlist_size, "mmap-addrlist-size"); + defsymbol (&Qmmap_times_mapped, "mmap-times-mapped"); + defsymbol (&Qmmap_pages_mapped, "mmap-pages-mapped"); + defsymbol (&Qmmap_times_unmapped, "mmap-times-unmapped"); + defsymbol (&Qmmap_times_remapped, "mmap-times-remapped"); + defsymbol (&Qmmap_didnt_copy, "mmap-didnt-copy"); + defsymbol (&Qmmap_pages_copied, "mmap-pages-copied"); + defsymbol (&Qmmap_average_bumpval, "mmap-average-bumpval"); + defsymbol (&Qmmap_wastage, "mmap-wastage"); + defsymbol (&Qmmap_live_pages, "mmap-live-pages"); + defsymbol (&Qmmap_addr_looked_up, "mmap-addr-looked-up"); + defsymbol (&Qmmap_hash_worked, "mmap-hash-worked"); + defsymbol (&Qmmap_addrlist_size, "mmap-addrlist-size"); DEFSUBR (Fmmap_allocator_status); #endif /* MMAP_METERING */ }
--- a/src/rangetab.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/rangetab.c Mon Aug 13 10:28:48 2007 +0200 @@ -66,15 +66,6 @@ #### We should be using the gap array stuff from extents.c. This is not hard but just requires moving that stuff out of that file. */ -static Lisp_Object mark_range_table (Lisp_Object, void (*) (Lisp_Object)); -static void print_range_table (Lisp_Object, Lisp_Object, int); -static int range_table_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long range_table_hash (Lisp_Object obj, int depth); -DEFINE_LRECORD_IMPLEMENTATION ("range-table", range_table, - mark_range_table, print_range_table, 0, - range_table_equal, range_table_hash, - struct Lisp_Range_Table); - static Lisp_Object mark_range_table (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -164,10 +155,13 @@ hash = HASH2 (hash, range_table_entry_hash (Dynarr_atp (rt->entries, i*size/5), depth)); - return hash; } +DEFINE_LRECORD_IMPLEMENTATION ("range-table", range_table, + mark_range_table, print_range_table, 0, + range_table_equal, range_table_hash, + struct Lisp_Range_Table); /************************************************************************/ /* Range table operations */ @@ -232,7 +226,7 @@ } DEFUN ("make-range-table", Fmake_range_table, 0, 0, 0, /* -Make a new, empty range table. +Return a new, empty range table. You can manipulate it using `put-range-table', `get-range-table', `remove-range-table', and `clear-range-table'. */ @@ -253,7 +247,7 @@ (old_table)) { struct Lisp_Range_Table *rt, *rtnew; - Lisp_Object obj = Qnil; + Lisp_Object obj; CHECK_RANGE_TABLE (old_table); rt = XRANGE_TABLE (old_table);
--- a/src/redisplay-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/redisplay-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -26,7 +26,7 @@ Chuck Thompson Lots of work done by Ben Wing for Mule - Partially rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. + Partially rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. */ #include <config.h> @@ -427,7 +427,7 @@ { struct frame *f = XFRAME (w->frame); /* struct device *d = XDEVICE (f->device);*/ - Lisp_Object window = Qnil; + Lisp_Object window; HDC hdc = FRAME_MSWINDOWS_DC (f); int clip_end; Lisp_Object bg_pmap; @@ -554,7 +554,6 @@ int cursor_start, int cursor_width, int cursor_height) { struct frame *f = XFRAME (w->frame); - struct device *d = XDEVICE (f->device); HDC hdc = FRAME_MSWINDOWS_DC (f); struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); Lisp_Object window; @@ -659,41 +658,6 @@ clip_x, clip_y, clip_width, clip_height, pwidth, pheight, pixmap_offset); } - -#if 0 - /* Draw a cursor over top of the pixmap. */ - if (cursor_width && cursor_height && (cursor_start >= xpos) - && !NILP (w->text_cursor_visible_p) - && (cursor_start < xpos + pwidth)) - { - int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); - int y = dl->ypos - dl->ascent; - struct face_cachel *cursor_cachel = - WINDOW_FACE_CACHEL (w, - get_builtin_face_cache_index - (w, Vtext_cursor_face)); - - mswindows_update_dc(hdc, Qnil, cursor_cachel->background, Qnil, - Qnil); - - if (cursor_width > xpos + pwidth - cursor_start) - cursor_width = xpos + pwidth - cursor_start; - - if (focus) - { - RECT rect={cursor_start, y + cursor_height, - cursor_start + cursor_width, y}; - FrameRect(hdc, &rect, - COLOR_INSTANCE_MSWINDOWS_BRUSH - (XCOLOR_INSTANCE(cursor_cachel->background))); - } - else - { - Rectangle (hdc, cursor_start, y, cursor_width, - cursor_height); - } - } -#endif } #ifdef HAVE_SCROLLBARS
--- a/src/redisplay-output.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/redisplay-output.c Mon Aug 13 10:28:48 2007 +0200 @@ -44,7 +44,6 @@ struct rune *drb); static void redraw_cursor_in_window (struct window *w, int run_end_begin_glyphs); -void redisplay_output_window (struct window *w); /***************************************************************************** sync_rune_structs @@ -274,7 +273,7 @@ int *cursor_height) { struct rune *rb; - Lisp_Object window = Qnil; + Lisp_Object window; int defheight, defwidth; if (Dynarr_length (db->runes) <= cursor_location) @@ -748,8 +747,6 @@ int x = w->last_point_x[CURRENT_DISP]; int y = w->last_point_y[CURRENT_DISP]; - extern int cursor_in_echo_area; - /* * Bail if cursor_in_echo_area is non-zero and we're fiddling with * the cursor in a non-active minibuffer window, since that is a @@ -928,7 +925,6 @@ struct display_line *dl; struct display_block *db; struct rune *rb; - extern int cursor_in_echo_area; int x = w->last_point_x[CURRENT_DISP]; int y = w->last_point_y[CURRENT_DISP]; @@ -980,21 +976,16 @@ void redisplay_redraw_cursor (struct frame *f, int run_end_begin_meths) { - struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f)); - extern int cursor_in_echo_area; - - if (cursor_in_echo_area) - { - if (FRAME_HAS_MINIBUF_P (f)) - { - w = XWINDOW (FRAME_MINIBUF_WINDOW (f)); - } - else - { - return; - } - } - redraw_cursor_in_window (w, run_end_begin_meths); + Lisp_Object window; + + if (!cursor_in_echo_area) + window = FRAME_SELECTED_WINDOW (f); + else if (FRAME_HAS_MINIBUF_P (f)) + window = FRAME_MINIBUF_WINDOW (f); + else + return; + + redraw_cursor_in_window (XWINDOW (window), run_end_begin_meths); } /*****************************************************************************
--- a/src/redisplay-tty.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/redisplay-tty.c Mon Aug 13 10:28:48 2007 +0200 @@ -101,8 +101,10 @@ /***************************************************************************** tty_text_width - tty's don't have fonts (that we use at least), so everything is - considered to be fixed width. In other words, we just return len. + Non-Mule tty's don't have fonts (that we use at least), so everything + is considered to be fixed width -- in other words, we return LEN. + Under Mule, however, a character can still cover more than one + column, so we use emchar_string_displayed_columns(). ****************************************************************************/ static int tty_text_width (struct frame *f, struct face_cachel *cachel, CONST Emchar *str, @@ -809,7 +811,7 @@ Turn off all set properties of the given face (revert to default face). We assume that tty_turn_on_face has been called for the given - face so that it's properties are actually active. + face so that its properties are actually active. ****************************************************************************/ static void tty_turn_off_face (struct window *w, face_index findex) @@ -855,7 +857,7 @@ static void tty_turn_on_frame_face (struct frame *f, Lisp_Object face) { - Lisp_Object frame = Qnil; + Lisp_Object frame; struct console *c = XCONSOLE (FRAME_CONSOLE (f)); XSETFRAME (frame, f); @@ -874,12 +876,12 @@ Turn off all set properties of the given face (revert to default face). We assume that tty_turn_on_face has been called for the given - face so that it's properties are actually active. + face so that its properties are actually active. ****************************************************************************/ static void tty_turn_off_frame_face (struct frame *f, Lisp_Object face) { - Lisp_Object frame = Qnil; + Lisp_Object frame; struct console *c = XCONSOLE (FRAME_CONSOLE (f)); XSETFRAME (frame, f); @@ -1284,7 +1286,7 @@ attributes_on = 0; /* - * Attempt to initialise the function_key_map to + * Attempt to initialize the function_key_map to * some kind of sensible value */
--- a/src/redisplay-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/redisplay-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -658,8 +658,6 @@ background_gc, shadow_thickness); } -void debug_print (Lisp_Object); /* kludge! */ - /***************************************************************************** x_get_gc @@ -785,8 +783,8 @@ /* General variables */ struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); - Lisp_Object device = Qnil; - Lisp_Object window = Qnil; + Lisp_Object device; + Lisp_Object window; Display *dpy = DEVICE_X_DISPLAY (d); Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); @@ -2091,12 +2089,7 @@ gc = x_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil); - { - Lisp_Object window = Qnil; - - XSETWINDOW (window, w); - default_face_font_info (window, &defascent, 0, &defheight, 0, 0); - } + default_face_font_info (window, &defascent, 0, &defheight, 0, 0); /* make sure the cursor is entirely contained between y and y+height */ cursor_height = min (defheight, height);
--- a/src/redisplay.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/redisplay.c Mon Aug 13 10:28:48 2007 +0200 @@ -40,6 +40,7 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "commands.h" @@ -63,7 +64,10 @@ #ifdef HAVE_TTY #include "console-tty.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> /* for isatty() */ #endif +#endif /* HAVE_TTY */ /* Note: We have to be careful throughout this code to properly handle and differentiate between Bufbytes and Emchars. @@ -205,26 +209,26 @@ enum prop_type type; union data - { - struct - { - Bufbyte *str; - Bytecount len; /* length of the string. */ - } p_string; - - struct - { - Emchar ch; - Bytind bi_cursor_bufpos; /* NOTE: is in Bytinds */ - unsigned int cursor_type :3; - } p_char; - - struct - { - int width; - face_index findex; - } p_blank; - } data; + { + struct + { + Bufbyte *str; + Bytecount len; /* length of the string. */ + } p_string; + + struct + { + Emchar ch; + Bytind bi_cursor_bufpos; /* NOTE: is in Bytinds */ + unsigned int cursor_type :3; + } p_char; + + struct + { + int width; + face_index findex; + } p_blank; + } data; }; typedef struct @@ -233,70 +237,30 @@ } prop_block_dynarr; -/* - * Prototypes for all functions defined in redisplay.c. - */ -struct display_block *get_display_block_from_line (struct display_line *dl, - enum display_type type); -layout_bounds calculate_display_line_boundaries (struct window *w, - int modeline); -static Bufpos generate_display_line (struct window *w, struct display_line *dl, - int bounds, Bufpos start_pos, - int start_col, prop_block_dynarr **prop, - int type); -static void generate_modeline (struct window *w, struct display_line *dl, - int type); -static int ensure_modeline_generated (struct window *w, int type); -#ifdef MODELINE_IS_SCROLLABLE static void generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, struct window *w, struct display_line *dl, struct display_block *db, face_index findex, int min_pixpos, - int max_pixpos, int type, - int modeline); + int max_pixpos, int type +#ifdef MODELINE_IS_SCROLLABLE + ,int modeline +#endif + ); static Charcount generate_fstring_runes (struct window *w, pos_data *data, Charcount pos, Charcount min_pos, - Charcount max_pos, int no_limit, + Charcount max_pos, +#ifdef MODELINE_IS_SCROLLABLE + int no_limit, +#endif Lisp_Object elt, int depth, int max_pixsize, face_index findex, int type); -#else /* MODELINE_IS_SCROLLABLE */ -static void generate_formatted_string_db (Lisp_Object format_str, - Lisp_Object result_str, - struct window *w, - struct display_line *dl, - struct display_block *db, - face_index findex, int min_pixpos, - int max_pixpos, int type); -static Charcount generate_fstring_runes (struct window *w, pos_data *data, - Charcount pos, Charcount min_pos, - Charcount max_pos, Lisp_Object elt, - int depth, int max_pixsize, - face_index findex, int type); -#endif /* not MODELINE_IS_SCROLLABLE */ -static prop_block_dynarr *add_emchar_rune (pos_data *data); -static prop_block_dynarr *add_bufbyte_string_runes (pos_data *data, - Bufbyte *c_string, - Bytecount c_length, - int no_prop); -static prop_block_dynarr *add_blank_rune (pos_data *data, struct window *w, - int char_tab_width); -static prop_block_dynarr *add_octal_runes (pos_data *data); -static prop_block_dynarr *add_control_char_runes (pos_data *data, - struct buffer *b); -static prop_block_dynarr *add_disp_table_entry_runes (pos_data *data, - Lisp_Object entry); -static prop_block_dynarr *add_propagation_runes (prop_block_dynarr **prop, - pos_data *data); static prop_block_dynarr *add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, int allow_cursor, struct glyph_cachel *cachel); -static prop_block_dynarr *add_glyph_runes (pos_data *data, - int pos_type); -/* NOTE: Bytinds not Bufpos's here. */ static Bytind create_text_block (struct window *w, struct display_line *dl, Bytind bi_start_pos, int start_col, prop_block_dynarr **prop, int type); @@ -307,40 +271,23 @@ int overlay_width); static void create_right_glyph_block (struct window *w, struct display_line *dl); -static void regenerate_window (struct window *w, Bufpos start_pos, - Bufpos point, int type); -static Bufpos regenerate_window_point_center (struct window *w, Bufpos point, - int type); -int window_half_pixpos (struct window *w); -int line_at_center (struct window *w, int type, Bufpos start, Bufpos point); -Bufpos point_at_center (struct window *w, int type, Bufpos start, - Bufpos point); -static void redisplay_window (Lisp_Object window, int skip_selected); static void redisplay_windows (Lisp_Object window, int skip_selected); -static int redisplay_frame (struct frame *f, int preemption_check); -void redisplay (void); static void decode_mode_spec (struct window *w, Emchar spec, int type); static void free_display_line (struct display_line *dl); -void free_display_structs (struct window_mirror *mir); -static int point_visible (struct window *w, Bufpos point, int type); static void update_line_start_cache (struct window *w, Bufpos from, Bufpos to, Bufpos point, int no_regen); -static Bufpos line_start_cache_start (struct window *w); -static Bufpos line_start_cache_end (struct window *w); +static int point_visible (struct window *w, Bufpos point, int type); /* This used to be 10 but 30 seems to give much better performance. */ #define INIT_MAX_PREEMPTS 30 static int max_preempts; -#define REDISPLAY_PREEMPTION_CHECK \ - do { \ - preempted = 0; \ - if (!disable_preemption && \ - ((preemption_count < max_preempts) || !NILP (Vexecuting_macro))) \ - if (!INTERACTIVE || detect_input_pending ()) { \ - preempted = 1; \ - } \ - } while (0) +#define REDISPLAY_PREEMPTION_CHECK \ +((void) \ + (preempted = \ + (!disable_preemption && \ + ((preemption_count < max_preempts) || !NILP (Vexecuting_macro)) && \ + (!INTERACTIVE || detect_input_pending ())))) /* * Redisplay global variables. @@ -530,7 +477,7 @@ Emchar *str, Charcount len) { unsigned char charsets[NUM_LEADING_BYTES]; - Lisp_Object window = Qnil; + Lisp_Object window; find_charsets_in_emchar_string (charsets, str, len); XSETWINDOW (window, w); @@ -567,7 +514,7 @@ Bytecount offset, Bytecount len) { unsigned char charsets[NUM_LEADING_BYTES]; - Lisp_Object frame = Qnil; + Lisp_Object frame; struct face_cachel cachel; if (!rtw_emchar_dynarr) @@ -631,7 +578,7 @@ /* The line doesn't have a block of the desired type so go ahead and create one and add it to the line. */ - memset (&db, 0, sizeof (struct display_block)); + xzero (db); db.type = type; db.runes = Dynarr_new (rune); Dynarr_add (dl->display_blocks, db); @@ -1902,7 +1849,7 @@ dl->used_prop_data = 0; dl->num_chars = 0; - memset (&data, 0, sizeof (data)); + xzero (data); data.ef = extent_fragment_new (w->buffer, f); /* These values are used by all of the rune addition routines. We add @@ -2671,7 +2618,7 @@ if (!STRINGP (Voverlay_arrow_string) && !GLYPHP (Voverlay_arrow_string)) return 0; - memset (&data, 0, sizeof (data)); + xzero (data); data.ef = NULL; data.d = d; XSETWINDOW (data.window, w); @@ -2730,7 +2677,7 @@ static int add_margin_runes (struct display_line *dl, struct display_block *db, int start, - int count, int glyph_type, int side, Lisp_Object window) + int count, enum glyph_layout layout, int side, Lisp_Object window) { glyph_block_dynarr *gbd = (side == LEFT_GLYPHS ? dl->left_glyphs @@ -2739,8 +2686,8 @@ int xpos = start; int reverse; - if ((glyph_type == GL_WHITESPACE && side == LEFT_GLYPHS) - || (glyph_type == GL_INSIDE_MARGIN && side == RIGHT_GLYPHS)) + if ((layout == GL_WHITESPACE && side == LEFT_GLYPHS) + || (layout == GL_INSIDE_MARGIN && side == RIGHT_GLYPHS)) { reverse = 1; elt = Dynarr_length (gbd) - 1; @@ -2762,9 +2709,9 @@ if (gb->active && ((side == LEFT_GLYPHS && - extent_begin_glyph_layout (XEXTENT (gb->extent)) == glyph_type) + extent_begin_glyph_layout (XEXTENT (gb->extent)) == layout) || (side == RIGHT_GLYPHS && - extent_end_glyph_layout (XEXTENT (gb->extent)) == glyph_type))) + extent_end_glyph_layout (XEXTENT (gb->extent)) == layout))) { struct rune rb; @@ -3580,16 +3527,13 @@ else ypos_adj = 0; -#ifdef MODELINE_IS_SCROLLABLE generate_formatted_string_db (b->modeline_format, b->generated_modeline_string, w, dl, db, - MODELINE_INDEX, min_pixpos, max_pixpos, type, - 1 /* generate a modeline */); -#else - generate_formatted_string_db (b->modeline_format, - b->generated_modeline_string, w, dl, db, - MODELINE_INDEX, min_pixpos, max_pixpos, type); + MODELINE_INDEX, min_pixpos, max_pixpos, type +#ifdef MODELINE_IS_SCROLLABLE + , 1 /* generate a modeline */ #endif /* not MODELINE_IS_SCROLLABLE */ + ); /* The modeline is at the bottom of the gutters. We have to wait to set this until we've generated teh modeline in order to account @@ -3598,13 +3542,13 @@ } /* This define is for the experimental horizontal modeline scrolling. It's not - functionnal for 20.5, but might be for 21.1 */ + functional for 21.0, but might be for 21.1 */ #ifdef MODELINE_IS_SCROLLABLE static void generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, struct window *w, struct display_line *dl, struct display_block *db, face_index findex, - int min_pixpos, int max_pixpos, int type, + int min_pixpos, int max_pixpos, int type, int modeline) { struct frame *f = XFRAME (w->frame); @@ -3613,7 +3557,7 @@ pos_data data; int c_pixpos; - memset (&data, 0, sizeof (data)); + xzero (data); data.d = d; data.db = db; data.dl = dl; @@ -3635,13 +3579,13 @@ This recursively builds up the modeline or the title/icon string. In case of a modeline, we use a negative start position to indicate the current modeline horizontal scroll. */ - generate_fstring_runes - (w, &data, + generate_fstring_runes + (w, &data, (modeline && WINDOW_HAS_MODELINE_P (w)) ? - w->modeline_hscroll : 0, (modeline && WINDOW_HAS_MODELINE_P (w)) ? - w->modeline_hscroll : 0, - 0, /* no limit */ 1, format_str, 0, max_pixpos - min_pixpos, findex, + 0, /* no limit */ 1, format_str, 0, max_pixpos - min_pixpos, findex, type); - + if (Dynarr_length (db->runes)) { struct rune *rb = @@ -3691,7 +3635,7 @@ for (elt = 0; elt < Dynarr_length (formatted_string_extent_dynarr); elt++) { - Lisp_Object extent = Qnil; + Lisp_Object extent; Lisp_Object child; XSETEXTENT (extent, Dynarr_at (formatted_string_extent_dynarr, elt)); @@ -3711,7 +3655,7 @@ } } -/* D. Verna Feb. 1998. Rewrote this function to handle the case of a +/* D. Verna Feb. 1998. Rewrote this function to handle the case of a scrolled modeline */ static Charcount add_string_to_fstring_db_runes (pos_data *data, CONST Bufbyte *str, @@ -3723,9 +3667,9 @@ CONST Bufbyte *cur_pos = str; struct display_block *db = data->db; int add_something; - + data->blank_width = space_width (XWINDOW (data->window)); - add_something = ((pos < min_pos) + add_something = ((pos < min_pos) || ((*cur_pos) && no_limit) || ((*cur_pos) && (pos < max_pos))); while (add_something) @@ -3733,7 +3677,7 @@ if ((initial_pos >= 0) && (pos == initial_pos)) while (Dynarr_length (db->runes) < pos) add_blank_rune (data, NULL, 0); - + if (pos < 0) /* just pretend we're adding something */ { if (*cur_pos) @@ -3746,7 +3690,7 @@ { CONST Bufbyte *old_cur_pos = cur_pos; int succeeded; - + data->ch = charptr_emchar (cur_pos); succeeded = (add_emchar_rune (data) != ADD_FAILED); INC_CHARPTR (cur_pos); @@ -3772,7 +3716,7 @@ pos += 1; } } - add_something = ((pos < min_pos) + add_something = ((pos < min_pos) || ((*cur_pos) && no_limit) || ((*cur_pos) && (pos < max_pos))); } @@ -3784,7 +3728,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 min_pos, Charcount max_pos, int no_limit) { /* This function has been Mule-ized. */ @@ -3793,19 +3737,19 @@ struct glyph_block gb; /* D. Verna Feb. 1998. - If pos < 0, we're building a scrolled modeline. + If pos < 0, we're building a scrolled modeline. The glyph should be hidden. So just skip it. */ if (pos < 0) return (pos + 1); - + data->blank_width = space_width (XWINDOW (data->window)); while (Dynarr_length (db->runes) < pos) add_blank_rune (data, NULL, 0); - + end = Dynarr_length (db->runes) + 1; if (!no_limit) end = min (max_pos, end); - + gb.glyph = glyph; gb.extent = Qnil; add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0); @@ -3854,23 +3798,23 @@ { /* A string. Add to the display line and check for %-constructs within it. */ - + Bufbyte *this = XSTRING_DATA (elt); - + while ((no_limit || pos < max_pos) && *this) { Bufbyte *last = this; - + while (*this && *this != '%') this++; - + if (this != last) { /* The string is just a string. */ Charcount size = bytecount_to_charcount (last, this - last) + pos; Charcount tmp_max = (no_limit ? size : min (size, max_pos)); - + pos = add_string_to_fstring_db_runes (data, last, pos, pos, tmp_max, /* limit */0); } @@ -3925,7 +3869,7 @@ while (num_to_add--) pos = add_string_to_fstring_db_runes - (data, (CONST Bufbyte *) "-", + (data, (CONST Bufbyte *) "-", pos, pos, max_pos, no_limit); } else if (*this != 0) @@ -4067,7 +4011,7 @@ /* LIMIT is to protect against circular lists. */ while (CONSP (elt) && --limit > 0 && (no_limit || pos < max_pos)) { - pos = generate_fstring_runes (w, data, pos, pos, max_pos, + pos = generate_fstring_runes (w, data, pos, pos, max_pos, no_limit, XCAR (elt), depth, max_pixsize, findex, type); @@ -4107,7 +4051,7 @@ new_findex = old_findex; data->findex = new_findex; - pos = generate_fstring_runes (w, data, pos, pos, max_pos, + pos = generate_fstring_runes (w, data, pos, pos, max_pos, no_limit, XCDR (elt), depth - 1, max_pixsize, new_findex, type); @@ -4120,7 +4064,7 @@ } else if (GLYPHP (elt)) { - pos = add_glyph_to_fstring_db_runes + pos = add_glyph_to_fstring_db_runes (data, elt, pos, pos, max_pos, no_limit); } else @@ -4153,7 +4097,7 @@ pos_data data; int c_pixpos; - memset (&data, 0, sizeof (data)); + xzero (data); data.d = d; data.db = db; data.dl = dl; @@ -4650,7 +4594,7 @@ #ifdef MODELINE_IS_SCROLLABLE /* D. Verna Feb. 1998. - Currently, only update_frame_title can make us come here. This is not + Currently, only update_frame_title can make us come here. This is not to build a modeline */ generate_formatted_string_db (format_str, result_str, w, dl, db, findex, 0, -1, type, 0 /* not a modeline */); @@ -4731,7 +4675,7 @@ else { struct display_line modeline; - memset (&modeline, 0, sizeof (struct display_line)); + xzero (modeline); Dynarr_add (dla, modeline); } } @@ -4852,8 +4796,8 @@ } else { + xzero (dl); dlp = &dl; - memset (dlp, 0, sizeof (struct display_line)); local = 1; } @@ -5907,7 +5851,7 @@ if (lrpos >= pos) { - Lisp_Object window = Qnil; + Lisp_Object window; XSETWINDOW (window, w); va_run_hook_with_args_in_buffer (XBUFFER (w->buffer), Qredisplay_end_trigger_functions, @@ -6388,8 +6332,9 @@ struct frame *f = XFRAME (w->frame); if (FRAME_TTY_P (f) && f->order_count > 1) { - str = (CONST char *) alloca (10); - sprintf (str, "-%d", f->order_count); + char * writable_str = alloca_array (char, 10); + sprintf (writable_str, "-%d", f->order_count); + str = writable_str; } } #endif /* HAVE_TTY */ @@ -7394,7 +7339,7 @@ /* Hit the bottom of the buffer. */ int adjustment = (cur_elt + new_line) - Dynarr_length (w->line_start_cache) + 1; - Lisp_Object window = Qnil; + Lisp_Object window; int defheight; XSETWINDOW (window, w); @@ -7603,6 +7548,7 @@ while (startp < old_lb || low_bound == -1) { int ic_elt; + Bufpos new_startp; regenerate_window (w, startp, point, CMOTION_DISP); update_internal_cache_list (w, CMOTION_DISP); @@ -7640,13 +7586,34 @@ } assert (ic_elt >= 0); - Dynarr_insert_many (cache, Dynarr_atp (internal_cache, 0), - ic_elt + 1, marker); - marker += (ic_elt + 1); + new_startp = Dynarr_atp (internal_cache, ic_elt)->end + 1; + + /* + * Handle invisible text properly: + * If the last line we're inserting has the same end as the + * line before which it will be added, merge the two lines. + */ + if (Dynarr_length (cache) && + Dynarr_atp (internal_cache, ic_elt)->end == + Dynarr_atp (cache, marker)->end) + { + Dynarr_atp (cache, marker)->start + = Dynarr_atp (internal_cache, ic_elt)->start; + Dynarr_atp (cache, marker)->height + = Dynarr_atp (internal_cache, ic_elt)->height; + ic_elt--; + } + + if (ic_elt >= 0) /* we still have lines to add.. */ + { + Dynarr_insert_many (cache, Dynarr_atp (internal_cache, 0), + ic_elt + 1, marker); + marker += (ic_elt + 1); + } if (startp < low_bound || low_bound == -1) low_bound = startp; - startp = Dynarr_atp (internal_cache, ic_elt)->end + 1; + startp = new_startp; if (startp > BUF_ZV (b)) { updating_line_start_cache = 0; @@ -7703,7 +7670,7 @@ { display_line_dynarr *dla = window_display_lines (w, CURRENT_DISP); int num_disp_lines, modeline; - Lisp_Object window = Qnil; + Lisp_Object window; int defheight, defwidth; XSETWINDOW (window, w); @@ -8356,7 +8323,7 @@ { struct display_line *dl = Dynarr_atp (dla, bot_elt); int adj_area = y_coord - (dl->ypos + dl->descent); - Lisp_Object lwin = Qnil; + Lisp_Object lwin; int defheight; XSETWINDOW (lwin, *w); @@ -8734,7 +8701,7 @@ formatted_string_extent_start_dynarr = Dynarr_new (Bytecount); formatted_string_extent_end_dynarr = Dynarr_new (Bytecount); internal_cache = Dynarr_new (line_start_cache); - memset (&formatted_string_display_line, 0, sizeof (struct display_line)); + xzero (formatted_string_display_line); } /* window system is nil when in -batch mode */ @@ -8832,7 +8799,7 @@ /* #### Probably temporary */ DEFVAR_INT ("redisplay-cache-adjustment", &cache_adjustment /* -(Temporary) Setting this will impact the performance of the internal +\(Temporary) Setting this will impact the performance of the internal line start cache. */ ); cache_adjustment = 2;
--- a/src/redisplay.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/redisplay.h Mon Aug 13 10:28:48 2007 +0200 @@ -394,10 +394,10 @@ DEVICE_LOOP_NO_BREAK (_devcons_, _concons_) \ { \ Lisp_Object _frmcons_; \ - struct device *_d_ = XDEVICE (XCONS (_devcons_)->car); \ + struct device *_d_ = XDEVICE (XCAR (_devcons_)); \ DEVICE_FRAME_LOOP (_frmcons_, _d_) \ { \ - struct frame *_f_ = XFRAME (XCONS (_frmcons_)->car); \ + struct frame *_f_ = XFRAME (XCAR (_frmcons_)); \ _f_->object##_changed = 1; \ _f_->modiff++; \ } \ @@ -440,11 +440,6 @@ /* redisplay structre used by various utility routines. */ extern display_line_dynarr *cmotion_display_lines; -/* nil or a symbol naming the window system - under which emacs is running - ('x is the only current possibility) */ -extern Lisp_Object Vwindow_system; - /* Nonzero means truncate lines in all windows less wide than the frame. */ extern int truncate_partial_width_windows; @@ -479,10 +474,18 @@ /* Type of display specified. Defined in emacs.c. */ extern char *display_use; +/* Nonzero means reading single-character input with prompt + so put cursor on minibuffer after the prompt. */ + +extern int cursor_in_echo_area; + +extern Lisp_Object Qbar_cursor, Qcursor_in_echo_area, Vwindow_system; + /*************************************************************************/ /* redisplay exported functions */ /*************************************************************************/ +EXFUN (Fredraw_frame, 2); int redisplay_text_width_string (struct window *w, int findex, Bufbyte *nonreloc, Lisp_Object reloc,
--- a/src/regex.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/regex.c Mon Aug 13 10:28:48 2007 +0200 @@ -186,26 +186,20 @@ static void init_syntax_once (void) { - REGISTER int c; - static int done = 0; - - if (done) - return; - - memset (re_syntax_table, 0, sizeof (re_syntax_table)); - - for (c = 'a'; c <= 'z'; c++) - re_syntax_table[c] = Sword; - - for (c = 'A'; c <= 'Z'; c++) - re_syntax_table[c] = Sword; - - for (c = '0'; c <= '9'; c++) - re_syntax_table[c] = Sword; - - re_syntax_table['_'] = Sword; - - done = 1; + static int done = 0; + + if (!done) + { + CONST char *word_syntax_chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"; + + memset (re_syntax_table, 0, sizeof (re_syntax_table)); + + while (*word_syntax_chars) + re_syntax_table[(unsigned int)(*word_syntax_chars++)] = Sword; + + done = 1; + } } #endif /* not SYNTAX_TABLE */ @@ -249,7 +243,7 @@ /* The IS*() macros can be passed any character, including an extended one. We need to make sure there are no crashes, which would occur otherwise due to out-of-bounds array references. */ -#define ISASCII(c) (((unsigned EMACS_INT) (c)) < 0x100 && ISASCII_1 (c)) +#define ISASCII(c) (((EMACS_UINT) (c)) < 0x100 && ISASCII_1 (c)) #else #define ISASCII(c) ISASCII_1 (c) #endif /* MULE */ @@ -679,7 +673,7 @@ } if (was_a_range) { - printf ("-"); + putchar ('-'); putchar (i - 1); } } @@ -700,7 +694,7 @@ if (start == NULL) { - printf ("(null)\n"); + puts ("(null)"); return; } @@ -1003,12 +997,12 @@ print_double_string (CONST char *where, CONST char *string1, int size1, CONST char *string2, int size2) { - unsigned this_char; - if (where == NULL) printf ("(null)"); else { + unsigned int this_char; + if (FIRST_STRING_P (where)) { for (this_char = where - string1; this_char < size1; this_char++) @@ -1067,31 +1061,32 @@ but why not be nice? */ static CONST char *re_error_msgid[] = - { "Success", /* REG_NOERROR */ - "No match", /* REG_NOMATCH */ - "Invalid regular expression", /* REG_BADPAT */ - "Invalid collation character", /* REG_ECOLLATE */ - "Invalid character class name", /* REG_ECTYPE */ - "Trailing backslash", /* REG_EESCAPE */ - "Invalid back reference", /* REG_ESUBREG */ - "Unmatched [ or [^", /* REG_EBRACK */ - "Unmatched ( or \\(", /* REG_EPAREN */ - "Unmatched \\{", /* REG_EBRACE */ - "Invalid content of \\{\\}", /* REG_BADBR */ - "Invalid range end", /* REG_ERANGE */ - "Memory exhausted", /* REG_ESPACE */ - "Invalid preceding regular expression", /* REG_BADRPT */ - "Premature end of regular expression", /* REG_EEND */ - "Regular expression too big", /* REG_ESIZE */ - "Unmatched ) or \\)", /* REG_ERPAREN */ +{ + "Success", /* REG_NOERROR */ + "No match", /* REG_NOMATCH */ + "Invalid regular expression", /* REG_BADPAT */ + "Invalid collation character", /* REG_ECOLLATE */ + "Invalid character class name", /* REG_ECTYPE */ + "Trailing backslash", /* REG_EESCAPE */ + "Invalid back reference", /* REG_ESUBREG */ + "Unmatched [ or [^", /* REG_EBRACK */ + "Unmatched ( or \\(", /* REG_EPAREN */ + "Unmatched \\{", /* REG_EBRACE */ + "Invalid content of \\{\\}", /* REG_BADBR */ + "Invalid range end", /* REG_ERANGE */ + "Memory exhausted", /* REG_ESPACE */ + "Invalid preceding regular expression", /* REG_BADRPT */ + "Premature end of regular expression", /* REG_EEND */ + "Regular expression too big", /* REG_ESIZE */ + "Unmatched ) or \\)", /* REG_ERPAREN */ #ifdef emacs - "Invalid syntax designator", /* REG_ESYNTAX */ + "Invalid syntax designator", /* REG_ESYNTAX */ #endif #ifdef MULE - "Ranges may not span charsets", /* REG_ERANGESPAN */ - "Invalid category designator", /* REG_ECATEGORY */ + "Ranges may not span charsets", /* REG_ERANGESPAN */ + "Invalid category designator", /* REG_ECATEGORY */ #endif - }; +}; /* Avoiding alloca during matching, to placate r_alloc. */ @@ -4062,11 +4057,11 @@ /* Written out as an if-else to avoid testing `translate' inside the loop. */ if (translate) + while (range > lim && #ifdef MULE - while (range > lim && *d < 0x80 && !fastmap[translate[*d]]) -#else - while (range > lim && !fastmap[(unsigned char)translate[*d]]) + *d < 0x80 && #endif + !fastmap[(unsigned char)translate[*d]]) { d_size = charcount_to_bytecount (d, 1); range -= d_size; @@ -5328,7 +5323,7 @@ `pop_failure_point'. */ unsigned dummy_low_reg, dummy_high_reg; unsigned char *pdummy; - CONST char *sdummy; + CONST char *sdummy = NULL; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy,
--- a/src/regex.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/regex.h Mon Aug 13 10:28:48 2007 +0200 @@ -406,38 +406,21 @@ /* Declarations for routines. */ -/* To avoid duplicating every routine declaration -- once with a - prototype (if we are ANSI), and once without (if we aren't) -- we - use the following macro to declare argument types. This - unfortunately clutters up the declarations a bit, but I think it's - worth it. */ - -#ifdef __STDC__ - -#define _RE_ARGS(args) args - -#else /* not __STDC__ */ - -#define _RE_ARGS(args) () - -#endif /* not __STDC__ */ - /* Sets the current default syntax to SYNTAX, and return the old syntax. You can also simply assign to the `re_syntax_options' variable. */ -extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); +reg_syntax_t re_set_syntax (reg_syntax_t syntax); /* Compile the regular expression PATTERN, with length LENGTH and syntax given by the global `re_syntax_options', into the buffer BUFFER. Return NULL if successful, and an error string if not. */ -extern CONST char *re_compile_pattern - _RE_ARGS ((CONST char *pattern, int length, - struct re_pattern_buffer *buffer)); +CONST char *re_compile_pattern (CONST char *pattern, int length, + struct re_pattern_buffer *buffer); /* Compile a fastmap for the compiled pattern in BUFFER; used to accelerate searches. Return 0 if successful and -2 if was an internal error. */ -extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); +int re_compile_fastmap (struct re_pattern_buffer *buffer); /* Search in the string STRING (with length LENGTH) for the pattern @@ -445,31 +428,28 @@ characters. Return the starting position of the match, -1 for no match, or -2 for an internal error. Also return register information in REGS (if REGS and BUFFER->no_sub are nonzero). */ -extern int re_search - _RE_ARGS ((struct re_pattern_buffer *buffer, CONST char *string, - int length, int start, int range, struct re_registers *regs)); +int re_search (struct re_pattern_buffer *buffer, CONST char *string, + int length, int start, int range, + struct re_registers *regs); /* Like `re_search', but search in the concatenation of STRING1 and STRING2. Also, stop searching at index START + STOP. */ -extern int re_search_2 - _RE_ARGS ((struct re_pattern_buffer *buffer, CONST char *string1, - int length1, CONST char *string2, int length2, - int start, int range, struct re_registers *regs, int stop)); +int re_search_2 (struct re_pattern_buffer *buffer, CONST char *string1, + int length1, CONST char *string2, int length2, int start, + int range, struct re_registers *regs, int stop); /* Like `re_search', but return how many characters in STRING the regexp in BUFFER matched, starting at position START. */ -extern int re_match - _RE_ARGS ((struct re_pattern_buffer *buffer, CONST char *string, - int length, int start, struct re_registers *regs)); +int re_match (struct re_pattern_buffer *buffer, CONST char *string, + int length, int start, struct re_registers *regs); /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ -extern int re_match_2 - _RE_ARGS ((struct re_pattern_buffer *buffer, CONST char *string1, - int length1, CONST char *string2, int length2, - int start, struct re_registers *regs, int stop)); +int re_match_2 (struct re_pattern_buffer *buffer, CONST char *string1, + int length1, CONST char *string2, int length2, + int start, struct re_registers *regs, int stop); /* Set REGS to hold NUM_REGS registers, storing them in STARTS and @@ -484,32 +464,22 @@ Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ -extern void re_set_registers - _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, - unsigned num_regs, regoff_t *starts, regoff_t *ends)); +void re_set_registers (struct re_pattern_buffer *buffer, + struct re_registers *regs, unsigned num_regs, + regoff_t *starts, regoff_t *ends); #ifdef _REGEX_RE_COMP /* 4.2 bsd compatibility. */ -extern char *re_comp _RE_ARGS ((CONST char *)); -extern int re_exec _RE_ARGS ((CONST char *)); +char *re_comp (CONST char *); +int re_exec (CONST char *); #endif /* POSIX compatibility. */ -extern int regcomp _RE_ARGS ((regex_t *preg, CONST char *pattern, int cflags)); -extern int regexec - _RE_ARGS ((CONST regex_t *preg, CONST char *string, size_t nmatch, - regmatch_t pmatch[], int eflags)); -extern size_t regerror - _RE_ARGS ((int errcode, CONST regex_t *preg, char *errbuf, - size_t errbuf_size)); -extern void regfree _RE_ARGS ((regex_t *preg)); +int regcomp (regex_t *preg, CONST char *pattern, int cflags); +int regexec (CONST regex_t *preg, CONST char *string, size_t nmatch, + regmatch_t pmatch[], int eflags); +size_t regerror (int errcode, CONST regex_t *preg, char *errbuf, + size_t errbuf_size); +void regfree (regex_t *preg); #endif /* not __REGEXP_LIBRARY_H__ */ - -/* -Local variables: -make-backup-files: t -version-control: t -trim-versions-without-asking: nil -End: -*/
--- a/src/s/386-ix.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/386-ix.h Mon Aug 13 10:28:48 2007 +0200 @@ -5,13 +5,3 @@ #include "usg5-3.h" #define BROKEN_TIOCGETC - -/* There are some reports that the following is needed - with some version of this system. -#undef LIBX11_SYSTEM -#define LIBX11_SYSTEM "-linet" -*/ - -/* This is said to be needed as a result of having _insque rather - than insque in -loldX. This may not always be the right thing. */ -#define WRONG_NAME_INSQUE
--- a/src/s/386bsd.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/386bsd.h Mon Aug 13 10:28:48 2007 +0200 @@ -19,6 +19,3 @@ /* For mem-limits.h. */ #define BSD4_2 - -/* This affects a declaration in xrdb.c. */ -#define DECLARE_GETPWUID_WITH_UID_T
--- a/src/s/aix3-2-5.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/aix3-2-5.h Mon Aug 13 10:28:48 2007 +0200 @@ -14,8 +14,6 @@ #define C_OPTIMIZE_SWITCH "-O" #endif -/* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct. */ -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ #define MAIL_USE_LOCKF /* XEmacs: from dkeller@VNET.IBM.COM */
--- a/src/s/aix4-1.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/aix4-1.h Mon Aug 13 10:28:48 2007 +0200 @@ -1,6 +1,6 @@ /* Synched up with: FSF 19.31. */ -#define AIX4_1 +#define AIX4_1 #include "aix4.h"
--- a/src/s/bsd386.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/bsd386.h Mon Aug 13 10:28:48 2007 +0200 @@ -10,8 +10,6 @@ #define DECLARE_GETPWUID_WITH_UID_T -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) #define A_TEXT_OFFSET(x) (sizeof (struct exec)) #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr)) @@ -27,8 +25,6 @@ #define TABDLY OXTABS #define TAB3 OXTABS -/* #define NO_TERMIO */ /* mrb */ - /* This silences a few compilation warnings. */ #ifdef emacs #undef BSD
--- a/src/s/bsd4-2.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/bsd4-2.h Mon Aug 13 10:28:48 2007 +0200 @@ -70,10 +70,6 @@ #define LDAV_SYMBOL "_avenrun" -/* Send signals to subprocesses by "typing" special chars at them. */ - -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - /* Formerly "BSD_PGRPS" */ #define SIGIO_REQUIRES_SEPARATE_PROCESS_GROUP
--- a/src/s/cxux.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/cxux.h Mon Aug 13 10:28:48 2007 +0200 @@ -70,8 +70,6 @@ #define FIRST_PTY_LETTER 'A' #define PTY_ITERATION for (c = 'A'; c <= 'P'; c++) for (i = 0; i < 16; i++) -/* #define NO_TERMIO */ /* mrb */ - /* * Define HAVE_PTYS if the system supports pty devices. */
--- a/src/s/dgux.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/dgux.h Mon Aug 13 10:28:48 2007 +0200 @@ -138,19 +138,6 @@ #define TERMINFO /* - * Send signals to subprocesses using characters. - * - */ - -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - -/* - * Prevent redundant inclusion of termio.h. - */ - -/* #define NO_TERMIO */ /* mrb */ - -/* * Use a Berkeley style sys/wait.h. * This makes WIF* macros operate on structures instead of ints. */
--- a/src/s/gnu.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/gnu.h Mon Aug 13 10:28:48 2007 +0200 @@ -17,7 +17,7 @@ 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: FSF 19.31. */ /* Get most of the stuff from bsd4.3 */ @@ -32,10 +32,6 @@ /* XXX should getloadavg be in libc? Should we have a libutil? #define HAVE_GETLOADAVG */ -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - -/* #define NO_TERMIO */ /* mrb */ - #define LIBS_DEBUG /* XXX emacs should not expect TAB3 to be defined. */
--- a/src/s/hpux9.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/hpux9.h Mon Aug 13 10:28:48 2007 +0200 @@ -42,9 +42,6 @@ */ #endif -/* neal@ctd.comsat.com */ -/* #define NO_TERMIO */ /* mrb */ - /* According to ngorelic@speclab.cr.usgs.gov, references to the X11R4 directories in these variables (inherited from hpux8.h)
--- a/src/s/irix4-0.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/irix4-0.h Mon Aug 13 10:28:48 2007 +0200 @@ -7,9 +7,6 @@ #undef NEED_SIOCTL -/* Make process_send_signal work by "typing" a signal character on the pty. */ -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - /* use K&R C */ /* XEmacs change -- use ANSI, not K&R */ #ifndef __GNUC__
--- a/src/s/irix5-0.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/irix5-0.h Mon Aug 13 10:28:48 2007 +0200 @@ -21,19 +21,6 @@ #undef SETUP_SLAVE_PTY #endif -/* thomas@mathematik.uni-bremen.de says this is needed. */ -/* Make process_send_signal work by "typing" a signal character on the pty. */ -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - -/* SGI has all the fancy wait stuff, but we can't include sys/wait.h - because it defines BIG_ENDIAN and LITTLE_ENDIAN (ugh!.) Instead - we'll just define WNOHANG right here. - (An implicit decl is good enough for wait3.) */ -/* [XEmacs: Now that we don't use BIG_ENDIAN/LITTLE_ENDIAN, it's safe - to include wait.h. Should something change here?] */ - -/* #define WNOHANG 0x1 */ - /* No need to use sprintf to get the tty name--we get that from _getpty. */ #ifdef PTY_TTY_NAME_SPRINTF #undef PTY_TTY_NAME_SPRINTF
--- a/src/s/isc2-2.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/isc2-2.h Mon Aug 13 10:28:48 2007 +0200 @@ -35,9 +35,6 @@ contrary!). */ #define MEMMOVE_MISSING -/* Send a signal to a subprocess by "typing" a signal character. */ -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - /* -lPW is only needed if not using Gcc. We used to include -lcposix here for the rename function, but some people say ISC's rename doesn't work correctly with Emacs so we use Emacs' emulation instead. */
--- a/src/s/linux.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/linux.h Mon Aug 13 10:28:48 2007 +0200 @@ -103,14 +103,14 @@ #ifndef __ELF__ #define LIB_STANDARD "-lc" /* avoid -lPW */ #else -#undef LIB_GCC -#define LIB_GCC +/*#undef LIB_GCC + #define LIB_GCC*/ #define LIB_STANDARD "-lgcc -lc -lgcc /usr/lib/crtn.o" +#define LINKER "$(CC) -nostdlib" #endif #ifdef TERM #define LIBS_SYSTEM "-lclient" - /* #define C_SWITCH_SYSTEM "-D_BSD_SOURCE -I/usr/src/term" - mrb */ #define C_SWITCH_SYSTEM "-I/usr/src/term" #else /* alane@wozzle.linet.org says that -lipc is not a separate library, @@ -121,11 +121,14 @@ #ifdef __ELF__ #define UNEXEC "unexelf.o" #define UNEXEC_USE_MAP_PRIVATE +#if 0 /* mrb - Ordinary link is simple and effective */ +/* slb - Not any more ... :-( */ #define ORDINARY_LINK #undef LIB_STANDARD #undef START_FILES #undef LIB_GCC +#endif #endif /* __ELF__ */ #ifdef LINUX_QMAGIC
--- a/src/s/netbsd.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/netbsd.h Mon Aug 13 10:28:48 2007 +0200 @@ -19,8 +19,6 @@ #undef LDAV_SYMBOL #define HAVE_GETLOADAVG -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) /* netbsd uses OXTABS instead of the expected TAB3. */ @@ -30,8 +28,6 @@ #define A_TEXT_OFFSET(x) (sizeof (struct exec)) #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr)) -/* #define NO_TERMIO */ /* mrb */ - #define LIBS_DEBUG /* -lutil is not needed for NetBSD >0.9. */ /* #define LIBS_SYSTEM -lutil */ @@ -44,7 +40,7 @@ #ifndef NO_SHARED_LIBS /* These definitions should work for either dynamic or static linking, whichever is the default for `cc -nostdlib'. */ -/* but they probably don't, and life's too short - jrg@doc.ic.ac.uk +/* but they probably don't, and life's too short - jrg@doc.ic.ac.uk ask for no shared libs if you have 0.9 */ /* mrb -- ORDINARY_LINK works just fine... */ #define LD_SWITCH_SYSTEM "-e start"
--- a/src/s/nextstep.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/nextstep.h Mon Aug 13 10:28:48 2007 +0200 @@ -120,7 +120,6 @@ #undef BSD_TERMIOS #undef HAVE_TERMIOS #undef HAVE_TERMIO -/* #define NO_TERMIO */ /* mrb */ #define TAB3 XTABS #define C_OPTIMIZE_SWITCH "-pipe" #undef HAVE_SETITIMER
--- a/src/s/sco4.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/sco4.h Mon Aug 13 10:28:48 2007 +0200 @@ -96,9 +96,6 @@ #define START_FILES "pre-crt0.o /lib/crt1.o" #define LIB_STANDARD "-lc /lib/crtn.o" -/* Send signals to subprocesses by "typing" signal chars at them. */ -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - /* Specify program for etc/fakemail to run. Define SMAIL if you are using smail, don't for MMDF. */
--- a/src/s/sco5.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/sco5.h Mon Aug 13 10:28:48 2007 +0200 @@ -107,9 +107,6 @@ #endif #define LIB_STANDARD "-lc" -/* Send signals to subprocesses by "typing" signal chars at them. */ -/* #define SIGNALS_VIA_CHARACTERS */ /* mrb */ - /* Specify program for etc/fakemail to run. Define SMAIL if you are using smail, don't for MMDF. */
--- a/src/s/sunos4-1.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/sunos4-1.h Mon Aug 13 10:28:48 2007 +0200 @@ -46,11 +46,5 @@ /* Define dlopen, dlclose, dlsym. */ #define USE_DL_STUBS -#if 0 /* mrb */ -#if !defined(HAVE_STRERROR) && defined(__SUNPRO_C) -#define HAVE_STRERROR -#endif -#endif - /* This appears to be broken on SunOS4.1.[123] */ #define BROKEN_SIGIO
--- a/src/s/umips.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/umips.h Mon Aug 13 10:28:48 2007 +0200 @@ -10,7 +10,6 @@ #define C_SWITCH_SYSTEM "-systype bsd43" #define LD_SWITCH_SYSTEM "-systype bsd43" #undef LIBS_SYSTEM -/* #define LIBS_SYSTEM "-lmld" */ /* mrb */ #define LIBS_DEBUG #define START_FILES "pre-crt0.o /lib/crt1.o" #define LIB_STANDARD "-lc /usr/lib/crtn.o" @@ -25,7 +24,6 @@ #include "usg5-2-2.h" #undef LIBS_SYSTEM -/* #define LIBS_SYSTEM "-lmld" */ /* mrb */ #define LIBS_DEBUG #define START_FILES "pre-crt0.o /usr/lib/crt1.o" #define LIB_STANDARD "-lbsd -lc /usr/lib/crtn.o"
--- a/src/s/usg5-4.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/usg5-4.h Mon Aug 13 10:28:48 2007 +0200 @@ -106,12 +106,6 @@ #undef BROKEN_TIOCGWINSZ #undef BROKEN_TIOCGETC -/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY - subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and - this is all we need. */ - -#define TIOCSIGSEND TIOCSIGNAL - /* This change means that we don't loop through allocate_pty too many times in the (rare) event of a failure. */
--- a/src/s/windowsnt.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/s/windowsnt.h Mon Aug 13 10:28:48 2007 +0200 @@ -55,9 +55,11 @@ #define NO_MATHERR -#define SIZEOF_LONG 4 +#define SIZEOF_SHORT 2 #define SIZEOF_INT 4 -#define SIZEOF_SHORT 2 +#define SIZEOF_LONG 4 +#define SIZEOF_LONG_LONG 8 +#define SIZEOF_VOID_P 4 /* NOMULTIPLEJOBS should be defined if your system's shell does not have "job control" (the ability to stop a program,
--- a/src/scrollbar-msw.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/scrollbar-msw.h Mon Aug 13 10:28:48 2007 +0200 @@ -51,9 +51,9 @@ #define SCROLLBAR_MSW_HEIGHT(i) (SCROLLBAR_MSW_DATA (i)->height) #define SCROLLBAR_MSW_SIZE(i) (SCROLLBAR_MSW_DATA (i)->size) /* -extern void mswindows_update_frame_scrollbars (struct frame *f); -extern void mswindows_set_scrollbar_pointer (struct frame *f, Lisp_Object cursor); -extern EMACS_INT mswindows_window_is_scrollbar (struct frame *f, Window win); +void mswindows_update_frame_scrollbars (struct frame *f); +void mswindows_set_scrollbar_pointer (struct frame *f, Lisp_Object cursor); +EMACS_INT mswindows_window_is_scrollbar (struct frame *f, Window win); */ void mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos);
--- a/src/scrollbar-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/scrollbar-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -187,10 +187,8 @@ update_one_scrollbar_bs (struct frame *f, Widget sb_widget) { Boolean use_backing_store; - Arg al [1]; - XtSetArg (al [0], XtNuseBackingStore, &use_backing_store); - XtGetValues (FRAME_X_TEXT_WIDGET (f), al, 1); + Xt_GET_VALUE (FRAME_X_TEXT_WIDGET (f), XtNuseBackingStore, &use_backing_store); if (use_backing_store && sb_widget) { @@ -313,11 +311,7 @@ /* mirror the value in the frame resources, unless it was already done. */ if (!in_resource_setting) - { - Arg al [1]; - XtSetArg (al [0], XtNscrollBarWidth, XINT (newval)); - XtSetValues (FRAME_X_TEXT_WIDGET (f), al, 1); - } + Xt_SET_VALUE (FRAME_X_TEXT_WIDGET (f), XtNscrollBarWidth, XINT (newval)); if (XtIsRealized (FRAME_X_CONTAINER_WIDGET (f))) { @@ -358,11 +352,7 @@ did, we wouldn't want to overwrite the resource information (which might specify a user preference). */ if (!in_resource_setting) - { - Arg al [1]; - XtSetArg (al [0], XtNscrollBarHeight, XINT (newval)); - XtSetValues (FRAME_X_TEXT_WIDGET (f), al, 1); - } + Xt_SET_VALUE (FRAME_X_TEXT_WIDGET (f), XtNscrollBarHeight, XINT (newval)); if (XtIsRealized (FRAME_X_CONTAINER_WIDGET (f))) { @@ -401,25 +391,14 @@ while (mir) { struct scrollbar_instance *vinstance = mir->scrollbar_vertical_instance; - struct scrollbar_instance *hinstance = - mir->scrollbar_horizontal_instance; - struct frame *f; - - assert (!NILP (window)); - f = XFRAME (XWINDOW (window)->frame); + struct scrollbar_instance *hinstance = mir->scrollbar_horizontal_instance; + struct window *w = XWINDOW (window); if (mir->vchild) - { - retval = x_scrollbar_loop (type, XWINDOW (window)->vchild, - mir->vchild, id, x_win); - } + retval = x_scrollbar_loop (type, w->vchild, mir->vchild, id, x_win); else if (mir->hchild) - { - retval = x_scrollbar_loop (type, XWINDOW (window)->hchild, - mir->hchild, id, x_win); - } - - if (retval != NULL) + retval = x_scrollbar_loop (type, w->hchild, mir->hchild, id, x_win); + if (retval) return retval; if (hinstance || vinstance) @@ -427,58 +406,42 @@ switch (type) { case X_FIND_SCROLLBAR_WINDOW_MIRROR: - if ((vinstance && SCROLLBAR_X_ID (vinstance) == id) - || (hinstance && SCROLLBAR_X_ID (hinstance) == id)) - { - return mir; - } + if ((vinstance && SCROLLBAR_X_ID (vinstance) == id) || + (hinstance && SCROLLBAR_X_ID (hinstance) == id)) + return mir; break; case X_UPDATE_FRAME_SCROLLBARS: if (!mir->vchild && !mir->hchild) - update_window_scrollbars (XWINDOW (window), mir, 1, 0); + update_window_scrollbars (w, mir, 1, 0); break; case X_SET_SCROLLBAR_POINTER: if (!mir->vchild && !mir->hchild) { - int loop; - - for (loop = 0; loop < 2; loop++) - { - Widget widget; + Widget widget; - if (loop) - widget = SCROLLBAR_X_WIDGET (vinstance); - else - widget = SCROLLBAR_X_WIDGET (hinstance); + widget = SCROLLBAR_X_WIDGET (hinstance); + if (widget && XtIsManaged (widget)) + update_one_widget_scrollbar_pointer (w, widget); - if (widget && XtIsManaged (widget)) - { - update_one_widget_scrollbar_pointer - (XWINDOW (window), widget); - } - } + widget = SCROLLBAR_X_WIDGET (vinstance); + if (widget && XtIsManaged (widget)) + update_one_widget_scrollbar_pointer (w, widget); } break; case X_WINDOW_IS_SCROLLBAR: if (!mir->vchild && !mir->hchild) { - int loop; - - for (loop = 0; loop < 2; loop++) - { - Widget widget; + Widget widget; - if (loop) - widget = SCROLLBAR_X_WIDGET (vinstance); - else - widget = SCROLLBAR_X_WIDGET (hinstance); + widget = SCROLLBAR_X_WIDGET (hinstance); + if (widget && XtIsManaged (widget) && + XtWindow (widget) == x_win) + return (struct window_mirror *) 1; - if (widget && XtIsManaged (widget)) - { - if (XtWindow (widget) == x_win) - return (struct window_mirror *) 1; - } - } + widget = SCROLLBAR_X_WIDGET (vinstance); + if (widget && XtIsManaged (widget) && + XtWindow (widget) == x_win) + return (struct window_mirror *) 1; } break; default: @@ -487,7 +450,7 @@ } mir = mir->next; - window = XWINDOW (window)->next; + window = w->next; } return NULL; @@ -652,14 +615,15 @@ } else { - value = (SCROLLBAR_X_POS_DATA (instance).minimum - + (((double) - (SCROLLBAR_X_VDRAG_ORIG_WINDOW_START (instance) - - SCROLLBAR_X_POS_DATA (instance).minimum) - * (data->slider_value - - SCROLLBAR_X_POS_DATA (instance).minimum)) - / (SCROLLBAR_X_VDRAG_ORIG_VALUE (instance) - - SCROLLBAR_X_POS_DATA (instance).minimum))); + value = (int) + (SCROLLBAR_X_POS_DATA (instance).minimum + + (((double) + (SCROLLBAR_X_VDRAG_ORIG_WINDOW_START (instance) + - SCROLLBAR_X_POS_DATA (instance).minimum) + * (data->slider_value - + SCROLLBAR_X_POS_DATA (instance).minimum)) + / (SCROLLBAR_X_VDRAG_ORIG_VALUE (instance) + - SCROLLBAR_X_POS_DATA (instance).minimum))); } } else @@ -676,14 +640,16 @@ } else { - value = (SCROLLBAR_X_VDRAG_ORIG_WINDOW_START (instance) - + (((double) (SCROLLBAR_X_POS_DATA (instance).maximum - - SCROLLBAR_X_VDRAG_ORIG_WINDOW_START (instance)) - * (data->slider_value - - SCROLLBAR_X_VDRAG_ORIG_VALUE (instance))) - / (SCROLLBAR_X_POS_DATA (instance).maximum - - SCROLLBAR_X_POS_DATA (instance).slider_size - - SCROLLBAR_X_VDRAG_ORIG_VALUE (instance)))); + value = (int) + (SCROLLBAR_X_VDRAG_ORIG_WINDOW_START (instance) + + (((double) + (SCROLLBAR_X_POS_DATA (instance).maximum + - SCROLLBAR_X_VDRAG_ORIG_WINDOW_START (instance)) + * (data->slider_value + - SCROLLBAR_X_VDRAG_ORIG_VALUE (instance))) + / (SCROLLBAR_X_POS_DATA (instance).maximum + - SCROLLBAR_X_POS_DATA (instance).slider_size + - SCROLLBAR_X_VDRAG_ORIG_VALUE (instance)))); } } #else @@ -778,7 +744,7 @@ static void x_scrollbar_pointer_changed_in_window (struct window *w) { - Lisp_Object window = Qnil; + Lisp_Object window; XSETWINDOW (window, w); x_scrollbar_loop (X_SET_SCROLLBAR_POINTER, window, find_window_mirror (w),
--- a/src/scrollbar-x.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/scrollbar-x.h Mon Aug 13 10:28:48 2007 +0200 @@ -67,9 +67,9 @@ (SCROLLBAR_X_DATA (i)->vdrag_orig_window_start) #endif -extern void x_update_frame_scrollbars (struct frame *f); -extern void x_set_scrollbar_pointer (struct frame *f, Lisp_Object cursor); -extern EMACS_INT x_window_is_scrollbar (struct frame *f, Window win); +void x_update_frame_scrollbars (struct frame *f); +void x_set_scrollbar_pointer (struct frame *f, Lisp_Object cursor); +EMACS_INT x_window_is_scrollbar (struct frame *f, Window win); #endif /* HAVE_X_WINDOWS and HAVE_SCROLLBARS */ #endif /* _XEMACS_SCROLLBAR_H_ */
--- a/src/scrollbar.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/scrollbar.c Mon Aug 13 10:28:48 2007 +0200 @@ -541,8 +541,7 @@ if (HAS_DEVMETH_P (d, create_scrollbar_instance)) { - Lisp_Object frame = Qnil; - + Lisp_Object frame; XSETFRAME (frame, f); call_critical_lisp_code (XDEVICE (FRAME_DEVICE (f)), Qinit_scrollbar_from_resources, @@ -555,8 +554,7 @@ { if (HAS_DEVMETH_P (d, create_scrollbar_instance)) { - Lisp_Object device = Qnil; - + Lisp_Object device; XSETDEVICE (device, d); call_critical_lisp_code (d, Qinit_scrollbar_from_resources, @@ -705,7 +703,7 @@ DEFUN ("scrollbar-page-up", Fscrollbar_page_up, 1, 1, 0, /* Function called when the user gives the "page-up" scrollbar action. -(The way this is done can vary from scrollbar to scrollbar.) One argument, +\(The way this is done can vary from scrollbar to scrollbar.) One argument, a cons containing the scrollbar's window and a value (#### document me! This value is nil for Motif/Lucid scrollbars and a number for Athena scrollbars). You can advise this function to change the scrollbar @@ -746,7 +744,7 @@ DEFUN ("scrollbar-page-down", Fscrollbar_page_down, 1, 1, 0, /* Function called when the user gives the "page-down" scrollbar action. -(The way this is done can vary from scrollbar to scrollbar.) One argument, +\(The way this is done can vary from scrollbar to scrollbar.) One argument, a cons containing the scrollbar's window and a value (#### document me! This value is nil for Motif/Lucid scrollbars and a number for Athena scrollbars). You can advise this function to change the scrollbar @@ -834,7 +832,7 @@ } DEFUN ("scrollbar-set-hscroll", Fscrollbar_set_hscroll, 2, 2, 0, /* -Sets WINDOW's hscroll position to VALUE. +Set WINDOW's hscroll position to VALUE. This ensures that VALUE is in the proper range for the horizontal scrollbar. */ (window, value))
--- a/src/scrollbar.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/scrollbar.h Mon Aug 13 10:28:48 2007 +0200 @@ -47,18 +47,18 @@ #define SCROLLBAR_INSTANCE_FRAME(inst) (inst->mirror->frame) -extern void init_frame_scrollbars (struct frame *f); -extern void init_device_scrollbars (struct device *d); -extern void init_global_scrollbars (struct device *d); -extern void free_frame_scrollbars (struct frame *f); -extern void release_window_mirror_scrollbars (struct window_mirror *mir); -extern void update_window_scrollbars (struct window *w, - struct window_mirror *mirror, - int active, int horiz_only); +void init_frame_scrollbars (struct frame *f); +void init_device_scrollbars (struct device *d); +void init_global_scrollbars (struct device *d); +void free_frame_scrollbars (struct frame *f); +void release_window_mirror_scrollbars (struct window_mirror *mir); +void update_window_scrollbars (struct window *w, + struct window_mirror *mirror, + int active, int horiz_only); #ifdef MEMORY_USAGE_STATS -extern int compute_scrollbar_instance_usage (struct device *d, - struct scrollbar_instance *inst, - struct overhead_stats *ovstats); +int compute_scrollbar_instance_usage (struct device *d, + struct scrollbar_instance *inst, + struct overhead_stats *ovstats); #endif extern Lisp_Object Vscrollbar_width, Vscrollbar_height;
--- a/src/search.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/search.c Mon Aug 13 10:28:48 2007 +0200 @@ -228,8 +228,9 @@ fixup_search_regs_for_buffer (struct buffer *buf) { int i; + int num_regs = search_regs.num_regs; - for (i = 0; i < search_regs.num_regs; i++) + for (i = 0; i < num_regs; i++) { if (search_regs.start[i] >= 0) search_regs.start[i] = bytind_to_bufpos (buf, search_regs.start[i]); @@ -243,6 +244,7 @@ fixup_search_regs_for_string (Lisp_Object string) { int i; + int num_regs = search_regs.num_regs; /* #### bytecount_to_charcount() is not that efficient. This function could be faster if it did its own conversion (using INC_CHARPTR() @@ -251,7 +253,7 @@ Think about this if this function is a time hog, which it's probably not. */ - for (i = 0; i < search_regs.num_regs; i++) + for (i = 0; i < num_regs; i++) { if (search_regs.start[i] > 0) { @@ -311,12 +313,15 @@ val = (0 <= i ? Qt : Qnil); if (NILP (val)) return Qnil; - for (i = 0; i < search_regs.num_regs; i++) - if (search_regs.start[i] >= 0) - { - search_regs.start[i] += BI_BUF_BEGV (buf); - search_regs.end[i] += BI_BUF_BEGV (buf); - } + { + int num_regs = search_regs.num_regs; + for (i = 0; i < num_regs; i++) + if (search_regs.start[i] >= 0) + { + search_regs.start[i] += BI_BUF_BEGV (buf); + search_regs.end[i] += BI_BUF_BEGV (buf); + } + } XSETBUFFER (last_thing_searched, buf); fixup_search_regs_for_buffer (buf); return val; @@ -368,7 +373,7 @@ s = 0; else { - Charcount len = string_char_length (XSTRING (string)); + Charcount len = XSTRING_CHAR_LENGTH (string); CHECK_INT (start); s = XINT (start); @@ -741,7 +746,7 @@ p = XSTRING_DATA (string); pend = p + XSTRING_LENGTH (string); - memset (fastmap, 0, sizeof (fastmap)); + xzero (fastmap); Fclear_range_table (Vskip_chars_range_table); @@ -811,7 +816,7 @@ in the comparisons below. */ if (negate) - for (i = 0; i < sizeof fastmap; i++) + for (i = 0; i < (int) (sizeof fastmap); i++) fastmap[i] ^= 1; { @@ -1128,8 +1133,9 @@ } if (val >= 0) { + int num_regs = search_regs.num_regs; j = BI_BUF_BEGV (buf); - for (i = 0; i < search_regs.num_regs; i++) + for (i = 0; i < num_regs; i++) if (search_regs.start[i] >= 0) { search_regs.start[i] += j; @@ -1164,8 +1170,9 @@ } if (val >= 0) { + int num_regs = search_regs.num_regs; j = BI_BUF_BEGV (buf); - for (i = 0; i < search_regs.num_regs; i++) + for (i = 0; i < num_regs; i++) if (search_regs.start[i] >= 0) { search_regs.start[i] += j; @@ -1360,8 +1367,8 @@ (EMACS_INT) p_limit) cursor += BM_tab[*cursor]; else - while ((unsigned EMACS_INT) cursor <= - (unsigned EMACS_INT) p_limit) + while ((EMACS_UINT) cursor <= + (EMACS_UINT) p_limit) cursor += BM_tab[*cursor]; } else @@ -1372,8 +1379,8 @@ (EMACS_INT) p_limit) cursor += BM_tab[*cursor]; else - while ((unsigned EMACS_INT) cursor >= - (unsigned EMACS_INT) p_limit) + while ((EMACS_UINT) cursor >= + (EMACS_UINT) p_limit) cursor += BM_tab[*cursor]; } /* If you are here, cursor is beyond the end of the searched region. */ @@ -1537,7 +1544,7 @@ XCHAR_TABLE (buf->mirror_syntax_table); CHECK_STRING (string); - len = string_char_length (XSTRING (string)); + len = XSTRING_CHAR_LENGTH (string); for (i = 0; i < len; i++) if (!WORD_SYNTAX_P (syntax_table, string_char (XSTRING (string), i))) @@ -1845,7 +1852,7 @@ { if (search_regs.start[0] < 0 || search_regs.start[0] > search_regs.end[0] - || search_regs.end[0] > string_char_length (XSTRING (string))) + || search_regs.end[0] > XSTRING_CHAR_LENGTH (string)) args_out_of_range (make_int (search_regs.start[0]), make_int (search_regs.end[0])); } @@ -1928,7 +1935,7 @@ /* Do case substitution into NEWTEXT if desired. */ if (NILP (literal)) { - Charcount stlen = string_char_length (XSTRING (newtext)); + Charcount stlen = XSTRING_CHAR_LENGTH (newtext); Charcount strpos; /* XEmacs change: rewrote this loop somewhat to make it cleaner. Also added \U, \E, etc. */ @@ -1994,7 +2001,7 @@ literal_end = strpos - 1; Dynarr_add (ul_pos_dynarr, (!NILP (accum) - ? string_char_length (XSTRING (accum)) + ? XSTRING_CHAR_LENGTH (accum) : 0) + (literal_end - literal_start)); Dynarr_add (ul_action_dynarr, c); } @@ -2039,7 +2046,7 @@ { int i = 0; int cur_action = 'E'; - Charcount stlen = string_char_length (XSTRING (newtext)); + Charcount stlen = XSTRING_CHAR_LENGTH (newtext); Charcount strpos; for (strpos = 0; strpos < stlen; strpos++) @@ -2093,7 +2100,7 @@ Finsert (1, &newtext); else { - Charcount stlen = string_char_length (XSTRING (newtext)); + Charcount stlen = XSTRING_CHAR_LENGTH (newtext); Charcount strpos; struct gcpro gcpro1; GCPRO1 (newtext); @@ -2304,39 +2311,39 @@ /* This function has been Mule-ized. */ REGISTER int i; REGISTER Lisp_Object marker; + int num_regs; + int length; if (running_asynch_code) save_search_regs (); - if (!CONSP (list) && !NILP (list)) - list = wrong_type_argument (Qconsp, list); + CONCHECK_LIST (list); /* Unless we find a marker with a buffer in LIST, assume that this match data came from a string. */ last_thing_searched = Qt; /* Allocate registers if they don't already exist. */ - { - int length = XINT (Flength (list)) / 2; + length = XINT (Flength (list)) / 2; + num_regs = search_regs.num_regs; - if (length > search_regs.num_regs) - { - if (search_regs.num_regs == 0) - { - search_regs.start = xnew_array (regoff_t, length); - search_regs.end = xnew_array (regoff_t, length); - } - else - { - XREALLOC_ARRAY (search_regs.start, regoff_t, length); - XREALLOC_ARRAY (search_regs.end, regoff_t, length); - } + if (length > num_regs) + { + if (search_regs.num_regs == 0) + { + search_regs.start = xnew_array (regoff_t, length); + search_regs.end = xnew_array (regoff_t, length); + } + else + { + XREALLOC_ARRAY (search_regs.start, regoff_t, length); + XREALLOC_ARRAY (search_regs.end, regoff_t, length); + } - search_regs.num_regs = length; - } - } + search_regs.num_regs = length; + } - for (i = 0; i < search_regs.num_regs; i++) + for (i = 0; i < num_regs; i++) { marker = Fcar (list); if (NILP (marker))
--- a/src/select-msw.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/select-msw.c Mon Aug 13 10:28:48 2007 +0200 @@ -23,7 +23,7 @@ /* Authorship: Written by Kevin Gallo for FSF Emacs. - Rewritten for mswindows by Jonathan Harris, December 1997 for 20.4. + Rewritten for mswindows by Jonathan Harris, December 1997 for 21.0. */
--- a/src/sheap.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/sheap.c Mon Aug 13 10:28:48 2007 +0200 @@ -22,7 +22,7 @@ #include <stdio.h> #include "lisp.h" #include <stddef.h> -#include "sheap-adjust.h" +#include <sheap-adjust.h> #define STATIC_HEAP_BASE 0x600000 #define STATIC_HEAP_SLOP 0x40000 @@ -44,7 +44,7 @@ { int size = (int) increment; void *result; - + if (!static_heap_initialized) { if (((unsigned long) static_heap_base & ~VALMASK) != 0) @@ -54,26 +54,26 @@ } static_heap_base=(char*)ALIGN_ALLOC(static_heap_buffer); static_heap_ptr=static_heap_base; - static_heap_size=STATIC_HEAP_SIZE - + static_heap_size=STATIC_HEAP_SIZE - (static_heap_base-static_heap_buffer); #ifdef __CYGWIN32__ sbrk(BLOCKSIZE); /* force space for fork to work */ #endif static_heap_initialized=1; } - + result = static_heap_ptr; /* we don't need to align - handled by gmalloc. */ - if (size < 0) + if (size < 0) { if (static_heap_ptr + size < static_heap_base) { return 0; } } - else + else { if (static_heap_ptr + size >= static_heap_base + static_heap_size) { @@ -91,7 +91,7 @@ } } static_heap_ptr += size; - + return result; }
--- a/src/signal.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/signal.c Mon Aug 13 10:28:48 2007 +0200 @@ -21,9 +21,6 @@ /* Synched up with: Not synched with FSF. Split out of keyboard.c. */ -/* Just to make sure we don't use any global vars below */ -#define DONT_DECLARE_MAC_VARS - #include <config.h> #include "lisp.h" @@ -34,6 +31,9 @@ #include "syssignal.h" #include "systime.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #include <errno.h> /* Set to 1 when a quit-check signal (either a SIGIO interrupt or @@ -309,7 +309,7 @@ #### This is a bit inefficient because there will be function call overhead each time QUIT occurs. */ - + if (!NILP (Vinhibit_quit)) { something_happened = 1; @@ -359,7 +359,7 @@ */ ()) { - return ((waiting_for_user_input_p) ? Qt : Qnil); + return waiting_for_user_input_p ? Qt : Qnil; } @@ -471,7 +471,7 @@ /* The effect of this function is to set Vquit_flag if the user pressed ^G and discard the ^G, so as to not notice the same ^G again. */ -int +int check_quit (void) { /* dont_check_for_quit is set in two circumstances: @@ -520,7 +520,7 @@ return check_quit (); } - + void init_poll_for_quit (void)
--- a/src/sound.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/sound.c Mon Aug 13 10:28:48 2007 +0200 @@ -37,6 +37,10 @@ #include "redisplay.h" #include "sysdep.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + #ifdef HAVE_NATIVE_SOUND # include <netdb.h> #endif @@ -64,7 +68,7 @@ DEFUN ("play-sound-file", Fplay_sound_file, 1, 3, "fSound file name: ", /* Play the named sound file on DEVICE's speaker at the specified volume -(0-100, default specified by the `bell-volume' variable). +\(0-100, default specified by the `bell-volume' variable). The sound file must be in the Sun/NeXT U-LAW format except under Linux where WAV files are also supported. DEVICE defaults to the selected device. @@ -275,10 +279,10 @@ goto try_it_again; } - - vol = (INT_OR_FLOATP (volume) ? XFLOATINT (volume) : bell_volume); - pit = (INT_OR_FLOATP (pitch) ? XFLOATINT (pitch) : -1); - dur = (INT_OR_FLOATP (duration) ? XFLOATINT (duration) : -1); + + vol = (INT_OR_FLOATP (volume) ? (int) XFLOATINT (volume) : bell_volume); + pit = (INT_OR_FLOATP (pitch) ? (int) XFLOATINT (pitch) : -1); + dur = (INT_OR_FLOATP (duration) ? (int) XFLOATINT (duration) : -1); /* If the sound is a string, and we're connected to Nas, do that. Else if the sound is a string, and we're on console, play it natively. @@ -291,7 +295,7 @@ Extcount soundextlen; GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); - if (nas_play_sound_data ((char*)soundext, soundextlen, vol)) + if (nas_play_sound_data ((unsigned char*)soundext, soundextlen, vol)) return Qnil; } #endif /* HAVE_NAS_SOUND */ @@ -306,7 +310,7 @@ GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */ stop_interrupts (); - play_sound_data ((char*)soundext, soundextlen, vol); + play_sound_data ((unsigned char*)soundext, soundextlen, vol); start_interrupts (); QUIT; return Qnil; @@ -318,19 +322,19 @@ } DEFUN ("device-sound-enabled-p", Fdevice_sound_enabled_p, 0, 1, 0, /* -Return T iff DEVICE is able to play sound. Defaults to selected device. +Return t if DEVICE is able to play sound. Defaults to selected device. */ (device)) { struct device *d = decode_device(device); #ifdef HAVE_NAS_SOUND - if ( DEVICE_CONNECTED_TO_NAS_P (d) ) - return (Qt); + if (DEVICE_CONNECTED_TO_NAS_P (d)) + return Qt; #endif #ifdef HAVE_NATIVE_SOUND - if ( DEVICE_ON_CONSOLE_P (d) ) - return (Qt); + if (DEVICE_ON_CONSOLE_P (d)) + return Qt; #endif return Qnil; } @@ -384,16 +388,12 @@ } DEFUN ("connected-to-nas-p", Fconnected_to_nas_p, 0, 1, 0, /* -t if connected to NAS server for sounds on DEVICE. +Return t if connected to NAS server for sounds on DEVICE. */ (device)) { #ifdef HAVE_NAS_SOUND - struct device *d = decode_device (device); - if (DEVICE_CONNECTED_TO_NAS_P (d)) - return Qt; - else - return Qnil; + return DEVICE_CONNECTED_TO_NAS_P (decode_device (device)) ? Qt : Qnil; #else return Qnil; #endif @@ -460,7 +460,7 @@ same host: on some losing systems, one is a FQDN and the other is not. Here in the wide wonderful world of Unix it's rocket science to obtain the local hostname in a portable fashion. - + And don't forget, gethostbyname() reuses the structure it returns, so we have to copy the fucker before calling it again.
--- a/src/specifier.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/specifier.c Mon Aug 13 10:28:48 2007 +0200 @@ -49,9 +49,6 @@ Lisp_Object Vuser_defined_tags; -MAC_DEFINE (struct Lisp_Specifier *, MTspecmeth_or_given) -MAC_DEFINE (struct Lisp_Specifier *, MTspecifier_data) - typedef struct specifier_type_entry specifier_type_entry; struct specifier_type_entry { @@ -81,24 +78,14 @@ static void recompute_cached_specifier_everywhere (Lisp_Object specifier); +EXFUN (Fspecifier_specs, 4); +EXFUN (Fremove_specifier, 4); + /************************************************************************/ /* Specifier object methods */ /************************************************************************/ -static Lisp_Object mark_specifier (Lisp_Object, void (*) (Lisp_Object)); -static void print_specifier (Lisp_Object, Lisp_Object, int); -static int specifier_equal (Lisp_Object, Lisp_Object, int depth); -static unsigned long specifier_hash (Lisp_Object obj, int depth); -static unsigned int sizeof_specifier (CONST void *header); -static void finalize_specifier (void *header, int for_disksave); -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier, - mark_specifier, print_specifier, - finalize_specifier, - specifier_equal, specifier_hash, - sizeof_specifier, - struct Lisp_Specifier); - /* Remove dead objects from the specified assoc list. */ static Lisp_Object @@ -299,16 +286,16 @@ Vinhibit_quit = Qt; depth++; - if (s1->methods != s2->methods || - !internal_equal (s1->global_specs, s2->global_specs, depth) || - !internal_equal (s1->device_specs, s2->device_specs, depth) || - !internal_equal (s1->frame_specs, s2->frame_specs, depth) || - !internal_equal (s1->window_specs, s2->window_specs, depth) || - !internal_equal (s1->buffer_specs, s2->buffer_specs, depth) || - !SPECMETH_OR_GIVEN (s1, equal, (o1, o2, depth - 1), 1)) - retval = 0; - else - retval = 1; + retval = + (s1->methods == s2->methods && + internal_equal (s1->global_specs, s2->global_specs, depth) && + internal_equal (s1->device_specs, s2->device_specs, depth) && + internal_equal (s1->frame_specs, s2->frame_specs, depth) && + internal_equal (s1->window_specs, s2->window_specs, depth) && + internal_equal (s1->buffer_specs, s2->buffer_specs, depth)); + + if (retval && HAS_SPECMETH_P (s1, equal)) + retval = SPECMETH (s1, equal, (o1, o2, depth - 1)); Vinhibit_quit = old_inhibit_quit; return retval; @@ -322,20 +309,27 @@ /* specifier hashing is a bit problematic because there are so many places where data can be stored. We pick what are perhaps the most likely places where interesting stuff will be. */ - return HASH5 (SPECMETH_OR_GIVEN (s, hash, (obj, depth), 0), + return HASH5 ((HAS_SPECMETH_P (s, hash) ? + SPECMETH (s, hash, (obj, depth)) : 0), (unsigned long) s->methods, internal_hash (s->global_specs, depth + 1), - internal_hash (s->frame_specs, depth + 1), + internal_hash (s->frame_specs, depth + 1), internal_hash (s->buffer_specs, depth + 1)); } -static unsigned int +static size_t sizeof_specifier (CONST void *header) { CONST struct Lisp_Specifier *p = (CONST struct Lisp_Specifier *) header; return sizeof (*p) + p->methods->extra_data_size - 1; } +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier, + mark_specifier, print_specifier, + finalize_specifier, + specifier_equal, specifier_hash, + sizeof_specifier, + struct Lisp_Specifier); /************************************************************************/ /* Creating specifiers */ @@ -361,9 +355,7 @@ static int valid_specifier_type_p (Lisp_Object type) { - if (decode_specifier_type (type, ERROR_ME_NOT)) - return 1; - return 0; + return decode_specifier_type (type, ERROR_ME_NOT) != 0; } DEFUN ("valid-specifier-type-p", Fvalid_specifier_type_p, 1, 1, 0, /* @@ -373,10 +365,7 @@ */ (specifier_type)) { - if (valid_specifier_type_p (specifier_type)) - return Qt; - else - return Qnil; + return valid_specifier_type_p (specifier_type) ? Qt : Qnil; } DEFUN ("specifier-type-list", Fspecifier_type_list, 0, 0, 0, /* @@ -402,7 +391,7 @@ static Lisp_Object make_specifier (struct specifier_methods *spec_meths) { - Lisp_Object specifier = Qnil; + Lisp_Object specifier; struct gcpro gcpro1; struct Lisp_Specifier *sp = (struct Lisp_Specifier *) alloc_lcrecord (sizeof (struct Lisp_Specifier) + @@ -428,7 +417,7 @@ } DEFUN ("make-specifier", Fmake_specifier, 1, 1, 0, /* -Create a new specifier. +Return a new specifier object of type TYPE. A specifier is an object that can be used to keep track of a property whose value can be per-buffer, per-window, per-frame, or per-device, @@ -460,7 +449,7 @@ } DEFUN ("specifierp", Fspecifierp, 1, 1, 0, /* -Return non-nil if OBJECT is a specifier. +Return t if OBJECT is a specifier. A specifier is an object that can be used to keep track of a property whose value can be per-buffer, per-window, per-frame, or per-device, @@ -469,9 +458,7 @@ */ (object)) { - if (!SPECIFIERP (object)) - return Qnil; - return Qt; + return SPECIFIERP (object) ? Qt : Qnil; } DEFUN ("specifier-type", Fspecifier_type, 1, 1, 0, /* @@ -489,59 +476,52 @@ /************************************************************************/ DEFUN ("valid-specifier-locale-p", Fvalid_specifier_locale_p, 1, 1, 0, /* -Return non-nil if LOCALE is a valid specifier locale. -Valid locales are a device, a frame, a window, a buffer, and 'global. -(nil is not valid.) +Return t if LOCALE is a valid specifier locale. +Valid locales are devices, frames, windows, buffers, and 'global. +\(nil is not valid.) */ (locale)) { /* This cannot GC. */ - if ((DEVICEP (locale) && DEVICE_LIVE_P (XDEVICE (locale))) || - (FRAMEP (locale) && FRAME_LIVE_P (XFRAME (locale))) || - (BUFFERP (locale) && BUFFER_LIVE_P (XBUFFER (locale))) || - /* dead windows are allowed because they may become live - windows again when a window configuration is restored */ - WINDOWP (locale) || - EQ (locale, Qglobal)) - return Qt; - else - return Qnil; + return ((DEVICEP (locale) && DEVICE_LIVE_P (XDEVICE (locale))) || + (FRAMEP (locale) && FRAME_LIVE_P (XFRAME (locale))) || + (BUFFERP (locale) && BUFFER_LIVE_P (XBUFFER (locale))) || + /* dead windows are allowed because they may become live + windows again when a window configuration is restored */ + WINDOWP (locale) || + EQ (locale, Qglobal)) + ? Qt : Qnil; } DEFUN ("valid-specifier-domain-p", Fvalid_specifier_domain_p, 1, 1, 0, /* -Return non-nil if DOMAIN is a valid specifier domain. +Return t if DOMAIN is a valid specifier domain. A domain is used to instance a specifier (i.e. determine the specifier's -value in that domain). Valid domains are a window, frame, or device. -(nil is not valid.) +value in that domain). Valid domains are windows, frames, and devices. +\(nil is not valid.) */ (domain)) { /* This cannot GC. */ - if ((DEVICEP (domain) && DEVICE_LIVE_P (XDEVICE (domain))) || - (FRAMEP (domain) && FRAME_LIVE_P (XFRAME (domain))) || - (WINDOWP (domain) && WINDOW_LIVE_P (XWINDOW (domain)))) - return Qt; - else - return Qnil; + return ((DEVICEP (domain) && DEVICE_LIVE_P (XDEVICE (domain))) || + (FRAMEP (domain) && FRAME_LIVE_P (XFRAME (domain))) || + (WINDOWP (domain) && WINDOW_LIVE_P (XWINDOW (domain)))) + ? Qt : Qnil; } DEFUN ("valid-specifier-locale-type-p", Fvalid_specifier_locale_type_p, 1, 1, 0, /* Given a specifier LOCALE-TYPE, return non-nil if it is valid. Valid locale types are 'global, 'device, 'frame, 'window, and 'buffer. -(Note, however, that in functions that accept either a locale or a locale +\(Note, however, that in functions that accept either a locale or a locale type, 'global is considered an individual locale.) */ (locale_type)) { /* This cannot GC. */ - if (EQ (locale_type, Qglobal) || - EQ (locale_type, Qdevice) || - EQ (locale_type, Qframe) || - EQ (locale_type, Qwindow) || - EQ (locale_type, Qbuffer)) - return Qt; - else - return Qnil; + return (EQ (locale_type, Qglobal) || + EQ (locale_type, Qdevice) || + EQ (locale_type, Qframe) || + EQ (locale_type, Qwindow) || + EQ (locale_type, Qbuffer)) ? Qt : Qnil; } static void @@ -555,7 +535,8 @@ signal_simple_error ("Invalid specifier locale or locale type", locale); } -DEFUN ("specifier-locale-type-from-locale", Fspecifier_locale_type_from_locale, 1, 1, 0, /* +DEFUN ("specifier-locale-type-from-locale", + Fspecifier_locale_type_from_locale, 1, 1, 0, /* Given a specifier LOCALE, return its type. */ (locale)) @@ -563,19 +544,15 @@ /* This cannot GC. */ if (NILP (Fvalid_specifier_locale_p (locale))) signal_simple_error ("Invalid specifier locale", locale); - if (DEVICEP (locale)) - return Qdevice; - if (FRAMEP (locale)) - return Qframe; - if (WINDOWP (locale)) - return Qwindow; - if (BUFFERP (locale)) - return Qbuffer; + if (DEVICEP (locale)) return Qdevice; + if (FRAMEP (locale)) return Qframe; + if (WINDOWP (locale)) return Qwindow; + if (BUFFERP (locale)) return Qbuffer; assert (EQ (locale, Qglobal)); return Qglobal; } -Lisp_Object +static Lisp_Object decode_locale (Lisp_Object locale) { /* This cannot GC. */ @@ -634,7 +611,7 @@ signal_simple_error ("Invalid specifier domain", domain); } -Lisp_Object +static Lisp_Object decode_domain (Lisp_Object domain) { if (NILP (domain)) @@ -654,11 +631,9 @@ */ (tag)) { - if (valid_console_type_p (tag) || - valid_device_class_p (tag) || - !NILP (assq_no_quit (tag, Vuser_defined_tags))) - return Qt; - return Qnil; + return (valid_console_type_p (tag) || + valid_device_class_p (tag) || + !NILP (assq_no_quit (tag, Vuser_defined_tags))) ? Qt : Qnil; } DEFUN ("valid-specifier-tag-set-p", Fvalid_specifier_tag_set_p, 1, 1, 0, /* @@ -671,9 +646,9 @@ A specifier tag set consists of a list of zero of more specifier tags, each of which is a symbol that is recognized by XEmacs as a tag. -(The valid device types and device classes are always tags, as are +\(The valid device types and device classes are always tags, as are any tags defined by `define-specifier-tag'.) It is called a "tag set" -(as opposed to a list) because the order of the tags or the number of +\(as opposed to a list) because the order of the tags or the number of times a particular tag occurs does not matter. Each tag has a predicate associated with it, which specifies whether @@ -821,7 +796,7 @@ DEFUN ("define-specifier-tag", Fdefine_specifier_tag, 1, 2, 0, /* Define a new specifier tag. If PREDICATE is specified, it should be a function of one argument -(a device) that specifies whether the tag matches that particular +\(a device) that specifies whether the tag matches that particular device. If PREDICATE is omitted, the tag matches all devices. You can redefine an existing user-defined specifier tag. However, @@ -893,7 +868,7 @@ setup_device_initial_specifier_tags (struct device *d) { Lisp_Object rest, rest2; - Lisp_Object device = Qnil; + Lisp_Object device; XSETDEVICE (device, d); @@ -914,7 +889,8 @@ } } -DEFUN ("device-matching-specifier-tag-list", Fdevice_matching_specifier_tag_list, 0, 1, 0, /* +DEFUN ("device-matching-specifier-tag-list", + Fdevice_matching_specifier_tag_list, 0, 1, 0, /* Return a list of all specifier tags matching DEVICE. DEVICE defaults to the selected device if omitted. */ @@ -934,7 +910,7 @@ list = Fnreverse (list); list = Fcons (DEVICE_CLASS (d), list); - list = Fcons (DEVICE_TYPE (d), list); + list = Fcons (DEVICE_TYPE (d), list); RETURN_UNGCPRO (list); } @@ -1092,21 +1068,28 @@ LIST_LOOP (rest, inst_list) { - if (!CONSP (rest) || !CONSP (XCAR (rest))) + Lisp_Object inst_pair, tag_set; + + if (!CONSP (rest)) { maybe_signal_simple_error ("Invalid instantiator list", inst_list, Qspecifier, errb); return Qnil; } - if (NILP (Fvalid_specifier_tag_set_p (XCAR (XCAR (rest))))) + if (!CONSP (inst_pair = XCAR (rest))) { - maybe_signal_simple_error ("Invalid specifier tag", - XCAR (XCAR (rest)), Qspecifier, errb); + maybe_signal_simple_error ("Invalid instantiator pair", inst_pair, + Qspecifier, errb); return Qnil; } - - if (NILP (check_valid_instantiator (XCDR (XCAR (rest)), meths, - errb))) + if (NILP (Fvalid_specifier_tag_set_p (tag_set = XCAR (inst_pair)))) + { + maybe_signal_simple_error ("Invalid specifier tag", tag_set, + Qspecifier, errb); + return Qnil; + } + + if (NILP (check_valid_instantiator (XCDR (inst_pair), meths, errb))) return Qnil; } @@ -1141,21 +1124,21 @@ LIST_LOOP (rest, spec_list) { - if (!CONSP (rest) || !CONSP (XCAR (rest))) + Lisp_Object spec, locale; + if (!CONSP (rest) || !CONSP (spec = XCAR (rest))) { maybe_signal_simple_error ("Invalid specification list", spec_list, Qspecifier, errb); return Qnil; } - if (NILP (Fvalid_specifier_locale_p (XCAR (XCAR (rest))))) + if (NILP (Fvalid_specifier_locale_p (locale = XCAR (spec)))) { - maybe_signal_simple_error ("Invalid specifier locale", - XCAR (XCAR (rest)), + maybe_signal_simple_error ("Invalid specifier locale", locale, Qspecifier, errb); return Qnil; } - if (NILP (check_valid_inst_list (XCDR (XCAR (rest)), meths, errb))) + if (NILP (check_valid_inst_list (XCDR (spec), meths, errb))) return Qnil; } @@ -1459,36 +1442,38 @@ Lisp_Object new_list, enum spec_add_meth add_meth) { - if (add_meth == SPEC_REMOVE_TAG_SET_PREPEND || - add_meth == SPEC_REMOVE_TAG_SET_APPEND) + switch (add_meth) { - Lisp_Object rest; - - LIST_LOOP (rest, new_list) - { - Lisp_Object canontag = canonicalize_tag_set (XCAR (XCAR (rest))); - struct gcpro gcpro1; - - GCPRO1 (canontag); - /* pull out all elements from the existing list with the - same tag as any tags in NEW_LIST. */ - *inst_list = remassoc_no_quit (canontag, *inst_list); - UNGCPRO; - } - if (add_meth == SPEC_REMOVE_TAG_SET_PREPEND) - return SPEC_PREPEND; - else - return SPEC_APPEND; - } - else if (add_meth == SPEC_REMOVE_LOCALE) - { + case SPEC_REMOVE_TAG_SET_APPEND: + add_meth = SPEC_APPEND; + goto remove_tag_set; + case SPEC_REMOVE_TAG_SET_PREPEND: + add_meth = SPEC_PREPEND; + remove_tag_set: + { + Lisp_Object rest; + + LIST_LOOP (rest, new_list) + { + Lisp_Object canontag = canonicalize_tag_set (XCAR (XCAR (rest))); + struct gcpro gcpro1; + + GCPRO1 (canontag); + /* pull out all elements from the existing list with the + same tag as any tags in NEW_LIST. */ + *inst_list = remassoc_no_quit (canontag, *inst_list); + UNGCPRO; + } + } + return add_meth; + case SPEC_REMOVE_LOCALE: *inst_list = Qnil; return SPEC_PREPEND; + case SPEC_APPEND: + return add_meth; + default: + return SPEC_PREPEND; } - if (add_meth == SPEC_APPEND) - return add_meth; - - return SPEC_PREPEND; } /* Given a LOCALE and INST_LIST that is going to be added to SPECIFIER, @@ -1502,6 +1487,7 @@ { /* The return value of this function must be GCPRO'd. */ Lisp_Object rest, list_to_build_up = Qnil; + struct Lisp_Specifier *sp = XSPECIFIER (specifier); struct gcpro gcpro1; GCPRO1 (list_to_build_up); @@ -1514,9 +1500,10 @@ NGCPRO2 (instantiator, sub_inst_list); /* call the will-add method; it may GC */ - sub_inst_list = SPECMETH_OR_GIVEN (XSPECIFIER (specifier), going_to_add, - (specifier, locale, tag_set, - instantiator), Qt); + sub_inst_list = HAS_SPECMETH_P (sp, going_to_add) ? + SPECMETH (sp, going_to_add, + (specifier, locale, tag_set, instantiator)) : + Qt; if (EQ (sub_inst_list, Qt)) /* no change here. */ sub_inst_list = list1 (Fcons (canonicalize_tag_set (tag_set), @@ -1551,13 +1538,11 @@ Lisp_Object inst_list, enum spec_add_meth add_meth) { struct Lisp_Specifier *sp = XSPECIFIER (specifier); - enum spec_locale_type type; - Lisp_Object *orig_inst_list; + enum spec_locale_type type = locale_type_from_locale (locale); + Lisp_Object *orig_inst_list, tem; Lisp_Object list_to_build_up = Qnil; struct gcpro gcpro1; - type = locale_type_from_locale (locale); - GCPRO1 (list_to_build_up); list_to_build_up = build_up_processed_list (specifier, locale, inst_list); /* Now handle REMOVE_LOCALE_TYPE and REMOVE_ALL. These are the @@ -1568,7 +1553,7 @@ { specifier_remove_locale_type (specifier, LOCALE_BUFFER, Qnil, 0); specifier_remove_locale_type (specifier, LOCALE_WINDOW, Qnil, 0); - specifier_remove_locale_type (specifier, LOCALE_FRAME, Qnil, 0); + specifier_remove_locale_type (specifier, LOCALE_FRAME, Qnil, 0); specifier_remove_locale_type (specifier, LOCALE_DEVICE, Qnil, 0); specifier_remove_spec (specifier, Qglobal, LOCALE_GLOBAL, Qnil, 0); } @@ -1580,16 +1565,14 @@ add_meth); if (add_meth == SPEC_PREPEND) - { - *orig_inst_list = nconc2 (list_to_build_up, *orig_inst_list); - } + tem = nconc2 (list_to_build_up, *orig_inst_list); else if (add_meth == SPEC_APPEND) - { - *orig_inst_list = nconc2 (*orig_inst_list, list_to_build_up); - } + tem = nconc2 (*orig_inst_list, list_to_build_up); else abort (); + *orig_inst_list = tem; + UNGCPRO; /* call the after-change method */ @@ -1825,11 +1808,11 @@ LIST_LOOP (rest, spec_list) { /* Placating the GCC god. */ - Lisp_Object crock1 = specifier; - Lisp_Object crock2 = XCAR (XCAR (rest)); - Lisp_Object crock3 = XCDR (XCAR (rest)); - - specifier_add_spec (crock1, crock2, crock3, add_meth); + Lisp_Object specification = XCAR (rest); + Lisp_Object locale = XCAR (specification); + Lisp_Object inst_list = XCDR (specification); + + specifier_add_spec (specifier, locale, inst_list, add_meth); } recompute_cached_specifier_everywhere (specifier); return Qnil; @@ -1909,7 +1892,7 @@ Only instantiators where TAG-SET (a list of zero or more tags) is a subset of (or possibly equal to) the instantiator's tag set are returned. -(The default value of nil is a subset of all tag sets, so in this case +\(The default value of nil is a subset of all tag sets, so in this case no instantiators will be screened out.) If EXACT-P is non-nil, however, TAG-SET must be equal to an instantiator's tag set for the instantiator to be returned. @@ -2274,7 +2257,7 @@ val = call_with_suspended_errors ((lisp_fn_t) RAW_SPECMETH (sp, instantiate), Qunbound, Qspecifier, errb, 5, specifier, - matchspec, domain, XCDR (tagged_inst), depth); + matchspec, domain, val, depth); if (!UNBOUNDP (val)) { @@ -2549,7 +2532,7 @@ Fspecifier_matching_instance_from_inst_list, 4, 5, 0, /* Attempt to convert a particular inst-list into an instance. This attempts to instantiate INST-LIST in the given DOMAIN -(as if INST-LIST existed in a specification in SPECIFIER), +\(as if INST-LIST existed in a specification in SPECIFIER), matching the specifications against MATCHSPEC. This function is analogous to `specifier-instance-from-inst-list' @@ -2616,7 +2599,7 @@ recompute_one_cached_specifier_in_window (Lisp_Object specifier, struct window *w) { - Lisp_Object window = Qnil; + Lisp_Object window; Lisp_Object newval, *location; XSETWINDOW (window, w); @@ -2642,7 +2625,7 @@ recompute_one_cached_specifier_in_frame (Lisp_Object specifier, struct frame *f) { - Lisp_Object frame = Qnil; + Lisp_Object frame; Lisp_Object newval, *location; XSETFRAME (frame, f);
--- a/src/specifier.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/specifier.h Mon Aug 13 10:28:48 2007 +0200 @@ -44,14 +44,14 @@ /* Validate method: Given an instantiator, verify that it's valid for this specifier type. If not, signal an error. - If this functions is not present, all instantiators are + If this function is not present, all instantiators are considered valid. */ void (*validate_method) (Lisp_Object instantiator); /* Validate-matchspec method: Given a matchspec, verify that it's valid for this specifier type. If not, signal an error. - If this functions is not present, *no* matchspecs are considered + If this function is not present, *no* matchspecs are considered valid. Note that this differs from validate_method(). */ void (*validate_matchspec_method) (Lisp_Object matchspec); @@ -98,7 +98,7 @@ /* This is a straight list of instantiators. */ Lisp_Object global_specs; - /* These are all assoc lists where the key is type of object the + /* These are all assoc lists where the key is the type of object the list represents (buffer, window, etc.) and the associated list is the actual list of instantiators. */ Lisp_Object device_specs; @@ -130,32 +130,33 @@ #define HAS_SPECMETH_P(sp, m) (!!RAW_SPECMETH (sp, m)) #define SPECMETH(sp, m, args) (((sp)->methods->m##_method) args) -/* Call a void-returning specifier method, if it exists */ -#define MAYBE_SPECMETH(sp, m, args) \ -do { \ - struct Lisp_Specifier *_maybe_specmeth_sp = (sp); \ - if (HAS_SPECMETH_P (_maybe_specmeth_sp, m)) \ - SPECMETH (_maybe_specmeth_sp, m, args); \ +/* Call a void-returning specifier method, if it exists. */ +#define MAYBE_SPECMETH(sp, m, args) do { \ + struct Lisp_Specifier *_maybe_specmeth_sp = (sp); \ + if (HAS_SPECMETH_P (_maybe_specmeth_sp, m)) \ + SPECMETH (_maybe_specmeth_sp, m, args); \ } while (0) -MAC_DECLARE_EXTERN (struct Lisp_Specifier *, MTspecmeth_or_given) - -/* Call a specifier method, if it exists; otherwise return - the specified value */ - -#define SPECMETH_OR_GIVEN(sp, m, args, given) \ -MAC_BEGIN \ - MAC_DECLARE (struct Lisp_Specifier *, MTspecmeth_or_given, sp) \ - HAS_SPECMETH_P (MTspecmeth_or_given, m) ? \ - SPECMETH (MTspecmeth_or_given, m, args) : (given) \ -MAC_END - /***** Defining new specifier types *****/ -#define DECLARE_SPECIFIER_TYPE(type) \ +#ifdef ERROR_CHECK_TYPECHECK +#define DECLARE_SPECIFIER_TYPE(type) \ +extern struct specifier_methods * type##_specifier_methods; \ +INLINE struct type##_specifier * \ +error_check_##type##_specifier_data (struct Lisp_Specifier *sp); \ +INLINE struct type##_specifier * \ +error_check_##type##_specifier_data (struct Lisp_Specifier *sp) \ +{ \ + assert (SPECIFIER_TYPE_P (sp, type)); \ + return (struct type##_specifier *) sp->data; \ +} \ +DECLARE_NOTHING +#else +#define DECLARE_SPECIFIER_TYPE(type) \ extern struct specifier_methods * type##_specifier_methods +#endif /* ERROR_CHECK_TYPECHECK */ -#define DEFINE_SPECIFIER_TYPE(type) \ +#define DEFINE_SPECIFIER_TYPE(type) \ struct specifier_methods * type##_specifier_methods #define INITIALIZE_SPECIFIER_TYPE(type, obj_name, pred_sym) do { \ @@ -163,36 +164,30 @@ type##_specifier_methods->name = obj_name; \ defsymbol (&type##_specifier_methods->predicate_symbol, pred_sym); \ add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \ -} while (0) \ +} while (0) #define INITIALIZE_SPECIFIER_TYPE_WITH_DATA(type, obj_name, pred_sym) \ - do { \ - INITIALIZE_SPECIFIER_TYPE (type, obj_name, pred_sym); \ - type##_specifier_methods->extra_data_size = \ - sizeof (struct type##_specifier); \ - } while (0) +do { \ + INITIALIZE_SPECIFIER_TYPE (type, obj_name, pred_sym); \ + type##_specifier_methods->extra_data_size = \ + sizeof (struct type##_specifier); \ +} while (0) -/* Declare that specifier-type TYPE has method M; used in +/* Declare that specifier-type TYPE has method METH; used in initialization routines */ -#define SPECIFIER_HAS_METHOD(type, m) \ - (type##_specifier_methods->m##_method = type##_##m) +#define SPECIFIER_HAS_METHOD(type, meth) \ + (type##_specifier_methods->meth##_method = type##_##meth) /***** Macros for accessing specifier types *****/ -#define SPECIFIER_TYPE_P(sp, type) \ +#define SPECIFIER_TYPE_P(sp, type) \ ((sp)->methods == type##_specifier_methods) #ifdef ERROR_CHECK_TYPECHECK -MAC_DECLARE_EXTERN (struct Lisp_Specifier *, MTspecifier_data) -# define SPECIFIER_TYPE_DATA(sp, type) \ -MAC_BEGIN \ - MAC_DECLARE (struct Lisp_Specifier *, MTspecifier_data, sp) \ - assert (SPECIFIER_TYPE_P (MTspecifier_data, type)) \ - MAC_SEP \ - (struct type##_specifier *) MTspecifier_data->data \ -MAC_END +# define SPECIFIER_TYPE_DATA(sp, type) \ + error_check_##type##_specifier_data (sp) #else -# define SPECIFIER_TYPE_DATA(sp, type) \ +# define SPECIFIER_TYPE_DATA(sp, type) \ ((struct type##_specifier *) (sp)->data) #endif @@ -202,22 +197,18 @@ #define XSETSPECIFIER_TYPE(x, p, type) XSETSPECIFIER (x, p) #define SPECIFIER_TYPEP(x, type) \ (SPECIFIERP (x) && SPECIFIER_TYPE_P (XSPECIFIER (x), type)) -#define CHECK_SPECIFIER_TYPE(x, type) \ - do { \ - CHECK_SPECIFIER (x); \ - if (!(SPECIFIERP (x) && SPECIFIER_TYPE_P (XSPECIFIER (x), \ - type))) \ - dead_wrong_type_argument \ - (type##_specifier_methods->predicate_symbol, x); \ - } while (0) -#define CONCHECK_SPECIFIER_TYPE(x, type) \ - do { \ - CONCHECK_SPECIFIER (x); \ - if (!(SPECIFIERP (x) && SPECIFIER_TYPE_P (XSPECIFIER (x), \ - type))) \ - x = wrong_type_argument \ - (type##_specifier_methods->predicate_symbol, x); \ - } while (0) +#define CHECK_SPECIFIER_TYPE(x, type) do { \ + CHECK_SPECIFIER (x); \ + if (!SPECIFIER_TYPE_P (XSPECIFIER (x), type)) \ + dead_wrong_type_argument \ + (type##_specifier_methods->predicate_symbol, x); \ +} while (0) +#define CONCHECK_SPECIFIER_TYPE(x, type) do { \ + CONCHECK_SPECIFIER (x); \ + if (!(SPECIFIER_TYPEP (x, type))) \ + x = wrong_type_argument \ + (type##_specifier_methods->predicate_symbol, x); \ +} while (0) /***** Miscellaneous structures *****/ @@ -251,32 +242,38 @@ Lisp_Object oldval); }; -extern Lisp_Object decode_locale (Lisp_Object locale); -extern Lisp_Object decode_locale_list (Lisp_Object locale); -extern Lisp_Object decode_domain (Lisp_Object domain); +EXFUN (Fcopy_specifier, 6); +EXFUN (Fmake_specifier, 1); +EXFUN (Fset_specifier_dirty_flag, 1); +EXFUN (Fspecifier_instance, 4); +EXFUN (Fvalid_specifier_locale_p, 1); + +extern Lisp_Object Qfallback, Qnatnum; + +Lisp_Object decode_locale_list (Lisp_Object locale); extern enum spec_add_meth decode_how_to_add_specification (Lisp_Object how_to_add); -extern Lisp_Object decode_specifier_tag_set (Lisp_Object tag_set); +Lisp_Object decode_specifier_tag_set (Lisp_Object tag_set); -extern void add_entry_to_specifier_type_list (Lisp_Object symbol, - struct specifier_methods *meths); -extern void set_specifier_caching (Lisp_Object specifier, - int struct_window_offset, - void (*value_changed_in_window) - (Lisp_Object specifier, struct window *w, - Lisp_Object oldval), - int struct_frame_offset, - void (*value_changed_in_frame) - (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval)); -extern void set_specifier_fallback (Lisp_Object specifier, - Lisp_Object fallback); -extern void recompute_all_cached_specifiers_in_window (struct window *w); -extern void recompute_all_cached_specifiers_in_frame (struct frame *f); +void add_entry_to_specifier_type_list (Lisp_Object symbol, + struct specifier_methods *meths); +void set_specifier_caching (Lisp_Object specifier, + int struct_window_offset, + void (*value_changed_in_window) + (Lisp_Object specifier, struct window *w, + Lisp_Object oldval), + int struct_frame_offset, + void (*value_changed_in_frame) + (Lisp_Object specifier, struct frame *f, + Lisp_Object oldval)); +void set_specifier_fallback (Lisp_Object specifier, + Lisp_Object fallback); +void recompute_all_cached_specifiers_in_window (struct window *w); +void recompute_all_cached_specifiers_in_frame (struct frame *f); -extern void cleanup_specifiers (void); -extern void prune_specifiers (int (*obj_marked_p) (Lisp_Object)); -extern void setup_device_initial_specifier_tags (struct device *d); +void cleanup_specifiers (void); +void prune_specifiers (int (*obj_marked_p) (Lisp_Object)); +void setup_device_initial_specifier_tags (struct device *d); void kill_specifier_buffer_locals (Lisp_Object buffer); DECLARE_SPECIFIER_TYPE (generic);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/src-headers Mon Aug 13 10:28:48 2007 +0200 @@ -0,0 +1,236 @@ +: #-*- Perl -*- +# Copyright (C) 1998 Free Software Foundation, Inc. + +# 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. + +# Author: Martin Buchholz +eval 'exec perl -w -S $0 ${1+"$@"}' + if 0; + +use strict; +my ($myName, $srcdir); + +($myName = $0) =~ s@.*/@@; my $usage =" +Usage: $myName + +Generates header file fragments from the Emacs sources. +"; + +die $usage if @ARGV; + +($srcdir = $0) =~ s@[^/]+$@@; +chdir $srcdir or die "$srcdir: $!"; + +# Find include dependencies +my (%exists, %uses); +opendir SRCDIR, "." or die "$srcdir: $!"; +for (grep (/\.[ch]$/, readdir (SRCDIR))) { $exists{$_} = 1; } +closedir SRCDIR; +{ + my %generated_header; + for (qw (config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h)) { + $generated_header{$_} = 1; + } + + for my $file (keys %exists) { + open (FILE, $file) or die "$file: $!"; + undef $/; $_ = <FILE>; + RemoveComments ($_); + s/[ \t]+//g; + for (/^\#include([^\n]+)/gmo) { + if (m@^\"([A-Za-z0-9_-]+\.h)\"@) { + $uses{$file}{$1} = 1 if exists $exists{$1}; + } elsif (m@<([A-Za-z0-9_-]+\.h)>@) { + $uses{$file}{$1} = 1 if exists $generated_header{$1}; + } elsif (m@\"../lwlib/([A-Za-z0-9_-]+\.h)\"@) { + $uses{$file}{"\$(LWLIB_SRCDIR)/lwlib.h"} = 1; + } + } + } + + # Make transitive closure of %uses + while (1) { + my $changedP = 0; + for my $x (keys %uses) { + for my $y (keys %{$uses{$x}}) { + for my $z (keys %{$uses{$y}}) { + if (! exists $uses{$x}{$z}) { + $uses{$x}{$z} = 1; + $changedP = 1; + } + } + } + } + last if !$changedP; + } +} # End of finding include dependencies + +my (%used, %maxargs); +my $minargs = '(?:[0-8])'; +my $maxargs = '(?:[0-8]|MANY|UNEVALLED)'; +my $doc = "(?:0|STR)"; +my $fun = '(?:\\bF[a-z0-9_]+X?\\b)'; +my $defun = "^DEFUN\\s*\\(\\s+STR\\s+($fun)\\s+$minargs\\s+($maxargs)\\s+$doc\\s+\\("; +my $var = '(?:\\b(?:Q[KS]?[a-z0-9_]+D?|V(?:[a-z0-9_]+)|Q_TT[A-Z]+)\\b)'; +my $pat = "(?:$var|$fun)"; +my %automagic; +my (%decl_file, %defn_file); + +for my $file (keys %exists) { + open (FILE, $file) or die "$file: $!"; + undef $/; $_ = <FILE>; + RemoveComments($_); + RemoveStrings ($_); + s/,/ /gmo; + s/^\s*EXFUN[^\n]+//gmo; + + # Now search for DECLARE_LRECORD to find types for predicates + for my $sym (/^DECLARE_LRECORD\s*\(\s*([a-z_]+)\s+struct /gmo) { + $automagic{"Q${sym}p"} = 1; + } + + if ($file =~ /\.c$/) { + my @match = (/$defun/gmo); + while (my $fun = shift @match) { + $defn_file{$fun} = $file; + $maxargs{$fun} = shift @match; + } + + # Now do Lisp_Object variables + for my $defs (/^\s*Lisp_Object\s+((?:$var\s*)+)\s*;/gmo) { + for my $var (split (' ',$defs)) { + $defn_file{$var} = $file; + } + } + } + + # Remove declarations of Lisp_Objects + s/^extern\s+Lisp_Object\s+(?:$var\s*)+\s*;//gmo; + + # Remove declarations of functions + s/^Lisp_Object $fun//; + + # Find all uses of symbols + for (/($pat)/gmo) { $used{$_}{$file} = 1; } +} + +my %candidates; +for my $file (keys %exists) { + @{$candidates{$file}} = (); + my $header1 = $file; $header1 =~ s/\.c$/.h/; + my $header2 = $header1; $header2 =~ s/-\w+\././; + push @{$candidates{$file}}, $header1 if exists $exists{$header1}; + push @{$candidates{$file}}, $header2 if exists $exists{$header2} && + $header1 ne $header2; +} + +SYM: for my $sym (keys %used) { + next SYM unless my $defn_file = $defn_file{$sym}; + my @users = keys %{$used{$sym}}; + if (@users == 1) { + die "$sym\n" unless $defn_file eq $users[0]; + next SYM; + } + for my $candidate (@{$candidates{$defn_file}}) { + if (!grep (!exists $uses{$_}{$candidate}, @users)) { + $decl_file{$sym} = $candidate; + next SYM; + } + } + $decl_file{$sym} = 'lisp.h'; +} + +# Print global Lisp_Objects +{ + my $line; + sub flushvars { + if (defined $line) { + print "extern Lisp_Object $line;\n"; + undef $line; + } + } + + sub printvar { + my $var = shift; + if (!defined $line) { $line = $var; return; } + if ($var =~ /^Vcharset_/) { + flushvars (); + $line = $var; + flushvars (); + return; + } + if (length "$line, $var" > 59) { + flushvars (); $line = $var; return; + } + $line = "$line, $var"; + } + END { flushvars (); } +} + +delete @decl_file{ keys %automagic, qw(Qzero Qnull_pointer)}; + +# Print Lisp_Object var declarations +for my $file (keys %exists) { + + # Print EXFUNs + if (my @funs = grep ($decl_file{$_} eq $file && exists $maxargs{$_}, + keys %decl_file)) { + print "\n\n$file:\n\n"; + for $fun (sort @funs) { + print "EXFUN ($fun, $maxargs{$fun});\n"; + } + print "\n"; + } + + if (my @vars = grep ($decl_file{$_} eq $file && /^[QV]/, keys %decl_file)) { + print "\n\n$file:\n\n"; + for $var (sort @vars) { + printvar ($var); + } + flushvars (); + print "\n\n"; + } +} + +#for my $var (sort grep (keys %{$used{$_}} > 1 , keys %defn_file)) { +# printvar ($var); +#} + +sub RemoveComments { + $_[0] =~ + s{ ( + [^\"\'/]+ | + (?:\"[^\"\\]*(?:\\.[^\"\\]*)*\" [^\"\'/]*)+ | + (?:\'[^\'\\]*(?:\\.[^\'\\]*)*\' [^\"\'/]*)+ + ) + | / (?: + \*[^*]*\*+(?:[^/*][^*]*\*+)*/ + | + /[^\n]* + ) + }{defined $1 ? $1 : ""}gsxeo; +} + +sub RemoveStrings { + $_[0] =~ + s{ ( + (?:\"[^\"\\]*(?:\\.[^\"\\]*)*\") | + (?:\'[^\'\\]*(?:\\.[^\'\\]*)*\') + ) + }{ STR }gxo; +}
--- a/src/strftime.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/strftime.c Mon Aug 13 10:28:48 2007 +0200 @@ -94,7 +94,7 @@ time_t mktime (); #endif -#if defined(WINDOWSNT) +#if defined(WINDOWSNT) || defined(__CYGWIN32__) #include <time.h> #else #if defined(HAVE_TZNAME)
--- a/src/sunplay.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/sunplay.c Mon Aug 13 10:28:48 2007 +0200 @@ -35,23 +35,17 @@ /* libaudio.h includes a header which defines CONST. We temporarily undefine it in order to eliminate a compiler warning. Yes, this is - a hack. */ + a gross hack. */ #undef CONST #include <multimedia/libaudio.h> #include <multimedia/audio_device.h> - #undef CONST -#ifdef CONST_IS_LOSING -# define CONST -#else -# define CONST const -#endif /* CONST */ +#define CONST const #ifdef emacs # include <config.h> # include "lisp.h" # include "sysdep.h" -# include "emacsfns.h" # include <errno.h> #include "syssignal.h" # define perror(string) \
--- a/src/symbols.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/symbols.c Mon Aug 13 10:28:48 2007 +0200 @@ -90,12 +90,6 @@ #ifdef LRECORD_SYMBOL -static Lisp_Object mark_symbol (Lisp_Object, void (*) (Lisp_Object)); -extern void print_symbol (Lisp_Object, Lisp_Object, int); -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("symbol", symbol, - mark_symbol, print_symbol, 0, 0, 0, - struct Lisp_Symbol); - static Lisp_Object mark_symbol (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -120,6 +114,9 @@ } } +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("symbol", symbol, + mark_symbol, print_symbol, 0, 0, 0, + struct Lisp_Symbol); #endif /* LRECORD_SYMBOL */ @@ -366,17 +363,15 @@ int hash_string (CONST Bufbyte *ptr, Bytecount len) { - CONST Bufbyte *p = ptr; - int hash = 0, g; - Bytecount count = len; - - while (count-- > 0) + int hash = 0; + + while (len-- > 0) { - hash = (hash << 4) + *p++; - if ((g = (hash & 0xf0000000))) { - hash = hash ^ (g >> 24); - hash = hash ^ g; - } + int g; + hash = (hash << 4) + *ptr++; + g = hash & 0xf0000000; + if (g) + hash = (hash ^ (g >> 24)) ^ g; } return hash & 07777777777; } @@ -388,12 +383,11 @@ int (*fn) (Lisp_Object, void *), void *arg) { REGISTER int i; - Lisp_Object tail; CHECK_VECTOR (obarray); for (i = XVECTOR_LENGTH (obarray) - 1; i >= 0; i--) { - tail = XVECTOR_DATA (obarray)[i]; + Lisp_Object tail = XVECTOR_DATA (obarray)[i]; if (SYMBOLP (tail)) while (1) { @@ -434,7 +428,8 @@ /* Apropos */ /**********************************************************************/ -struct appropos_mapper_closure { +struct appropos_mapper_closure +{ Lisp_Object regexp; Lisp_Object predicate; Lisp_Object accumulation; @@ -444,17 +439,15 @@ apropos_mapper (Lisp_Object symbol, void *arg) { struct appropos_mapper_closure *closure = - (struct appropos_mapper_closure *)arg; - Lisp_Object acceptp = Qt; + (struct appropos_mapper_closure *) arg; Bytecount match = fast_lisp_string_match (closure->regexp, Fsymbol_name (symbol)); - if (match < 0) - acceptp = Qnil; - else if (!NILP (closure->predicate)) - acceptp = call1 (closure->predicate, symbol); - - if (!NILP (acceptp)) + + if (match >= 0 && + (NILP (closure->predicate) || + !NILP (call1 (closure->predicate, symbol)))) closure->accumulation = Fcons (symbol, closure->accumulation); + return 0; } @@ -489,7 +482,7 @@ int set_it_p); DEFUN ("boundp", Fboundp, 1, 1, 0, /* -T if SYMBOL's value is not void. +Return t if SYMBOL's value is not void. */ (sym)) { @@ -498,7 +491,7 @@ } DEFUN ("globally-boundp", Fglobally_boundp, 1, 1, 0, /* -T if SYMBOL has a global (non-bound) value. +Return t if SYMBOL has a global (non-bound) value. This is for the byte-compiler; you really shouldn't be using this. */ (sym)) @@ -508,12 +501,12 @@ } DEFUN ("fboundp", Ffboundp, 1, 1, 0, /* -T if SYMBOL's function definition is not void. +Return t if SYMBOL's function definition is not void. */ (sym)) { CHECK_SYMBOL (sym); - return (UNBOUNDP (XSYMBOL (sym)->function)) ? Qnil : Qt; + return UNBOUNDP (XSYMBOL (sym)->function) ? Qnil : Qt; } /* Return non-zero if SYM's value or function (the current contents of @@ -526,19 +519,25 @@ type and make nil, t, and all keywords have that same magic constant_symbol value. This test is awfully specific about what is constant and what isn't. --Stig */ - return - NILP (sym) || - EQ (sym, Qt) || - (SYMBOL_VALUE_MAGIC_P (val) && - (XSYMBOL_VALUE_MAGIC_TYPE (val) == SYMVAL_CONST_OBJECT_FORWARD || - XSYMBOL_VALUE_MAGIC_TYPE (val) == SYMVAL_CONST_SPECIFIER_FORWARD || - XSYMBOL_VALUE_MAGIC_TYPE (val) == SYMVAL_CONST_FIXNUM_FORWARD || - XSYMBOL_VALUE_MAGIC_TYPE (val) == SYMVAL_CONST_BOOLEAN_FORWARD || - XSYMBOL_VALUE_MAGIC_TYPE (val) == SYMVAL_CONST_CURRENT_BUFFER_FORWARD || - XSYMBOL_VALUE_MAGIC_TYPE (val) == SYMVAL_CONST_SELECTED_CONSOLE_FORWARD)) - /* We don't return true for keywords here because they are handled + if (EQ (sym, Qnil) || + EQ (sym, Qt)) + return 1; + + if (SYMBOL_VALUE_MAGIC_P (val)) + switch (XSYMBOL_VALUE_MAGIC_TYPE (val)) + { + case SYMVAL_CONST_OBJECT_FORWARD: + case SYMVAL_CONST_SPECIFIER_FORWARD: + case SYMVAL_CONST_FIXNUM_FORWARD: + case SYMVAL_CONST_BOOLEAN_FORWARD: + case SYMVAL_CONST_CURRENT_BUFFER_FORWARD: + case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD: + return 1; + } + + /* We don't return true for keywords here because they are handled specially by reject_constant_symbols(). */ - ; + return 0; } /* We are setting SYM's value slot (or function slot, if FUNCTION_P is @@ -578,23 +577,25 @@ { Lisp_Object val = fetch_value_maybe_past_magic (sym, follow_past_lisp_magic); - if (symbol_is_constant (sym, val) || - (SYMBOL_VALUE_MAGIC_P (val) && - XSYMBOL_VALUE_MAGIC_TYPE (val) == - SYMVAL_DEFAULT_BUFFER_FORWARD) || - (SYMBOL_VALUE_MAGIC_P (val) && - XSYMBOL_VALUE_MAGIC_TYPE (val) == - SYMVAL_DEFAULT_CONSOLE_FORWARD) || - /* #### It's theoretically possible for it to be reasonable - to have both console-local and buffer-local variables, - but I don't want to consider that right now. */ - (SYMBOL_VALUE_MAGIC_P (val) && - XSYMBOL_VALUE_MAGIC_TYPE (val) == - SYMVAL_SELECTED_CONSOLE_FORWARD) - ) - signal_error (Qerror, - list2 (build_string ("Symbol may not be buffer-local"), - sym)); + if (symbol_is_constant (sym, val)) + goto not_ok; + if (SYMBOL_VALUE_MAGIC_P (val)) + switch (XSYMBOL_VALUE_MAGIC_TYPE (val)) + { + case SYMVAL_DEFAULT_BUFFER_FORWARD: + case SYMVAL_DEFAULT_CONSOLE_FORWARD: + /* #### It's theoretically possible for it to be reasonable + to have both console-local and buffer-local variables, + but I don't want to consider that right now. */ + case SYMVAL_SELECTED_CONSOLE_FORWARD: + goto not_ok; + } + + return; + + not_ok: + signal_error (Qerror, + list2 (build_string ("Symbol may not be buffer-local"), sym)); } DEFUN ("makunbound", Fmakunbound, 1, 1, 0, /* @@ -618,7 +619,7 @@ } DEFUN ("symbol-function", Fsymbol_function, 1, 1, 0, /* -Return SYMBOL's function definition. Error if that is void. +Return SYMBOL's function definition. Error if that is void. */ (symbol)) { @@ -891,40 +892,6 @@ symbol to operate on. */ -static Lisp_Object mark_symbol_value_buffer_local (Lisp_Object, - void (*) (Lisp_Object)); -static Lisp_Object mark_symbol_value_lisp_magic (Lisp_Object, - void (*) (Lisp_Object)); -static Lisp_Object mark_symbol_value_varalias (Lisp_Object, - void (*) (Lisp_Object)); - -DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-forward", - symbol_value_forward, - this_one_is_unmarkable, - print_symbol_value_magic, 0, 0, 0, - struct symbol_value_forward); - -DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-buffer-local", - symbol_value_buffer_local, - mark_symbol_value_buffer_local, - print_symbol_value_magic, - 0, 0, 0, - struct symbol_value_buffer_local); - -DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-lisp-magic", - symbol_value_lisp_magic, - mark_symbol_value_lisp_magic, - print_symbol_value_magic, - 0, 0, 0, - struct symbol_value_lisp_magic); - -DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-varalias", - symbol_value_varalias, - mark_symbol_value_varalias, - print_symbol_value_magic, - 0, 0, 0, - struct symbol_value_varalias); - static Lisp_Object mark_symbol_value_buffer_local (Lisp_Object obj, void (*markobj) (Lisp_Object)) @@ -978,11 +945,37 @@ Lisp_Object printcharfun, int escapeflag) { char buf[200]; - sprintf (buf, "#<INTERNAL EMACS BUG (symfwd %d) 0x%p>", - XSYMBOL_VALUE_MAGIC_TYPE (obj), (void *) XPNTR (obj)); + sprintf (buf, "#<INTERNAL EMACS BUG (%s type %d) 0x%p>", + XRECORD_LHEADER_IMPLEMENTATION (obj)->name, + XSYMBOL_VALUE_MAGIC_TYPE (obj), + (void *) XPNTR (obj)); write_c_string (buf, printcharfun); } +DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-forward", + symbol_value_forward, + this_one_is_unmarkable, + print_symbol_value_magic, 0, 0, 0, + struct symbol_value_forward); + +DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-buffer-local", + symbol_value_buffer_local, + mark_symbol_value_buffer_local, + print_symbol_value_magic, 0, 0, 0, + struct symbol_value_buffer_local); + +DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-lisp-magic", + symbol_value_lisp_magic, + mark_symbol_value_lisp_magic, + print_symbol_value_magic, 0, 0, 0, + struct symbol_value_lisp_magic); + +DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-varalias", + symbol_value_varalias, + mark_symbol_value_varalias, + print_symbol_value_magic, 0, 0, 0, + struct symbol_value_varalias); + /* Getting and setting values of symbols */ @@ -1867,7 +1860,7 @@ } DEFUN ("default-boundp", Fdefault_boundp, 1, 1, 0, /* -Return T if SYMBOL has a non-void default value. +Return t if SYMBOL has a non-void default value. This is the value that is seen in buffers that do not have their own values for this variable. */ @@ -2058,7 +2051,7 @@ struct symbol_value_buffer_local *bfwd = alloc_lcrecord_type (struct symbol_value_buffer_local, lrecord_symbol_value_buffer_local); - Lisp_Object foo = Qnil; + Lisp_Object foo; bfwd->magic.type = SYMVAL_BUFFER_LOCAL; bfwd->default_value = find_symbol_value (variable); @@ -2083,11 +2076,12 @@ if (UNBOUNDP (valcontents)) Fset (variable, Qnil); #endif - return (variable); + return variable; } } -DEFUN ("make-local-variable", Fmake_local_variable, 1, 1, "vMake Local Variable: ", /* +DEFUN ("make-local-variable", Fmake_local_variable, 1, 1, + "vMake Local Variable: ", /* Make VARIABLE have a separate value in the current buffer. Other buffers will continue to share a common default value. \(The buffer-local value of VARIABLE starts out as the same value @@ -2239,7 +2233,8 @@ return variable; } -DEFUN ("kill-local-variable", Fkill_local_variable, 1, 1, "vKill Local Variable: ", /* +DEFUN ("kill-local-variable", Fkill_local_variable, 1, 1, + "vKill Local Variable: ", /* Make VARIABLE no longer have a separate value in the current buffer. From now on the default value will apply in this buffer. */ @@ -2331,7 +2326,8 @@ } -DEFUN ("kill-console-local-variable", Fkill_console_local_variable, 1, 1, "vKill Console Local Variable: ", /* +DEFUN ("kill-console-local-variable", Fkill_console_local_variable, 1, 1, + "vKill Console Local Variable: ", /* Make VARIABLE no longer have a separate value in the selected console. From now on the default value will apply in this console. */ @@ -3021,7 +3017,7 @@ until the alias is removed, at which point it will be restored. Currently VARIABLE cannot be a built-in variable, a variable that has a buffer-local value in any buffer, or the symbols nil or t. -(ALIAS, however, can be any type of variable.) +\(ALIAS, however, can be any type of variable.) */ (variable, alias)) { @@ -3143,10 +3139,20 @@ void init_symbols_once_early (void) { +#ifndef Qzero + Qzero = make_int (0); /* Only used if Lisp_Object is a union type */ +#endif + +#ifndef Qnull_pointer + /* C guarantees that Qnull_pointer will be initialized to all 0 bits, + so the following is a actually a no-op. */ + XSETOBJ (Qnull_pointer, (enum Lisp_Type) 0, 0); +#endif + /* see comment in Fpurecopy() */ Vpure_uninterned_symbol_table = make_lisp_hashtable (50, HASHTABLE_NONWEAK, HASHTABLE_EQ); - staticpro(&Vpure_uninterned_symbol_table); + staticpro (&Vpure_uninterned_symbol_table); Qnil = Fmake_symbol (make_pure_pname ((CONST Bufbyte *) "nil", 3, 1)); /* Bootstrapping problem: Qnil isn't set when make_pure_pname is @@ -3155,28 +3161,13 @@ XSYMBOL (Qnil)->value = Qnil; /* Nihil ex nihil */ XSYMBOL (Qnil)->plist = Qnil; -#ifndef Qzero - Qzero = make_int (0); /* Only used if Lisp_Object is a union type */ -#endif - -#ifndef Qnull_pointer - Qnull_pointer.ui = 0; -#endif - Vobarray = make_vector (OBARRAY_SIZE, Qzero); initial_obarray = Vobarray; staticpro (&initial_obarray); /* Intern nil in the obarray */ { - /* These locals are to kludge around a pyramid compiler bug. */ - int hash; - Lisp_Object *tem; - - hash = hash_string (string_data (XSYMBOL (Qnil)->name), 3); - /* Separate statement here to avoid VAXC bug. */ - hash %= OBARRAY_SIZE; - tem = &XVECTOR_DATA (Vobarray)[hash]; - *tem = Qnil; + int hash = hash_string (string_data (XSYMBOL (Qnil)->name), 3); + XVECTOR_DATA (Vobarray)[hash % OBARRAY_SIZE] = Qnil; XSYMBOL (Qnil)->obarray = Qt; } @@ -3343,8 +3334,7 @@ /* Create and initialize a variable whose value is forwarded to C data */ void -defvar_mumble (CONST char *namestring, - CONST void *magic, int sizeof_magic) +defvar_mumble (CONST char *namestring, CONST void *magic, size_t sizeof_magic) { Lisp_Object kludge; Lisp_Object sym = Fintern (make_pure_pname ((CONST Bufbyte *) namestring,
--- a/src/symeval.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/symeval.h Mon Aug 13 10:28:48 2007 +0200 @@ -81,7 +81,7 @@ #define XSYMBOL_VALUE_MAGIC_TYPE(v) \ (((struct symbol_value_magic *) XPNTR (v))->type) #define XSETSYMBOL_VALUE_MAGIC(s, p) XSETOBJ (s, Lisp_Type_Record, p) -extern void print_symbol_value_magic (Lisp_Object, Lisp_Object, int); +void print_symbol_value_magic (Lisp_Object, Lisp_Object, int); /********** The various different symbol-value-magic types ***********/ @@ -96,8 +96,6 @@ whose CURRENT-VALUE field then contains a symbol-value-forward. */ -extern CONST_IF_NOT_DEBUG struct lrecord_implementation - lrecord_symbol_value_forward[]; struct symbol_value_forward { struct symbol_value_magic magic; @@ -141,15 +139,14 @@ int (*magicfun) (Lisp_Object sym, Lisp_Object *val, Lisp_Object in_object, int flags); }; -#define XSYMBOL_VALUE_FORWARD(v) \ - ((CONST struct symbol_value_forward *) XPNTR(v)) +DECLARE_LRECORD (symbol_value_forward, struct symbol_value_forward); +#define XSYMBOL_VALUE_FORWARD(x) \ + XRECORD (x, symbol_value_forward, struct symbol_value_forward) #define symbol_value_forward_forward(m) ((void *)((m)->magic.lcheader.next)) #define symbol_value_forward_magicfun(m) ((m)->magicfun) /* 2. symbol-value-buffer-local */ -extern CONST_IF_NOT_DEBUG struct lrecord_implementation - lrecord_symbol_value_buffer_local[]; struct symbol_value_buffer_local { struct symbol_value_magic magic; @@ -184,7 +181,7 @@ setting a value, there will always be an entry in the buffer's local_var_alist to set.) - However, these operation is potentially slow. To speed it up, + However, this operation is potentially slow. To speed it up, we cache the value in one buffer in this structure. NOTE: This is *not* a write-through cache. I.e. when setting @@ -229,17 +226,13 @@ Lisp_Object current_buffer; Lisp_Object current_alist_element; }; -#define XSYMBOL_VALUE_BUFFER_LOCAL(v) \ - ((struct symbol_value_buffer_local *) XPNTR(v)) -#define SYMBOL_VALUE_BUFFER_LOCAL_P(v) \ - (SYMBOL_VALUE_MAGIC_P (v) && \ - (XSYMBOL_VALUE_MAGIC_TYPE (v) == SYMVAL_BUFFER_LOCAL \ - || XSYMBOL_VALUE_MAGIC_TYPE (v) == SYMVAL_SOME_BUFFER_LOCAL)) +DECLARE_LRECORD (symbol_value_buffer_local, struct symbol_value_buffer_local); +#define XSYMBOL_VALUE_BUFFER_LOCAL(x) \ + XRECORD (x, symbol_value_buffer_local, struct symbol_value_buffer_local) +#define SYMBOL_VALUE_BUFFER_LOCAL_P(x) RECORDP (x, symbol_value_buffer_local) /* 3. symbol-value-lisp-magic */ -extern CONST_IF_NOT_DEBUG struct lrecord_implementation - lrecord_symbol_value_lisp_magic[]; enum lisp_magic_handler { MAGIC_HANDLER_GET_VALUE, @@ -258,47 +251,42 @@ Lisp_Object harg[MAGIC_HANDLER_MAX]; Lisp_Object shadowed; }; -#define XSYMBOL_VALUE_LISP_MAGIC(v) \ - ((struct symbol_value_lisp_magic *) XPNTR (v)) -#define SYMBOL_VALUE_LISP_MAGIC_P(v) \ - (SYMBOL_VALUE_MAGIC_P (v) && \ - XSYMBOL_VALUE_MAGIC_TYPE (v) == SYMVAL_LISP_MAGIC) +DECLARE_LRECORD (symbol_value_lisp_magic, struct symbol_value_lisp_magic); +#define XSYMBOL_VALUE_LISP_MAGIC(x) \ + XRECORD (x, symbol_value_lisp_magic, struct symbol_value_lisp_magic) +#define SYMBOL_VALUE_LISP_MAGIC_P(x) RECORDP (x, symbol_value_lisp_magic) /* 4. symbol-value-varalias */ -extern CONST_IF_NOT_DEBUG struct lrecord_implementation - lrecord_symbol_value_varalias[]; struct symbol_value_varalias { struct symbol_value_magic magic; Lisp_Object aliasee; Lisp_Object shadowed; }; -#define XSYMBOL_VALUE_VARALIAS(v) \ - ((struct symbol_value_varalias *) XPNTR (v)) -#define SYMBOL_VALUE_VARALIAS_P(v) \ - (SYMBOL_VALUE_MAGIC_P (v) && \ - XSYMBOL_VALUE_MAGIC_TYPE (v) == SYMVAL_VARALIAS) +DECLARE_LRECORD (symbol_value_varalias, struct symbol_value_varalias); +#define XSYMBOL_VALUE_VARALIAS(x) \ + XRECORD (x, symbol_value_varalias, struct symbol_value_varalias) +#define SYMBOL_VALUE_VARALIAS_P(x) RECORDP (x, symbol_value_varalias) #define symbol_value_varalias_aliasee(m) ((m)->aliasee) #define symbol_value_varalias_shadowed(m) ((m)->shadowed) /* DEFSUBR (Fname); is how we define the symbol for function `Fname' at start-up time. */ #define DEFSUBR(Fname) defsubr (&S##Fname) -extern void defsubr (struct Lisp_Subr *); +void defsubr (struct Lisp_Subr *); -extern void defsymbol (Lisp_Object *location, CONST char *name); +void defsymbol (Lisp_Object *location, CONST char *name); -extern void defkeyword (Lisp_Object *location, CONST char *name); +void defkeyword (Lisp_Object *location, CONST char *name); -extern void deferror (Lisp_Object *symbol, CONST char *name, - CONST char *message, Lisp_Object inherits_from); +void deferror (Lisp_Object *symbol, CONST char *name, + CONST char *message, Lisp_Object inherits_from); /* Macros we use to define forwarded Lisp variables. These are used in the syms_of_FILENAME functions. */ -extern void defvar_mumble (CONST char *names, - CONST void *magic, int sizeof_magic); +void defvar_mumble (CONST char *names, CONST void *magic, size_t sizeof_magic); #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION # define symbol_value_forward_lheader_initializer { 1, 0, 0 } @@ -307,13 +295,8 @@ { lrecord_symbol_value_forward } #endif -#define DEFVAR_HEADER(lname, c_location, forward_type) do { \ - static CONST struct symbol_value_forward I_hate_C \ - = { { { symbol_value_forward_lheader_initializer, \ - (struct lcrecord_header *) (c_location), 69 }, \ - forward_type }, 0 }; \ - defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C)); \ -} while (0) +#define DEFVAR_HEADER(lname, c_location, forward_type) \ + DEFVAR_MAGIC_HEADER (lname, c_location, forward_type, 0) #define DEFVAR_MAGIC_HEADER(lname, c_location, forward_type, magicfun) do { \ static CONST struct symbol_value_forward I_hate_C \ @@ -323,9 +306,6 @@ defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C)); \ } while (0) -/* These discard their DOC arg because it is snarfed by make-docfile - * and stored in an external file. */ - #define DEFVAR_HEADER_GCPRO(lname, c_location, symbol_value_type) do { \ DEFVAR_HEADER (lname, c_location, symbol_value_type); \ staticpro (c_location); \
--- a/src/symsinit.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/symsinit.h Mon Aug 13 10:28:48 2007 +0200 @@ -58,7 +58,7 @@ void syms_of_console_mswindows (void); void syms_of_console (void); void syms_of_data (void); -void syms_of_dbm (void); +void syms_of_database (void); void syms_of_debug (void); void syms_of_device_tty (void); void syms_of_device_mswindows (void); @@ -67,7 +67,7 @@ void syms_of_dialog_x (void); void syms_of_dialog (void); void syms_of_dired (void); -void syms_of_dlopen (void); +void syms_of_dll (void); void syms_of_doc (void); void syms_of_editfns (void); void syms_of_elhash (void); @@ -218,7 +218,7 @@ void vars_of_console_mswindows (void); void vars_of_console_tty (void); void vars_of_data (void); -void vars_of_dbm (void); +void vars_of_database (void); void vars_of_debug (void); void vars_of_device (void); void vars_of_device_mswindows (void);
--- a/src/syntax.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/syntax.c Mon Aug 13 10:28:48 2007 +0200 @@ -159,19 +159,18 @@ */ (obj)) { - if (CHAR_TABLEP (obj) && XCHAR_TABLE_TYPE (obj) == CHAR_TABLE_TYPE_SYNTAX) - return Qt; - return Qnil; + return CHAR_TABLEP (obj) && XCHAR_TABLE_TYPE (obj) == CHAR_TABLE_TYPE_SYNTAX + ? Qt : Qnil; } static Lisp_Object -check_syntax_table (Lisp_Object obj, Lisp_Object def) +check_syntax_table (Lisp_Object obj, Lisp_Object default_) { if (NILP (obj)) - obj = def; + obj = default_; while (NILP (Fsyntax_table_p (obj))) obj = wrong_type_argument (Qsyntax_table_p, obj); - return (obj); + return obj; } DEFUN ("syntax-table", Fsyntax_table, 0, 1, 0, /* @@ -305,10 +304,8 @@ if (SYNTAX_FROM_CODE (XINT (code2)) == Sinherit) code = CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (Vstandard_syntax_table), ch); - if (CONSP (code)) - return XCDR (code); - else - return Qnil; + + return CONSP (code) ? XCDR (code) : Qnil; } DEFUN ("matching-paren", Fmatching_paren, 1, 2, 0, /* @@ -1489,6 +1486,7 @@ int target; Bufpos start, end; struct buffer *buf = decode_buffer (buffer, 0); + Lisp_Object val; if (!NILP (targetdepth)) { @@ -1505,26 +1503,18 @@ BUF_SET_PT (buf, state.location); - { - /* - * This junk is necessary because of a bug in SparcWorks cc 2.0.1. It - * doesn't handle functions as arguments to other functions very well. - */ - Lisp_Object retval[8]; + /* reverse order */ + val = Qnil; + val = Fcons (state.comstyle ? Qt : Qnil, val); + val = Fcons (make_int (state.mindepth), val); + val = Fcons (state.quoted ? Qt : Qnil, val); + val = Fcons (state.incomment ? Qt : Qnil, val); + val = Fcons (state.instring < 0 ? Qnil : make_int (state.instring), val); + val = Fcons (state.thislevelstart < 0 ? Qnil : make_int (state.thislevelstart), val); + val = Fcons (state.prevlevelstart < 0 ? Qnil : make_int (state.prevlevelstart), val); + val = Fcons (make_int (state.depth), val); - retval[0] = make_int (state.depth); - retval[1] = ((state.prevlevelstart < 0) ? Qnil : - make_int (state.prevlevelstart)); - retval[2] = ((state.thislevelstart < 0) ? Qnil : - make_int (state.thislevelstart)); - retval[3] = ((state.instring >= 0) ? make_int (state.instring) : Qnil); - retval[4] = ((state.incomment) ? Qt : Qnil); - retval[5] = ((state.quoted) ? Qt : Qnil); - retval[6] = make_int (state.mindepth); - retval[7] = ((state.comstyle) ? Qt : Qnil); - - return (Flist (8, retval)); - } + return val; }
--- a/src/syntax.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/syntax.h Mon Aug 13 10:28:48 2007 +0200 @@ -25,10 +25,6 @@ #include "chartab.h" -/* The standard syntax table is stored where it will automatically - be used in all new buffers. */ -extern Lisp_Object Vstandard_syntax_table; - /* A syntax table is a type of char table. The low 7 bits of the integer is a code, as follows. The 8th bit is @@ -68,10 +64,6 @@ Smax /* Upper bound on codes that are meaningful */ }; -extern Lisp_Object Qsyntax_table_p; -Lisp_Object Fsyntax_table_p (Lisp_Object); -Lisp_Object Fsyntax_table (Lisp_Object); -Lisp_Object Fset_syntax_table (Lisp_Object, Lisp_Object); enum syntaxcode charset_syntax (struct buffer *buf, Lisp_Object charset, int *multi_p_out); @@ -86,7 +78,7 @@ { return SYNTAX_CODE_UNSAFE (table, c); } - + #define SYNTAX_UNSAFE(table, c) \ ((enum syntaxcode) (SYNTAX_CODE_UNSAFE (table, c) & 0177)) @@ -230,6 +222,13 @@ ? SYNTAX_COMMENT_STYLE_B \ : 0))) +EXFUN (Fchar_syntax, 2); +EXFUN (Fforward_word, 2); + +/* The standard syntax table is stored where it will automatically + be used in all new buffers. */ +extern Lisp_Object Vstandard_syntax_table; + /* This array, indexed by a character, contains the syntax code which that character signifies (as a char). For example, (enum syntaxcode) syntax_spec_code['w'] is Sword. */
--- a/src/sysdep.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/sysdep.c Mon Aug 13 10:28:48 2007 +0200 @@ -44,6 +44,7 @@ #include "lisp.h" #include <stddef.h> +#include <stdlib.h> /* ------------------------------- */ /* basic includes */ @@ -946,7 +947,7 @@ } DEVICE_BAUD_RATE (d) = - (DEVICE_TTY_DATA (d)->ospeed < sizeof baud_convert / sizeof baud_convert[0] + (DEVICE_TTY_DATA (d)->ospeed < countof (baud_convert) ? baud_convert[DEVICE_TTY_DATA (d)->ospeed] : 9600); @@ -2166,6 +2167,10 @@ * */ +#ifdef ORDINARY_LINK +extern char **environ; +#endif + void * start_of_data (void) { @@ -2179,7 +2184,6 @@ * is known to live at or near the start of the system crt0.c, and * we don't sweat the handful of bytes that might lose. */ - extern char **environ; #ifdef HEAP_IN_DATA extern char* static_heap_base; if (!initialized) @@ -2281,7 +2285,7 @@ if (initialized) # endif /* not CANNOT_DUMP */ { - struct hostent *hp; + struct hostent *hp = NULL; int count; # ifdef TRY_AGAIN for (count = 0; count < 10; count++) @@ -2569,7 +2573,7 @@ /************************************************************************/ #define PATHNAME_CONVERT_OUT(path) \ - GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (path, path) + GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA ((CONST Bufbyte *) path, path) /***** MSDOS versions are in msdos.c *****/ @@ -2637,8 +2641,7 @@ which could be relocated by GC when checking for QUIT. */ memcpy (nonreloc, path, len + 1); - /* The same as PATHNAME_CONVERT_OUT in sysdep.c. */ - GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (nonreloc, nonreloc); + PATHNAME_CONVERT_OUT (nonreloc); for (;;) { @@ -2676,7 +2679,7 @@ #endif /* ENCAPSULATE_CLOSE */ int -sys_read_1 (int fildes, void *buf, unsigned int nbyte, int allow_quit) +sys_read_1 (int fildes, void *buf, size_t nbyte, int allow_quit) { int rtnval; @@ -2692,14 +2695,14 @@ #ifdef ENCAPSULATE_READ int -sys_read (int fildes, void *buf, unsigned int nbyte) +sys_read (int fildes, void *buf, size_t nbyte) { return sys_read_1 (fildes, buf, nbyte, 0); } #endif /* ENCAPSULATE_READ */ int -sys_write_1 (int fildes, CONST void *buf, unsigned int nbyte, int allow_quit) +sys_write_1 (int fildes, CONST void *buf, size_t nbyte, int allow_quit) { int rtnval; int bytes_written = 0; @@ -2729,7 +2732,7 @@ #ifdef ENCAPSULATE_WRITE int -sys_write (int fildes, CONST void *buf, unsigned int nbyte) +sys_write (int fildes, CONST void *buf, size_t nbyte) { return sys_write_1 (fildes, buf, nbyte, 0); } @@ -2861,7 +2864,7 @@ #ifdef ENCAPSULATE_MKDIR int -sys_mkdir (CONST char *path, int mode) +sys_mkdir (CONST char *path, mode_t mode) { PATHNAME_CONVERT_OUT (path); return mkdir (path, mode); @@ -3000,7 +3003,7 @@ #ifdef ENCAPSULATE_READLINK int -sys_readlink (CONST char *path, char *buf, int bufsiz) +sys_readlink (CONST char *path, char *buf, size_t bufsiz) { PATHNAME_CONVERT_OUT (path); /* #### currently we don't do conversions on the incoming data */ @@ -3023,7 +3026,7 @@ #ifdef ENCAPSULATE_CHMOD int -sys_chmod (CONST char *path, int mode) +sys_chmod (CONST char *path, mode_t mode) { PATHNAME_CONVERT_OUT (path); return chmod (path, mode); @@ -3033,7 +3036,7 @@ #ifdef ENCAPSULATE_CREAT int -sys_creat (CONST char *path, int mode) +sys_creat (CONST char *path, mode_t mode) { PATHNAME_CONVERT_OUT (path); return creat (path, mode); @@ -3089,16 +3092,19 @@ sys_execvp (CONST char *path, char * CONST * argv) { int i, argc; - CONST char ** new_argv; + char ** new_argv; PATHNAME_CONVERT_OUT (path); for (argc = 0; argv[argc]; argc++) ; - new_argv = alloca_array (CONST char *, argc + 1); + new_argv = alloca_array (char *, argc + 1); for (i = 0; i < argc; i++) - GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (argv[i], new_argv[i]); + { + new_argv[i] = argv[i]; + PATHNAME_CONVERT_OUT (new_argv[i]); + } new_argv[argc] = NULL; - return execvp (path, (char **) new_argv); + return execvp (path, new_argv); } #endif /* ENCAPSULATE_EXECVP */ @@ -3404,16 +3410,6 @@ return val & ((1L << VALBITS) - 1); } -#ifdef WRONG_NAME_INSQUE - -void -insque (caddr_t q, caddr_t p) -{ - _insque (q,p); -} - -#endif - /************************************************************************/ /* Strings corresponding to defined signals */
--- a/src/sysdir.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/sysdir.h Mon Aug 13 10:28:48 2007 +0200 @@ -20,6 +20,10 @@ /* Synched up with: Not really in FSF. */ +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + #ifdef SYSV_SYSTEM_DIR # include <dirent.h> #elif defined (NONSYSTEM_DIR_LIBRARY) @@ -60,7 +64,7 @@ /* encapsulation: directory calls */ #ifdef ENCAPSULATE_CHDIR -extern int sys_chdir (CONST char *path); +int sys_chdir (CONST char *path); #endif #if defined (ENCAPSULATE_CHDIR) && !defined (DONT_ENCAPSULATE) # undef chdir @@ -71,7 +75,7 @@ #endif #ifdef ENCAPSULATE_MKDIR -extern int sys_mkdir (CONST char *path, int mode); +int sys_mkdir (CONST char *path, mode_t mode); #endif #if defined (ENCAPSULATE_MKDIR) && !defined (DONT_ENCAPSULATE) # undef mkdir @@ -82,7 +86,7 @@ #endif #ifdef ENCAPSULATE_OPENDIR -extern DIR *sys_opendir (CONST char *filename); +DIR *sys_opendir (CONST char *filename); #endif #if defined (ENCAPSULATE_OPENDIR) && !defined (DONT_ENCAPSULATE) # undef opendir @@ -93,7 +97,7 @@ #endif #ifdef ENCAPSULATE_READDIR -extern DIRENTRY *sys_readdir (DIR *dirp); +DIRENTRY *sys_readdir (DIR *dirp); #endif #if defined (ENCAPSULATE_READDIR) && !defined (DONT_ENCAPSULATE) # undef readdir @@ -104,7 +108,7 @@ #endif #ifdef ENCAPSULATE_CLOSEDIR -extern int sys_closedir (DIR *dirp); +int sys_closedir (DIR *dirp); #endif #if defined (ENCAPSULATE_CLOSEDIR) && !defined (DONT_ENCAPSULATE) # undef closedir @@ -115,7 +119,7 @@ #endif #ifdef ENCAPSULATE_RMDIR -extern int sys_rmdir (CONST char *path); +int sys_rmdir (CONST char *path); #endif #if defined (ENCAPSULATE_RMDIR) && !defined (DONT_ENCAPSULATE) # undef rmdir
--- a/src/sysdll.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/sysdll.c Mon Aug 13 10:28:48 2007 +0200 @@ -108,7 +108,7 @@ } int dll_close(dll_handle h) { - shl_t h = *((shl_t *)hp); + shl_t hp = *((shl_t *)h); free(hp); return (shl_unload(h)); }
--- a/src/sysfile.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/sysfile.h Mon Aug 13 10:28:48 2007 +0200 @@ -26,6 +26,15 @@ #include <sys/errno.h> /* <errno.h> does not always imply this */ #endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#ifndef INCLUDED_FCNTL +# define INCLUDED_FCNTL +# include <fcntl.h> +#endif /* INCLUDED_FCNTL */ + /* Load sys/types.h if not already loaded. In some systems loading it twice is suicidal. */ #ifndef makedev @@ -36,7 +45,7 @@ #include <sys/param.h> #if defined (NeXT) || defined(__CYGWIN32__) -/* what is needed from here? Do others need it too? +/* what is needed from here? Do others need it too? O_BINARY is in here under cygwin. */ # include <sys/fcntl.h> #endif /* NeXT */ @@ -211,10 +220,124 @@ # define FD_CLOEXEC 1 #endif +/* Emacs needs to use its own definitions of certain system calls on + some systems (like SunOS 4.1 and USG systems, where the read system + call is interruptible but Emacs expects it not to be; and under + MULE, where all filenames need to be converted to external format). + To do this, we #define read to be sys_read, which is defined in + sysdep.c. We first #undef read, in case some system file defines + read as a macro. sysdep.c doesn't encapsulate read, so the call to + read inside of sys_read will do the right thing. + + DONT_ENCAPSULATE is used in files such as sysdep.c that want to + call the actual system calls rather than the encapsulated versions. + Those files can call sys_read to get the (possibly) encapsulated + versions. + + IMPORTANT: the redefinition of the system call must occur *after* the + inclusion of any header files that declare or define the system call; + otherwise lots of unfriendly things can happen. This goes for all + encapsulated system calls. + + We encapsulate the most common system calls here; we assume their + declarations are in one of the standard header files included above. + Other encapsulations are declared in the appropriate sys*.h file. */ + +#ifdef ENCAPSULATE_READ +int sys_read (int, void *, size_t); +#endif +#if defined (ENCAPSULATE_READ) && !defined (DONT_ENCAPSULATE) +# undef read +# define read sys_read +#endif +#if !defined (ENCAPSULATE_READ) && defined (DONT_ENCAPSULATE) +# define sys_read read +#endif + +#ifdef ENCAPSULATE_WRITE +int sys_write (int, CONST void *, size_t); +#endif +#if defined (ENCAPSULATE_WRITE) && !defined (DONT_ENCAPSULATE) +# undef write +# define write sys_write +#endif +#if !defined (ENCAPSULATE_WRITE) && defined (DONT_ENCAPSULATE) +# define sys_write write +#endif + +#ifdef ENCAPSULATE_OPEN +int sys_open (CONST char *, int, ...); +#endif +#if defined (ENCAPSULATE_OPEN) && !defined (DONT_ENCAPSULATE) +# undef open +# define open sys_open +#endif +#if !defined (ENCAPSULATE_OPEN) && defined (DONT_ENCAPSULATE) +# define sys_open open +#endif + +#ifdef ENCAPSULATE_CLOSE +int sys_close (int); +#endif +#if defined (ENCAPSULATE_CLOSE) && !defined (DONT_ENCAPSULATE) +# undef close +# define close sys_close +#endif +#if !defined (ENCAPSULATE_CLOSE) && defined (DONT_ENCAPSULATE) +# define sys_close close +#endif + +/* Now the stdio versions ... */ + +#ifdef ENCAPSULATE_FREAD +size_t sys_fread (void *, size_t, size_t, FILE *); +#endif +#if defined (ENCAPSULATE_FREAD) && !defined (DONT_ENCAPSULATE) +# undef fread +# define fread sys_fread +#endif +#if !defined (ENCAPSULATE_FREAD) && defined (DONT_ENCAPSULATE) +# define sys_fread fread +#endif + +#ifdef ENCAPSULATE_FWRITE +size_t sys_fwrite (CONST void *, size_t, size_t, FILE *); +#endif +#if defined (ENCAPSULATE_FWRITE) && !defined (DONT_ENCAPSULATE) +# undef fwrite +# define fwrite sys_fwrite +#endif +#if !defined (ENCAPSULATE_FWRITE) && defined (DONT_ENCAPSULATE) +# define sys_fwrite fwrite +#endif + +#ifdef ENCAPSULATE_FOPEN +FILE *sys_fopen (CONST char *, CONST char *); +#endif +#if defined (ENCAPSULATE_FOPEN) && !defined (DONT_ENCAPSULATE) +# undef fopen +# define fopen sys_fopen +#endif +#if !defined (ENCAPSULATE_FOPEN) && defined (DONT_ENCAPSULATE) +# define sys_fopen fopen +#endif + +#ifdef ENCAPSULATE_FCLOSE +int sys_fclose (FILE *); +#endif +#if defined (ENCAPSULATE_FCLOSE) && !defined (DONT_ENCAPSULATE) +# undef fclose +# define fclose sys_fclose +#endif +#if !defined (ENCAPSULATE_FCLOSE) && defined (DONT_ENCAPSULATE) +# define sys_fclose fclose +#endif + + /* encapsulations: file-information calls */ #ifdef ENCAPSULATE_ACCESS -extern int sys_access (CONST char *path, int mode); +int sys_access (CONST char *path, int mode); #endif #if defined (ENCAPSULATE_ACCESS) && !defined (DONT_ENCAPSULATE) # undef access @@ -225,7 +348,7 @@ #endif #ifdef ENCAPSULATE_EACCESS -extern int sys_eaccess (CONST char *path, int mode); +int sys_eaccess (CONST char *path, int mode); #endif #if defined (ENCAPSULATE_EACCESS) && !defined (DONT_ENCAPSULATE) # undef eaccess @@ -236,7 +359,7 @@ #endif #ifdef ENCAPSULATE_LSTAT -extern int sys_lstat (CONST char *path, struct stat *buf); +int sys_lstat (CONST char *path, struct stat *buf); #endif #if defined (ENCAPSULATE_LSTAT) && !defined (DONT_ENCAPSULATE) # undef lstat @@ -247,7 +370,7 @@ #endif #ifdef ENCAPSULATE_READLINK -extern int sys_readlink (CONST char *path, char *buf, int bufsiz); +int sys_readlink (CONST char *path, char *buf, size_t bufsiz); #endif #if defined (ENCAPSULATE_READLINK) && !defined (DONT_ENCAPSULATE) # undef readlink @@ -258,7 +381,7 @@ #endif #ifdef ENCAPSULATE_STAT -extern int sys_stat (CONST char *path, struct stat *buf); +int sys_stat (CONST char *path, struct stat *buf); #endif #if defined (ENCAPSULATE_STAT) && !defined (DONT_ENCAPSULATE) # undef stat @@ -272,7 +395,7 @@ /* encapsulations: file-manipulation calls */ #ifdef ENCAPSULATE_CHMOD -extern int sys_chmod (CONST char *path, int mode); +int sys_chmod (CONST char *path, mode_t mode); #endif #if defined (ENCAPSULATE_CHMOD) && !defined (DONT_ENCAPSULATE) # undef chmod @@ -283,7 +406,7 @@ #endif #ifdef ENCAPSULATE_CREAT -extern int sys_creat (CONST char *path, int mode); +int sys_creat (CONST char *path, mode_t mode); #endif #if defined (ENCAPSULATE_CREAT) && !defined (DONT_ENCAPSULATE) # undef creat @@ -294,7 +417,7 @@ #endif #ifdef ENCAPSULATE_LINK -extern int sys_link (CONST char *existing, CONST char *new); +int sys_link (CONST char *existing, CONST char *new); #endif #if defined (ENCAPSULATE_LINK) && !defined (DONT_ENCAPSULATE) # undef link @@ -305,7 +428,7 @@ #endif #ifdef ENCAPSULATE_RENAME -extern int sys_rename (CONST char *old, CONST char *new); +int sys_rename (CONST char *old, CONST char *new); #endif #if defined (ENCAPSULATE_RENAME) && !defined (DONT_ENCAPSULATE) # undef rename @@ -316,7 +439,7 @@ #endif #ifdef ENCAPSULATE_SYMLINK -extern int sys_symlink (CONST char *name1, CONST char *name2); +int sys_symlink (CONST char *name1, CONST char *name2); #endif #if defined (ENCAPSULATE_SYMLINK) && !defined (DONT_ENCAPSULATE) # undef symlink @@ -327,7 +450,7 @@ #endif #ifdef ENCAPSULATE_UNLINK -extern int sys_unlink (CONST char *path); +int sys_unlink (CONST char *path); #endif #if defined (ENCAPSULATE_UNLINK) && !defined (DONT_ENCAPSULATE) # undef unlink @@ -338,7 +461,7 @@ #endif #ifdef ENCAPSULATE_EXECVP -extern int sys_execvp (CONST char *, char * CONST *); +int sys_execvp (CONST char *, char * CONST *); #endif #if defined (ENCAPSULATE_EXECVP) && !defined (DONT_ENCAPSULATE) # undef execvp
--- a/src/sysproc.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/sysproc.h Mon Aug 13 10:28:48 2007 +0200 @@ -96,11 +96,11 @@ #endif /* no FD_SET */ #ifdef EMACS_BTL -extern int cadillac_stop_logging (); -extern int cadillac_start_logging (); +int cadillac_stop_logging (); +int cadillac_start_logging (); #endif -extern int poll_fds_for_input (SELECT_TYPE mask); +int poll_fds_for_input (SELECT_TYPE mask); #ifdef MSDOS /* #include <process.h> */
--- a/src/syssignal.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/syssignal.h Mon Aug 13 10:28:48 2007 +0200 @@ -96,8 +96,7 @@ /* The POSIX way (sigaction, sigprocmask, sigpending, sigsuspend) */ -extern signal_handler_t sys_do_signal (int signal_number, - signal_handler_t action); +signal_handler_t sys_do_signal (int signal_number, signal_handler_t action); /* Provide our own version of signal(), that calls sigaction(). The name is not sys_signal() because a function of that name exists in libenergize.a */ @@ -225,7 +224,7 @@ #endif #ifdef SIGDANGER -extern SIGTYPE memory_warning_signal (int sig); +SIGTYPE memory_warning_signal (int sig); #endif #ifdef _WIN32
--- a/src/systime.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/systime.h Mon Aug 13 10:28:48 2007 +0200 @@ -141,7 +141,7 @@ #if !defined (HAVE_GETTIMEOFDAY) struct timezone; -extern int gettimeofday (struct timeval *, struct timezone *); +int gettimeofday (struct timeval *, struct timezone *); #endif /* On SVR4, the compiler may complain if given this extra BSD arg. */ @@ -149,7 +149,7 @@ # ifdef SOLARIS2 /* Solaris (at least) omits this prototype. IRIX5 has it and chokes if we declare it here. */ -extern int gettimeofday (struct timeval *); +int gettimeofday (struct timeval *); # endif /* According to the Xt sources, some NTP daemons on some systems may return non-normalized values. */ @@ -162,7 +162,7 @@ # ifdef SOLARIS2 /* Solaris doesn't provide any prototype of this unless a bunch of crap we don't define are defined. */ -extern int gettimeofday (struct timeval *, void *dummy); +int gettimeofday (struct timeval *, void *dummy); # endif #define EMACS_GET_TIME(time) \ do { \ @@ -219,10 +219,10 @@ #define EMACS_SET_SECS_USECS(time, secs, usecs) \ (EMACS_SET_SECS (time, secs), EMACS_SET_USECS (time, usecs)) -extern int set_file_times (char *filename, EMACS_TIME atime, EMACS_TIME mtime); +int set_file_times (char *filename, EMACS_TIME atime, EMACS_TIME mtime); -extern void get_process_times (double *user_time, double *system_time, - double *real_time); +void get_process_times (double *user_time, double *system_time, + double *real_time); #if defined(WINDOWSNT) || defined(BROKEN_CYGWIN)
--- a/src/systty.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/systty.h Mon Aug 13 10:28:48 2007 +0200 @@ -144,7 +144,7 @@ #ifdef NEED_BSDTTY #include <sys/bsdtty.h> -#endif +#endif /* Include files for PTY's */ @@ -156,8 +156,6 @@ #include <sys/pty.h> #endif /* AIX */ -/* XEmacs: We don't include unistd.h because it's done in lisp.h */ - #ifdef SYSV_PTYS # include <sys/types.h> # include <sys/tty.h>
--- a/src/toolbar-x.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/toolbar-x.c Mon Aug 13 10:28:48 2007 +0200 @@ -519,7 +519,7 @@ static void x_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change) { - Lisp_Object frame = Qnil; + Lisp_Object frame; struct device *d = XDEVICE (f->device); int x, y, width, height, vert; @@ -687,18 +687,16 @@ size. */ in_specifier_change_function++; + if (!in_resource_setting) /* mirror the value in the frame resources, unless already done. */ - { - Arg al [1]; - XtSetArg (al [0], - pos == TOP_TOOLBAR ? XtNtopToolBarHeight : - pos == BOTTOM_TOOLBAR ? XtNbottomToolBarHeight : - pos == LEFT_TOOLBAR ? XtNleftToolBarWidth : - XtNrightToolBarWidth, - newval); - XtSetValues (FRAME_X_TEXT_WIDGET (f), al, 1); - } + Xt_SET_VALUE (FRAME_X_CONTAINER_WIDGET (f), + pos == TOP_TOOLBAR ? XtNtopToolBarHeight : + pos == BOTTOM_TOOLBAR ? XtNbottomToolBarHeight : + pos == LEFT_TOOLBAR ? XtNleftToolBarWidth : + XtNrightToolBarWidth, + newval); + if (XtIsRealized (FRAME_X_CONTAINER_WIDGET (f))) { int change = newval - oldval; @@ -790,18 +788,16 @@ size. */ in_specifier_change_function++; + if (!in_resource_setting) /* mirror the value in the frame resources, unless already done. */ - { - Arg al [1]; - XtSetArg (al [0], - pos == TOP_TOOLBAR ? XtNtopToolBarBorderWidth : - pos == BOTTOM_TOOLBAR ? XtNbottomToolBarBorderWidth : - pos == LEFT_TOOLBAR ? XtNleftToolBarBorderWidth : - XtNrightToolBarBorderWidth, - newval); - XtSetValues (FRAME_X_TEXT_WIDGET (f), al, 1); - } + Xt_SET_VALUE (FRAME_X_TEXT_WIDGET (f), + pos == TOP_TOOLBAR ? XtNtopToolBarBorderWidth : + pos == BOTTOM_TOOLBAR ? XtNbottomToolBarBorderWidth : + pos == LEFT_TOOLBAR ? XtNleftToolBarBorderWidth : + XtNrightToolBarBorderWidth, + newval); + if (XtIsRealized (FRAME_X_CONTAINER_WIDGET (f))) { int change = 2 * (newval - oldval); @@ -838,6 +834,7 @@ x_initialize_frame_toolbar_gcs (struct frame *f) { EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); + EmacsFramePart *efp = &(ef->emacs_frame); XGCValues gcv; unsigned long flags = (GCForeground | GCBackground | GCGraphicsExposures); @@ -845,9 +842,8 @@ * If backgroundToolBarColor is specified, use it. * Otherwise use the background resource. */ - if (ef->emacs_frame.background_toolbar_pixel == -1) - ef->emacs_frame.background_toolbar_pixel = - ef->emacs_frame.background_pixel; + if (efp->background_toolbar_pixel == (Pixel) (-1)) + efp->background_toolbar_pixel = efp->background_pixel; /* * #### @@ -858,50 +854,46 @@ * used when toolbar captions are generated by the toolbar code * instead being incorporated into the icon image. */ - if (ef->emacs_frame.foreground_toolbar_pixel == -1) - ef->emacs_frame.foreground_toolbar_pixel = - ef->emacs_frame.foreground_pixel; + if (efp->foreground_toolbar_pixel == (Pixel) (-1)) + efp->foreground_toolbar_pixel = efp->foreground_pixel; - gcv.foreground = ef->emacs_frame.background_toolbar_pixel; + gcv.foreground = efp->background_toolbar_pixel; gcv.background = ef->core.background_pixel; gcv.graphics_exposures = False; FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f) = XtGetGC ((Widget) ef, flags, &gcv); - if (ef->emacs_frame.top_toolbar_shadow_pixel == - ef->emacs_frame.bottom_toolbar_shadow_pixel) + if (efp->top_toolbar_shadow_pixel == efp->bottom_toolbar_shadow_pixel) { - ef->emacs_frame.top_toolbar_shadow_pixel = - ef->emacs_frame.background_toolbar_pixel; - ef->emacs_frame.bottom_toolbar_shadow_pixel = - ef->emacs_frame.background_toolbar_pixel; + efp->top_toolbar_shadow_pixel = efp->background_toolbar_pixel; + efp->bottom_toolbar_shadow_pixel = efp->background_toolbar_pixel; } - x_generate_shadow_pixels (f, &ef->emacs_frame.top_toolbar_shadow_pixel, - &ef->emacs_frame.bottom_toolbar_shadow_pixel, - ef->emacs_frame.background_toolbar_pixel, + x_generate_shadow_pixels (f, &efp->top_toolbar_shadow_pixel, + &efp->bottom_toolbar_shadow_pixel, + efp->background_toolbar_pixel, ef->core.background_pixel); - gcv.foreground = ef->emacs_frame.top_toolbar_shadow_pixel; + gcv.foreground = efp->top_toolbar_shadow_pixel; gcv.background = ef->core.background_pixel; gcv.graphics_exposures = False; flags = GCForeground | GCBackground | GCGraphicsExposures; - if (ef->emacs_frame.top_toolbar_shadow_pixmap) + if (efp->top_toolbar_shadow_pixmap) { gcv.fill_style = FillOpaqueStippled; - gcv.stipple = ef->emacs_frame.top_toolbar_shadow_pixmap; + gcv.stipple = efp->top_toolbar_shadow_pixmap; flags |= GCStipple | GCFillStyle; } FRAME_X_TOOLBAR_TOP_SHADOW_GC (f) = XtGetGC ((Widget) ef, flags, &gcv); - gcv.foreground = ef->emacs_frame.bottom_toolbar_shadow_pixel; + gcv.foreground = efp->bottom_toolbar_shadow_pixel; gcv.background = ef->core.background_pixel; gcv.graphics_exposures = False; flags = GCForeground | GCBackground | GCGraphicsExposures; - if (ef->emacs_frame.bottom_toolbar_shadow_pixmap) + if (efp->bottom_toolbar_shadow_pixmap) { gcv.fill_style = FillOpaqueStippled; - gcv.stipple = ef->emacs_frame.bottom_toolbar_shadow_pixmap; + gcv.stipple = efp->bottom_toolbar_shadow_pixmap; flags |= GCStipple | GCFillStyle; } FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f) = XtGetGC ((Widget) ef, flags, &gcv); @@ -939,10 +931,10 @@ XtReleaseGC (ew, FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f)); /* Seg fault if we try and use these again. */ - FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f) = (GC) - 1; + FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f) = (GC) - 1; FRAME_X_TOOLBAR_PIXMAP_BACKGROUND_GC (f) = (GC) - 1; - FRAME_X_TOOLBAR_TOP_SHADOW_GC (f) = (GC) - 1; - FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f) = (GC) - 1; + FRAME_X_TOOLBAR_TOP_SHADOW_GC (f) = (GC) - 1; + FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f) = (GC) - 1; } static void @@ -951,11 +943,8 @@ EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); if (ef->emacs_frame.toolbar_shadow_thickness < MINIMUM_SHADOW_THICKNESS) - { - Arg al [1]; - XtSetArg (al [0], XtNtoolBarShadowThickness, MINIMUM_SHADOW_THICKNESS); - XtSetValues (FRAME_X_TEXT_WIDGET (f), al, 1); - } + Xt_SET_VALUE (FRAME_X_TEXT_WIDGET (f), + XtNtoolBarShadowThickness, MINIMUM_SHADOW_THICKNESS); x_initialize_frame_toolbar_gcs (f); }
--- a/src/toolbar.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/toolbar.c Mon Aug 13 10:28:48 2007 +0200 @@ -52,7 +52,6 @@ Lisp_Object Qtoolbar_buttonp; Lisp_Object Q2D, Q3D, Q2d, Q3d; Lisp_Object Q_size; -extern Lisp_Object Q_style; /* defined in menubar.c */ Lisp_Object Qinit_toolbar_from_resources; @@ -834,7 +833,7 @@ support toolbars. */ if (HAS_DEVMETH_P (d, output_frame_toolbars)) { - Lisp_Object frame = Qnil; + Lisp_Object frame; compute_frame_toolbars_data (f, 1); XSETFRAME (frame, f); @@ -848,7 +847,7 @@ void init_device_toolbars (struct device *d) { - Lisp_Object device = Qnil; + Lisp_Object device; XSETDEVICE (device, d); if (HAS_DEVMETH_P (d, output_frame_toolbars)) @@ -1405,7 +1404,7 @@ void specifier_vars_of_toolbar (void) { - Lisp_Object elt; + Lisp_Object fb; DEFVAR_SPECIFIER ("default-toolbar", &Vdefault_toolbar /* Specifier for a fallback toolbar. @@ -1593,12 +1592,12 @@ /* initially, top inherits from default; this can be changed with `set-default-toolbar-position'. */ - elt = list1 (Fcons (Qnil, Qnil)); - set_specifier_fallback (Vdefault_toolbar, elt); + fb = list1 (Fcons (Qnil, Qnil)); + set_specifier_fallback (Vdefault_toolbar, fb); set_specifier_fallback (Vtoolbar[TOP_TOOLBAR], Vdefault_toolbar); - set_specifier_fallback (Vtoolbar[BOTTOM_TOOLBAR], elt); - set_specifier_fallback (Vtoolbar[LEFT_TOOLBAR], elt); - set_specifier_fallback (Vtoolbar[RIGHT_TOOLBAR], elt); + set_specifier_fallback (Vtoolbar[BOTTOM_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar[LEFT_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar[RIGHT_TOOLBAR], fb); DEFVAR_SPECIFIER ("default-toolbar-height", &Vdefault_toolbar_height /* *Height of the default toolbar, if it's oriented horizontally. @@ -1727,39 +1726,31 @@ toolbar_size[RIGHT_TOOLBAR]), toolbar_size_changed_in_frame); - /* #### this is ugly. */ - /* sb - even uglier to make this work without console tty support, ugh. */ - elt = Qnil; + fb = Qnil; #ifdef HAVE_TTY - elt = list1 (Fcons (list1 (Qtty), Qzero)); + fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); #endif #ifdef HAVE_X_WINDOWS - if (!EQ(elt, Qnil)) - elt = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_HEIGHT)), elt); - else - elt = list1 (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_HEIGHT))); + fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_HEIGHT)), fb); #endif - if (!EQ(elt, Qnil)) - set_specifier_fallback (Vdefault_toolbar_height, elt); + if (!NILP (fb)) + set_specifier_fallback (Vdefault_toolbar_height, fb); - elt = Qnil; + fb = Qnil; #ifdef HAVE_TTY - elt = list1 (Fcons (list1 (Qtty), Qzero)); + fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); #endif #ifdef HAVE_X_WINDOWS - if (!EQ(elt, Qnil)) - elt = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_WIDTH)), elt); - else - elt = list1 (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_WIDTH))); + fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_WIDTH)), fb); #endif - if (!EQ(elt, Qnil)) - set_specifier_fallback (Vdefault_toolbar_width, elt); + if (!NILP (fb)) + set_specifier_fallback (Vdefault_toolbar_width, fb); set_specifier_fallback (Vtoolbar_size[TOP_TOOLBAR], Vdefault_toolbar_height); - elt = list1 (Fcons (Qnil, Qzero)); - set_specifier_fallback (Vtoolbar_size[BOTTOM_TOOLBAR], elt); - set_specifier_fallback (Vtoolbar_size[LEFT_TOOLBAR], elt); - set_specifier_fallback (Vtoolbar_size[RIGHT_TOOLBAR], elt); + fb = list1 (Fcons (Qnil, Qzero)); + set_specifier_fallback (Vtoolbar_size[BOTTOM_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_size[LEFT_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_size[RIGHT_TOOLBAR], fb); DEFVAR_SPECIFIER ("default-toolbar-border-width", &Vdefault_toolbar_border_width /* @@ -1856,27 +1847,21 @@ toolbar_border_width[RIGHT_TOOLBAR]), toolbar_border_width_changed_in_frame); - /* #### this is ugly. */ - /* sb - even uglier to make this work without console tty support, ugh. */ - /* not if you get to copy it instead of writing it from scratch. --kyle */ - elt = Qnil; + fb = Qnil; #ifdef HAVE_TTY - elt = list1 (Fcons (list1 (Qtty), Qzero)); + fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); #endif #ifdef HAVE_X_WINDOWS - if (!EQ(elt, Qnil)) - elt = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_BORDER_WIDTH)), elt); - else - elt = list1 (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_BORDER_WIDTH))); + fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_BORDER_WIDTH)), fb); #endif - if (!EQ(elt, Qnil)) - set_specifier_fallback (Vdefault_toolbar_border_width, elt); + if (!NILP (fb)) + set_specifier_fallback (Vdefault_toolbar_border_width, fb); set_specifier_fallback (Vtoolbar_border_width[TOP_TOOLBAR], Vdefault_toolbar_border_width); - elt = list1 (Fcons (Qnil, Qzero)); - set_specifier_fallback (Vtoolbar_border_width[BOTTOM_TOOLBAR], elt); - set_specifier_fallback (Vtoolbar_border_width[LEFT_TOOLBAR], elt); - set_specifier_fallback (Vtoolbar_border_width[RIGHT_TOOLBAR], elt); + fb = list1 (Fcons (Qnil, Qzero)); + set_specifier_fallback (Vtoolbar_border_width[BOTTOM_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_border_width[LEFT_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_border_width[RIGHT_TOOLBAR], fb); DEFVAR_SPECIFIER ("default-toolbar-visible-p", &Vdefault_toolbar_visible_p /* *Whether the default toolbar is visible. @@ -1973,13 +1958,13 @@ /* initially, top inherits from default; this can be changed with `set-default-toolbar-position'. */ - elt = list1 (Fcons (Qnil, Qt)); - set_specifier_fallback (Vdefault_toolbar_visible_p, elt); + fb = list1 (Fcons (Qnil, Qt)); + set_specifier_fallback (Vdefault_toolbar_visible_p, fb); set_specifier_fallback (Vtoolbar_visible_p[TOP_TOOLBAR], Vdefault_toolbar_visible_p); - set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_TOOLBAR], elt); - set_specifier_fallback (Vtoolbar_visible_p[LEFT_TOOLBAR], elt); - set_specifier_fallback (Vtoolbar_visible_p[RIGHT_TOOLBAR], elt); + set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_visible_p[LEFT_TOOLBAR], fb); + set_specifier_fallback (Vtoolbar_visible_p[RIGHT_TOOLBAR], fb); DEFVAR_SPECIFIER ("toolbar-buttons-captioned-p", &Vtoolbar_buttons_captioned_p /*
--- a/src/toolbar.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/toolbar.h Mon Aug 13 10:28:48 2007 +0200 @@ -100,11 +100,11 @@ #define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button) #define CONCHECK_TOOLBAR_BUTTON(x) CONCHECK_RECORD (x, toolbar_button) -extern void get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x, - int *y, int *width, int *height, int *vert, - int for_layout); -extern Lisp_Object toolbar_button_at_pixpos (struct frame *f, int x_coord, - int y_coord); +void get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x, + int *y, int *width, int *height, int *vert, + int for_layout); +Lisp_Object toolbar_button_at_pixpos (struct frame *f, int x_coord, + int y_coord); DECLARE_SPECIFIER_TYPE (toolbar); #define XTOOLBAR_SPECIFIER(x) XSPECIFIER_TYPE (x, toolbar) #define XSETTOOLBAR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, toolbar)
--- a/src/tooltalk.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/tooltalk.c Mon Aug 13 10:28:48 2007 +0200 @@ -28,7 +28,6 @@ #include "lisp.h" #include <X11/Xlib.h> -#include TT_C_H_PATH #include "buffer.h" #include "elhash.h" @@ -151,13 +150,6 @@ Tt_message m; }; -static Lisp_Object mark_tooltalk_message (Lisp_Object, void (*) (Lisp_Object)); -static void print_tooltalk_message (Lisp_Object, Lisp_Object, int); -DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-message", tooltalk_message, - mark_tooltalk_message, print_tooltalk_message, - 0, 0, 0, - struct Lisp_Tooltalk_Message); - static Lisp_Object mark_tooltalk_message (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -181,13 +173,18 @@ write_c_string (buf, printcharfun); } +DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-message", tooltalk_message, + mark_tooltalk_message, print_tooltalk_message, + 0, 0, 0, + struct Lisp_Tooltalk_Message); + static Lisp_Object make_tooltalk_message (Tt_message m) { + Lisp_Object val; struct Lisp_Tooltalk_Message *msg = alloc_lcrecord_type (struct Lisp_Tooltalk_Message, lrecord_tooltalk_message); - Lisp_Object val; msg->m = m; msg->callback = Qnil; @@ -227,13 +224,6 @@ Tt_pattern p; }; -static Lisp_Object mark_tooltalk_pattern (Lisp_Object, void (*) (Lisp_Object)); -static void print_tooltalk_pattern (Lisp_Object, Lisp_Object, int); -DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-pattern", tooltalk_pattern, - mark_tooltalk_pattern, print_tooltalk_pattern, - 0, 0, 0, - struct Lisp_Tooltalk_Pattern); - static Lisp_Object mark_tooltalk_pattern (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -257,6 +247,11 @@ write_c_string (buf, printcharfun); } +DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-pattern", tooltalk_pattern, + mark_tooltalk_pattern, print_tooltalk_pattern, + 0, 0, 0, + struct Lisp_Tooltalk_Pattern); + static Lisp_Object make_tooltalk_pattern (Tt_pattern p) {
--- a/src/tooltalk.doc Mon Aug 13 10:27:41 2007 +0200 +++ b/src/tooltalk.doc Mon Aug 13 10:28:48 2007 +0200 @@ -7,18 +7,18 @@ if needed. The Lisp interface departs from the C API in a few ways: - Tooltalk is initialized automatically at emacs startup-time. Messages -can only be sent other Tooltalk applications connected to the same -X11 server that emacs is running on. +can only be sent other Tooltalk applications connected to the same +X11 server that emacs is running on. - There are fewer entry points, polymorphic functions with keyword arguments are used instead. - The callback interface is simpler and marginally less functional. -A single callback may be associated with a message or a pattern, +A single callback may be associated with a message or a pattern, the callback is specified with a Lisp symbol (the symbol should have a function binding). -- The session attribute for messages and patterns is always +- The session attribute for messages and patterns is always initialized to the default session. - Anywhere a Tooltalk enum constant, e.g. TT_SESSION, is valid one @@ -30,7 +30,7 @@ Here's a simple example of a handler for a message that tells emacs to display a string in the mini-buffer area. The message -operation is called "emacs-display-string", it's first (0th) argument +operation is called "emacs-display-string", its first (0th) argument is the string to display: (defun tooltalk-display-string-handler (msg) @@ -49,7 +49,7 @@ * Example: Sending Messages Here's a simple example that sends a query to another application -and then displays it's reply. Both the query and the reply are +and then displays its reply. Both the query and the reply are stored in the first argument of the message. (defun tooltalk-random-query-handler (msg) @@ -61,8 +61,8 @@ (message "Random query turns up nothing"))))) (defvar random-query-message - '( class TT_REQUEST - scope TT_SESSION + '( class TT_REQUEST + scope TT_SESSION address TT_PROCEDURE op "random-query" args '((TT_INOUT "?" "string")) @@ -79,11 +79,11 @@ (make-tooltalk-message attributes) Create a tooltalk message and initialize its attributes. -The value of attributes must be a list of alternating keyword/values, -where keywords are symbols that name valid message attributes. +The value of attributes must be a list of alternating keyword/values, +where keywords are symbols that name valid message attributes. For example: - (make-tooltalk-message + (make-tooltalk-message '(class TT_NOTICE scope TT_SESSION address TT_PROCEDURE @@ -91,7 +91,7 @@ args ("arg1" 12345 (TT_INOUT "arg3" "string")))) Values must always be strings, integers, or symbols that -represent Tooltalk constants. Attribute names are the same as +represent Tooltalk constants. Attribute names are the same as those supported by set-tooltalk-message-attribute, plus 'args. The value of args should be a list of message arguments where @@ -99,13 +99,13 @@ (mode [value [type]]) or just value -Where mode is one of TT_IN, TT_OUT, TT_INOUT and type is a string. -If type isn't specified then "int" is used if the value is a +Where mode is one of TT_IN, TT_OUT, TT_INOUT and type is a string. +If type isn't specified then "int" is used if the value is a number otherwise "string" is used. If type is "string" then value is converted to a string (if it isn't a string already) with -prin1-to-string. If only a value is specified then mode defaults +prin1-to-string. If only a value is specified then mode defaults to TT_IN. If mode is TT_OUT then value and type don't need -to be specified. You can find out more about the semantics and +to be specified. You can find out more about the semantics and uses of ToolTalk message arguments in chapter 4 of the Tooltalk Programmers Guide. @@ -113,7 +113,7 @@ (send-tooltalk-message msg) -Send the message on it's way. Once the message has been sent it's +Send the message on its way. Once the message has been sent it's almost always a good idea to get rid of it with destroy-tooltalk-message. @@ -137,11 +137,11 @@ represented by fixnums (small integers), opnum is converted to a string, and disposition is converted to a fixnum. We convert opnum (a C int) to a string, e.g. 123 => \"123\" because there's no guarantee that opnums will fit -within the range of Emacs Lisp integers. +within the range of Emacs Lisp integers. [TBD] Use the 'plist attribute instead of C API 'user attribute -for user defined message data. To retrieve the value of a message property -specify the indicator for argn. For example to get the value of a property +for user defined message data. To retrieve the value of a message property +specify the indicator for argn. For example to get the value of a property called 'rflagg, use (get-tooltalk-message-attribute msg 'plist 'rflag) @@ -150,7 +150,7 @@ 'arg_ival (integers), or 'arg_bval (strings with embedded nulls), attributes. Because integer valued arguments can be larger than Emacs Lisp integers 'arg_ival yields a string. If the value is will fit within 24 bits then -convert it to an integer with string-to-int. For example to get the integer +convert it to an integer with string-to-int. For example to get the integer value of the third argument: (string-to-int (get-tooltalk-message-attribute msg 'arg_ival 2)) @@ -158,7 +158,7 @@ As you can see, argument numbers are zero based. The type of each arguments can be retrieved, with the 'arg_type attribute, however Tooltalk doesn't define any semantics for the string value of 'arg_type. Conventionally -"string" is used for strings and "int" for 32 bit integers. Note that +"string" is used for strings and "int" for 32 bit integers. Note that Emacs Lisp stores the lengths of strings explicitly (unlike C) so treating the value returned by 'arg_bval like a string is fine. @@ -169,7 +169,7 @@ Initialize one ToolTalk message attribute. -Attribue names and values are the same as for get-tooltalk-message-attribute. +Attribue names and values are the same as for get-tooltalk-message-attribute. A property list is provided for user data (instead of the 'user message attribute), see get-tooltalk-message-attribute. @@ -180,7 +180,7 @@ changed to TT_HANDLED (or TT_FAILED), so that reply argument values can be used. -If one of the argument attributes is specified, 'arg_val, 'arg_ival, or +If one of the argument attributes is specified, 'arg_val, 'arg_ival, or 'arg_bval then argn must be the number of an already created argument. Arguments can be added to a message with add-tooltalk-message-arg. @@ -211,7 +211,7 @@ (destroy-tooltalk-message msg) Apply tt_message_destroy to the message. It's not necessary -to destroy messages after they've been proccessed by a message or +to destroy messages after they've been proccessed by a message or pattern callback, the Lisp/Tooltalk callback machinery does this for you. @@ -223,37 +223,37 @@ (make-tooltalk-pattern attributes) Create a tooltalk pattern and initialize its attributes. -The value of attributes must be a list of alternating keyword/values, +The value of attributes must be a list of alternating keyword/values, where keywords are symbols that name valid pattern attributes or lists of valid attributes. For example: - (make-tooltalk-pattern + (make-tooltalk-pattern '(category TT_OBSERVE scope TT_SESSION op ("operation1" "operation2") args ("arg1" 12345 (TT_INOUT "arg3" "string")))) -Attribute names are the same as those supported by +Attribute names are the same as those supported by add-tooltalk-pattern-attribute, plus 'args. Values must always be strings, integers, or symbols that -represent Tooltalk constants or lists of same. When a list -of values is provided all of the list elements are added to +represent Tooltalk constants or lists of same. When a list +of values is provided all of the list elements are added to the attribute. In the example above, messages whose op attribute is "operation1" or "operation2" would match the pattern. -The value of args should be a list of pattern arguments where +The value of args should be a list of pattern arguments where each pattern argument has the following form: (mode [value [type]]) or just value -Where mode is one of TT_IN, TT_OUT, TT_INOUT and type is a string. -If type isn't specified then "int" is used if the value is a +Where mode is one of TT_IN, TT_OUT, TT_INOUT and type is a string. +If type isn't specified then "int" is used if the value is a number otherwise "string" is used. If type is "string" then value is converted to a string (if it isn't a string already) with -prin1-to-string. If only a value is specified then mode defaults +prin1-to-string. If only a value is specified then mode defaults to TT_IN. If mode is TT_OUT then value and type don't need -to be specified. You can find out more about the semantics and +to be specified. You can find out more about the semantics and uses of ToolTalk pattern arguments in chapter 3 of the Tooltalk Programmers Guide. @@ -273,24 +273,24 @@ (add-tooltalk-pattern-attribute value pat indicator) Add one value to the indicated pattern attribute. The names of attributes -are the same as the Tooltalk accessors used to set them less the -"tooltalk_pattern_" prefix and the "_add" suffix). For example -the name of the attribute for tt_pattern_dispostion_add attribute -is 'disposition. The 'category attribute is handled specially, +are the same as the Tooltalk accessors used to set them less the +"tooltalk_pattern_" prefix and the "_add" suffix). For example +the name of the attribute for tt_pattern_dispostion_add attribute +is 'disposition. The 'category attribute is handled specially, since a pattern can only be a member of one category (TT_OBSERVE or TT_HANDLE. Callbacks are handled slightly differently than in the C Tooltalk API. The value of callback should be the name of a function of one argument. -It will be called each time the pattern matches an incoming message. +It will be called each time the pattern matches an incoming message. (add-tooltalk-pattern-arg pat mode type value) -Add one, fully specified, argument to a tooltalk pattern. Mode must +Add one, fully specified, argument to a tooltalk pattern. Mode must be one of TT_IN, TT_INOUT, or TT_OUT, type must be a string. -Value can be an integer, string or nil. If value is an integer then +Value can be an integer, string or nil. If value is an integer then an integer argument (tt_pattern_iarg_add) added otherwise a string argument is added. At present there's no way to add a binary data argument. @@ -323,7 +323,7 @@ - Message and patterns should support a plist attribute. This would be based on one more Tooltalk user data key. This would also make -it useful to apply the message and pattern callbacks to +it useful to apply the message and pattern callbacks to both the message and the matching pattern.
--- a/src/tooltalk.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/tooltalk.h Mon Aug 13 10:28:48 2007 +0200 @@ -24,6 +24,7 @@ #ifndef _XEMACS_TOOLTALK_H_ #define _XEMACS_TOOLTALK_H_ +#include TT_C_H_PATH struct Lisp_Tooltalk_Message; DECLARE_LRECORD (tooltalk_message, struct Lisp_Tooltalk_Message); @@ -44,8 +45,10 @@ #define TOOLTALK_MESSAGE_KEY 100 #define TOOLTALK_PATTERN_KEY 101 -#define CHECK_TOOLTALK_CONSTANT(x) \ - { if ((!INTP (x)) && (!SYMBOLP (x))) x = wrong_type_argument (Qsymbolp, (x)); } +#define CHECK_TOOLTALK_CONSTANT(x) do { \ + if (!(INTP (x) || SYMBOLP (x))) \ + dead_wrong_type_argument (Qsymbolp, (x)); \ +} while (0) #define VALID_TOOLTALK_MESSAGEP(m) \ (m && (tt_ptr_error (m) == TT_OK)) @@ -53,8 +56,8 @@ #define VALID_TOOLTALK_PATTERNP(p) \ (p && (tt_ptr_error (p) == TT_OK)) -extern Lisp_Object box_tooltalk_message (Tt_message m); -extern Tt_message unbox_tooltalk_message (Lisp_Object msg); +Lisp_Object box_tooltalk_message (Tt_message m); +Tt_message unbox_tooltalk_message (Lisp_Object msg); extern Lisp_Object Qtooltalk_error;
--- a/src/unexapollo.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/unexapollo.c Mon Aug 13 10:28:48 2007 +0200 @@ -22,7 +22,7 @@ /* Written by Leonard N. Zubkoff. */ -#include "config.h" +#include <config.h> #include <fcntl.h>
--- a/src/unexelf.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/unexelf.c Mon Aug 13 10:28:48 2007 +0200 @@ -436,7 +436,7 @@ #define fatal(a, b, c) fprintf (stderr, a, b, c), exit (1) #else #include <config.h> -extern void fatal (char *, ...); +extern void fatal (CONST char *, ...); #endif #ifndef ELF_BSS_SECTION_NAME @@ -446,7 +446,7 @@ /* Get the address of a particular section or program header entry, * accounting for the size of the entries. */ -/* +/* On PPC Reference Platform running Solaris 2.5.1 the plt section is also of type NOBI like the bss section. (not really stored) and therefore sections after the bss @@ -455,7 +455,7 @@ Thus, we modify the test from if (NEW_SECTION_H (nn).sh_offset >= new_data2_offset) to - if (NEW_SECTION_H (nn).sh_offset >= + if (NEW_SECTION_H (nn).sh_offset >= OLD_SECTION_H (old_bss_index-1).sh_offset) This is just a hack. We should put the new data section before the .plt section. @@ -670,7 +670,7 @@ for (n = new_file_h->e_phnum - 1; n >= 0; n--) { /* Compute maximum of all requirements for alignment of section. */ - int alignment = (NEW_PROGRAM_H (n)).p_align; + ElfW(Word) alignment = (NEW_PROGRAM_H (n)).p_align; if ((OLD_SECTION_H (old_bss_index)).sh_addralign > alignment) alignment = OLD_SECTION_H (old_bss_index).sh_addralign;
--- a/src/unexhp9k800.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/unexhp9k800.c Mon Aug 13 10:28:48 2007 +0200 @@ -26,25 +26,25 @@ area with the current data area. When the new file is executed, the process will see the same data structures and data values that the original process had when unexec was called. - + Unlike other versions of unexec, this one copies symbol table and debug information to the new a.out file. Thus, the new a.out file may be debugged with symbolic debuggers. - + If you fix any bugs in this, I'd like to incorporate your fixes. Send them to uunet!hpda!hpsemc!jmorris or jmorris%hpsemc@hplabs.HP.COM. - + CAVEATS: This routine saves the current value of all static and external variables. This means that any data structure that needs to be initialized must be explicitly reset. Variables will not have their expected default values. - + Unfortunately, the HP-UX signal handler has internal initialization flags which are not explicitly reset. Thus, for signals to work in conjunction with this routine, the following code must executed when the new process starts up. - + void _sigreturn(); ... sigsetreturn(_sigreturn); @@ -75,7 +75,7 @@ * current VM implementation. * * 3. Any setup that defines HPUX_USE_SHLIBS *must* also define - * RUN_TIME_REMAP. + * RUN_TIME_REMAP. */ #ifdef HPUX_USE_SHLIBS @@ -87,28 +87,36 @@ #define roundup(x,n) ( ( (x)+(n-1) ) & ~(n-1) ) /* n is power of 2 */ #define min(x,y) ( ((x)<(y))?(x):(y) ) +void write_header(int file, struct header *hdr, struct som_exec_auxhdr *auxhdr); +void read_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr); +void save_data_space (int file, struct header *hdr, + struct som_exec_auxhdr *auxhdr, int size); +void copy_rest (int old, int new); +void copy_file (int old, int new, int size); +void update_file_ptrs(int file, struct header *hdr, + struct som_exec_auxhdr *auxhdr, + unsigned int location, int offset); /* Create a new a.out file, same as old but with current data space */ - -unexec(new_name, old_name, new_end_of_text, dummy1, dummy2) - char new_name[]; /* name of the new a.out file to be created */ - char old_name[]; /* name of the old a.out file */ - char *new_end_of_text; /* ptr to new edata/etext; NOT USED YET */ - int dummy1, dummy2; /* not used by emacs */ +int +unexec(char new_name[], /* name of the new a.out file to be created */ + char old_name[], /* name of the old a.out file */ + char *new_end_of_text, /* ptr to new edata/etext; NOT USED YET */ + int dummy1, int dummy2) /* not used by emacs */ { int old, new; int old_size, new_size; struct header hdr; struct som_exec_auxhdr auxhdr; long i; - + /* For the greatest flexibility, should create a temporary file in the same directory as the new file. When everything is complete, rename the temp file to the new name. This way, a program could update its own a.out file even while it is still executing. If problems occur, everything is still intact. NOT implemented. */ - + /* Open the input and output a.out files */ old = open (old_name, O_RDONLY); if (old < 0) @@ -116,10 +124,10 @@ new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777); if (new < 0) { perror(new_name); exit(1); } - + /* Read the old headers */ read_header(old, &hdr, &auxhdr); - + #ifdef HPUX_USE_SHLIBS Save_Shared_Data(); /* Save break value (added: dg@hplb.hpl.hp.com) */ #endif @@ -129,24 +137,24 @@ to avoid a compiler bug in hpux version 8. */ i = (long) sbrk (0); new_size = i - auxhdr.exec_dmem; - + /* Copy the old file to the new, up to the data space */ lseek(old, 0, 0); copy_file(old, new, auxhdr.exec_dfile); - + /* Skip the old data segment and write a new one */ lseek(old, old_size, 1); save_data_space(new, &hdr, &auxhdr, new_size); - + /* Copy the rest of the file */ copy_rest(old, new); - + /* Update file pointers since we probably changed size of data area */ update_file_ptrs(new, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size); - + /* Save the modified header */ write_header(new, &hdr, &auxhdr); - + /* Close the binary file */ close (old); close (new); @@ -155,16 +163,14 @@ /* Save current data space in the file, update header. */ -save_data_space(file, hdr, auxhdr, size) - int file; - struct header *hdr; - struct som_exec_auxhdr *auxhdr; - int size; +void +save_data_space (int file, struct header *hdr, + struct som_exec_auxhdr *auxhdr, int size) { /* Write the entire data space out to the file */ if (write(file, (void *)auxhdr->exec_dmem, size) != size) { perror("Can't save new data space"); exit(1); } - + /* Update the header to reflect the new data size */ auxhdr->exec_dsize = size; auxhdr->exec_bsize = 0; @@ -172,19 +178,17 @@ /* Update the values of file pointers when something is inserted. */ -update_file_ptrs(file, hdr, auxhdr, location, offset) - int file; - struct header *hdr; - struct som_exec_auxhdr *auxhdr; - unsigned int location; - int offset; +void +update_file_ptrs(int file, struct header *hdr, + struct som_exec_auxhdr *auxhdr, + unsigned int location, int offset) { struct subspace_dictionary_record subspace; int i; - + /* Increase the overall size of the module */ hdr->som_length += offset; - + /* Update the various file pointers in the header */ #define update(ptr) if (ptr > location) ptr = ptr + offset update(hdr->aux_header_location); @@ -197,16 +201,16 @@ update(hdr->unloadable_sp_location); update(auxhdr->exec_tfile); update(auxhdr->exec_dfile); - + /* Do for each subspace dictionary entry */ lseek(file, hdr->subspace_location, 0); for (i = 0; i < hdr->subspace_total; i++) { if (read(file, &subspace, sizeof(subspace)) != sizeof(subspace)) { perror("Can't read subspace record"); exit(1); } - + /* If subspace has a file location, update it */ - if (subspace.initialization_length > 0 + if (subspace.initialization_length > 0 && subspace.file_loc_init_value > location) { subspace.file_loc_init_value += offset; @@ -214,8 +218,8 @@ if (write(file, &subspace, sizeof(subspace)) != sizeof(subspace)) { perror("Can't update subspace record"); exit(1); } } - } - + } + /* Do for each initialization pointer record */ /* (I don't think it applies to executable files, only relocatables) */ #undef update @@ -223,42 +227,37 @@ /* Read in the header records from an a.out file. */ -read_header(file, hdr, auxhdr) - int file; - struct header *hdr; - struct som_exec_auxhdr *auxhdr; +void +read_header(int file, struct header *hdr, struct som_exec_auxhdr *auxhdr) { - + /* Read the header in */ lseek(file, 0, 0); if (read(file, hdr, sizeof(*hdr)) != sizeof(*hdr)) { perror("Couldn't read header from a.out file"); exit(1); } - + if (hdr->a_magic != EXEC_MAGIC && hdr->a_magic != SHARE_MAGIC && hdr->a_magic != DEMAND_MAGIC) { - fprintf(stderr, "a.out file doesn't have legal magic number\n"); - exit(1); + fprintf(stderr, "a.out file doesn't have legal magic number\n"); + exit(1); } - + lseek(file, hdr->aux_header_location, 0); if (read(file, auxhdr, sizeof(*auxhdr)) != sizeof(*auxhdr)) { perror("Couldn't read auxiliary header from a.out file"); exit(1); - } + } } /* Write out the header records into an a.out file. */ - -write_header(file, hdr, auxhdr) - int file; - struct header *hdr; - struct som_exec_auxhdr *auxhdr; +void +write_header(int file, struct header *hdr, struct som_exec_auxhdr *auxhdr) { /* Update the checksum */ hdr->checksum = calculate_checksum(hdr); - + /* Write the header back into the a.out file */ lseek(file, 0, 0); if (write(file, hdr, sizeof(*hdr)) != sizeof(*hdr)) @@ -269,29 +268,26 @@ } /* Calculate the checksum of a SOM header record. */ - -calculate_checksum(hdr) - struct header *hdr; +int +calculate_checksum(struct header *hdr) { int checksum, i, *ptr; - + checksum = 0; ptr = (int *) hdr; - + for (i=0; i<sizeof(*hdr)/sizeof(int)-1; i++) checksum ^= ptr[i]; - + return(checksum); } /* Copy size bytes from the old file to the new one. */ - -copy_file(old, new, size) - int new, old; - int size; +void +copy_file (int old, int new, int size) { int len; int buffer[8192]; /* word aligned will be faster */ - + for (; size > 0; size -= len) { len = min(size, sizeof(buffer)); @@ -303,29 +299,26 @@ } /* Copy the rest of the file, up to EOF. */ - -copy_rest(old, new) - int new, old; +void +copy_rest (int old, int new) { int buffer[4096]; int len; - + /* Copy bytes until end of file or error */ while ( (len = read(old, buffer, sizeof(buffer))) > 0) if (write(new, buffer, len) != len) break; - + if (len != 0) { perror("Unable to copy the rest of the file"); exit(1); } } #ifdef DEBUG -display_header(hdr, auxhdr) - struct header *hdr; - struct som_exec_auxhdr *auxhdr; +display_header(struct header *hdr, struct som_exec_auxhdr *auxhdr) { /* Display the header information (debug) */ printf("\n\nFILE HEADER\n"); - printf("magic number %d \n", hdr->a_magic); + printf("magic number %d \n", hdr->a_magic); printf("text loc %.8x size %d \n", auxhdr->exec_tmem, auxhdr->exec_tsize); printf("data loc %.8x size %d \n", auxhdr->exec_dmem, auxhdr->exec_dsize); printf("entry %x \n", auxhdr->exec_entry); @@ -347,7 +340,7 @@ void Save_Shared_Data () { Brk_On_Dump = sbrk( 0 ); } - + void Restore_Shared_Data () { brk ( Brk_On_Dump ); } @@ -357,6 +350,6 @@ } /* run_time_remap is the magic called by startup code in the dumped executable - * if RUN_TIME_REMAP is set. + * if RUN_TIME_REMAP is set. */ #endif /* HPUX_USE_SHLIBS */
--- a/src/window.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/window.c Mon Aug 13 10:28:48 2007 +0200 @@ -38,22 +38,18 @@ #include "window.h" #include "commands.h" -Lisp_Object Qwindowp, Qwindow_live_p; -Lisp_Object Qwindow_configurationp; -Lisp_Object Qscroll_up; -Lisp_Object Qscroll_down; -Lisp_Object Qdisplay_buffer; +Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configurationp; +Lisp_Object Qscroll_up, Qscroll_down, Qdisplay_buffer; #ifdef MEMORY_USAGE_STATS -Lisp_Object Qface_cache; -Lisp_Object Qglyph_cache; -Lisp_Object Qline_start_cache; +Lisp_Object Qface_cache, Qglyph_cache, Qline_start_cache, Qother_redisplay; #ifdef HAVE_SCROLLBARS Lisp_Object Qscrollbar_instances; #endif -Lisp_Object Qother_redisplay; #endif +EXFUN (Fnext_window, 4); + static int window_pixel_width_to_char_width (struct window *w, int pixel_width, int include_margins_p); @@ -70,7 +66,6 @@ int inpixels); static int window_displayed_pixel_height (struct window *); - /* Thickness of shadow border around 3d modelines. */ Lisp_Object Vmodeline_shadow_thickness; @@ -129,13 +124,6 @@ } while (0) -static Lisp_Object mark_window (Lisp_Object, void (*) (Lisp_Object)); -static void print_window (Lisp_Object, Lisp_Object, int); -static void finalize_window (void *header, int for_disksave); -DEFINE_LRECORD_IMPLEMENTATION ("window", window, - mark_window, print_window, finalize_window, - 0, 0, struct window); - #define MARK_DISP_VARIABLE(field) \ ((markobj) (window->field[CURRENT_DISP])); \ ((markobj) (window->field[DESIRED_DISP])); \ @@ -263,6 +251,11 @@ } } +DEFINE_LRECORD_IMPLEMENTATION ("window", window, + mark_window, print_window, finalize_window, + 0, 0, struct window); + + #define INIT_DISP_VARIABLE(field, initialization) \ p->field[CURRENT_DISP] = initialization; \ p->field[DESIRED_DISP] = initialization; \ @@ -280,7 +273,7 @@ Lisp_Object allocate_window (void) { - Lisp_Object val = Qnil; + Lisp_Object val; struct window *p = alloc_lcrecord_type (struct window, lrecord_window); zero_lcrecord (p); @@ -326,6 +319,7 @@ p->toolbar_size[1] = Qnil; p->toolbar_size[2] = Qnil; p->toolbar_size[3] = Qnil; + p->toolbar_buttons_captioned_p = Qnil; #endif p->minimum_line_ascent = Qnil; p->minimum_line_descent = Qnil; @@ -334,9 +328,6 @@ #ifdef HAVE_MENUBARS p->menubar_visible_p = Qnil; #endif -#ifdef HAVE_TOOLBARS - p->toolbar_buttons_captioned_p = Qnil; -#endif p->text_cursor_visible_p = Qnil; /* end cached specifier values. */ @@ -399,7 +390,7 @@ if (mir) { free_window_mirror (mir); - mir = 0; + mir = NULL; } return mir; } @@ -474,20 +465,26 @@ find_window_mirror_internal (Lisp_Object win, struct window_mirror *rmir, struct window *w) { - struct window_mirror *retval; - for (; !NILP (win); win = XWINDOW (win)->next, rmir = rmir->next) { if (w == XWINDOW (win)) return rmir; - if (!NILP (XWINDOW (win)->vchild) && - (retval = find_window_mirror_internal (XWINDOW (win)->vchild, - rmir->vchild, w))) - return retval; - if (!NILP (XWINDOW (win)->hchild) && - (retval = find_window_mirror_internal (XWINDOW (win)->hchild, - rmir->hchild, w))) - return retval; + + if (!NILP (XWINDOW (win)->vchild)) + { + struct window_mirror *retval = + find_window_mirror_internal (XWINDOW (win)->vchild, + rmir->vchild, w); + if (retval) return retval; + } + + if (!NILP (XWINDOW (win)->hchild)) + { + struct window_mirror *retval = + find_window_mirror_internal (XWINDOW (win)->hchild, + rmir->hchild, w); + if (retval) return retval; + } } return 0; @@ -506,11 +503,9 @@ void free_window_mirror (struct window_mirror *mir) { - struct window_mirror *p; - - p = mir; while (mir) { + struct window_mirror *prev = mir; if (mir->hchild) free_window_mirror (mir->hchild); if (mir->vchild) free_window_mirror (mir->vchild); #ifdef HAVE_SCROLLBARS @@ -518,8 +513,7 @@ #endif free_display_structs (mir); mir = mir->next; - xfree (p); - p = mir; + xfree (prev); } } @@ -528,11 +522,8 @@ Lisp_Object real_window (struct window_mirror *mir, int no_abort) { - Lisp_Object retval; - - retval = real_window_internal (mir->frame->root_window, - mir->frame->root_mirror, mir); - + Lisp_Object retval = real_window_internal (mir->frame->root_window, + mir->frame->root_mirror, mir); if (NILP (retval) && !no_abort) abort (); @@ -557,22 +548,25 @@ position. ****************************************************************************/ struct window * -find_window_by_pixel_pos (unsigned int pix_x, unsigned int pix_y, - Lisp_Object win) +find_window_by_pixel_pos (int pix_x, int pix_y, Lisp_Object win) { - struct window *w; - if (NILP (win)) return 0; for (; !NILP (win); win = XWINDOW (win)->next) { - if (!NILP (XWINDOW (win)->vchild) && - (w = find_window_by_pixel_pos (pix_x, pix_y, XWINDOW (win)->vchild))) - return w; - if (!NILP (XWINDOW (win)->hchild) && - (w = find_window_by_pixel_pos (pix_x, pix_y, XWINDOW (win)->hchild))) - return w; + struct window *w; + + if (!NILP (XWINDOW (win)->vchild)) + { + w = find_window_by_pixel_pos (pix_x, pix_y, XWINDOW (win)->vchild); + if (w) return w; + } + if (!NILP (XWINDOW (win)->hchild)) + { + w = find_window_by_pixel_pos (pix_x, pix_y, XWINDOW (win)->hchild); + if (w) return w; + } w = XWINDOW (win); if (pix_x >= WINDOW_LEFT (w) && pix_x <= WINDOW_RIGHT (w) @@ -580,7 +574,7 @@ && pix_y <= WINDOW_BOTTOM (w)) return w; } - return 0; + return NULL; } /* Return a pointer to the display structures for the given window. */ @@ -904,7 +898,7 @@ int window_cwidth = window_char_width (w, 1); int margin_cwidth; int font_width; - Lisp_Object window = Qnil; + Lisp_Object window; /* We might be getting called on a non-leaf. */ if (NILP (w->buffer)) @@ -1125,13 +1119,13 @@ */ (con_dev_or_frame)) { - struct frame *f; - if (NILP (con_dev_or_frame) && NILP (Fselected_device (Qnil))) return Qnil; /* happens at startup */ - f = decode_frame_or_selected (con_dev_or_frame); - return FRAME_SELECTED_WINDOW (f); + { + struct frame *f = decode_frame_or_selected (con_dev_or_frame); + return FRAME_SELECTED_WINDOW (f); + } } DEFUN ("minibuffer-window", Fminibuffer_window, 0, 1, 0, /* @@ -1144,9 +1138,7 @@ */ (con_dev_or_frame)) { - struct frame *f = decode_frame_or_selected (con_dev_or_frame); - - return FRAME_MINIBUF_WINDOW (f); + return FRAME_MINIBUF_WINDOW (decode_frame_or_selected (con_dev_or_frame)); } DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 1, 1, 0, /* @@ -1237,13 +1229,9 @@ (pos, window)) { struct window *w = decode_window (window); - Bufpos top; + Bufpos top = marker_position (w->start[CURRENT_DISP]); Bufpos posint; - struct buffer *buf; - - top = marker_position (w->start[CURRENT_DISP]); - - buf = XBUFFER (w->buffer); + struct buffer *buf = XBUFFER (w->buffer); if (NILP (pos)) posint = BUF_PT (buf); @@ -1260,10 +1248,7 @@ if (top < BUF_BEGV (buf) || top > BUF_ZV (buf)) return Qnil; - if (point_would_be_visible (w, top, posint)) - return Qt; - else - return Qnil; + return point_would_be_visible (w, top, posint) ? Qt : Qnil; } @@ -1311,7 +1296,7 @@ DEFUN ("window-displayed-height", Fwindow_displayed_height, 0, 1, 0, /* Return the number of lines currently displayed in WINDOW. This counts the actual number of lines displayed in WINDOW -(as opposed to `window-height'). The modeline and horizontal +\(as opposed to `window-height'). The modeline and horizontal scrollbar do not count as lines. If there is some blank space between the end of the buffer and the end of the window, this function pretends that there are lines of text in the default @@ -1334,7 +1319,7 @@ DEFUN ("window-displayed-pixel-height", Fwindow_displayed_pixel_height, 0, 1, 0, /* Return the height in pixels of the buffer-displaying portion of WINDOW. Unlike `window-pixel-height', the space occupied by the gutters -(modeline, horizontal scrollbar, ...) is not counted. +\(modeline, horizontal scrollbar, ...) is not counted. */ (window)) { @@ -1368,38 +1353,17 @@ #ifdef MODELINE_IS_SCROLLABLE DEFUN ("modeline-hscroll", Fmodeline_hscroll, 0, 1, 0, /* -Return the number of columns by which WINDOW's modeline is scrolled from +Return the number of columns by which WINDOW's modeline is scrolled from left margin. If the window has no modeline, return nil. */ (window)) { struct window *w; - + w = decode_window (window); return (WINDOW_HAS_MODELINE_P (w)) ? make_int (w->modeline_hscroll) : Qnil; } -#endif - -DEFUN ("set-window-hscroll", Fset_window_hscroll, 2, 2, 0, /* -Set number of columns WINDOW is scrolled from left margin to NCOL. -NCOL should be zero or positive. -*/ - (window, ncol)) -{ - struct window *w; - int ncols; - - CHECK_INT (ncol); - ncols = XINT (ncol); - if (ncols < 0) ncols = 0; - w = decode_window (window); - if (w->hscroll != ncols) - MARK_CLIP_CHANGED; /* FSF marks differently but we aren't FSF. */ - w->hscroll = ncols; - return ncol; -} - -#ifdef MODELINE_IS_SCROLLABLE + DEFUN ("set-modeline-hscroll", Fset_modeline_hscroll, 2, 2, 0, /* Set number of columns WINDOW's modeline is scrolled from left margin to NCOL. NCOL should be zero or positive. If NCOL is negative, it will be forced to 0. @@ -1423,7 +1387,26 @@ } return Qnil; } -#endif +#endif /* MODELINE_IS_SCROLLABLE */ + +DEFUN ("set-window-hscroll", Fset_window_hscroll, 2, 2, 0, /* +Set number of columns WINDOW is scrolled from left margin to NCOL. +NCOL should be zero or positive. +*/ + (window, ncol)) +{ + struct window *w; + int ncols; + + CHECK_INT (ncol); + ncols = XINT (ncol); + if (ncols < 0) ncols = 0; + w = decode_window (window); + if (w->hscroll != ncols) + MARK_CLIP_CHANGED; /* FSF marks differently but we aren't FSF. */ + w->hscroll = ncols; + return ncol; +} #if 0 /* bogus crock */ @@ -1516,18 +1499,13 @@ */ (window, guarantee)) { - Lisp_Object value; struct window *w = decode_window (window); - Lisp_Object buf; if (NILP (guarantee)) { - buf = w->buffer; + Lisp_Object buf = w->buffer; CHECK_BUFFER (buf); - - XSETINT (value, BUF_Z (XBUFFER (buf)) - w->window_end_pos[CURRENT_DISP]); - - return value; + return make_int (BUF_Z (XBUFFER (buf)) - w->window_end_pos[CURRENT_DISP]); } else { @@ -1595,7 +1573,7 @@ */ (window, arg)) { - REGISTER struct window *w = decode_window (window); + struct window *w = decode_window (window); w->dedicated = NILP (arg) ? Qnil : Qt; @@ -2356,7 +2334,7 @@ DEVICE_LOOP_NO_BREAK (devcons, concons) { Lisp_Object device = XCAR (devcons); - Lisp_Object the_frame = Qnil; + Lisp_Object the_frame; if (frame) XSETFRAME (the_frame, frame); @@ -2921,11 +2899,11 @@ default_face_height_and_width (window, &defheight, &defwidth); line_size = (set_height ? defheight : defwidth); + check_min_window_sizes (); + minsize = (set_height ? window_min_height : window_min_width); minsize *= line_size; - check_min_window_sizes (); - if (!nodelete && !TOP_LEVEL_WINDOW_P (w) && new_pixsize < minsize) @@ -3190,7 +3168,7 @@ widen_buffer (b, 0); BUF_SET_PT (b, BUF_BEG (b)); - if (!EQ (Vtemp_buffer_show_function, Qnil)) + if (!NILP (Vtemp_buffer_show_function)) call1 (Vtemp_buffer_show_function, buf); else { @@ -3236,7 +3214,7 @@ static void make_dummy_parent (Lisp_Object window) { - Lisp_Object new = Qnil; + Lisp_Object new; struct window *o = XWINDOW (window); struct window *p = alloc_lcrecord_type (struct window, lrecord_window); @@ -3493,10 +3471,7 @@ #### We need to go through the calling functions and actually do this. */ - if (char_height < 0) - return 0; - else - return char_height; + return max (0, char_height); } static int @@ -3524,10 +3499,7 @@ #### We need to go through the calling functions and actually do this. */ - if (pixel_height < 0) - return 0; - else - return pixel_height; + return max (0, pixel_height); } /* Return number of default lines of text can fit in the window W. @@ -3612,7 +3584,7 @@ } /* - * Return height in pixels of buffer-displaying portion of window w. + * Return height in pixels of buffer-displaying portion of window w. * Does not include the gutters (modeline, scrollbars, ...) */ int @@ -3655,10 +3627,7 @@ #### We need to go through the calling functions and actually do this. */ - if (char_width < 0) - return 0; - else - return char_width; + return max (0, char_width); } static int @@ -3686,10 +3655,7 @@ #### We need to go through the calling functions and actually do this. */ - if (pixel_width < 0) - return 0; - else - return pixel_width; + return max (0, pixel_width); } /* This returns the usable space which doesn't include space needed by @@ -3728,7 +3694,7 @@ int inpixels) { Lisp_Object parent; - Lisp_Object window = Qnil; + Lisp_Object window; struct window *w; struct frame *f; int *sizep; @@ -4225,7 +4191,7 @@ opoint = BUF_PT (b); - if (NILP (n) || CONSP (n)) + if (LISTP (n)) { struct frame *f = XFRAME (w->frame); @@ -4374,10 +4340,9 @@ int (*mapfun) (struct window *w, void *closure), void *closure) { - int retval; - for (; !NILP (window); window = XWINDOW (window)->next) { + int retval; struct window *w = XWINDOW (window); if (!NILP (w->vchild)) @@ -4386,11 +4351,12 @@ retval = map_windows_1 (w->hchild, mapfun, closure); else retval = (mapfun) (w, closure); + if (retval) return retval; } - return retval; + return 0; } /* Map MAPFUN over the windows in F. CLOSURE is passed to each @@ -4481,7 +4447,7 @@ compute_window_usage (struct window *w, struct window_stats *stats, struct overhead_stats *ovstats) { - memset (stats, 0, sizeof (*stats)); + xzero (*stats); stats->other += malloced_storage_size (w, sizeof (struct window), ovstats); stats->face += compute_face_cachel_usage (w->face_cachels, ovstats); stats->glyph += compute_glyph_cachel_usage (w->glyph_cachels, ovstats); @@ -4492,13 +4458,13 @@ DEFUN ("window-memory-usage", Fwindow_memory_usage, 1, 1, 0, /* Return stats about the memory usage of window WINDOW. -The values returned are in the form an alist of usage types and byte +The values returned are in the form of an alist of usage types and byte counts. The byte counts attempt to encompass all the memory used by the window (separate from the memory logically associated with a buffer or frame), including internal structures and any malloc() overhead associated with them. In practice, the byte counts are underestimated because certain memory usage is very hard to determine -(e.g. the amount of memory used inside the Xt library or inside the +\(e.g. the amount of memory used inside the Xt library or inside the X server) and because there is other stuff that might logically be associated with a window, buffer, or frame (e.g. window configurations, glyphs) but should not obviously be included in the usage counts. @@ -4513,32 +4479,26 @@ { struct window_stats stats; struct overhead_stats ovstats; + Lisp_Object val = Qnil; CHECK_WINDOW (window); /* dead windows should be allowed, no? */ - memset (&ovstats, 0, sizeof (ovstats)); + xzero (ovstats); compute_window_usage (XWINDOW (window), &stats, &ovstats); - return nconc2 ( -#ifdef HAVE_SCROLLBARS - list6 -#else - list5 -#endif - (Fcons (Qface_cache, make_int (stats.face)), - Fcons (Qglyph_cache, make_int (stats.glyph)), + val = acons (Qface_cache, make_int (stats.face), val); + val = acons (Qglyph_cache, make_int (stats.glyph), val); #ifdef HAVE_SCROLLBARS - Fcons (Qscrollbar_instances, make_int (stats.scrollbar)), + val = acons (Qscrollbar_instances, make_int (stats.scrollbar), val); #endif - Fcons (Qline_start_cache, make_int (stats.line_start)), - Fcons (Qother_redisplay, make_int (stats.other_redisplay)), - Fcons (Qother, make_int (stats.other))), - list4 (Qnil, - Fcons (Qactually_requested, - make_int (ovstats.was_requested)), - Fcons (Qmalloc_overhead, - make_int (ovstats.malloc_overhead)), - Fcons (Qdynarr_overhead, - make_int (ovstats.dynarr_overhead)))); + val = acons (Qline_start_cache, make_int (stats.line_start), val); + val = acons (Qother_redisplay, make_int (stats.other_redisplay), val); + val = acons (Qother, make_int (stats.other), val); + val = Fcons (Qnil, val); + val = acons (Qactually_requested, make_int (ovstats.was_requested), val); + val = acons (Qmalloc_overhead, make_int (ovstats.malloc_overhead), val); + val = acons (Qdynarr_overhead, make_int (ovstats.dynarr_overhead), val); + + return Fnreverse (val); } #endif /* MEMORY_USAGE_STATS */ @@ -4621,25 +4581,14 @@ /* Zero-sized arrays aren't ANSI C */ struct saved_window saved_windows[1]; }; + #define SAVED_WINDOW_N(conf, n) (&((conf)->saved_windows[(n)])) - -static Lisp_Object mark_window_config (Lisp_Object, void (*) (Lisp_Object)); -static void print_window_config (Lisp_Object, Lisp_Object, int); -static unsigned int sizeof_window_config (CONST void *); - #define XWINDOW_CONFIGURATION(x) XRECORD (x, window_configuration, struct window_config) #define XSETWINDOW_CONFIGURATION(x, p) XSETRECORD (x, p, window_configuration) #define WINDOW_CONFIGURATIONP(x) RECORDP (x, window_configuration) #define GC_WINDOW_CONFIGURATIONP(x) GC_RECORDP (x, window_configuration) #define CHECK_WINDOW_CONFIGURATION(x) CHECK_RECORD (x, window_configuration) -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("window-configuration", - window_configuration, - mark_window_config, - print_window_config, - 0, 0, 0, sizeof_window_config, - struct window_config); - static Lisp_Object mark_window_config (Lisp_Object obj, void (*markobj) (Lisp_Object)) { @@ -4664,7 +4613,7 @@ return Qnil; } -static int +static size_t sizeof_window_config_for_n_windows (int n) { return (sizeof (struct window_config) + @@ -4672,7 +4621,7 @@ (n - 1) *sizeof (struct saved_window)); } -static unsigned int +static size_t sizeof_window_config (CONST void *h) { CONST struct window_config *c = (CONST struct window_config *) h; @@ -4692,6 +4641,14 @@ write_c_string (buf, printcharfun); } +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("window-configuration", + window_configuration, + mark_window_config, + print_window_config, + 0, 0, 0, sizeof_window_config, + struct window_config); + + /* Returns a boolean indicating whether the two saved windows are identical. */ static int @@ -4793,7 +4750,7 @@ } DEFUN ("window-configuration-p", Fwindow_configuration_p, 1, 1, 0, /* -T if OBJECT is a window-configuration object. +Return t if OBJECT is a window-configuration object. */ (obj)) { @@ -5245,12 +5202,9 @@ void delete_all_subwindows (struct window *w) { - if (!NILP (w->next)) - delete_all_subwindows (XWINDOW (w->next)); - if (!NILP (w->vchild)) - delete_all_subwindows (XWINDOW (w->vchild)); - if (!NILP (w->hchild)) - delete_all_subwindows (XWINDOW (w->hchild)); + if (!NILP (w->next)) delete_all_subwindows (XWINDOW (w->next)); + if (!NILP (w->vchild)) delete_all_subwindows (XWINDOW (w->vchild)); + if (!NILP (w->hchild)) delete_all_subwindows (XWINDOW (w->hchild)); mark_window_as_deleted (w); } @@ -5259,14 +5213,10 @@ static int count_windows (struct window *window) { - int count = 1; - if (!NILP (window->next)) - count += count_windows (XWINDOW (window->next)); - if (!NILP (window->vchild)) - count += count_windows (XWINDOW (window->vchild)); - if (!NILP (window->hchild)) - count += count_windows (XWINDOW (window->hchild)); - return count; + return 1 + + (!NILP (window->next) ? count_windows (XWINDOW (window->next)) : 0) + + (!NILP (window->vchild) ? count_windows (XWINDOW (window->vchild)) : 0) + + (!NILP (window->hchild) ? count_windows (XWINDOW (window->hchild)) : 0); } static int @@ -5277,7 +5227,7 @@ { if (EQ (SAVED_WINDOW_N (config, j)->window, window)) return j; - } + } abort (); return 0; /* suppress compiler warning */ } @@ -5285,14 +5235,13 @@ static int save_window_save (Lisp_Object window, struct window_config *config, int i) { - struct saved_window *p; struct window *w; for (; !NILP (window); window = w->next) { - p = SAVED_WINDOW_N (config, i); + struct saved_window *p = SAVED_WINDOW_N (config, i); + w = XWINDOW (window); - i++; p->window = window; p->buffer = w->buffer; @@ -5406,20 +5355,15 @@ */ (frame)) { - Lisp_Object result = Qnil; - struct frame *f; - int n_windows; - + Lisp_Object result; + struct frame *f = decode_frame (frame); struct window_config *config; - - f = decode_frame (frame); - - n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); + int n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); + if (n_windows <= countof (Vwindow_configuration_free_list)) - config = - XWINDOW_CONFIGURATION (allocate_managed_lcrecord - (Vwindow_configuration_free_list - [n_windows - 1])); + config = XWINDOW_CONFIGURATION (allocate_managed_lcrecord + (Vwindow_configuration_free_list + [n_windows - 1])); else /* More than ten windows; just allocate directly */ config = (struct window_config *) @@ -5474,25 +5418,21 @@ static void debug_print_window (Lisp_Object window, int level) { - Lisp_Object child; - int i = level; - - child = Fwindow_first_vchild (window); + int i; + Lisp_Object child = Fwindow_first_vchild (window); + if (NILP (child)) child = Fwindow_first_hchild (window); - while (i > 0) - { - fprintf (stderr, "\t"); - i--; - } - - fprintf (stderr, "#<window"); - if (!NILP (XWINDOW (window)->buffer) && BUFFERP (XWINDOW (window)->buffer)) - { - struct buffer *b = XBUFFER (XWINDOW (window)->buffer); - fprintf (stderr, " on %s", XSTRING_DATA (b->name)); - } + for (i = level; i > 0; i--) + putc ('\t', stderr); + + fputs ("#<window", stderr); + { + Lisp_Object buffer = XWINDOW (window)->buffer; + if (!NILP (buffer) && BUFFERP (buffer)) + fprintf (stderr, " on %s", XSTRING_DATA (XBUFFER (buffer)->name)); + } fprintf (stderr, " 0x%x>", XWINDOW (window)->header.uid); while (!NILP (child)) @@ -5507,7 +5447,7 @@ debug_print_windows (struct frame *f) { debug_print_window (f->root_window, 0); - fprintf (stderr, "\n"); + putc ('\n', stderr); } #endif /* DEBUG_XEMACS */ @@ -5564,15 +5504,13 @@ DEFSUBR (Fwindow_hscroll); #ifdef MODELINE_IS_SCROLLABLE DEFSUBR (Fmodeline_hscroll); + DEFSUBR (Fset_modeline_hscroll); #endif /* MODELINE_IS_SCROLLABLE */ #if 0 /* bogus crock */ DEFSUBR (Fwindow_redisplay_end_trigger); DEFSUBR (Fset_window_redisplay_end_trigger); #endif DEFSUBR (Fset_window_hscroll); -#ifdef MODELINE_IS_SCROLLABLE - DEFSUBR (Fset_modeline_hscroll); -#endif /* MODELINE_IS_SCROLLABLE */ DEFSUBR (Fwindow_pixel_edges); DEFSUBR (Fwindow_point); DEFSUBR (Fwindow_start);
--- a/src/window.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/window.h Mon Aug 13 10:28:48 2007 +0200 @@ -297,8 +297,6 @@ #define CHECK_WINDOW(x) CHECK_RECORD (x, window) #define CONCHECK_WINDOW(x) CONCHECK_RECORD (x, window) -extern Lisp_Object Qwindow_live_p; - #define WINDOW_LIVE_P(x) (!(x)->dead) #define CHECK_LIVE_WINDOW(x) do { \ CHECK_WINDOW (x); \ @@ -312,7 +310,7 @@ } while (0) /* 1 if W is a minibuffer window. */ -#define MINI_WINDOW_P(W) (!EQ ((W)->mini_p, Qnil)) +#define MINI_WINDOW_P(W) (!NILP ((W)->mini_p)) /* 1 if we are dealing with a parentless window (this includes the root window on a frame and the minibuffer window; both of these @@ -323,7 +321,10 @@ #define MARK_WINDOWS_CHANGED(w) do { \ (w)->windows_changed = 1; \ if (!NILP (w->frame)) \ - MARK_FRAME_WINDOWS_CHANGED (XFRAME (w->frame)); \ + { \ + struct frame *mwc_frame = XFRAME (w->frame); \ + MARK_FRAME_WINDOWS_CHANGED (mwc_frame); \ + } \ else \ windows_changed = 1; \ } while (0) @@ -335,24 +336,32 @@ DECLARE_LRECORD (window_configuration, struct window_config); +EXFUN (Fget_buffer_window, 3); +EXFUN (Fmove_to_window_line, 2); +EXFUN (Frecenter, 2); +EXFUN (Freplace_buffer_in_windows, 1); +EXFUN (Fselect_window, 1); +EXFUN (Fselected_window, 1); +EXFUN (Fset_window_buffer, 2); +EXFUN (Fset_window_hscroll, 2); +EXFUN (Fset_window_point, 2); +EXFUN (Fset_window_start, 3); +EXFUN (Fwindow_buffer, 1); +EXFUN (Fwindow_highest_p, 1); +EXFUN (Fwindow_point, 1); +EXFUN (Fwindow_start, 1); + /* The minibuffer window of the selected frame. Note that you cannot test for minibufferness of an arbitrary window by comparing against this; but you can test for minibufferness of the selected window or of any window that is displayed. */ extern Lisp_Object minibuf_window; -/* Non-nil => window to for C-M-v to scroll - when the minibuffer is selected. */ -extern Lisp_Object Vminibuf_scroll_window; - /* Prompt to display in front of the minibuffer contents, or nil */ extern Lisp_Object Vminibuf_prompt; /* Prompt to display in front of the minibuffer prompt, or nil */ extern Lisp_Object Vminibuf_preprompt; -/* Depth in minibuffer invocations */ -extern int minibuf_level; - Lisp_Object allocate_window (void); int window_char_width (struct window *, int include_margins_p); int window_char_height (struct window *, int include_gutters_p); @@ -383,9 +392,7 @@ int buffer_window_mru (struct window *w); void check_frame_size (struct frame *frame, int *rows, int *cols); struct window *decode_window (Lisp_Object window); -struct window *find_window_by_pixel_pos (unsigned int pix_x, - unsigned int pix_y, - Lisp_Object win); +struct window *find_window_by_pixel_pos (int pix_x, int pix_y, Lisp_Object win); /* new functions to handle the window mirror */ void free_window_mirror (struct window_mirror *mir);
--- a/src/xgccache.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/xgccache.c Mon Aug 13 10:28:48 2007 +0200 @@ -166,7 +166,7 @@ #ifdef GCCACHE_HASH - if (gethash (&gcvm, cache->table, (void **) &cell)) + if (gethash (&gcvm, cache->table, (CONST void **) &cell)) #else /* !GCCACHE_HASH */
--- a/src/xintrinsic.h Mon Aug 13 10:27:41 2007 +0200 +++ b/src/xintrinsic.h Mon Aug 13 10:28:48 2007 +0200 @@ -23,8 +23,4 @@ #include <X11/Intrinsic.h> -#ifdef CONST_IS_LOSING -# define CONST -#else -# define CONST const -#endif +#define CONST const
--- a/src/xmu.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/xmu.c Mon Aug 13 10:28:48 2007 +0200 @@ -31,9 +31,6 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <X11/cursorfont.h> -#if 0 /* mrb */ -#include <X11/Xos.h> -#endif #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Intrinsic.h>
--- a/src/xselect.c Mon Aug 13 10:27:41 2007 +0200 +++ b/src/xselect.c Mon Aug 13 10:28:48 2007 +0200 @@ -33,6 +33,9 @@ #include "opaque.h" #include "systime.h" +int lisp_to_time (Lisp_Object, time_t *); +Lisp_Object time_to_lisp (time_t); + #ifdef LWLIB_USES_MOTIF # define MOTIF_CLIPBOARDS #endif @@ -52,11 +55,6 @@ QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, QATOM_PAIR, QCOMPOUND_TEXT; -#ifdef EPOCH -Lisp_Object QARC, QBITMAP, QCARDINAL, QCURSOR, QDRAWABLE, QFONT, QINTEGER, - QPIXMAP, QPOINT, QRECTANGLE, QWINDOW, QWM_HINTS, QWM_SIZE_HINTS; -#endif /* EPOCH */ - #ifdef CUT_BUFFER_SUPPORT Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3, QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7; @@ -117,7 +115,7 @@ int *format_ret); static Lisp_Object selection_data_to_lisp_data (struct device *, unsigned char *data, - int size, + size_t size, Atom type, int format); static Lisp_Object x_get_window_property_as_lisp_data (Display *, @@ -134,61 +132,44 @@ /* This converts a Lisp symbol to a server Atom, avoiding a server roundtrip whenever possible. */ -Atom +static Atom symbol_to_x_atom (struct device *d, Lisp_Object sym, int only_if_exists) { Display *display = DEVICE_X_DISPLAY (d); - if (NILP (sym)) return XA_PRIMARY; - if (EQ (sym, Qt)) return XA_SECONDARY; - if (EQ (sym, QPRIMARY)) return XA_PRIMARY; - if (EQ (sym, QSECONDARY)) return XA_SECONDARY; - if (EQ (sym, QSTRING)) return XA_STRING; - if (EQ (sym, QINTEGER)) return XA_INTEGER; - if (EQ (sym, QATOM)) return XA_ATOM; - if (EQ (sym, QCLIPBOARD)) return DEVICE_XATOM_CLIPBOARD (d); - if (EQ (sym, QTIMESTAMP)) return DEVICE_XATOM_TIMESTAMP (d); - if (EQ (sym, QTEXT)) return DEVICE_XATOM_TEXT (d); - if (EQ (sym, QDELETE)) return DEVICE_XATOM_DELETE (d); - if (EQ (sym, QMULTIPLE)) return DEVICE_XATOM_MULTIPLE (d); - if (EQ (sym, QINCR)) return DEVICE_XATOM_INCR (d); - if (EQ (sym, QEMACS_TMP)) return DEVICE_XATOM_EMACS_TMP (d); - if (EQ (sym, QTARGETS)) return DEVICE_XATOM_TARGETS (d); - if (EQ (sym, QNULL)) return DEVICE_XATOM_NULL (d); - if (EQ (sym, QATOM_PAIR)) return DEVICE_XATOM_ATOM_PAIR (d); + if (NILP (sym)) return XA_PRIMARY; + if (EQ (sym, Qt)) return XA_SECONDARY; + if (EQ (sym, QPRIMARY)) return XA_PRIMARY; + if (EQ (sym, QSECONDARY)) return XA_SECONDARY; + if (EQ (sym, QSTRING)) return XA_STRING; + if (EQ (sym, QINTEGER)) return XA_INTEGER; + if (EQ (sym, QATOM)) return XA_ATOM; + if (EQ (sym, QCLIPBOARD)) return DEVICE_XATOM_CLIPBOARD (d); + if (EQ (sym, QTIMESTAMP)) return DEVICE_XATOM_TIMESTAMP (d); + if (EQ (sym, QTEXT)) return DEVICE_XATOM_TEXT (d); + if (EQ (sym, QDELETE)) return DEVICE_XATOM_DELETE (d); + if (EQ (sym, QMULTIPLE)) return DEVICE_XATOM_MULTIPLE (d); + if (EQ (sym, QINCR)) return DEVICE_XATOM_INCR (d); + if (EQ (sym, QEMACS_TMP)) return DEVICE_XATOM_EMACS_TMP (d); + if (EQ (sym, QTARGETS)) return DEVICE_XATOM_TARGETS (d); + if (EQ (sym, QNULL)) return DEVICE_XATOM_NULL (d); + if (EQ (sym, QATOM_PAIR)) return DEVICE_XATOM_ATOM_PAIR (d); if (EQ (sym, QCOMPOUND_TEXT)) return DEVICE_XATOM_COMPOUND_TEXT (d); -#ifdef EPOCH - if (EQ (sym, QARC)) return XA_ARC; - if (EQ (sym, QBITMAP)) return XA_BITMAP; - if (EQ (sym, QCARDINAL)) return XA_CARDINAL; - if (EQ (sym, QCURSOR)) return XA_CURSOR; - if (EQ (sym, QDRAWABLE)) return XA_DRAWABLE; - if (EQ (sym, QFONT)) return XA_FONT; - if (EQ (sym, QINTEGER)) return XA_INTEGER; - if (EQ (sym, QPIXMAP)) return XA_PIXMAP; - if (EQ (sym, QPOINT)) return XA_POINT; - if (EQ (sym, QRECTANGLE)) return XA_RECTANGLE; - if (EQ (sym, QWINDOW)) return XA_WINDOW; - if (EQ (sym, QWM_HINTS)) return XA_WM_HINTS; - if (EQ (sym, QWM_SIZE_HINTS)) return XA_WM_SIZE_HINTS; -#endif /* EPOCH */ #ifdef CUT_BUFFER_SUPPORT - if (EQ (sym, QCUT_BUFFER0)) return XA_CUT_BUFFER0; - if (EQ (sym, QCUT_BUFFER1)) return XA_CUT_BUFFER1; - if (EQ (sym, QCUT_BUFFER2)) return XA_CUT_BUFFER2; - if (EQ (sym, QCUT_BUFFER3)) return XA_CUT_BUFFER3; - if (EQ (sym, QCUT_BUFFER4)) return XA_CUT_BUFFER4; - if (EQ (sym, QCUT_BUFFER5)) return XA_CUT_BUFFER5; - if (EQ (sym, QCUT_BUFFER6)) return XA_CUT_BUFFER6; - if (EQ (sym, QCUT_BUFFER7)) return XA_CUT_BUFFER7; + if (EQ (sym, QCUT_BUFFER0)) return XA_CUT_BUFFER0; + if (EQ (sym, QCUT_BUFFER1)) return XA_CUT_BUFFER1; + if (EQ (sym, QCUT_BUFFER2)) return XA_CUT_BUFFER2; + if (EQ (sym, QCUT_BUFFER3)) return XA_CUT_BUFFER3; + if (EQ (sym, QCUT_BUFFER4)) return XA_CUT_BUFFER4; + if (EQ (sym, QCUT_BUFFER5)) return XA_CUT_BUFFER5; + if (EQ (sym, QCUT_BUFFER6)) return XA_CUT_BUFFER6; + if (EQ (sym, QCUT_BUFFER7)) return XA_CUT_BUFFER7; #endif /* CUT_BUFFER_SUPPORT */ { CONST char *nameext; - Lisp_Object namesym; - XSETSTRING (namesym, XSYMBOL (sym)->name); - GET_C_STRING_CTEXT_DATA_ALLOCA (namesym, nameext); + GET_C_STRING_CTEXT_DATA_ALLOCA (Fsymbol_name (sym), nameext); return XInternAtom (display, nameext, only_if_exists ? True : False); } } @@ -197,17 +178,17 @@ /* This converts a server Atom to a Lisp symbol, avoiding server roundtrips and calls to intern whenever possible. */ -Lisp_Object +static Lisp_Object x_atom_to_symbol (struct device *d, Atom atom) { Display *display = DEVICE_X_DISPLAY (d); if (! atom) return Qnil; - if (atom == XA_PRIMARY) return QPRIMARY; - if (atom == XA_SECONDARY) return QSECONDARY; - if (atom == XA_STRING) return QSTRING; - if (atom == XA_INTEGER) return QINTEGER; - if (atom == XA_ATOM) return QATOM; + if (atom == XA_PRIMARY) return QPRIMARY; + if (atom == XA_SECONDARY) return QSECONDARY; + if (atom == XA_STRING) return QSTRING; + if (atom == XA_INTEGER) return QINTEGER; + if (atom == XA_ATOM) return QATOM; if (atom == DEVICE_XATOM_CLIPBOARD (d)) return QCLIPBOARD; if (atom == DEVICE_XATOM_TIMESTAMP (d)) return QTIMESTAMP; if (atom == DEVICE_XATOM_TEXT (d)) return QTEXT; @@ -220,41 +201,26 @@ if (atom == DEVICE_XATOM_ATOM_PAIR (d)) return QATOM_PAIR; if (atom == DEVICE_XATOM_COMPOUND_TEXT (d)) return QCOMPOUND_TEXT; -#ifdef EPOCH - if (atom == XA_ARC) return QARC; - if (atom == XA_BITMAP) return QBITMAP; - if (atom == XA_CARDINAL) return QCARDINAL; - if (atom == XA_CURSOR) return QCURSOR; - if (atom == XA_DRAWABLE) return QDRAWABLE; - if (atom == XA_FONT) return QFONT; - if (atom == XA_INTEGER) return QINTEGER; - if (atom == XA_PIXMAP) return QPIXMAP; - if (atom == XA_POINT) return QPOINT; - if (atom == XA_RECTANGLE) return QRECTANGLE; - if (atom == XA_WINDOW) return QWINDOW; - if (atom == XA_WM_HINTS) return QWM_HINTS; - if (atom == XA_WM_SIZE_HINTS) return QWM_SIZE_HINTS; -#endif /* EPOCH */ #ifdef CUT_BUFFER_SUPPORT - if (atom == XA_CUT_BUFFER0) return QCUT_BUFFER0; - if (atom == XA_CUT_BUFFER1) return QCUT_BUFFER1; - if (atom == XA_CUT_BUFFER2) return QCUT_BUFFER2; - if (atom == XA_CUT_BUFFER3) return QCUT_BUFFER3; - if (atom == XA_CUT_BUFFER4) return QCUT_BUFFER4; - if (atom == XA_CUT_BUFFER5) return QCUT_BUFFER5; - if (atom == XA_CUT_BUFFER6) return QCUT_BUFFER6; - if (atom == XA_CUT_BUFFER7) return QCUT_BUFFER7; + if (atom == XA_CUT_BUFFER0) return QCUT_BUFFER0; + if (atom == XA_CUT_BUFFER1) return QCUT_BUFFER1; + if (atom == XA_CUT_BUFFER2) return QCUT_BUFFER2; + if (atom == XA_CUT_BUFFER3) return QCUT_BUFFER3; + if (atom == XA_CUT_BUFFER4) return QCUT_BUFFER4; + if (atom == XA_CUT_BUFFER5) return QCUT_BUFFER5; + if (atom == XA_CUT_BUFFER6) return QCUT_BUFFER6; + if (atom == XA_CUT_BUFFER7) return QCUT_BUFFER7; #endif { Lisp_Object newsym; - CONST char *intstr; + CONST Bufbyte *intstr; char *str = XGetAtomName (display, atom); if (! str) return Qnil; GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA (str, intstr); - newsym = intern (intstr); + newsym = intern ((char *) intstr); XFree (str); return newsym; } @@ -296,9 +262,9 @@ Opaque pointers are the clean way to go here. */ Lisp_Object selection_time = make_opaque (sizeof (thyme), (void *) &thyme); - Lisp_Object selection_data = Fcons (selection_name, - Fcons (selection_value, - Fcons (selection_time, Qnil))); + Lisp_Object selection_data = list3 (selection_name, + selection_value, + selection_time); Lisp_Object prev_value = assq_no_quit (selection_name, Vselection_alist); Vselection_alist = Fcons (selection_data, Vselection_alist); @@ -371,7 +337,7 @@ #endif XmString fmh; String encoding = "STRING"; - Extbyte *data = XSTRING_DATA (selection_value); + CONST Extbyte *data = XSTRING_DATA (selection_value); Extcount bytes = XSTRING_LENGTH (selection_value); #ifdef MULE @@ -1068,10 +1034,10 @@ return vec; } -#endif +#endif /* 0 */ -static int reading_selection_reply; +static Window reading_selection_reply; static Atom reading_which_selection; static int selection_reply_timed_out; @@ -1117,7 +1083,7 @@ requestor_window, requestor_time); /* Block until the reply has been read. */ - reading_selection_reply = (int) requestor_window; + reading_selection_reply = requestor_window; reading_which_selection = selection_atom; selection_reply_timed_out = 0; @@ -1379,7 +1345,7 @@ static Lisp_Object selection_data_to_lisp_data (struct device *d, unsigned char *data, - int size, + size_t size, Atom type, int format) { @@ -1398,16 +1364,15 @@ */ else if (type == XA_ATOM) { - int i; if (size == sizeof (Atom)) return x_atom_to_symbol (d, *((Atom *) data)); else { - Lisp_Object v = Fmake_vector (make_int (size / sizeof (Atom)), - Qzero); - for (i = 0; i < size / sizeof (Atom); i++) - Faset (v, make_int (i), - x_atom_to_symbol (d, ((Atom *) data) [i])); + int i; + int len = size / sizeof (Atom); + Lisp_Object v = Fmake_vector (make_int (len), Qzero); + for (i = 0; i < len; i++) + Faset (v, make_int (i), x_atom_to_symbol (d, ((Atom *) data) [i])); return v; } } @@ -1441,7 +1406,7 @@ { int i; Lisp_Object v = make_vector (size / 4, Qzero); - for (i = 0; i < size / 4; i++) + for (i = 0; i < (int) size / 4; i++) { int j = (int) ((unsigned short *) data) [i]; Faset (v, make_int (i), make_int (j)); @@ -1452,7 +1417,7 @@ { int i; Lisp_Object v = make_vector (size / 4, Qzero); - for (i = 0; i < size / 4; i++) + for (i = 0; i < (int) size / 4; i++) { unsigned long j = ((unsigned long *) data) [i]; Faset (v, make_int (i), word_to_lisp (j)); @@ -1489,7 +1454,7 @@ } else if (STRINGP (obj)) { - Extbyte *extval; + CONST Extbyte *extval; Extcount extvallen; if (NILP (type)) @@ -1569,7 +1534,7 @@ *size_ret = XVECTOR_LENGTH (obj); *format_ret = 32; *data_ret = (unsigned char *) xmalloc ((*size_ret) * sizeof (Atom)); - for (i = 0; i < *size_ret; i++) + for (i = 0; i < (int) (*size_ret); i++) if (SYMBOLP (XVECTOR_DATA (obj) [i])) (*(Atom **) data_ret) [i] = symbol_to_x_atom (d, XVECTOR_DATA (obj) [i], 0); @@ -1616,7 +1581,7 @@ *size_ret = XVECTOR_LENGTH (obj); if (NILP (type)) type = QINTEGER; *format_ret = 16; - for (i = 0; i < *size_ret; i++) + for (i = 0; i < (int) (*size_ret); i++) if (CONSP (XVECTOR_DATA (obj) [i])) *format_ret = 32; else if (!INTP (XVECTOR_DATA (obj) [i])) @@ -1626,7 +1591,7 @@ obj)); *data_ret = (unsigned char *) xmalloc (*size_ret * (*format_ret/8)); - for (i = 0; i < *size_ret; i++) + for (i = 0; i < (int) (*size_ret); i++) if (*format_ret == 32) (*((unsigned long **) data_ret)) [i] = lisp_to_word (XVECTOR_DATA (obj) [i]); @@ -1810,7 +1775,7 @@ DEFUN ("x-selection-owner-p", Fx_selection_owner_p, 0, 1, 0, /* -Whether the current emacs process owns the given X Selection. +Return t if current emacs process owns the given X Selection. The arg should be the name of the selection in question, typically one of the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, the symbol nil is the same as PRIMARY, and t is the same as SECONDARY.) @@ -1818,10 +1783,10 @@ (selection)) { CHECK_SYMBOL (selection); - if (EQ (selection, Qnil)) selection = QPRIMARY; - if (EQ (selection, Qt)) selection = QSECONDARY; + if (EQ (selection, Qnil)) selection = QPRIMARY; + else if (EQ (selection, Qt)) selection = QSECONDARY; - return NILP (Fassq (selection, Vselection_alist)) ? Qnil: Qt; + return NILP (Fassq (selection, Vselection_alist)) ? Qnil : Qt; } DEFUN ("x-selection-exists-p", Fx_selection_exists_p, 0, 1, 0, /* @@ -1926,7 +1891,7 @@ Display *display = DEVICE_X_DISPLAY (d); Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ Atom cut_buffer_atom; - Extbyte *data = XSTRING_DATA (string); + CONST Extbyte *data = XSTRING_DATA (string); Extcount bytes = XSTRING_LENGTH (string); Extcount bytes_remaining; int max_bytes = SELECTION_QUANTUM (display); @@ -2057,7 +2022,6 @@ defsymbol (&QCLIPBOARD, "CLIPBOARD"); defsymbol (&QTIMESTAMP, "TIMESTAMP"); defsymbol (&QTEXT, "TEXT"); - defsymbol (&QTIMESTAMP, "TIMESTAMP"); defsymbol (&QDELETE, "DELETE"); defsymbol (&QMULTIPLE, "MULTIPLE"); defsymbol (&QINCR, "INCR"); @@ -2068,22 +2032,6 @@ defsymbol (&QCOMPOUND_TEXT, "COMPOUND_TEXT"); defsymbol (&QNULL, "NULL"); -#ifdef EPOCH - defsymbol (&QARC, "ARC"); - defsymbol (&QBITMAP, "BITMAP"); - defsymbol (&QCARDINAL, "CARDINAL"); - defsymbol (&QCURSOR, "CURSOR"); - defsymbol (&QDRAWABLE, "DRAWABLE"); - defsymbol (&QFONT, "FONT"); - defsymbol (&QINTEGER, "INTEGER"); - defsymbol (&QPIXMAP, "PIXMAP"); - defsymbol (&QPOINT, "POINT"); - defsymbol (&QRECTANGLE, "RECTANGLE"); - defsymbol (&QWINDOW, "WINDOW"); - defsymbol (&QWM_HINTS, "WM_HINTS"); - defsymbol (&QWM_SIZE_HINTS, "WM_SIZE_HINTS"); -#endif /* EPOCH */ - #ifdef CUT_BUFFER_SUPPORT defsymbol (&QCUT_BUFFER0, "CUT_BUFFER0"); defsymbol (&QCUT_BUFFER1, "CUT_BUFFER1");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/basic-lisp.el Mon Aug 13 10:28:48 2007 +0200 @@ -0,0 +1,89 @@ +;;; Test basic Lisp functionality + +;;(when (not (boundp 'foo)) (setq foo 1)) +;;(incf foo) +;;(print foo) + +(let ((my-vector [1 2 3 4]) + (my-bit-vector (bit-vector 1 0 1 0)) + (my-string "1234") + (my-list '(1 2 3 4))) + + ;;(Assert (fooooo)) ;; Generate Other failure + ;;(Assert (eq 1 2)) ;; Generate Assertion failure + + (Assert (eq (elt my-vector 0) 1)) + (Assert (eq (elt my-bit-vector 0) 1)) + (Assert (eq (elt my-string 0) ?1)) + (Assert (eq (elt my-list 0) 1)) + + (Assert (eq 4 (length my-vector))) + (Assert (eq 4 (length my-bit-vector))) + (Assert (eq 4 (length my-string))) + + (fillarray my-vector 5) + (fillarray my-bit-vector 1) + (fillarray my-string ?5) + + (Assert (eq 4 (length my-vector))) + (Assert (eq 4 (length my-bit-vector))) + (Assert (eq 4 (length my-string))) + + (Assert (eq (elt my-vector 0) 5)) + (Assert (eq (elt my-bit-vector 0) 1)) + (Assert (eq (elt my-string 0) ?5)) + + (Assert (eq (elt my-vector 3) 5)) + (Assert (eq (elt my-bit-vector 3) 1)) + (Assert (eq (elt my-string 3) ?5)) + + (fillarray my-bit-vector 0) + (Assert (eq 4 (length my-bit-vector))) + (Assert (eq (elt my-bit-vector 2) 0)) + + ;; Test nconc + (let ((x (list 0 1 2))) + (Assert (eq (nconc) nil)) + (Assert (eq (nconc nil) nil)) + (Assert (eq (nconc nil x) x)) + (Assert (eq (nconc x nil) x)) + (let ((y (nconc x nil (list 3 4 5) nil))) + (Assert (eq (length y) 6)) + (Assert (eq (nth 3 y) 3)) + )) + ) + +;;; Old cruft +;;;(run-tests) + +;(defmacro Assert (assertion) +; `(condition-case error +; (progn +; (assert ,assertion) +; (princ (format "Assertion passed: %S" (quote ,assertion))) +; (terpri) +; (incf Assert-successes)) +; (cl-assertion-failed +; (princ (format "Assertion failed: %S" (quote ,assertion))) +; (terpri) +; (incf Assert-failures)) +; (t (princ (format "Test harness error: %S" error)) +; (terpri) +; (incf Harness-failures) +; ))) + + +;(defun run-tests () +; (with-output-to-temp-buffer "*Test-Log*" +; (let ((Assert-successes 0) +; (Assert-failures 0) +; (Harness-failures 0)) +; (basic-lisp-test) +; (byte-compile 'basic-lisp-test) +; (basic-lisp-test) +; (print (format "%d successes, %d assertion failures, %d harness failures" +; Assert-successes +; Assert-failures +; Harness-failures))))) + +;(defun the-test ()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/database.el Mon Aug 13 10:28:48 2007 +0200 @@ -0,0 +1,29 @@ +;;; Test database functionality + +(defun test-database (db) + (Assert (databasep db)) + (put-database "key1" "val1" db) + (Assert (equal "val1" (get-database "key1" db))) + (remove-database "key1" db) + (Assert (equal nil (get-database "key1" db))) + (close-database db) + (Assert (not (database-live-p db))) + (Assert (databasep db)) + (let ((filename (database-file-name db))) + (loop for fn in (list filename (concat filename ".db")) do + (when (file-exists-p fn) + (delete-file fn)))) + ) + +(let ((filename (expand-file-name "test-emacs" (temp-directory)))) + + (when (featurep 'dbm) + (let ((db (open-database filename 'dbm))) + (test-database db))) + + (princ "\n") + + (when (featurep 'berkeley-db) + (let ((db (open-database filename 'berkeley-db))) + (test-database db))) + )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-emacs.el Mon Aug 13 10:28:48 2007 +0200 @@ -0,0 +1,219 @@ +;; test-emacs.el --- Run Emacs Lisp test suites. + +;;; Copyright (C) 1998 Free Software Foundation, Inc. + +;; Author: Martin Buchholz +;; Keywords: testing + +;; 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 + +(defvar test-emacs-verbose + (and (not noninteractive) (> (device-baud-rate) search-slow-speed)) + "*Non-nil means print messages describing progress of emacs-tester.") + +(defvar test-emacs-current-file nil) + +(defvar emacs-lisp-file-regexp (purecopy "\\.el$") + "*Regexp which matches Emacs Lisp source files.") + +(defun test-emacs-test-file (filename) + "Test a file of Lisp code named FILENAME. +The output file's name is made by appending `c' to the end of FILENAME." + ;; (interactive "fTest file: ") + (interactive + (let ((file buffer-file-name) + (file-name nil) + (file-dir nil)) + (and file + (eq (cdr (assq 'major-mode (buffer-local-variables))) + 'emacs-lisp-mode) + (setq file-name (file-name-nondirectory file) + file-dir (file-name-directory file))) + (list (read-file-name "Test file: " file-dir nil nil file-name)))) + ;; Expand now so we get the current buffer's defaults + (setq filename (expand-file-name filename)) + + ;; If we're testing a file that's in a buffer and is modified, offer + ;; to save it first. + (or noninteractive + (let ((b (get-file-buffer (expand-file-name filename)))) + (if (and b (buffer-modified-p b) + (y-or-n-p (format "save buffer %s first? " (buffer-name b)))) + (save-excursion (set-buffer b) (save-buffer))))) + + (if (or noninteractive test-emacs-verbose) + (message "Testing %s..." filename)) + (let ((test-emacs-current-file filename) + input-buffer) + (save-excursion + (setq input-buffer (get-buffer-create " *Test Input*")) + (set-buffer input-buffer) + (erase-buffer) + (insert-file-contents filename) + ;; Run hooks including the uncompression hook. + ;; If they change the file name, then change it for the output also. + (let ((buffer-file-name filename) + (default-major-mode 'emacs-lisp-mode) + (enable-local-eval nil)) + (normal-mode) + (setq filename buffer-file-name))) + (test-emacs-from-buffer input-buffer filename) + (kill-buffer input-buffer) + )) + +(defun test-emacs-read-from-buffer (buffer) + "Read forms from BUFFER, and turn it into a lambda test form." + (let ((body nil)) + (goto-char (point-min) buffer) + (condition-case nil + (while t + (setq body (cons (read inbuffer) body))) + (error nil)) + `(lambda () + (defvar passes) + (defvar assertion-failures) + (defvar other-failures) + ,@(nreverse body)))) + +(defun test-emacs-from-buffer (inbuffer filename) + "Run tests in buffer INBUFFER, visiting FILENAME." + (let ((passes 0) + (assertion-failures 0) + (other-failures 0)) + (with-output-to-temp-buffer "*Test-Log*" + (defmacro Assert (assertion) + `(condition-case error + (progn + (assert ,assertion) + (princ (format "PASS: %S" (quote ,assertion))) + (terpri) + (incf passes)) + (cl-assertion-failed + (princ (format "Assertion failed: %S" (quote ,assertion))) + (terpri) + (incf assertion-failures)) + (t (princ "Error during test execution:\n\t") + (display-error error nil) + (terpri) + (incf other-failures) + ))) + + (princ "Testing Interpreted Lisp\n\n") + (funcall (test-emacs-read-from-buffer inbuffer)) + (princ "\nTesting Compiled Lisp\n\n") + (funcall (byte-compile (test-emacs-read-from-buffer inbuffer))) + (princ (format + "\nSUMMARY: %d passes, %d assertion failures, %d other failures\n" + passes + assertion-failures + other-failures)) + (let* ((total (+ passes assertion-failures other-failures)) + (basename (file-name-nondirectory filename)) + (summary-msg + (if (> total 0) + (format "%s: %d of %d (%d%%) tests successful." + basename passes total (/ (* 100 passes) total)) + (format "%s: No tests run" basename)))) + (message "%s" summary-msg)) + (fmakunbound 'Assert)))) + +(defvar test-emacs-results-point-max nil) +(defmacro displaying-emacs-test-results (&rest body) + `(let ((test-emacs-results-point-max test-emacs-results-point-max)) + ;; Log the file name. + (test-emacs-log-file) + ;; Record how much is logged now. + ;; We will display the log buffer if anything more is logged + ;; before the end of BODY. + (or test-emacs-results-point-max + (save-excursion + (set-buffer (get-buffer-create "*Test-Log*")) + (setq test-emacs-results-point-max (point-max)))) + (unwind-protect + (condition-case error-info + (progn ,@body) + (error + (test-emacs-report-error error-info))) + (save-excursion + ;; If there were compilation warnings, display them. + (set-buffer "*Test-Log*") + (if (= test-emacs-results-point-max (point-max)) + nil + (if temp-buffer-show-function + (let ((show-buffer (get-buffer-create "*Test-Log-Show*"))) + (save-excursion + (set-buffer show-buffer) + (setq buffer-read-only nil) + (erase-buffer)) + (copy-to-buffer show-buffer + (save-excursion + (goto-char test-emacs-results-point-max) + (forward-line -1) + (point)) + (point-max)) + (funcall temp-buffer-show-function show-buffer)) + (select-window + (prog1 (selected-window) + (select-window (display-buffer (current-buffer))) + (goto-char test-emacs-results-point-max) + (recenter 1))))))))) + +(defun batch-test-emacs-1 (file) + (condition-case err + (progn (test-emacs-test-file file) t) + (error + (princ ">>Error occurred processing ") + (princ file) + (princ ": ") + (display-error err nil) + (terpri) + nil))) + +(defun batch-test-emacs () + "Run `test-emacs' on the files remaining on the command line. +Use this from the command line, with `-batch'; +it won't work in an interactive Emacs. +Each file is processed even if an error occurred previously. +For example, invoke \"xemacs -batch -f batch-test-emacs tests/*.el\"" + ;; command-line-args-left is what is left of the command line (from + ;; startup.el) + (defvar command-line-args-left) ;Avoid 'free variable' warning + (if (not noninteractive) + (error "`batch-test-emacs' is to be used only with -batch")) + (let ((error nil) + (debug-issue-ebola-notices 0)) + (loop for file in command-line-args-left + do + (if (file-directory-p (expand-file-name file)) + (let ((files (directory-files file)) + source) + (while files + (if (and (string-match emacs-lisp-file-regexp (car files)) + (not (auto-save-file-name-p (car files))) + (setq source (expand-file-name + (car files) + file)) + (if (null (batch-test-emacs-1 source)) + (setq error t))) + (setq files (cdr files))))) + (if (null (batch-test-emacs-1 file)) + (setq error t)))) + (message "Done") + (kill-emacs (if error 1 0))))
--- a/version.sh Mon Aug 13 10:27:41 2007 +0200 +++ b/version.sh Mon Aug 13 10:28:48 2007 +0200 @@ -1,5 +1,8 @@ #!/bin/sh emacs_major_version=21 emacs_minor_version=0 -emacs_beta_version=33 -xemacs_codename="Nigerian Dwarf" +emacs_beta_version=34 +xemacs_codename="Oberhasli" +infodock_major_version=3 +infodock_minor_version=90 +infodock_build_version=1