# HG changeset patch # User cvs # Date 1186993998 -7200 # Node ID c42ec1d1cded1ee7bbd0652f6d2e0a9f2ea177b5 # Parent 090b52736db238b1b4b7e9e0b757a30e0d4d4eb0 Import from CVS: tag r21-0b39 diff -r 090b52736db2 -r c42ec1d1cded CHANGES-beta --- a/CHANGES-beta Mon Aug 13 10:32:23 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 10:33:18 2007 +0200 @@ -1,4 +1,41 @@ -*- indented-text -*- +to 21.0 beta39 "Russian White" +-- DnD fixes from Oliver Graf and Jonathan Harris +-- scrollbar visibility and placement specifiers from of Kirill Katsnelson +-- x-toolbar.el and x-menubar.el renamed to toolbar-items.el and + menubar-items.el +-- Device metrics from Kirill Katsnelson +-- Frame redraw smoothing fix from Kirill Katsnelson +-- MS Windows transparency handling from Andy Piper +-- XEmacs FAQ update from Christian Nybo +-- MS Windows build fix for minimal tagbits, etc. from Kirill Katsnelson +-- Fix cancelling directory creation prompt from Hrvoje Niksic +-- cygwin build fixes from Andy Piper +-- Restore oo-browser etags.c as ootags.c +-- Socket connections for Windows from Kirill Katsnelson +-- region limiting fixes from Hrvoje Niksic +-- cleanup focus-follows-mouse handling from Greg Klanderman +-- mswindows cursor support from Andy Piper +-- elimination of bzero from Michael Sperber +-- build fix from Jeff Miller +-- xpm button fix from Andy Piper +-- add optional `norecord' arg to select-window from Greg Klanderman +-- regexp quote fix from Hrvoje Niksic +-- early frame title update from Jan Vroonhof +-- Make character 0240 display as space from Kyle Jones +-- 0 argument printing fix from Hrvoje Niksic +-- revert recent changes to etags.c +-- dump clean up, removal of Lisp reader macros +-- spelling fix from Jonathan Harris +-- MS Windows build fix from Kirill Katsnelson +-- sound fixes from Kyle Jones +-- LDAP updates from Oscar Figueiredo +-- Drag and drop update from Oliver Graf +-- rename XEmacs internal realpath from Kyle Jones +-- rangetab cleanup from Martin Buchholz +-- etags fix +-- miscellaneous bug fixes + to 21.0 beta38 "Repartida" -- apropos.el modernization -- Documentation updates from Hrvoje Niksic diff -r 090b52736db2 -r c42ec1d1cded ChangeLog --- a/ChangeLog Mon Aug 13 10:32:23 2007 +0200 +++ b/ChangeLog Mon Aug 13 10:33:18 2007 +0200 @@ -1,3 +1,26 @@ +1998-05-09 SL Baur + + * XEmacs 21.0-beta39 is released. + +1998-05-06 Oliver Graf + + * configure.in: added autodetection for the Drag'n'Drop API + if some DnD protocol is found, HAVE_DRAGNDROP will be defined + and dragdrop.o is added to extra_objs + * configure.usage: added with-dragndrop, added (*) to with-offix + * tests/Dnd/droptest.el: complete overhaul, no it's a real test + +1998-05-04 Oliver Graf + + * tests/Dnd/droptest.el: changed to test new protocol + * tests/Dnd/README.OffiX: removed + * tests/Dnd/README: created, info about new protocol + * tests/Dnd/dragtest.el: comment change + +1998-05-07 SL Baur + + * etc/altrasoft-logo.xpm: Removed. + 1998-05-02 SL Baur * XEmacs 21.0-beta38 is released. diff -r 090b52736db2 -r c42ec1d1cded configure --- a/configure Mon Aug 13 10:32:23 2007 +0200 +++ b/configure Mon Aug 13 10:33:18 2007 +0200 @@ -303,6 +303,7 @@ with_ncurses | \ with_dnet | \ with_socks | \ + with_dragndrop | \ with_cde | \ with_offix | \ with_gpm | \ @@ -736,7 +737,7 @@ if test -z "$configuration"; then echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:740: checking "host system type"" >&5 +echo "configure:741: checking "host system type"" >&5 if configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess | \ sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` ; then echo "$ac_t""$configuration" 1>&6 @@ -750,7 +751,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:754: checking whether ln -s works" >&5 +echo "configure:755: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -966,7 +967,7 @@ echo "checking "the configuration name"" 1>&6 -echo "configure:970: checking "the configuration name"" >&5 +echo "configure:971: checking "the configuration name"" >&5 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'` if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else exit $? @@ -1430,7 +1431,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:1434: checking for $ac_word" >&5 +echo "configure:1435: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1456,7 +1457,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:1460: checking for $ac_word" >&5 +echo "configure:1461: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1501,7 +1502,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1505: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1506: 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' @@ -1513,11 +1514,11 @@ cross_compiling=no cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1522: \"$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 @@ -1537,19 +1538,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:1541: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1542: 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:1546: checking whether we are using GNU C" >&5 +echo "configure:1547: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1554: \"$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 @@ -1563,7 +1564,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1567: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1568: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1592,7 +1593,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:1596: checking for $ac_word" >&5 +echo "configure:1597: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1618,7 +1619,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:1622: checking for $ac_word" >&5 +echo "configure:1623: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1663,7 +1664,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1667: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1668: 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' @@ -1675,11 +1676,11 @@ cross_compiling=no cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1684: \"$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 @@ -1699,19 +1700,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:1703: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1704: 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:1708: checking whether we are using GNU C" >&5 +echo "configure:1709: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1716: \"$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 @@ -1725,7 +1726,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1729: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1730: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1754,7 +1755,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:1758: checking for $ac_word" >&5 +echo "configure:1759: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1780,7 +1781,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:1784: checking for $ac_word" >&5 +echo "configure:1785: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1825,7 +1826,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1829: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1830: 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' @@ -1837,11 +1838,11 @@ cross_compiling=no cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1846: \"$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 @@ -1861,19 +1862,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:1865: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1866: 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:1870: checking whether we are using GNU C" >&5 +echo "configure:1871: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1878: \"$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 @@ -1887,7 +1888,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1891: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1892: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1920,7 +1921,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:1924: checking how to run the C preprocessor" >&5 +echo "configure:1925: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1933,13 +1934,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1950,13 +1951,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1979,9 +1980,9 @@ echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1983: checking for AIX" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&6 -echo "configure:2012: checking for GNU libc" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { @@ -2022,7 +2023,7 @@ ; return 0; } EOF -if { (eval echo configure:2026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -2043,9 +2044,9 @@ echo $ac_n "checking whether we are using SunPro C""... $ac_c" 1>&6 -echo "configure:2047: checking whether we are using SunPro C" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* __sunpro_c=yes else @@ -2330,7 +2331,7 @@ fi echo $ac_n "checking for dynodump""... $ac_c" 1>&6 -echo "configure:2334: checking for dynodump" >&5 +echo "configure:2335: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -2430,7 +2431,7 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:2434: checking "for runtime libraries flag"" >&5 +echo "configure:2435: 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" @@ -2448,14 +2449,14 @@ done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 2453 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* dash_r="$try_dash_r" else @@ -2555,10 +2556,10 @@ fi after_morecore_hook_exists=yes echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6 -echo "configure:2559: checking for malloc_get_state" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2586: \"$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 @@ -2601,10 +2602,10 @@ fi echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:2605: checking for malloc_set_state" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2632: \"$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 @@ -2647,16 +2648,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:2651: checking whether __after_morecore_hook exists" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2715,7 +2716,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:2719: checking for $ac_word" >&5 +echo "configure:2720: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -2768,7 +2769,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:2772: checking for a BSD compatible install" >&5 +echo "configure:2773: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" @@ -2819,7 +2820,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:2823: checking for $ac_word" >&5 +echo "configure:2824: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2850,15 +2851,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2854: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2891,15 +2892,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2895: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2932,15 +2933,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2936: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2970,10 +2971,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:2974: checking for sys/wait.h that is POSIX.1 compatible" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -2989,7 +2990,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:2993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3013,10 +3014,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3017: checking for ANSI C header files" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3024,7 +3025,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3041,7 +3042,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 @@ -3059,7 +3060,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 @@ -3077,7 +3078,7 @@ if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3088,7 +3089,7 @@ exit (0); } EOF -if { (eval echo configure:3092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then : else @@ -3113,10 +3114,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3117: checking whether time.h and sys/time.h may both be included" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3125,7 +3126,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3149,10 +3150,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3153: checking for sys_siglist declaration in signal.h or unistd.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3164,7 +3165,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3189,9 +3190,9 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:3193: checking for struct utimbuf" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < @@ -3210,7 +3211,7 @@ static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:3214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3215: \"$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 @@ -3230,10 +3231,10 @@ rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3234: checking return type of signal handlers" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3250,7 +3251,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3272,10 +3273,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3276: checking for size_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3306,10 +3307,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3310: checking for pid_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3340,10 +3341,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3344: checking for uid_t in sys/types.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF @@ -3379,10 +3380,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3383: checking for mode_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3413,10 +3414,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3417: checking for off_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3448,9 +3449,9 @@ echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:3452: checking for struct timeval" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < @@ -3466,7 +3467,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:3470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -3488,10 +3489,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:3492: checking whether struct tm is in sys/time.h or time.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3499,7 +3500,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3523,10 +3524,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3527: checking for tm_zone in struct tm" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -3534,7 +3535,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:3538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -3557,10 +3558,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:3561: checking for tzname" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -3570,7 +3571,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:3574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -3596,10 +3597,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3600: checking for working const" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3673,7 +3674,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:3677: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:3678: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -3698,12 +3699,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:3702: checking whether byte ordering is bigendian" >&5 +echo "configure:3703: checking whether byte ordering is bigendian" >&5 ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -3714,11 +3715,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:3718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -3729,7 +3730,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:3733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3746,7 +3747,7 @@ rm -f conftest* if test $ac_cv_c_bigendian = unknown; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_c_bigendian=no else @@ -3785,10 +3786,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:3789: checking size of short" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -3799,7 +3800,7 @@ exit(0); } EOF -if { (eval echo configure:3803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -3826,10 +3827,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:3830: checking size of int" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -3840,7 +3841,7 @@ exit(0); } EOF -if { (eval echo configure:3844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -3861,10 +3862,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:3865: checking size of long" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -3875,7 +3876,7 @@ exit(0); } EOF -if { (eval echo configure:3879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -3896,10 +3897,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:3900: checking size of long long" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -3910,7 +3911,7 @@ exit(0); } EOF -if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3915: \"$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 @@ -3931,10 +3932,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:3935: checking size of void *" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -3945,7 +3946,7 @@ exit(0); } EOF -if { (eval echo configure:3949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3950: \"$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 @@ -3967,7 +3968,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:3971: checking for long file names" >&5 +echo "configure:3972: 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: @@ -4014,12 +4015,12 @@ echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:4018: checking for sin in -lm" >&5 +echo "configure:4019: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` xe_check_libs=" -lm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4035: \"$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 @@ -4072,14 +4073,14 @@ cat > conftest.$ac_ext < int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:4083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4084: \"$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 @@ -4096,7 +4097,7 @@ rm -f conftest* echo "checking type of mail spool file locking" 1>&6 -echo "configure:4100: checking type of mail spool file locking" >&5 +echo "configure:4101: 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 @@ -4120,12 +4121,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:4124: checking for kstat_open in -lkstat" >&5 +echo "configure:4125: checking for kstat_open in -lkstat" >&5 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lkstat " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4141: \"$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 @@ -4170,12 +4171,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:4174: checking for kvm_read in -lkvm" >&5 +echo "configure:4175: checking for kvm_read in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` xe_check_libs=" -lkvm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4191: \"$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 @@ -4221,12 +4222,12 @@ case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4225: checking for cma_open in -lpthreads" >&5 +echo "configure:4226: checking for cma_open in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lpthreads " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4242: \"$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 @@ -4273,7 +4274,7 @@ esac echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:4277: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:4278: 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; @@ -4284,7 +4285,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:4288: checking for \"-z ignore\" linker flag" >&5 +echo "configure:4289: 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 ;; @@ -4294,7 +4295,7 @@ echo "checking "for specified window system"" 1>&6 -echo "configure:4298: checking "for specified window system"" >&5 +echo "configure:4299: checking "for specified window system"" >&5 if test "$with_x11" != "no"; then test "$x_includes $x_libraries" != "NONE NONE" && \ @@ -4327,7 +4328,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:4331: checking for X" >&5 +echo "configure:4332: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4387,12 +4388,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4397: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4461,14 +4462,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4473: \"$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. @@ -4577,17 +4578,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:4581: checking whether -R must be followed by a space" >&5 +echo "configure:4582: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 4585 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -4603,14 +4604,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 4608 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -4646,12 +4647,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:4650: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4651: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4667: \"$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 @@ -4686,12 +4687,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:4690: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4691: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet_stub " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4707: \"$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 @@ -4731,10 +4732,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:4735: checking for gethostbyname" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4778,12 +4779,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4782: checking for gethostbyname in -lnsl" >&5 +echo "configure:4783: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` xe_check_libs=" -lnsl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4799: \"$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 @@ -4824,10 +4825,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:4828: checking for connect" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4873,12 +4874,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:4877: checking "$xe_msg_checking"" >&5 +echo "configure:4878: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocket $X_EXTRA_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4894: \"$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 @@ -4913,10 +4914,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:4917: checking for remove" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -4960,12 +4961,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:4964: checking for remove in -lposix" >&5 +echo "configure:4965: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` xe_check_libs=" -lposix " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4981: \"$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 @@ -5000,10 +5001,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:5004: checking for shmat" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -5047,12 +5048,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:5051: checking for shmat in -lipc" >&5 +echo "configure:5052: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` xe_check_libs=" -lipc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5068: \"$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 @@ -5097,12 +5098,12 @@ # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:5101: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:5102: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` xe_check_libs=" -lICE " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5118: \"$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 @@ -5280,7 +5281,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:5284: checking for X defines extracted by xmkmf" >&5 +echo "configure:5285: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -5312,15 +5313,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:5316: checking for X11/Intrinsic.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5344,12 +5345,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:5348: checking for XOpenDisplay in -lX11" >&5 +echo "configure:5349: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5365: \"$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 @@ -5385,12 +5386,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:5389: checking "$xe_msg_checking"" >&5 +echo "configure:5390: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 -b i486-linuxaout" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5406: \"$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 @@ -5428,12 +5429,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:5432: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:5433: checking for XShapeSelectInput in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'` xe_check_libs=" -lXext " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5449: \"$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 @@ -5467,12 +5468,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:5471: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:5472: checking for XtOpenDisplay in -lXt" >&5 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lXt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5488: \"$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 @@ -5506,14 +5507,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:5510: checking the version of X11 being used" >&5 +echo "configure:5511: checking the version of X11 being used" >&5 cat > conftest.$ac_ext < int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; } EOF -if { (eval echo configure:5517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:5518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ./conftest foobar; x11_release=$? else @@ -5537,15 +5538,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5541: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5576,7 +5577,7 @@ echo $ac_n "checking for XFree86""... $ac_c" 1>&6 -echo "configure:5580: checking for XFree86" >&5 +echo "configure:5581: checking for XFree86" >&5 if test -d "/usr/X386/include" -o \ -f "/etc/XF86Config" -o \ -f "/etc/X11/XF86Config" -o \ @@ -5596,12 +5597,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:5600: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:5601: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` xe_check_libs=" -lXmu " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5617: \"$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 @@ -5651,19 +5652,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:5655: checking for main in -lXbsd" >&5 +echo "configure:5656: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lXbsd " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5668: \"$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 @@ -5700,22 +5701,22 @@ fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:5704: checking for MS-Windows" >&5 +echo "configure:5705: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:5707: checking for main in -lgdi32" >&5 +echo "configure:5708: checking for main in -lgdi32" >&5 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdi32 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5720: \"$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 @@ -5773,12 +5774,12 @@ fi fi cat > conftest.$ac_ext < int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } EOF -if { (eval echo configure:5782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:5783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MSG_SELECT @@ -5808,7 +5809,7 @@ test -z "$window_system" && window_system="none" if test "$window_system" = "none"; then - for feature in menubars scrollbars toolbars dialogs + for feature in menubars scrollbars toolbars dialogs dragndrop 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 @@ -5856,7 +5857,7 @@ esac echo "checking for session-management option" 1>&6 -echo "configure:5860: checking for session-management option" >&5; +echo "configure:5861: checking for session-management option" >&5; if test "$with_session" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SESSION @@ -5871,15 +5872,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:5875: checking for X11/Xauth.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5902,12 +5903,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:5906: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:5907: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5923: \"$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 @@ -5962,6 +5963,10 @@ echo "configure: warning: No OffiX without real Xmu support" 1>&2 with_offix=no fi +if test "$with_dragndrop" = no; then + echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2 + with_offix=no +fi test -z "$with_offix" && with_offix=yes if test "$with_offix" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF @@ -5973,6 +5978,7 @@ } dnd_objs="$dnd_objs offix.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"offix.o\" to \$dnd_objs"; fi + dragndrop_proto="$dragndrop_proto OffiX" && if test "$extra_verbose" = "yes"; then echo " Appending \"OffiX\" to \$dragndrop_proto"; fi fi @@ -5982,15 +5988,15 @@ for dir in "" "Tt/" "desktop/" ; do ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6 -echo "configure:5986: checking for ${dir}tt_c.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6019,12 +6025,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:6023: checking "$xe_msg_checking"" >&5 +echo "configure:6029: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` xe_check_libs=" -ltt $extra_libs" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6045: \"$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 @@ -6084,15 +6090,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:6088: checking for Dt/Dt.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6115,12 +6121,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:6119: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:6125: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6141: \"$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 @@ -6153,6 +6159,10 @@ } test -z "$with_cde" && with_cde=yes +if test "$with_dragndrop" = no; then + echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2 + with_cde=no +fi if test "$with_cde" = "yes" ; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_CDE @@ -6163,23 +6173,45 @@ } libs_x="-lDtSvc $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lDtSvc\" to \$libs_x"; fi + dragndrop_proto="$dragndrop_proto CDE" && if test "$extra_verbose" = "yes"; then echo " Appending \"CDE\" to \$dragndrop_proto"; fi with_tooltalk=yes # CDE requires Tooltalk need_motif=yes # CDE requires Motif fi +echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 +echo "configure:6183: checking if drag and drop API is needed" >&5 +if test "$with_dragndrop" != "no" ; then + if test -n "$dragndrop_proto" ; then + with_dragndrop=yes + echo "$ac_t""yes (${dragndrop_proto} )" 1>&6 + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_DRAGNDROP +EOF +cat >> confdefs.h <<\EOF +#define HAVE_DRAGNDROP 1 +EOF +} + + extra_objs="$extra_objs dragdrop.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"dragdrop.o\" to \$extra_objs"; fi + else + with_dragndrop=no + echo "$ac_t""no" 1>&6 + fi +fi + echo "checking for LDAP" 1>&6 -echo "configure:6172: checking for LDAP" >&5 +echo "configure:6204: 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:6175: checking for ldap.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6202,15 +6234,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:6206: checking for lber.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6236,12 +6268,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6240: checking "$xe_msg_checking"" >&5 +echo "configure:6272: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6288: \"$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 @@ -6275,12 +6307,12 @@ } test "$with_umich_ldap" = "no" && { echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6 -echo "configure:6279: checking for ldap_set_option in -lldap10" >&5 +echo "configure:6311: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6327: \"$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 @@ -6355,14 +6387,14 @@ if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:6359: checking for graphics libraries" >&5 +echo "configure:6391: checking for graphics libraries" >&5 if test -z "$with_xpm"; then echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:6363: checking for Xpm - no older than 3.4f" >&5 +echo "configure:6395: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext < int main(int c, char **v) { @@ -6370,7 +6402,7 @@ XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:6374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:6406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ./conftest dummy_arg; xpm_status=$?; if test "$?" = "0"; then @@ -6411,17 +6443,17 @@ libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6 -echo "configure:6415: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:6447: checking for \"FOR_MSW\" xpm" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* xpm_for_msw=no else @@ -6448,12 +6480,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:6452: checking for inflate in -lc" >&5 +echo "configure:6484: checking for inflate in -lc" >&5 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6500: \"$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 @@ -6483,12 +6515,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:6487: checking for inflate in -lz" >&5 +echo "configure:6519: checking for inflate in -lz" >&5 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6535: \"$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 @@ -6518,12 +6550,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:6522: checking for inflate in -lgz" >&5 +echo "configure:6554: checking for inflate in -lgz" >&5 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lgz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6570: \"$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 @@ -6563,18 +6595,18 @@ fi echo $ac_n "checking for giflib - no older than 3.1""... $ac_c" 1>&6 -echo "configure:6567: checking for giflib - no older than 3.1" >&5 +echo "configure:6599: 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:6570: checking for gif_lib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6597,12 +6629,12 @@ } test -z "$with_gif" && { echo $ac_n "checking for GetGifError in -lgif""... $ac_c" 1>&6 -echo "configure:6601: checking for GetGifError in -lgif" >&5 +echo "configure:6633: checking for GetGifError in -lgif" >&5 ac_lib_var=`echo gif'_'GetGifError | sed 'y%./+-%__p_%'` xe_check_libs=" -lgif " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6649: \"$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 @@ -6649,15 +6681,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:6653: checking for jpeglib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6680,12 +6712,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:6684: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:6716: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` xe_check_libs=" -ljpeg " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6732: \"$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 @@ -6732,9 +6764,9 @@ if test -z "$with_png"; then echo $ac_n "checking for png.h - no older than 0.96""... $ac_c" 1>&6 -echo "configure:6736: checking for png.h - no older than 0.96" >&5 +echo "configure:6768: checking for png.h - no older than 0.96" >&5 cat > conftest.$ac_ext < #if PNG_LIBPNG_VER >= 96 @@ -6754,10 +6786,10 @@ fi test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:6758: checking for pow" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -6801,12 +6833,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:6805: checking for png_read_image in -lpng" >&5 +echo "configure:6837: checking for png_read_image in -lpng" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` xe_check_libs=" -lpng " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6853: \"$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 @@ -6853,15 +6885,15 @@ test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6 -echo "configure:6857: checking for tiffio.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6884,12 +6916,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFReadScanline in -ltiff""... $ac_c" 1>&6 -echo "configure:6888: checking for TIFFReadScanline in -ltiff" >&5 +echo "configure:6920: checking for TIFFReadScanline in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFReadScanline | sed 'y%./+-%__p_%'` xe_check_libs=" -ltiff " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6936: \"$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 @@ -6939,19 +6971,19 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:6943: checking for X11 graphics libraries" >&5 +echo "configure:6975: checking for X11 graphics libraries" >&5 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:6947: checking for compface.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6974,12 +7006,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:6978: checking for UnGenFace in -lcompface" >&5 +echo "configure:7010: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7026: \"$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 @@ -7026,12 +7058,12 @@ echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6 -echo "configure:7030: checking for XawScrollbarSetThumb in -lXaw" >&5 +echo "configure:7062: checking for XawScrollbarSetThumb in -lXaw" >&5 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7078: \"$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 @@ -7066,15 +7098,15 @@ ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:7070: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7091,12 +7123,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:7095: checking for XmStringFree in -lXm" >&5 +echo "configure:7127: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7143: \"$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 @@ -7136,9 +7168,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:7140: checking for Lesstif" >&5 +echo "configure:7172: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -7422,7 +7454,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:7426: checking for Mule-related features" >&5 +echo "configure:7458: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -7447,15 +7479,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7451: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7486,12 +7518,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:7490: checking for strerror in -lintl" >&5 +echo "configure:7522: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7538: \"$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 @@ -7535,19 +7567,19 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:7539: checking for Mule input methods" >&5 +echo "configure:7571: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:7542: checking for XIM" >&5 +echo "configure:7574: 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:7546: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:7578: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7594: \"$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 @@ -7624,15 +7656,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:7628: checking for XFontSet" >&5 +echo "configure:7660: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:7631: checking for XmbDrawString in -lX11" >&5 +echo "configure:7663: checking for XmbDrawString in -lX11" >&5 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7679: \"$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 @@ -7683,15 +7715,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:7687: checking for wnn/jllib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7716,10 +7748,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7720: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7771,12 +7803,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:7775: checking for crypt in -lcrypt" >&5 +echo "configure:7807: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` xe_check_libs=" -lcrypt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7823: \"$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 @@ -7821,12 +7853,12 @@ fi test -z "$with_wnn" && { echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6 -echo "configure:7825: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:7857: checking for jl_dic_list_e in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7873: \"$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 @@ -7874,12 +7906,12 @@ fi echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6 -echo "configure:7878: checking for jl_fi_dic_list in -lwnn" >&5 +echo "configure:7910: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7926: \"$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 @@ -7924,15 +7956,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:7928: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7959,15 +7991,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:7963: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7995,15 +8027,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:7999: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8026,12 +8058,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:8030: checking for RkBgnBun in -lRKC" >&5 +echo "configure:8062: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8078: \"$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 @@ -8065,12 +8097,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:8069: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:8101: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8117: \"$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 @@ -8130,12 +8162,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:8134: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:8166: checking for layout_object_getvalue in -li18n" >&5 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'` xe_check_libs=" -li18n " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8182: \"$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 @@ -8232,10 +8264,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:8236: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8295,10 +8327,10 @@ for ac_func in realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8299: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8354,16 +8386,16 @@ esac echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:8358: checking whether netdb declares h_errno" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:8367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8399: \"$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 @@ -8383,16 +8415,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:8387: checking for sigsetjmp" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:8396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8428: \"$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 @@ -8412,11 +8444,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:8416: checking whether localtime caches TZ" >&5 +echo "configure:8448: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext < #if STDC_HEADERS @@ -8451,7 +8483,7 @@ exit (0); } EOF -if { (eval echo configure:8455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then emacs_cv_localtime_cache=no else @@ -8480,9 +8512,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:8484: checking whether gettimeofday accepts one or two arguments" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""two" 1>&6 else @@ -8526,19 +8558,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:8530: checking for inline" >&5 +echo "configure:8562: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -8588,17 +8620,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:8592: checking for working alloca.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:8602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -8622,10 +8654,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8626: checking for alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -8687,10 +8719,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8691: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&6 -echo "configure:8718: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8770,10 +8802,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8774: checking stack direction for C alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_c_stack_direction=1 else @@ -8820,15 +8852,15 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:8824: checking for vfork.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8856,10 +8888,10 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:8860: checking for working vfork" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < @@ -8954,7 +8986,7 @@ } } EOF -if { (eval echo configure:8958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_vfork_works=yes else @@ -8979,10 +9011,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:8983: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main () @@ -8992,7 +9024,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:8996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:9028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -9019,10 +9051,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9023: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9073,10 +9105,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:9077: checking whether getpgrp takes no argument" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:9167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -9157,10 +9189,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:9161: checking for working mmap" >&5 +echo "configure:9193: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext < #include @@ -9193,7 +9225,7 @@ return 1; } EOF -if { (eval echo configure:9197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:9229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then have_mmap=yes else @@ -9227,15 +9259,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:9231: checking for termios.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9278,15 +9310,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:9282: checking for termio.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9318,10 +9350,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:9322: checking for socket" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -9359,15 +9391,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:9363: checking for netinet/in.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9384,15 +9416,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:9388: checking for arpa/inet.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9417,9 +9449,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:9421: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:9453: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext < @@ -9430,7 +9462,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:9434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9466: \"$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 @@ -9448,9 +9480,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:9452: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:9484: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext < @@ -9459,7 +9491,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:9463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9495: \"$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 @@ -9490,10 +9522,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:9494: checking for msgget" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -9531,15 +9563,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:9535: checking for sys/ipc.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9556,15 +9588,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:9560: checking for sys/msg.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9602,15 +9634,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:9606: checking for dirent.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9637,15 +9669,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:9641: checking for sys/dir.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9678,15 +9710,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:9682: checking for nlist.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9716,7 +9748,7 @@ echo "checking "for sound support"" 1>&6 -echo "configure:9720: checking "for sound support"" >&5 +echo "configure:9752: checking "for sound support"" >&5 case "$with_sound" in native | both ) with_native_sound=yes;; nas | no ) with_native_sound=no;; @@ -9727,15 +9759,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:9731: checking for multimedia/audio_device.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9783,12 +9815,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:9787: checking for ALopenport in -laudio" >&5 +echo "configure:9819: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9835: \"$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 @@ -9830,12 +9862,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:9834: checking for AOpenAudio in -lAlib" >&5 +echo "configure:9866: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9882: \"$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 @@ -9884,15 +9916,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:9888: checking for ${dir}/soundcard.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9962,7 +9994,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 @@ -9989,7 +10021,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:9993: checking for TTY-related features" >&5 +echo "configure:10025: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -10005,12 +10037,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:10009: checking for tgetent in -lncurses" >&5 +echo "configure:10041: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10057: \"$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 @@ -10054,15 +10086,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:10058: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10084,15 +10116,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:10088: checking for ncurses/term.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10122,15 +10154,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:10126: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10165,12 +10197,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:10169: checking for tgetent in -l$lib" >&5 +echo "configure:10201: checking for tgetent in -l$lib" >&5 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -l$lib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10217: \"$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 @@ -10212,12 +10244,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:10216: checking for tgetent in -lcurses" >&5 +echo "configure:10248: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lcurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10264: \"$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 @@ -10246,12 +10278,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:10250: checking for tgetent in -ltermcap" >&5 +echo "configure:10282: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -ltermcap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10298: \"$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 @@ -10310,15 +10342,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:10314: checking for gpm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10341,12 +10373,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:10345: checking for Gpm_Open in -lgpm" >&5 +echo "configure:10377: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgpm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10393: \"$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 @@ -10406,22 +10438,22 @@ echo "checking for database support" 1>&6 -echo "configure:10410: checking for database support" >&5 +echo "configure:10442: 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:10417: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10453,12 +10485,12 @@ if test "$have_ndbm_h" = "yes"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:10457: checking for dbm_open in -lgdbm" >&5 +echo "configure:10489: checking for dbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdbm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10505: \"$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 @@ -10492,10 +10524,10 @@ fi if test "$with_database_gnudbm" != "yes"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:10496: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -10554,10 +10586,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:10558: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -10601,12 +10633,12 @@ if test "$need_libdbm" != "no"; then echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:10605: checking for dbm_open in -ldbm" >&5 +echo "configure:10637: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -ldbm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10653: \"$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 @@ -10654,10 +10686,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for dbopen""... $ac_c" 1>&6 -echo "configure:10658: checking for dbopen" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbopen=yes" else @@ -10701,12 +10733,12 @@ if test "$need_libdb" != "no"; then echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6 -echo "configure:10705: checking for dbopen in -ldb" >&5 +echo "configure:10737: checking for dbopen in -ldb" >&5 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <&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 @@ -10741,7 +10773,7 @@ if test "$with_database_berkdb" = "yes"; then for path in "db/db.h" "db.h"; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_path="$path"; break else @@ -10810,12 +10842,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:10814: checking for SOCKSinit in -lsocks" >&5 +echo "configure:10846: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10862: \"$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 @@ -10883,15 +10915,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10887: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10922,12 +10954,12 @@ test -z "$with_shlib" && test ! -z "$have_dlfcn" && { echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:10926: checking for dlopen in -ldl" >&5 +echo "configure:10958: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10974: \"$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 @@ -10967,12 +10999,12 @@ } test -z "$with_shlib" && test ! -z "$have_dlfcn" && { echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6 -echo "configure:10971: checking for _dlopen in -lc" >&5 +echo "configure:11003: checking for _dlopen in -lc" >&5 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:11019: \"$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 @@ -11012,12 +11044,12 @@ } test -z "$with_shlib" && test ! -z "$have_dlfcn" && { echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:11016: checking for dlopen in -lc" >&5 +echo "configure:11048: checking for dlopen in -lc" >&5 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:11064: \"$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 @@ -11057,12 +11089,12 @@ } test -z "$with_shlib" && { echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:11061: checking for shl_load in -ldld" >&5 +echo "configure:11093: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:11109: \"$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 @@ -11102,12 +11134,12 @@ } test -z "$with_shlib" && { echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:11106: checking for dld_init in -ldld" >&5 +echo "configure:11138: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:11154: \"$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 @@ -11168,7 +11200,7 @@ dll_oflags="-o " echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6 -echo "configure:11172: checking how to build a shared library" >&5 +echo "configure:11204: checking how to build a shared library" >&5 case `uname -rs` in UNIX_SV*|UNIX_System_V*) dll_lflags="-G" @@ -11259,10 +11291,10 @@ for ac_func in dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11263: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:11321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11321,11 +11353,11 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:11361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then : else @@ -11928,6 +11960,7 @@ test "$with_cde" = yes && echo " Compiling in support for CDE." test "$with_tooltalk" = yes && echo " Compiling in support for ToolTalk." test "$with_offix" = yes && echo " Compiling in support for OffiX." +test "$with_dragndrop" = yes && echo " Compiling in support for Drag'n'Drop ($dragndrop_proto )." test "$with_workshop" = yes && echo " Compiling in support for Sun WorkShop." test "$with_session" != no && echo " Compiling in support for proper session-management." case "$with_menubars" in diff -r 090b52736db2 -r c42ec1d1cded configure.in --- a/configure.in Mon Aug 13 10:32:23 2007 +0200 +++ b/configure.in Mon Aug 13 10:33:18 2007 +0200 @@ -451,6 +451,7 @@ with_ncurses | \ with_dnet | \ with_socks | \ + with_dragndrop | \ with_cde | \ with_offix | \ with_gpm | \ @@ -2417,7 +2418,7 @@ 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 + for feature in menubars scrollbars toolbars dialogs dragndrop do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then AC_MSG_WARN([--with-$feature ignored: Not valid without window system support]) @@ -2492,19 +2493,27 @@ fi AC_SUBST(libs_xauth) -dnl Always compile OffiX unless --without-offix is given or no -dnl X11 support is compiled in or no standard Xmu. +dnl Always compile OffiX unless --without-offix is given, no +dnl X11 support is compiled in, no standard Xmu is avaiable, +dnl or dragndrop support is disabled 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]) with_offix=no fi +if test "$with_dragndrop" = no; then + AC_MSG_WARN([No OffiX without generic Drag'n'Drop support]) + with_offix=no +fi test -z "$with_offix" && with_offix=yes if test "$with_offix" = "yes"; then AC_DEFINE(HAVE_OFFIX_DND) XE_APPEND(offix.o, dnd_objs) + XE_APPEND(OffiX, dragndrop_proto) fi +dnl This one is for the static initializeds variables in +dnl offix.c, so that the thing is dumped after lastfile.o AC_SUBST(dnd_objs) dnl Autodetect tooltalk @@ -2535,13 +2544,33 @@ test -z "$with_cde" && { AC_CHECK_HEADER(Dt/Dt.h, , with_cde=no) } test -z "$with_cde" && { AC_CHECK_LIB(DtSvc, DtDndDragStart, [:], with_cde=no) } test -z "$with_cde" && with_cde=yes +if test "$with_dragndrop" = no; then + AC_MSG_WARN([No CDE without generic Drag'n'Drop support]) + with_cde=no +fi if test "$with_cde" = "yes" ; then AC_DEFINE(HAVE_CDE) XE_PREPEND(-lDtSvc, libs_x) + XE_APPEND(CDE, dragndrop_proto) with_tooltalk=yes # CDE requires Tooltalk need_motif=yes # CDE requires Motif fi +dnl Autodetect Drag'n'Drop support +dnl always included if CDE, Offix, or MSWindows are defined +AC_MSG_CHECKING(if drag and drop API is needed) +if test "$with_dragndrop" != "no" ; then + if test -n "$dragndrop_proto" ; then + with_dragndrop=yes + AC_MSG_RESULT([yes (${dragndrop_proto} )]) + AC_DEFINE(HAVE_DRAGNDROP) + XE_APPEND(dragdrop.o, extra_objs) + else + with_dragndrop=no + AC_MSG_RESULT(no) + fi +fi + dnl Autodetect LDAP AC_CHECKING(for LDAP) test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) } @@ -3851,6 +3880,7 @@ test "$with_cde" = yes && echo " Compiling in support for CDE." test "$with_tooltalk" = yes && echo " Compiling in support for ToolTalk." test "$with_offix" = yes && echo " Compiling in support for OffiX." +test "$with_dragndrop" = yes && echo " Compiling in support for Drag'n'Drop ($dragndrop_proto )." test "$with_workshop" = yes && echo " Compiling in support for Sun WorkShop." test "$with_session" != no && echo " Compiling in support for proper session-management." case "$with_menubars" in diff -r 090b52736db2 -r c42ec1d1cded configure.usage --- a/configure.usage Mon Aug 13 10:32:23 2007 +0200 +++ b/configure.usage Mon Aug 13 10:33:18 2007 +0200 @@ -76,8 +76,11 @@ --with-dialogs=TYPE Use TYPE dialog boxes (motif, athena, athena3d, or no). Lucid menubars and scrollbars are the default. Motif dialog boxes will be used if Motif can be found. +--with-dragndrop (*) Compile in the generic drag and drop API. This is + automatically added if one of the drag and drop + protocols is found (currently CDE, OffiX, MSWindows). --with-cde (*) Compile in support for CDE drag and drop. ---with-offix Compile in support for OffiX drag and drop. +--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. diff -r 090b52736db2 -r c42ec1d1cded etc/altrasoft-logo.xpm Binary file etc/altrasoft-logo.xpm has changed diff -r 090b52736db2 -r c42ec1d1cded info/dir --- a/info/dir Mon Aug 13 10:32:23 2007 +0200 +++ b/info/dir Mon Aug 13 10:33:18 2007 +0200 @@ -36,7 +36,7 @@ XEmacs 21.0 =========== -* Info:: Documentation browsing system. +* Info: (info). Documentation browsing system. * XEmacs:: The extensible user-friendly self-documenting text editor. This manual is for XEmacs 21.0. * Lispref:: XEmacs Lisp technical reference. @@ -45,15 +45,16 @@ * XEmacs-FAQ:: XEmacs Frequently Asked Questions for 21.0. * Internals:: Guide to the internals of XEmacs. + Local Packages: -* CL:: A Common Lisp compatibility package for Emacs-Lisp. -* Custom:: Customization Library for Emacs -* External-Widget:: Use XEmacs as a text widget inside of another program. -* Standards:: The GNU coding standards. -* Term:: A mode to control inferior processes (a comint replacement) -* Termcap:: The termcap library, which enables application programs - to handle all types of character-display terminals. -* Texinfo:: With one source file, make either a printed manual (through - TeX) or an Info file (through texinfo). -* Widget:: An Emacs Lisp widget library +* CL:: A Common Lisp compatibility package for Emacs-Lisp. +* Custom:: Customization Library for Emacs +* External-Widget:: Use XEmacs as a text widget inside of another program. +* Standards: (standards). GNU coding standards. +* Term:: A mode to control inferior processes (a comint replacement) +* Termcap:: The termcap library, which enables application programs + to handle all types of character-display terminals. +* Texinfo: (texinfo). The GNU documentation format. +* Widget:: An Emacs Lisp widget library + diff -r 090b52736db2 -r c42ec1d1cded lib-src/ChangeLog --- a/lib-src/ChangeLog Mon Aug 13 10:32:23 2007 +0200 +++ b/lib-src/ChangeLog Mon Aug 13 10:33:18 2007 +0200 @@ -1,3 +1,32 @@ +1998-05-07 Andy Piper + + * update-elc.sh: test x && y loses in the presence of set -e, use + if instead. + +1998-05-06 SL Baur + + * Makefile.in.in (INSTALLABLES): Add ootags. + (ootags): New rule. + + * ootags.c: New file. + (C_entries): Annotate changes neeeded for increased OO-Browser + context. + +1998-05-05 Jeff Miller + + * Makefile.in.in: Fix blessmail target. + +1998-05-05 SL Baur + + * Makefile.in.in (etags_args): Back out -DOO_BROWSER + + * etags.c: Revert to CVS version 1.11 (pre OO-browser additions). + +1998-05-04 SL Baur + + * etags.c (C_entries): Fix order typo. + (C_entries): Restore previous test. + Wed Apr 22 12:59:35 1998 Andy Piper * installexe.sh: fix to use -f instead of -e file and fix shift diff -r 090b52736db2 -r c42ec1d1cded lib-src/Makefile.in.in --- a/lib-src/Makefile.in.in Mon Aug 13 10:32:23 2007 +0200 +++ b/lib-src/Makefile.in.in Mon Aug 13 10:33:18 2007 +0200 @@ -42,6 +42,10 @@ LN_S=@LN_S@ version=@version@ +## This will be the name of the generated binary and is set automatically +## by configure. +PROGNAME=@PROGNAME@ + ## ==================== Where To Install Things ==================== prefix=@prefix@ @@ -61,7 +65,7 @@ ## Things that a user might actually run, ## which should be installed in bindir. -INSTALLABLES = etags ctags b2m gnuclient +INSTALLABLES = etags ctags b2m gnuclient ootags INSTALLABLE_SCRIPTS = rcs-checkin pstogif install-sid send-pr gnudoit gnuattach ## Things that Emacs runs internally, or during the build process, @@ -252,13 +256,22 @@ $(CC) -c `echo $(cflags) | sed 's/-Demacs/ /'` \ -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c -etags_args = -DOO_BROWSER -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 etags: ${etags_deps} $(CC) ${etags_args} -o $@ + +ootags_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \ + -DVERSION='"${version}"' ${srcdir}/ootags.c \ + $(GETOPTOBJS) regex.o $(ldflags) +ootags_deps = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h + +ootags: ${ootags_deps} + $(CC) ${ootags_args} -o $@ + ## ctags depends on etags to assure that parallel makes do not write ## two etags.o files on top of each other. ctags: ${etags_deps} etags diff -r 090b52736db2 -r c42ec1d1cded lib-src/etags.c --- a/lib-src/etags.c Mon Aug 13 10:32:23 2007 +0200 +++ b/lib-src/etags.c Mon Aug 13 10:33:18 2007 +0200 @@ -166,20 +166,6 @@ #define intoken(c) (_itk[CHAR(c)]) /* c can be in token */ #define endtoken(c) (_etk[CHAR(c)]) /* c ends tokens */ -/*#ifdef INFODOCK*/ -/*#undef OO_BROWSER*/ -/* Due to the way this file is constructed, this unfortunately doesn't */ -/* work except for documentation purposes. -slb */ -#define OO_BROWSER 1 -/*#endif*/ - -#ifdef OO_BROWSER -#define set_construct(construct) \ - if (!oo_browser_construct) oo_browser_construct = construct -void oo_browser_clear_all_globals(); -void oo_browser_clear_some_globals(); -void oo_browser_check_and_clear_structtype(); -#endif /* * xnew, xrnew -- allocate, reallocate storage @@ -213,9 +199,6 @@ typedef struct node_st { /* sorting structure */ char *name; /* function or type name */ -#ifdef OO_BROWSER - short int construct; /* Construct type for the OO-Browser */ -#endif char *file; /* file name */ bool is_func; /* use pattern or line no */ bool been_warned; /* set if noticed dup */ @@ -225,24 +208,6 @@ struct node_st *left, *right; /* left and right sons */ } node; -#ifdef OO_BROWSER -/* If you add to this array, you must add a corresponding entry to the - following enum. */ -static char *oo_browser_default_classes[] = - /* Lack of square brackets around some of these entries are intentional. */ - {"null", "class", "method", "[constant]", "[enumeration]", "[enum_label]", - "extern", "[function]", "[macro]", "objc", "[structure]", "[type]", - "[union]", "[variable]"}; - -/* If you add to this enum, you must add a corresponding entry to the - preceding array. */ -enum oo_browser_constructs {C_NULL, C_CLASS, C_METHOD, C_CONSTANT, C_ENUMERATION, - C_ENUM_LABEL, C_EXTERN, C_FUNCTION, C_MACRO, - C_OBJC, C_STRUCTURE, C_TYPE, C_UNION, C_VARIABLE}; - -enum oo_browser_constructs oo_browser_construct = C_NULL; -#endif - /* * A `linebuffer' is a structure which holds a line of text. * `readline_internal' reads a line from a stream into a linebuffer @@ -388,9 +353,6 @@ bool cxref_style; /* -x: create cxref style output */ bool cplusplus; /* .[hc] means C++, not C */ bool noindentypedefs; /* -I: ignore indentation in C */ -#ifdef OO_BROWSER -bool oo_browser_format; /* -O: OO-Browser tags format */ -#endif #ifdef LONG_OPTIONS struct option longopts[] = @@ -412,9 +374,6 @@ { "no-members", no_argument, &members, FALSE }, { "no-warn", no_argument, NULL, 'w' }, { "output", required_argument, NULL, 'o' }, -#ifdef OO_BROWSER - { "oo-browser", no_argument, NULL, 'O' }, -#endif #ifdef ETAGS_REGEXPS { "regex", required_argument, NULL, 'r' }, { "no-regex", no_argument, NULL, 'R' }, @@ -667,10 +626,6 @@ #endif /* ETAGS_REGEXPS */ puts ("-o FILE, --output=FILE\n\ Write the tags to FILE."); -#ifdef OO_BROWSER - puts ("-O, --oo-browser\n\ - Generate a specialized tags format used only by the Altrasoft OO-Browser."); -#endif puts ("-I, --ignore-indentation\n\ Don't rely on indentation quite as much as normal. Currently,\n\ this means not to assume that a closing brace in the first\n\ @@ -912,17 +867,9 @@ char *optstring; #ifdef ETAGS_REGEXPS -#ifndef OO_BROWSER optstring = "-aCdDf:Il:o:r:RStTi:BuvxwVhH"; #else - optstring = "-aCdDf:Il:o:r:RStTi:BOuvxwVhH"; -#endif -#else -#ifndef OO_BROWSER optstring = "-aCdDf:Il:o:StTi:BuvxwVhH"; -#else - optstring = "-aCdDf:Il:o:StTi:BOuvxwVhH"; -#endif #endif /* ETAGS_REGEXPS */ #ifndef LONG_OPTIONS @@ -965,11 +912,6 @@ } tagfile = optarg; break; -#ifdef OO_BROWSER - case 'O': - oo_browser_format = TRUE; - break; -#endif case 'I': case 'S': /* for backward compatibility */ noindentypedefs = TRUE; @@ -1113,21 +1055,11 @@ #else this_file = argbuffer[i].what; #endif -#ifdef OO_BROWSER - oo_browser_clear_all_globals(); -#endif /* Input file named "-" means read file names from stdin (one per line) and use them. */ if (streq (this_file, "-")) while (readline_internal (&filename_lb, stdin) > 0) -#ifdef OO_BROWSER - { - oo_browser_clear_some_globals(); -#endif process_file (filename_lb.buffer); -#ifdef OO_BROWSER - } -#endif else process_file (this_file); #ifdef VMS @@ -1303,11 +1235,6 @@ to the directory of the tags file. */ filename = relative_filename (file, tagfiledir); } -#ifdef OO_BROWSER - if (oo_browser_format) - fprintf (tagf, "\f\n%s\n", filename); - else -#endif fprintf (tagf, "\f\n%s,%d\n", filename, total_size_of_entries (head)); free (filename); put_entries (head); @@ -1487,13 +1414,6 @@ else np->pat = savenstr (linestart, linelen); -#ifdef OO_BROWSER - if (oo_browser_format) - np->construct = oo_browser_construct; - oo_browser_construct = C_NULL; - oo_browser_check_and_clear_structtype(); -#endif - add_node (np, &head); } @@ -1539,12 +1459,7 @@ cp = linestart + linelen - namelen; if (notinname (linestart[linelen-1])) cp -= 1; /* rule #4 */ -#ifdef OO_BROWSER - if (!oo_browser_format - && cp >= linestart /* rule #2 */ -#else if (cp >= linestart /* rule #2 */ -#endif && (cp == linestart || notinname (cp[-1])) /* rule #3 */ && strneq (name, cp, namelen)) /* rule #2 */ @@ -1646,13 +1561,6 @@ } } -#ifdef OO_BROWSER -/* Default class name for the current OO-Browser tag. */ -static char *oo_browser_class; -/* Prefix character to use in OO-Browser listings for the current tag. */ -static char oo_browser_prefix; -#endif - void put_entries (np) register node *np; @@ -1669,56 +1577,12 @@ if (!CTAGS) { -#ifdef OO_BROWSER - if (oo_browser_format) - { - /* Omit C++ `class' and `method' entries as well as Objective-C - entries from this OO-Browser tags file since the browser handles - them independently of this file. Omit `extern' variable declarations - as they are unused by the OO-Browser. */ - if (np->construct != C_CLASS - && np->construct != C_METHOD - && np->construct != C_EXTERN - && np->construct != C_OBJC) - { - oo_browser_class = oo_browser_default_classes[np->construct]; - switch (np->construct) - { - case C_CONSTANT: - case C_ENUMERATION: - case C_ENUM_LABEL: - case C_STRUCTURE: - case C_TYPE: - case C_UNION: - case C_VARIABLE: - oo_browser_prefix = '='; - break; - case C_FUNCTION: - case C_MACRO: - oo_browser_prefix = '-'; - break; - } - if (np->name != NULL) - fprintf (tagf, "%s@%c %s@%s\n", - oo_browser_class, oo_browser_prefix, - np->name, np->pat); - else - fprintf (tagf, "%s@%c ???@%s\n", - oo_browser_class, oo_browser_prefix, np->pat); - } - } - else - { -#endif if (np->name != NULL) fprintf (tagf, "%s\177%s\001%d,%ld\n", np->pat, np->name, np->lno, np->cno); else fprintf (tagf, "%s\177%d,%ld\n", np->pat, np->lno, np->cno); -#ifdef OO_BROWSER - } -#endif } else { @@ -1817,9 +1681,6 @@ st_C_ignore, st_C_javastruct, st_C_struct, st_C_enum, st_C_define, st_C_typedef, st_C_typespec -#ifdef OO_BROWSER - , st_C_union, st_C_class, st_C_extern, st_C_inline -#endif }; /* Feed stuff between (but not including) %[ and %] lines to: @@ -1837,15 +1698,14 @@ extends, C_JAVA, st_C_javastruct implements, C_JAVA, st_C_javastruct interface, C_JAVA, st_C_struct -class, C_PLPL, st_C_class +class, C_PLPL, st_C_struct namespace, C_PLPL, st_C_struct domain, C_STAR, st_C_struct -union, 0, st_C_union +union, 0, st_C_struct struct, 0, st_C_struct enum, 0, st_C_enum typedef, 0, st_C_typedef define, 0, st_C_define -inline, 0, st_C_inline bool, C_PLPL, st_C_typespec long, 0, st_C_typespec short, 0, st_C_typespec @@ -1857,7 +1717,7 @@ unsigned, 0, st_C_typespec auto, 0, st_C_typespec void, 0, st_C_typespec -extern, 0, st_C_extern +extern, 0, st_C_typespec static, 0, st_C_typespec const, 0, st_C_typespec volatile, 0, st_C_typespec @@ -1876,115 +1736,125 @@ %] and replace lines between %< and %> with its output. */ /*%<*/ -/* C code produced by gperf version 2.5 (GNU C++ version) */ +/* starting time is 10:15:51 */ +/* C code produced by gperf version 2.1 (K&R C version) */ /* Command-line: gperf -c -k 1,3 -o -p -r -t */ + + struct C_stab_entry { char *name; int c_ext; enum sym_type type; }; -#define TOTAL_KEYWORDS 41 #define MIN_WORD_LENGTH 3 #define MAX_WORD_LENGTH 15 -#define MIN_HASH_VALUE 19 -#define MAX_HASH_VALUE 100 -/* maximum key range = 82, duplicates = 0 */ - -static unsigned int +#define MIN_HASH_VALUE 11 +#define MAX_HASH_VALUE 117 +/* + 40 keywords + 107 is the maximum key range +*/ + +static int hash (str, len) register char *str; - register int unsigned len; + register unsigned int len; { - static unsigned char asso_values[] = + static unsigned char hash_table[] = { - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 25, 101, 101, 101, 31, 33, - 46, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 60, 101, 101, 43, 1, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 11, 17, 4, - 44, 63, 31, 8, 101, 29, 101, 101, 14, 15, - 44, 5, 13, 101, 38, 15, 25, 33, 55, 101, - 101, 101, 101, 101, 101, 101, 101, 101, - }; - return len + asso_values[str[2]] + asso_values[str[0]]; + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 1, 117, 117, 117, 2, 42, + 16, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 5, 117, 117, 21, 54, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 24, 19, 43, + 2, 35, 3, 10, 117, 26, 117, 117, 9, 20, + 35, 9, 61, 117, 40, 52, 10, 57, 3, 117, + 117, 117, 117, 117, 117, 117, 117, 117 + }; + return len + hash_table[(int) str[2]] + hash_table[(int) str[0]]; } +struct C_stab_entry * in_word_set PP ((char *str, unsigned int len)); struct C_stab_entry * in_word_set (str, len) register char *str; register unsigned int len; { - static struct C_stab_entry wordlist[] = + + static struct C_stab_entry wordlist[] = { {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"char", 0, st_C_typespec}, - {"class", C_PLPL, st_C_class}, - {"",}, {"",}, {"",}, - {"package", C_JAVA, st_C_ignore}, - {"short", 0, st_C_typespec}, - {"bool", C_PLPL, st_C_typespec}, {"",}, {"",}, - {"signed", 0, st_C_typespec}, + {"define", 0, st_C_define}, + {"",}, {"",}, {"",}, {"",}, {"",}, + {"float", 0, st_C_typespec}, + {"",}, {"",}, + {"volatile", 0, st_C_typespec}, {"",}, {"",}, - {"static", 0, st_C_typespec}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"ENTRY", 0, st_C_gnumacro}, - {"auto", 0, st_C_typespec}, - {"float", 0, st_C_typespec}, + {"DEFUN", 0, st_C_gnumacro}, + {"",}, {"",}, {"",}, {"",}, + {"domain", C_STAR, st_C_struct}, {"",}, {"",}, {"",}, - {"typedef", 0, st_C_typedef}, - {"typename", C_PLPL, st_C_typespec}, - {"mutable", C_PLPL, st_C_typespec}, - {"import", C_JAVA, st_C_ignore}, - {"inline", 0, st_C_inline}, - {"",}, {"",}, - {"implements", C_JAVA, st_C_javastruct}, - {"const", 0, st_C_typespec}, + {"bool", C_PLPL, st_C_typespec}, + {"void", 0, st_C_typespec}, {"",}, - {"@implementation", 0, st_C_objimpl}, - {"unsigned", 0, st_C_typespec}, - {"int", 0, st_C_typespec}, + {"friend", C_PLPL, st_C_ignore}, + {"@implementation", 0, st_C_objimpl}, + {"mutable", C_PLPL, st_C_typespec}, + {"auto", 0, st_C_typespec}, + {"int", 0, st_C_typespec}, + {"@end", 0, st_C_objend}, + {"",}, {"",}, {"",}, {"",}, + {"interface", C_JAVA, st_C_struct}, + {"@interface", 0, st_C_objprot}, {"",}, - {"struct", 0, st_C_struct}, - {"",}, {"",}, - {"long", 0, st_C_typespec}, - {"interface", C_JAVA, st_C_struct}, + {"long", 0, st_C_typespec}, + {"SYSCALL", 0, st_C_gnumacro}, + {"@protocol", 0, st_C_objprot}, + {"extern", 0, st_C_typespec}, + {"extends", C_JAVA, st_C_javastruct}, + {"PSEUDO", 0, st_C_gnumacro}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"domain", C_STAR, st_C_struct}, - {"friend", C_PLPL, st_C_ignore}, - {"union", 0, st_C_union}, - {"namespace", C_PLPL, st_C_struct}, - {"",}, {"",}, {"",}, - {"@protocol", 0, st_C_objprot}, - {"@end", 0, st_C_objend}, - {"",}, {"",}, {"",}, - {"volatile", 0, st_C_typespec}, + {"namespace", C_PLPL, st_C_struct}, + {"double", 0, st_C_typespec}, + {"short", 0, st_C_typespec}, {"",}, - {"@interface", 0, st_C_objprot}, - {"",}, - {"define", 0, st_C_define}, - {"DEFUN", 0, st_C_gnumacro}, - {"double", 0, st_C_typespec}, - {"explicit", C_PLPL, st_C_typespec}, - {"",}, {"",}, {"",}, - {"void", 0, st_C_typespec}, + {"signed", 0, st_C_typespec}, + {"",}, {"",}, + {"char", 0, st_C_typespec}, + {"class", C_PLPL, st_C_struct}, + {"",}, {"",}, {"",}, {"",}, {"",}, + {"typedef", 0, st_C_typedef}, + {"typename", C_PLPL, st_C_typespec}, + {"",}, {"",}, + {"static", 0, st_C_typespec}, + {"const", 0, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, + {"union", 0, st_C_struct}, {"",}, {"",}, {"",}, {"",}, - {"SYSCALL", 0, st_C_gnumacro}, - {"extern", 0, st_C_extern}, - {"extends", C_JAVA, st_C_javastruct}, - {"",}, {"",}, {"",}, - {"PSEUDO", 0, st_C_gnumacro}, - {"enum", 0, st_C_enum}, + {"import", C_JAVA, st_C_ignore}, + {"",}, {"",}, + {"enum", 0, st_C_enum}, + {"implements", C_JAVA, st_C_javastruct}, + {"struct", 0, st_C_struct}, + {"",}, {"",}, + {"ENTRY", 0, st_C_gnumacro}, + {"",}, {"",}, + {"explicit", C_PLPL, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"package", C_JAVA, st_C_ignore}, + {"",}, {"",}, {"",}, {"",}, {"",}, + {"unsigned", 0, st_C_typespec}, }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); - if (key <= MAX_HASH_VALUE && key >= 0) + if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) { register char *s = wordlist[key].name; @@ -1994,6 +1864,7 @@ } return 0; } +/* ending time is 10:15:52 */ /*%>*/ enum sym_type C_symtype PP ((char *str, int len, int c_ext)); @@ -2062,16 +1933,6 @@ char *structtag = ""; enum sym_type structtype; -#ifdef OO_BROWSER -void -oo_browser_check_and_clear_structtype() -{ - /* Allow for multiple enum_label tags. */ - if (structtype != st_C_enum) - structtype = st_none; -} -#endif - /* * When objdef is different from onone, objtag is the name of the class. */ @@ -2108,6 +1969,7 @@ oignore /* wait for @end */ } objdef; + /* * Use this structure to keep info about the token read, and how it * should be tagged. Used by the make_C_tag function to build a tag. @@ -2141,26 +2003,6 @@ */ int methodlen; -#ifdef OO_BROWSER -void -oo_browser_clear_all_globals() -{ - /* Initialize globals so there is no carry over between files. */ - oo_browser_construct = C_NULL; - fvdef = fvnone; typdef = tnone; structdef = snone; - definedef = dnone; objdef = onone; - structtype = st_none; - next_token_is_func = yacc_rules = FALSE; -} - -void -oo_browser_clear_some_globals() -{ - oo_browser_construct = C_NULL; - structtype = st_none; -} -#endif - /* * consider_token () * checks to see if the current token is at the start of a @@ -2197,33 +2039,6 @@ { enum sym_type toktype = C_symtype (str, len, c_ext); -#ifdef OO_BROWSER - switch (toktype) - { - case st_C_struct: - set_construct(C_STRUCTURE); - break; - case st_C_union: - set_construct(C_UNION); - break; - case st_C_class: - set_construct(C_CLASS); - break; - case st_C_enum: - set_construct(C_ENUMERATION); - break; - case st_C_typedef: - set_construct(C_TYPE); - break; - case st_C_extern: - set_construct(C_EXTERN); - break; - case st_C_inline: - set_construct(C_FUNCTION); - break; - } -#endif - /* * Advance the definedef state machine. */ @@ -2248,55 +2063,7 @@ * and constantypedefs is FALSE. */ definedef = dignorerest; -#ifndef OO_BROWSER *is_func_or_var = (c == '('); -#else - { - char *p = str + len * sizeof(char); - - if (*p == '(') - /* This must be a macro since there is no - whitespace between the opening parenthesis - and the definition name. */ - *is_func_or_var = TRUE; - else - { - *is_func_or_var = FALSE; - - /* Handle possible whitespace between macro tag and opening - parenthesis and ensure this is an actual macro. - -- Bob Weiner, Altrasoft, 11/19/1997 */ - while (*p && isspace(*p)) p++; - if (*p) c = *p; - - /* Skip over nested parentheses. */ - if (c == '(') - { - short depth = 1; - - while (*++p && depth > 0 && *p != '\n') - { - switch (*p) - { - case '(': - depth++; break; - case ')': - depth--; break; - } - } - - /* If this is a macro, we have just passed - the arguments and there will be more on - the line before the NULL character that marks - the end of the line token. */ - while (*p == ' ' || *p == '\t') p++; - if (*p) *is_func_or_var = TRUE; - } - } - } - - set_construct((*is_func_or_var) ? C_MACRO : C_CONSTANT); -#endif if (!*is_func_or_var && !constantypedefs) return FALSE; else @@ -2326,17 +2093,10 @@ { case st_none: case st_C_typespec: -#ifdef OO_BROWSER - case st_C_extern: -#endif typdef = tend; break; case st_C_struct: case st_C_enum: -#ifdef OO_BROWSER - case st_C_union: - case st_C_class: -#endif break; } /* Do not return here, so the structdef stuff has a chance. */ @@ -2347,11 +2107,6 @@ case st_C_typespec: case st_C_struct: case st_C_enum: -#ifdef OO_BROWSER - case st_C_extern: - case st_C_union: - case st_C_class: -#endif return FALSE; } return TRUE; @@ -2375,11 +2130,6 @@ return FALSE; case st_C_struct: case st_C_enum: -#ifdef OO_BROWSER - case st_C_union: - case st_C_class: - case st_C_extern: -#endif if (typdef == ttypedseen || (typedefs_and_cplusplus && cblev == 0 && structdef == snone)) { @@ -2393,13 +2143,7 @@ { /* Save the tag for struct/union/class, for functions and variables that may be defined inside. */ -#ifndef OO_BROWSER if (structtype == st_C_struct) -#else - if (structtype == st_C_struct - || structtype == st_C_union - || structtype == st_C_class) -#endif structtag = savenstr (str, len); else structtag = ""; @@ -2448,15 +2192,9 @@ switch (toktype) { case st_C_objprot: -#ifdef OO_BROWSER - set_construct(C_OBJC); -#endif objdef = oprotocol; return FALSE; case st_C_objimpl: -#ifdef OO_BROWSER - set_construct(C_OBJC); -#endif objdef = oimplementation; return FALSE; } @@ -2523,9 +2261,6 @@ switch (toktype) { case st_C_typespec: -#ifdef OO_BROWSER - case st_C_extern: -#endif if (fvdef != finlist && fvdef != fignore && fvdef != vignore) fvdef = fvnone; /* should be useless */ return FALSE; @@ -2534,14 +2269,7 @@ return FALSE; case st_none: if (constantypedefs && structdef == sinbody && structtype == st_C_enum) -#ifdef OO_BROWSER - { - oo_browser_construct = C_ENUM_LABEL; -#endif return TRUE; -#ifdef OO_BROWSER - } -#endif if (fvdef == fvnone) { fvdef = fvnameseen; /* function or variable */ @@ -2818,9 +2546,6 @@ */ lp += 2; toklen += 3; -#ifdef OO_BROWSER - set_construct(C_METHOD); -#endif } else { @@ -2844,9 +2569,6 @@ newlb.buffer + tokoff, toklen); token_name.len = len; tok.named = TRUE; -#ifdef OO_BROWSER - oo_browser_construct = C_METHOD; -#endif } else if (objdef == ocatseen) /* Objective C category */ @@ -2860,18 +2582,12 @@ strcat (token_name.buffer, ")"); token_name.len = len; tok.named = TRUE; -#ifdef OO_BROWSER - oo_browser_construct = C_OBJC; -#endif } else if (objdef == omethodtag || objdef == omethodparm) /* Objective C method */ { tok.named = TRUE; -#ifdef OO_BROWSER - oo_browser_construct = C_OBJC; -#endif } else { @@ -2881,26 +2597,10 @@ token_name.buffer[toklen] = '\0'; token_name.len = toklen; /* Name macros. */ - tok.named - = (structdef == stagseen - || typdef == tend -#ifdef OO_BROWSER - /* Also name #define constants, - enumerations and enum_labels. - Conditionalize `funorvar' reference - here or #defines will appear without - their #names. - -- Bob Weiner, Altrasoft, 4/25/1998 */ - || ((oo_browser_format || funorvar) - && definedef == dignorerest) - || (oo_browser_format - && (oo_browser_construct == C_ENUMERATION - || oo_browser_construct == C_ENUM_LABEL)) -#else - || (funorvar - && definedef == dignorerest) -#endif - ); + tok.named = (structdef == stagseen + || typdef == tend + || (funorvar + && definedef == dignorerest)); } tok.lineno = lineno; tok.linelen = tokoff + toklen + 1; @@ -2940,9 +2640,6 @@ fvdef = finlist; continue; case flistseen: -#ifdef OO_BROWSER - set_construct(C_MACRO); -#endif make_C_tag (TRUE); /* a function */ fvdef = fignore; break; @@ -3013,9 +2710,6 @@ switch (typdef) { case tend: -#ifdef OO_BROWSER - set_construct(C_TYPE); -#endif make_C_tag (FALSE); /* a typedef */ /* FALLTHRU */ default: @@ -3026,30 +2720,8 @@ case fignore: break; case fvnameseen: -#ifndef OO_BROWSER if ((globals && cblev == 0) || (members && cblev == 1)) make_C_tag (FALSE); /* a variable */ -#else - if (constantypedefs && structdef == snone) - { - tok.named = TRUE; - switch (structtype) - { - case st_C_enum: - set_construct(C_ENUMERATION); - break; - case st_C_class: - set_construct(C_CLASS); - break; - default: - set_construct(C_VARIABLE); - break; - } - make_C_tag (FALSE); - /* Force reset of st_C_enum structtype value. */ - structtype = st_none; - } -#endif /* FALLTHRU */ default: fvdef = fvnone; @@ -3093,9 +2765,6 @@ break; if (cblev == 0 && typdef == tend) { -#ifdef OO_BROWSER - set_construct(C_TYPE); -#endif typdef = tignore; make_C_tag (FALSE); /* a typedef */ break; @@ -3107,30 +2776,8 @@ case vignore: break; case fvnameseen: -#ifndef OO_BROWSER if ((globals && cblev == 0) || (members && cblev == 1)) make_C_tag (FALSE); /* a variable */ -#else - if (constantypedefs && structdef == snone) - { - tok.named = TRUE; - switch (structtype) - { - case st_C_enum: - set_construct(C_ENUMERATION); - break; - case st_C_class: - set_construct(C_CLASS); - break; - default: - set_construct(C_VARIABLE); - break; - } - make_C_tag (FALSE); - /* Force reset of st_C_enum structtype value. */ - structtype = st_none; - } -#endif /* FALLTHRU */ default: fvdef = fvnone; @@ -3154,9 +2801,6 @@ { /* This handles constructs like: typedef void OperatorFun (int fun); */ -#ifdef OO_BROWSER - set_construct(C_TYPE); -#endif make_C_tag (FALSE); typdef = tignore; } @@ -3191,9 +2835,6 @@ } if (cblev == 0 && typdef == tend) { -#ifdef OO_BROWSER - set_construct(C_TYPE); -#endif typdef = tignore; make_C_tag (FALSE); /* a typedef */ } @@ -3221,12 +2862,6 @@ switch (fvdef) { case flistseen: -#ifdef OO_BROWSER - set_construct(C_FUNCTION); - /* Ensure function name is recorded. - -- Bob Weiner, Altrasoft */ - tok.named = TRUE; -#endif make_C_tag (TRUE); /* a function */ /* FALLTHRU */ case fignore: @@ -3282,11 +2917,6 @@ structdef = snone; structtag = ""; -#ifdef OO_BROWSER - /* Next line added to avoid any state carryover between - functions. -- Bob Weiner, Altrasoft, 11/19/1997 */ - fvdef = fvnone; oo_browser_construct = C_NULL; -#endif } break; case '=': @@ -3299,31 +2929,8 @@ case vignore: break; case fvnameseen: -#ifndef OO_BROWSER if ((globals && cblev == 0) || (members && cblev == 1)) make_C_tag (FALSE); /* a variable */ -#else - if (constantypedefs) - { - tok.named = TRUE; - switch (structtype) - { - case st_C_enum: - set_construct(C_ENUMERATION); - break; - case st_C_class: - set_construct(C_CLASS); - break; - default: - /* a global variable */ - set_construct(C_VARIABLE); - break; - } - make_C_tag (FALSE); - /* Force reset of st_C_enum structtype value. */ - structtype = st_none; - } -#endif /* FALLTHRU */ default: fvdef = vignore; diff -r 090b52736db2 -r c42ec1d1cded lib-src/ootags.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/ootags.c Mon Aug 13 10:33:18 2007 +0200 @@ -0,0 +1,5426 @@ +/* Tags file maker to go with GNU Emacs + Copyright (C) 1984, 87, 88, 89, 93, 94, 95 + Free Software Foundation, Inc. and Ken Arnold + +This file is not considered part of GNU Emacs. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + * Authors: + * Ctags originally by Ken Arnold. + * Fortran added by Jim Kleckner. + * Ed Pelegri-Llopart added C typedefs. + * Gnu Emacs TAGS format and modifications by RMS? + * Sam Kendall added C++. + * Francesco Potorti` reorganised C and C++ based on work by Joe Wells. + * Regexp tags by Tom Tromey. + * + * Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer. + */ + +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 + /* 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 + +#ifndef DEBUG +# define DEBUG FALSE +#endif + +#ifdef MSDOS +# include +# include +# include +# ifndef HAVE_CONFIG_H +# define DOS_NT +# include +# endif +#endif /* MSDOS */ + +#ifdef WINDOWSNT +# include +# include +# include +# include +# define MAXPATHLEN _MAX_PATH +# ifdef HAVE_CONFIG_H +# undef HAVE_NTGUI +# else +# define DOS_NT +# define HAVE_GETCWD +# endif /* not HAVE_CONFIG_H */ +#endif /* WINDOWSNT */ + +#if !defined (WINDOWSNT) && defined (STDC_HEADERS) +#include +#include +#endif + +#ifdef HAVE_UNISTD_H +# include +#else +# ifdef HAVE_GETCWD + extern char *getcwd (); +# endif +#endif /* HAVE_UNISTD_H */ + +#include +#include +#include +#ifndef errno + extern int errno; +#endif +#include +#include + +#if !defined (S_ISREG) && defined (S_IFREG) +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif + +#ifdef LONG_OPTIONS +# include +#else +# define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr) + extern char *optarg; + extern int optind, opterr; +#endif /* LONG_OPTIONS */ + +#ifdef ETAGS_REGEXPS +# include +#endif /* ETAGS_REGEXPS */ + +/* Define CTAGS to make the program "ctags" compatible with the usual one. + Leave it undefined to make the program "etags", which makes emacs-style + tag tables and tags typedefs, #defines and struct/union/enum by default. */ +#ifdef CTAGS +# undef CTAGS +# define CTAGS TRUE +#else +# define CTAGS FALSE +#endif + +/* Exit codes for success and failure. */ +#ifdef VMS +# define GOOD 1 +# define BAD 0 +#else +# define GOOD 0 +# define BAD 1 +#endif + +/* C extensions. */ +#define C_PLPL 0x00001 /* C++ */ +#define C_STAR 0x00003 /* C* */ +#define C_JAVA 0x00005 /* JAVA */ +#define YACC 0x10000 /* yacc file */ + +#define streq(s,t) ((DEBUG && (s) == NULL && (t) == NULL \ + && (abort (), 1)) || !strcmp (s, t)) +#define strneq(s,t,n) ((DEBUG && (s) == NULL && (t) == NULL \ + && (abort (), 1)) || !strncmp (s, t, n)) + +#define lowcase(c) tolower ((char)c) + +#define CHARS 256 /* 2^sizeof(char) */ +#define CHAR(x) ((unsigned int)x & (CHARS - 1)) +#define iswhite(c) (_wht[CHAR(c)]) /* c is white */ +#define notinname(c) (_nin[CHAR(c)]) /* c is not in a name */ +#define begtoken(c) (_btk[CHAR(c)]) /* c can start token */ +#define intoken(c) (_itk[CHAR(c)]) /* c can be in token */ +#define endtoken(c) (_etk[CHAR(c)]) /* c ends tokens */ + +/*#ifdef INFODOCK*/ +/*#undef OO_BROWSER*/ +/* Due to the way this file is constructed, this unfortunately doesn't */ +/* work except for documentation purposes. -slb */ +#define OO_BROWSER 1 +/*#endif*/ + +#ifdef OO_BROWSER +#define set_construct(construct) \ + if (!oo_browser_construct) oo_browser_construct = construct +void oo_browser_clear_all_globals(); +void oo_browser_clear_some_globals(); +void oo_browser_check_and_clear_structtype(); +#endif + +/* + * xnew, xrnew -- allocate, reallocate storage + * + * SYNOPSIS: Type *xnew (int n, Type); + * Type *xrnew (OldPointer, int n, Type); + */ +#ifdef chkmalloc +# include "chkmalloc.h" +# define xnew(n,Type) ((Type *) trace_malloc (__FILE__, __LINE__, \ + (n) * sizeof (Type))) +# define xrnew(op,n,Type) ((Type *) trace_realloc (__FILE__, __LINE__, \ + (op), (n) * sizeof (Type))) +#else +# define xnew(n,Type) ((Type *) xmalloc ((n) * sizeof (Type))) +# define xrnew(op,n,Type) ((Type *) xrealloc ((op), (n) * sizeof (Type))) +#endif + +typedef int bool; + +typedef void Lang_function (); + +typedef struct +{ + char *name; + Lang_function *function; + char **suffixes; + char **interpreters; +} language; + +typedef struct node_st +{ /* sorting structure */ + char *name; /* function or type name */ +#ifdef OO_BROWSER + short int construct; /* Construct type for the OO-Browser */ +#endif + char *file; /* file name */ + bool is_func; /* use pattern or line no */ + bool been_warned; /* set if noticed dup */ + int lno; /* line number tag is on */ + long cno; /* character number line starts on */ + char *pat; /* search pattern */ + struct node_st *left, *right; /* left and right sons */ +} node; + +#ifdef OO_BROWSER +/* If you add to this array, you must add a corresponding entry to the + following enum. */ +static char *oo_browser_default_classes[] = + /* Lack of square brackets around some of these entries are intentional. */ + {"null", "class", "method", "[constant]", "[enumeration]", "[enum_label]", + "extern", "[function]", "[macro]", "objc", "[structure]", "[type]", + "[union]", "[variable]"}; + +/* If you add to this enum, you must add a corresponding entry to the + preceding array. */ +enum oo_browser_constructs {C_NULL, C_CLASS, C_METHOD, C_CONSTANT, C_ENUMERATION, + C_ENUM_LABEL, C_EXTERN, C_FUNCTION, C_MACRO, + C_OBJC, C_STRUCTURE, C_TYPE, C_UNION, C_VARIABLE}; + +enum oo_browser_constructs oo_browser_construct = C_NULL; +#endif + +/* + * A `linebuffer' is a structure which holds a line of text. + * `readline_internal' reads a line from a stream into a linebuffer + * and works regardless of the length of the line. + * SIZE is the size of BUFFER, LEN is the length of the string in + * BUFFER after readline reads it. + */ +typedef struct +{ + long size; + int len; + char *buffer; +} linebuffer; + +extern char *getenv PP ((const char *envvar)); + +/* Many compilers barf on this: + Lang_function Asm_labels; + so let's write it this way */ +void Asm_labels PP ((FILE *inf)); +void C_entries PP ((int c_ext, FILE *inf)); +void default_C_entries PP ((FILE *inf)); +void plain_C_entries PP ((FILE *inf)); +void Cjava_entries PP ((FILE *inf)); +void Cplusplus_entries PP ((FILE *inf)); +void Yacc_entries PP ((FILE *inf)); +void Cobol_paragraphs PP ((FILE *inf)); +void Cstar_entries PP ((FILE *inf)); +void Erlang_functions PP ((FILE *inf)); +void Fortran_functions PP ((FILE *inf)); +void Lisp_functions PP ((FILE *inf)); +void Pascal_functions PP ((FILE *inf)); +void Perl_functions PP ((FILE *inf)); +void Postscript_functions PP ((FILE *inf)); +void Prolog_functions PP ((FILE *inf)); +void Python_functions PP ((FILE *inf)); +void Scheme_functions PP ((FILE *inf)); +void TeX_functions PP ((FILE *inf)); +void just_read_file PP ((FILE *inf)); + +void print_language_names PP ((void)); +void print_version PP ((void)); +void print_help PP ((void)); + +language *get_language_from_name PP ((char *name)); +language *get_language_from_interpreter PP ((char *interpreter)); +language *get_language_from_suffix PP ((char *suffix)); +int total_size_of_entries PP ((node *np)); +long readline PP ((linebuffer *lbp, FILE *stream)); +long readline_internal PP ((linebuffer *lbp, FILE *stream)); +#ifdef ETAGS_REGEXPS +void analyse_regex PP ((char *regex_arg)); +void add_regex PP ((char *regexp_pattern, language *lang)); +void free_patterns PP ((void)); +#endif /* ETAGS_REGEXPS */ +void error PP ((const char *s1, const char *s2)); +void suggest_asking_for_help PP ((void)); +void fatal PP ((char *s1, char *s2)); +void pfatal PP ((char *s1)); +void add_node PP ((node *np, node **cur_node_p)); + +void init PP ((void)); +void initbuffer PP ((linebuffer *lbp)); +void find_entries PP ((char *file, FILE *inf)); +void free_tree PP ((node *np)); +void pfnote PP ((char *name, bool is_func, char *linestart, int linelen, int lno, long cno)); +void new_pfnote PP ((char *name, int namelen, bool is_func, char *linestart, int linelen, int lno, long cno)); +void process_file PP ((char *file)); +void put_entries PP ((node *np)); +void takeprec PP ((void)); + +char *concat PP ((char *s1, char *s2, char *s3)); +char *skip_spaces PP ((char *cp)); +char *skip_non_spaces PP ((char *cp)); +char *savenstr PP ((char *cp, int len)); +char *savestr PP ((char *cp)); +char *etags_strchr PP ((char *sp, int c)); +char *etags_strrchr PP ((char *sp, int c)); +char *etags_getcwd PP ((void)); +char *relative_filename PP ((char *file, char *dir)); +char *absolute_filename PP ((char *file, char *dir)); +char *absolute_dirname PP ((char *file, char *dir)); +bool filename_is_absolute PP ((char *fn)); +void canonicalize_filename PP ((char *fn)); +void grow_linebuffer PP ((linebuffer *lbp, int toksize)); +long *xmalloc PP ((unsigned int size)); +long *xrealloc PP ((char *ptr, unsigned int size)); + + +char searchar = '/'; /* use /.../ searches */ + +char *tagfile; /* output file */ +char *progname; /* name this program was invoked with */ +char *cwd; /* current working directory */ +char *tagfiledir; /* directory of tagfile */ +FILE *tagf; /* ioptr for tags file */ + +char *curfile; /* current input file name */ +language *curlang; /* current language */ + +int lineno; /* line number of current line */ +long charno; /* current character number */ +long linecharno; /* charno of start of current line */ +char *dbp; /* pointer to start of current tag */ +node *head; /* the head of the binary tree of tags */ + +linebuffer lb; /* the current line */ +linebuffer token_name; /* used by C_entries as a temporary area */ +struct +{ + long linepos; + linebuffer lb; /* used by C_entries instead of lb */ +} lbs[2]; + +/* boolean "functions" (see init) */ +bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS]; +char + /* white chars */ + *white = " \f\t\n\r", + /* not in a name */ + *nonam = " \f\t\n\r(=,[;", + /* token ending chars */ + *endtk = " \t\n\r\"'#()[]{}=-+%*/&|^~!<>;,.:?", + /* token starting chars */ + *begtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$~@", + /* valid in-token chars */ + *midtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789"; + +bool append_to_tagfile; /* -a: append to tags */ +/* The following four default to TRUE for etags, but to FALSE for ctags. */ +bool typedefs; /* -t: create tags for C typedefs */ +bool typedefs_and_cplusplus; /* -T: create tags for C typedefs, level */ + /* 0 struct/enum/union decls, and C++ */ + /* member functions. */ +bool constantypedefs; /* -d: create tags for C #define, enum */ + /* constants and variables. */ + /* -D: opposite of -d. Default under ctags. */ +bool globals; /* create tags for global variables */ +bool members; /* create tags for C member variables */ +bool update; /* -u: update tags */ +bool vgrind_style; /* -v: create vgrind style index output */ +bool no_warnings; /* -w: suppress warnings */ +bool cxref_style; /* -x: create cxref style output */ +bool cplusplus; /* .[hc] means C++, not C */ +bool noindentypedefs; /* -I: ignore indentation in C */ +#ifdef OO_BROWSER +bool oo_browser_format; /* -O: OO-Browser tags format */ +#endif + +#ifdef LONG_OPTIONS +struct option longopts[] = +{ + { "append", no_argument, NULL, 'a' }, + { "backward-search", no_argument, NULL, 'B' }, + { "c++", no_argument, NULL, 'C' }, + { "cxref", no_argument, NULL, 'x' }, + { "defines", no_argument, NULL, 'd' }, + { "no-defines", no_argument, NULL, 'D' }, + { "globals", no_argument, &globals, TRUE }, + { "no-globals", no_argument, &globals, FALSE }, + { "help", no_argument, NULL, 'h' }, + { "help", no_argument, NULL, 'H' }, + { "ignore-indentation", no_argument, NULL, 'I' }, + { "include", required_argument, NULL, 'i' }, + { "language", required_argument, NULL, 'l' }, + { "members", no_argument, &members, TRUE }, + { "no-members", no_argument, &members, FALSE }, + { "no-warn", no_argument, NULL, 'w' }, + { "output", required_argument, NULL, 'o' }, +#ifdef OO_BROWSER + { "oo-browser", no_argument, NULL, 'O' }, +#endif +#ifdef ETAGS_REGEXPS + { "regex", required_argument, NULL, 'r' }, + { "no-regex", no_argument, NULL, 'R' }, +#endif /* ETAGS_REGEXPS */ + { "typedefs", no_argument, NULL, 't' }, + { "typedefs-and-c++", no_argument, NULL, 'T' }, + { "update", no_argument, NULL, 'u' }, + { "version", no_argument, NULL, 'V' }, + { "vgrind", no_argument, NULL, 'v' }, + { 0 } +}; +#endif /* LONG_OPTIONS */ + +#ifdef ETAGS_REGEXPS +/* Structure defining a regular expression. Elements are + the compiled pattern, and the name string. */ +typedef struct pattern +{ + struct pattern *p_next; + language *language; + char *regex; + struct re_pattern_buffer *pattern; + struct re_registers regs; + char *name_pattern; + bool error_signaled; +} pattern; + +/* Array of all regexps. */ +pattern *p_head = NULL; +#endif /* ETAGS_REGEXPS */ + +/* + * Language stuff. + */ + +/* Non-NULL if language fixed. */ +language *forced_lang = NULL; + +/* Assembly code */ +char *Asm_suffixes [] = { "a", /* Unix assembler */ + "asm", /* Microcontroller assembly */ + "def", /* BSO/Tasking definition includes */ + "inc", /* Microcontroller include files */ + "ins", /* Microcontroller include files */ + "s", "sa", /* Unix assembler */ + "src", /* BSO/Tasking C compiler output */ + NULL + }; + +/* Note that .c and .h can be considered C++, if the --c++ flag was + given. That is why default_C_entries is called here. */ +char *default_C_suffixes [] = + { "c", "h", NULL }; + +char *Cplusplus_suffixes [] = + { "C", "H", "c++", "cc", "cpp", "cxx", "h++", "hh", "hpp", "hxx", + "M", /* Objective C++ */ + "pdb", /* Postscript with C syntax */ + NULL }; + +char *Cjava_suffixes [] = + { "java", NULL }; + +char *Cobol_suffixes [] = + { "COB", "cob", NULL }; + +char *Cstar_suffixes [] = + { "cs", "hs", NULL }; + +char *Erlang_suffixes [] = + { "erl", "hrl", NULL }; + +char *Fortran_suffixes [] = + { "F", "f", "f90", "for", NULL }; + +char *Lisp_suffixes [] = + { "cl", "clisp", "el", "l", "lisp", "lsp", "ml", NULL }; + +char *Pascal_suffixes [] = + { "p", "pas", NULL }; + +char *Perl_suffixes [] = + { "pl", "pm", NULL }; +char *Perl_interpreters [] = + { "perl", "@PERL@", NULL }; + +char *plain_C_suffixes [] = + { "pc", /* Pro*C file */ + "m", /* Objective C file */ + "lm", /* Objective lex file */ + NULL }; + +char *Postscript_suffixes [] = + { "ps", NULL }; + +char *Prolog_suffixes [] = + { "prolog", NULL }; + +char *Python_suffixes [] = + { "py", NULL }; + +/* Can't do the `SCM' or `scm' prefix with a version number. */ +char *Scheme_suffixes [] = + { "SCM", "SM", "oak", "sch", "scheme", "scm", "sm", "ss", "t", NULL }; + +char *TeX_suffixes [] = + { "TeX", "bib", "clo", "cls", "ltx", "sty", "tex", NULL }; + +char *Yacc_suffixes [] = + { "y", "ym", NULL }; /* .ym is Objective yacc file */ + +/* + * Table of languages. + * + * It is ok for a given function to be listed under more than one + * name. I just didn't. + */ + +language lang_names [] = +{ + { "asm", Asm_labels, Asm_suffixes, NULL }, + { "c", default_C_entries, default_C_suffixes, NULL }, + { "c++", Cplusplus_entries, Cplusplus_suffixes, NULL }, + { "c*", Cstar_entries, Cstar_suffixes, NULL }, + { "cobol", Cobol_paragraphs, Cobol_suffixes, NULL }, + { "erlang", Erlang_functions, Erlang_suffixes, NULL }, + { "fortran", Fortran_functions, Fortran_suffixes, NULL }, + { "java", Cjava_entries, Cjava_suffixes, NULL }, + { "lisp", Lisp_functions, Lisp_suffixes, NULL }, + { "pascal", Pascal_functions, Pascal_suffixes, NULL }, + { "perl", Perl_functions, Perl_suffixes, Perl_interpreters }, + { "postscript", Postscript_functions, Postscript_suffixes, NULL }, + { "proc", plain_C_entries, plain_C_suffixes, NULL }, + { "prolog", Prolog_functions, Prolog_suffixes, NULL }, + { "python", Python_functions, Python_suffixes, NULL }, + { "scheme", Scheme_functions, Scheme_suffixes, NULL }, + { "tex", TeX_functions, TeX_suffixes, NULL }, + { "yacc", Yacc_entries, Yacc_suffixes, NULL }, + { "auto", NULL }, /* default guessing scheme */ + { "none", just_read_file }, /* regexp matching only */ + { NULL, NULL } /* end of list */ +}; + + +void +print_language_names () +{ + language *lang; + char **ext; + + puts ("\nThese are the currently supported languages, along with the\n\ +default file name suffixes:"); + for (lang = lang_names; lang->name != NULL; lang++) + { + printf ("\t%s\t", lang->name); + if (lang->suffixes != NULL) + for (ext = lang->suffixes; *ext != NULL; ext++) + printf (" .%s", *ext); + puts (""); + } + puts ("Where `auto' means use default language for files based on file\n\ +name suffix, and `none' means only do regexp processing on files.\n\ +If no language is specified and no matching suffix is found,\n\ +the first line of the file is read for a sharp-bang (#!) sequence\n\ +followed by the name of an interpreter. If no such sequence is found,\n\ +Fortran is tried first; if no tags are found, C is tried next."); +} + +#ifndef VERSION +# define VERSION "20" +#endif +void +print_version () +{ + printf ("%s (GNU Emacs %s)\n", (CTAGS) ? "ctags" : "etags", VERSION); + puts ("Copyright (C) 1996 Free Software Foundation, Inc. and Ken Arnold"); + puts ("This program is distributed under the same terms as Emacs"); + + exit (GOOD); +} + +void +print_help () +{ + printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ +\n\ +These are the options accepted by %s.\n", progname, progname); +#ifdef LONG_OPTIONS + puts ("You may use unambiguous abbreviations for the long option names."); +#else + puts ("Long option names do not work with this executable, as it is not\n\ +linked with GNU getopt."); +#endif /* LONG_OPTIONS */ + puts ("A - as file name means read names from stdin (one per line)."); + if (!CTAGS) + printf (" Absolute names are stored in the output file as they are.\n\ +Relative ones are stored relative to the output file's directory."); + puts ("\n"); + + puts ("-a, --append\n\ + Append tag entries to existing tags file."); + + if (CTAGS) + puts ("-B, --backward-search\n\ + Write the search commands for the tag entries using '?', the\n\ + backward-search command instead of '/', the forward-search command."); + + puts ("-C, --c++\n\ + Treat files whose name suffix defaults to C language as C++ files."); + + if (CTAGS) + puts ("-d, --defines\n\ + Create tag entries for C #define constants and enum constants, too."); + else + puts ("-D, --no-defines\n\ + Don't create tag entries for C #define constants and enum constants.\n\ + This makes the tags file smaller."); + + if (!CTAGS) + { + puts ("-i FILE, --include=FILE\n\ + Include a note in tag file indicating that, when searching for\n\ + a tag, one should also consult the tags file FILE after\n\ + checking the current file."); + puts ("-l LANG, --language=LANG\n\ + Force the following files to be considered as written in the\n\ + named language up to the next --language=LANG option."); + } + + if (CTAGS) + puts ("--globals\n\ + Create tag entries for global variables in some languages."); + else + puts ("--no-globals\n\ + Do not create tag entries for global variables in some\n\ + languages. This makes the tags file smaller."); + puts ("--members\n\ + Create tag entries for member variables in C and derived languages."); + +#ifdef ETAGS_REGEXPS + puts ("-r /REGEXP/, --regex=/REGEXP/ or --regex=@regexfile\n\ + Make a tag for each line matching pattern REGEXP in the\n\ + following files. regexfile is a file containing one REGEXP\n\ + per line. REGEXP is anchored (as if preceded by ^).\n\ + The form /REGEXP/NAME/ creates a named tag. For example Tcl\n\ + named tags can be created with:\n\ + --regex=/proc[ \\t]+\\([^ \\t]+\\)/\\1/."); + puts ("-R, --no-regex\n\ + Don't create tags from regexps for the following files."); +#endif /* ETAGS_REGEXPS */ + puts ("-o FILE, --output=FILE\n\ + Write the tags to FILE."); +#ifdef OO_BROWSER + puts ("-O, --oo-browser\n\ + Generate a specialized tags format used only by the Altrasoft OO-Browser."); +#endif + puts ("-I, --ignore-indentation\n\ + Don't rely on indentation quite as much as normal. Currently,\n\ + this means not to assume that a closing brace in the first\n\ + column is the final brace of a function or structure\n\ + definition in C and C++."); + + if (CTAGS) + { + puts ("-t, --typedefs\n\ + Generate tag entries for C typedefs."); + puts ("-T, --typedefs-and-c++\n\ + Generate tag entries for C typedefs, C struct/enum/union tags,\n\ + and C++ member functions."); + puts ("-u, --update\n\ + Update the tag entries for the given files, leaving tag\n\ + entries for other files in place. Currently, this is\n\ + implemented by deleting the existing entries for the given\n\ + files and then rewriting the new entries at the end of the\n\ + tags file. It is often faster to simply rebuild the entire\n\ + tag file than to use this."); + puts ("-v, --vgrind\n\ + Generates an index of items intended for human consumption,\n\ + similar to the output of vgrind. The index is sorted, and\n\ + gives the page number of each item."); + puts ("-w, --no-warn\n\ + Suppress warning messages about entries defined in multiple\n\ + files."); + puts ("-x, --cxref\n\ + Like --vgrind, but in the style of cxref, rather than vgrind.\n\ + The output uses line numbers instead of page numbers, but\n\ + beyond that the differences are cosmetic; try both to see\n\ + which you like."); + } + + puts ("-V, --version\n\ + Print the version of the program.\n\ +-h, --help\n\ + Print this help message."); + + print_language_names (); + + puts (""); + puts ("Report bugs to bug-gnu-emacs@prep.ai.mit.edu"); + + exit (GOOD); +} + + +enum argument_type +{ + at_language, + at_regexp, + at_filename +}; + +/* This structure helps us allow mixing of --lang and file names. */ +typedef struct +{ + enum argument_type arg_type; + char *what; + language *lang; +} argument; + +#ifdef VMS /* VMS specific functions */ + +#define EOS '\0' + +/* This is a BUG! ANY arbitrary limit is a BUG! + Won't someone please fix this? */ +#define MAX_FILE_SPEC_LEN 255 +typedef struct { + short curlen; + char body[MAX_FILE_SPEC_LEN + 1]; +} vspec; + +/* + v1.05 nmm 26-Jun-86 fn_exp - expand specification of list of file names + returning in each successive call the next file name matching the input + spec. The function expects that each in_spec passed + to it will be processed to completion; in particular, up to and + including the call following that in which the last matching name + is returned, the function ignores the value of in_spec, and will + only start processing a new spec with the following call. + If an error occurs, on return out_spec contains the value + of in_spec when the error occurred. + + With each successive file name returned in out_spec, the + function's return value is one. When there are no more matching + names the function returns zero. If on the first call no file + matches in_spec, or there is any other error, -1 is returned. +*/ + +#include +#include +#define OUTSIZE MAX_FILE_SPEC_LEN +short +fn_exp (out, in) + vspec *out; + char *in; +{ + static long context = 0; + static struct dsc$descriptor_s o; + static struct dsc$descriptor_s i; + static bool pass1 = TRUE; + long status; + short retval; + + if (pass1) + { + pass1 = FALSE; + o.dsc$a_pointer = (char *) out; + o.dsc$w_length = (short)OUTSIZE; + i.dsc$a_pointer = in; + i.dsc$w_length = (short)strlen(in); + i.dsc$b_dtype = DSC$K_DTYPE_T; + i.dsc$b_class = DSC$K_CLASS_S; + o.dsc$b_dtype = DSC$K_DTYPE_VT; + o.dsc$b_class = DSC$K_CLASS_VS; + } + if ((status = lib$find_file(&i, &o, &context, 0, 0)) == RMS$_NORMAL) + { + out->body[out->curlen] = EOS; + return 1; + } + else if (status == RMS$_NMF) + retval = 0; + else + { + strcpy(out->body, in); + retval = -1; + } + lib$find_file_end(&context); + pass1 = TRUE; + return retval; +} + +/* + v1.01 nmm 19-Aug-85 gfnames - return in successive calls the + name of each file specified by the provided arg expanding wildcards. +*/ +char * +gfnames (arg, p_error) + char *arg; + bool *p_error; +{ + static vspec filename = {MAX_FILE_SPEC_LEN, "\0"}; + + switch (fn_exp (&filename, arg)) + { + case 1: + *p_error = FALSE; + return filename.body; + case 0: + *p_error = FALSE; + return NULL; + default: + *p_error = TRUE; + return filename.body; + } +} + +#ifndef OLD /* Newer versions of VMS do provide `system'. */ +system (cmd) + char *cmd; +{ + error ("%s", "system() function not implemented under VMS"); +} +#endif + +#define VERSION_DELIM ';' +char *massage_name (s) + char *s; +{ + char *start = s; + + for ( ; *s; s++) + if (*s == VERSION_DELIM) + { + *s = EOS; + break; + } + else + *s = lowcase (*s); + return start; +} +#endif /* VMS */ + + +int +main (argc, argv) + int argc; + char *argv[]; +{ + int i; + unsigned int nincluded_files; + char **included_files; + char *this_file; + argument *argbuffer; + int current_arg, file_count; + linebuffer filename_lb; +#ifdef VMS + bool got_err; +#endif + +#ifdef DOS_NT + _fmode = O_BINARY; /* all of files are treated as binary files */ +#endif /* DOS_NT */ + + progname = argv[0]; + nincluded_files = 0; + included_files = xnew (argc, char *); + current_arg = 0; + file_count = 0; + + /* Allocate enough no matter what happens. Overkill, but each one + is small. */ + argbuffer = xnew (argc, argument); + +#ifdef ETAGS_REGEXPS + /* Set syntax for regular expression routines. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_INTERVALS); +#endif /* ETAGS_REGEXPS */ + + /* + * If etags, always find typedefs and structure tags. Why not? + * Also default is to find macro constants, enum constants and + * global variables. + */ + if (!CTAGS) + { + typedefs = typedefs_and_cplusplus = constantypedefs = TRUE; + globals = TRUE; + members = FALSE; + } + + while (1) + { + int opt; + char *optstring; + +#ifdef ETAGS_REGEXPS +#ifndef OO_BROWSER + optstring = "-aCdDf:Il:o:r:RStTi:BuvxwVhH"; +#else + optstring = "-aCdDf:Il:o:r:RStTi:BOuvxwVhH"; +#endif +#else +#ifndef OO_BROWSER + optstring = "-aCdDf:Il:o:StTi:BuvxwVhH"; +#else + optstring = "-aCdDf:Il:o:StTi:BOuvxwVhH"; +#endif +#endif /* ETAGS_REGEXPS */ + +#ifndef LONG_OPTIONS + optstring = optstring + 1; +#endif /* LONG_OPTIONS */ + + opt = getopt_long (argc, argv, optstring, longopts, 0); + if (opt == EOF) + break; + + switch (opt) + { + case 0: + /* If getopt returns 0, then it has already processed a + long-named option. We should do nothing. */ + break; + + case 1: + /* This means that a file name has been seen. Record it. */ + argbuffer[current_arg].arg_type = at_filename; + argbuffer[current_arg].what = optarg; + ++current_arg; + ++file_count; + break; + + /* Common options. */ + case 'a': append_to_tagfile = TRUE; break; + case 'C': cplusplus = TRUE; break; + case 'd': constantypedefs = TRUE; break; + case 'D': constantypedefs = FALSE; break; + case 'f': /* for compatibility with old makefiles */ + case 'o': + if (tagfile) + { + /* convert char to string, to call error with */ + char buf[2]; + sprintf (buf, "%c", opt); + error ("-%s option may only be given once.", buf); + suggest_asking_for_help (); + } + tagfile = optarg; + break; +#ifdef OO_BROWSER + case 'O': + oo_browser_format = TRUE; + break; +#endif + case 'I': + case 'S': /* for backward compatibility */ + noindentypedefs = TRUE; + break; + case 'l': + { + language *lang = get_language_from_name (optarg); + if (lang != NULL) + { + argbuffer[current_arg].lang = lang; + argbuffer[current_arg].arg_type = at_language; + ++current_arg; + } + } + break; +#ifdef ETAGS_REGEXPS + case 'r': + argbuffer[current_arg].arg_type = at_regexp; + argbuffer[current_arg].what = optarg; + ++current_arg; + break; + case 'R': + argbuffer[current_arg].arg_type = at_regexp; + argbuffer[current_arg].what = NULL; + ++current_arg; + break; +#endif /* ETAGS_REGEXPS */ + case 'V': + print_version (); + break; + case 'h': + case 'H': + print_help (); + break; + case 't': + typedefs = TRUE; + break; + case 'T': + typedefs = typedefs_and_cplusplus = TRUE; + break; +#if (!CTAGS) + /* Etags options */ + case 'i': + included_files[nincluded_files++] = optarg; + break; +#else /* CTAGS */ + /* Ctags options. */ + case 'B': searchar = '?'; break; + case 'u': update = TRUE; break; + case 'v': vgrind_style = TRUE; /*FALLTHRU*/ + case 'x': cxref_style = TRUE; break; + case 'w': no_warnings = TRUE; break; +#endif /* CTAGS */ + default: + suggest_asking_for_help (); + } + } + + for (; optind < argc; ++optind) + { + argbuffer[current_arg].arg_type = at_filename; + argbuffer[current_arg].what = argv[optind]; + ++current_arg; + ++file_count; + } + + if (nincluded_files == 0 && file_count == 0) + { + error ("no input files specified.", 0); + suggest_asking_for_help (); + } + + if (tagfile == NULL) + tagfile = CTAGS ? "tags" : "TAGS"; + cwd = etags_getcwd (); /* the current working directory */ + if (cwd[strlen (cwd) - 1] != '/') + { + char *oldcwd = cwd; + cwd = concat (oldcwd, "/", ""); + free (oldcwd); + } + if (streq (tagfile, "-")) + tagfiledir = cwd; + else + tagfiledir = absolute_dirname (tagfile, cwd); + + init (); /* set up boolean "functions" */ + + initbuffer (&lb); + initbuffer (&token_name); + initbuffer (&lbs[0].lb); + initbuffer (&lbs[1].lb); + initbuffer (&filename_lb); + + if (!CTAGS) + { + if (streq (tagfile, "-")) + { + tagf = stdout; +#ifdef DOS_NT + /* Switch redirected `stdout' to binary mode (setting `_fmode' + doesn't take effect until after `stdout' is already open). */ + if (!isatty (fileno (stdout))) + setmode (fileno (stdout), O_BINARY); +#endif /* DOS_NT */ + } + else + tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); + if (tagf == NULL) + pfatal (tagfile); + } + + /* + * Loop through files finding functions. + */ + for (i = 0; i < current_arg; ++i) + { + switch (argbuffer[i].arg_type) + { + case at_language: + forced_lang = argbuffer[i].lang; + break; +#ifdef ETAGS_REGEXPS + case at_regexp: + analyse_regex (argbuffer[i].what); + break; +#endif + case at_filename: +#ifdef VMS + while ((this_file = gfnames (argbuffer[i].what, &got_err)) != NULL) + { + if (got_err) + { + error ("can't find file %s\n", this_file); + argc--, argv++; + } + else + { + this_file = massage_name (this_file); + } +#else + this_file = argbuffer[i].what; +#endif +#ifdef OO_BROWSER + oo_browser_clear_all_globals(); +#endif + /* Input file named "-" means read file names from stdin + (one per line) and use them. */ + if (streq (this_file, "-")) + while (readline_internal (&filename_lb, stdin) > 0) +#ifdef OO_BROWSER + { + oo_browser_clear_some_globals(); +#endif + process_file (filename_lb.buffer); +#ifdef OO_BROWSER + } +#endif + else + process_file (this_file); +#ifdef VMS + } +#endif + break; + } + } + +#ifdef ETAGS_REGEXPS + free_patterns (); +#endif /* ETAGS_REGEXPS */ + + if (!CTAGS) + { + while (nincluded_files-- > 0) + fprintf (tagf, "\f\n%s,include\n", *included_files++); + + fclose (tagf); + exit (GOOD); + } + + /* If CTAGS, we are here. process_file did not write the tags yet, + because we want them ordered. Let's do it now. */ + if (cxref_style) + { + put_entries (head); + exit (GOOD); + } + + if (update) + { + char cmd[BUFSIZ]; + for (i = 0; i < current_arg; ++i) + { + if (argbuffer[i].arg_type != at_filename) + continue; + sprintf (cmd, + "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS", + tagfile, argbuffer[i].what, tagfile); + if (system (cmd) != GOOD) + fatal ("failed to execute shell command", (char *)NULL); + } + append_to_tagfile = TRUE; + } + + tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); + if (tagf == NULL) + pfatal (tagfile); + put_entries (head); + fclose (tagf); + + if (update) + { + char cmd[BUFSIZ]; + sprintf (cmd, "sort %s -o %s", tagfile, tagfile); + exit (system (cmd)); + } + return GOOD; +} + + +/* + * Return a language given the name. + */ +language * +get_language_from_name (name) + char *name; +{ + language *lang; + + if (name == NULL) + error ("empty language name", (char *)NULL); + else + { + for (lang = lang_names; lang->name != NULL; lang++) + if (streq (name, lang->name)) + return lang; + error ("unknown language \"%s\"", name); + } + + return NULL; +} + + +/* + * Return a language given the interpreter name. + */ +language * +get_language_from_interpreter (interpreter) + char *interpreter; +{ + language *lang; + char **iname; + + if (interpreter == NULL) + return NULL; + for (lang = lang_names; lang->name != NULL; lang++) + if (lang->interpreters != NULL) + for (iname = lang->interpreters; *iname != NULL; iname++) + if (streq (*iname, interpreter)) + return lang; + + return NULL; +} + + + +/* + * Return a language given the file suffix. + */ +language * +get_language_from_suffix (suffix) + char *suffix; +{ + language *lang; + char **ext; + + if (suffix == NULL) + return NULL; + for (lang = lang_names; lang->name != NULL; lang++) + if (lang->suffixes != NULL) + for (ext = lang->suffixes; *ext != NULL; ext++) + if (streq (*ext, suffix)) + return lang; + + return NULL; +} + + +/* + * This routine is called on each file argument. + */ +void +process_file (file) + char *file; +{ + struct stat stat_buf; + FILE *inf; + + canonicalize_filename (file); + if (stat (file, &stat_buf) == 0 && !S_ISREG (stat_buf.st_mode)) + { + error ("skipping %s: it is not a regular file.", file); + return; + } + if (streq (file, tagfile) && !streq (tagfile, "-")) + { + error ("skipping inclusion of %s in self.", file); + return; + } + inf = fopen (file, "r"); + if (inf == NULL) + { + perror (file); + return; + } + + find_entries (file, inf); + + if (!CTAGS) + { + char *filename; + + if (filename_is_absolute (file)) + { + /* file is an absolute file name. Canonicalise it. */ + filename = absolute_filename (file, cwd); + } + else + { + /* file is a file name relative to cwd. Make it relative + to the directory of the tags file. */ + filename = relative_filename (file, tagfiledir); + } +#ifdef OO_BROWSER + if (oo_browser_format) + fprintf (tagf, "\f\n%s\n", filename); + else +#endif + fprintf (tagf, "\f\n%s,%d\n", filename, total_size_of_entries (head)); + free (filename); + put_entries (head); + free_tree (head); + head = NULL; + } +} + +/* + * This routine sets up the boolean pseudo-functions which work + * by setting boolean flags dependent upon the corresponding character. + * Every char which is NOT in that string is not a white char. Therefore, + * all of the array "_wht" is set to FALSE, and then the elements + * subscripted by the chars in "white" are set to TRUE. Thus "_wht" + * of a char is TRUE if it is the string "white", else FALSE. + */ +void +init () +{ + register char *sp; + register int i; + + for (i = 0; i < CHARS; i++) + iswhite(i) = notinname(i) = begtoken(i) = intoken(i) = endtoken(i) = FALSE; + for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = TRUE; + for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = TRUE; + for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = TRUE; + for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = TRUE; + for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = TRUE; + iswhite('\0') = iswhite('\n'); + notinname('\0') = notinname('\n'); + begtoken('\0') = begtoken('\n'); + intoken('\0') = intoken('\n'); + endtoken('\0') = endtoken('\n'); +} + +/* + * This routine opens the specified file and calls the function + * which finds the function and type definitions. + */ +node *last_node = NULL; + +void +find_entries (file, inf) + char *file; + FILE *inf; +{ + char *cp; + language *lang; + node *old_last_node; + + curfile = savestr (file); + + /* If user specified a language, use it. */ + lang = forced_lang; + if (lang != NULL && lang->function != NULL) + { + curlang = lang; + lang->function (inf); + free (curfile); + fclose (inf); + return; + } + + cp = etags_strrchr (file, '.'); + if (cp != NULL) + { + cp += 1; + lang = get_language_from_suffix (cp); + if (lang != NULL && lang->function != NULL) + { + curlang = lang; + lang->function (inf); + free (curfile); + fclose (inf); + return; + } + } + + /* Look for sharp-bang as the first two characters. */ + if (readline_internal (&lb, inf) > 0 + && lb.len >= 2 + && lb.buffer[0] == '#' + && lb.buffer[1] == '!') + { + char *lp; + + /* Set lp to point at the first char after the last slash in the + line or, if no slashes, at the first nonblank. Then set cp to + the first successive blank and terminate the string. */ + lp = etags_strrchr (lb.buffer+2, '/'); + if (lp != NULL) + lp += 1; + else + lp = skip_spaces (lb.buffer + 2); + cp = skip_non_spaces (lp); + *cp = '\0'; + + if (strlen (lp) > 0) + { + lang = get_language_from_interpreter (lp); + if (lang != NULL && lang->function != NULL) + { + curlang = lang; + lang->function (inf); + fclose (inf); + free (curfile); + return; + } + } + } + rewind (inf); + + /* Try Fortran. */ + old_last_node = last_node; + curlang = get_language_from_name ("fortran"); + Fortran_functions (inf); + + /* No Fortran entries found. Try C. */ + if (old_last_node == last_node) + { + rewind (inf); + curlang = get_language_from_name (cplusplus ? "c++" : "c"); + default_C_entries (inf); + } + free (curfile); + fclose (inf); + return; +} + +/* Record a tag. */ +void +pfnote (name, is_func, linestart, linelen, lno, cno) + char *name; /* tag name, or NULL if unnamed */ + bool is_func; /* tag is a function */ + char *linestart; /* start of the line where tag is */ + int linelen; /* length of the line where tag is */ + int lno; /* line number */ + long cno; /* character number */ +{ + register node *np; + + if (CTAGS && name == NULL) + return; + + np = xnew (1, node); + + /* If ctags mode, change name "main" to M. */ + if (CTAGS && !cxref_style && streq (name, "main")) + { + register char *fp = etags_strrchr (curfile, '/'); + np->name = concat ("M", fp == 0 ? curfile : fp + 1, ""); + fp = etags_strrchr (np->name, '.'); + if (fp && fp[1] != '\0' && fp[2] == '\0') + fp[0] = 0; + } + else + np->name = name; + np->been_warned = FALSE; + np->file = curfile; + np->is_func = is_func; + np->lno = lno; + /* Our char numbers are 0-base, because of C language tradition? + ctags compatibility? old versions compatibility? I don't know. + Anyway, since emacs's are 1-base we expect etags.el to take care + of the difference. If we wanted to have 1-based numbers, we would + uncomment the +1 below. */ + np->cno = cno /* + 1 */ ; + np->left = np->right = NULL; + if (CTAGS && !cxref_style) + { + if (strlen (linestart) < 50) + np->pat = concat (linestart, "$", ""); + else + np->pat = savenstr (linestart, 50); + } + else + np->pat = savenstr (linestart, linelen); + +#ifdef OO_BROWSER + if (oo_browser_format) + np->construct = oo_browser_construct; + oo_browser_construct = C_NULL; + oo_browser_check_and_clear_structtype(); +#endif + + add_node (np, &head); +} + +/* Date: Wed, 22 Jan 1997 02:56:31 -0500 [last amended 18 Sep 1997] + * From: Sam Kendall + * Subject: Proposal for firming up the TAGS format specification + * To: F.Potorti@cnuce.cnr.it + * + * pfnote should emit the optimized form [unnamed tag] only if: + * 1. name does not contain any of the characters " \t\r\n(),;"; + * 2. linestart contains name as either a rightmost, or rightmost but + * one character, substring; + * 3. the character, if any, immediately before name in linestart must + * be one of the characters " \t(),;"; + * 4. the character, if any, immediately after name in linestart must + * also be one of the characters " \t(),;". + * + * The real implementation uses the notinname() macro, which recognises + * characters slightly different form " \t\r\n(),;". See the variable + * `nonam'. + */ +#define traditional_tag_style TRUE +void +new_pfnote (name, namelen, is_func, linestart, linelen, lno, cno) + char *name; /* tag name, or NULL if unnamed */ + int namelen; /* tag length */ + bool is_func; /* tag is a function */ + char *linestart; /* start of the line where tag is */ + int linelen; /* length of the line where tag is */ + int lno; /* line number */ + long cno; /* character number */ +{ + register char *cp; + bool named; + + named = TRUE; + if (!CTAGS) + { + for (cp = name; !notinname (*cp); cp++) + continue; + if (*cp == '\0') /* rule #1 */ + { + cp = linestart + linelen - namelen; + if (notinname (linestart[linelen-1])) + cp -= 1; /* rule #4 */ +#ifdef OO_BROWSER + if (!oo_browser_format + && cp >= linestart /* rule #2 */ +#else + if (cp >= linestart /* rule #2 */ +#endif + && (cp == linestart + || notinname (cp[-1])) /* rule #3 */ + && strneq (name, cp, namelen)) /* rule #2 */ + named = FALSE; /* use unnamed tag */ + } + } + + if (named) + name = savenstr (name, namelen); + else + name = NULL; + pfnote (name, is_func, linestart, linelen, lno, cno); +} + +/* + * free_tree () + * recurse on left children, iterate on right children. + */ +void +free_tree (np) + register node *np; +{ + while (np) + { + register node *node_right = np->right; + free_tree (np->left); + if (np->name != NULL) + free (np->name); + free (np->pat); + free (np); + np = node_right; + } +} + +/* + * add_node () + * Adds a node to the tree of nodes. In etags mode, we don't keep + * it sorted; we just keep a linear list. In ctags mode, maintain + * an ordered tree, with no attempt at balancing. + * + * add_node is the only function allowed to add nodes, so it can + * maintain state. + */ +void +add_node (np, cur_node_p) + node *np, **cur_node_p; +{ + register int dif; + register node *cur_node = *cur_node_p; + + if (cur_node == NULL) + { + *cur_node_p = np; + last_node = np; + return; + } + + if (!CTAGS) + { + /* Etags Mode */ + if (last_node == NULL) + fatal ("internal error in add_node", (char *)NULL); + last_node->right = np; + last_node = np; + } + else + { + /* Ctags Mode */ + dif = strcmp (np->name, cur_node->name); + + /* + * If this tag name matches an existing one, then + * do not add the node, but maybe print a warning. + */ + if (!dif) + { + if (streq (np->file, cur_node->file)) + { + if (!no_warnings) + { + fprintf (stderr, "Duplicate entry in file %s, line %d: %s\n", + np->file, lineno, np->name); + fprintf (stderr, "Second entry ignored\n"); + } + } + else if (!cur_node->been_warned && !no_warnings) + { + fprintf + (stderr, + "Duplicate entry in files %s and %s: %s (Warning only)\n", + np->file, cur_node->file, np->name); + cur_node->been_warned = TRUE; + } + return; + } + + /* Actually add the node */ + add_node (np, dif < 0 ? &cur_node->left : &cur_node->right); + } +} + +#ifdef OO_BROWSER +/* Default class name for the current OO-Browser tag. */ +static char *oo_browser_class; +/* Prefix character to use in OO-Browser listings for the current tag. */ +static char oo_browser_prefix; +#endif + +void +put_entries (np) + register node *np; +{ + register char *sp; + + if (np == NULL) + return; + + /* Output subentries that precede this one */ + put_entries (np->left); + + /* Output this entry */ + + if (!CTAGS) + { +#ifdef OO_BROWSER + if (oo_browser_format) + { + /* Omit C++ `class' and `method' entries as well as Objective-C + entries from this OO-Browser tags file since the browser handles + them independently of this file. Omit `extern' variable declarations + as they are unused by the OO-Browser. */ + if (np->construct != C_CLASS + && np->construct != C_METHOD + && np->construct != C_EXTERN + && np->construct != C_OBJC) + { + oo_browser_class = oo_browser_default_classes[np->construct]; + switch (np->construct) + { + case C_CONSTANT: + case C_ENUMERATION: + case C_ENUM_LABEL: + case C_STRUCTURE: + case C_TYPE: + case C_UNION: + case C_VARIABLE: + oo_browser_prefix = '='; + break; + case C_FUNCTION: + case C_MACRO: + oo_browser_prefix = '-'; + break; + } + if (np->name != NULL) + fprintf (tagf, "%s@%c %s@%s\n", + oo_browser_class, oo_browser_prefix, + np->name, np->pat); + else + fprintf (tagf, "%s@%c ???@%s\n", + oo_browser_class, oo_browser_prefix, np->pat); + } + } + else + { +#endif + if (np->name != NULL) + fprintf (tagf, "%s\177%s\001%d,%ld\n", + np->pat, np->name, np->lno, np->cno); + else + fprintf (tagf, "%s\177%d,%ld\n", + np->pat, np->lno, np->cno); +#ifdef OO_BROWSER + } +#endif + } + else + { + if (np->name == NULL) + error ("internal error: NULL name in ctags mode.", (char *)NULL); + + if (cxref_style) + { + if (vgrind_style) + fprintf (stdout, "%s %s %d\n", + np->name, np->file, (np->lno + 63) / 64); + else + fprintf (stdout, "%-16s %3d %-16s %s\n", + np->name, np->lno, np->file, np->pat); + } + else + { + fprintf (tagf, "%s\t%s\t", np->name, np->file); + + if (np->is_func) + { /* a function */ + putc (searchar, tagf); + putc ('^', tagf); + + for (sp = np->pat; *sp; sp++) + { + if (*sp == '\\' || *sp == searchar) + putc ('\\', tagf); + putc (*sp, tagf); + } + putc (searchar, tagf); + } + else + { /* a typedef; text pattern inadequate */ + fprintf (tagf, "%d", np->lno); + } + putc ('\n', tagf); + } + } + + /* Output subentries that follow this one */ + put_entries (np->right); +} + +/* Length of a number's decimal representation. */ +int number_len PP ((long num)); +int +number_len (num) + long num; +{ + int len = 1; + while ((num /= 10) > 0) + len += 1; + return len; +} + +/* + * Return total number of characters that put_entries will output for + * the nodes in the subtree of the specified node. Works only if + * we are not ctags, but called only in that case. This count + * is irrelevant with the new tags.el, but is still supplied for + * backward compatibility. + */ +int +total_size_of_entries (np) + register node *np; +{ + register int total; + + if (np == NULL) + return 0; + + for (total = 0; np != NULL; np = np->right) + { + /* Count left subentries. */ + total += total_size_of_entries (np->left); + + /* Count this entry */ + total += strlen (np->pat) + 1; + total += number_len ((long) np->lno) + 1 + number_len (np->cno) + 1; + if (np->name != NULL) + total += 1 + strlen (np->name); /* \001name */ + } + + return total; +} + +/* + * The C symbol tables. + */ +enum sym_type +{ + st_none, + st_C_objprot, st_C_objimpl, st_C_objend, + st_C_gnumacro, + st_C_ignore, + st_C_javastruct, + st_C_struct, st_C_enum, st_C_define, st_C_typedef, st_C_typespec, + st_C_const +#ifdef OO_BROWSER + , st_C_union, st_C_class, st_C_extern, st_C_inline +#endif +}; + +/* Feed stuff between (but not including) %[ and %] lines to: + gperf -c -k 1,3 -o -p -r -t +%[ +struct C_stab_entry { char *name; int c_ext; enum sym_type type; } +%% +@interface, 0, st_C_objprot +@protocol, 0, st_C_objprot +@implementation,0, st_C_objimpl +@end, 0, st_C_objend +import, C_JAVA, st_C_ignore +package, C_JAVA, st_C_ignore +friend, C_PLPL, st_C_ignore +extends, C_JAVA, st_C_javastruct +implements, C_JAVA, st_C_javastruct +interface, C_JAVA, st_C_struct +class, C_PLPL, st_C_class +namespace, C_PLPL, st_C_struct +domain, C_STAR, st_C_struct +union, 0, st_C_union +struct, 0, st_C_struct +enum, 0, st_C_enum +typedef, 0, st_C_typedef +define, 0, st_C_define +inline, 0, st_C_inline +bool, C_PLPL, st_C_typespec +long, 0, st_C_typespec +short, 0, st_C_typespec +int, 0, st_C_typespec +char, 0, st_C_typespec +float, 0, st_C_typespec +double, 0, st_C_typespec +signed, 0, st_C_typespec +unsigned, 0, st_C_typespec +auto, 0, st_C_typespec +void, 0, st_C_typespec +extern, 0, st_C_extern +static, 0, st_C_typespec +const, 0, st_C_const +volatile, 0, st_C_typespec +explicit, C_PLPL, st_C_typespec +mutable, C_PLPL, st_C_typespec +typename, C_PLPL, st_C_typespec +# DEFUN used in emacs, the next three used in glibc (SYSCALL only for mach). +DEFUN, 0, st_C_gnumacro +SYSCALL, 0, st_C_gnumacro +ENTRY, 0, st_C_gnumacro +PSEUDO, 0, st_C_gnumacro +# These are defined inside C functions, so currently they are not met. +# EXFUN used in glibc, DEFVAR_* in emacs. +#EXFUN, 0, st_C_gnumacro +#DEFVAR_, 0, st_C_gnumacro +%] +and replace lines between %< and %> with its output. */ +/*%<*/ +/* C code produced by gperf version 2.5 (GNU C++ version) */ +/* Command-line: gperf -c -k 1,3 -o -p -r -t */ +struct C_stab_entry { char *name; int c_ext; enum sym_type type; }; + +#define TOTAL_KEYWORDS 41 +#define MIN_WORD_LENGTH 3 +#define MAX_WORD_LENGTH 15 +#define MIN_HASH_VALUE 13 +#define MAX_HASH_VALUE 129 +/* maximum key range = 117, duplicates = 0 */ + +static unsigned int +hash (str, len) + register char *str; + register int unsigned len; +{ + static unsigned char asso_values[] = + { + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 13, 130, 130, 130, 33, 32, + 47, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 5, 130, 130, 20, 32, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 47, 55, 8, + 15, 33, 61, 38, 130, 60, 130, 130, 2, 9, + 10, 62, 59, 130, 28, 27, 50, 19, 3, 130, + 130, 130, 130, 130, 130, 130, 130, 130, + }; + return len + asso_values[str[2]] + asso_values[str[0]]; +} + +struct C_stab_entry * +in_word_set (str, len) + register char *str; + register unsigned int len; +{ + static struct C_stab_entry wordlist[] = + { + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"",}, {"",}, {"",}, {"",}, + {"volatile", 0, st_C_typespec}, + {"",}, {"",}, + {"long", 0, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"const", 0, st_C_const}, + {"",}, {"",}, {"",}, + {"@end", 0, st_C_objend}, + {"namespace", C_PLPL, st_C_struct}, + {"",}, + {"domain", C_STAR, st_C_struct}, + {"",}, {"",}, + {"@interface", 0, st_C_objprot}, + {"",}, {"",}, {"",}, + {"@implementation", 0, st_C_objimpl}, + {"",}, {"",}, + {"double", 0, st_C_typespec}, + {"",}, {"",}, + {"PSEUDO", 0, st_C_gnumacro}, + {"",}, {"",}, {"",}, + {"SYSCALL", 0, st_C_gnumacro}, + {"",}, {"",}, + {"@protocol", 0, st_C_objprot}, + {"",}, {"",}, {"",}, + {"unsigned", 0, st_C_typespec}, + {"",}, + {"enum", 0, st_C_enum}, + {"",}, {"",}, + {"char", 0, st_C_typespec}, + {"class", C_PLPL, st_C_class}, + {"struct", 0, st_C_struct}, + {"",}, {"",}, {"",}, {"",}, + {"mutable", C_PLPL, st_C_typespec}, + {"void", 0, st_C_typespec}, + {"inline", 0, st_C_inline}, + {"ENTRY", 0, st_C_gnumacro}, + {"",}, + {"signed", 0, st_C_typespec}, + {"",}, {"",}, + {"package", C_JAVA, st_C_ignore}, + {"",}, {"",}, {"",}, {"",}, {"",}, + {"static", 0, st_C_typespec}, + {"",}, + {"define", 0, st_C_define}, + {"",}, + {"union", 0, st_C_union}, + {"DEFUN", 0, st_C_gnumacro}, + {"",}, {"",}, {"",}, + {"extern", 0, st_C_extern}, + {"extends", C_JAVA, st_C_javastruct}, + {"",}, {"",}, {"",}, + {"short", 0, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, {"",}, + {"explicit", C_PLPL, st_C_typespec}, + {"auto", 0, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"",}, {"",}, + {"int", 0, st_C_typespec}, + {"",}, {"",}, + {"typedef", 0, st_C_typedef}, + {"typename", C_PLPL, st_C_typespec}, + {"",}, + {"interface", C_JAVA, st_C_struct}, + {"",}, + {"bool", C_PLPL, st_C_typespec}, + {"",}, {"",}, {"",}, + {"import", C_JAVA, st_C_ignore}, + {"",}, + {"friend", C_PLPL, st_C_ignore}, + {"float", 0, st_C_typespec}, + {"implements", C_JAVA, st_C_javastruct}, + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register char *s = wordlist[key].name; + + if (*s == *str && !strncmp (str + 1, s + 1, len - 1)) + return &wordlist[key]; + } + } + return 0; +} +/*%>*/ + +enum sym_type C_symtype PP ((char *str, int len, int c_ext)); +enum sym_type +C_symtype (str, len, c_ext) + char *str; + int len; + int c_ext; +{ + register struct C_stab_entry *se = in_word_set (str, len); + + if (se == NULL || (se->c_ext && !(c_ext & se->c_ext))) + return st_none; + return se->type; +} + + /* + * C functions and variables are recognized using a simple + * finite automaton. fvdef is its state variable. + */ +enum +{ + fvnone, /* nothing seen */ + fvnameseen, /* function or variable name seen */ + fstartlist, /* func: just after open parenthesis */ + finlist, /* func: in parameter list */ + flistseen, /* func: after parameter list */ + fignore, /* func: before open brace */ + vignore /* var-like: ignore until ';' */ +} fvdef; + + + /* + * typedefs are recognized using a simple finite automaton. + * typdef is its state variable. + */ +enum +{ + tnone, /* nothing seen */ + ttypedseen, /* typedef keyword seen */ + tinbody, /* inside typedef body */ + tend, /* just before typedef tag */ + tignore /* junk after typedef tag */ +} typdef; + + + /* + * struct-like structures (enum, struct and union) are recognized + * using another simple finite automaton. `structdef' is its state + * variable. + */ +enum +{ + snone, /* nothing seen yet */ + skeyseen, /* struct-like keyword seen */ + stagseen, /* struct-like tag seen */ + scolonseen, /* colon seen after struct-like tag */ + sinbody /* in struct body: recognize member func defs*/ +} structdef; + +/* + * When structdef is stagseen, scolonseen, or sinbody, structtag is the + * struct tag, and structtype is the type of the preceding struct-like + * keyword. + */ +char *structtag = ""; +enum sym_type structtype; + +#ifdef OO_BROWSER +void +oo_browser_check_and_clear_structtype() +{ + /* Allow for multiple enum_label tags. */ + if (structtype != st_C_enum) + structtype = st_none; +} +#endif + +/* + * When objdef is different from onone, objtag is the name of the class. + */ +char *objtag = ""; + +/* + * Yet another little state machine to deal with preprocessor lines. + */ +enum +{ + dnone, /* nothing seen */ + dsharpseen, /* '#' seen as first char on line */ + ddefineseen, /* '#' and 'define' seen */ + dignorerest /* ignore rest of line */ +} definedef; + +/* + * State machine for Objective C protocols and implementations. + * Tom R.Hageman + */ +enum +{ + onone, /* nothing seen */ + oprotocol, /* @interface or @protocol seen */ + oimplementation, /* @implementations seen */ + otagseen, /* class name seen */ + oparenseen, /* parenthesis before category seen */ + ocatseen, /* category name seen */ + oinbody, /* in @implementation body */ + omethodsign, /* in @implementation body, after +/- */ + omethodtag, /* after method name */ + omethodcolon, /* after method colon */ + omethodparm, /* after method parameter */ + oignore /* wait for @end */ +} objdef; + +/* + * Use this structure to keep info about the token read, and how it + * should be tagged. Used by the make_C_tag function to build a tag. + */ +typedef struct +{ + bool valid; + char *str; + bool named; + int linelen; + int lineno; + long linepos; + char *buffer; +} token; + +token tok; /* latest token read */ + +/* + * Set this to TRUE, and the next token considered is called a function. + * Used only for GNU emacs's function-defining macros. + */ +bool next_token_is_func; + +/* + * TRUE in the rules part of a yacc file, FALSE outside (parse as C). + */ +bool yacc_rules; + +/* + * methodlen is the length of the method name stored in token_name. + */ +int methodlen; + +#ifdef OO_BROWSER +void +oo_browser_clear_all_globals() +{ + /* Initialize globals so there is no carry over between files. */ + oo_browser_construct = C_NULL; + fvdef = fvnone; typdef = tnone; structdef = snone; + definedef = dnone; objdef = onone; + structtype = st_none; + next_token_is_func = yacc_rules = FALSE; +} + +void +oo_browser_clear_some_globals() +{ + oo_browser_construct = C_NULL; + structtype = st_none; +} +#endif + +/* + * consider_token () + * checks to see if the current token is at the start of a + * function or variable, or corresponds to a typedef, or + * is a struct/union/enum tag, or #define, or an enum constant. + * + * *IS_FUNC gets TRUE iff the token is a function or #define macro + * with args. C_EXT is which language we are looking at. + * + * In the future we will need some way to adjust where the end of + * the token is; for instance, implementing the C++ keyword + * `operator' properly will adjust the end of the token to be after + * whatever follows `operator'. + * + * Globals + * fvdef IN OUT + * structdef IN OUT + * definedef IN OUT + * typdef IN OUT + * objdef IN OUT + * next_token_is_func IN OUT + */ +bool consider_token PP ((char *str, int len, int c, int c_ext, + int cblev, int parlev, bool *is_func_or_var)); +bool +consider_token (str, len, c, c_ext, cblev, parlev, is_func_or_var) + register char *str; /* IN: token pointer */ + register int len; /* IN: token length */ + register int c; /* IN: first char after the token */ + int c_ext; /* IN: C extensions mask */ + int cblev; /* IN: curly brace level */ + int parlev; /* IN: parenthesis level */ + bool *is_func_or_var; /* OUT: function or variable found */ +{ + enum sym_type toktype = C_symtype (str, len, c_ext); + +#ifdef OO_BROWSER + switch (toktype) + { + case st_C_struct: + set_construct(C_STRUCTURE); + break; + case st_C_union: + set_construct(C_UNION); + break; + case st_C_class: + set_construct(C_CLASS); + break; + case st_C_enum: + set_construct(C_ENUMERATION); + break; + case st_C_typedef: + set_construct(C_TYPE); + break; + case st_C_extern: + set_construct(C_EXTERN); + break; + case st_C_inline: + set_construct(C_FUNCTION); + break; + } +#endif + + /* + * Advance the definedef state machine. + */ + switch (definedef) + { + case dnone: + /* We're not on a preprocessor line. */ + break; + case dsharpseen: + if (toktype == st_C_define) + { + definedef = ddefineseen; + } + else + { + definedef = dignorerest; + } + return FALSE; + case ddefineseen: + /* + * Make a tag for any macro, unless it is a constant + * and constantypedefs is FALSE. + */ + definedef = dignorerest; +#ifndef OO_BROWSER + *is_func_or_var = (c == '('); +#else + { + char *p = str + len * sizeof(char); + + if (*p == '(') + /* This must be a macro since there is no + whitespace between the opening parenthesis + and the definition name. */ + *is_func_or_var = TRUE; + else + { + *is_func_or_var = FALSE; + + /* Handle possible whitespace between macro tag and opening + parenthesis and ensure this is an actual macro. + -- Bob Weiner, Altrasoft, 11/19/1997 */ + while (*p && isspace(*p)) p++; + if (*p) c = *p; + + /* Skip over nested parentheses. */ + if (c == '(') + { + short depth = 1; + + while (*++p && depth > 0 && *p != '\n') + { + switch (*p) + { + case '(': + depth++; break; + case ')': + depth--; break; + } + } + + /* If this is a macro, we have just passed + the arguments and there will be more on + the line before the NULL character that marks + the end of the line token. */ + while (*p == ' ' || *p == '\t') p++; + if (*p) *is_func_or_var = TRUE; + } + } + } + + set_construct((*is_func_or_var) ? C_MACRO : C_CONSTANT); +#endif + if (!*is_func_or_var && !constantypedefs) + return FALSE; + else + return TRUE; + case dignorerest: + return FALSE; + default: + error ("internal error: definedef value.", (char *)NULL); + } + + /* + * Now typedefs + */ + switch (typdef) + { + case tnone: + if (toktype == st_C_typedef) + { + if (typedefs) + typdef = ttypedseen; + fvdef = fvnone; + return FALSE; + } + break; + case ttypedseen: + switch (toktype) + { + case st_C_const: + set_construct(C_CONSTANT); + /* fall through */ + case st_none: + case st_C_typespec: +#ifdef OO_BROWSER + case st_C_extern: +#endif + typdef = tend; + break; + case st_C_struct: + case st_C_enum: +#ifdef OO_BROWSER + case st_C_union: + case st_C_class: +#endif + break; + } + /* Do not return here, so the structdef stuff has a chance. */ + break; + case tend: + switch (toktype) + { + case st_C_const: + set_construct(C_CONSTANT); + /* fall through */ + case st_C_typespec: + case st_C_struct: + case st_C_enum: +#ifdef OO_BROWSER + case st_C_extern: + case st_C_union: + case st_C_class: +#endif + return FALSE; + } + return TRUE; + } + + /* + * This structdef business is currently only invoked when cblev==0. + * It should be recursively invoked whatever the curly brace level, + * and a stack of states kept, to allow for definitions of structs + * within structs. + * + * This structdef business is NOT invoked when we are ctags and the + * file is plain C. This is because a struct tag may have the same + * name as another tag, and this loses with ctags. + */ + switch (toktype) + { + case st_C_javastruct: + if (structdef == stagseen) + structdef = scolonseen; + return FALSE; + case st_C_struct: + case st_C_enum: +#ifdef OO_BROWSER + case st_C_union: + case st_C_class: + case st_C_extern: +#endif + if (typdef == ttypedseen + || (typedefs_and_cplusplus && cblev == 0 && structdef == snone)) + { + structdef = skeyseen; + structtype = toktype; + } + return FALSE; + } + + if (structdef == skeyseen) + { + /* Save the tag for struct/union/class, for functions and variables + that may be defined inside. */ +#ifndef OO_BROWSER + if (structtype == st_C_struct) +#else + if (structtype == st_C_struct + || structtype == st_C_union + || structtype == st_C_class) +#endif + structtag = savenstr (str, len); + else + structtag = ""; + structdef = stagseen; + return TRUE; + } + + /* Avoid entering fvdef stuff if typdef is going on. */ + if (typdef != tnone) + { + definedef = dnone; + return FALSE; + } + + /* Detect GNU macros. + + DEFUN note for writers of emacs C code: + The DEFUN macro, used in emacs C source code, has a first arg + that is a string (the lisp function name), and a second arg that + is a C function name. Since etags skips strings, the second arg + is tagged. This is unfortunate, as it would be better to tag the + first arg. The simplest way to deal with this problem would be + to name the tag with a name built from the function name, by + removing the initial 'F' character and substituting '-' for '_'. + Anyway, this assumes that the conventions of naming lisp + functions will never change. Currently, this method is not + implemented, so writers of emacs code are recommended to put the + first two args of a DEFUN on the same line. */ + if (definedef == dnone && toktype == st_C_gnumacro) + { + next_token_is_func = TRUE; + return FALSE; + } + if (next_token_is_func) + { + next_token_is_func = FALSE; + fvdef = fignore; + *is_func_or_var = TRUE; + return TRUE; + } + + /* Detect Objective C constructs. */ + switch (objdef) + { + case onone: + switch (toktype) + { + case st_C_objprot: +#ifdef OO_BROWSER + set_construct(C_OBJC); +#endif + objdef = oprotocol; + return FALSE; + case st_C_objimpl: +#ifdef OO_BROWSER + set_construct(C_OBJC); +#endif + objdef = oimplementation; + return FALSE; + } + break; + case oimplementation: + /* Save the class tag for functions or variables defined inside. */ + objtag = savenstr (str, len); + objdef = oinbody; + return FALSE; + case oprotocol: + /* Save the class tag for categories. */ + objtag = savenstr (str, len); + objdef = otagseen; + *is_func_or_var = TRUE; + return TRUE; + case oparenseen: + objdef = ocatseen; + *is_func_or_var = TRUE; + return TRUE; + case oinbody: + break; + case omethodsign: + if (parlev == 0) + { + objdef = omethodtag; + methodlen = len; + grow_linebuffer (&token_name, methodlen + 1); + strncpy (token_name.buffer, str, len); + token_name.buffer[methodlen] = '\0'; + token_name.len = methodlen; + return TRUE; + } + return FALSE; + case omethodcolon: + if (parlev == 0) + objdef = omethodparm; + return FALSE; + case omethodparm: + if (parlev == 0) + { + objdef = omethodtag; + methodlen += len; + grow_linebuffer (&token_name, methodlen + 1); + strncat (token_name.buffer, str, len); + token_name.len = methodlen; + return TRUE; + } + return FALSE; + case oignore: + if (toktype == st_C_objend) + { + /* Memory leakage here: the string pointed by objtag is + never released, because many tests would be needed to + avoid breaking on incorrect input code. The amount of + memory leaked here is the sum of the lengths of the + class tags. + free (objtag); */ + objdef = onone; + } + return FALSE; + } + + /* A function, variable or enum constant? */ + switch (toktype) + { + case st_C_const: + set_construct(C_CONSTANT); + /* fall through */ + case st_C_typespec: +#ifdef OO_BROWSER + case st_C_extern: +#endif + if (fvdef != finlist && fvdef != fignore && fvdef != vignore) + fvdef = fvnone; /* should be useless */ + return FALSE; + case st_C_ignore: + fvdef = vignore; + return FALSE; + case st_none: + if (constantypedefs && structdef == sinbody && structtype == st_C_enum) +#ifdef OO_BROWSER + { + oo_browser_construct = C_ENUM_LABEL; +#endif + return TRUE; +#ifdef OO_BROWSER + } +#endif + if (fvdef == fvnone) + { + fvdef = fvnameseen; /* function or variable */ + *is_func_or_var = TRUE; + return TRUE; + } + } + + return FALSE; +} + +/* + * C_entries () + * This routine finds functions, variables, typedefs, + * #define's, enum constants and struct/union/enum definitions in + * #C syntax and adds them to the list. + */ +#define current_lb_is_new (newndx == curndx) +#define switch_line_buffers() (curndx = 1 - curndx) + +#define curlb (lbs[curndx].lb) +#define othlb (lbs[1-curndx].lb) +#define newlb (lbs[newndx].lb) +#define curlinepos (lbs[curndx].linepos) +#define othlinepos (lbs[1-curndx].linepos) +#define newlinepos (lbs[newndx].linepos) + +#define CNL_SAVE_DEFINEDEF() \ +do { \ + curlinepos = charno; \ + lineno++; \ + linecharno = charno; \ + charno += readline (&curlb, inf); \ + lp = curlb.buffer; \ + quotednl = FALSE; \ + newndx = curndx; \ +} while (0) + +#define CNL() \ +do { \ + CNL_SAVE_DEFINEDEF(); \ + if (savetok.valid) \ + { \ + tok = savetok; \ + savetok.valid = FALSE; \ + } \ + definedef = dnone; \ +} while (0) + + +void make_C_tag PP ((bool isfun)); +void +make_C_tag (isfun) + bool isfun; +{ + /* This function should never be called when tok.valid is FALSE, but + we must protect against invalid input or internal errors. */ + if (tok.valid) + { + if (traditional_tag_style) + { + /* This was the original code. Now we call new_pfnote instead, + which uses the new method for naming tags (see new_pfnote). */ + char *name = NULL; + + if (CTAGS || tok.named) + name = savestr (token_name.buffer); + pfnote (name, isfun, + tok.buffer, tok.linelen, tok.lineno, tok.linepos); + } + else + new_pfnote (token_name.buffer, token_name.len, isfun, + tok.buffer, tok.linelen, tok.lineno, tok.linepos); + tok.valid = FALSE; + } + else if (DEBUG) + abort (); +} + + +void +C_entries (c_ext, inf) + int c_ext; /* extension of C */ + FILE *inf; /* input file */ +{ + register char c; /* latest char read; '\0' for end of line */ + register char *lp; /* pointer one beyond the character `c' */ + int curndx, newndx; /* indices for current and new lb */ + register int tokoff; /* offset in line of start of current token */ + register int toklen; /* length of current token */ + char *qualifier; /* string used to qualify names */ + int qlen; /* length of qualifier */ + int cblev; /* current curly brace level */ + int parlev; /* current parenthesis level */ + bool incomm, inquote, inchar, quotednl, midtoken; + bool cplpl, cjava; + token savetok; /* token saved during preprocessor handling */ + + + tokoff = toklen = 0; /* keep compiler quiet */ + curndx = newndx = 0; + lineno = 0; + charno = 0; + lp = curlb.buffer; + *lp = 0; + + fvdef = fvnone; typdef = tnone; structdef = snone; + definedef = dnone; objdef = onone; + next_token_is_func = yacc_rules = FALSE; + midtoken = inquote = inchar = incomm = quotednl = FALSE; + tok.valid = savetok.valid = FALSE; + cblev = 0; + parlev = 0; + cplpl = (c_ext & C_PLPL) == C_PLPL; + cjava = (c_ext & C_JAVA) == C_JAVA; + if (cjava) + { qualifier = "."; qlen = 1; } + else + { qualifier = "::"; qlen = 2; } + + while (!feof (inf)) + { + c = *lp++; + if (c == '\\') + { + /* If we're at the end of the line, the next character is a + '\0'; don't skip it, because it's the thing that tells us + to read the next line. */ + if (*lp == '\0') + { + quotednl = TRUE; + continue; + } + lp++; + c = ' '; + } + else if (incomm) + { + switch (c) + { + case '*': + if (*lp == '/') + { + c = *lp++; + incomm = FALSE; + } + break; + case '\0': + /* Newlines inside comments do not end macro definitions in + traditional cpp. */ + CNL_SAVE_DEFINEDEF (); + break; + } + continue; + } + else if (inquote) + { + switch (c) + { + case '"': + inquote = FALSE; + break; + case '\0': + /* Newlines inside strings do not end macro definitions + in traditional cpp, even though compilers don't + usually accept them. */ + CNL_SAVE_DEFINEDEF (); + break; + } + continue; + } + else if (inchar) + { + switch (c) + { + case '\0': + /* Hmmm, something went wrong. */ + CNL (); + /* FALLTHRU */ + case '\'': + inchar = FALSE; + break; + } + continue; + } + else + switch (c) + { + case '"': + inquote = TRUE; + if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) + fvdef = fvnone; + continue; + case '\'': + inchar = TRUE; + if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) + fvdef = fvnone; + continue; + case '/': + if (*lp == '*') + { + lp++; + incomm = TRUE; + continue; + } + else if (/* cplpl && */ *lp == '/') + { + c = '\0'; + break; + } + else + break; + case '%': + if ((c_ext & YACC) && *lp == '%') + { + /* entering or exiting rules section in yacc file */ + lp++; + definedef = dnone; fvdef = fvnone; + typdef = tnone; structdef = snone; + next_token_is_func = FALSE; + midtoken = inquote = inchar = incomm = quotednl = FALSE; + cblev = 0; + yacc_rules = !yacc_rules; + continue; + } + else + break; + case '#': + if (definedef == dnone) + { + char *cp; + bool cpptoken = TRUE; + + /* Look back on this line. If all blanks, or nonblanks + followed by an end of comment, this is a preprocessor + token. */ + for (cp = newlb.buffer; cp < lp-1; cp++) + if (!iswhite (*cp)) + { + if (*cp == '*' && *(cp+1) == '/') + { + cp++; + cpptoken = TRUE; + } + else + cpptoken = FALSE; + } + if (cpptoken) + definedef = dsharpseen; + } /* if (definedef == dnone) */ + + continue; + } /* switch (c) */ + + + /* Consider token only if some complicated conditions are satisfied. */ + if ((definedef != dnone + || (cblev == 0 && structdef != scolonseen) + || (cblev == 1 && cplpl && structdef == sinbody) + || (structdef == sinbody && structtype == st_C_enum)) + && typdef != tignore + && definedef != dignorerest + && fvdef != finlist) + { + if (midtoken) + { + if (endtoken (c)) + { + if (c == ':' && cplpl && *lp == ':' && begtoken(*(lp + 1))) + { + /* + * This handles :: in the middle, but not at the + * beginning of an identifier. + */ + lp += 2; + toklen += 3; +#ifdef OO_BROWSER + set_construct(C_METHOD); +#endif + } + else + { + bool funorvar = FALSE; + + if (yacc_rules + || consider_token (newlb.buffer + tokoff, toklen, c, + c_ext, cblev, parlev, &funorvar)) + { + tok.named = FALSE; + if (structdef == sinbody + && definedef == dnone + && funorvar) + /* function or var defined in C++ class body */ + { + int len = strlen (structtag) + qlen + toklen; + grow_linebuffer (&token_name, len + 1); + strcpy (token_name.buffer, structtag); + strcat (token_name.buffer, qualifier); + strncat (token_name.buffer, + newlb.buffer + tokoff, toklen); + token_name.len = len; + tok.named = TRUE; +#ifdef OO_BROWSER + oo_browser_construct = C_METHOD; +#endif + } + else if (objdef == ocatseen) + /* Objective C category */ + { + int len = strlen (objtag) + 2 + toklen; + grow_linebuffer (&token_name, len + 1); + strcpy (token_name.buffer, objtag); + strcat (token_name.buffer, "("); + strncat (token_name.buffer, + newlb.buffer + tokoff, toklen); + strcat (token_name.buffer, ")"); + token_name.len = len; + tok.named = TRUE; +#ifdef OO_BROWSER + oo_browser_construct = C_OBJC; +#endif + } + else if (objdef == omethodtag + || objdef == omethodparm) + /* Objective C method */ + { + tok.named = TRUE; +#ifdef OO_BROWSER + oo_browser_construct = C_OBJC; +#endif + } + else + { + grow_linebuffer (&token_name, toklen + 1); + strncpy (token_name.buffer, + newlb.buffer + tokoff, toklen); + token_name.buffer[toklen] = '\0'; + token_name.len = toklen; + /* Name macros. */ + tok.named + = (structdef == stagseen + || typdef == tend +#ifdef OO_BROWSER + /* Also name #define constants, + enumerations and enum_labels. + Conditionalize `funorvar' reference + here or #defines will appear without + their #names. + -- Bob Weiner, Altrasoft, 4/25/1998 */ + || ((oo_browser_format || funorvar) + && definedef == dignorerest) + || (oo_browser_format + && (oo_browser_construct == C_ENUMERATION + || oo_browser_construct == C_ENUM_LABEL)) +#else + || (funorvar + && definedef == dignorerest) +#endif + ); + } + tok.lineno = lineno; + tok.linelen = tokoff + toklen + 1; + tok.buffer = newlb.buffer; + tok.linepos = newlinepos; + tok.valid = TRUE; + + if (definedef == dnone + && (fvdef == fvnameseen + || structdef == stagseen + || typdef == tend + || objdef != onone)) + { + if (current_lb_is_new) + switch_line_buffers (); + } + else + make_C_tag (funorvar); + } + midtoken = FALSE; + } + } /* if (endtoken (c)) */ + else if (intoken (c)) + { + toklen++; + continue; + } + } /* if (midtoken) */ + else if (begtoken (c)) + { + switch (definedef) + { + case dnone: + switch (fvdef) + { + case fstartlist: + fvdef = finlist; + continue; + case flistseen: +#ifdef OO_BROWSER + set_construct(C_MACRO); +#endif + make_C_tag (TRUE); /* a function */ + fvdef = fignore; + break; + case fvnameseen: + fvdef = fvnone; + break; + } + if (structdef == stagseen && !cjava) + structdef = snone; + break; + case dsharpseen: + savetok = tok; + } + if (!yacc_rules || lp == newlb.buffer + 1) + { + tokoff = lp - 1 - newlb.buffer; + toklen = 1; + midtoken = TRUE; + } + continue; + } /* if (begtoken) */ + } /* if must look at token */ + + + /* Detect end of line, colon, comma, semicolon and various braces + after having handled a token.*/ + switch (c) + { + case ':': + if (definedef != dnone) + break; + switch (objdef) + { + case otagseen: + objdef = oignore; + make_C_tag (TRUE); /* an Objective C class */ + break; + case omethodtag: + case omethodparm: + objdef = omethodcolon; + methodlen += 1; + grow_linebuffer (&token_name, methodlen + 1); + strcat (token_name.buffer, ":"); + token_name.len = methodlen; + break; + } + if (structdef == stagseen) + structdef = scolonseen; + else + switch (fvdef) + { + case fvnameseen: + if (yacc_rules) + { + make_C_tag (FALSE); /* a yacc function */ + fvdef = fignore; + } + break; + case fstartlist: + fvdef = fvnone; + break; + } + break; + case ';': + if (definedef != dnone) + break; + if (cblev == 0) + switch (typdef) + { + case tend: +#ifdef OO_BROWSER + set_construct(C_TYPE); +#endif + make_C_tag (FALSE); /* a typedef */ + /* FALLTHRU */ + default: + typdef = tnone; + } + switch (fvdef) + { + case fignore: + break; + case fvnameseen: + if ((globals && cblev == 0) || (members && cblev == 1)) +#ifndef OO_BROWSER + make_C_tag (FALSE); /* a variable */ +#else +/* if (constantypedefs && structdef == snone)*/ + { + tok.named = TRUE; + switch (structtype) + { + case st_C_enum: + set_construct(C_ENUMERATION); + break; + case st_C_class: + set_construct(C_CLASS); + break; + default: + set_construct(C_VARIABLE); + break; + } + make_C_tag (FALSE); + /* Force reset of st_C_enum structtype value. */ + structtype = st_none; + } +#endif + /* FALLTHRU */ + default: + fvdef = fvnone; + /* The following instruction invalidates the token. + Probably the token should be invalidated in all + other cases where some state machine is reset. */ + tok.valid = FALSE; + } + if (structdef == stagseen) + structdef = snone; + break; + case ',': + if (definedef != dnone) + break; + switch (objdef) + { + case omethodtag: + case omethodparm: + make_C_tag (TRUE); /* an Objective C method */ + objdef = oinbody; + break; + } + switch (fvdef) + { + case finlist: + case fignore: + case vignore: + break; + case fvnameseen: + if ((globals && cblev == 0) || (members && cblev == 1)) + make_C_tag (FALSE); /* a variable */ + break; + default: + fvdef = fvnone; + } + if (structdef == stagseen) + structdef = snone; + break; + case '[': + if (definedef != dnone) + break; + if (cblev == 0 && typdef == tend) + { +#ifdef OO_BROWSER + set_construct(C_TYPE); +#endif + typdef = tignore; + make_C_tag (FALSE); /* a typedef */ + break; + } + switch (fvdef) + { + case finlist: + case fignore: + case vignore: + break; + case fvnameseen: +#ifndef OO_BROWSER + if ((globals && cblev == 0) || (members && cblev == 1)) + make_C_tag (FALSE); /* a variable */ +#else + if (constantypedefs && structdef == snone) + { + tok.named = TRUE; + switch (structtype) + { + case st_C_enum: + set_construct(C_ENUMERATION); + break; + case st_C_class: + set_construct(C_CLASS); + break; + default: + set_construct(C_VARIABLE); + break; + } + make_C_tag (FALSE); + /* Force reset of st_C_enum structtype value. */ + structtype = st_none; + } +#endif + /* FALLTHRU */ + default: + fvdef = fvnone; + } + if (structdef == stagseen) + structdef = snone; + break; + case '(': + if (definedef != dnone) + break; + if (objdef == otagseen && parlev == 0) + objdef = oparenseen; + switch (fvdef) + { + case fvnone: + switch (typdef) + { + case ttypedseen: + case tend: + if (tok.valid && *lp != '*') + { + /* This handles constructs like: + typedef void OperatorFun (int fun); */ + typdef = tignore; +#ifdef OO_BROWSER + set_construct(C_TYPE); +#endif + make_C_tag (FALSE); + } + break; + } /* switch (typdef) */ + break; + case fvnameseen: + fvdef = fstartlist; + break; + case flistseen: + fvdef = finlist; + break; + } + parlev++; + break; + case ')': + if (definedef != dnone) + break; + if (objdef == ocatseen && parlev == 1) + { + make_C_tag (TRUE); /* an Objective C category */ + objdef = oignore; + } + if (--parlev == 0) + { + switch (fvdef) + { + case fstartlist: + case finlist: + fvdef = flistseen; + break; + } + if (cblev == 0 && typdef == tend) + { +#ifdef OO_BROWSER + set_construct(C_TYPE); +#endif + typdef = tignore; + make_C_tag (FALSE); /* a typedef */ + } + } + else if (parlev < 0) /* can happen due to ill-conceived #if's. */ + parlev = 0; + break; + case '{': + if (definedef != dnone) + break; + if (typdef == ttypedseen) + typdef = tinbody; + switch (structdef) + { + case skeyseen: /* unnamed struct */ + structdef = sinbody; + structtag = "_anonymous_"; + break; + case stagseen: + case scolonseen: /* named struct */ + structdef = sinbody; + make_C_tag (FALSE); /* a struct */ + break; + } + switch (fvdef) + { + case flistseen: +#ifdef OO_BROWSER + set_construct(C_FUNCTION); + /* Ensure function name is recorded. + -- Bob Weiner, Altrasoft */ + tok.named = TRUE; +#endif + make_C_tag (TRUE); /* a function */ + /* FALLTHRU */ + case fignore: + fvdef = fvnone; + break; + case fvnone: + switch (objdef) + { + case otagseen: + make_C_tag (TRUE); /* an Objective C class */ + objdef = oignore; + break; + case omethodtag: + case omethodparm: + make_C_tag (TRUE); /* an Objective C method */ + objdef = oinbody; + break; + default: + /* Neutralize `extern "C" {' grot. */ + if (cblev == 0 && structdef == snone && typdef == tnone) + cblev = -1; + } + } + cblev++; + break; + case '*': + if (definedef != dnone) + break; + if (fvdef == fstartlist) + fvdef = fvnone; /* avoid tagging `foo' in `foo (*bar()) ()' */ + break; + case '}': + if (definedef != dnone) + break; + if (!noindentypedefs && lp == newlb.buffer + 1) + { + cblev = 0; /* reset curly brace level if first column */ + parlev = 0; /* also reset paren level, just in case... */ + } + else if (cblev > 0) + cblev--; + if (cblev == 0) + { + if (typdef == tinbody) + typdef = tend; + /* Memory leakage here: the string pointed by structtag is + never released, because I fear to miss something and + break things while freeing the area. The amount of + memory leaked here is the sum of the lengths of the + struct tags. + if (structdef == sinbody) + free (structtag); */ + + structdef = snone; + structtag = ""; +#ifdef OO_BROWSER + /* Next line added to avoid any state carryover between + functions. -- Bob Weiner, Altrasoft, 11/19/1997 */ + fvdef = fvnone; oo_browser_construct = C_NULL; +#endif + } + break; + case '=': + if (definedef != dnone) + break; +#ifdef OO_BROWSER + { + int is_method = 0; +#endif + switch (fvdef) + { + case finlist: + case fignore: + case vignore: + break; + case fvnameseen: + if ((globals && cblev == 0) || (members && cblev == 1)) +#ifndef OO_BROWSER + make_C_tag (FALSE); /* a variable */ +#else + { + tok.named = TRUE; + switch (structtype) + { + case st_C_enum: + set_construct(C_ENUMERATION); + break; + case st_C_class: + set_construct(C_CLASS); + break; + default: + /* a global variable */ + set_construct(C_VARIABLE); + break; + } + /* We need this hack because *tags doesn't really parse */ + /* the input, and the OO Browser scanning has slightly */ + /* more context. -slb */ + is_method = (oo_browser_construct == C_METHOD); + make_C_tag (FALSE); + /* Force reset of st_C_enum structtype value. */ + structtype = st_none; + } +#endif + /* FALLTHRU */ + default: +#ifdef OO_BROWSER + fvdef = is_method ? fignore : vignore; +#else + fvdef = vignore; +#endif + } +#ifdef OO_BROWSER + } +#endif + break; + case '+': + case '-': + if (objdef == oinbody && cblev == 0) + { + objdef = omethodsign; + break; + } + /* FALLTHRU */ + case '#': case '~': case '&': case '%': case '/': case '|': + case '^': case '!': case '<': case '>': case '.': case '?': case ']': + if (definedef != dnone) + break; +#ifdef OO_BROWSER + if (!cplpl) + { +#endif + /* These surely cannot follow a function tag. */ + /* Not if the language is C++ -slb */ + if (fvdef != finlist && fvdef != fignore && fvdef != vignore) + fvdef = fvnone; +#ifdef OO_BROWSER + } +#endif + break; + case '\0': + if (objdef == otagseen) + { + make_C_tag (TRUE); /* an Objective C class */ + objdef = oignore; + } + /* If a macro spans multiple lines don't reset its state. */ + if (quotednl) + CNL_SAVE_DEFINEDEF (); + else + CNL (); + break; + } /* switch (c) */ + + } /* while not eof */ +} + +/* + * Process either a C++ file or a C file depending on the setting + * of a global flag. + */ +void +default_C_entries (inf) + FILE *inf; +{ + C_entries (cplusplus ? C_PLPL : 0, inf); +} + +/* Always do plain ANSI C. */ +void +plain_C_entries (inf) + FILE *inf; +{ + C_entries (0, inf); +} + +/* Always do C++. */ +void +Cplusplus_entries (inf) + FILE *inf; +{ + C_entries (C_PLPL, inf); +} + +/* Always do Java. */ +void +Cjava_entries (inf) + FILE *inf; +{ + C_entries (C_JAVA, inf); +} + +/* Always do C*. */ +void +Cstar_entries (inf) + FILE *inf; +{ + C_entries (C_STAR, inf); +} + +/* Always do Yacc. */ +void +Yacc_entries (inf) + FILE *inf; +{ + C_entries (YACC, inf); +} + +/* A useful macro. */ +#define LOOP_ON_INPUT_LINES(file_pointer, line_buffer, char_pointer) \ + for (lineno = charno = 0; /* loop initialization */ \ + !feof (file_pointer) /* loop test */ \ + && (lineno++, /* instructions at start of loop */ \ + linecharno = charno, \ + charno += readline (&line_buffer, file_pointer), \ + char_pointer = lb.buffer, \ + TRUE); \ + ) + + +/* + * Read a file, but do no processing. This is used to do regexp + * matching on files that have no language defined. + */ +void +just_read_file (inf) + FILE *inf; +{ + register char *dummy; + + LOOP_ON_INPUT_LINES (inf, lb, dummy) + continue; +} + +/* Fortran parsing */ + +bool tail PP ((char *cp)); +bool +tail (cp) + char *cp; +{ + register int len = 0; + + while (*cp && lowcase(*cp) == lowcase(dbp[len])) + cp++, len++; + if (*cp == '\0' && !intoken(dbp[len])) + { + dbp += len; + return TRUE; + } + return FALSE; +} + +void +takeprec () +{ + dbp = skip_spaces (dbp); + if (*dbp != '*') + return; + dbp++; + dbp = skip_spaces (dbp); + if (strneq (dbp, "(*)", 3)) + { + dbp += 3; + return; + } + if (!isdigit (*dbp)) + { + --dbp; /* force failure */ + return; + } + do + dbp++; + while (isdigit (*dbp)); +} + +void getit PP ((FILE *inf)); +void +getit (inf) + FILE *inf; +{ + register char *cp; + + dbp = skip_spaces (dbp); + if (*dbp == '\0') + { + lineno++; + linecharno = charno; + charno += readline (&lb, inf); + dbp = lb.buffer; + if (dbp[5] != '&') + return; + dbp += 6; + dbp = skip_spaces (dbp); + } + if (!isalpha (*dbp) + && *dbp != '_' + && *dbp != '$') + return; + for (cp = dbp + 1; *cp && intoken (*cp); cp++) + continue; + pfnote ((CTAGS) ? savenstr (dbp, cp-dbp) : NULL, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); +} + + +void +Fortran_functions (inf) + FILE *inf; +{ + LOOP_ON_INPUT_LINES (inf, lb, dbp) + { + if (*dbp == '%') + dbp++; /* Ratfor escape to fortran */ + dbp = skip_spaces (dbp); + if (*dbp == '\0') + continue; + switch (lowcase (*dbp)) + { + case 'i': + if (tail ("integer")) + takeprec (); + break; + case 'r': + if (tail ("real")) + takeprec (); + break; + case 'l': + if (tail ("logical")) + takeprec (); + break; + case 'c': + if (tail ("complex") || tail ("character")) + takeprec (); + break; + case 'd': + if (tail ("double")) + { + dbp = skip_spaces (dbp); + if (*dbp == '\0') + continue; + if (tail ("precision")) + break; + continue; + } + break; + } + dbp = skip_spaces (dbp); + if (*dbp == '\0') + continue; + switch (lowcase (*dbp)) + { + case 'f': + if (tail ("function")) + getit (inf); + continue; + case 's': + if (tail ("subroutine")) + getit (inf); + continue; + case 'e': + if (tail ("entry")) + getit (inf); + continue; + case 'p': + if (tail ("program")) + { + getit (inf); + continue; + } + if (tail ("procedure")) + getit (inf); + continue; + } + } +} + +/* + * Bob Weiner, Motorola Inc., 4/3/94 + * Unix and microcontroller assembly tag handling + * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]' + */ +void +Asm_labels (inf) + FILE *inf; +{ + register char *cp; + + LOOP_ON_INPUT_LINES (inf, lb, cp) + { + /* If first char is alphabetic or one of [_.$], test for colon + following identifier. */ + if (isalpha (*cp) || *cp == '_' || *cp == '.' || *cp == '$') + { + /* Read past label. */ + cp++; + while (isalnum (*cp) || *cp == '_' || *cp == '.' || *cp == '$') + cp++; + if (*cp == ':' || isspace (*cp)) + { + /* Found end of label, so copy it and add it to the table. */ + pfnote ((CTAGS) ? savenstr(lb.buffer, cp-lb.buffer) : NULL, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } + } + } +} + +/* + * Perl support by Bart Robinson + * enhanced by Michael Ernst + * Perl sub names: look for /^sub[ \t\n]+[^ \t\n{]+/ + * Perl variable names: /^(my|local).../ + */ +void +Perl_functions (inf) + FILE *inf; +{ + register char *cp; + + LOOP_ON_INPUT_LINES (inf, lb, cp) + { + if (*cp++ == 's' + && *cp++ == 'u' + && *cp++ == 'b' && isspace (*cp++)) + { + cp = skip_spaces (cp); + if (*cp != '\0') + { + while (*cp != '\0' + && !isspace (*cp) && *cp != '{' && *cp != '(') + cp++; + pfnote ((CTAGS) ? savenstr(lb.buffer, cp-lb.buffer) : NULL, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } + } + else if (globals /* only if tagging global vars is enabled */ + && ((cp = lb.buffer, + *cp++ == 'm' + && *cp++ == 'y') + || (cp = lb.buffer, + *cp++ == 'l' + && *cp++ == 'o' + && *cp++ == 'c' + && *cp++ == 'a' + && *cp++ == 'l')) + && (*cp == '(' || isspace (*cp))) + { + /* After "my" or "local", but before any following paren or space. */ + char *varname = NULL; + + cp = skip_spaces (cp); + if (*cp == '$' || *cp == '@' || *cp == '%') + { + char* varstart = ++cp; + while (isalnum (*cp) || *cp == '_') + cp++; + varname = savenstr (varstart, cp-varstart); + } + else + { + /* Should be examining a variable list at this point; + could insist on seeing an open parenthesis. */ + while (*cp != '\0' && *cp != ';' && *cp != '=' && *cp != ')') + cp++; + } + + /* Perhaps I should back cp up one character, so the TAGS table + doesn't mention (and so depend upon) the following char. */ + pfnote ((CTAGS) ? savenstr (lb.buffer, cp-lb.buffer) : varname, + FALSE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } + } +} + +/* + * Python support by Eric S. Raymond + * Look for /^def[ \t\n]+[^ \t\n(:]+/ or /^class[ \t\n]+[^ \t\n(:]+/ + */ +void +Python_functions (inf) + FILE *inf; +{ + register char *cp; + + LOOP_ON_INPUT_LINES (inf, lb, cp) + { + if (*cp++ == 'd' + && *cp++ == 'e' + && *cp++ == 'f' && isspace (*cp++)) + { + cp = skip_spaces (cp); + while (*cp != '\0' && !isspace (*cp) && *cp != '(' && *cp != ':') + cp++; + pfnote ((char *) NULL, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } + + cp = lb.buffer; + if (*cp++ == 'c' + && *cp++ == 'l' + && *cp++ == 'a' + && *cp++ == 's' + && *cp++ == 's' && isspace (*cp++)) + { + cp = skip_spaces (cp); + while (*cp != '\0' && !isspace (*cp) && *cp != '(' && *cp != ':') + cp++; + pfnote ((char *) NULL, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } + } +} + +/* Idea by Corny de Souza + * Cobol tag functions + * We could look for anything that could be a paragraph name. + * i.e. anything that starts in column 8 is one word and ends in a full stop. + */ +void +Cobol_paragraphs (inf) + FILE *inf; +{ + register char *bp, *ep; + + LOOP_ON_INPUT_LINES (inf, lb, bp) + { + if (lb.len < 9) + continue; + bp += 8; + + /* If eoln, compiler option or comment ignore whole line. */ + if (bp[-1] != ' ' || !isalnum (bp[0])) + continue; + + for (ep = bp; isalnum (*ep) || *ep == '-'; ep++) + continue; + if (*ep++ == '.') + pfnote ((CTAGS) ? savenstr (bp, ep-bp) : NULL, TRUE, + lb.buffer, ep - lb.buffer + 1, lineno, linecharno); + } +} + +/* Added by Mosur Mohan, 4/22/88 */ +/* Pascal parsing */ + +/* + * Locates tags for procedures & functions. Doesn't do any type- or + * var-definitions. It does look for the keyword "extern" or + * "forward" immediately following the procedure statement; if found, + * the tag is skipped. + */ +void +Pascal_functions (inf) + FILE *inf; +{ + linebuffer tline; /* mostly copied from C_entries */ + long save_lcno; + int save_lineno, save_len; + char c, *cp, *namebuf; + + bool /* each of these flags is TRUE iff: */ + incomment, /* point is inside a comment */ + inquote, /* point is inside '..' string */ + get_tagname, /* point is after PROCEDURE/FUNCTION + keyword, so next item = potential tag */ + found_tag, /* point is after a potential tag */ + inparms, /* point is within parameter-list */ + verify_tag; /* point has passed the parm-list, so the + next token will determine whether this + is a FORWARD/EXTERN to be ignored, or + whether it is a real tag */ + + save_lcno = save_lineno = save_len = 0; /* keep compiler quiet */ + namebuf = NULL; /* keep compiler quiet */ + lineno = 0; + charno = 0; + dbp = lb.buffer; + *dbp = '\0'; + initbuffer (&tline); + + incomment = inquote = FALSE; + found_tag = FALSE; /* have a proc name; check if extern */ + get_tagname = FALSE; /* have found "procedure" keyword */ + inparms = FALSE; /* found '(' after "proc" */ + verify_tag = FALSE; /* check if "extern" is ahead */ + + + while (!feof (inf)) /* long main loop to get next char */ + { + c = *dbp++; + if (c == '\0') /* if end of line */ + { + lineno++; + linecharno = charno; + charno += readline (&lb, inf); + dbp = lb.buffer; + if (*dbp == '\0') + continue; + if (!((found_tag && verify_tag) + || get_tagname)) + c = *dbp++; /* only if don't need *dbp pointing + to the beginning of the name of + the procedure or function */ + } + if (incomment) + { + if (c == '}') /* within { } comments */ + incomment = FALSE; + else if (c == '*' && *dbp == ')') /* within (* *) comments */ + { + dbp++; + incomment = FALSE; + } + continue; + } + else if (inquote) + { + if (c == '\'') + inquote = FALSE; + continue; + } + else + switch (c) + { + case '\'': + inquote = TRUE; /* found first quote */ + continue; + case '{': /* found open { comment */ + incomment = TRUE; + continue; + case '(': + if (*dbp == '*') /* found open (* comment */ + { + incomment = TRUE; + dbp++; + } + else if (found_tag) /* found '(' after tag, i.e., parm-list */ + inparms = TRUE; + continue; + case ')': /* end of parms list */ + if (inparms) + inparms = FALSE; + continue; + case ';': + if (found_tag && !inparms) /* end of proc or fn stmt */ + { + verify_tag = TRUE; + break; + } + continue; + } + if (found_tag && verify_tag && (*dbp != ' ')) + { + /* check if this is an "extern" declaration */ + if (*dbp == '\0') + continue; + if (lowcase (*dbp == 'e')) + { + if (tail ("extern")) /* superfluous, really! */ + { + found_tag = FALSE; + verify_tag = FALSE; + } + } + else if (lowcase (*dbp) == 'f') + { + if (tail ("forward")) /* check for forward reference */ + { + found_tag = FALSE; + verify_tag = FALSE; + } + } + if (found_tag && verify_tag) /* not external proc, so make tag */ + { + found_tag = FALSE; + verify_tag = FALSE; + pfnote (namebuf, TRUE, + tline.buffer, save_len, save_lineno, save_lcno); + continue; + } + } + if (get_tagname) /* grab name of proc or fn */ + { + if (*dbp == '\0') + continue; + + /* save all values for later tagging */ + grow_linebuffer (&tline, lb.len + 1); + strcpy (tline.buffer, lb.buffer); + save_lineno = lineno; + save_lcno = linecharno; + + /* grab block name */ + for (cp = dbp + 1; *cp != '\0' && !endtoken (*cp); cp++) + continue; + namebuf = (CTAGS) ? savenstr (dbp, cp-dbp) : NULL; + dbp = cp; /* set dbp to e-o-token */ + save_len = dbp - lb.buffer + 1; + get_tagname = FALSE; + found_tag = TRUE; + continue; + + /* and proceed to check for "extern" */ + } + else if (!incomment && !inquote && !found_tag) + { + /* check for proc/fn keywords */ + switch (lowcase (c)) + { + case 'p': + if (tail ("rocedure")) /* c = 'p', dbp has advanced */ + get_tagname = TRUE; + continue; + case 'f': + if (tail ("unction")) + get_tagname = TRUE; + continue; + } + } + } /* while not eof */ + + free (tline.buffer); +} + +/* + * lisp tag functions + * look for (def or (DEF, quote or QUOTE + */ +int L_isdef PP ((char *strp)); +int +L_isdef (strp) + register char *strp; +{ + return ((strp[1] == 'd' || strp[1] == 'D') + && (strp[2] == 'e' || strp[2] == 'E') + && (strp[3] == 'f' || strp[3] == 'F')); +} +int L_isquote PP ((char *strp)); +int +L_isquote (strp) + register char *strp; +{ + return ((*++strp == 'q' || *strp == 'Q') + && (*++strp == 'u' || *strp == 'U') + && (*++strp == 'o' || *strp == 'O') + && (*++strp == 't' || *strp == 'T') + && (*++strp == 'e' || *strp == 'E') + && isspace (*++strp)); +} + +void L_getit PP ((void)); +void +L_getit () +{ + register char *cp; + + if (*dbp == '\'') /* Skip prefix quote */ + dbp++; + else if (*dbp == '(') + { + if (L_isquote (dbp)) + dbp += 7; /* Skip "(quote " */ + else + dbp += 1; /* Skip "(" before name in (defstruct (foo)) */ + dbp = skip_spaces (dbp); + } + + for (cp = dbp /*+1*/; + *cp != '\0' && *cp != '(' && *cp != ' ' && *cp != ')'; + cp++) + continue; + if (cp == dbp) + return; + + pfnote ((CTAGS) ? savenstr (dbp, cp-dbp) : NULL, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); +} + +void +Lisp_functions (inf) + FILE *inf; +{ + LOOP_ON_INPUT_LINES (inf, lb, dbp) + { + if (dbp[0] == '(') + { + if (L_isdef (dbp)) + { + dbp = skip_non_spaces (dbp); + dbp = skip_spaces (dbp); + L_getit (); + } + else + { + /* Check for (foo::defmumble name-defined ... */ + do + dbp++; + while (*dbp != '\0' && !isspace (*dbp) + && *dbp != ':' && *dbp != '(' && *dbp != ')'); + if (*dbp == ':') + { + do + dbp++; + while (*dbp == ':'); + + if (L_isdef (dbp - 1)) + { + dbp = skip_non_spaces (dbp); + dbp = skip_spaces (dbp); + L_getit (); + } + } + } + } + } +} + +/* + * Postscript tag functions + * Just look for lines where the first character is '/' + * Richard Mlynarik + */ +void +Postscript_functions (inf) + FILE *inf; +{ + register char *bp, *ep; + + LOOP_ON_INPUT_LINES (inf, lb, bp) + { + if (bp[0] == '/') + { + for (ep = bp+1; + *ep != '\0' && *ep != ' ' && *ep != '{'; + ep++) + continue; + pfnote ((CTAGS) ? savenstr (bp, ep-bp) : NULL, TRUE, + lb.buffer, ep - lb.buffer + 1, lineno, linecharno); + } + } +} + + +/* + * Scheme tag functions + * look for (def... xyzzy + * look for (def... (xyzzy + * look for (def ... ((...(xyzzy .... + * look for (set! xyzzy + */ + +void get_scheme PP ((void)); + +void +Scheme_functions (inf) + FILE *inf; +{ + LOOP_ON_INPUT_LINES (inf, lb, dbp) + { + if (dbp[0] == '(' + && (dbp[1] == 'D' || dbp[1] == 'd') + && (dbp[2] == 'E' || dbp[2] == 'e') + && (dbp[3] == 'F' || dbp[3] == 'f')) + { + dbp = skip_non_spaces (dbp); + /* Skip over open parens and white space */ + while (isspace (*dbp) || *dbp == '(') + dbp++; + get_scheme (); + } + if (dbp[0] == '(' + && (dbp[1] == 'S' || dbp[1] == 's') + && (dbp[2] == 'E' || dbp[2] == 'e') + && (dbp[3] == 'T' || dbp[3] == 't') + && (dbp[4] == '!' || dbp[4] == '!') + && (isspace (dbp[5]))) + { + dbp = skip_non_spaces (dbp); + dbp = skip_spaces (dbp); + get_scheme (); + } + } +} + +void +get_scheme () +{ + register char *cp; + + if (*dbp == '\0') + return; + /* Go till you get to white space or a syntactic break */ + for (cp = dbp + 1; + *cp != '\0' && *cp != '(' && *cp != ')' && !isspace (*cp); + cp++) + continue; + pfnote ((CTAGS) ? savenstr (dbp, cp-dbp) : NULL, TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); +} + +/* Find tags in TeX and LaTeX input files. */ + +/* TEX_toktab is a table of TeX control sequences that define tags. + Each TEX_tabent records one such control sequence. + CONVERT THIS TO USE THE Stab TYPE!! */ +struct TEX_tabent +{ + char *name; + int len; +}; + +struct TEX_tabent *TEX_toktab = NULL; /* Table with tag tokens */ + +/* Default set of control sequences to put into TEX_toktab. + The value of environment var TEXTAGS is prepended to this. */ + +char *TEX_defenv = "\ +:chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\ +:part:appendix:entry:index"; + +void TEX_mode PP ((FILE *inf)); +struct TEX_tabent *TEX_decode_env PP ((char *evarname, char *defenv)); +int TEX_Token PP ((char *cp)); + +char TEX_esc = '\\'; +char TEX_opgrp = '{'; +char TEX_clgrp = '}'; + +/* + * TeX/LaTeX scanning loop. + */ +void +TeX_functions (inf) + FILE *inf; +{ + char *cp, *lasthit; + register int i; + + /* Select either \ or ! as escape character. */ + TEX_mode (inf); + + /* Initialize token table once from environment. */ + if (!TEX_toktab) + TEX_toktab = TEX_decode_env ("TEXTAGS", TEX_defenv); + + LOOP_ON_INPUT_LINES (inf, lb, cp) + { + lasthit = cp; + /* Look at each esc in line. */ + while ((cp = etags_strchr (cp, TEX_esc)) != NULL) + { + if (*++cp == '\0') + break; + linecharno += cp - lasthit; + lasthit = cp; + i = TEX_Token (lasthit); + if (i >= 0) + { + /* We seem to include the TeX command in the tag name. + register char *p; + for (p = lasthit + TEX_toktab[i].len; + *p != '\0' && *p != TEX_clgrp; + p++) + continue; */ + pfnote (/*savenstr (lasthit, p-lasthit)*/ (char *)NULL, TRUE, + lb.buffer, lb.len, lineno, linecharno); + break; /* We only tag a line once */ + } + } + } +} + +#define TEX_LESC '\\' +#define TEX_SESC '!' +#define TEX_cmt '%' + +/* Figure out whether TeX's escapechar is '\\' or '!' and set grouping + chars accordingly. */ +void +TEX_mode (inf) + FILE *inf; +{ + int c; + + while ((c = getc (inf)) != EOF) + { + /* Skip to next line if we hit the TeX comment char. */ + if (c == TEX_cmt) + while (c != '\n') + c = getc (inf); + else if (c == TEX_LESC || c == TEX_SESC ) + break; + } + + if (c == TEX_LESC) + { + TEX_esc = TEX_LESC; + TEX_opgrp = '{'; + TEX_clgrp = '}'; + } + else + { + TEX_esc = TEX_SESC; + TEX_opgrp = '<'; + TEX_clgrp = '>'; + } + rewind (inf); +} + +/* Read environment and prepend it to the default string. + Build token table. */ +struct TEX_tabent * +TEX_decode_env (evarname, defenv) + char *evarname; + char *defenv; +{ + register char *env, *p; + + struct TEX_tabent *tab; + int size, i; + + /* Append default string to environment. */ + env = getenv (evarname); + if (!env) + env = defenv; + else + { + char *oldenv = env; + env = concat (oldenv, defenv, ""); + free (oldenv); + } + + /* Allocate a token table */ + for (size = 1, p = env; p;) + if ((p = etags_strchr (p, ':')) && *++p != '\0') + size++; + /* Add 1 to leave room for null terminator. */ + tab = xnew (size + 1, struct TEX_tabent); + + /* Unpack environment string into token table. Be careful about */ + /* zero-length strings (leading ':', "::" and trailing ':') */ + for (i = 0; *env;) + { + p = etags_strchr (env, ':'); + if (!p) /* End of environment string. */ + p = env + strlen (env); + if (p - env > 0) + { /* Only non-zero strings. */ + tab[i].name = savenstr (env, p - env); + tab[i].len = strlen (tab[i].name); + i++; + } + if (*p) + env = p + 1; + else + { + tab[i].name = NULL; /* Mark end of table. */ + tab[i].len = 0; + break; + } + } + return tab; +} + +/* If the text at CP matches one of the tag-defining TeX command names, + return the pointer to the first occurrence of that command in TEX_toktab. + Otherwise return -1. + Keep the capital `T' in `token' for dumb truncating compilers + (this distinguishes it from `TEX_toktab' */ +int +TEX_Token (cp) + char *cp; +{ + int i; + + for (i = 0; TEX_toktab[i].len > 0; i++) + if (strneq (TEX_toktab[i].name, cp, TEX_toktab[i].len)) + return i; + return -1; +} + +/* + * Prolog support (rewritten) by Anders Lindgren, Mar. 96 + * + * Assumes that the predicate starts at column 0. + * Only the first clause of a predicate is added. + */ +int prolog_pred PP ((char *s, char *last)); +void prolog_skip_comment PP ((linebuffer *plb, FILE *inf)); +int prolog_atom PP ((char *s, int pos)); + +void +Prolog_functions (inf) + FILE *inf; +{ + char *cp, *last; + int len; + int allocated; + + allocated = 0; + len = 0; + last = NULL; + + LOOP_ON_INPUT_LINES (inf, lb, cp) + { + if (cp[0] == '\0') /* Empty line */ + continue; + else if (isspace (cp[0])) /* Not a predicate */ + continue; + else if (cp[0] == '/' && cp[1] == '*') /* comment. */ + prolog_skip_comment (&lb, inf); + else if ((len = prolog_pred (cp, last)) > 0) + { + /* Predicate. Store the function name so that we only + generate a tag for the first clause. */ + if (last == NULL) + last = xnew(len + 1, char); + else if (len + 1 > allocated) + last = xrnew (last, len + 1, char); + allocated = len + 1; + strncpy (last, cp, len); + last[len] = '\0'; + } + } +} + + +void +prolog_skip_comment (plb, inf) + linebuffer *plb; + FILE *inf; +{ + char *cp; + + do + { + for (cp = plb->buffer; *cp != '\0'; cp++) + if (cp[0] == '*' && cp[1] == '/') + return; + lineno++; + linecharno += readline (plb, inf); + } + while (!feof(inf)); +} + +/* + * A predicate definition is added if it matches: + * ( + * + * It is added to the tags database if it doesn't match the + * name of the previous clause header. + * + * Return the size of the name of the predicate, or 0 if no header + * was found. + */ +int +prolog_pred (s, last) + char *s; + char *last; /* Name of last clause. */ +{ + int pos; + int len; + + pos = prolog_atom (s, 0); + if (pos < 1) + return 0; + + len = pos; + pos = skip_spaces (s + pos) - s; + + if ((s[pos] == '(') || (s[pos] == '.')) + { + if (s[pos] == '(') + pos++; + + /* Save only the first clause. */ + if (last == NULL + || len != strlen (last) + || !strneq (s, last, len)) + { + pfnote ((CTAGS) ? savenstr (s, len) : NULL, TRUE, + s, pos, lineno, linecharno); + return len; + } + } + return 0; +} + +/* + * Consume a Prolog atom. + * Return the number of bytes consumed, or -1 if there was an error. + * + * A prolog atom, in this context, could be one of: + * - An alphanumeric sequence, starting with a lower case letter. + * - A quoted arbitrary string. Single quotes can escape themselves. + * Backslash quotes everything. + */ +int +prolog_atom (s, pos) + char *s; + int pos; +{ + int origpos; + + origpos = pos; + + if (islower(s[pos]) || (s[pos] == '_')) + { + /* The atom is unquoted. */ + pos++; + while (isalnum(s[pos]) || (s[pos] == '_')) + { + pos++; + } + return pos - origpos; + } + else if (s[pos] == '\'') + { + pos++; + + while (1) + { + if (s[pos] == '\'') + { + pos++; + if (s[pos] != '\'') + break; + pos++; /* A double quote */ + } + else if (s[pos] == '\0') + /* Multiline quoted atoms are ignored. */ + return -1; + else if (s[pos] == '\\') + { + if (s[pos+1] == '\0') + return -1; + pos += 2; + } + else + pos++; + } + return pos - origpos; + } + else + return -1; +} + +/* + * Support for Erlang -- Anders Lindgren, Feb 1996. + * + * Generates tags for functions, defines, and records. + * + * Assumes that Erlang functions start at column 0. + */ +int erlang_func PP ((char *s, char *last)); +void erlang_attribute PP ((char *s)); +int erlang_atom PP ((char *s, int pos)); + +void +Erlang_functions (inf) + FILE *inf; +{ + char *cp, *last; + int len; + int allocated; + + allocated = 0; + len = 0; + last = NULL; + + LOOP_ON_INPUT_LINES (inf, lb, cp) + { + if (cp[0] == '\0') /* Empty line */ + continue; + else if (isspace (cp[0])) /* Not function nor attribute */ + continue; + else if (cp[0] == '%') /* comment */ + continue; + else if (cp[0] == '"') /* Sometimes, strings start in column one */ + continue; + else if (cp[0] == '-') /* attribute, e.g. "-define" */ + { + erlang_attribute (cp); + last = NULL; + } + else if ((len = erlang_func (cp, last)) > 0) + { + /* + * Function. Store the function name so that we only + * generates a tag for the first clause. + */ + if (last == NULL) + last = xnew (len + 1, char); + else if (len + 1 > allocated) + last = xrnew (last, len + 1, char); + allocated = len + 1; + strncpy (last, cp, len); + last[len] = '\0'; + } + } +} + + +/* + * A function definition is added if it matches: + * ( + * + * It is added to the tags database if it doesn't match the + * name of the previous clause header. + * + * Return the size of the name of the function, or 0 if no function + * was found. + */ +int +erlang_func (s, last) + char *s; + char *last; /* Name of last clause. */ +{ + int pos; + int len; + + pos = erlang_atom (s, 0); + if (pos < 1) + return 0; + + len = pos; + pos = skip_spaces (s + pos) - s; + + /* Save only the first clause. */ + if (s[pos++] == '(' + && (last == NULL + || len != strlen (last) + || !strneq (s, last, len))) + { + pfnote ((CTAGS) ? savenstr (s, len) : NULL, TRUE, + s, pos, lineno, linecharno); + return len; + } + + return 0; +} + + +/* + * Handle attributes. Currently, tags are generated for defines + * and records. + * + * They are on the form: + * -define(foo, bar). + * -define(Foo(M, N), M+N). + * -record(graph, {vtab = notable, cyclic = true}). + */ +void +erlang_attribute (s) + char *s; +{ + int pos; + int len; + + if (strneq (s, "-define", 7) || strneq (s, "-record", 7)) + { + pos = skip_spaces (s + 7) - s; + if (s[pos++] == '(') + { + pos = skip_spaces (s + pos) - s; + len = erlang_atom (s, pos); + if (len != 0) + pfnote ((CTAGS) ? savenstr (& s[pos], len) : NULL, TRUE, + s, pos + len, lineno, linecharno); + } + } + return; +} + + +/* + * Consume an Erlang atom (or variable). + * Return the number of bytes consumed, or -1 if there was an error. + */ +int +erlang_atom (s, pos) + char *s; + int pos; +{ + int origpos; + + origpos = pos; + + if (isalpha (s[pos]) || s[pos] == '_') + { + /* The atom is unquoted. */ + pos++; + while (isalnum (s[pos]) || s[pos] == '_') + pos++; + return pos - origpos; + } + else if (s[pos] == '\'') + { + pos++; + + while (1) + { + if (s[pos] == '\'') + { + pos++; + break; + } + else if (s[pos] == '\0') + /* Multiline quoted atoms are ignored. */ + return -1; + else if (s[pos] == '\\') + { + if (s[pos+1] == '\0') + return -1; + pos += 2; + } + else + pos++; + } + return pos - origpos; + } + else + return -1; +} + +#ifdef ETAGS_REGEXPS + +/* Take a string like "/blah/" and turn it into "blah", making sure + that the first and last characters are the same, and handling + quoted separator characters. Actually, stops on the occurrence of + an unquoted separator. Also turns "\t" into a Tab character. + Returns pointer to terminating separator. Works in place. Null + terminates name string. */ +char * scan_separators PP ((char *name)); +char * +scan_separators (name) + char *name; +{ + char sep = name[0]; + char *copyto = name; + bool quoted = FALSE; + + for (++name; *name != '\0'; ++name) + { + if (quoted) + { + if (*name == 't') + *copyto++ = '\t'; + else if (*name == sep) + *copyto++ = sep; + else + { + /* Something else is quoted, so preserve the quote. */ + *copyto++ = '\\'; + *copyto++ = *name; + } + quoted = FALSE; + } + else if (*name == '\\') + quoted = TRUE; + else if (*name == sep) + break; + else + *copyto++ = *name; + } + + /* Terminate copied string. */ + *copyto = '\0'; + return name; +} + +/* Look at the argument of --regex or --no-regex and do the right + thing. Same for each line of a regexp file. */ +void +analyse_regex (regex_arg) + char *regex_arg; +{ + if (regex_arg == NULL) + free_patterns (); /* --no-regex: remove existing regexps */ + + /* A real --regexp option or a line in a regexp file. */ + switch (regex_arg[0]) + { + /* Comments in regexp file or null arg to --regex. */ + case '\0': + case ' ': + case '\t': + break; + + /* Read a regex file. This is recursive and may result in a + loop, which will stop when the file descriptors are exhausted. */ + case '@': + { + FILE *regexfp; + linebuffer regexbuf; + char *regexfile = regex_arg + 1; + + /* regexfile is a file containing regexps, one per line. */ + regexfp = fopen (regexfile, "r"); + if (regexfp == NULL) + { + pfatal (regexfile); + return; + } + initbuffer (®exbuf); + while (readline_internal (®exbuf, regexfp) > 0) + analyse_regex (regexbuf.buffer); + free (regexbuf.buffer); + fclose (regexfp); + } + break; + + /* Regexp to be used for a specific language only. */ + case '{': + { + language *lang; + char *lang_name = regex_arg + 1; + char *cp; + + for (cp = lang_name; *cp != '}'; cp++) + if (*cp == '\0') + { + error ("unterminated language name in regex: %s", regex_arg); + return; + } + *cp = '\0'; + lang = get_language_from_name (lang_name); + if (lang == NULL) + return; + add_regex (cp + 1, lang); + } + break; + + /* Regexp to be used for any language. */ + default: + add_regex (regex_arg, NULL); + break; + } +} + +/* Turn a name, which is an ed-style (but Emacs syntax) regular + expression, into a real regular expression by compiling it. */ +void +add_regex (regexp_pattern, lang) + char *regexp_pattern; + language *lang; +{ + char *name; + const char *err; + struct re_pattern_buffer *patbuf; + pattern *pp; + + + if (regexp_pattern[strlen(regexp_pattern)-1] != regexp_pattern[0]) + { + error ("%s: unterminated regexp", regexp_pattern); + return; + } + name = scan_separators (regexp_pattern); + if (regexp_pattern[0] == '\0') + { + error ("null regexp", (char *)NULL); + return; + } + (void) scan_separators (name); + + patbuf = xnew (1, struct re_pattern_buffer); + patbuf->translate = NULL; + patbuf->fastmap = NULL; + patbuf->buffer = NULL; + patbuf->allocated = 0; + + err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf); + if (err != NULL) + { + error ("%s while compiling pattern", err); + return; + } + + pp = p_head; + p_head = xnew (1, pattern); + p_head->regex = savestr (regexp_pattern); + p_head->p_next = pp; + p_head->language = lang; + p_head->pattern = patbuf; + p_head->name_pattern = savestr (name); + p_head->error_signaled = FALSE; +} + +/* + * Do the substitutions indicated by the regular expression and + * arguments. + */ +char * substitute PP ((char *in, char *out, struct re_registers *regs)); +char * +substitute (in, out, regs) + char *in, *out; + struct re_registers *regs; +{ + char *result, *t; + int size, dig, diglen; + + result = NULL; + size = strlen (out); + + /* Pass 1: figure out how much to allocate by finding all \N strings. */ + if (out[size - 1] == '\\') + fatal ("pattern error in \"%s\"", out); + for (t = etags_strchr (out, '\\'); + t != NULL; + t = etags_strchr (t + 2, '\\')) + if (isdigit (t[1])) + { + dig = t[1] - '0'; + diglen = regs->end[dig] - regs->start[dig]; + size += diglen - 2; + } + else + size -= 1; + + /* Allocate space and do the substitutions. */ + result = xnew (size + 1, char); + + for (t = result; *out != '\0'; out++) + if (*out == '\\' && isdigit (*++out)) + { + /* Using "dig2" satisfies my debugger. Bleah. */ + dig = *out - '0'; + diglen = regs->end[dig] - regs->start[dig]; + strncpy (t, in + regs->start[dig], diglen); + t += diglen; + } + else + *t++ = *out; + *t = '\0'; + + if (DEBUG && (t > result + size || t - result != strlen (result))) + abort (); + + return result; +} + +/* Deallocate all patterns. */ +void +free_patterns () +{ + pattern *pp; + while (p_head != NULL) + { + pp = p_head->p_next; + free (p_head->regex); + free (p_head->name_pattern); + free (p_head); + p_head = pp; + } + return; +} + +#endif /* ETAGS_REGEXPS */ +/* Initialize a linebuffer for use */ +void +initbuffer (lbp) + linebuffer *lbp; +{ + lbp->size = 200; + lbp->buffer = xnew (200, char); +} + +/* + * Read a line of text from `stream' into `lbp', excluding the + * newline or CR-NL, if any. Return the number of characters read from + * `stream', which is the length of the line including the newline. + * + * On DOS or Windows we do not count the CR character, if any, before the + * NL, in the returned length; this mirrors the behavior of emacs on those + * platforms (for text files, it translates CR-NL to NL as it reads in the + * file). + */ +long +readline_internal (lbp, stream) + linebuffer *lbp; + register FILE *stream; +{ + char *buffer = lbp->buffer; + register char *p = lbp->buffer; + register char *pend; + int chars_deleted; + + pend = p + lbp->size; /* Separate to avoid 386/IX compiler bug. */ + + while (1) + { + register int c = getc (stream); + if (p == pend) + { + /* We're at the end of linebuffer: expand it. */ + lbp->size *= 2; + buffer = xrnew (buffer, lbp->size, char); + p += buffer - lbp->buffer; + pend = buffer + lbp->size; + lbp->buffer = buffer; + } + if (c == EOF) + { + *p = '\0'; + chars_deleted = 0; + break; + } + if (c == '\n') + { + if (p > buffer && p[-1] == '\r') + { + p -= 1; +#ifdef DOS_NT + /* Assume CRLF->LF translation will be performed by Emacs + when loading this file, so CRs won't appear in the buffer. + It would be cleaner to compensate within Emacs; + however, Emacs does not know how many CRs were deleted + before any given point in the file. */ + chars_deleted = 1; +#else + chars_deleted = 2; +#endif + } + else + { + chars_deleted = 1; + } + *p = '\0'; + break; + } + *p++ = c; + } + lbp->len = p - buffer; + + return lbp->len + chars_deleted; +} + +/* + * Like readline_internal, above, but in addition try to match the + * input line against relevant regular expressions. + */ +long +readline (lbp, stream) + linebuffer *lbp; + FILE *stream; +{ + /* Read new line. */ + long result = readline_internal (lbp, stream); +#ifdef ETAGS_REGEXPS + int match; + pattern *pp; + + /* Match against relevant patterns. */ + if (lbp->len > 0) + for (pp = p_head; pp != NULL; pp = pp->p_next) + { + /* Only use generic regexps or those for the current language. */ + if (pp->language != NULL && pp->language != curlang) + continue; + + match = re_match (pp->pattern, lbp->buffer, lbp->len, 0, &pp->regs); + switch (match) + { + case -2: + /* Some error. */ + if (!pp->error_signaled) + { + error ("error while matching \"%s\"", pp->regex); + pp->error_signaled = TRUE; + } + break; + case -1: + /* No match. */ + break; + default: + /* Match occurred. Construct a tag. */ + if (pp->name_pattern[0] != '\0') + { + /* Make a named tag. */ + char *name = substitute (lbp->buffer, + pp->name_pattern, &pp->regs); + if (name != NULL) + pfnote (name, TRUE, lbp->buffer, match, lineno, linecharno); + } + else + { + /* Make an unnamed tag. */ + pfnote ((char *)NULL, TRUE, + lbp->buffer, match, lineno, linecharno); + } + break; + } + } +#endif /* ETAGS_REGEXPS */ + + return result; +} + +/* + * Return a pointer to a space of size strlen(cp)+1 allocated + * with xnew where the string CP has been copied. + */ +char * +savestr (cp) + char *cp; +{ + return savenstr (cp, strlen (cp)); +} + +/* + * Return a pointer to a space of size LEN+1 allocated with xnew where + * the string CP has been copied for at most the first LEN characters. + */ +char * +savenstr (cp, len) + char *cp; + int len; +{ + register char *dp; + + dp = xnew (len + 1, char); + strncpy (dp, cp, len); + dp[len] = '\0'; + return dp; +} + +/* + * Return the ptr in sp at which the character c last + * appears; NULL if not found + * + * Identical to System V strrchr, included for portability. + */ +char * +etags_strrchr (sp, c) + register char *sp; + register int c; +{ + register char *r; + + r = NULL; + do + { + if (*sp == c) + r = sp; + } while (*sp++); + return r; +} + + +/* + * Return the ptr in sp at which the character c first + * appears; NULL if not found + * + * Identical to System V strchr, included for portability. + */ +char * +etags_strchr (sp, c) + register char *sp; + register int c; +{ + do + { + if (*sp == c) + return sp; + } while (*sp++); + return NULL; +} + +/* Skip spaces, return new pointer. */ +char * +skip_spaces (cp) + char *cp; +{ + while (isspace (*cp)) /* isspace('\0')==FALSE */ + cp++; + return cp; +} + +/* Skip non spaces, return new pointer. */ +char * +skip_non_spaces (cp) + char *cp; +{ + while (!iswhite (*cp)) /* iswhite('\0')==TRUE */ + cp++; + return cp; +} + +/* Print error message and exit. */ +void +fatal (s1, s2) + char *s1, *s2; +{ + error (s1, s2); + exit (BAD); +} + +void +pfatal (s1) + char *s1; +{ + perror (s1); + exit (BAD); +} + +void +suggest_asking_for_help () +{ + fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", + progname, +#ifdef LONG_OPTIONS + "--help" +#else + "-h" +#endif + ); + exit (BAD); +} + +/* Print error message. `s1' is printf control string, `s2' is arg for it. */ +void +error (s1, s2) + const char *s1, *s2; +{ + fprintf (stderr, "%s: ", progname); + fprintf (stderr, s1, s2); + fprintf (stderr, "\n"); +} + +/* Return a newly-allocated string whose contents + concatenate those of s1, s2, s3. */ +char * +concat (s1, s2, s3) + char *s1, *s2, *s3; +{ + int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); + char *result = xnew (len1 + len2 + len3 + 1, char); + + strcpy (result, s1); + strcpy (result + len1, s2); + strcpy (result + len1 + len2, s3); + result[len1 + len2 + len3] = '\0'; + + return result; +} + +/* Does the same work as the system V getcwd, but does not need to + guess the buffer size in advance. */ +char * +etags_getcwd () +{ +#ifdef HAVE_GETCWD + int bufsize = 200; + char *path = xnew (bufsize, char); + + while (getcwd (path, bufsize) == NULL) + { + if (errno != ERANGE) + pfatal ("getcwd"); + bufsize *= 2; + free (path); + path = xnew (bufsize, char); + } + + canonicalize_filename (path); + return path; + +#else /* not HAVE_GETCWD */ +#ifdef MSDOS + char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ + + getwd (path); + + for (p = path; *p != '\0'; p++) + if (*p == '\\') + *p = '/'; + else + *p = lowcase (*p); + + return strdup (path); +#else /* not MSDOS */ + linebuffer path; + FILE *pipe; + + initbuffer (&path); + pipe = (FILE *) popen ("pwd 2>/dev/null", "r"); + if (pipe == NULL || readline_internal (&path, pipe) == 0) + pfatal ("pwd"); + pclose (pipe); + + return path.buffer; +#endif /* not MSDOS */ +#endif /* not HAVE_GETCWD */ +} + +/* Return a newly allocated string containing the file name of FILE + relative to the absolute directory DIR (which should end with a slash). */ +char * +relative_filename (file, dir) + char *file, *dir; +{ + char *fp, *dp, *afn, *res; + int i; + + /* Find the common root of file and dir (with a trailing slash). */ + afn = absolute_filename (file, cwd); + fp = afn; + dp = dir; + while (*fp++ == *dp++) + continue; + fp--, dp--; /* back to the first differing char */ + do /* look at the equal chars until '/' */ + fp--, dp--; + while (*fp != '/'); + + /* Build a sequence of "../" strings for the resulting relative file name. */ + i = 0; + while ((dp = etags_strchr (dp + 1, '/')) != NULL) + i += 1; + res = xnew (3*i + strlen (fp + 1) + 1, char); + res[0] = '\0'; + while (i-- > 0) + strcat (res, "../"); + + /* Add the file name relative to the common root of file and dir. */ + strcat (res, fp + 1); + free (afn); + + return res; +} + +/* Return a newly allocated string containing the absolute file name + of FILE given DIR (which should end with a slash). */ +char * +absolute_filename (file, dir) + char *file, *dir; +{ + char *slashp, *cp, *res; + + if (filename_is_absolute (file)) + res = savestr (file); +#ifdef DOS_NT + /* We don't support non-absolute file names with a drive + letter, like `d:NAME' (it's too much hassle). */ + else if (file[1] == ':') + fatal ("%s: relative file names with drive letters not supported", file); +#endif + else + res = concat (dir, file, ""); + + /* Delete the "/dirname/.." and "/." substrings. */ + slashp = etags_strchr (res, '/'); + while (slashp != NULL && slashp[0] != '\0') + { + if (slashp[1] == '.') + { + if (slashp[2] == '.' + && (slashp[3] == '/' || slashp[3] == '\0')) + { + cp = slashp; + do + cp--; + while (cp >= res && !filename_is_absolute (cp)); + if (cp < res) + cp = slashp; /* the absolute name begins with "/.." */ +#ifdef DOS_NT + /* Under MSDOS and NT we get `d:/NAME' as absolute + file name, so the luser could say `d:/../NAME'. + We silently treat this as `d:/NAME'. */ + else if (cp[0] != '/') + cp = slashp; +#endif + strcpy (cp, slashp + 3); + slashp = cp; + continue; + } + else if (slashp[2] == '/' || slashp[2] == '\0') + { + strcpy (slashp, slashp + 2); + continue; + } + } + + slashp = etags_strchr (slashp + 1, '/'); + } + + if (res[0] == '\0') + return savestr ("/"); + else + return res; +} + +/* Return a newly allocated string containing the absolute + file name of dir where FILE resides given DIR (which should + end with a slash). */ +char * +absolute_dirname (file, dir) + char *file, *dir; +{ + char *slashp, *res; + char save; + + canonicalize_filename (file); + slashp = etags_strrchr (file, '/'); + if (slashp == NULL) + return savestr (dir); + save = slashp[1]; + slashp[1] = '\0'; + res = absolute_filename (file, dir); + slashp[1] = save; + + return res; +} + +/* Whether the argument string is an absolute file name. The argument + string must have been canonicalized with canonicalize_filename. */ +bool +filename_is_absolute (fn) + char *fn; +{ + return (fn[0] == '/' +#ifdef DOS_NT + || (isalpha(fn[0]) && fn[1] == ':' && fn[2] == '/') +#endif + ); +} + +/* Translate backslashes into slashes. Works in place. */ +void +canonicalize_filename (fn) + register char *fn; +{ +#ifdef DOS_NT + for (; *fn != '\0'; fn++) + if (*fn == '\\') + *fn = '/'; +#else + /* No action. */ +#endif +} + +/* Increase the size of a linebuffer. */ +void +grow_linebuffer (lbp, toksize) + linebuffer *lbp; + int toksize; +{ + while (lbp->size < toksize) + lbp->size *= 2; + lbp->buffer = xrnew (lbp->buffer, lbp->size, char); +} + +/* Like malloc but get fatal error if memory is exhausted. */ +long * +xmalloc (size) + unsigned int size; +{ + long *result = (long *) malloc (size); + if (result == NULL) + fatal ("virtual memory exhausted", (char *)NULL); + return result; +} + +long * +xrealloc (ptr, size) + char *ptr; + unsigned int size; +{ + long *result = (long *) realloc (ptr, size); + if (result == NULL) + fatal ("virtual memory exhausted", (char *)NULL); + return result; +} diff -r 090b52736db2 -r c42ec1d1cded lib-src/update-elc.sh --- a/lib-src/update-elc.sh Mon Aug 13 10:32:23 2007 +0200 +++ b/lib-src/update-elc.sh Mon Aug 13 10:33:18 2007 +0200 @@ -42,7 +42,7 @@ exit 1 fi -test -z "$EMACS" && EMACS="./src/xemacs" +if test -z "$EMACS"; then EMACS="./src/xemacs"; fi export EMACS echo " (using $EMACS)" diff -r 090b52736db2 -r c42ec1d1cded lisp/ChangeLog --- a/lisp/ChangeLog Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/ChangeLog Mon Aug 13 10:33:18 2007 +0200 @@ -1,3 +1,127 @@ +1998-05-06 Oliver Graf + + * dragdrop.el (dragdrop-drop-dispatch): changed to new list concept + (dragdrop-drop-url-default) default handler for URL drops created + (dragdrop-drop-mime-default) default handler for MIME drops created + (dragdrop-drop-functions) default custom for handling drops created + (dragdrop-drop-do-functions) helper for drgadrop-drop-dispatch + +1998-05-05 Jonathan Harris + + * mouse.el: Removed redundant mouse-mswindows-drop function. + +1998-05-05 Oliver Graf + + * about.el: changed some text in my entry + * dragdrop.el: added customs + +1998-05-04 Oliver Graf + + * mouse.el: killed global drop key bindings + (mouse-offix-drop) removed + * dragdrop.el: created + * dumped-lisp.el: inclusion of dragdrop.el for window-systems + +1998-05-09 Kirill M. Katsnelson + + * x-scrollbar.el (x-init-scrollbar-from-resources): Initialize + scrollbar-on-{left,top}-p from *scrollBarPlacement resources. + + * x-misc.el (x-get-resource-and-maybe-bogosity-check): Removed + obsolete comment. + + * scrollbar.el (scrollbars-visible-p): Use new + {vertical,horizontal}-scrollbar-visible-p specifiers. + +1998-04-18 Kirill M. Katsnelson + + * device.el (device-pixel-height): + (device-pixel-width): + (device-mm-width): + (device-mm-height): + (device-bitplanes): + (device-color-cells): Moved these 6 functions from device.c; they + all use single (device-system-metrics) call. + +1998-05-09 SL Baur + + * dumped-lisp.el (preloaded-file-list): x-menubar.el and x-toolbar.el + were renamed. + + * menubar-items.el: + * toolbar-items.el: Renamed from x-menubar/x-toolbar. + Suggested by Hrvoje Niksic + + * help.el (help-map): Remove Hyperbole keybinding logic. + Suggested by: Michael Ernst + +1998-05-08 SL Baur + + * x-menubar.el (default-menubar): Enable 'mail-user-agent' feature. + From SAKIYAMA Nobuo + +1998-05-07 Andy Piper + + * msw-glyphs.el: use nicer icon3 from the frame icon. + +1998-05-07 SL Baur + + * version.el (emacs-version): Remove InfoDock conditionals. + + * startup.el (startup-splash-frame): Change ID logo name. + +1998-05-06 Hrvoje Niksic + + * files.el (after-find-file): If the user presses C-g on + directory-creation prompt, kill the buffer. + +1998-05-06 SL Baur + + * simple.el (count-words-region): Reverse previous change. + +1998-05-05 Hrvoje Niksic + + * replace.el (query-replace): Just call perform-replace. + (query-replace-regexp): Ditto. + (perform-replace): Move region handling here. + (perform-replace): Use the new arg to match-data. + +1998-03-08 Kyle Jones + + * x-init.el: Install X specific display table that + displays char 0240 as a space to avoid whatever it is + that screws up display of that character code. + +1998-05-03 Hrvoje Niksic + + * help.el (function-arglist): If no arguments are documented for a + subr, print nothing rather than incorrect output. + +1998-05-05 SL Baur + + * cmdloop.el (command-error): Update bail-out error message to use + `emacs-program-name'. + + * lib-complete.el: Remove reader macro cruft. + + * dumped-lisp.el (preloaded-file-list): Phase I: remove InfoDock + cruft. + + * simple.el (count-words-region): Drop interactive-p check on the + message. + +1998-05-04 Jonathan Harris + + * font.el + * msw-faces.el + Correct spelling of mswindows-font-canonicalize-name. + +1998-05-03 Oscar Figueiredo + + * ldap.el (ldap-host-parameters-alist): Replaced with + `ldap-host-parameters-plist' + (ldap-search): Adapt to previous change + 1998-05-02 SL Baur * about.el (about-hackers): Update Bob Weiner bio. diff -r 090b52736db2 -r c42ec1d1cded lisp/about.el --- a/lisp/about.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/about.el Mon Aug 13 10:33:18 2007 +0200 @@ -948,10 +948,10 @@ business network solutions based on linux servers and various other networking products. -Most of my spare time I spent on the development of the XEmacs DnD -events, a enhanced version of Tk called TkStep (better looks, DnD, -and more), and various other minor hacks: ISDN-tools, cd players, -python, etc... +Most of my spare time I spent on the development of the XEmacs +Drag'n'Drop API, a enhanced version of Tk called TkStep (better looks, +also Drag'n'Drop, and more), and various other hacks: ISDN-tools, +cd players, python, etc... To see some of these have a look at ") (about-url-link 'ograf "one of my homepages") diff -r 090b52736db2 -r c42ec1d1cded lisp/auto-autoloads.el --- a/lisp/auto-autoloads.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/auto-autoloads.el Mon Aug 13 10:33:18 2007 +0200 @@ -949,7 +949,7 @@ (make-variable-buffer-local 'font-lock-keywords) -(defvar font-lock-mode nil) +(defcustom font-lock-mode nil "Non nil means `font-lock-mode' is on" :group 'font-lock :type 'boolean :initialize 'custom-initialize-default :require 'font-lock :set '(lambda (var val) (font-lock-mode (or val 0)))) (defvar font-lock-mode-hook nil "\ Function or functions to run on entry to font-lock-mode.") @@ -1097,7 +1097,7 @@ ;;;*** -;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-query info) "info" "lisp/info.el") +;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-batch-rebuild-dir Info-query info) "info" "lisp/info.el") (defvar Info-directory-list nil "\ List of directories to search for Info documentation files. @@ -1118,6 +1118,13 @@ (autoload 'Info-query "info" "\ Enter Info, the documentation browser. Prompt for name of Info file." t nil) +(autoload 'Info-batch-rebuild-dir "info" "\ +(Re)build info `dir' files in the directories remaining on the command line. +Use this from the command line, with `-batch'; +it won't work in an interactive Emacs. +Each file is processed even if an error occurred previously. +For example, invoke \"xemacs -batch -f Info-batch-rebuild-dir /usr/local/info\"" nil nil) + (autoload 'Info-goto-node "info" "\ Go to info node named NAME. Give just NODENAME or (FILENAME)NODENAME. Actually, the following interpretations of NAME are tried in order: diff -r 090b52736db2 -r c42ec1d1cded lisp/cmdloop.el --- a/lisp/cmdloop.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/cmdloop.el Mon Aug 13 10:33:18 2007 +0200 @@ -147,7 +147,7 @@ (if (noninteractive) (progn - (message "XEmacs exiting.") + (message "%s exiting." emacs-program-name) (kill-emacs -1))) t)) diff -r 090b52736db2 -r c42ec1d1cded lisp/custom-load.el --- a/lisp/custom-load.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/custom-load.el Mon Aug 13 10:33:18 2007 +0200 @@ -7,13 +7,14 @@ (custom-add-loads 'custom-buffer '("cus-edit")) (custom-add-loads 'custom-faces '("cus-edit")) (custom-add-loads 'auto-show '("auto-show")) +(custom-add-loads 'drag-n-drop '("dragdrop")) (custom-add-loads 'mouse '("mouse" "mwheel")) (custom-add-loads 'etags '("etags")) (custom-add-loads 'widgets '("wid-browse" "wid-edit")) -(custom-add-loads 'menu '("x-menubar")) +(custom-add-loads 'menu '("menubar-items")) (custom-add-loads 'minibuffer '("simple" "minibuf")) (custom-add-loads 'log-message '("simple")) -(custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "x-init" "x-toolbar" "cus-edit" "gnuserv" "sound")) +(custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "x-init" "toolbar-items" "cus-edit" "gnuserv" "sound")) (custom-add-loads 'sound '("sound")) (custom-add-loads 'terminals '("gnuserv")) (custom-add-loads 'auto-save '("files" "auto-save")) @@ -25,7 +26,7 @@ (custom-add-loads 'internal '("cus-edit")) (custom-add-loads 'help-appearance '("help" "help-macro")) (custom-add-loads 'build-report '("build-report")) -(custom-add-loads 'buffers-menu '("x-menubar")) +(custom-add-loads 'buffers-menu '("menubar-items")) (custom-add-loads 'hypermedia '("wid-edit")) (custom-add-loads 'lisp '("lisp" "lisp-mode" "hyper-apropos")) (custom-add-loads 'applications '("cus-edit")) @@ -42,7 +43,7 @@ (custom-add-loads 'custom-browse '("cus-edit")) (custom-add-loads 'abbrev '("abbrev" "files")) (custom-add-loads 'programming '("cus-edit")) -(custom-add-loads 'toolbar '("x-toolbar")) +(custom-add-loads 'toolbar '("toolbar-items")) (custom-add-loads 'dired '("files")) (custom-add-loads 'killing '("simple")) (custom-add-loads 'widget-button '("wid-edit")) @@ -60,7 +61,7 @@ (custom-add-loads 'languages '("lisp-mode" "cus-edit" "font-lock")) (custom-add-loads 'fill '("simple" "fill")) (custom-add-loads 'custom-magic-faces '("cus-edit")) -(custom-add-loads 'display '("auto-show")) +(custom-add-loads 'display '("toolbar" "scrollbar" "auto-show")) (custom-add-loads 'faces '("faces" "cus-edit" "font-lock" "font" "hyper-apropos" "info" "wid-edit")) (custom-add-loads 'emacs '("faces" "help" "files" "cus-edit")) (custom-add-loads 'processes '("process" "gnuserv")) @@ -70,10 +71,10 @@ (custom-add-loads 'isearch '("isearch-mode")) (custom-add-loads 'font-lock-faces '("font-lock")) (custom-add-loads 'modeline '("modeline")) -(custom-add-loads 'editing '("simple" "abbrev" "fill" "mouse" "cus-edit")) +(custom-add-loads 'editing '("simple" "abbrev" "fill" "mouse" "dragdrop" "cus-edit")) (custom-add-loads 'matching '("simple" "isearch-mode" "hyper-apropos")) (custom-add-loads 'i18n '("cus-edit")) -(custom-add-loads 'info '("x-toolbar" "info")) +(custom-add-loads 'info '("toolbar-items" "info")) (custom-add-loads 'x '("x-faces" "x-font-menu")) ;;; custom-load.el ends here diff -r 090b52736db2 -r c42ec1d1cded lisp/device.el --- a/lisp/device.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/device.el Mon Aug 13 10:33:18 2007 +0200 @@ -63,6 +63,34 @@ (make-device 'tty tty (list 'terminal-type terminal-type 'controlling-process controlling-process))) +(defun device-pixel-width (&optional device) + "Return the width in pixels of DEVICE, or nil if unknown." + (let ((ds (device-system-metrics device 'size-device))) + (and ds (car ds)))) + +(defun device-pixel-height (&optional device) + "Return the height in pixels of DEVICE, or nil if unknown." + (let ((ds (device-system-metrics device 'size-device))) + (and ds (cdr ds)))) + +(defun device-mm-width (&optional device) + "Return the width in millimeters of DEVICE, or nil if unknown." + (let ((ds (device-system-metrics device 'size-device-mm))) + (and ds (car ds)))) + +(defun device-mm-height (&optional device) + "Return the height in millimeters of DEVICE, or nil if unknown." + (let ((ds (device-system-metrics device 'size-device-mm))) + (and ds (cdr ds)))) + +(defun device-bitplanes (&optional device) + "Return the number of bitplanes of DEVICE, or nil if unknown." + (device-system-metrics device 'num-bit-planes)) + +(defun device-color-cells (&optional device) + "Return the number of color cells of DEVICE, or nil if unknown." + (device-system-metrics device 'num-color-cells)) + (defun make-x-device (&optional display) "Create a new device connected to DISPLAY." (make-device 'x display)) diff -r 090b52736db2 -r c42ec1d1cded lisp/dragdrop.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/dragdrop.el Mon Aug 13 10:33:18 2007 +0200 @@ -0,0 +1,213 @@ +;;; dragdrop.el --- window system-independent Drag'n'Drop support. + +;; Copyright (C) 1998 Oliver Graf + +;; Maintainer: XEmacs Development Team, Oliver Graf +;; Keywords: drag, drop, dumped + +;; 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, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Synched up with: Not in FSF. + +;;; Commentary: + +;; This file is dumped with XEmacs (when window system support is compiled in). + +;;; Code: + +(provide 'dragdrop) + +;; we need mouse-set-point +(require 'mouse) + +;; I think this is a better name for the custom group +;; looks better in the menu and the group display as dragdrop +(defgroup drag-n-drop nil + "Window system-independent drag'n'drop support." + :group 'editing) + +(defcustom dragdrop-drop-at-point nil + "*If non-nil, the drop handler functions will drop text at the cursor location. +Otherwise, the cursor will be moved to the location of the pointer drop before +text is inserted." + :type 'boolean + :group 'drag-n-drop) + +(defcustom dragdrop-autoload-tm-view nil + "*If non-nil, autoload tm-view if a MIME buffer needs to be decoded. +Otherwise, the buffer is only decoded if tm-view is already avaiable." + :type 'boolean + :group 'drag-n-drop) + +(defcustom dragdrop-drop-functions '(dragdrop-drop-url-default + dragdrop-drop-mime-default) + "This is the standart drop function search list. +Each variable in this list is called with the drop data until +one of the functions return t, or the end of the list is reached." + :group 'drag-n-drop + :type '(repeat (choice (function-item dragdrop-drop-url-default) + (function-item dragdrop-drop-mime-default) + (function :tag "other")))) + +(defun dragdrop-drop-dispatch (object) + "This function identifies DROP type misc-user-events. +It tries to find out how to handle the dropped data by looking +for dragdrop-drop-functions in extents and variables." + (catch 'dragdrop-drop-is-done + (and (event-over-text-area-p current-mouse-event) + ;; let's search the extents + (catch 'dragdrop-extents-done + (let ((window (event-window current-mouse-event)) + (pos (event-point current-mouse-event)) + (cpos (event-closest-point current-mouse-event)) + (buffer nil)) + (or window (throw 'dragdrop-extents-done nil)) + (or pos (setq pos cpos)) + (select-window window) + (setq buffer (window-buffer)) + (let ((ext (extent-at pos buffer 'dragdrop-drop-functions))) + (while (not (eq ext nil)) + (dragdrop-drop-do-functions + (extent-property ext 'dragdrop-drop-functions) + object) + (setq ext (extent-at pos buffer 'dragdrop-drop-functions ext))))))) + ;; now look into the variable dragdrop-drop-functions + (dragdrop-drop-do-functions dragdrop-drop-functions object))) + +(defun dragdrop-drop-do-functions (drop-funs object) + "Calls all functions in drop-funs with object until one returns t. +Returns t if one of drop-funs returns t. Otherwise returns nil." + (while (not (eq drop-funs ())) + (and (funcall (car drop-funs) object) + (throw 'dragdrop-drop-is-done t)) + (setq drop-funs (cdr drop-funs))) + nil) + +(defun dragdrop-drop-url-default (object) + "Default handler for dropped URL data. +Finds files and URLs. Returns nil if object does not contain URL data." + (cond ((eq (car object) 'dragdrop-URL) + (let ((data (cdr object)) + (frame (event-channel current-mouse-event)) + (x pop-up-windows)) + (setq pop-up-windows nil) + (while (not (eq data ())) + (cond ((dragdrop-is-some-url "file" (car data)) + ;; if it is some file, pop it to a buffer + (pop-to-buffer (find-file-noselect + (substring (car data) 5)) + nil frame)) + ;; to-do: open ftp URLs with efs... + (t + ;; some other URL, try to fire up some browser for it + (if (boundp 'browse-url-browser-function) + (funcall browse-url-browser-function (car data)) + (display-message 'error + "Can't show URL, no browser selected")))) + (undo-boundary) + (setq data (cdr data))) + (make-frame-visible frame) + (setq pop-up-windows x) + t)) + (t nil))) + +(defun dragdrop-drop-mime-default (object) + "Default handler for dropped MIME data. +Inserts text into buffer, creates MIME buffers for other types. +Returns nil if object does not contain MIME data." + (cond ((eq (car object) 'dragdrop-MIME) + (let ((ldata (cdr object)) + (frame (event-channel current-mouse-event)) + (x pop-up-windows) + (data nil)) + ;; how should this be handled??? + ;; insert drops of text/* into buffer + ;; create new buffer if pointer is outside buffer... + ;; but there are many other ways... + ;; + ;; first thing: check if it's only text/plain and if the + ;; drop happened inside some buffer. if yes insert it into + ;; this buffer (hope it is not encoded in some MIME way) + ;; + ;; Remember: ("text/plain" "dosnotmatter" "somedata") + ;; drops are inserted at mouse-point, if inside a buffer + (while (not (eq ldata ())) + (setq data (car ldata)) + (if (and (listp data) + (= (length data) 3) + (string= (car data) "text/plain") + (event-over-text-area-p current-mouse-event)) + (let ((window (event-window current-mouse-event))) + (and window + (select-window window)) + (and (not dragdrop-drop-at-point) + (mouse-set-point current-mouse-event)) + (insert (caddr data))) + (let ((buf (get-buffer-create "*MIME-Drop data*"))) + (set-buffer buf) + (pop-to-buffer buf nil frame) + (or (featurep 'tm-view) + (and dragdrop-autoload-tm-view + (require 'tm-view))) + (cond ((stringp data) + ;; this is some raw MIME stuff + ;; create some buffer and let tm do the job + ;; + ;; this is always the same buffer!!! + ;; change? + (erase-buffer) + (insert data) + (and (featurep 'tm-view) + (mime/viewer-mode buf))) + ((and (listp data) + (= (length data) 3)) + ;; change the internal content-type representation to the + ;; way tm does it ("content/type" (key . value)*) + ;; but for now list will do the job + ;; + ;; this is always the same buffer!!! + ;; change? + (erase-buffer) + (insert (caddr data)) + (and (featurep 'tm-view) + ;; this list of (car data) should be done before + ;; enqueing the event + (mime/viewer-mode buf (list (car data)) (cadr data)))) + (t + (display-message 'error "Wrong drop data"))))) + (undo-boundary) + (setq ldata (cdr ldata))) + (make-frame-visible frame) + (setq pop-up-windows x)) + t) + (t nil))) + +(defun dragdrop-is-some-url (method url) + "Returns true if method equals the start of url. +If method does not end into ':' this is appended before the +compare." + (cond ((and (stringp url) + (stringp method) + (> (length url) (length method))) + ;; is this ?: check efficient enough? + (if (not (string= (substring method -1) ":")) + (setq method (concat method ":"))) + (string= method (substring url 0 (length method)))) + (t nil))) + +;;; dragdrop.el ends here diff -r 090b52736db2 -r c42ec1d1cded lisp/dumped-lisp.el --- a/lisp/dumped-lisp.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/dumped-lisp.el Mon Aug 13 10:33:18 2007 +0200 @@ -1,7 +1,7 @@ (setq preloaded-file-list '("backquote" ; needed for defsubst etc. "bytecomp-runtime" ; define defsubst - #-infodock "Installation.el" + "Installation.el" "find-paths" "packages" ; Bootstrap run-time lisp environment "setup-paths" @@ -58,7 +58,7 @@ ;; (pureload "hyper-apropos") Soon... #-file-coding "files-nomule" "files" - #-infodock "lib-complete" ; InfoDock uses an older version + "lib-complete" "format" "indent" "isearch-mode" @@ -159,9 +159,10 @@ #+window-system "gui" #+window-system "mode-motion" #+window-system "mouse" + #+window-system "dragdrop" #+window-system "select" ;; preload the X code, for faster startup. - #+(and (not infodock) (or x mswindows) menubar) "x-menubar" + #+(and (not infodock) (or x mswindows) menubar) "menubar-items" #+(and infodock (or x mswindows) menubar) "id-menus" #+x "x-faces" #+x "x-iso8859-1" @@ -170,7 +171,7 @@ #+(and x scrollbar) "x-scrollbar" #+x "x-misc" #+x "x-init" - #+(and (not infodock) window-system toolbar) "x-toolbar" + #+(and (not infodock) window-system toolbar) "toolbar-items" #+x "x-win-xfree86" #+x "x-win-sun" ;; preload the mswindows code. diff -r 090b52736db2 -r c42ec1d1cded lisp/files.el --- a/lisp/files.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/files.el Mon Aug 13 10:33:18 2007 +0200 @@ -1086,13 +1086,18 @@ (setq buffer-read-only nil) ;; XEmacs (or (file-exists-p (file-name-directory buffer-file-name)) - (if (yes-or-no-p - (format - "The directory containing %s does not exist. Create? " - (abbreviate-file-name buffer-file-name))) - (make-directory (file-name-directory - buffer-file-name) - t))) + (condition-case nil + (if (yes-or-no-p + (format + "\ +The directory containing %s does not exist. Create? " + (abbreviate-file-name buffer-file-name))) + (make-directory (file-name-directory + buffer-file-name) + t)) + (quit + (kill-buffer (current-buffer)) + (error "Canceled")))) nil)))) (if msg (progn diff -r 090b52736db2 -r c42ec1d1cded lisp/font.el --- a/lisp/font.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/font.el Mon Aug 13 10:33:18 2007 +0200 @@ -809,7 +809,7 @@ (defun mswindows-font-create-object (fontname &optional device) (let ((case-fold-search t) - (font (mswindows-font-canicolize-name fontname))) + (font (mswindows-font-canonicalize-name fontname))) (if (or (not (stringp font)) (not (string-match font-mswindows-font-regexp font))) (make-font) diff -r 090b52736db2 -r c42ec1d1cded lisp/frame.el --- a/lisp/frame.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/frame.el Mon Aug 13 10:33:18 2007 +0200 @@ -826,25 +826,6 @@ (or deselect-frame-hook (add-hook 'deselect-frame-hook 'default-deselect-frame-hook)) -(defun default-drag-and-drop-functions (frame filepath &optional data) - "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." - ;; changed this back -- hope it works for CDE ;-) Oliver Graf - ;; the OffiX drop stuff has moved to mouse.el (mouse-offix-drop) - (if data - (insert data) - (let ((x pop-up-windows)) - (setq pop-up-windows nil) - (pop-to-buffer (find-file-noselect filepath) nil frame) - (make-frame-visible frame) - (setq pop-up-windows x)))) - -(and (boundp 'drag-and-drop-functions) - (or drag-and-drop-functions - (add-hook 'drag-and-drop-functions 'default-drag-and-drop-functions))) - (defun cde-start-drag (begin end) "Implement the CDE drag operation. Calls the internal function cde-start-drag-internal to do the actual work." diff -r 090b52736db2 -r c42ec1d1cded lisp/gui.el --- a/lisp/gui.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/gui.el Mon Aug 13 10:33:18 2007 +0200 @@ -88,8 +88,10 @@ (if (not (face-differs-from-default-p 'gui-button-face)) (progn (set-face-reverse-p 'gui-button-face t) - (set-face-background 'gui-button-face "grey75" nil '(x color)) - (set-face-foreground 'gui-button-face "black" nil '(x color)))) + (set-face-background 'gui-button-face '(((x color) . "grey75") + ((mswindows color) . "grey75"))) + (set-face-foreground 'gui-button-face '(((x color) . "black") + ((mswindows color) . "black"))))) (defun make-gui-button (string &optional action user-data) "Make a GUI button whose label is STRING and whose action is ACTION. diff -r 090b52736db2 -r c42ec1d1cded lisp/help.el --- a/lisp/help.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/help.el Mon Aug 13 10:33:18 2007 +0200 @@ -83,18 +83,6 @@ (define-key help-map "F" 'xemacs-local-faq) -;;; Setup so Hyperbole can be autoloaded from a key. -;;; Choose a key on which to place the Hyperbole menus. -;;; For most people this key binding will work and will be equivalent -;;; to {C-h h}. -;;; -(when (featurep 'infodock) ; This isn't used in XEmacs - ;; #### This needs fixing for InfoDock 4.0. - (or (where-is-internal 'hyperbole) - (where-is-internal 'hui:menu) - (define-key help-map "h" 'hyperbole)) - (autoload 'hyperbole "hsite" "Hyperbole info manager menus." t)) - (define-key help-map "i" 'info) (define-key help-map '(control i) 'Info-query) ;; FSFmacs has Info-goto-emacs-command-node on C-f, no binding @@ -996,10 +984,16 @@ ((eq (car-safe fndef) 'lambda) (nth 1 fndef)) ((subrp fndef) - (let ((doc (documentation function))) - (if (string-match "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'" - doc) - (substring doc (match-beginning 1) (match-end 1))))) + (let* ((doc (documentation function)) + (args (and (string-match + "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'" + doc) + (match-string 1 doc)))) + ;; If there are no arguments documented for the + ;; subr, rather don't print anything. + (cond ((null args) t) + ((equal args "") nil) + (args)))) (t t)))) (cond ((listp arglist) (prin1-to-string diff -r 090b52736db2 -r c42ec1d1cded lisp/ldap.el --- a/lisp/ldap.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/ldap.el Mon Aug 13 10:33:18 2007 +0200 @@ -5,7 +5,7 @@ ;; Author: Oscar Figueiredo ;; Maintainer: Oscar Figueiredo ;; Created: Jan 1998 -;; Version: $Revision: 1.4 $ +;; Version: $Revision: 1.5 $ ;; Keywords: help comm ;; This file is part of XEmacs @@ -41,28 +41,21 @@ (defvar ldap-default-host nil "*Default LDAP server.") -(defvar ldap-host-parameters-alist nil - "*An alist describing per host options to use for LDAP transactions -The list has the form ((HOST OPTION OPTION ...) (HOST OPTION OPTION ...)) -HOST is the name of an LDAP server. OPTIONs are cons cells describing -parameters for the server. Valid options are: - (binddn . BINDDN) - (passwd . PASSWD) - (auth . AUTH) - (base . BASE) - (scope . SCOPE) - (deref . DEREF) - (timelimit . TL) - (sizelimit . SL)) -BINDDN is the distinguished name of the user to bind as (in RFC 1779 syntax). -PASSWD is the password to use for simple authentication. -AUTH is the authentication method to use, possible values are: -`simple', `krbv41' and `krbv42'. -BASE is the base for the search as described in RFC 1779. -SCOPE is one of the three symbols `subtree', `base' or `onelevel'. -DEREF is one of the symbols `never', `always', `search' or `find'. -TL is the timeout limit for the connection in seconds. -SL is the maximum number of matches to return." ) +(defvar ldap-host-parameters-plist nil + "*A property list of per host options for LDAP transactions +The list elements look like (HOST PROP1 VAL1 PROP2 VAL2 ...) +HOST is the name of an LDAP server. PROPn and VALn are property/value pairs +describing parameters for the server. Valid properties: + `binddn' is the distinguished name of the user to bind as + (in RFC 1779 syntax). + `passwd' is the password to use for simple authentication. + `auth' is the authentication method to use. + Possible values are: `simple', `krbv41' and `krbv42'. + `base' is the base for the search as described in RFC 1779. + `scope' is one of the three symbols `subtree', `base' or `onelevel'. + `deref' is one of the symbols `never', `always', `search' or `find'. + `timelimit' is the timeout limit for the connection in seconds. + `sizelimit' is the maximum number of matches to return." ) (defun ldap-search (filter &optional host attributes attrsonly) @@ -74,21 +67,21 @@ ATTRSONLY if non nil retrieves the attributes only without the associated values. Additional search parameters can be specified through -`ldap-host-parameters-alist' which see." +`ldap-host-parameters-plist' which see." (interactive "sFilter:") - (let (host-alist res ldap) + (let (host-plist res ldap) (if (null host) (setq host ldap-default-host)) (if (null host) (error "No LDAP host specified")) - (setq host-alist - (assoc host ldap-host-parameters-alist)) + (setq host-plist + (cdr (assoc host ldap-host-parameters-plist))) (message "Opening LDAP connection to %s..." host) - (setq ldap (ldap-open host (alist-to-plist (cdr host-alist)))) + (setq ldap (ldap-open host host-plist)) (message "Searching with LDAP on %s..." host) (setq res (ldap-search-internal ldap filter - (cdr (assq 'base host-alist)) - (cdr (assq 'scope host-alist)) + (plist-get host-plist 'base) + (plist-get host-plist 'scope) attributes attrsonly)) (ldap-close ldap) res)) diff -r 090b52736db2 -r c42ec1d1cded lisp/lib-complete.el --- a/lisp/lib-complete.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/lib-complete.el Mon Aug 13 10:33:18 2007 +0200 @@ -38,7 +38,7 @@ ;; Last Modified By: Heiko M|nkel ;; Additional XEmacs integration By: Chuck Thompson ;; Last Modified On: Thu Jul 1 14:23:00 1994 -;; RCS Info : $Revision: 1.2 $ $Locker: $ +;; RCS Info : $Revision: 1.3 $ $Locker: $ ;; ======================================================================== ;; NOTE: XEmacs must be redumped if this file is changed. ;; @@ -123,10 +123,8 @@ (message "%s" (, MESSAGE)) (progn (,@ FORMS)) (message ""))))) -#+infodock (defalias 'lib-funcall-with-msg 'progn-with-message) (put 'progn-with-message 'lisp-indent-hook 1) -#+infodock (put 'lib-funcall-with-message 'lisp-indent-hook 1) ;;=== Completion caching ================================================== @@ -140,7 +138,6 @@ where each has the form ( )") -#+infodock (defvaralias 'lib-completions 'lib-complete:cache) (defun lib-complete:better-root (ROOT1 ROOT2) "Return non-nil if ROOT1 is a superset of ROOT2." @@ -320,7 +317,6 @@ (if current-prefix-arg (read-coding-system "Coding System: ")))) (find-file-other-window library codesys)) -#+infodock (defalias 'lib-edit-other-window 'find-library-other-window) (defun find-library-other-frame (library &optional codesys) "Load the library named LIBRARY in a newly-created frame. @@ -338,9 +334,6 @@ (define-key global-map "\C-x4l" 'find-library-other-window) (define-key global-map "\C-x5l" 'find-library-other-frame) -#+infodock (defalias 'lib-where-is 'locate-library) - -#+infodock (provide 'lib) (provide 'lib-complete) ;;; lib-complete.el ends here diff -r 090b52736db2 -r c42ec1d1cded lisp/menubar-items.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/menubar-items.el Mon Aug 13 10:33:18 2007 +0200 @@ -0,0 +1,1490 @@ +;;; menubar-items.el --- Menubar and popup-menu content for XEmacs. + +;; Copyright (C) 1991-1995, 1997-1998 Free Software Foundation, Inc. +;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. +;; Copyright (C) 1995 Sun Microsystems. +;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1997 MORIOKA Tomohiko + +;; Maintainer: XEmacs Development Team +;; Keywords: frames, extensions, internal, dumped + +;; 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 Xmacs; see the file COPYING. If not, write to the +;; Free Software Foundation, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This file is dumped with XEmacs (when window system and menubar support is +;; compiled in). + +;;; Code: + +;;; Warning-free compile +(eval-when-compile + (defvar language-environment-list) + (defvar bookmark-alist) + (defvar language-info-alist) + (defvar current-language-environment) + (defvar tutorial-supported-languages)) + +(defconst default-menubar + (purecopy-menubar + ;; note backquote. + `( + ("File" + ["Open..." find-file] + ["Open in Other Window..." find-file-other-window] + ["Open in New Frame..." find-file-other-frame] + ["Insert File..." insert-file] + ["View File..." view-file] + "------" + ["Save" save-buffer + :active (buffer-modified-p) + :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + ["Save As..." write-file] + ["Save Some Buffers" save-some-buffers] + "-----" + ["Print Buffer" lpr-buffer + :active (fboundp 'lpr-buffer) + :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + ["Pretty-Print Buffer" ps-print-buffer-with-faces + :active (fboundp 'ps-print-buffer-with-faces) + :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + "-----" + ["New Frame" make-frame] + ["Frame on Other Display..." make-frame-on-display] + ["Delete Frame" delete-frame + :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) + (selected-frame)))] + "-----" + ["Split Window" split-window-vertically] + ["Un-Split (Keep This)" delete-other-windows + :active (not (one-window-p t))] + ["Un-Split (Keep Others)" delete-window + :active (not (one-window-p t))] + "-----" + ["Revert Buffer" revert-buffer + :active (or buffer-file-name revert-buffer-function) + :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + ["Delete Buffer" kill-this-buffer + :active t + :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + "-----" + ["Exit XEmacs" save-buffers-kill-emacs] + ) + + ("Edit" + ["Undo" advertised-undo + :active (and (not (eq buffer-undo-list t)) + (or buffer-undo-list pending-undo-list)) + :suffix (if (or (eq last-command 'undo) + (eq last-command 'advertised-undo)) + "More" "")] + ["Redo" redo + :included (fboundp 'redo) + :active (not (or (eq buffer-undo-list t) + (eq last-buffer-undo-list nil) + (not (or (eq last-buffer-undo-list buffer-undo-list) + (and (null (car-safe buffer-undo-list)) + (eq last-buffer-undo-list + (cdr-safe buffer-undo-list))))) + (or (eq buffer-undo-list pending-undo-list) + (eq (cdr buffer-undo-list) pending-undo-list)))) + :suffix (if (eq last-command 'redo) "More" "")] + ["Cut" kill-primary-selection + :active (selection-owner-p)] + ["Copy" copy-primary-selection + :active (selection-owner-p)] + ["Paste" yank-clipboard-selection + :active (selection-exists-p 'CLIPBOARD)] + ["Clear" delete-primary-selection + :active (selection-owner-p)] + "----" + ["Search..." isearch-forward] + ["Search Backward..." isearch-backward] + ["Replace..." query-replace] + "----" + ["Search (Regexp)..." isearch-forward-regexp] + ["Search Backward (Regexp)..." isearch-backward-regexp] + ["Replace (Regexp)..." query-replace-regexp] + "----" + ["Goto Line..." goto-line] + ["What Line" what-line] + ("Bookmarks" + :filter bookmark-menu-filter) + "----" + ["Start Macro Recording" start-kbd-macro + :active (not defining-kbd-macro)] + ["End Macro Recording" end-kbd-macro + :active defining-kbd-macro] + ["Execute Last Macro" call-last-kbd-macro + :active last-kbd-macro] + "----" + ["Show Message Log" show-message-log] + ) + + ,@(if (featurep 'mule) + '(("Mule" + ("Describe language support") + ("Set language environment") + "--" + ["Toggle input method" toggle-input-method] + ["Select input method" select-input-method] + ["Describe input method" describe-input-method] + "--" + ["Describe current coding systems" + describe-current-coding-system] + ["Set coding system of buffer file" + set-buffer-file-coding-system] + ;; not implemented yet + ["Set coding system of terminal" + set-terminal-coding-system :active nil] + ;; not implemented yet + ["Set coding system of keyboard" + set-keyboard-coding-system :active nil] + ;; not implemented yet + ["Set coding system of process" + set-current-process-coding-system :active nil] + "--" + ["Show character table" view-charset-by-menu] + ;; 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)] + ["Read Mail (MH)..." (mh-rmail t) + :active (fboundp 'mh-rmail)] + ["Send mail..." compose-mail + :active (fboundp 'compose-mail)] + ["Usenet News" gnus + :active (fboundp 'gnus)] + ["Browse the Web" w3 + :active (fboundp 'w3)] + ["Gopher" gopher + :active (fboundp 'gopher)] + "----" + ["Spell-Check Buffer" ispell-buffer + :active (fboundp 'ispell-buffer)] + ["Toggle VI emulation" toggle-viper-mode + :active (fboundp 'toggle-viper-mode)] + "----" + ("Calendar" + ["3-Month Calendar" calendar + :active (fboundp 'calendar)] + ["Diary" diary + :active (fboundp 'diary)] + ["Holidays" holidays + :active (fboundp 'holidays)] + ;; we're all pagans at heart ... + ["Phases of the Moon" phases-of-moon + :active (fboundp 'phases-of-moon)] + ["Sunrise/Sunset" sunrise-sunset + :active (fboundp 'sunrise-sunset)]) + + ("Games" + ["Mine Game" xmine + :active (fboundp 'xmine)] + ["Tetris" tetris + :active (fboundp 'tetris)] + ["Sokoban" sokoban + :active (fboundp 'sokoban)] + ["Quote from Zippy" yow + :active (fboundp 'yow)] + ["Psychoanalyst" doctor + :active (fboundp 'doctor)] + ["Psychoanalyze Zippy!" psychoanalyze-pinhead + :active (fboundp 'psychoanalyze-pinhead)] + ["Random Flames" flame + :active (fboundp 'flame)] + ["Dunnet (Adventure)" dunnet + :active (fboundp 'dunnet)] + ["Towers of Hanoi" hanoi + :active (fboundp 'hanoi)] + ["Game of Life" life + :active (fboundp 'life)] + ["Multiplication Puzzle" mpuz + :active (fboundp 'mpuz)])) + + ("Options" + ("Customize" + ("Emacs" :filter (lambda (&rest junk) + (cdr (custom-menu-create 'emacs)))) + ["Group..." customize-group] + ["Variable..." customize-variable] + ["Face..." customize-face] + ["Saved..." customize-saved] + ["Set..." customize-customized] + ["Apropos..." customize-apropos] + ["Browse..." customize-browse]) + ("Editing Options" + ["Overstrike" + (progn + (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual)) + (customize-set-variable 'overwrite-mode overwrite-mode)) + :style toggle :selected overwrite-mode] + ["Case Sensitive Search" + (customize-set-variable 'case-fold-search + (setq case-fold-search (not case-fold-search))) + :style toggle :selected (not case-fold-search)] + ["Case Matching Replace" + (customize-set-variable 'case-replace (not case-replace)) + :style toggle :selected case-replace] + ["Auto Delete Selection" + (customize-set-variable 'pending-delete-mode (not pending-delete-mode)) + :style toggle + :selected (and (boundp 'pending-delete-mode) pending-delete-mode) + :active (boundp 'pending-delete-mode)] + ["Active Regions" + (customize-set-variable 'zmacs-regions (not zmacs-regions)) + :style toggle :selected zmacs-regions] + ["Mouse Paste At Text Cursor" + (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point)) + :style toggle :selected mouse-yank-at-point] + ("Newline at end of file..." + ["Don't require" + (customize-set-variable 'require-final-newline nil) + :style radio :selected (not require-final-newline)] + ["Require" + (customize-set-variable 'require-final-newline t) + :style radio :selected (eq require-final-newline t)] + ["Ask" + (customize-set-variable 'require-final-newline 'ask) + :style radio :selected (and require-final-newline + (not (eq require-final-newline t)))]) + ["Add Newline When Moving Past End" + (customize-set-variable 'next-line-add-newlines + (not next-line-add-newlines)) + :style toggle :selected next-line-add-newlines] + ) + ("General Options" + ["Teach Extended Commands" + (customize-set-variable 'teach-extended-commands-p + (not teach-extended-commands-p)) + :style toggle :selected teach-extended-commands-p] + ["Debug On Error" + (customize-set-variable 'debug-on-error (not debug-on-error)) + :style toggle :selected debug-on-error] + ["Debug On Quit" + (customize-set-variable 'debug-on-quit (not debug-on-quit)) + :style toggle :selected debug-on-quit] + ) + ("Printing Options" + ["Command-Line Switches for `lpr'/`lp'..." + ;; better to directly open a customization buffer, since the value + ;; must be a list of strings, which is somewhat complex to prompt for. + (customize-variable 'lpr-switches) + (boundp 'lpr-switches)] + ("Pretty-Print Paper Size" + ["Letter" + (customize-set-variable 'ps-paper-type 'letter) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter)) + :active (boundp 'ps-paper-type)] + ["Letter-small" + (customize-set-variable 'ps-paper-type 'letter-small) + :style radio + :selected (and (boundp 'ps-paper-type) + (eq ps-paper-type 'letter-small)) + :active (boundp 'ps-paper-type)] + ["Legal" + (customize-set-variable 'ps-paper-type 'legal) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal)) + :active (boundp 'ps-paper-type)] + ["Statement" + (customize-set-variable 'ps-paper-type 'statement) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'statement)) + :active (boundp 'ps-paper-type)] + ["Executive" + (customize-set-variable 'ps-paper-type 'executive) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'executive)) + :active (boundp 'ps-paper-type)] + ["Tabloid" + (customize-set-variable 'ps-paper-type 'tabloid) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'tabloid)) + :active (boundp 'ps-paper-type)] + ["Ledger" + (customize-set-variable 'ps-paper-type 'ledger) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger)) + :active (boundp 'ps-paper-type)] + ["A3" + (customize-set-variable 'ps-paper-type 'a3) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3)) + :active (boundp 'ps-paper-type)] + ["A4" + (customize-set-variable 'ps-paper-type 'a4) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4)) + :active (boundp 'ps-paper-type)] + ["A4small" + (customize-set-variable 'ps-paper-type 'a4small) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small)) + :active (boundp 'ps-paper-type)] + ["B4" + (customize-set-variable 'ps-paper-type 'b4) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4)) + :active (boundp 'ps-paper-type)] + ["B5" + (customize-set-variable 'ps-paper-type 'b5) + :style radio + :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b5)) + :active (boundp 'ps-paper-type)] + ) + ["Color Printing" + (cond (ps-print-color-p + (customize-set-variable 'ps-print-color-p nil) + ;; I'm wondering whether all this muck is usefull. + (and (boundp 'original-face-background) + original-face-background + (set-face-background 'default original-face-background))) + (t + (customize-set-variable 'ps-print-color-p t) + (setq original-face-background + (face-background-instance 'default)) + (set-face-background 'default "white"))) + :style toggle + :selected (and (boundp 'ps-print-color-p) ps-print-color-p) + :active (boundp 'ps-print-color-p)]) + ("\"Other Window\" Location" + ["Always in Same Frame" + (customize-set-variable + 'get-frame-for-buffer-default-instance-limit nil) + :style radio + :selected (null get-frame-for-buffer-default-instance-limit)] + ["Other Frame (2 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 2) + :style radio + :selected (eq 2 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (3 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 3) + :style radio + :selected (eq 3 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (4 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 4) + :style radio + :selected (eq 4 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (5 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 5) + :style radio + :selected (eq 5 get-frame-for-buffer-default-instance-limit)] + ["Always Create New Frame" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 0) + :style radio + :selected (eq 0 get-frame-for-buffer-default-instance-limit)] + "-----" + ["Temp Buffers Always in Same Frame" + (customize-set-variable 'temp-buffer-show-function + 'show-temp-buffer-in-current-frame) + :style radio + :selected (eq temp-buffer-show-function + 'show-temp-buffer-in-current-frame)] + ["Temp Buffers Like Other Buffers" + (customize-set-variable 'temp-buffer-show-function nil) + :style radio + :selected (null temp-buffer-show-function)] + "-----" + ["Make current frame gnuserv target" + (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil t)) + :style toggle + :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t)) + :active (boundp 'gnuserv-frame)] + ) + "-----" + ("Syntax Highlighting" + ["In This Buffer" + (progn ;; becomes buffer local + (font-lock-mode) + (customize-set-variable 'font-lock-mode font-lock-mode)) + :style toggle + :selected (and (boundp 'font-lock-mode) font-lock-mode) + :active (boundp 'font-lock-mode)] + ["Automatic" + (customize-set-variable 'font-lock-auto-fontify + (not font-lock-auto-fontify)) + :style toggle + :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify) + :active (fboundp 'font-lock-mode)] + "-----" + ["Fonts" + (progn + (require 'font-lock) + (font-lock-use-default-fonts) + (customize-set-variable 'font-lock-use-fonts t) + (customize-set-variable 'font-lock-use-colors nil) + (font-lock-mode 1)) + :style radio + :selected (and (boundp 'font-lock-use-fonts) font-lock-use-fonts) + :active (fboundp 'font-lock-mode)] + ["Colors" + (progn + (require 'font-lock) + (font-lock-use-default-colors) + (customize-set-variable 'font-lock-use-colors t) + (customize-set-variable 'font-lock-use-fonts nil) + (font-lock-mode 1)) + :style radio + :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors) + :active (boundp 'font-lock-mode)] + "-----" + ["Least" + (progn + (require 'font-lock) + (if (or (and (not (integerp font-lock-maximum-decoration)) + (not (eq t font-lock-maximum-decoration))) + (and (integerp font-lock-maximum-decoration) + (<= font-lock-maximum-decoration 0))) + nil + (customize-set-variable 'font-lock-maximum-decoration nil) + (font-lock-recompute-variables))) + :style radio + :active (fboundp 'font-lock-mode) + :selected (and (boundp 'font-lock-maximium-decoration) + (or (and (not (integerp font-lock-maximum-decoration)) + (not (eq t font-lock-maximum-decoration))) + (and (integerp font-lock-maximum-decoration) + (<= font-lock-maximum-decoration 0))))] + ["More" + (progn + (require 'font-lock) + (if (and (integerp font-lock-maximum-decoration) + (= 1 font-lock-maximum-decoration)) + nil + (customize-set-variable 'font-lock-maximum-decoration 1) + (font-lock-recompute-variables))) + :style radio + :active (fboundp 'font-lock-mode) + :selected (and (boundp 'font-lock-maximium-decoration) + (integerp font-lock-maximum-decoration) + (= 1 font-lock-maximum-decoration))] + ["Even More" + (progn + (require 'font-lock) + (if (and (integerp font-lock-maximum-decoration) + (= 2 font-lock-maximum-decoration)) + nil + (customize-set-variable 'font-lock-maximum-decoration 2) + (font-lock-recompute-variables))) + :style radio + :active (fboundp 'font-lock-mode) + :selected (and (boundp 'font-lock-maximum-decoration) + (integerp font-lock-maximum-decoration) + (= 2 font-lock-maximum-decoration))] + ["Most" + (progn + (require 'font-lock) + (if (or (eq font-lock-maximum-decoration t) + (and (integerp font-lock-maximum-decoration) + (>= font-lock-maximum-decoration 3))) + nil + (customize-set-variable 'font-lock-maximum-decoration t) + (font-lock-recompute-variables))) + :style radio + :active (fboundp 'font-lock-mode) + :selected (and (boundp 'font-lock-maximum-decoration) + (or (eq font-lock-maximum-decoration t) + (and (integerp font-lock-maximum-decoration) + (>= font-lock-maximum-decoration 3))))] + "-----" + ["Lazy" + (progn ;; becomes buffer local + (lazy-shot-mode) + (customize-set-variable 'lazy-shot-mode lazy-shot-mode) + ;; this shouldn't be necessary so there has to + ;; be a redisplay bug lurking somewhere (or + ;; possibly another event handler bug) + (redraw-modeline)) + :active (and (boundp 'font-lock-mode) (boundp 'lazy-shot-mode) + font-lock-mode) + :style toggle + :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)] + ["Caching" + (progn ;; becomes buffer local + (fast-lock-mode) + (customize-set-variable 'fast-lock-mode fast-lock-mode) + ;; this shouldn't be necessary so there has to + ;; be a redisplay bug lurking somewhere (or + ;; possibly another event handler bug) + (redraw-modeline)) + :active (and (boundp 'font-lock-mode) (boundp 'fast-lock-mode) + font-lock-mode) + :style toggle + :selected (and (boundp 'fast-lock-mode) fast-lock-mode)] + ) + ("Paren Highlighting" + ["None" + (customize-set-variable 'paren-mode nil) + :style radio + :selected (and (boundp 'paren-mode) (not paren-mode)) + :active (boundp 'paren-mode)] + ["Blinking Paren" + (customize-set-variable 'paren-mode 'blink-paren) + :style radio + :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren)) + :active (boundp 'paren-mode)] + ["Steady Paren" + (customize-set-variable 'paren-mode 'paren) + :style radio + :selected (and (boundp 'paren-mode) (eq paren-mode 'paren)) + :active (boundp 'paren-mode)] + ["Expression" + (customize-set-variable 'paren-mode 'sexp) + :style radio + :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp)) + :active (boundp 'paren-mode)] +;; ["Nested Shading" +;; (customize-set-variable 'paren-mode 'nested) +;; :style radio +;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested)) +;; :active (boundp 'paren-mode)] + ) + "-----" + ("Frame Appearance" + ["Frame-Local Font Menu" + (customize-set-variable 'font-menu-this-frame-only-p + (not font-menu-this-frame-only-p)) + :style toggle + :selected (and (boundp 'font-menu-this-frame-only-p) + font-menu-this-frame-only-p)] + ,@(if (featurep 'scrollbar) + '(["Scrollbars" + (customize-set-variable 'scrollbars-visible-p + (not scrollbars-visible-p)) + :style toggle + :selected scrollbars-visible-p])) + ;; I don't think this is of any interest. - dverna apr. 98 +;; ["3D Modeline" +;; (progn +;; (if (zerop (specifier-instance modeline-shadow-thickness)) +;; (set-specifier modeline-shadow-thickness 2) +;; (set-specifier modeline-shadow-thickness 0)) +;; (redraw-modeline t)) +;; :style toggle +;; :selected (let ((thickness +;; (specifier-instance modeline-shadow-thickness))) +;; (and (integerp thickness) +;; (> thickness 0)))] + ["Truncate Lines" + (progn ;; becomes buffer-local + (setq truncate-lines (not truncate-lines)) + (customize-set-variable 'truncate-lines truncate-lines)) + :style toggle + :selected truncate-lines] + ["Blinking Cursor" + (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode)) + :style toggle + :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode) + :active (boundp 'blink-cursor-mode)] + "-----" + ["Block cursor" + (progn + (customize-set-variable 'bar-cursor nil) + (force-cursor-redisplay)) + :style radio + :selected (null bar-cursor)] + ["Bar cursor (1 pixel)" + (progn + (customize-set-variable 'bar-cursor t) + (force-cursor-redisplay)) + :style radio + :selected (eq bar-cursor t)] + ["Bar cursor (2 pixels)" + (progn + (customize-set-variable 'bar-cursor 2) + (force-cursor-redisplay)) + :style radio + :selected (and bar-cursor (not (eq bar-cursor t)))] + "------" + ["Line Numbers" + (progn + (customize-set-variable 'line-number-mode (not line-number-mode)) + (redraw-modeline)) + :style toggle :selected line-number-mode] + ["Column Numbers" + (progn + (customize-set-variable 'column-number-mode + (not column-number-mode)) + (redraw-modeline)) + :style toggle :selected column-number-mode] + ) + ("Menubar Appearance" + ["Buffers Menu Length..." + (customize-set-variable + 'buffers-menu-max-size + ;; would it be better to open a customization buffer ? + (let ((val + (read-number + "Enter number of buffers to display (or 0 for unlimited): "))) + (if (eq val 0) nil val)))] + ["Multi-Operation Buffers Sub-Menus" + (customize-set-variable 'complex-buffers-menu-p + (not complex-buffers-menu-p)) + :style toggle + :selected complex-buffers-menu-p] + ("Buffers Menu Sorting" + ["Most Recently Used" + (progn + (customize-set-variable 'buffers-menu-sort-function nil) + (customize-set-variable 'buffers-menu-grouping-function nil)) + :style radio + :selected (null buffers-menu-sort-function)] + ["Alphabetically" + (progn + (customize-set-variable 'buffers-menu-sort-function + 'sort-buffers-menu-alphabetically) + (customize-set-variable 'buffers-menu-grouping-function nil)) + :style radio + :selected (eq 'sort-buffers-menu-alphabetically + buffers-menu-sort-function)] + ["By Major Mode, Then Alphabetically" + (progn + (customize-set-variable + 'buffers-menu-sort-function + 'sort-buffers-menu-by-mode-then-alphabetically) + (customize-set-variable + 'buffers-menu-grouping-function + 'group-buffers-menu-by-mode-then-alphabetically)) + :style radio + :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically + buffers-menu-sort-function)]) + ["Submenus for Buffer Groups" + (customize-set-variable 'buffers-menu-submenus-for-groups-p + (not buffers-menu-submenus-for-groups-p)) + :style toggle + :selected buffers-menu-submenus-for-groups-p] + "---" + ["Ignore Scaled Fonts" + (customize-set-variable 'font-menu-ignore-scaled-fonts + (not font-menu-ignore-scaled-fonts)) + :style toggle + :selected (and (boundp 'font-menu-ignore-scaled-fonts) + font-menu-ignore-scaled-fonts)] + ) + ,@(if (featurep 'toolbar) + '(("Toolbar Appearance" + ["Visible" + (customize-set-variable 'toolbar-visible-p + (not toolbar-visible-p)) + :style toggle + :selected toolbar-visible-p] + ["Captioned" + (customize-set-variable 'toolbar-captioned-p + (not toolbar-captioned-p)) + :style toggle + :selected toolbar-captioned-p] + ("Default Location" + ["Top" + (customize-set-variable 'default-toolbar-position 'top) + :style radio + :selected (eq default-toolbar-position 'top)] + ["Bottom" + (customize-set-variable 'default-toolbar-position 'bottom) + :style radio + :selected (eq default-toolbar-position 'bottom)] + ["Left" + (customize-set-variable 'default-toolbar-position 'left) + :style radio + :selected (eq default-toolbar-position 'left)] + ["Right" + (customize-set-variable 'default-toolbar-position 'right) + :style radio + :selected (eq default-toolbar-position 'right)] + ) + ))) + ("Mouse" + ["Avoid Text..." + (customize-set-variable 'mouse-avoidance-mode + (if mouse-avoidance-mode nil 'banish)) + :style toggle + :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode) + :active (and (boundp 'mouse-avoidance-mode) + window-system (eq (device-type) 'x))] + ["strokes-mode" + (customize-set-variable 'strokes-mode (not strokes-mode)) + :style toggle + :selected (and (boundp 'strokes-mode) strokes-mode) + :active (and (boundp 'strokes-mode) + window-system (eq (device-type) 'x))] + ) + ("Open URLs With" + ["Emacs-W3" + (customize-set-variable 'browse-url-browser-function 'browse-url-w3) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-w3)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-w3) + (fboundp 'w3-fetch))] + ["Netscape" + (customize-set-variable 'browse-url-browser-function + 'browse-url-netscape) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-netscape)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-netscape))] + ["Mosaic" + (customize-set-variable 'browse-url-browser-function + 'browse-url-mosaic) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-mosaic)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-mosaic))] + ["Mosaic (CCI)" + (customize-set-variable 'browse-url-browser-function 'browse-url-cci) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-cci)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-cci))] + ["IXI Mosaic" + (customize-set-variable 'browse-url-browser-function + 'browse-url-iximosaic) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-iximosaic)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-iximosaic))] + ["Lynx (xterm)" + (customize-set-variable 'browse-url-browser-function + 'browse-url-lynx-xterm) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-lynx-xterm)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-lynx-xterm))] + ["Lynx (xemacs)" + (customize-set-variable 'browse-url-browser-function + 'browse-url-lynx-emacs) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-lynx-emacs)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-lynx-emacs))] + ["Grail" + (customize-set-variable 'browse-url-browser-function + 'browse-url-grail) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-grail)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-grail))] + ) + "-----" + ["Browse Faces..." (customize-face nil)] + ("Font" :filter font-menu-family-constructor) + ("Size" :filter font-menu-size-constructor) + ("Weight" :filter font-menu-weight-constructor) + "-----" + ["Save Options" customize-save-customized] + ) + + ("Buffers" + :filter buffers-menu-filter + ["Read Only" (toggle-read-only) + :style toggle :selected buffer-read-only] + ["List All Buffers" list-buffers] + "--" + ) + + ("Tools" + ["Grep..." grep + :active (fboundp 'grep)] + ["Compile..." compile + :active (fboundp 'compile)] + ["Shell" shell + :active (fboundp 'shell)] + ["Shell Command..." shell-command + :active (fboundp 'shell-command)] + ["Shell Command on Region..." shell-command-on-region + :active (and (fboundp 'shell-command-on-region) (region-exists-p))] + ["Debug (GDB)..." gdb + :active (fboundp 'gdb)] + ["Debug (DBX)..." dbx + :active (fboundp 'dbx)] + "-----" + ("Tags" + ["Find Tag..." find-tag] + ["Find Other Window..." find-tag-other-window] + ["Next Tag..." (find-tag nil)] + ["Next Other Window..." (find-tag-other-window nil)] + ["Next File" next-file] + "-----" + ["Tags Search..." tags-search] + ["Tags Replace..." tags-query-replace] + ["Continue Search/Replace" tags-loop-continue] + "-----" + ["Pop stack" pop-tag-mark] + ["Apropos..." tags-apropos] + "-----" + ["Set Tags Table File..." visit-tags-table] + )) + + nil ; the partition: menus after this are flushright + + ("Help" + ["About XEmacs..." about-xemacs] + ("Basics" + ["Installation" describe-installation + :active (boundp 'Installation-string)] + ;; Tutorials. + ,(if (featurep 'mule) + ;; Mule tutorials. + (let ((lang language-info-alist) + submenu tut) + (while lang + (and (setq tut (assq 'tutorial (car lang))) + (not (string= (caar lang) "ASCII")) + (setq + submenu + (cons + `[,(caar lang) (help-with-tutorial nil ,(cdr tut))] + submenu))) + (setq lang (cdr lang))) + (append `("Tutorials" + :filter tutorials-menu-filter + ["Default" help-with-tutorial t + ,(concat "(" current-language-environment ")")]) + submenu)) + ;; Non mule tutorials. + (let ((lang tutorial-supported-languages) + submenu) + (while lang + (setq submenu + (cons + `[,(caar lang) + (help-with-tutorial ,(format "TUTORIAL.%s" + (cadr (car lang))))] + submenu)) + (setq lang (cdr lang))) + (append '("Tutorials" + ["English" help-with-tutorial]) + submenu))) + ["News" view-emacs-news] + ["Packages" finder-by-keyword] + ["Splash" xemacs-splash-buffer]) + "-----" + ("XEmacs FAQ" + ["FAQ (local)" xemacs-local-faq] + ["FAQ via WWW" xemacs-www-faq (boundp 'browse-url-browser-function)] + ["Home Page" xemacs-www-page (boundp 'browse-url-browser-function)]) + ("Samples" + ["Sample .emacs" (find-file (expand-file-name "sample.emacs" + data-directory))] + ["Sample .Xdefaults" (find-file (expand-file-name "sample.Xdefaults" + data-directory))] + ["Sample enriched" (find-file (expand-file-name "enriched.doc" + data-directory))]) + "-----" + ("Lookup in Info" + ["Key Binding..." Info-goto-emacs-key-command-node] + ["Command..." Info-goto-emacs-command-node] + ["Function..." Info-elisp-ref] + ["Topic..." Info-query]) + ("Manuals" + ["Info" info] + ["Unix Manual..." manual-entry]) + ("Commands & Keys" + ["Mode" describe-mode] + ["Apropos..." hyper-apropos] + ["Apropos Docs..." apropos-documentation] + "-----" + ["Key..." describe-key] + ["Bindings" describe-bindings] + ["Mouse Bindings" describe-pointer] + ["Recent Keys" view-lossage] + "-----" + ["Function..." describe-function] + ["Variable..." describe-variable] + ["Locate Command..." where-is]) + "-----" + ["Recent Messages" view-lossage] + ("Misc" + ["No Warranty" describe-no-warranty] + ["XEmacs License" describe-copying] + ["The Latest Version" describe-distribution]) + ["Submit Bug Report" send-pr])))) + + +(defun maybe-add-init-button () + "Don't call this. +Adds `Load .emacs' button to menubar when starting up with -q." + ;; by Stig@hackvan.com + (cond + (init-file-user nil) + ((file-exists-p (cond + ((eq system-type 'ms-dos) + (concat "~" (user-login-name) "/_emacs")) + ((eq system-type 'vax-vms) + "sys$login:.emacs") + (t + (concat "~" (user-login-name) "/.emacs")))) + (add-menu-button nil + ["Load .emacs" + (progn (delete-menu-item '("Load .emacs")) + (load-user-init-file (user-login-name))) + ] + "Help")) + (t nil))) + +(add-hook 'before-init-hook 'maybe-add-init-button) + + +;;; The File menu + +(defvar put-buffer-names-in-file-menu t) + + +;;; The Bookmarks menu + +(defun bookmark-menu-filter (&rest ignore) + (let ((definedp (and (boundp 'bookmark-alist) + bookmark-alist + t))) + `(,(if definedp + '("Jump to Bookmark" + :filter (lambda (&rest junk) + (mapcar #'(lambda (bmk) + `[,bmk (bookmark-jump ',bmk)]) + (bookmark-all-names)))) + ["Jump to Bookmark" nil nil]) + ["Set bookmark" bookmark-set + :active (fboundp 'bookmark-set)] + "---" + ["Insert contents" bookmark-menu-insert + :active (fboundp 'bookmark-menu-insert)] + ["Insert location" bookmark-menu-locate + :active (fboundp 'bookmark-menu-locate)] + "---" + ["Rename bookmark" bookmark-menu-rename + :active (fboundp 'bookmark-menu-rename)] + ,(if definedp + '("Delete Bookmark" + :filter (lambda (&rest junk) + (mapcar #'(lambda (bmk) + `[,bmk (bookmark-delete ',bmk)]) + (bookmark-all-names)))) + ["Delete Bookmark" nil nil]) + ["Edit Bookmark List" bookmark-bmenu-list ,definedp] + "---" + ["Save bookmarks" bookmark-save ,definedp] + ["Save bookmarks as..." bookmark-write ,definedp] + ["Load a bookmark file" bookmark-load + :active (fboundp 'bookmark-load)]))) + +;;; The Buffers menu + +(defgroup buffers-menu nil + "Customization of `Buffers' menu." + :group 'menu) + +(defcustom buffers-menu-max-size 25 + "*Maximum number of entries which may appear on the \"Buffers\" menu. +If this is 10, then only the ten most-recently-selected buffers will be +shown. If this is nil, then all buffers will be shown. Setting this to +a large number or nil will slow down menu responsiveness." + :type '(choice (const :tag "Show all" nil) + (integer 10)) + :group 'buffers-menu) + +(defcustom complex-buffers-menu-p nil + "*If non-nil, the buffers menu will contain several commands. +Commands will be presented as submenus of each buffer line. If this +is false, then there will be only one command: select that buffer." + :type 'boolean + :group 'buffers-menu) + +(defcustom buffers-menu-submenus-for-groups-p nil + "*If non-nil, the buffers menu will contain one submenu per group of buffers. +The grouping function is specified in `buffers-menu-grouping-function'. +If this is an integer, do not build submenus if the number of buffers +is not larger than this value." + :type '(choice (const :tag "No Subgroups" nil) + (integer :tag "Max. submenus" 10) + (sexp :format "%t\n" :tag "Allow Subgroups" :value t)) + :group 'buffers-menu) + +(defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer + "*The function to call to select a buffer from the buffers menu. +`switch-to-buffer' is a good choice, as is `pop-to-buffer'." + :type '(radio (function-item switch-to-buffer) + (function-item pop-to-buffer) + (function :tag "Other")) + :group 'buffers-menu) + +(defcustom buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers + "*If non-nil, a function specifying the buffers to omit from the buffers menu. +This is passed a buffer and should return non-nil if the buffer should be +omitted. The default value `buffers-menu-omit-invisible-buffers' omits +buffers that are normally considered \"invisible\" (those whose name +begins with a space)." + :type '(choice (const :tag "None" nil) + function) + :group 'buffers-menu) + +(defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line + "*The function to call to return a string to represent a buffer in the +buffers menu. The function is passed a buffer and should return a string. +The default value `format-buffers-menu-line' just returns the name of +the buffer. Also check out `slow-format-buffers-menu-line' which +returns a whole bunch of info about a buffer." + :type 'function + :group 'buffers-menu) + +(defcustom buffers-menu-sort-function + 'sort-buffers-menu-by-mode-then-alphabetically + "*If non-nil, a function to sort the list of buffers in the buffers menu. +It will be passed two arguments (two buffers to compare) and should return +T if the first is \"less\" than the second. One possible value is +`sort-buffers-menu-alphabetically'; another is +`sort-buffers-menu-by-mode-then-alphabetically'." + :type '(choice (const :tag "None" nil) + function) + :group 'buffers-menu) + +(defcustom buffers-menu-grouping-function + 'group-buffers-menu-by-mode-then-alphabetically + "*If non-nil, a function to group buffers in the buffers menu together. +It will be passed two arguments, successive members of the sorted buffers +list after being passed through `buffers-menu-sort-function'. It should +return non-nil if the second buffer begins a new group. The return value +should be the name of the old group, which may be used in hierarchical +buffers menus. The last invocation of the function contains nil as the +second argument, so that the name of the last group can be determined. + +The sensible values of this function are dependent on the value specified +for `buffers-menu-sort-function'." + :type '(choice (const :tag "None" nil) + function) + :group 'buffers-menu) + +(defun buffers-menu-omit-invisible-buffers (buf) + "For use as a value of `buffers-menu-omit-function'. +Omits normally invisible buffers (those whose name begins with a space)." + (not (null (string-match "\\` " (buffer-name buf))))) + +(defun sort-buffers-menu-alphabetically (buf1 buf2) + "For use as a value of `buffers-menu-sort-function'. +Sorts the buffers in alphabetical order by name, but puts buffers beginning +with a star at the end of the list." + (let* ((nam1 (buffer-name buf1)) + (nam2 (buffer-name buf2)) + (star1p (not (null (string-match "\\`*" nam1)))) + (star2p (not (null (string-match "\\`*" nam2))))) + (if (not (eq star1p star2p)) + (not star1p) + (string-lessp nam1 nam2)))) + +(defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2) + "For use as a value of `buffers-menu-sort-function'. +Sorts first by major mode and then alphabetically by name, but puts buffers +beginning with a star at the end of the list." + (let* ((nam1 (buffer-name buf1)) + (nam2 (buffer-name buf2)) + (star1p (not (null (string-match "\\`*" nam1)))) + (star2p (not (null (string-match "\\`*" nam2)))) + (mode1 (symbol-value-in-buffer 'major-mode buf1)) + (mode2 (symbol-value-in-buffer 'major-mode buf2))) + (cond ((not (eq star1p star2p)) (not star1p)) + ((and star1p star2p (string-lessp nam1 nam2))) + ((string-lessp mode1 mode2) t) + ((string-lessp mode2 mode1) nil) + (t (string-lessp nam1 nam2))))) + +;; this version is too slow on some machines. +(defun slow-format-buffers-menu-line (buffer) + "For use as a value of `buffers-menu-format-buffer-line-function'. +This returns a string containing a bunch of info about the buffer." + (format "%s%s %-19s %6s %-15s %s" + (if (buffer-modified-p buffer) "*" " ") + (if (symbol-value-in-buffer 'buffer-read-only buffer) "%" " ") + (buffer-name buffer) + (buffer-size buffer) + (symbol-value-in-buffer 'mode-name buffer) + (or (buffer-file-name buffer) ""))) + +(defun format-buffers-menu-line (buffer) + "For use as a value of `buffers-menu-format-buffer-line-function'. +This just returns the buffer's name." + (buffer-name buffer)) + +(defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2) + "For use as a value of `buffers-menu-grouping-function'. +This groups buffers by major mode. It only really makes sense if +`buffers-menu-sorting-function' is +`sort-buffers-menu-by-mode-then-alphabetically'." + (cond ((string-match "\\`*" (buffer-name buf1)) + (and (null buf2) "*Misc*")) + ((or (null buf2) + (string-match "\\`*" (buffer-name buf2)) + (not (eq (symbol-value-in-buffer 'major-mode buf1) + (symbol-value-in-buffer 'major-mode buf2)))) + (symbol-value-in-buffer 'mode-name buf1)) + (t nil))) + +(defun buffer-menu-save-buffer (buffer) + (save-excursion + (set-buffer buffer) + (save-buffer))) + +(defun buffer-menu-write-file (buffer) + (save-excursion + (set-buffer buffer) + (write-file (read-file-name + (format "Write %s to file: " + (buffer-name (current-buffer))))))) + +(defsubst build-buffers-menu-internal (buffers) + (let (name line) + (mapcar + #'(lambda (buffer) + (if (eq buffer t) + "---" + (setq line (funcall buffers-menu-format-buffer-line-function + buffer)) + (if complex-buffers-menu-p + (delq nil + (list line + (vector "Switch to Buffer" + (list buffers-menu-switch-to-buffer-function + (setq name (buffer-name buffer))) + t) + (if (eq buffers-menu-switch-to-buffer-function + 'switch-to-buffer) + (vector "Switch to Buffer, Other Frame" + (list 'switch-to-buffer-other-frame + (setq name (buffer-name buffer))) + t) + nil) + (if (and (buffer-modified-p buffer) + (buffer-file-name buffer)) + (vector "Save Buffer" + (list 'buffer-menu-save-buffer name) t) + ["Save Buffer" nil nil] + ) + (vector "Save As..." + (list 'buffer-menu-write-file name) t) + (vector "Delete Buffer" (list 'kill-buffer name) + t))) + ;; ### We don't want buffer names to be translated, + ;; ### so we put the buffer name in the suffix. + ;; ### Also, avoid losing with non-ASCII buffer names. + ;; ### We still lose, however, if complex-buffers-menu-p. --mrb + (vector "" + (list buffers-menu-switch-to-buffer-function + (buffer-name buffer)) + t line)))) + buffers))) + +(defun buffers-menu-filter (menu) + "This is the menu filter for the top-level buffers \"Buffers\" menu. +It dynamically creates a list of buffers to use as the contents of the menu. +Only the most-recently-used few buffers will be listed on the menu, for +efficiency reasons. You can control how many buffers will be shown by +setting `buffers-menu-max-size'. You can control the text of the menu +items by redefining the function `format-buffers-menu-line'." + (let ((buffers (delete-if buffers-menu-omit-function (buffer-list)))) + (and (integerp buffers-menu-max-size) + (> buffers-menu-max-size 1) + (> (length buffers) buffers-menu-max-size) + ;; shorten list of buffers (not with submenus!) + (not (and buffers-menu-grouping-function + buffers-menu-submenus-for-groups-p)) + (setcdr (nthcdr buffers-menu-max-size buffers) nil)) + (if buffers-menu-sort-function + (setq buffers (sort buffers buffers-menu-sort-function))) + (if (and buffers-menu-grouping-function + buffers-menu-submenus-for-groups-p + (or (not (integerp buffers-menu-submenus-for-groups-p)) + (> (length buffers) buffers-menu-submenus-for-groups-p))) + (let (groups groupnames current-group) + (mapl + #'(lambda (sublist) + (let ((groupname (funcall buffers-menu-grouping-function + (car sublist) (cadr sublist)))) + (setq current-group (cons (car sublist) current-group)) + (if groupname + (progn + (setq groups (cons (nreverse current-group) + groups)) + (setq groupnames (cons groupname groupnames)) + (setq current-group nil))))) + buffers) + (setq buffers + (mapcar* + #'(lambda (groupname group) + (cons groupname (build-buffers-menu-internal group))) + (nreverse groupnames) + (nreverse groups)))) + (if buffers-menu-grouping-function + (progn + (setq buffers + (mapcon + #'(lambda (sublist) + (cond ((funcall buffers-menu-grouping-function + (car sublist) (cadr sublist)) + (list (car sublist) t)) + (t (list (car sublist))))) + buffers)) + ;; remove a trailing separator. + (and (>= (length buffers) 2) + (let ((lastcdr (nthcdr (- (length buffers) 2) buffers))) + (if (eq t (cadr lastcdr)) + (setcdr lastcdr nil)))))) + (setq buffers (build-buffers-menu-internal buffers))) + (append menu buffers) + )) + +(defun language-environment-menu-filter (menu) + "This is the menu filter for the \"Language Environment\" submenu." + (mapcar (lambda (env-sym) + `[ ,(capitalize (symbol-name env-sym)) + (set-language-environment ',env-sym)]) + language-environment-list)) + + +;;; The Options menu + +;; We'll keep those variables here for a while, in order to provide a +;; function for porting the old options file that a user may own to Custom. + +(defvar options-save-faces nil + "*Non-nil value means save-options will save information about faces. +A nil value means save-options will not save face information. +Set this non-nil only if you use M-x edit-faces to change face +settings. If you use M-x customize-face or the \"Browse Faces...\" +menu entry, you will see a button in the Customize Face buffer that you +can use to permanently save your face changes. + +M-x edit-faces is deprecated. Support for it and this variable will +be discontinued in a future release.") + +(defvar save-options-init-file nil + "File into which to save forms to load the options file (nil for .emacs). +Normally this is nil, which means save into your .emacs file (the value +of `user-init-file'.") + +(defvar save-options-file ".xemacs-options" + "File to save options into. +This file is loaded from your .emacs file. +If this is a relative filename, it is put into the same directory as your +.emacs file.") + + + +;;; The Help menu + +(if (featurep 'mule) + (defun tutorials-menu-filter (menu-items) + ;; If there's a tutorial for the current language environment, make it + ;; 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 + (assoc current-language-environment language-info-alist)) + current-language-environment + "English") + ")")) + menu))) + + +(set-menubar default-menubar) + + +;;; Popup menus. + +(defconst default-popup-menu + '("XEmacs Commands" + ["Undo" advertised-undo + :active (and (not (eq buffer-undo-list t)) + (or buffer-undo-list pending-undo-list)) + :suffix (if (or (eq last-command 'undo) + (eq last-command 'advertised-undo)) + "More" "")] + ["Cut" x-kill-primary-selection + :active (and (eq 'x (device-type (selected-device))) + (x-selection-owner-p))] + ["Copy" x-copy-primary-selection + :active (and (eq 'x (device-type (selected-device))) + (x-selection-owner-p))] + ["Paste" x-yank-clipboard-selection + :active (and (eq 'x (device-type (selected-device))) + (x-selection-exists-p 'CLIPBOARD))] + ["Clear" x-delete-primary-selection + :active (and (eq 'x (device-type (selected-device))) + (x-selection-owner-p))] + "-----" + ["Select Block" mark-paragraph] + ["Split Window" (split-window)] + ["Unsplit Window" delete-other-windows] + )) + +(defvar global-popup-menu nil + "The global popup menu. This is present in all modes. +See the function `popup-menu' for a description of menu syntax.") + +(defvar mode-popup-menu nil + "The mode-specific popup menu. Automatically buffer local. +This is appended to the default items in `global-popup-menu'. +See the function `popup-menu' for a description of menu syntax.") +(make-variable-buffer-local 'mode-popup-menu) + +;; In an effort to avoid massive menu clutter, this mostly worthless menu is +;; superceded by any local popup menu... +(setq-default mode-popup-menu default-popup-menu) + +(defvar activate-popup-menu-hook nil + "Function or functions run before a mode-specific popup menu is made visible. +These functions are called with no arguments, and should interrogate and +modify the value of `global-popup-menu' or `mode-popup-menu' as desired. +Note: this hook is only run if you use `popup-mode-menu' for activating the +global and mode-specific commands; if you have your own binding for button3, +this hook won't be run.") + +(defun popup-mode-menu () + "Pop up a menu of global and mode-specific commands. +The menu is computed by combining `global-popup-menu' and `mode-popup-menu'." + (interactive "@_") + (run-hooks 'activate-popup-menu-hook) + (popup-menu + (cond ((and global-popup-menu mode-popup-menu) + (check-menu-syntax mode-popup-menu) + (let* ((title (car mode-popup-menu)) + (items (cdr mode-popup-menu)) + filters) + ;; Strip keywords from local menu for attaching them at the top + (while (and items + (symbolp (car items))) + (setq items (append filters (list (car items)))) + (setq items (cdr items))) + ;; If filters contains a keyword already present in + ;; `global-popup-menu' you will probably lose. + (append (list (car global-popup-menu)) + filters + (cdr global-popup-menu) + '("---" "---") + (if popup-menu-titles (list title)) + (if popup-menu-titles '("---" "---")) + items))) + (t + (or mode-popup-menu + global-popup-menu + (error "No menu here.")))))) + +(defun popup-buffer-menu (event) + "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked." + (interactive "e") + (let ((window (and (event-over-text-area-p event) (event-window event))) + (bmenu nil)) + (or window + (error "Pointer must be in a normal window")) + (select-window window) + (if current-menubar + (setq bmenu (assoc "Buffers" current-menubar))) + (if (null bmenu) + (setq bmenu (assoc "Buffers" default-menubar))) + (if (null bmenu) + (error "Can't find the Buffers menu")) + (popup-menu bmenu))) + +(defun popup-menubar-menu (event) + "Pop up a copy of menu that also appears in the menubar" + ;; by Stig@hackvan.com + (interactive "e") + (let ((window (and (event-over-text-area-p event) (event-window event))) + popup-menubar) + (or window + (error "Pointer must be in a normal window")) + (select-window window) + (and current-menubar (run-hooks 'activate-menubar-hook)) + ;; ##### Instead of having to copy this just to safely get rid of + ;; any nil what we should really do is fix up the internal menubar + ;; code to just ignore nil if generating a popup menu + (setq popup-menubar (delete nil (copy-sequence (or current-menubar + default-menubar)))) + (popup-menu (cons "Menubar Menu" popup-menubar)) + )) + +(global-set-key 'button3 'popup-mode-menu) +;; shift button3 and shift button2 are reserved for Hyperbole +(global-set-key '(meta control button3) 'popup-buffer-menu) +;; The following command is way too dangerous with Custom. +;; (global-set-key '(meta shift button3) 'popup-menubar-menu) + +;; Here's a test of the cool new menu features (from Stig). + +;;(setq mode-popup-menu +;; '("Test Popup Menu" +;; :filter cdr +;; ["this item won't appear because of the menu filter" ding t] +;; "--:singleLine" +;; "singleLine" +;; "--:doubleLine" +;; "doubleLine" +;; "--:singleDashedLine" +;; "singleDashedLine" +;; "--:doubleDashedLine" +;; "doubleDashedLine" +;; "--:noLine" +;; "noLine" +;; "--:shadowEtchedIn" +;; "shadowEtchedIn" +;; "--:shadowEtchedOut" +;; "shadowEtchedOut" +;; "--:shadowDoubleEtchedIn" +;; "shadowDoubleEtchedIn" +;; "--:shadowDoubleEtchedOut" +;; "shadowDoubleEtchedOut" +;; "--:shadowEtchedInDash" +;; "shadowEtchedInDash" +;; "--:shadowEtchedOutDash" +;; "shadowEtchedOutDash" +;; "--:shadowDoubleEtchedInDash" +;; "shadowDoubleEtchedInDash" +;; "--:shadowDoubleEtchedOutDash" +;; "shadowDoubleEtchedOutDash" +;; )) + +(defun xemacs-splash-buffer () + "Redisplay XEmacs splash screen in a buffer." + (interactive) + (let ((buffer (get-buffer-create "*Splash*"))) + (set-buffer buffer) + (erase-buffer buffer) + (startup-splash-frame) + (pop-to-buffer buffer) + (delete-other-windows))) + + +;;; backwards compatibility +(provide 'x-menubar) +(provide 'menubar-items) + +;;; x-menubar.el ends here. diff -r 090b52736db2 -r c42ec1d1cded lisp/mouse.el --- a/lisp/mouse.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/mouse.el Mon Aug 13 10:33:18 2007 +0200 @@ -40,24 +40,16 @@ (global-set-key '(control shift button1) 'mouse-track-delete-and-insert) (global-set-key '(meta button1) 'mouse-track-do-rectangle) +;; drops are now handled in dragdrop.el (ograf@fga.de) + ;; enable drag regions (ograf@fga.de) ;; if button2 is dragged from within a region, this becomes a drop +;; +;; this must be changed to the new api (if (featurep '(or offix cde mswindows)) (global-set-key 'button2 'mouse-drag-or-yank) (global-set-key 'button2 'mouse-yank)) -;; enable drops from OffiX (ograf@fga.de) or mswindows -;; accept any button1,2,3 drop with `mouse-offix-drop' or 'mswindows-mouse-drop' -(cond ((featurep 'offix) - (global-set-key 'drop1 'mouse-offix-drop) - (global-set-key 'drop2 'mouse-offix-drop) - (global-set-key 'drop3 'mouse-offix-drop)) - ((featurep 'mswindows) - (global-set-key 'drop0 'mouse-mswindows-drop) - (global-set-key 'drop1 'mouse-mswindows-drop) - (global-set-key 'drop2 'mouse-mswindows-drop) - (global-set-key 'drop3 'mouse-mswindows-drop))) - (defgroup mouse nil "Window system-independent mouse support." :group 'editing) @@ -208,89 +200,6 @@ (funcall mouse-yank-function)) ) -(defun mouse-offix-drop (event) - "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 - (interactive "e") - (let ((type (car (event-drag-and-drop-data event))) - (data (cadr (event-drag-and-drop-data event))) - (frame (event-channel event))) - (cond ((= type 2) - (let ((x pop-up-windows)) - (setq pop-up-windows nil) - (pop-to-buffer (find-file-noselect data) nil frame) - (make-frame-visible frame) - (setq pop-up-windows x))) - ((= type 3) - (let ((x pop-up-windows)) - (setq pop-up-windows nil) - (while (not (eq data ())) - (pop-to-buffer (find-file-noselect (car data)) nil frame) - (setq data (cdr data))) - (make-frame-visible frame) - (setq pop-up-windows x))) - ((= type 4) - (and (not mouse-yank-at-point) - (mouse-set-point event)) - (insert data)) - ((= type 5) (dired data)) - ((or (= type 6) (= type 7)) (dired data)) ;; this is junk - ((= type 8) (funcall browse-url-browser-function data)) - ((= type 9) - (let ((buf (generate-new-buffer "DndMIME"))) - (set-buffer buf) - (pop-to-buffer buf nil frame) - (insert data) - (make-frame-visible frame))) - (t ;; this is raw data or unknown stuff - (let ((buf (generate-new-buffer "DndRawData"))) - (set-buffer buf) - (pop-to-buffer buf nil frame) - (insert data) - (hexlify-buffer) - (make-frame-visible frame)))) - (undo-boundary))) - -(defun mouse-mswindows-drop (event) - "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))) - (frame (event-channel event)) - (window (if frame (event-window event) (frame-selected-window)))) - (cond ((= type 2) ;; file - (let ((x pop-up-windows)) - (setq pop-up-windows nil) - (cond (window - (select-window window))) - (switch-to-buffer (find-file-noselect data)) - (make-frame-visible frame) - (setq pop-up-windows x))) - ((= type 3) ;; files - (let ((x pop-up-windows)) - (setq pop-up-windows nil) - (while (not (eq data ())) - (pop-to-buffer (find-file-noselect (car data)) nil frame) - (setq data (cdr data))) - (make-frame-visible frame) - (setq pop-up-windows x))) - ((= type 4) ;; text - (and (not mouse-yank-at-point) - (mouse-set-point event)) - (insert data)) - (t ;; this is raw data or unknown stuff - (let ((buf (generate-new-buffer "DndRawData"))) - (set-buffer buf) - (pop-to-buffer buf nil frame) - (insert data) - (hexlify-buffer) - (make-frame-visible frame)))) - (undo-boundary))) - (defun mouse-eval-sexp (click force-window) "Evaluate the sexp under the mouse. Usually, this is the last sexp before the click, but if you click on a left paren, then it is the sexp beginning diff -r 090b52736db2 -r c42ec1d1cded lisp/msw-faces.el --- a/lisp/msw-faces.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/msw-faces.el Mon Aug 13 10:33:18 2007 +0200 @@ -58,9 +58,9 @@ ;;; Courier New:Bold Italic:10:underline strikeout:ansi ;;; Missing parts of the font spec should be filled in with these values: ;;; Courier New:Normal:10::ansi -(defun mswindows-font-canicolize-name (font) - "Given a mswindows font specification, this returns its name in canonical -form." +(defun mswindows-font-canonicalize-name (font) + "Given a mswindows font or font specification, this returns its +specification in canonical form." (if (or (font-instance-p font) (stringp font)) (let ((name (if (font-instance-p font) @@ -83,7 +83,7 @@ "Given a mswindows font specification, this attempts to make a bold font. If it fails, it returns nil." (if (font-instance-p font) - (let ((name (mswindows-font-canicolize-name font)) + (let ((name (mswindows-font-canonicalize-name font)) (oldwidth (font-instance-width font))) (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) (let ((newfont (make-font-instance @@ -102,7 +102,7 @@ "Given a mswindows font specification, this attempts to make a non-bold font. If it fails, it returns nil." (if (font-instance-p font) - (let ((name (mswindows-font-canicolize-name font))) + (let ((name (mswindows-font-canonicalize-name font))) (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) (make-font-instance (concat (substring name 0 (match-beginning 1)) @@ -113,7 +113,7 @@ "Given a mswindows font specification, this attempts to make an `italic' font. If it fails, it returns nil." (if (font-instance-p font) - (let ((name (mswindows-font-canicolize-name font))) + (let ((name (mswindows-font-canonicalize-name font))) (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) (make-font-instance (concat (substring name 0 (match-beginning 1)) @@ -124,7 +124,7 @@ "Given a mswindows font specification, this attempts to make a non-italic font. If it fails, it returns nil." (if (font-instance-p font) - (let ((name (mswindows-font-canicolize-name font))) + (let ((name (mswindows-font-canonicalize-name font))) (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) (make-font-instance (concat (substring name 0 (match-beginning 1)) @@ -135,7 +135,7 @@ "Given a mswindows font specification, this attempts to make a `bold-italic' font. If it fails, it returns nil." (if (font-instance-p font) - (let ((name (mswindows-font-canicolize-name font)) + (let ((name (mswindows-font-canonicalize-name font)) (oldwidth (font-instance-width font))) (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) (let ((newfont (make-font-instance @@ -154,7 +154,7 @@ "Loads a new version of the given font (or font name) 1 point smaller. Returns the font if it succeeds, nil otherwise." (if (font-instance-p font) - (let (old-size (name (mswindows-font-canicolize-name font))) + (let (old-size (name (mswindows-font-canonicalize-name font))) (string-match "^[a-zA-Z ]+:[a-zA-Z ]*:\\([0-9]+\\):" name) (setq old-size (string-to-int (substring name (match-beginning 1) (match-end 1)))) @@ -169,7 +169,7 @@ "Loads a new version of the given font (or font name) 1 point larger. Returns the font if it succeeds, nil otherwise." (if (font-instance-p font) - (let (old-size (name (mswindows-font-canicolize-name font))) + (let (old-size (name (mswindows-font-canonicalize-name font))) (string-match "^[a-zA-Z ]+:[a-zA-Z ]*:\\([0-9]+\\):" name) (setq old-size (string-to-int (substring name (match-beginning 1) (match-end 1)))) diff -r 090b52736db2 -r c42ec1d1cded lisp/msw-glyphs.el --- a/lisp/msw-glyphs.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/msw-glyphs.el Mon Aug 13 10:33:18 2007 +0200 @@ -70,7 +70,7 @@ (cond ((featurep 'xpm) (set-glyph-image frame-icon-glyph - (concat "../etc/" "xemacs-icon.xpm") + (concat "../etc/" "xemacs-icon3.xpm") 'global 'mswindows) (set-glyph-image xemacs-logo (concat "../etc/" diff -r 090b52736db2 -r c42ec1d1cded lisp/package-get-base.el --- a/lisp/package-get-base.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/package-get-base.el Mon Aug 13 10:33:18 2007 +0200 @@ -1,19 +1,19 @@ (setq package-get-base '((eudc (standards-version 1.0 - version "1.05" - author-version "1.05" - date "1998-04-29" - build-date "1998-05-01" + version "1.06" + author-version "1.06" + date "1998-05-03" + build-date "1998-05-04" maintainer "Oscar Figueiredo " distribution stable priority low category "comm" dump nil description "Emacs Unified Directory Client." - filename "eudc-1.05-pkg.tar.gz" - md5sum "1313a4cf7bb644e807bd846ab0d6e414" - size 40378 + filename "eudc-1.06-pkg.tar.gz" + md5sum "aff14f51353f6ad31f28f10104bb4996" + size 40382 provides (eudc eudc-ldap eudc-ph) requires (fsf-compat xemacs-base) type regular @@ -172,19 +172,19 @@ )) (supercite (standards-version 1.0 - version "1.05" + version "1.06" author-version "3.55x" - date "1998-02-11" - build-date "1998-04-04" + date "1998-05-07" + build-date "1998-05-09" maintainer "XEmacs Development Team " distribution stable priority low category "comm" dump nil description "An Emacs citation tool for News & Mail messages." - filename "supercite-1.05-pkg.tar.gz" - md5sum "de8676b20143e985ab2b7c46f82218dc" - size 90162 + filename "supercite-1.06-pkg.tar.gz" + md5sum "9626dcb33f2b7719c49324a8ed92956b" + size 70857 provides (supercite) requires (mail-lib xemacs-base) type regular @@ -362,19 +362,19 @@ )) (dired (standards-version 1.0 - version "1.0" + version "1.01" author-version "7.9" - date "1998-02-17" - build-date "1998-04-04" + date "1998-05-05" + build-date "1998-05-05" maintainer "Mike Sperber " distribution stable priority medium category "libs" dump nil description "Manage file systems." - filename "dired-1.0-pkg.tar.gz" - md5sum "9d0fab9ce63853d8a44d95fe8f87ad29" - size 187355 + filename "dired-1.01-pkg.tar.gz" + md5sum "d9748d8e8af8a63095aaaab9924987ef" + size 187526 provides (diff dired) requires (xemacs-base) type regular @@ -420,9 +420,9 @@ (fsf-compat (standards-version 1.0 version "1.0" - author-version "21.0b35" + author-version "21.0b39" date "1998-03-25" - build-date "1998-04-04" + build-date "1998-05-06" maintainer "XEmacs Development Team " distribution mule priority high @@ -430,30 +430,30 @@ dump nil description "FSF Emacs compatibility files." filename "fsf-compat-1.0-pkg.tar.gz" - md5sum "813d839e6907a1e0b4a1226ca4340e0b" - size 16103 + md5sum "71351ff26a69b341015612d9b88dfc55" + size 16083 provides (overlay thingatpt timer) requires () type single )) (mail-lib (standards-version 1.0 - version "1.12" - author-version "21.0b38" - date "1998-05-01" - build-date "1998-05-02" + version "1.13" + author-version "21.0b39" + date "1998-05-09" + build-date "1998-05-09" maintainer "XEmacs Development Team " distribution stable priority medium category "libs" dump nil description "Fundamental lisp files for providing email support." - filename "mail-lib-1.12-pkg.tar.gz" - md5sum "287eaaeafd45a778e45200866e6952f4" - size 119922 + filename "mail-lib-1.13-pkg.tar.gz" + md5sum "39c95ef0dfc8d2bee106768c14821d98" + size 120019 provides (browse-url highlight-headers mail-abbrevs mail-extr mail-utils reporter rfc822 rmail-mini rmailout sendmail smtpmail) requires (xemacs-base) - type single + type regular )) (tooltalk (standards-version 1.0 @@ -515,20 +515,20 @@ (edict (standards-version 1.0 version "1.01" - author-version "0.9.6X1" + author-version "0.9.7" date "1998-03-13" - build-date "1998-03-13" - maintainer "XEmacs Development Team " + build-date "1998-05-06" + maintainer "Stephen J. Turnbull " distribution mule priority high category "mule" dump t description "Lisp Interface to EDICT, Kanji Dictionary" filename "edict-1.01-pkg.tar.gz" - md5sum "f3e4eab5058a028d1d5224adf8d6fc91" - size 85019 + md5sum "45881df2e316f5fb38bed46f46c9992e" + size 144862 provides () - requires (skk egg-its mule-base xemacs-base) + requires (mule-base xemacs-base) type regular )) (egg-its @@ -590,19 +590,19 @@ )) (mule-base (standards-version 1.0 - version "1.14" - author-version "21.0b36" - date "1998-04-07" - build-date "1998-04-17" - maintainer "XEmacs Development Team " + version "1.16" + author-version "21.0b39" + date "1998-05-09" + build-date "1998-05-09" + maintainer "SL Baur " distribution mule priority high category "mule" dump t description "Basic Mule support, required for building with Mule." - filename "mule-base-1.14-pkg.tar.gz" - md5sum "6f5cd80e31ff852636c19df9ad7d3e95" - size 487974 + filename "mule-base-1.16-pkg.tar.gz" + md5sum "5acc72aebf3a3f6505ddc947bd111cb1" + size 508454 provides (canna-leim canna char-table china-util cyril-util isearch-ext japan-util ccl can-n-egg mule-help) requires (fsf-compat xemacs-base) type regular @@ -1120,21 +1120,40 @@ requires () type regular )) +(jde + (standards-version 1.0 + version "1.0" + author-version "2.0" + date "1998-04-19" + build-date "1998-05-06" + maintainer "Andy Piper " + distribution stable + priority medium + category "prog" + dump nil + description "Java language and development support." + filename "jde-1.0-pkg.tar.gz" + md5sum "f17436f90709e197ea7937d75b8ede15" + size 112195 + provides (jde) + requires (cc-mode debug speedbar edit-utils mail-lib xemacs-base) + type regular +)) (pcl-cvs (standards-version 1.0 - version "1.07" - author-version "21.0b38" - date "1998-04-27" - build-date "1998-05-01" + version "1.08" + author-version "21.0b39" + date "1998-05-07" + build-date "1998-05-09" maintainer "XEmacs Development Team " distribution stable priority low category "prog" dump nil description "CVS frontend." - filename "pcl-cvs-1.07-pkg.tar.gz" - md5sum "252e448e4d2a6d68d52b7e0389949889" - size 170580 + filename "pcl-cvs-1.08-pkg.tar.gz" + md5sum "c1cf0841a3df11130736a82e20b1ccf4" + size 172294 provides (pcl-cvs dll elib-node generic-sc) requires (xemacs-base) type regular diff -r 090b52736db2 -r c42ec1d1cded lisp/replace.el --- a/lisp/replace.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/replace.el Mon Aug 13 10:33:18 2007 +0200 @@ -68,7 +68,7 @@ ;; As per suggestion from Per Abrahamsen, limit replacement to the region ;; if the region is active. -(defun query-replace (from-string to-string &optional arg) +(defun query-replace (from-string to-string &optional delimited) "Replace some occurrences of FROM-STRING with TO-STRING. As each match is found, the user must type a character saying what to do with it. For directions, type \\[help-command] at that time. @@ -87,16 +87,9 @@ To customize possible responses, change the \"bindings\" in `query-replace-map'." (interactive (query-replace-read-args "Query replace" nil)) - (if (or (and (boundp 'zmacs-region-active-p) zmacs-region-active-p) - (and (boundp 'transient-mark-mode) transient-mark-mode mark-active)) - (save-restriction - (save-excursion - (narrow-to-region (point) (mark)) - (goto-char (point-min)) - (perform-replace from-string to-string t nil arg))) - (perform-replace from-string to-string t nil arg))) + (perform-replace from-string to-string t nil delimited)) -(defun query-replace-regexp (regexp to-string &optional arg) +(defun query-replace-regexp (regexp to-string &optional delimited) "Replace some things after point matching REGEXP with TO-STRING. As each match is found, the user must type a character saying what to do with it. For directions, type \\[help-command] at that time. @@ -113,14 +106,7 @@ and `\\=\\N' (where N is a digit) stands for whatever what matched the Nth `\\(...\\)' in REGEXP." (interactive (query-replace-read-args "Query replace regexp" t)) - (if (or (and (boundp 'zmacs-region-active-p) zmacs-region-active-p) - (and (boundp 'transient-mark-mode) transient-mark-mode mark-active)) - (save-restriction - (save-excursion - (narrow-to-region (point) (mark)) - (goto-char (point-min)) - (perform-replace regexp to-string t t arg))) - (perform-replace regexp to-string t t arg))) + (perform-replace regexp to-string t t delimited)) ;;#### Not patently useful (defun map-query-replace-regexp (regexp to-strings &optional arg) @@ -594,8 +580,8 @@ (setq query-replace-map map))) - -(autoload 'isearch-highlight "isearch") +;; isearch-mode is dumped, so don't autoload. +;(autoload 'isearch-highlight "isearch") ;; XEmacs (defun perform-replace-next-event (event) @@ -635,6 +621,9 @@ (next-rotate-count 0) (replace-count 0) (lastrepl nil) ;Position after last match considered. + ;; If non-nil, it is marker saying where in the buffer to + ;; stop. + (limit nil) (match-again t) ;; XEmacs addition (qr-case-fold-search @@ -645,6 +634,14 @@ (if query-flag (substitute-command-keys "Query replacing %s with %s: (\\\\[help] for help) ")))) + ;; If the region is active, operate on region. + (when (region-active-p) + ;; Original Per Abrahamsen's code simply narrowed the region, + ;; thus providing a visual indication of the search boundary. + ;; Stallman, on the other hand, handles it like this. + (setq limit (copy-marker (region-end))) + (goto-char (region-beginning)) + (zmacs-deactivate-region)) (if (stringp replacements) (setq next-replacement replacements) (or repeat-count (setq repeat-count 1))) @@ -661,7 +658,7 @@ (while (and keep-going (not (eobp)) (let ((case-fold-search qr-case-fold-search)) - (funcall search-function search-string nil t)) + (funcall search-function search-string limit t)) ;; If the search string matches immediately after ;; the previous match, but it did not match there ;; before the replacement was done, ignore the match. @@ -675,7 +672,7 @@ ;; right after end of previous replacement. (forward-char 1) (let ((case-fold-search qr-case-fold-search)) - (funcall search-function search-string nil t))) + (funcall search-function search-string limit t))) t)) ;; Save the data associated with the real match. @@ -797,44 +794,43 @@ (setq stack (cons (cons (point) (or replaced - (mapcar - #'(lambda (elt) - (if (markerp elt) - (prog1 (marker-position elt) - (set-marker elt nil)) - elt)) - (match-data)))) + (match-data t))) stack)) (if replaced (setq replace-count (1+ replace-count))))) (setq lastrepl (point))) - (replace-dehighlight)) + ;; Useless in XEmacs. We handle (de)highlighting through + ;; perform-replace-next-event. + ;(replace-dehighlight) + ) (or unread-command-events (message "Replaced %d occurrence%s" replace-count (if (= replace-count 1) "" "s"))) (and keep-going stack))) -(defvar query-replace-highlight nil - "*Non-nil means to highlight words during query replacement.") - -(defvar replace-overlay nil) +;; FSFmacs code: someone should port it. -(defun replace-dehighlight () - (and replace-overlay - (progn - (delete-overlay replace-overlay) - (setq replace-overlay nil)))) +;(defvar query-replace-highlight nil +; "*Non-nil means to highlight words during query replacement.") + +;(defvar replace-overlay nil) -(defun replace-highlight (start end) - (and query-replace-highlight - (progn - (or replace-overlay - (progn - (setq replace-overlay (make-overlay start end)) - (overlay-put replace-overlay 'face - (if (internal-find-face 'query-replace) - 'query-replace 'region)))) - (move-overlay replace-overlay start end (current-buffer))))) +;(defun replace-dehighlight () +; (and replace-overlay +; (progn +; (delete-overlay replace-overlay) +; (setq replace-overlay nil)))) + +;(defun replace-highlight (start end) +; (and query-replace-highlight +; (progn +; (or replace-overlay +; (progn +; (setq replace-overlay (make-overlay start end)) +; (overlay-put replace-overlay 'face +; (if (internal-find-face 'query-replace) +; 'query-replace 'region)))) +; (move-overlay replace-overlay start end (current-buffer))))) (defun match-string (num &optional string) "Return string of text matched by last search. diff -r 090b52736db2 -r c42ec1d1cded lisp/scrollbar.el --- a/lisp/scrollbar.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/scrollbar.el Mon Aug 13 10:33:18 2007 +0200 @@ -31,20 +31,18 @@ ;;; Code: (defcustom scrollbars-visible-p ;; added for the options menu - dverna - (> (specifier-instance scrollbar-width) 0) + (specifier-instance vertical-scrollbar-visible-p (selected-device)) "Whether the scrollbars are globally visible. This variable can be customized through the options menu." :group 'display :type 'boolean - ;; This is really a hack: there should be a real specifier for this, in - ;; order to turn on/off the scrollbars without altering their size. :set '(lambda (var val) (if val (progn - (set-specifier scrollbar-width 15) - (set-specifier scrollbar-height 15)) - (set-specifier scrollbar-width 0) - (set-specifier scrollbar-height 0)) + (remove-specifier vertical-scrollbar-visible-p 'global) + (remove-specifier horizontal-scrollbar-visible-p 'global)) + (set-specifier vertical-scrollbar-visible-p nil 'global) + (set-specifier horizontal-scrollbar-visible-p nil 'global)) (setq scrollbars-visible-p val)) ) diff -r 090b52736db2 -r c42ec1d1cded lisp/simple.el --- a/lisp/simple.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/simple.el Mon Aug 13 10:33:18 2007 +0200 @@ -588,7 +588,7 @@ (while (< (point) end) (when (forward-word 1) (incf words))) - (when (interactive-p) + (when (interactive-p) (message "Region has %d words" words)) words))) diff -r 090b52736db2 -r c42ec1d1cded lisp/startup.el --- a/lisp/startup.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/startup.el Mon Aug 13 10:33:18 2007 +0200 @@ -981,7 +981,7 @@ (defun startup-splash-frame () (let ((p (point)) (logo (cond ((featurep 'infodock) - (make-glyph (locate-data-file "altrasoft-logo.xpm"))) + (make-glyph (locate-data-file "altrasoft-slogo.xpm"))) (t xemacs-logo))) (cramped-p (eq 'tty (console-type)))) (unless cramped-p (insert "\n")) diff -r 090b52736db2 -r c42ec1d1cded lisp/toolbar-items.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/toolbar-items.el Mon Aug 13 10:33:18 2007 +0200 @@ -0,0 +1,587 @@ +;;; toolbar-items.el -- Static initialization of XEmacs toolbar + +;; Copyright (C) 1997 Free Software Foundation, Inc. +;; Copyright (C) 1994 Andy Piper +;; Copyright (C) 1995 Board of Trustees, University of Illinois +;; Copyright (C) 1996 Ben Wing + +;; Maintainer: XEmacs development team +;; Keywords: frames, dumped + +;; 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: Not in FSF + +;;; Commentary: + +;; This file is dumped with XEmacs (when window system and toolbar support +;; is compiled in). + +;; Miscellaneous toolbar functions, useful for users to redefine, in +;; order to get different behaviour. + +;;; Code: + +;; Suppress warning message from bytecompiler +(eval-when-compile + (defvar pending-delete-mode)) + +(defgroup toolbar nil + "Configure XEmacs Toolbar functions and properties" + :group 'environment) + + +(defun toolbar-not-configured () + (interactive) + ;; Note: we don't use `susbtitute-command-keys' here, because + ;; Customize is bound to `C-h C' by default, and that binding is not + ;; familiar to people. This is more descriptive. + (error + "Configure the item via `M-x customize RET toolbar RET'")) + +(defcustom toolbar-open-function 'find-file + "*Function to call when the open icon is selected." + :type '(radio (function-item find-file) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-open () + (interactive) + (call-interactively toolbar-open-function)) + +(defcustom toolbar-dired-function 'dired + "*Function to call when the dired icon is selected." + :type '(radio (function-item dired) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-dired () + (interactive) + (call-interactively toolbar-dired-function)) + +(defcustom toolbar-save-function 'save-buffer + "*Function to call when the save icon is selected." + :type '(radio (function-item save-buffer) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-save () + (interactive) + (call-interactively toolbar-save-function)) + +(defcustom toolbar-print-function 'lpr-buffer + "*Function to call when the print icon is selected." + :type '(radio (function-item lpr-buffer) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-print () + (interactive) + (call-interactively toolbar-print-function)) + +(defcustom toolbar-cut-function 'kill-primary-selection + "*Function to call when the cut icon is selected." + :type '(radio (function-item kill-primary-selection) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-cut () + (interactive) + (call-interactively toolbar-cut-function)) + +(defcustom toolbar-copy-function 'copy-primary-selection + "*Function to call when the copy icon is selected." + :type '(radio (function-item copy-primary-selection) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-copy () + (interactive) + (call-interactively toolbar-copy-function)) + +(defcustom toolbar-paste-function 'yank-clipboard-selection + "*Function to call when the paste icon is selected." + :type '(radio (function-item yank-clipboard-selection) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-paste () + (interactive) + ;; This horrible kludge is for pending-delete to work correctly. + (and (boundp 'pending-delete-mode) + pending-delete-mode + (let ((this-command toolbar-paste-function)) + (pending-delete-pre-hook))) + (call-interactively toolbar-paste-function)) + +(defcustom toolbar-undo-function 'undo + "*Function to call when the undo icon is selected." + :type '(radio (function-item undo) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-undo () + (interactive) + (call-interactively toolbar-undo-function)) + +(defcustom toolbar-replace-function 'query-replace + "*Function to call when the replace icon is selected." + :type '(radio (function-item query-replace) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-replace () + (interactive) + (call-interactively toolbar-replace-function)) + +;; +;; toolbar ispell variables and defuns +;; + +(defun toolbar-ispell-internal () + (interactive) + (cond + ((region-active-p) (ispell-region (region-beginning) (region-end))) + ((eq major-mode 'mail-mode) (ispell-message)) + ((eq major-mode 'message-mode) (ispell-message)) + (t (ispell-buffer)))) + +(defcustom toolbar-ispell-function 'toolbar-ispell-internal + "*Function to call when the ispell icon is selected." + :type '(radio (function-item toolbar-ispell-internal) + (function :tag "Other")) + :group 'toolbar) + +(defun toolbar-ispell () + "Intelligently spell the region or buffer." + (interactive) + (call-interactively toolbar-ispell-function)) + +;; +;; toolbar mail variables and defuns +;; + +;; This used to be a macro that expanded its arguments to a form that +;; called `call-process'. With the advent of customize, it's better +;; to have it as a defun, to make customization easier. +(defun toolbar-external (process &rest args) + (interactive) + (apply 'call-process process nil 0 nil args)) + +(defcustom toolbar-mail-commands-alist + `((not-configured . toolbar-not-configured) + (vm . vm) + (gnus . gnus-no-server) + (rmail . rmail) + (mh . mh-rmail) + (pine . (toolbar-external "xterm" "-e" "pine")) ; *gag* + (elm . (toolbar-external "xterm" "-e" "elm")) + (mutt . (toolbar-external "xterm" "-e" "mutt")) + (exmh . (toolbar-external "exmh")) + (netscape . (toolbar-external "netscape" "mailbox:")) + (send . mail)) + "*Alist of mail readers and their commands. +The car of each alist element is the mail reader, and the cdr is the form +used to start it." + :type '(repeat (cons :format "%v" + (symbol :tag "Mailer") (function :tag "Start with"))) + :group 'toolbar) + +(defcustom toolbar-mail-reader 'not-configured + "*Mail reader toolbar will invoke. +The legal values are the keys from `toolbar-mail-command-alist', which + should be used to add new mail readers. +Mail readers known by default are vm, gnus, rmail, mh, pine, elm, + mutt, exmh, netscape and send." + :type '(choice (const :tag "Not Configured" not-configured) + (const vm) (const gnus) (const rmail) (const mh) + (const pine) (const elm) (const mutt) (const exmh) + (const netscape) + (const send) + (symbol :tag "Other" + :validate (lambda (wid) + (if (assq (widget-value wid) + toolbar-mail-commands-alist) + nil + (widget-put wid :error + "Unknown mail reader") + wid)))) + :group 'toolbar) + + +(defun toolbar-mail () + "Run mail in a separate frame." + (interactive) + (let ((command (cdr (assq toolbar-mail-reader toolbar-mail-commands-alist)))) + (or command + (error "Uknown mail reader %s" toolbar-mail-reader)) + (if (symbolp command) + (call-interactively command) + (eval command)))) + +;; +;; toolbar info variables and defuns +;; + +(defcustom toolbar-info-use-separate-frame t + "*Whether Info is invoked in a separate frame." + :type 'boolean + :group 'toolbar) + +(defcustom toolbar-info-frame-plist + ;; Info pages are 80 characters wide, so it makes a good default. + `(width 80 ,@(let ((h (plist-get default-frame-plist 'height))) + (and h `(height ,h)))) + "*The properties of the frame in which news is displayed." + :type 'plist + :group 'info) + +(define-obsolete-variable-alias 'Info-frame-plist + 'toolbar-info-frame-plist) + +(defvar toolbar-info-frame nil + "The frame in which info is displayed.") + +(defun toolbar-info () + "Run info in a separate frame." + (interactive) + (when toolbar-info-use-separate-frame + (cond ((or (not toolbar-info-frame) + (not (frame-live-p toolbar-info-frame))) + ;; We used to raise frame here, but it's a bad idea, + ;; because raising is a matter of WM policy. However, we + ;; *must* select it, to ensure that the info buffer goes to + ;; the right frame. + (setq toolbar-info-frame (make-frame toolbar-info-frame-plist)) + (select-frame toolbar-info-frame)) + (t + ;; However, if the frame already exists, and the user + ;; clicks on info, it's OK to raise it. + (select-frame toolbar-info-frame) + (raise-frame toolbar-info-frame))) + (when (frame-iconified-p toolbar-info-frame) + (deiconify-frame toolbar-info-frame))) + (info)) + +;; +;; toolbar debug variables and defuns +;; + +(defun toolbar-debug () + (interactive) + (if (featurep 'eos-debugger) + (call-interactively 'eos::start-debugger) + (require 'gdbsrc) + (call-interactively 'gdbsrc))) + +(defvar compile-command) +(defvar toolbar-compile-already-run nil) + +(defun toolbar-compile () + "Run compile without having to touch the keyboard." + (interactive) + (require 'compile) + (if toolbar-compile-already-run + (compile compile-command) + (setq toolbar-compile-already-run t) + (popup-dialog-box + `(,(concat "Compile:\n " compile-command) + ["Compile" (compile compile-command) t] + ["Edit command" compile t] + nil + ["Cancel" (message "Quit") t])))) + +;; +;; toolbar news variables and defuns +;; + +(defcustom toolbar-news-commands-alist + `((not-configured . toolbar-not-configured) + (gnus . toolbar-gnus) ; M-x all-hail-gnus + (rn . (toolbar-external "xterm" "-e" "rn")) + (nn . (toolbar-external "xterm" "-e" "nn")) + (trn . (toolbar-external "xterm" "-e" "trn")) + (xrn . (toolbar-external "xrn")) + (slrn . (toolbar-external "xterm" "-e" "slrn")) + (pine . (toolbar-external "xterm" "-e" "pine")) ; *gag* + (tin . (toolbar-external "xterm" "-e" "tin")) ; *gag* + (netscape . (toolbar-external "netscape" "news:"))) + "*Alist of news readers and their commands. +The car of each alist element the pair is the news reader, and the cdr +is the form used to start it." + :type '(repeat (cons :format "%v" + (symbol :tag "Reader") (sexp :tag "Start with"))) + :group 'toolbar) + +(defcustom toolbar-news-reader 'not-configured + "*News reader toolbar will invoke. +The legal values are the keys from `toolbar-news-command-alist', which should + be used to add new news readers. +Newsreaders known by default are gnus, rn, nn, trn, xrn, slrn, pine + and netscape." + :type '(choice (const :tag "Not Configured" not-configured) + (const gnus) (const rn) (const nn) (const trn) + (const xrn) (const slrn) (const pine) (const tin) + (const netscape) + (symbol :tag "Other" + :validate (lambda (wid) + (if (assq (widget-value wid) + toolbar-news-commands-alist) + nil + (widget-put wid :error + "Unknown news reader") + wid)))) + :group 'toolbar) + +(defcustom toolbar-news-use-separate-frame t + "*Whether Gnus is invoked in a separate frame." + :type 'boolean + :group 'toolbar) + +(defvar toolbar-news-frame nil + "The frame in which news is displayed.") + +(defcustom toolbar-news-frame-plist nil + "*The properties of the frame in which news is displayed." + :type 'plist + :group 'toolbar) + +(define-obsolete-variable-alias 'toolbar-news-frame-properties + 'toolbar-news-frame-plist) + +(defun toolbar-gnus () + "Run Gnus in a separate frame." + (interactive) + (if (not toolbar-news-use-separate-frame) + (gnus) + (unless (frame-live-p toolbar-news-frame) + (setq toolbar-news-frame (make-frame toolbar-news-frame-properties)) + (add-hook 'gnus-exit-gnus-hook + (lambda () + (when (frame-live-p toolbar-news-frame) + (if (cdr (frame-list)) + (delete-frame toolbar-news-frame)) + (setq toolbar-news-frame nil)))) + (select-frame toolbar-news-frame) + (gnus)) + (when (framep toolbar-news-frame) + (when (frame-iconified-p toolbar-news-frame) + (deiconify-frame toolbar-news-frame)) + (select-frame toolbar-news-frame) + (raise-frame toolbar-news-frame)))) + +(defun toolbar-news () + "Run News." + (interactive) + (let ((command (cdr-safe + (assq toolbar-news-reader toolbar-news-commands-alist)))) + (or command + (error "Unkown news reader %s" toolbar-news-reader)) + (if (symbolp command) + (call-interactively command) + (eval command)))) + +(defvar toolbar-last-win-icon nil "A `last-win' icon set.") +(defvar toolbar-next-win-icon nil "A `next-win' icon set.") +(defvar toolbar-file-icon nil "A `file' icon set.") +(defvar toolbar-folder-icon nil "A `folder' icon set") +(defvar toolbar-disk-icon nil "A `disk' icon set.") +(defvar toolbar-printer-icon nil "A `printer' icon set.") +(defvar toolbar-cut-icon nil "A `cut' icon set.") +(defvar toolbar-copy-icon nil "A `copy' icon set.") +(defvar toolbar-paste-icon nil "A `paste' icon set.") +(defvar toolbar-undo-icon nil "An `undo' icon set.") +(defvar toolbar-spell-icon nil "A `spell' icon set.") +(defvar toolbar-replace-icon nil "A `replace' icon set.") +(defvar toolbar-mail-icon nil "A `mail' icon set.") +(defvar toolbar-info-icon nil "An `info' icon set.") +(defvar toolbar-compile-icon nil "A `compile' icon set.") +(defvar toolbar-debug-icon nil "A `debugger' icon set.") +(defvar toolbar-news-icon nil "A `news' icon set.") + +;;; each entry maps a variable to the prefix used. + +(defvar init-x-toolbar-list + '((toolbar-last-win-icon . "last-win") + (toolbar-next-win-icon . "next-win") + (toolbar-file-icon . "file") + (toolbar-folder-icon . "folder") + (toolbar-disk-icon . "disk") + (toolbar-printer-icon . "printer") + (toolbar-cut-icon . "cut") + (toolbar-copy-icon . "copy") + (toolbar-paste-icon . "paste") + (toolbar-undo-icon . "undo") + (toolbar-spell-icon . "spell") + (toolbar-replace-icon . "replace") + (toolbar-mail-icon . "mail") + (toolbar-info-icon . "info-def") + (toolbar-compile-icon . "compile") + (toolbar-debug-icon . "debug") + (toolbar-news-icon . "news"))) + +(defun init-x-toolbar () + (toolbar-add-item-data init-x-toolbar-list ) + ;; do this now because errors will occur if the icon symbols + ;; are not initted + (set-specifier default-toolbar initial-toolbar-spec)) + +(defun toolbar-add-item-data ( icon-list &optional icon-dir ) + (if (eq icon-dir nil) + (setq icon-dir toolbar-icon-directory)) + (mapcar + (lambda (cons) + (let ((prefix (expand-file-name (cdr cons) icon-dir))) + (set (car cons) + (if (featurep 'xpm) + (toolbar-make-button-list + (concat prefix "-up.xpm") + nil + (concat prefix "-xx.xpm") + (concat prefix "-cap-up.xpm") + nil + (concat prefix "-cap-xx.xpm")) + (toolbar-make-button-list + (concat prefix "-up.xbm") + (concat prefix "-dn.xbm") + (concat prefix "-xx.xbm") + ))))) + icon-list ) + ) + +(defvar toolbar-vector-open + [toolbar-file-icon toolbar-open t "Open a file"] + "Define the vector for the \"Open\" toolbar button") + +(defvar toolbar-vector-dired + [toolbar-folder-icon toolbar-dired t "View directory"] + "Define the vector for the \"Dired\" toolbar button") + +(defvar toolbar-vector-save + [toolbar-disk-icon toolbar-save t "Save buffer"] + "Define the vector for the \"Save\" toolbar button") + +(defvar toolbar-vector-print + [toolbar-printer-icon toolbar-print t "Print buffer"] + "Define the vector for the \"Printer\" toolbar button") + +(defvar toolbar-vector-cut + [toolbar-cut-icon toolbar-cut t "Kill region"] + "Define the vector for the \"Cut\" toolbar button") + +(defvar toolbar-vector-copy + [toolbar-copy-icon toolbar-copy t "Copy region"] + "Define the vector for the \"Copy\" toolbar button") + +(defvar toolbar-vector-paste + [toolbar-paste-icon toolbar-paste t "Paste from clipboard"] + "Define the vector for the \"Paste\" toolbar button") + +(defvar toolbar-vector-undo + [toolbar-undo-icon toolbar-undo t "Undo edit"] + "Define the vector for the \"Undo\" toolbar button") + +(defvar toolbar-vector-spell + [toolbar-spell-icon toolbar-ispell t "Spellcheck"] + "Define the vector for the \"Spell\" toolbar button") + +(defvar toolbar-vector-replace + [toolbar-replace-icon toolbar-replace t "Replace text"] + "Define the vector for the \"Replace\" toolbar button") + +(defvar toolbar-vector-mail + [toolbar-mail-icon toolbar-mail t "Mail"] + "Define the vector for the \"Mail\" toolbar button") + +(defvar toolbar-vector-info + [toolbar-info-icon toolbar-info t "Information"] + "Define the vector for the \"Info\" toolbar button") + +(defvar toolbar-vector-compile + [toolbar-compile-icon toolbar-compile t "Compile"] + "Define the vector for the \"Compile\" toolbar button") + +(defvar toolbar-vector-debug + [toolbar-debug-icon toolbar-debug t "Debug"] + "Define the vector for the \"Debug\" toolbar button") + +(defvar toolbar-vector-news + [toolbar-news-icon toolbar-news t "News"] + "Define the vector for the \"News\" toolbar button") + +(defvar initial-toolbar-spec + (list + ;;[toolbar-last-win-icon pop-window-configuration + ;;(frame-property (selected-frame) + ;; 'window-config-stack) t "Most recent window config"] + ;; #### Illicit knowledge? + ;; #### These don't work right - not consistent! + ;; I don't know what's wrong; perhaps `selected-frame' is wrong + ;; sometimes when this is evaluated. Note that I even tried to + ;; kludge-fix this by calls to `set-specifier-dirty-flag' in + ;; pop-window-configuration and such. + + ;;[toolbar-next-win-icon unpop-window-configuration + ;;(frame-property (selected-frame) + ;; 'window-config-unpop-stack) t "Undo \"Most recent window config\""] + ;; #### Illicit knowledge? + toolbar-vector-open + toolbar-vector-dired + toolbar-vector-save + toolbar-vector-print + toolbar-vector-cut + toolbar-vector-copy + toolbar-vector-paste + toolbar-vector-undo + toolbar-vector-spell + toolbar-vector-replace + toolbar-vector-mail + toolbar-vector-info + toolbar-vector-compile + toolbar-vector-debug + toolbar-vector-news + ) + "The initial toolbar for a buffer.") + +(defun x-init-toolbar-from-resources (locale) + (x-init-specifier-from-resources + top-toolbar-height 'natnum locale + '("topToolBarHeight" . "TopToolBarHeight")) + (x-init-specifier-from-resources + bottom-toolbar-height 'natnum locale + '("bottomToolBarHeight" . "BottomToolBarHeight")) + (x-init-specifier-from-resources + left-toolbar-width 'natnum locale + '("leftToolBarWidth" . "LeftToolBarWidth")) + (x-init-specifier-from-resources + right-toolbar-width 'natnum locale + '("rightToolBarWidth" . "RightToolBarWidth")) + (x-init-specifier-from-resources + top-toolbar-border-width 'natnum locale + '("topToolBarBorderWidth" . "TopToolBarBorderWidth")) + (x-init-specifier-from-resources + bottom-toolbar-border-width 'natnum locale + '("bottomToolBarBorderWidth" . "BottomToolBarBorderWidth")) + (x-init-specifier-from-resources + left-toolbar-border-width 'natnum locale + '("leftToolBarBorderWidth" . "LeftToolBarBorderWidth")) + (x-init-specifier-from-resources + right-toolbar-border-width 'natnum locale + '("rightToolBarBorderWidth" . "RightToolBarBorderWidth"))) + +;;; toolbar-items.el ends here diff -r 090b52736db2 -r c42ec1d1cded lisp/version.el --- a/lisp/version.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/version.el Mon Aug 13 10:33:18 2007 +0200 @@ -40,14 +40,10 @@ (format "%d.%d %s%s%s" emacs-major-version emacs-minor-version - (if (and xemacs-codename (not (featurep 'infodock))) + (if xemacs-codename (concat "\"" xemacs-codename "\"") "") - (concat " XEmacs " -;; (if (not (featurep 'infodock)) - " Lucid" -;; "")) - ) + " XEmacs Lucid" (if xemacs-betaname (concat " " xemacs-betaname) ""))) diff -r 090b52736db2 -r c42ec1d1cded lisp/x-init.el --- a/lisp/x-init.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/x-init.el Mon Aug 13 10:33:18 2007 +0200 @@ -366,4 +366,15 @@ (if (equal display "") (setq display nil)) (make-frame-on-device 'x display props)) +;; Character 160 (octal 0240) displays incorrectly under X apparently +;; due to a universally crocked font width specification. Display it +;; as a space since that's what seems to be expected. +;; +;; (make-vector 256 nil) instead of (make-display-table) because +;; make-display-table doesn't exist when this file is loaded. + +(let ((tab (make-vector 256 nil))) + (aset tab 160 " ") + (set-specifier current-display-table tab 'global 'x)) + ;;; x-init.el ends here diff -r 090b52736db2 -r c42ec1d1cded lisp/x-menubar.el --- a/lisp/x-menubar.el Mon Aug 13 10:32:23 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1488 +0,0 @@ -;;; x-menubar.el --- Menubar and popup-menu support for X. - -;; Copyright (C) 1991-1995, 1997-1998 Free Software Foundation, Inc. -;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. -;; Copyright (C) 1995 Sun Microsystems. -;; Copyright (C) 1995, 1996 Ben Wing. -;; Copyright (C) 1997 MORIOKA Tomohiko - -;; Maintainer: XEmacs Development Team -;; Keywords: extensions, internal, dumped - -;; 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 Xmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;; This file is dumped with XEmacs (when X11 and menubar support is compiled -;; in). - -;;; Code: - -;;; Warning-free compile -(eval-when-compile - (defvar language-environment-list) - (defvar bookmark-alist) - (defvar language-info-alist) - (defvar current-language-environment) - (defvar tutorial-supported-languages)) - -(defconst default-menubar - (purecopy-menubar - ;; note backquote. - `( - ("File" - ["Open..." find-file] - ["Open in Other Window..." find-file-other-window] - ["Open in New Frame..." find-file-other-frame] - ["Insert File..." insert-file] - ["View File..." view-file] - "------" - ["Save" save-buffer - :active (buffer-modified-p) - :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Save As..." write-file] - ["Save Some Buffers" save-some-buffers] - "-----" - ["Print Buffer" lpr-buffer - :active (fboundp 'lpr-buffer) - :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Pretty-Print Buffer" ps-print-buffer-with-faces - :active (fboundp 'ps-print-buffer-with-faces) - :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - "-----" - ["New Frame" make-frame] - ["Frame on Other Display..." make-frame-on-display] - ["Delete Frame" delete-frame - :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) - (selected-frame)))] - "-----" - ["Split Window" split-window-vertically] - ["Un-Split (Keep This)" delete-other-windows - :active (not (one-window-p t))] - ["Un-Split (Keep Others)" delete-window - :active (not (one-window-p t))] - "-----" - ["Revert Buffer" revert-buffer - :active (or buffer-file-name revert-buffer-function) - :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Delete Buffer" kill-this-buffer - :active t - :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - "-----" - ["Exit XEmacs" save-buffers-kill-emacs] - ) - - ("Edit" - ["Undo" advertised-undo - :active (and (not (eq buffer-undo-list t)) - (or buffer-undo-list pending-undo-list)) - :suffix (if (or (eq last-command 'undo) - (eq last-command 'advertised-undo)) - "More" "")] - ["Redo" redo - :included (fboundp 'redo) - :active (not (or (eq buffer-undo-list t) - (eq last-buffer-undo-list nil) - (not (or (eq last-buffer-undo-list buffer-undo-list) - (and (null (car-safe buffer-undo-list)) - (eq last-buffer-undo-list - (cdr-safe buffer-undo-list))))) - (or (eq buffer-undo-list pending-undo-list) - (eq (cdr buffer-undo-list) pending-undo-list)))) - :suffix (if (eq last-command 'redo) "More" "")] - ["Cut" kill-primary-selection - :active (selection-owner-p)] - ["Copy" copy-primary-selection - :active (selection-owner-p)] - ["Paste" yank-clipboard-selection - :active (selection-exists-p 'CLIPBOARD)] - ["Clear" delete-primary-selection - :active (selection-owner-p)] - "----" - ["Search..." isearch-forward] - ["Search Backward..." isearch-backward] - ["Replace..." query-replace] - "----" - ["Search (Regexp)..." isearch-forward-regexp] - ["Search Backward (Regexp)..." isearch-backward-regexp] - ["Replace (Regexp)..." query-replace-regexp] - "----" - ["Goto Line..." goto-line] - ["What Line" what-line] - ("Bookmarks" - :filter bookmark-menu-filter) - "----" - ["Start Macro Recording" start-kbd-macro - :active (not defining-kbd-macro)] - ["End Macro Recording" end-kbd-macro - :active defining-kbd-macro] - ["Execute Last Macro" call-last-kbd-macro - :active last-kbd-macro] - "----" - ["Show Message Log" show-message-log] - ) - - ,@(if (featurep 'mule) - '(("Mule" - ("Describe language support") - ("Set language environment") - "--" - ["Toggle input method" toggle-input-method] - ["Select input method" select-input-method] - ["Describe input method" describe-input-method] - "--" - ["Describe current coding systems" - describe-current-coding-system] - ["Set coding system of buffer file" - set-buffer-file-coding-system] - ;; not implemented yet - ["Set coding system of terminal" - set-terminal-coding-system :active nil] - ;; not implemented yet - ["Set coding system of keyboard" - set-keyboard-coding-system :active nil] - ;; not implemented yet - ["Set coding system of process" - set-current-process-coding-system :active nil] - "--" - ["Show character table" view-charset-by-menu] - ;; 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)] - ["Read Mail (MH)..." (mh-rmail t) - :active (fboundp 'mh-rmail)] - ["Send mail..." mail - :active (fboundp 'mail)] - ["Usenet News" gnus - :active (fboundp 'gnus)] - ["Browse the Web" w3 - :active (fboundp 'w3)] - ["Gopher" gopher - :active (fboundp 'gopher)] - "----" - ["Spell-Check Buffer" ispell-buffer - :active (fboundp 'ispell-buffer)] - ["Toggle VI emulation" toggle-viper-mode - :active (fboundp 'toggle-viper-mode)] - "----" - ("Calendar" - ["3-Month Calendar" calendar - :active (fboundp 'calendar)] - ["Diary" diary - :active (fboundp 'diary)] - ["Holidays" holidays - :active (fboundp 'holidays)] - ;; we're all pagans at heart ... - ["Phases of the Moon" phases-of-moon - :active (fboundp 'phases-of-moon)] - ["Sunrise/Sunset" sunrise-sunset - :active (fboundp 'sunrise-sunset)]) - - ("Games" - ["Mine Game" xmine - :active (fboundp 'xmine)] - ["Tetris" tetris - :active (fboundp 'tetris)] - ["Sokoban" sokoban - :active (fboundp 'sokoban)] - ["Quote from Zippy" yow - :active (fboundp 'yow)] - ["Psychoanalyst" doctor - :active (fboundp 'doctor)] - ["Psychoanalyze Zippy!" psychoanalyze-pinhead - :active (fboundp 'psychoanalyze-pinhead)] - ["Random Flames" flame - :active (fboundp 'flame)] - ["Dunnet (Adventure)" dunnet - :active (fboundp 'dunnet)] - ["Towers of Hanoi" hanoi - :active (fboundp 'hanoi)] - ["Game of Life" life - :active (fboundp 'life)] - ["Multiplication Puzzle" mpuz - :active (fboundp 'mpuz)])) - - ("Options" - ("Customize" - ("Emacs" :filter (lambda (&rest junk) - (cdr (custom-menu-create 'emacs)))) - ["Group..." customize-group] - ["Variable..." customize-variable] - ["Face..." customize-face] - ["Saved..." customize-saved] - ["Set..." customize-customized] - ["Apropos..." customize-apropos] - ["Browse..." customize-browse]) - ("Editing Options" - ["Overstrike" - (progn - (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual)) - (customize-set-variable 'overwrite-mode overwrite-mode)) - :style toggle :selected overwrite-mode] - ["Case Sensitive Search" - (customize-set-variable 'case-fold-search - (setq case-fold-search (not case-fold-search))) - :style toggle :selected (not case-fold-search)] - ["Case Matching Replace" - (customize-set-variable 'case-replace (not case-replace)) - :style toggle :selected case-replace] - ["Auto Delete Selection" - (customize-set-variable 'pending-delete-mode (not pending-delete-mode)) - :style toggle - :selected (and (boundp 'pending-delete-mode) pending-delete-mode) - :active (boundp 'pending-delete-mode)] - ["Active Regions" - (customize-set-variable 'zmacs-regions (not zmacs-regions)) - :style toggle :selected zmacs-regions] - ["Mouse Paste At Text Cursor" - (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point)) - :style toggle :selected mouse-yank-at-point] - ("Newline at end of file..." - ["Don't require" - (customize-set-variable 'require-final-newline nil) - :style radio :selected (not require-final-newline)] - ["Require" - (customize-set-variable 'require-final-newline t) - :style radio :selected (eq require-final-newline t)] - ["Ask" - (customize-set-variable 'require-final-newline 'ask) - :style radio :selected (and require-final-newline - (not (eq require-final-newline t)))]) - ["Add Newline When Moving Past End" - (customize-set-variable 'next-line-add-newlines - (not next-line-add-newlines)) - :style toggle :selected next-line-add-newlines] - ) - ("General Options" - ["Teach Extended Commands" - (customize-set-variable 'teach-extended-commands-p - (not teach-extended-commands-p)) - :style toggle :selected teach-extended-commands-p] - ["Debug On Error" - (customize-set-variable 'debug-on-error (not debug-on-error)) - :style toggle :selected debug-on-error] - ["Debug On Quit" - (customize-set-variable 'debug-on-quit (not debug-on-quit)) - :style toggle :selected debug-on-quit] - ) - ("Printing Options" - ["Command-Line Switches for `lpr'/`lp'..." - ;; better to directly open a customization buffer, since the value - ;; must be a list of strings, which is somewhat complex to prompt for. - (customize-variable 'lpr-switches) - (boundp 'lpr-switches)] - ("Pretty-Print Paper Size" - ["Letter" - (customize-set-variable 'ps-paper-type 'letter) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter)) - :active (boundp 'ps-paper-type)] - ["Letter-small" - (customize-set-variable 'ps-paper-type 'letter-small) - :style radio - :selected (and (boundp 'ps-paper-type) - (eq ps-paper-type 'letter-small)) - :active (boundp 'ps-paper-type)] - ["Legal" - (customize-set-variable 'ps-paper-type 'legal) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal)) - :active (boundp 'ps-paper-type)] - ["Statement" - (customize-set-variable 'ps-paper-type 'statement) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'statement)) - :active (boundp 'ps-paper-type)] - ["Executive" - (customize-set-variable 'ps-paper-type 'executive) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'executive)) - :active (boundp 'ps-paper-type)] - ["Tabloid" - (customize-set-variable 'ps-paper-type 'tabloid) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'tabloid)) - :active (boundp 'ps-paper-type)] - ["Ledger" - (customize-set-variable 'ps-paper-type 'ledger) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger)) - :active (boundp 'ps-paper-type)] - ["A3" - (customize-set-variable 'ps-paper-type 'a3) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3)) - :active (boundp 'ps-paper-type)] - ["A4" - (customize-set-variable 'ps-paper-type 'a4) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4)) - :active (boundp 'ps-paper-type)] - ["A4small" - (customize-set-variable 'ps-paper-type 'a4small) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small)) - :active (boundp 'ps-paper-type)] - ["B4" - (customize-set-variable 'ps-paper-type 'b4) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4)) - :active (boundp 'ps-paper-type)] - ["B5" - (customize-set-variable 'ps-paper-type 'b5) - :style radio - :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b5)) - :active (boundp 'ps-paper-type)] - ) - ["Color Printing" - (cond (ps-print-color-p - (customize-set-variable 'ps-print-color-p nil) - ;; I'm wondering whether all this muck is usefull. - (and (boundp 'original-face-background) - original-face-background - (set-face-background 'default original-face-background))) - (t - (customize-set-variable 'ps-print-color-p t) - (setq original-face-background - (face-background-instance 'default)) - (set-face-background 'default "white"))) - :style toggle - :selected (and (boundp 'ps-print-color-p) ps-print-color-p) - :active (boundp 'ps-print-color-p)]) - ("\"Other Window\" Location" - ["Always in Same Frame" - (customize-set-variable - 'get-frame-for-buffer-default-instance-limit nil) - :style radio - :selected (null get-frame-for-buffer-default-instance-limit)] - ["Other Frame (2 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 2) - :style radio - :selected (eq 2 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (3 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 3) - :style radio - :selected (eq 3 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (4 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 4) - :style radio - :selected (eq 4 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (5 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 5) - :style radio - :selected (eq 5 get-frame-for-buffer-default-instance-limit)] - ["Always Create New Frame" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 0) - :style radio - :selected (eq 0 get-frame-for-buffer-default-instance-limit)] - "-----" - ["Temp Buffers Always in Same Frame" - (customize-set-variable 'temp-buffer-show-function - 'show-temp-buffer-in-current-frame) - :style radio - :selected (eq temp-buffer-show-function - 'show-temp-buffer-in-current-frame)] - ["Temp Buffers Like Other Buffers" - (customize-set-variable 'temp-buffer-show-function nil) - :style radio - :selected (null temp-buffer-show-function)] - "-----" - ["Make current frame gnuserv target" - (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil t)) - :style toggle - :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t)) - :active (boundp 'gnuserv-frame)] - ) - "-----" - ("Syntax Highlighting" - ["In This Buffer" - (progn ;; becomes buffer local - (font-lock-mode) - (customize-set-variable 'font-lock-mode font-lock-mode)) - :style toggle - :selected (and (boundp 'font-lock-mode) font-lock-mode) - :active (boundp 'font-lock-mode)] - ["Automatic" - (customize-set-variable 'font-lock-auto-fontify - (not font-lock-auto-fontify)) - :style toggle - :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify) - :active (fboundp 'font-lock-mode)] - "-----" - ["Fonts" - (progn - (require 'font-lock) - (font-lock-use-default-fonts) - (customize-set-variable 'font-lock-use-fonts t) - (customize-set-variable 'font-lock-use-colors nil) - (font-lock-mode 1)) - :style radio - :selected (and (boundp 'font-lock-use-fonts) font-lock-use-fonts) - :active (fboundp 'font-lock-mode)] - ["Colors" - (progn - (require 'font-lock) - (font-lock-use-default-colors) - (customize-set-variable 'font-lock-use-colors t) - (customize-set-variable 'font-lock-use-fonts nil) - (font-lock-mode 1)) - :style radio - :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors) - :active (boundp 'font-lock-mode)] - "-----" - ["Least" - (progn - (require 'font-lock) - (if (or (and (not (integerp font-lock-maximum-decoration)) - (not (eq t font-lock-maximum-decoration))) - (and (integerp font-lock-maximum-decoration) - (<= font-lock-maximum-decoration 0))) - nil - (customize-set-variable 'font-lock-maximum-decoration nil) - (font-lock-recompute-variables))) - :style radio - :active (fboundp 'font-lock-mode) - :selected (and (boundp 'font-lock-maximium-decoration) - (or (and (not (integerp font-lock-maximum-decoration)) - (not (eq t font-lock-maximum-decoration))) - (and (integerp font-lock-maximum-decoration) - (<= font-lock-maximum-decoration 0))))] - ["More" - (progn - (require 'font-lock) - (if (and (integerp font-lock-maximum-decoration) - (= 1 font-lock-maximum-decoration)) - nil - (customize-set-variable 'font-lock-maximum-decoration 1) - (font-lock-recompute-variables))) - :style radio - :active (fboundp 'font-lock-mode) - :selected (and (boundp 'font-lock-maximium-decoration) - (integerp font-lock-maximum-decoration) - (= 1 font-lock-maximum-decoration))] - ["Even More" - (progn - (require 'font-lock) - (if (and (integerp font-lock-maximum-decoration) - (= 2 font-lock-maximum-decoration)) - nil - (customize-set-variable 'font-lock-maximum-decoration 2) - (font-lock-recompute-variables))) - :style radio - :active (fboundp 'font-lock-mode) - :selected (and (boundp 'font-lock-maximum-decoration) - (integerp font-lock-maximum-decoration) - (= 2 font-lock-maximum-decoration))] - ["Most" - (progn - (require 'font-lock) - (if (or (eq font-lock-maximum-decoration t) - (and (integerp font-lock-maximum-decoration) - (>= font-lock-maximum-decoration 3))) - nil - (customize-set-variable 'font-lock-maximum-decoration t) - (font-lock-recompute-variables))) - :style radio - :active (fboundp 'font-lock-mode) - :selected (and (boundp 'font-lock-maximum-decoration) - (or (eq font-lock-maximum-decoration t) - (and (integerp font-lock-maximum-decoration) - (>= font-lock-maximum-decoration 3))))] - "-----" - ["Lazy" - (progn ;; becomes buffer local - (lazy-shot-mode) - (customize-set-variable 'lazy-shot-mode lazy-shot-mode) - ;; this shouldn't be necessary so there has to - ;; be a redisplay bug lurking somewhere (or - ;; possibly another event handler bug) - (redraw-modeline)) - :active (and (boundp 'font-lock-mode) (boundp 'lazy-shot-mode) - font-lock-mode) - :style toggle - :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)] - ["Caching" - (progn ;; becomes buffer local - (fast-lock-mode) - (customize-set-variable 'fast-lock-mode fast-lock-mode) - ;; this shouldn't be necessary so there has to - ;; be a redisplay bug lurking somewhere (or - ;; possibly another event handler bug) - (redraw-modeline)) - :active (and (boundp 'font-lock-mode) (boundp 'fast-lock-mode) - font-lock-mode) - :style toggle - :selected (and (boundp 'fast-lock-mode) fast-lock-mode)] - ) - ("Paren Highlighting" - ["None" - (customize-set-variable 'paren-mode nil) - :style radio - :selected (and (boundp 'paren-mode) (not paren-mode)) - :active (boundp 'paren-mode)] - ["Blinking Paren" - (customize-set-variable 'paren-mode 'blink-paren) - :style radio - :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren)) - :active (boundp 'paren-mode)] - ["Steady Paren" - (customize-set-variable 'paren-mode 'paren) - :style radio - :selected (and (boundp 'paren-mode) (eq paren-mode 'paren)) - :active (boundp 'paren-mode)] - ["Expression" - (customize-set-variable 'paren-mode 'sexp) - :style radio - :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp)) - :active (boundp 'paren-mode)] -;; ["Nested Shading" -;; (customize-set-variable 'paren-mode 'nested) -;; :style radio -;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested)) -;; :active (boundp 'paren-mode)] - ) - "-----" - ("Frame Appearance" - ["Frame-Local Font Menu" - (customize-set-variable 'font-menu-this-frame-only-p - (not font-menu-this-frame-only-p)) - :style toggle - :selected (and (boundp 'font-menu-this-frame-only-p) - font-menu-this-frame-only-p)] - ,@(if (featurep 'scrollbar) - '(["Scrollbars" - (customize-set-variable 'scrollbars-visible-p - (not scrollbars-visible-p)) - :style toggle - :selected scrollbars-visible-p])) - ;; I don't think this is of any interest. - dverna apr. 98 -;; ["3D Modeline" -;; (progn -;; (if (zerop (specifier-instance modeline-shadow-thickness)) -;; (set-specifier modeline-shadow-thickness 2) -;; (set-specifier modeline-shadow-thickness 0)) -;; (redraw-modeline t)) -;; :style toggle -;; :selected (let ((thickness -;; (specifier-instance modeline-shadow-thickness))) -;; (and (integerp thickness) -;; (> thickness 0)))] - ["Truncate Lines" - (progn ;; becomes buffer-local - (setq truncate-lines (not truncate-lines)) - (customize-set-variable 'truncate-lines truncate-lines)) - :style toggle - :selected truncate-lines] - ["Blinking Cursor" - (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode)) - :style toggle - :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode) - :active (boundp 'blink-cursor-mode)] - "-----" - ["Block cursor" - (progn - (customize-set-variable 'bar-cursor nil) - (force-cursor-redisplay)) - :style radio - :selected (null bar-cursor)] - ["Bar cursor (1 pixel)" - (progn - (customize-set-variable 'bar-cursor t) - (force-cursor-redisplay)) - :style radio - :selected (eq bar-cursor t)] - ["Bar cursor (2 pixels)" - (progn - (customize-set-variable 'bar-cursor 2) - (force-cursor-redisplay)) - :style radio - :selected (and bar-cursor (not (eq bar-cursor t)))] - "------" - ["Line Numbers" - (progn - (customize-set-variable 'line-number-mode (not line-number-mode)) - (redraw-modeline)) - :style toggle :selected line-number-mode] - ["Column Numbers" - (progn - (customize-set-variable 'column-number-mode - (not column-number-mode)) - (redraw-modeline)) - :style toggle :selected column-number-mode] - ) - ("Menubar Appearance" - ["Buffers Menu Length..." - (customize-set-variable - 'buffers-menu-max-size - ;; would it be better to open a customization buffer ? - (let ((val - (read-number - "Enter number of buffers to display (or 0 for unlimited): "))) - (if (eq val 0) nil val)))] - ["Multi-Operation Buffers Sub-Menus" - (customize-set-variable 'complex-buffers-menu-p - (not complex-buffers-menu-p)) - :style toggle - :selected complex-buffers-menu-p] - ("Buffers Menu Sorting" - ["Most Recently Used" - (progn - (customize-set-variable 'buffers-menu-sort-function nil) - (customize-set-variable 'buffers-menu-grouping-function nil)) - :style radio - :selected (null buffers-menu-sort-function)] - ["Alphabetically" - (progn - (customize-set-variable 'buffers-menu-sort-function - 'sort-buffers-menu-alphabetically) - (customize-set-variable 'buffers-menu-grouping-function nil)) - :style radio - :selected (eq 'sort-buffers-menu-alphabetically - buffers-menu-sort-function)] - ["By Major Mode, Then Alphabetically" - (progn - (customize-set-variable - 'buffers-menu-sort-function - 'sort-buffers-menu-by-mode-then-alphabetically) - (customize-set-variable - 'buffers-menu-grouping-function - 'group-buffers-menu-by-mode-then-alphabetically)) - :style radio - :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically - buffers-menu-sort-function)]) - ["Submenus for Buffer Groups" - (customize-set-variable 'buffers-menu-submenus-for-groups-p - (not buffers-menu-submenus-for-groups-p)) - :style toggle - :selected buffers-menu-submenus-for-groups-p] - "---" - ["Ignore Scaled Fonts" - (customize-set-variable 'font-menu-ignore-scaled-fonts - (not font-menu-ignore-scaled-fonts)) - :style toggle - :selected (and (boundp 'font-menu-ignore-scaled-fonts) - font-menu-ignore-scaled-fonts)] - ) - ,@(if (featurep 'toolbar) - '(("Toolbar Appearance" - ["Visible" - (customize-set-variable 'toolbar-visible-p - (not toolbar-visible-p)) - :style toggle - :selected toolbar-visible-p] - ["Captioned" - (customize-set-variable 'toolbar-captioned-p - (not toolbar-captioned-p)) - :style toggle - :selected toolbar-captioned-p] - ("Default Location" - ["Top" - (customize-set-variable 'default-toolbar-position 'top) - :style radio - :selected (eq default-toolbar-position 'top)] - ["Bottom" - (customize-set-variable 'default-toolbar-position 'bottom) - :style radio - :selected (eq default-toolbar-position 'bottom)] - ["Left" - (customize-set-variable 'default-toolbar-position 'left) - :style radio - :selected (eq default-toolbar-position 'left)] - ["Right" - (customize-set-variable 'default-toolbar-position 'right) - :style radio - :selected (eq default-toolbar-position 'right)] - ) - ))) - ("Mouse" - ["Avoid Text..." - (customize-set-variable 'mouse-avoidance-mode - (if mouse-avoidance-mode nil 'banish)) - :style toggle - :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode) - :active (and (boundp 'mouse-avoidance-mode) - window-system (eq (device-type) 'x))] - ["strokes-mode" - (customize-set-variable 'strokes-mode (not strokes-mode)) - :style toggle - :selected (and (boundp 'strokes-mode) strokes-mode) - :active (and (boundp 'strokes-mode) - window-system (eq (device-type) 'x))] - ) - ("Open URLs With" - ["Emacs-W3" - (customize-set-variable 'browse-url-browser-function 'browse-url-w3) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-w3)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-w3) - (fboundp 'w3-fetch))] - ["Netscape" - (customize-set-variable 'browse-url-browser-function - 'browse-url-netscape) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-netscape)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-netscape))] - ["Mosaic" - (customize-set-variable 'browse-url-browser-function - 'browse-url-mosaic) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-mosaic)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-mosaic))] - ["Mosaic (CCI)" - (customize-set-variable 'browse-url-browser-function 'browse-url-cci) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-cci)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-cci))] - ["IXI Mosaic" - (customize-set-variable 'browse-url-browser-function - 'browse-url-iximosaic) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-iximosaic)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-iximosaic))] - ["Lynx (xterm)" - (customize-set-variable 'browse-url-browser-function - 'browse-url-lynx-xterm) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-lynx-xterm)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-lynx-xterm))] - ["Lynx (xemacs)" - (customize-set-variable 'browse-url-browser-function - 'browse-url-lynx-emacs) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-lynx-emacs)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-lynx-emacs))] - ["Grail" - (customize-set-variable 'browse-url-browser-function - 'browse-url-grail) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-grail)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-grail))] - ) - "-----" - ["Browse Faces..." (customize-face nil)] - ("Font" :filter font-menu-family-constructor) - ("Size" :filter font-menu-size-constructor) - ("Weight" :filter font-menu-weight-constructor) - "-----" - ["Save Options" customize-save-customized] - ) - - ("Buffers" - :filter buffers-menu-filter - ["Read Only" (toggle-read-only) - :style toggle :selected buffer-read-only] - ["List All Buffers" list-buffers] - "--" - ) - - ("Tools" - ["Grep..." grep - :active (fboundp 'grep)] - ["Compile..." compile - :active (fboundp 'compile)] - ["Shell" shell - :active (fboundp 'shell)] - ["Shell Command..." shell-command - :active (fboundp 'shell-command)] - ["Shell Command on Region..." shell-command-on-region - :active (and (fboundp 'shell-command-on-region) (region-exists-p))] - ["Debug (GDB)..." gdb - :active (fboundp 'gdb)] - ["Debug (DBX)..." dbx - :active (fboundp 'dbx)] - "-----" - ("Tags" - ["Find Tag..." find-tag] - ["Find Other Window..." find-tag-other-window] - ["Next Tag..." (find-tag nil)] - ["Next Other Window..." (find-tag-other-window nil)] - ["Next File" next-file] - "-----" - ["Tags Search..." tags-search] - ["Tags Replace..." tags-query-replace] - ["Continue Search/Replace" tags-loop-continue] - "-----" - ["Pop stack" pop-tag-mark] - ["Apropos..." tags-apropos] - "-----" - ["Set Tags Table File..." visit-tags-table] - )) - - nil ; the partition: menus after this are flushright - - ("Help" - ["About XEmacs..." about-xemacs] - ("Basics" - ["Installation" describe-installation - :active (boundp 'Installation-string)] - ;; Tutorials. - ,(if (featurep 'mule) - ;; Mule tutorials. - (let ((lang language-info-alist) - submenu tut) - (while lang - (and (setq tut (assq 'tutorial (car lang))) - (not (string= (caar lang) "ASCII")) - (setq - submenu - (cons - `[,(caar lang) (help-with-tutorial nil ,(cdr tut))] - submenu))) - (setq lang (cdr lang))) - (append `("Tutorials" - :filter tutorials-menu-filter - ["Default" help-with-tutorial t - ,(concat "(" current-language-environment ")")]) - submenu)) - ;; Non mule tutorials. - (let ((lang tutorial-supported-languages) - submenu) - (while lang - (setq submenu - (cons - `[,(caar lang) - (help-with-tutorial ,(format "TUTORIAL.%s" - (cadr (car lang))))] - submenu)) - (setq lang (cdr lang))) - (append '("Tutorials" - ["English" help-with-tutorial]) - submenu))) - ["News" view-emacs-news] - ["Packages" finder-by-keyword] - ["Splash" xemacs-splash-buffer]) - "-----" - ("XEmacs FAQ" - ["FAQ (local)" xemacs-local-faq] - ["FAQ via WWW" xemacs-www-faq (boundp 'browse-url-browser-function)] - ["Home Page" xemacs-www-page (boundp 'browse-url-browser-function)]) - ("Samples" - ["Sample .emacs" (find-file (expand-file-name "sample.emacs" - data-directory))] - ["Sample .Xdefaults" (find-file (expand-file-name "sample.Xdefaults" - data-directory))] - ["Sample enriched" (find-file (expand-file-name "enriched.doc" - data-directory))]) - "-----" - ("Lookup in Info" - ["Key Binding..." Info-goto-emacs-key-command-node] - ["Command..." Info-goto-emacs-command-node] - ["Function..." Info-elisp-ref] - ["Topic..." Info-query]) - ("Manuals" - ["Info" info] - ["Unix Manual..." manual-entry]) - ("Commands & Keys" - ["Mode" describe-mode] - ["Apropos..." hyper-apropos] - ["Apropos Docs..." apropos-documentation] - "-----" - ["Key..." describe-key] - ["Bindings" describe-bindings] - ["Mouse Bindings" describe-pointer] - ["Recent Keys" view-lossage] - "-----" - ["Function..." describe-function] - ["Variable..." describe-variable] - ["Locate Command..." where-is]) - "-----" - ["Recent Messages" view-lossage] - ("Misc" - ["No Warranty" describe-no-warranty] - ["XEmacs License" describe-copying] - ["The Latest Version" describe-distribution]) - ["Submit Bug Report" send-pr])))) - - -(defun maybe-add-init-button () - "Don't call this. -Adds `Load .emacs' button to menubar when starting up with -q." - ;; by Stig@hackvan.com - (cond - (init-file-user nil) - ((file-exists-p (cond - ((eq system-type 'ms-dos) - (concat "~" (user-login-name) "/_emacs")) - ((eq system-type 'vax-vms) - "sys$login:.emacs") - (t - (concat "~" (user-login-name) "/.emacs")))) - (add-menu-button nil - ["Load .emacs" - (progn (delete-menu-item '("Load .emacs")) - (load-user-init-file (user-login-name))) - ] - "Help")) - (t nil))) - -(add-hook 'before-init-hook 'maybe-add-init-button) - - -;;; The File menu - -(defvar put-buffer-names-in-file-menu t) - - -;;; The Bookmarks menu - -(defun bookmark-menu-filter (&rest ignore) - (let ((definedp (and (boundp 'bookmark-alist) - bookmark-alist - t))) - `(,(if definedp - '("Jump to Bookmark" - :filter (lambda (&rest junk) - (mapcar #'(lambda (bmk) - `[,bmk (bookmark-jump ',bmk)]) - (bookmark-all-names)))) - ["Jump to Bookmark" nil nil]) - ["Set bookmark" bookmark-set - :active (fboundp 'bookmark-set)] - "---" - ["Insert contents" bookmark-menu-insert - :active (fboundp 'bookmark-menu-insert)] - ["Insert location" bookmark-menu-locate - :active (fboundp 'bookmark-menu-locate)] - "---" - ["Rename bookmark" bookmark-menu-rename - :active (fboundp 'bookmark-menu-rename)] - ,(if definedp - '("Delete Bookmark" - :filter (lambda (&rest junk) - (mapcar #'(lambda (bmk) - `[,bmk (bookmark-delete ',bmk)]) - (bookmark-all-names)))) - ["Delete Bookmark" nil nil]) - ["Edit Bookmark List" bookmark-bmenu-list ,definedp] - "---" - ["Save bookmarks" bookmark-save ,definedp] - ["Save bookmarks as..." bookmark-write ,definedp] - ["Load a bookmark file" bookmark-load - :active (fboundp 'bookmark-load)]))) - -;;; The Buffers menu - -(defgroup buffers-menu nil - "Customization of `Buffers' menu." - :group 'menu) - -(defcustom buffers-menu-max-size 25 - "*Maximum number of entries which may appear on the \"Buffers\" menu. -If this is 10, then only the ten most-recently-selected buffers will be -shown. If this is nil, then all buffers will be shown. Setting this to -a large number or nil will slow down menu responsiveness." - :type '(choice (const :tag "Show all" nil) - (integer 10)) - :group 'buffers-menu) - -(defcustom complex-buffers-menu-p nil - "*If non-nil, the buffers menu will contain several commands. -Commands will be presented as submenus of each buffer line. If this -is false, then there will be only one command: select that buffer." - :type 'boolean - :group 'buffers-menu) - -(defcustom buffers-menu-submenus-for-groups-p nil - "*If non-nil, the buffers menu will contain one submenu per group of buffers. -The grouping function is specified in `buffers-menu-grouping-function'. -If this is an integer, do not build submenus if the number of buffers -is not larger than this value." - :type '(choice (const :tag "No Subgroups" nil) - (integer :tag "Max. submenus" 10) - (sexp :format "%t\n" :tag "Allow Subgroups" :value t)) - :group 'buffers-menu) - -(defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer - "*The function to call to select a buffer from the buffers menu. -`switch-to-buffer' is a good choice, as is `pop-to-buffer'." - :type '(radio (function-item switch-to-buffer) - (function-item pop-to-buffer) - (function :tag "Other")) - :group 'buffers-menu) - -(defcustom buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers - "*If non-nil, a function specifying the buffers to omit from the buffers menu. -This is passed a buffer and should return non-nil if the buffer should be -omitted. The default value `buffers-menu-omit-invisible-buffers' omits -buffers that are normally considered \"invisible\" (those whose name -begins with a space)." - :type '(choice (const :tag "None" nil) - function) - :group 'buffers-menu) - -(defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line - "*The function to call to return a string to represent a buffer in the -buffers menu. The function is passed a buffer and should return a string. -The default value `format-buffers-menu-line' just returns the name of -the buffer. Also check out `slow-format-buffers-menu-line' which -returns a whole bunch of info about a buffer." - :type 'function - :group 'buffers-menu) - -(defcustom buffers-menu-sort-function - 'sort-buffers-menu-by-mode-then-alphabetically - "*If non-nil, a function to sort the list of buffers in the buffers menu. -It will be passed two arguments (two buffers to compare) and should return -T if the first is \"less\" than the second. One possible value is -`sort-buffers-menu-alphabetically'; another is -`sort-buffers-menu-by-mode-then-alphabetically'." - :type '(choice (const :tag "None" nil) - function) - :group 'buffers-menu) - -(defcustom buffers-menu-grouping-function - 'group-buffers-menu-by-mode-then-alphabetically - "*If non-nil, a function to group buffers in the buffers menu together. -It will be passed two arguments, successive members of the sorted buffers -list after being passed through `buffers-menu-sort-function'. It should -return non-nil if the second buffer begins a new group. The return value -should be the name of the old group, which may be used in hierarchical -buffers menus. The last invocation of the function contains nil as the -second argument, so that the name of the last group can be determined. - -The sensible values of this function are dependent on the value specified -for `buffers-menu-sort-function'." - :type '(choice (const :tag "None" nil) - function) - :group 'buffers-menu) - -(defun buffers-menu-omit-invisible-buffers (buf) - "For use as a value of `buffers-menu-omit-function'. -Omits normally invisible buffers (those whose name begins with a space)." - (not (null (string-match "\\` " (buffer-name buf))))) - -(defun sort-buffers-menu-alphabetically (buf1 buf2) - "For use as a value of `buffers-menu-sort-function'. -Sorts the buffers in alphabetical order by name, but puts buffers beginning -with a star at the end of the list." - (let* ((nam1 (buffer-name buf1)) - (nam2 (buffer-name buf2)) - (star1p (not (null (string-match "\\`*" nam1)))) - (star2p (not (null (string-match "\\`*" nam2))))) - (if (not (eq star1p star2p)) - (not star1p) - (string-lessp nam1 nam2)))) - -(defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2) - "For use as a value of `buffers-menu-sort-function'. -Sorts first by major mode and then alphabetically by name, but puts buffers -beginning with a star at the end of the list." - (let* ((nam1 (buffer-name buf1)) - (nam2 (buffer-name buf2)) - (star1p (not (null (string-match "\\`*" nam1)))) - (star2p (not (null (string-match "\\`*" nam2)))) - (mode1 (symbol-value-in-buffer 'major-mode buf1)) - (mode2 (symbol-value-in-buffer 'major-mode buf2))) - (cond ((not (eq star1p star2p)) (not star1p)) - ((and star1p star2p (string-lessp nam1 nam2))) - ((string-lessp mode1 mode2) t) - ((string-lessp mode2 mode1) nil) - (t (string-lessp nam1 nam2))))) - -;; this version is too slow on some machines. -(defun slow-format-buffers-menu-line (buffer) - "For use as a value of `buffers-menu-format-buffer-line-function'. -This returns a string containing a bunch of info about the buffer." - (format "%s%s %-19s %6s %-15s %s" - (if (buffer-modified-p buffer) "*" " ") - (if (symbol-value-in-buffer 'buffer-read-only buffer) "%" " ") - (buffer-name buffer) - (buffer-size buffer) - (symbol-value-in-buffer 'mode-name buffer) - (or (buffer-file-name buffer) ""))) - -(defun format-buffers-menu-line (buffer) - "For use as a value of `buffers-menu-format-buffer-line-function'. -This just returns the buffer's name." - (buffer-name buffer)) - -(defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2) - "For use as a value of `buffers-menu-grouping-function'. -This groups buffers by major mode. It only really makes sense if -`buffers-menu-sorting-function' is -`sort-buffers-menu-by-mode-then-alphabetically'." - (cond ((string-match "\\`*" (buffer-name buf1)) - (and (null buf2) "*Misc*")) - ((or (null buf2) - (string-match "\\`*" (buffer-name buf2)) - (not (eq (symbol-value-in-buffer 'major-mode buf1) - (symbol-value-in-buffer 'major-mode buf2)))) - (symbol-value-in-buffer 'mode-name buf1)) - (t nil))) - -(defun buffer-menu-save-buffer (buffer) - (save-excursion - (set-buffer buffer) - (save-buffer))) - -(defun buffer-menu-write-file (buffer) - (save-excursion - (set-buffer buffer) - (write-file (read-file-name - (format "Write %s to file: " - (buffer-name (current-buffer))))))) - -(defsubst build-buffers-menu-internal (buffers) - (let (name line) - (mapcar - #'(lambda (buffer) - (if (eq buffer t) - "---" - (setq line (funcall buffers-menu-format-buffer-line-function - buffer)) - (if complex-buffers-menu-p - (delq nil - (list line - (vector "Switch to Buffer" - (list buffers-menu-switch-to-buffer-function - (setq name (buffer-name buffer))) - t) - (if (eq buffers-menu-switch-to-buffer-function - 'switch-to-buffer) - (vector "Switch to Buffer, Other Frame" - (list 'switch-to-buffer-other-frame - (setq name (buffer-name buffer))) - t) - nil) - (if (and (buffer-modified-p buffer) - (buffer-file-name buffer)) - (vector "Save Buffer" - (list 'buffer-menu-save-buffer name) t) - ["Save Buffer" nil nil] - ) - (vector "Save As..." - (list 'buffer-menu-write-file name) t) - (vector "Delete Buffer" (list 'kill-buffer name) - t))) - ;; ### We don't want buffer names to be translated, - ;; ### so we put the buffer name in the suffix. - ;; ### Also, avoid losing with non-ASCII buffer names. - ;; ### We still lose, however, if complex-buffers-menu-p. --mrb - (vector "" - (list buffers-menu-switch-to-buffer-function - (buffer-name buffer)) - t line)))) - buffers))) - -(defun buffers-menu-filter (menu) - "This is the menu filter for the top-level buffers \"Buffers\" menu. -It dynamically creates a list of buffers to use as the contents of the menu. -Only the most-recently-used few buffers will be listed on the menu, for -efficiency reasons. You can control how many buffers will be shown by -setting `buffers-menu-max-size'. You can control the text of the menu -items by redefining the function `format-buffers-menu-line'." - (let ((buffers (delete-if buffers-menu-omit-function (buffer-list)))) - (and (integerp buffers-menu-max-size) - (> buffers-menu-max-size 1) - (> (length buffers) buffers-menu-max-size) - ;; shorten list of buffers (not with submenus!) - (not (and buffers-menu-grouping-function - buffers-menu-submenus-for-groups-p)) - (setcdr (nthcdr buffers-menu-max-size buffers) nil)) - (if buffers-menu-sort-function - (setq buffers (sort buffers buffers-menu-sort-function))) - (if (and buffers-menu-grouping-function - buffers-menu-submenus-for-groups-p - (or (not (integerp buffers-menu-submenus-for-groups-p)) - (> (length buffers) buffers-menu-submenus-for-groups-p))) - (let (groups groupnames current-group) - (mapl - #'(lambda (sublist) - (let ((groupname (funcall buffers-menu-grouping-function - (car sublist) (cadr sublist)))) - (setq current-group (cons (car sublist) current-group)) - (if groupname - (progn - (setq groups (cons (nreverse current-group) - groups)) - (setq groupnames (cons groupname groupnames)) - (setq current-group nil))))) - buffers) - (setq buffers - (mapcar* - #'(lambda (groupname group) - (cons groupname (build-buffers-menu-internal group))) - (nreverse groupnames) - (nreverse groups)))) - (if buffers-menu-grouping-function - (progn - (setq buffers - (mapcon - #'(lambda (sublist) - (cond ((funcall buffers-menu-grouping-function - (car sublist) (cadr sublist)) - (list (car sublist) t)) - (t (list (car sublist))))) - buffers)) - ;; remove a trailing separator. - (and (>= (length buffers) 2) - (let ((lastcdr (nthcdr (- (length buffers) 2) buffers))) - (if (eq t (cadr lastcdr)) - (setcdr lastcdr nil)))))) - (setq buffers (build-buffers-menu-internal buffers))) - (append menu buffers) - )) - -(defun language-environment-menu-filter (menu) - "This is the menu filter for the \"Language Environment\" submenu." - (mapcar (lambda (env-sym) - `[ ,(capitalize (symbol-name env-sym)) - (set-language-environment ',env-sym)]) - language-environment-list)) - - -;;; The Options menu - -;; We'll keep those variables here for a while, in order to provide a -;; function for porting the old options file that a user may own to Custom. - -(defvar options-save-faces nil - "*Non-nil value means save-options will save information about faces. -A nil value means save-options will not save face information. -Set this non-nil only if you use M-x edit-faces to change face -settings. If you use M-x customize-face or the \"Browse Faces...\" -menu entry, you will see a button in the Customize Face buffer that you -can use to permanently save your face changes. - -M-x edit-faces is deprecated. Support for it and this variable will -be discontinued in a future release.") - -(defvar save-options-init-file nil - "File into which to save forms to load the options file (nil for .emacs). -Normally this is nil, which means save into your .emacs file (the value -of `user-init-file'.") - -(defvar save-options-file ".xemacs-options" - "File to save options into. -This file is loaded from your .emacs file. -If this is a relative filename, it is put into the same directory as your -.emacs file.") - - - -;;; The Help menu - -(if (featurep 'mule) - (defun tutorials-menu-filter (menu-items) - ;; If there's a tutorial for the current language environment, make it - ;; 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 - (assoc current-language-environment language-info-alist)) - current-language-environment - "English") - ")")) - menu))) - - -(set-menubar default-menubar) - - -;;; Popup menus. - -(defconst default-popup-menu - '("XEmacs Commands" - ["Undo" advertised-undo - :active (and (not (eq buffer-undo-list t)) - (or buffer-undo-list pending-undo-list)) - :suffix (if (or (eq last-command 'undo) - (eq last-command 'advertised-undo)) - "More" "")] - ["Cut" x-kill-primary-selection - :active (and (eq 'x (device-type (selected-device))) - (x-selection-owner-p))] - ["Copy" x-copy-primary-selection - :active (and (eq 'x (device-type (selected-device))) - (x-selection-owner-p))] - ["Paste" x-yank-clipboard-selection - :active (and (eq 'x (device-type (selected-device))) - (x-selection-exists-p 'CLIPBOARD))] - ["Clear" x-delete-primary-selection - :active (and (eq 'x (device-type (selected-device))) - (x-selection-owner-p))] - "-----" - ["Select Block" mark-paragraph] - ["Split Window" (split-window)] - ["Unsplit Window" delete-other-windows] - )) - -(defvar global-popup-menu nil - "The global popup menu. This is present in all modes. -See the function `popup-menu' for a description of menu syntax.") - -(defvar mode-popup-menu nil - "The mode-specific popup menu. Automatically buffer local. -This is appended to the default items in `global-popup-menu'. -See the function `popup-menu' for a description of menu syntax.") -(make-variable-buffer-local 'mode-popup-menu) - -;; In an effort to avoid massive menu clutter, this mostly worthless menu is -;; superceded by any local popup menu... -(setq-default mode-popup-menu default-popup-menu) - -(defvar activate-popup-menu-hook nil - "Function or functions run before a mode-specific popup menu is made visible. -These functions are called with no arguments, and should interrogate and -modify the value of `global-popup-menu' or `mode-popup-menu' as desired. -Note: this hook is only run if you use `popup-mode-menu' for activating the -global and mode-specific commands; if you have your own binding for button3, -this hook won't be run.") - -(defun popup-mode-menu () - "Pop up a menu of global and mode-specific commands. -The menu is computed by combining `global-popup-menu' and `mode-popup-menu'." - (interactive "@_") - (run-hooks 'activate-popup-menu-hook) - (popup-menu - (cond ((and global-popup-menu mode-popup-menu) - (check-menu-syntax mode-popup-menu) - (let* ((title (car mode-popup-menu)) - (items (cdr mode-popup-menu)) - filters) - ;; Strip keywords from local menu for attaching them at the top - (while (and items - (symbolp (car items))) - (setq items (append filters (list (car items)))) - (setq items (cdr items))) - ;; If filters contains a keyword already present in - ;; `global-popup-menu' you will probably lose. - (append (list (car global-popup-menu)) - filters - (cdr global-popup-menu) - '("---" "---") - (if popup-menu-titles (list title)) - (if popup-menu-titles '("---" "---")) - items))) - (t - (or mode-popup-menu - global-popup-menu - (error "No menu here.")))))) - -(defun popup-buffer-menu (event) - "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked." - (interactive "e") - (let ((window (and (event-over-text-area-p event) (event-window event))) - (bmenu nil)) - (or window - (error "Pointer must be in a normal window")) - (select-window window) - (if current-menubar - (setq bmenu (assoc "Buffers" current-menubar))) - (if (null bmenu) - (setq bmenu (assoc "Buffers" default-menubar))) - (if (null bmenu) - (error "Can't find the Buffers menu")) - (popup-menu bmenu))) - -(defun popup-menubar-menu (event) - "Pop up a copy of menu that also appears in the menubar" - ;; by Stig@hackvan.com - (interactive "e") - (let ((window (and (event-over-text-area-p event) (event-window event))) - popup-menubar) - (or window - (error "Pointer must be in a normal window")) - (select-window window) - (and current-menubar (run-hooks 'activate-menubar-hook)) - ;; ##### Instead of having to copy this just to safely get rid of - ;; any nil what we should really do is fix up the internal menubar - ;; code to just ignore nil if generating a popup menu - (setq popup-menubar (delete nil (copy-sequence (or current-menubar - default-menubar)))) - (popup-menu (cons "Menubar Menu" popup-menubar)) - )) - -(global-set-key 'button3 'popup-mode-menu) -;; shift button3 and shift button2 are reserved for Hyperbole -(global-set-key '(meta control button3) 'popup-buffer-menu) -;; The following command is way too dangerous with Custom. -;; (global-set-key '(meta shift button3) 'popup-menubar-menu) - -;; Here's a test of the cool new menu features (from Stig). - -;;(setq mode-popup-menu -;; '("Test Popup Menu" -;; :filter cdr -;; ["this item won't appear because of the menu filter" ding t] -;; "--:singleLine" -;; "singleLine" -;; "--:doubleLine" -;; "doubleLine" -;; "--:singleDashedLine" -;; "singleDashedLine" -;; "--:doubleDashedLine" -;; "doubleDashedLine" -;; "--:noLine" -;; "noLine" -;; "--:shadowEtchedIn" -;; "shadowEtchedIn" -;; "--:shadowEtchedOut" -;; "shadowEtchedOut" -;; "--:shadowDoubleEtchedIn" -;; "shadowDoubleEtchedIn" -;; "--:shadowDoubleEtchedOut" -;; "shadowDoubleEtchedOut" -;; "--:shadowEtchedInDash" -;; "shadowEtchedInDash" -;; "--:shadowEtchedOutDash" -;; "shadowEtchedOutDash" -;; "--:shadowDoubleEtchedInDash" -;; "shadowDoubleEtchedInDash" -;; "--:shadowDoubleEtchedOutDash" -;; "shadowDoubleEtchedOutDash" -;; )) - -(defun xemacs-splash-buffer () - "Redisplay XEmacs splash screen in a buffer." - (interactive) - (let ((buffer (get-buffer-create "*Splash*"))) - (set-buffer buffer) - (erase-buffer buffer) - (startup-splash-frame) - (pop-to-buffer buffer) - (delete-other-windows))) - - -(provide 'x-menubar) - -;;; x-menubar.el ends here. diff -r 090b52736db2 -r c42ec1d1cded lisp/x-misc.el --- a/lisp/x-misc.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/x-misc.el Mon Aug 13 10:33:18 2007 +0200 @@ -77,7 +77,6 @@ (x-bogosity-check-resource name class type) (x-get-resource name class type locale nil t)) -;; #### this function is not necessary. (defun x-get-resource-and-maybe-bogosity-check (name class type &optional locale) (if (eq locale 'global) diff -r 090b52736db2 -r c42ec1d1cded lisp/x-scrollbar.el --- a/lisp/x-scrollbar.el Mon Aug 13 10:32:23 2007 +0200 +++ b/lisp/x-scrollbar.el Mon Aug 13 10:33:18 2007 +0200 @@ -75,6 +75,30 @@ (if (featurep 'athena-scrollbars) (x-init-specifier-from-resources (specifier-fallback scrollbar-height) 'natnum locale - '("scrollbar.height" . "ScrollBar.Height")))) + '("scrollbar.height" . "ScrollBar.Height"))) + + ;; Now do ScrollBarPlacement.scrollBarPlacement + (let ((case-fold-search t) + (resval (x-get-resource-and-maybe-bogosity-check + "ScrollBarPlacement" "scrollBarPlacement" 'string locale))) + (cond + ((null resval)) + ((string-match "^top_left$" resval) + (set-specifier scrollbar-on-top-p t locale) + (set-specifier scrollbar-on-left-p t locale)) + ((string-match "^top_right$" resval) + (set-specifier scrollbar-on-top-p t locale) + (set-specifier scrollbar-on-left-p nil locale)) + ((string-match "^bottom_left$" resval) + (set-specifier scrollbar-on-top-p nil locale) + (set-specifier scrollbar-on-left-p t locale)) + ((string-match "^bottom_right$" resval) + (set-specifier scrollbar-on-top-p nil locale) + (set-specifier scrollbar-on-left-p nil locale)) + (t + (display-warning 'resource + (format "Illegal value '%s' for scrollBarPlacement resource" resval))))) + +) ;;; x-scrollbar.el ends here diff -r 090b52736db2 -r c42ec1d1cded lisp/x-toolbar.el --- a/lisp/x-toolbar.el Mon Aug 13 10:32:23 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,586 +0,0 @@ -;;; x-toolbar.el -- Runtime initialization of XEmacs toolbar - -;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 1994 Andy Piper -;; Copyright (C) 1995 Board of Trustees, University of Illinois -;; Copyright (C) 1996 Ben Wing - -;; Maintainer: XEmacs development team -;; Keywords: frames, dumped - -;; 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: Not in FSF - -;;; Commentary: - -;; This file is dumped with XEmacs (when X and toolbar support is compiled in). - -;; Miscellaneous toolbar functions, useful for users to redefine, in -;; order to get different behaviour. - -;;; Code: - -;; Suppress warning message from bytecompiler -(eval-when-compile - (defvar pending-delete-mode)) - -(defgroup toolbar nil - "Configure XEmacs Toolbar functions and properties" - :group 'environment) - - -(defun toolbar-not-configured () - (interactive) - ;; Note: we don't use `susbtitute-command-keys' here, because - ;; Customize is bound to `C-h C' by default, and that binding is not - ;; familiar to people. This is more descriptive. - (error - "Configure the item via `M-x customize RET toolbar RET'")) - -(defcustom toolbar-open-function 'find-file - "*Function to call when the open icon is selected." - :type '(radio (function-item find-file) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-open () - (interactive) - (call-interactively toolbar-open-function)) - -(defcustom toolbar-dired-function 'dired - "*Function to call when the dired icon is selected." - :type '(radio (function-item dired) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-dired () - (interactive) - (call-interactively toolbar-dired-function)) - -(defcustom toolbar-save-function 'save-buffer - "*Function to call when the save icon is selected." - :type '(radio (function-item save-buffer) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-save () - (interactive) - (call-interactively toolbar-save-function)) - -(defcustom toolbar-print-function 'lpr-buffer - "*Function to call when the print icon is selected." - :type '(radio (function-item lpr-buffer) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-print () - (interactive) - (call-interactively toolbar-print-function)) - -(defcustom toolbar-cut-function 'kill-primary-selection - "*Function to call when the cut icon is selected." - :type '(radio (function-item kill-primary-selection) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-cut () - (interactive) - (call-interactively toolbar-cut-function)) - -(defcustom toolbar-copy-function 'copy-primary-selection - "*Function to call when the copy icon is selected." - :type '(radio (function-item copy-primary-selection) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-copy () - (interactive) - (call-interactively toolbar-copy-function)) - -(defcustom toolbar-paste-function 'yank-clipboard-selection - "*Function to call when the paste icon is selected." - :type '(radio (function-item yank-clipboard-selection) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-paste () - (interactive) - ;; This horrible kludge is for pending-delete to work correctly. - (and (boundp 'pending-delete-mode) - pending-delete-mode - (let ((this-command toolbar-paste-function)) - (pending-delete-pre-hook))) - (call-interactively toolbar-paste-function)) - -(defcustom toolbar-undo-function 'undo - "*Function to call when the undo icon is selected." - :type '(radio (function-item undo) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-undo () - (interactive) - (call-interactively toolbar-undo-function)) - -(defcustom toolbar-replace-function 'query-replace - "*Function to call when the replace icon is selected." - :type '(radio (function-item query-replace) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-replace () - (interactive) - (call-interactively toolbar-replace-function)) - -;; -;; toolbar ispell variables and defuns -;; - -(defun toolbar-ispell-internal () - (interactive) - (cond - ((region-active-p) (ispell-region (region-beginning) (region-end))) - ((eq major-mode 'mail-mode) (ispell-message)) - ((eq major-mode 'message-mode) (ispell-message)) - (t (ispell-buffer)))) - -(defcustom toolbar-ispell-function 'toolbar-ispell-internal - "*Function to call when the ispell icon is selected." - :type '(radio (function-item toolbar-ispell-internal) - (function :tag "Other")) - :group 'toolbar) - -(defun toolbar-ispell () - "Intelligently spell the region or buffer." - (interactive) - (call-interactively toolbar-ispell-function)) - -;; -;; toolbar mail variables and defuns -;; - -;; This used to be a macro that expanded its arguments to a form that -;; called `call-process'. With the advent of customize, it's better -;; to have it as a defun, to make customization easier. -(defun toolbar-external (process &rest args) - (interactive) - (apply 'call-process process nil 0 nil args)) - -(defcustom toolbar-mail-commands-alist - `((not-configured . toolbar-not-configured) - (vm . vm) - (gnus . gnus-no-server) - (rmail . rmail) - (mh . mh-rmail) - (pine . (toolbar-external "xterm" "-e" "pine")) ; *gag* - (elm . (toolbar-external "xterm" "-e" "elm")) - (mutt . (toolbar-external "xterm" "-e" "mutt")) - (exmh . (toolbar-external "exmh")) - (netscape . (toolbar-external "netscape" "mailbox:")) - (send . mail)) - "*Alist of mail readers and their commands. -The car of each alist element is the mail reader, and the cdr is the form -used to start it." - :type '(repeat (cons :format "%v" - (symbol :tag "Mailer") (function :tag "Start with"))) - :group 'toolbar) - -(defcustom toolbar-mail-reader 'not-configured - "*Mail reader toolbar will invoke. -The legal values are the keys from `toolbar-mail-command-alist', which - should be used to add new mail readers. -Mail readers known by default are vm, gnus, rmail, mh, pine, elm, - mutt, exmh, netscape and send." - :type '(choice (const :tag "Not Configured" not-configured) - (const vm) (const gnus) (const rmail) (const mh) - (const pine) (const elm) (const mutt) (const exmh) - (const netscape) - (const send) - (symbol :tag "Other" - :validate (lambda (wid) - (if (assq (widget-value wid) - toolbar-mail-commands-alist) - nil - (widget-put wid :error - "Unknown mail reader") - wid)))) - :group 'toolbar) - - -(defun toolbar-mail () - "Run mail in a separate frame." - (interactive) - (let ((command (cdr (assq toolbar-mail-reader toolbar-mail-commands-alist)))) - (or command - (error "Uknown mail reader %s" toolbar-mail-reader)) - (if (symbolp command) - (call-interactively command) - (eval command)))) - -;; -;; toolbar info variables and defuns -;; - -(defcustom toolbar-info-use-separate-frame t - "*Whether Info is invoked in a separate frame." - :type 'boolean - :group 'toolbar) - -(defcustom toolbar-info-frame-plist - ;; Info pages are 80 characters wide, so it makes a good default. - `(width 80 ,@(let ((h (plist-get default-frame-plist 'height))) - (and h `(height ,h)))) - "*The properties of the frame in which news is displayed." - :type 'plist - :group 'info) - -(define-obsolete-variable-alias 'Info-frame-plist - 'toolbar-info-frame-plist) - -(defvar toolbar-info-frame nil - "The frame in which info is displayed.") - -(defun toolbar-info () - "Run info in a separate frame." - (interactive) - (when toolbar-info-use-separate-frame - (cond ((or (not toolbar-info-frame) - (not (frame-live-p toolbar-info-frame))) - ;; We used to raise frame here, but it's a bad idea, - ;; because raising is a matter of WM policy. However, we - ;; *must* select it, to ensure that the info buffer goes to - ;; the right frame. - (setq toolbar-info-frame (make-frame toolbar-info-frame-plist)) - (select-frame toolbar-info-frame)) - (t - ;; However, if the frame already exists, and the user - ;; clicks on info, it's OK to raise it. - (select-frame toolbar-info-frame) - (raise-frame toolbar-info-frame))) - (when (frame-iconified-p toolbar-info-frame) - (deiconify-frame toolbar-info-frame))) - (info)) - -;; -;; toolbar debug variables and defuns -;; - -(defun toolbar-debug () - (interactive) - (if (featurep 'eos-debugger) - (call-interactively 'eos::start-debugger) - (require 'gdbsrc) - (call-interactively 'gdbsrc))) - -(defvar compile-command) -(defvar toolbar-compile-already-run nil) - -(defun toolbar-compile () - "Run compile without having to touch the keyboard." - (interactive) - (require 'compile) - (if toolbar-compile-already-run - (compile compile-command) - (setq toolbar-compile-already-run t) - (popup-dialog-box - `(,(concat "Compile:\n " compile-command) - ["Compile" (compile compile-command) t] - ["Edit command" compile t] - nil - ["Cancel" (message "Quit") t])))) - -;; -;; toolbar news variables and defuns -;; - -(defcustom toolbar-news-commands-alist - `((not-configured . toolbar-not-configured) - (gnus . toolbar-gnus) ; M-x all-hail-gnus - (rn . (toolbar-external "xterm" "-e" "rn")) - (nn . (toolbar-external "xterm" "-e" "nn")) - (trn . (toolbar-external "xterm" "-e" "trn")) - (xrn . (toolbar-external "xrn")) - (slrn . (toolbar-external "xterm" "-e" "slrn")) - (pine . (toolbar-external "xterm" "-e" "pine")) ; *gag* - (tin . (toolbar-external "xterm" "-e" "tin")) ; *gag* - (netscape . (toolbar-external "netscape" "news:"))) - "*Alist of news readers and their commands. -The car of each alist element the pair is the news reader, and the cdr -is the form used to start it." - :type '(repeat (cons :format "%v" - (symbol :tag "Reader") (sexp :tag "Start with"))) - :group 'toolbar) - -(defcustom toolbar-news-reader 'not-configured - "*News reader toolbar will invoke. -The legal values are the keys from `toolbar-news-command-alist', which should - be used to add new news readers. -Newsreaders known by default are gnus, rn, nn, trn, xrn, slrn, pine - and netscape." - :type '(choice (const :tag "Not Configured" not-configured) - (const gnus) (const rn) (const nn) (const trn) - (const xrn) (const slrn) (const pine) (const tin) - (const netscape) - (symbol :tag "Other" - :validate (lambda (wid) - (if (assq (widget-value wid) - toolbar-news-commands-alist) - nil - (widget-put wid :error - "Unknown news reader") - wid)))) - :group 'toolbar) - -(defcustom toolbar-news-use-separate-frame t - "*Whether Gnus is invoked in a separate frame." - :type 'boolean - :group 'toolbar) - -(defvar toolbar-news-frame nil - "The frame in which news is displayed.") - -(defcustom toolbar-news-frame-plist nil - "*The properties of the frame in which news is displayed." - :type 'plist - :group 'toolbar) - -(define-obsolete-variable-alias 'toolbar-news-frame-properties - 'toolbar-news-frame-plist) - -(defun toolbar-gnus () - "Run Gnus in a separate frame." - (interactive) - (if (not toolbar-news-use-separate-frame) - (gnus) - (unless (frame-live-p toolbar-news-frame) - (setq toolbar-news-frame (make-frame toolbar-news-frame-properties)) - (add-hook 'gnus-exit-gnus-hook - (lambda () - (when (frame-live-p toolbar-news-frame) - (if (cdr (frame-list)) - (delete-frame toolbar-news-frame)) - (setq toolbar-news-frame nil)))) - (select-frame toolbar-news-frame) - (gnus)) - (when (framep toolbar-news-frame) - (when (frame-iconified-p toolbar-news-frame) - (deiconify-frame toolbar-news-frame)) - (select-frame toolbar-news-frame) - (raise-frame toolbar-news-frame)))) - -(defun toolbar-news () - "Run News." - (interactive) - (let ((command (cdr-safe - (assq toolbar-news-reader toolbar-news-commands-alist)))) - (or command - (error "Unkown news reader %s" toolbar-news-reader)) - (if (symbolp command) - (call-interactively command) - (eval command)))) - -(defvar toolbar-last-win-icon nil "A `last-win' icon set.") -(defvar toolbar-next-win-icon nil "A `next-win' icon set.") -(defvar toolbar-file-icon nil "A `file' icon set.") -(defvar toolbar-folder-icon nil "A `folder' icon set") -(defvar toolbar-disk-icon nil "A `disk' icon set.") -(defvar toolbar-printer-icon nil "A `printer' icon set.") -(defvar toolbar-cut-icon nil "A `cut' icon set.") -(defvar toolbar-copy-icon nil "A `copy' icon set.") -(defvar toolbar-paste-icon nil "A `paste' icon set.") -(defvar toolbar-undo-icon nil "An `undo' icon set.") -(defvar toolbar-spell-icon nil "A `spell' icon set.") -(defvar toolbar-replace-icon nil "A `replace' icon set.") -(defvar toolbar-mail-icon nil "A `mail' icon set.") -(defvar toolbar-info-icon nil "An `info' icon set.") -(defvar toolbar-compile-icon nil "A `compile' icon set.") -(defvar toolbar-debug-icon nil "A `debugger' icon set.") -(defvar toolbar-news-icon nil "A `news' icon set.") - -;;; each entry maps a variable to the prefix used. - -(defvar init-x-toolbar-list - '((toolbar-last-win-icon . "last-win") - (toolbar-next-win-icon . "next-win") - (toolbar-file-icon . "file") - (toolbar-folder-icon . "folder") - (toolbar-disk-icon . "disk") - (toolbar-printer-icon . "printer") - (toolbar-cut-icon . "cut") - (toolbar-copy-icon . "copy") - (toolbar-paste-icon . "paste") - (toolbar-undo-icon . "undo") - (toolbar-spell-icon . "spell") - (toolbar-replace-icon . "replace") - (toolbar-mail-icon . "mail") - (toolbar-info-icon . "info-def") - (toolbar-compile-icon . "compile") - (toolbar-debug-icon . "debug") - (toolbar-news-icon . "news"))) - -(defun init-x-toolbar () - (toolbar-add-item-data init-x-toolbar-list ) - ;; do this now because errors will occur if the icon symbols - ;; are not initted - (set-specifier default-toolbar initial-toolbar-spec)) - -(defun toolbar-add-item-data ( icon-list &optional icon-dir ) - (if (eq icon-dir nil) - (setq icon-dir toolbar-icon-directory)) - (mapcar - (lambda (cons) - (let ((prefix (expand-file-name (cdr cons) icon-dir))) - (set (car cons) - (if (featurep 'xpm) - (toolbar-make-button-list - (concat prefix "-up.xpm") - nil - (concat prefix "-xx.xpm") - (concat prefix "-cap-up.xpm") - nil - (concat prefix "-cap-xx.xpm")) - (toolbar-make-button-list - (concat prefix "-up.xbm") - (concat prefix "-dn.xbm") - (concat prefix "-xx.xbm") - ))))) - icon-list ) - ) - -(defvar toolbar-vector-open - [toolbar-file-icon toolbar-open t "Open a file"] - "Define the vector for the \"Open\" toolbar button") - -(defvar toolbar-vector-dired - [toolbar-folder-icon toolbar-dired t "View directory"] - "Define the vector for the \"Dired\" toolbar button") - -(defvar toolbar-vector-save - [toolbar-disk-icon toolbar-save t "Save buffer"] - "Define the vector for the \"Save\" toolbar button") - -(defvar toolbar-vector-print - [toolbar-printer-icon toolbar-print t "Print buffer"] - "Define the vector for the \"Printer\" toolbar button") - -(defvar toolbar-vector-cut - [toolbar-cut-icon toolbar-cut t "Kill region"] - "Define the vector for the \"Cut\" toolbar button") - -(defvar toolbar-vector-copy - [toolbar-copy-icon toolbar-copy t "Copy region"] - "Define the vector for the \"Copy\" toolbar button") - -(defvar toolbar-vector-paste - [toolbar-paste-icon toolbar-paste t "Paste from clipboard"] - "Define the vector for the \"Paste\" toolbar button") - -(defvar toolbar-vector-undo - [toolbar-undo-icon toolbar-undo t "Undo edit"] - "Define the vector for the \"Undo\" toolbar button") - -(defvar toolbar-vector-spell - [toolbar-spell-icon toolbar-ispell t "Spellcheck"] - "Define the vector for the \"Spell\" toolbar button") - -(defvar toolbar-vector-replace - [toolbar-replace-icon toolbar-replace t "Replace text"] - "Define the vector for the \"Replace\" toolbar button") - -(defvar toolbar-vector-mail - [toolbar-mail-icon toolbar-mail t "Mail"] - "Define the vector for the \"Mail\" toolbar button") - -(defvar toolbar-vector-info - [toolbar-info-icon toolbar-info t "Information"] - "Define the vector for the \"Info\" toolbar button") - -(defvar toolbar-vector-compile - [toolbar-compile-icon toolbar-compile t "Compile"] - "Define the vector for the \"Compile\" toolbar button") - -(defvar toolbar-vector-debug - [toolbar-debug-icon toolbar-debug t "Debug"] - "Define the vector for the \"Debug\" toolbar button") - -(defvar toolbar-vector-news - [toolbar-news-icon toolbar-news t "News"] - "Define the vector for the \"News\" toolbar button") - -(defvar initial-toolbar-spec - (list - ;;[toolbar-last-win-icon pop-window-configuration - ;;(frame-property (selected-frame) - ;; 'window-config-stack) t "Most recent window config"] - ;; #### Illicit knowledge? - ;; #### These don't work right - not consistent! - ;; I don't know what's wrong; perhaps `selected-frame' is wrong - ;; sometimes when this is evaluated. Note that I even tried to - ;; kludge-fix this by calls to `set-specifier-dirty-flag' in - ;; pop-window-configuration and such. - - ;;[toolbar-next-win-icon unpop-window-configuration - ;;(frame-property (selected-frame) - ;; 'window-config-unpop-stack) t "Undo \"Most recent window config\""] - ;; #### Illicit knowledge? - toolbar-vector-open - toolbar-vector-dired - toolbar-vector-save - toolbar-vector-print - toolbar-vector-cut - toolbar-vector-copy - toolbar-vector-paste - toolbar-vector-undo - toolbar-vector-spell - toolbar-vector-replace - toolbar-vector-mail - toolbar-vector-info - toolbar-vector-compile - toolbar-vector-debug - toolbar-vector-news - ) - "The initial toolbar for a buffer.") - -(defun x-init-toolbar-from-resources (locale) - (x-init-specifier-from-resources - top-toolbar-height 'natnum locale - '("topToolBarHeight" . "TopToolBarHeight")) - (x-init-specifier-from-resources - bottom-toolbar-height 'natnum locale - '("bottomToolBarHeight" . "BottomToolBarHeight")) - (x-init-specifier-from-resources - left-toolbar-width 'natnum locale - '("leftToolBarWidth" . "LeftToolBarWidth")) - (x-init-specifier-from-resources - right-toolbar-width 'natnum locale - '("rightToolBarWidth" . "RightToolBarWidth")) - (x-init-specifier-from-resources - top-toolbar-border-width 'natnum locale - '("topToolBarBorderWidth" . "TopToolBarBorderWidth")) - (x-init-specifier-from-resources - bottom-toolbar-border-width 'natnum locale - '("bottomToolBarBorderWidth" . "BottomToolBarBorderWidth")) - (x-init-specifier-from-resources - left-toolbar-border-width 'natnum locale - '("leftToolBarBorderWidth" . "LeftToolBarBorderWidth")) - (x-init-specifier-from-resources - right-toolbar-border-width 'natnum locale - '("rightToolBarBorderWidth" . "RightToolBarBorderWidth"))) - -;;; x-toolbar.el ends here diff -r 090b52736db2 -r c42ec1d1cded man/ChangeLog --- a/man/ChangeLog Mon Aug 13 10:32:23 2007 +0200 +++ b/man/ChangeLog Mon Aug 13 10:33:18 2007 +0200 @@ -1,3 +1,12 @@ +1998-05-05 Oliver Graf + + * commands.texi: exchange of dnd-drop with misc-user + +1998-05-04 Martin Buchholz + + * internals.texi (Techniques for XEmacs Developers): Add some more + comments on adding new files, inspired by Olivier Galibert. + 1998-05-02 Hrvoje Niksic * lispref/windows.texi (Vertical Scrolling): Fixup docstring for diff -r 090b52736db2 -r c42ec1d1cded man/internals/internals.texi --- a/man/internals/internals.texi Mon Aug 13 10:32:23 2007 +0200 +++ b/man/internals/internals.texi Mon Aug 13 10:33:18 2007 +0200 @@ -2047,8 +2047,44 @@ @code{quantify-stop-recording-data} and @code{quantify-clear-data}. To get started debugging XEmacs, take a look at the @file{gdbinit} and -@file{dbxrc} files in the @file{src} directory. - +@file{dbxrc} files in the @file{src} directory. +@xref{Q2.1.15: How to Debug an XEmacs problem with a debugger,,, +xemacs-faq, XEmacs FAQ}. + + +Here are things to know when you create a new source file: + +@itemize @bullet +@item +All .c files should @code{#include } first. Almost all .c +files should @code{#include "lisp.h"} second. + +@item +Generated header files should be included using the @code{<>} syntax, +not the @code{""} syntax. The generated headers are: + +config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h + +The basic rule is that you should assume builds using @code{--srcdir} +and the @code{<>} syntax needs to be used when the to-be-included +generated file is in a potentially different directory +@emph{at compile time}. + +@item +Header files should not include and "lisp.h". It is the +responsibility of the .c files that use it to do so. + +@item +If the header uses INLINE, either directly or though DECLARE_LRECORD, +then it must be added to inline.c's includes. + +@item +Try compiling at least once with + +@example +gcc --with-mule --with-union-type --error-checking=all +@end example +@end itemize @node A Summary of the Various XEmacs Modules, Allocation of Objects in XEmacs Lisp, Rules When Writing New C Code, Top @chapter A Summary of the Various XEmacs Modules diff -r 090b52736db2 -r c42ec1d1cded man/lispref/commands.texi --- a/man/lispref/commands.texi Mon Aug 13 10:32:23 2007 +0200 +++ b/man/lispref/commands.texi Mon Aug 13 10:33:18 2007 +0200 @@ -829,18 +829,12 @@ or released, button events specify the modifier keys that were held down at the time and the position of the pointer at the time. -@item dnd-drop event - Some dragged data was released. The event provides the button that was used -to drag the data, the modifier keys that were hold down, the position where -the drop took place, and a lisp object containing the type and the data -dropped (Note: until now only the OffiX protocol supports dnd-drop). - @item motion event The pointer was moved. Along with the position of the pointer, these events also specify the modifier keys that were held down at the time. @item misc-user event - A menu item was selected, or the scrollbar was used. + A menu item was selected, the scrollbar was used, or a drag or a drop occured. @item process event Input is available on a process. @@ -910,21 +904,6 @@ The position of the pointer (in pixels) at the time of the event. @end table -@item dnd-drop event -@table @asis -@item channel -@item timestamp -@item button - What button was used to drag. Buttons are numbered starting at 1. -@item modifiers - Which modifier keys were pressed to do the drag. -@item x -@itemx y - The position of the pointer (in pixels) at the time of the event. -@item data - A lisp object containing the dropped type and data. -@end table - @item pointer-motion event @table @asis @item channel @@ -946,6 +925,14 @@ @item object The object to pass to the function. This is normally the callback that was specified in the menu description. +@item button + What button went down or up. Buttons are numbered starting at 1. +@item modifiers + Which modifier keys were pressed. The special business mentioned above +for the shift key does @emph{not} apply to mouse events. +@item x +@itemx y + The position of the pointer (in pixels) at the time of the event. @end table @item process_event @@ -996,13 +983,11 @@ A mouse button was pressed. @item button-release A mouse button was released. -@item dnd-drop -A drop occured. @item motion The mouse moved. @item misc-user Some other user action happened; typically, this is -a menu selection or scrollbar action. +a menu selection, scrollbar action, or drag and drop action. @item process Input is available from a subprocess. @item timeout @@ -1037,10 +1022,6 @@ This is true if @var{object} is a mouse button-release event. @end defun -@defun dnd-drop-event-p object -This is true if @var{object} is a mouse dnd-drop event. -@end defun - @defun motion-event-p object This is true if @var{object} is a mouse motion event. @end defun @@ -1074,9 +1055,10 @@ @subsection Accessing the Position of a Mouse Event Unlike other events, mouse events (i.e. motion, button-press, -button-release, and dnd-drop events) occur in a particular location -on the screen. Many primitives are provided for determining exactly -where the event occurred and what is under that location. +button-release, and drag or drop type misc-user events) occur in a +particular location on the screen. Many primitives are provided for +determining exactly where the event occurred and what is under that +location. @menu * Frame-Level Event Position Info:: @@ -1095,7 +1077,7 @@ @defun event-frame event This function returns the ``channel'' or frame that the given mouse -motion, button press, button release, or dnd drop event occurred in. +motion, button press, button release, or misc-user event occurred in. This will be @code{nil} for non-mouse events. @end defun @@ -1118,14 +1100,14 @@ a mouse event occurred. @defun event-window event -Given a mouse motion, button press, button release, or dnd drop event, compute and +Given a mouse motion, button press, button release, or misc-user event, compute and return the window on which that event occurred. This may be @code{nil} if the event occurred in the border or over a toolbar. The modeline is considered to be within the window it describes. @end defun @defun event-buffer event -Given a mouse motion, button press, button release, or dnd drop event, compute and +Given a mouse motion, button press, button release, or misc-user event, compute and return the buffer of the window on which that event occurred. This may be @code{nil} if the event occurred in the border or over a toolbar. The modeline is considered to be within the window it describes. This is @@ -1137,14 +1119,14 @@ This function returns the X position in pixels of the given mouse event. The value returned is relative to the window the event occurred in. This will signal an error if the event is not a mouse-motion, button-press, -button-release, or dnd-drop event. +button-release, or misc-user event. @end defun @defun event-window-y-pixel event This function returns the Y position in pixels of the given mouse event. The value returned is relative to the window the event occurred in. This will signal an error if the event is not a mouse-motion, button-press, -or button-release event. +button-release, or misc-user event. @end defun @node Event Text Position Info @@ -1154,33 +1136,33 @@ modeline) that a mouse event occurred over or near. @defun event-over-text-area-p event -Given a mouse-motion, button-press, button-release, or dnd-drop event, this +Given a mouse-motion, button-press, button-release, or misc-user event, this function returns @code{t} if the event is over the text area of a window. Otherwise, @code{nil} is returned. The modeline is not considered to be part of the text area. @end defun @defun event-over-modeline-p event -Given a mouse-motion, button-press, button-release, or dnd-drop event, this +Given a mouse-motion, button-press, button-release, or misc-user event, this function returns @code{t} if the event is over the modeline of a window. Otherwise, @code{nil} is returned. @end defun @defun event-x event This function returns the X position of the given mouse-motion, -button-press, button-release, or dnd-drop event in characters. This is relative +button-press, button-release, or misc-user event in characters. This is relative to the window the event occurred over. @end defun @defun event-y event This function returns the Y position of the given mouse-motion, -button-press, button-release, or dnd-drop event in characters. This is relative +button-press, button-release, or misc-user event in characters. This is relative to the window the event occurred over. @end defun @defun event-point event This function returns the character position of the given mouse-motion, -button-press, button-release, or dnd-drop event. If the event did not occur over +button-press, button-release, or misc-user event. If the event did not occur over a window, or did not occur over text, then this returns @code{nil}. Otherwise, it returns an index into the buffer visible in the event's window. @@ -1188,7 +1170,7 @@ @defun event-closest-point event This function returns the character position of the given mouse-motion, -button-press, button-release, or dnd-drop event. If the event did not occur over +button-press, button-release, or misc-user event. If the event did not occur over a window or over text, it returns the closest point to the location of the event. If the Y pixel position overlaps a window and the X pixel position is to the left of that window, the closest point is the @@ -1206,25 +1188,25 @@ a mouse event occurred over. @defun event-over-glyph-p event -Given a mouse-motion, button-press, button-release, or dnd-drop event, this +Given a mouse-motion, button-press, button-release, or misc-user event, this function returns @code{t} if the event is over a glyph. Otherwise, @code{nil} is returned. @end defun @defun event-glyph-extent event -If the given mouse-motion, button-press, button-release, or dnd-drop event happened +If the given mouse-motion, button-press, button-release, or misc-user event happened on top of a glyph, this returns its extent; else @code{nil} is returned. @end defun @defun event-glyph-x-pixel event -Given a mouse-motion, button-press, button-release, or dnd-drop event over a +Given a mouse-motion, button-press, button-release, or misc-user event over a glyph, this function returns the X position of the pointer relative to the upper left of the glyph. If the event is not over a glyph, it returns @code{nil}. @end defun @defun event-glyph-y-pixel event -Given a mouse-motion, button-press, button-release, or dnd-drop event over a +Given a mouse-motion, button-press, button-release, or misc-user event over a glyph, this function returns the Y position of the pointer relative to the upper left of the glyph. If the event is not over a glyph, it returns @code{nil}. @@ -1234,13 +1216,13 @@ @subsubsection Event Toolbar Position Info @defun event-over-toolbar-p event -Given a mouse-motion, button-press, button-release, or dnd-drop event, this +Given a mouse-motion, button-press, button-release, or misc-user event, this function returns @code{t} if the event is over a toolbar. Otherwise, @code{nil} is returned. @end defun @defun event-toolbar-button event -If the given mouse-motion, button-press, button-release, or dnd-drop event +If the given mouse-motion, button-press, button-release, or misc-user event happened on top of a toolbar button, this function returns the button. Otherwise, @code{nil} is returned. @end defun @@ -1249,7 +1231,7 @@ @subsubsection Other Event Position Info @defun event-over-border-p event -Given a mouse-motion, button-press, button-release, or dnd-drop event, this +Given a mouse-motion, button-press, button-release, or misc-user event, this function returns @code{t} if the event is over an internal toolbar. Otherwise, @code{nil} is returned. @end defun @@ -1302,11 +1284,6 @@ This function returns the process of the given process event. @end defun -@defun event-drag-and-drop-data event -This function returns a list containing the type of the drop as first element -and the data of the drop as second element. -@end defun - @node Working With Events @subsection Working With Events diff -r 090b52736db2 -r c42ec1d1cded man/xemacs-faq.texi --- a/man/xemacs-faq.texi Mon Aug 13 10:32:23 2007 +0200 +++ b/man/xemacs-faq.texi Mon Aug 13 10:33:18 2007 +0200 @@ -7,8 +7,7 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs -@subtitle Last Modified: $Date: 1998/04/18 23:25:13 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 1998/05/10 00:25:35 $ @sp 1 @author Tony Rossini @author Ben Wing @@ -21,6 +20,7 @@ @node Top, Introduction, (dir), (dir) @top XEmacs FAQ +@unnumbered Introduction This is the guide to the XEmacs Frequently Asked Questions list---a compendium of questions and answers pertaining to one of the finest @@ -33,15 +33,48 @@ FITNESS FOR A PARTICULAR PURPOSE. If you have a Web browser, the official hypertext version is at -@iftex -@* -@end iftex -@uref{http://www.xemacs.org/faq/xemacs-faq.html}. +@iftex +@* +@end iftex +@uref{http://www.xemacs.org/faq/xemacs-faq.html}. This version is somewhat nicer than the unofficial hypertext versions that are archived at Utrecht, Oxford, Smart Pages, and other FAQ archives. +@ifset CANONICAL +@html +This document is available in several different formats: +@itemize @bullet +@item +@uref{xemacs-faq.txt, As a single ASCII file}, produced by +@code{makeinfo --no-headers} +@item +@uref{xemacs-faq.dvi, As a .dvi file}, as used with +@uref{http://www.tug.org, TeX.} +@item +As a PostScript file @uref{xemacs-faq-a4.ps, in A4 format}, +as well as in @uref{xemacs-faq-letter.ps, letter format} +@item +In html format, @uref{xemacs-faq_1.html, split by chapter}, or in +@uref{xemacs-faq.html, one monolithic} document. +@item +The canonical version of the FAQ is the texinfo document +@uref{xemacs-faq.texi, man/xemacs-faq.texi}. +@item +If you do not have makeinfo installed, you may @uref{xemacs-faq.info, +download the faq} in info format, and install it in @file{/info/}. For example in +@file{/usr/local/lib/xemacs-20.4/info/}. + +@end itemize + +@end html + +@end ifset + +@c end ifset points to CANONICAL + @menu * Introduction:: Introduction, Policy, Credits. * Installation:: Installation and Trouble Shooting. @@ -61,10 +94,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? @@ -78,17 +111,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? @@ -101,20 +134,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! @@ -127,7 +160,7 @@ * Q2.1.8:: got (wrong-type-argument color-instance-p nil)! * Q2.1.9:: XEmacs causes my OpenWindows 3.0 server to crash. * Q2.1.10:: Warnings from incorrect key modifiers. -* Q2.1.11:: [This question intentionally left blank] +* Q2.1.11:: Can't instantiate image error... in toolbar * Q2.1.12:: Regular Expression Problems on DEC OSF1. * Q2.1.13:: HP/UX 10.10 and @code{create_process} failure * Q2.1.14:: @kbd{C-g} doesn't work for me. Is it broken? @@ -143,13 +176,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}? @@ -161,14 +194,15 @@ * 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. +* Q3.2.6:: Can I have pixmap backgrounds in XEmacs? The Modeline: * Q3.3.1:: How can I make the modeline go away? @@ -177,21 +211,22 @@ * Q3.3.4:: How do I turn off current chapter from AUC TeX modeline? * 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? +Multiple Device Support: +* 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: +The Keyboard: * Q3.5.1:: How can I bind complex functions (or macros) to keys? * Q3.5.2:: How can I stop down-arrow from adding empty lines to the bottom of my buffers? * 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? * Q3.5.10:: Can I turn on @dfn{sticky} modifier keys? +* Q3.5.11:: How do I map the arrow keys? The Cursor: * Q3.6.1:: Is there a way to make the bar cursor thicker? @@ -222,7 +257,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)? @@ -249,7 +284,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? @@ -262,7 +297,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? @@ -276,6 +311,7 @@ * Q4.7.3:: Byte compiling AUC TeX on XEmacs 19.14 * Q4.7.4:: Problems installing AUC TeX * Q4.7.5:: Is there a reason for an Emacs package not to be included in XEmacs? +* Q4.7.6:: Is there a MatLab mode? The Miscellaneous Stuff @@ -288,8 +324,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. @@ -310,6 +346,8 @@ * Q5.1.7:: I like the the @code{do} form of cl, does it slow things down? * Q5.1.8:: I like recursion, does it slow things down? * Q5.1.9:: How do I put a glyph as annotation in a buffer? +* Q5.1.10:: @code{map-extents} won't traverse all of my extents! +* Q5.1.11:: My elisp program is horribly slow. Is there an easy way to find out where it spends time? Sound: * Q5.2.1:: How do I turn off the sound? @@ -364,11 +402,11 @@ texinfo by @email{hniksic@@srce.hr, Hrvoje Niksic}. The FAQ was then maintained by @email{andreas@@sccon.com, Andreas -Kaempf}, who passed it on to @email{chr@@mediascience.no, Christian +Kaempf}, who passed it on to @email{faq@@xemacs.org, Christian Nyb@o{}}, the current FAQ maintainer. If you notice any errors or items which should be added or amended to -this FAQ please send email to @email{chr@@mediascience.no, Christian +this FAQ please send email to @email{faq@@xemacs.org, Christian Nyb@o{}}. Include @samp{XEmacs FAQ} on the Subject: line. @menu @@ -378,10 +416,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? @@ -395,17 +433,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? @@ -528,7 +566,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 @email{xemacs-beta@@xemacs.org} and +that often result. Mail your questions to @email{xemacs-beta@@xemacs.org} and @email{bug-gnu-emacs@@prep.ai.mit.edu}. @node Q1.0.6, Q1.0.7, Q1.0.5, Introduction @@ -541,7 +579,7 @@ Try reading this FAQ, examining the regular GNU Emacs FAQ (which can be found with the Emacs 19 distribution) as well as at -@uref{http://www.eecs.nwu.edu/emacs/faq/} and reading the Usenet group +@uref{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. @@ -550,7 +588,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 @email{xemacs-request@@xemacs.org} -for subscription information and @email{xemacs@@xemacs.org} to send messages +for subscription information and @email{xemacs@@xemacs.org} to send messages to the list. To cancel a subscription, you @strong{must} use the xemacs-request @@ -591,13 +629,16 @@ XEmacs; however, a native NT/95 port is in alpha, thanks to @email{jhar@@tardis.ed.ac.uk, Jonathan Harris}. +Although some features are still unimplemented, XEmacs 21.0 will support +MS-Windows. + The NT development is now coordinated by a mailing list at @email{xemacs-nt@@xemacs.org}. If you are willing to contribute or want to follow the progress, mail to @iftex @* -@end iftex +@end iftex @email{xemacs-nt-request@@xemacs.org} to subscribe. Furthermore, Altrasoft is seeking corporate and government sponsors to @@ -618,11 +659,15 @@ @node Q1.0.11, Q1.0.12, Q1.0.10, Introduction @unnumberedsubsec Q1.0.11: Is there a port of XEmacs to the Macintosh? +@c changed There has been a port to the MachTen environment of XEmacs 19.13, but no patches have been submitted to the maintainers to get this in the mainstream distribution. +For the MacOS, there is a port of +@uref{ftp://ftp.cs.cornell.edu/pub/parmet/, Emacs 18.59}. + @node Q1.0.12, Q1.0.13, Q1.0.11, Introduction @unnumberedsubsec Q1.0.12: Is there a port of XEmacs to NextStep? @@ -662,10 +707,11 @@ Brand new questions are tagged. All submissions are welcome. E-mail submissions -to @iftex +to +@iftex @* -@end iftex -@email{chr@@mediascience.no, Christian Nyb@o{}}. +@end iftex +@email{faq@@xemacs.org, Christian Nyb@o{}}. Please make sure that @samp{XEmacs FAQ} appears on the Subject: line. If you think you have a better way of answering a question, or think a @@ -681,7 +727,7 @@ @unnumberedsubsec Q1.1.2: How do I become a Beta Tester? Send an email message to @email{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. @@ -726,23 +772,23 @@ developers responsible for the 19.16/20.x releases are: @itemize @bullet -@item @email{martin@@xemacs.org, Martin Buchholz} +@item @email{martin@@xemacs.org, Martin Buchholz} @ifhtml - +
Portrait of Martin Buchholz
@end ifhtml @item @email{steve@@altair.xemacs.org, Steve Baur} @ifhtml - +
Portrait of Steve Baur
@end ifhtml @item @email{hniksic@@srce.hr, Hrvoje Niksic} @ifhtml - +
Portrait of Hrvoje Niksic
@end ifhtml @end itemize @@ -752,7 +798,7 @@ @itemize @bullet @item @email{cthomp@@xemacs.org, Chuck Thompson} @ifhtml - +
Portrait of Chuck Thompson
@end ifhtml Chuck was Mr. XEmacs from 19.11 through 19.14, and is responsible @@ -760,21 +806,22 @@ @item @email{ben@@666.com, Ben Wing} @ifhtml - +
Portrait of Ben Wing
@end ifhtml @end itemize + +@itemize @bullet +@item @email{jwz@@netscape.com, Jamie Zawinski} +@ifhtml +
Portrait of Jamie Zawinski
+@end ifhtml + Jamie Zawinski was Mr. Lucid Emacs from 19.0 through 19.10, the last release actually named Lucid Emacs. Richard Mlynarik was crucial to most of those releases. -@itemize @bullet -@item @email{jwz@@netscape.com, Jamie Zawinski} -@ifhtml - -@end ifhtml - @item @email{mly@@adoc.xerox.com, Richard Mlynarik} @end itemize @@ -848,7 +895,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, @@ -859,7 +906,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 @@ -916,7 +963,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 fundings on Mule have stopped, the 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 @email{xemacs-beta@@xemacs.org}. @@ -950,7 +997,7 @@ @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} 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 @@ -1051,22 +1098,27 @@ There is a cyrillic mode in the file @file{mysetup.zip} in @iftex @* -@end iftex +@end iftex @uref{ftp://ftp.math.ohio-state.edu/pub/users/ilya/emacs/}. This is a modification to @email{ava@@math.jhu.ed, Valery Alexeev's} @file{russian.el} -which can be obtained from @uref{ftp://ftp.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages/russian.el.Z}. +which can be obtained from @end quotation +@uref{http://ftpsearch.ntnu.no/?query=russian.el.Z}. +@c dead link above + @email{d.barsky@@ee.surrey.ac.uk, Dima Barsky} writes: @quotation There is another cyrillic mode for both GNU Emacs and XEmacs by @email{manin@@camelot.mssm.edu, Dmitrii -(Mitya) Manin} at +(Mitya) Manin} at @iftex -@end iftex -@uref{http://camelot.mssm.edu/~manin/cyr.el}. +@end iftex +@uref{http://kulichki-lat.rambler.ru/centrolit/manin/cyr.el}. +@c Link above, was dead. +@c Changed to russian host instead @end quotation @email{rebecca.ore@@op.net, Rebecca Ore} writes: @@ -1089,7 +1141,7 @@ Starting with 19.14, you may bring the @file{sample.emacs} into an XEmacs buffer by selecting @samp{Help->Sample .emacs} from the menubar. To determine the location of the @file{etc} directory type the command -@kbd{C-h v data-directory RET}. +@kbd{C-h v data-directory @key{RET}}. @node Q1.4.2, Q1.4.3, Q1.4.1, Introduction @unnumberedsubsec Q1.4.2: Can I use the same @file{.emacs} with the other Emacs? @@ -1103,7 +1155,7 @@ There's the XEmacs tutorial available from the Help Menu, or by typing @kbd{C-h t}. To check whether it's available in a non-english language, type @kbd{C-u C-h t TAB}, type the first letters of your preferred -language, then type @kbd{RET}. +language, then type @key{RET}. There's an Emacs Lisp tutorial at @@ -1112,10 +1164,10 @@ @end example @email{erik@@petaxp.rug.ac.be, Erik Sundermann} has made a tutorial web -page at +page at @iftex @* -@end iftex +@end iftex @uref{http://petaxp.rug.ac.be/~erik/xemacs/}. @node Q1.4.4, Q1.4.5, Q1.4.3, Introduction @@ -1222,20 +1274,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! @@ -1248,7 +1300,7 @@ * Q2.1.8:: got (wrong-type-argument color-instance-p nil)! * Q2.1.9:: XEmacs causes my OpenWindows 3.0 server to crash. * Q2.1.10:: Warnings from incorrect key modifiers. -* Q2.1.11:: [This question intentionally left blank] +* Q2.1.11:: Can't instantiate image error... in toolbar * Q2.1.12:: Regular Expression Problems on DEC OSF1. * Q2.1.13:: HP/UX 10.10 and @code{create_process} failure * Q2.1.14:: @kbd{C-g} doesn't work for me. Is it broken? @@ -1306,19 +1358,19 @@ Now examine the space used by directory: -@example +@format 0 /usr/local/bin/xemacs 2048 /usr/local/bin/xemacs-19.13 1546 /usr/local/lib/xemacs-19.13/i486-miranova-sco3.2v4.2 1158 /usr/local/lib/xemacs-19.13/i486-unknown-linux1.2.13 -@end example +@end format You need to keep these. XEmacs isn't stripped by default in installation, you should consider stripping. That will save you about 5MB right there. -@example +@format 207 /usr/local/lib/xemacs-19.13/etc/w3 122 /usr/local/lib/xemacs-19.13/etc/sounds 18 /usr/local/lib/xemacs-19.13/etc/sparcworks @@ -1328,13 +1380,13 @@ 172 /usr/local/lib/xemacs-19.13/etc/toolbar 61 /usr/local/lib/xemacs-19.13/etc/ns 43 /usr/local/lib/xemacs-19.13/etc/gnus -@end example +@end format These are support directories for various packages. In general they match a directory under ./xemacs-19.13/lib/xemacs-19.13/lisp/. If you do not require the package, you may delete or gzip the support too. -@example +@format 1959 /usr/local/lib/xemacs-19.13/etc 175 /usr/local/lib/xemacs-19.13/lisp/bytecomp 340 /usr/local/lib/xemacs-19.13/lisp/calendar @@ -1379,7 +1431,7 @@ 53 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx 466 /usr/local/lib/xemacs-19.13/lisp/oobr 14142 /usr/local/lib/xemacs-19.13/lisp -@end example +@end format These are all Emacs Lisp source code and bytecompiled object code. You may safely gzip everything named *.el here. You may remove any package @@ -1438,7 +1490,7 @@ cd $d for f in *.el ; do # compress (remove) only (ONLY) the sources that have a -# corresponding compiled file --- do not (DO NOT) +# corresponding compiled file --- do not (DO NOT) # touch other sources if test -f $@{f@}c ; then gzip -v9 $f >> $r/cmpr ; fi done @@ -1459,7 +1511,7 @@ @end quotation @quotation -XEmacs 21 will unbundle the lisp hierarchy and allow the installer +XEmacs 21.0 will unbundle the lisp hierarchy and allow the installer to choose exactly how much support code gets installed. @end quotation @@ -1500,9 +1552,10 @@ @example src/xemacs -nw -q -Initialization error: @iftex +Initialization error: +@iftex @* -@end iftex +@end iftex Terminal type `xterm' undefined (or can't access database?) @end example @@ -1552,9 +1605,10 @@ @item Patch the XEmacs binary by replacing all occurrences of -@samp{_h_errno^@@} with @iftex +@samp{_h_errno^@@} with +@iftex @* -@end iftex +@end iftex @samp{h_errno^@@^@@}. Any version of Emacs will suffice. If you don't understand how to do this, don't do it. @@ -1601,12 +1655,13 @@ @unnumberedsubsec Q2.0.9: Where do I find external libraries? All external libraries used by XEmacs can be found at the XEmacs FTP -site +site @iftex @* -@end iftex -@uref{ftp://ftp.xemacs.org/pub/aux/}. - +@end iftex +@uref{ftp://ftp.xemacs.org/pub/xemacs/aux/}. + +@c Changed June Link above, was dead. @c This list is a pain in the you-know-what to keep in synch with the @c world. The canonical locations (at the time of this writing) are as follows: @@ -1614,7 +1669,7 @@ @table @asis @item JPEG @uref{ftp://ftp.uu.net/graphics/jpeg/}. Version 6a is current. - +@c Check from host with legal IP address @item XPM @uref{ftp://ftp.x.org/contrib/libraries/}. Version 3.4j is current. Older versions of this package are known to cause XEmacs crashes. @@ -1626,6 +1681,7 @@ @item PNG @uref{ftp://ftp.uu.net/graphics/png/}. 0.89c is current. XEmacs requires a fairly recent version to avoid using temporary files. +@c Check from host with legal IP address @uref{ftp://swrinde.nde.swri.edu/pub/png/src/} @@ -1729,10 +1785,10 @@ cp src/xemacs /usr/local/bin/xemacs @item -cp lib-src/DOC-19.16-XEmacs +cp lib-src/DOC-19.16-XEmacs @iftex \ @* -@end iftex +@end iftex /usr/local/lib/xemacs-19.16/i586-unknown-linuxaout @end enumerate @end quotation @@ -1744,8 +1800,8 @@ 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 @@ -1898,7 +1954,7 @@ included with XEmacs which should be at @iftex @* -@end iftex +@end iftex @file{/lib/xemacs-19.16/etc/XKeysymDB}. @item @@ -1917,15 +1973,16 @@ This is highly dependent on your installation, but try with the following font as your base font for XEmacs and see what it does: -@example +@format -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1 -@end example +@end format More precisely, do the following in your resource file: -@example -Emacs.default.attributeFont: -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1 -@end example +@format +Emacs.default.attributeFont: \ +-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1 +@end format If you just don't want to see the @samp{*Warnings*} buffer at startup time, you can set this: @@ -1978,8 +2035,8 @@ doesn't occur on X11R5. @lisp -Signalling: -(error "got (wrong-type-argument color-instance-p nil) +Signalling: +(error "got (wrong-type-argument color-instance-p nil) and I don't know why!") @end lisp @end quotation @@ -2011,10 +2068,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 @@ -2053,9 +2110,30 @@ @end example @node Q2.1.11, Q2.1.12, Q2.1.10, Installation -@unnumberedsubsec Q2.1.11: [This question intentionally left blank] - -Obsolete question, left blank to avoid renumbering. +@unnumberedsubsec Q2.1.11: @samp{Can't instantiate image error...} in toolbar +@c New + +@email{expt@@alanine.ram.org, Dr. Ram Samudrala} writes: + +I just installed the XEmacs (20.4-2) RPMS that I downloaded from +@uref{http://www.xemacs.org/}. Everything works fine, except that when +I place my mouse over the toolbar, it beeps and gives me this message: + +@example + Can't instantiate image (probably cached): + [xbm :mask-file "/usr/include/X11/bitmaps/leftptrmsk :mask-data + (16 16 ... +@end example + +@email{kyle_jones@@wonderworks.com, Kyle Jones} writes: +@quotation +This is problem specific to some Chips and Technologies video +chips, when running XFree86. Putting + +@code{Option "sw_cursor"} + +in @file{XF86Config} gets rid of the problem. +@end quotation @node Q2.1.12, Q2.1.13, Q2.1.11, Installation @unnumberedsubsec Q2.1.12: Problems with Regular Expressions on DEC OSF1. @@ -2068,11 +2146,11 @@ @email{douglask@@dstc.edu.au, Douglas Kosovic} 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 @@ -2080,6 +2158,11 @@ @example @uref{http://www-digital.cern.ch/carney/emacs/emacs.html} +@c Link above, is +@c dead. And the directory `carney' is empty. + + + @end example NOTE: There have been a variety of other problems reported that are @@ -2159,11 +2242,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 @@ -2187,8 +2270,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) @@ -2251,7 +2334,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. @@ -2268,62 +2351,23 @@ @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 +also need gdb 4.17. Earlier releases of gdb can't handle the debug +information generated by the newer compilers. + +@item +The above information on using @file{src/gdbinit} works for XEmacs-21.0 +and above. For older versions of XEmacs, there are different +@file{gdbinit} files provided in the @file{src} directory. Use the one +corresponding to the configure options used when building XEmacs. + @end itemize - - -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 - -@end example - -If the object is a record type, you'll probably have to the following -steps: - -@example -print OBJECT -xtype -xrecord - -print OBJECT - -@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 @unnumberedsubsec Q2.1.16: XEmacs crashes in @code{strcat} on HP/UX 10 @@ -2388,10 +2432,10 @@ @email{cognot@@ensg.u-nancy.fr, Richard Cognot} adds: @quotation -Apparently somebody has found the reason why there is this +Apparently somebody has found the reason why there is this @iftex @* -@end iftex +@end iftex @samp{poll: interrupted...} message for each event. For some reason, libcurses reimplements a @code{select()} system call, in a highly broken fashion. @@ -2486,7 +2530,7 @@ @end quotation @node Q2.1.23, , Q2.1.22, Installation -@unnumberedsubsec Q2.1.23: Movemail on Linux does not work for XEmacs 19.15 and later. +@unnumberedsubsec Q2.1.23: 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. @@ -2512,13 +2556,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}? @@ -2530,14 +2574,15 @@ * 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. +* Q3.2.6:: Can I have pixmap backgrounds in XEmacs? The Modeline: * Q3.3.1:: How can I make the modeline go away? @@ -2547,7 +2592,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: @@ -2556,11 +2601,12 @@ * 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? * Q3.5.10:: Can I turn on @dfn{sticky} modifier keys? +* Q3.5.11:: How do I map the arrow keys? The Cursor: * Q3.6.1:: Is there a way to make the bar cursor thicker? @@ -2591,7 +2637,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)? @@ -2682,7 +2728,7 @@ @code{fboundp}, or even simple behavioural 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 @@ -2720,7 +2766,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) @@ -2800,10 +2846,10 @@ In Lucid Emacs 19.6 I did @code{(set-screen-width @var{characters})} and @code{(set-screen-height @var{lines})} in my @file{.emacs} instead of -specifying @code{Emacs*EmacsScreen.geometry} in my +specifying @code{Emacs*EmacsScreen.geometry} in my @iftex @* -@end iftex +@end iftex @file{.Xdefaults} but this does not work in XEmacs 19.13. @@ -2857,7 +2903,7 @@ @lisp (setq frame-title-format - '("%S: " (buffer-file-name "%f" + '("%S: " (buffer-file-name "%f" (dired-directory dired-directory "%b")))) @end lisp @@ -2942,22 +2988,22 @@ (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-foreground 'highlight "yellow") -(set-face-background 'modeline "blue") ; Line at bottom +(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 +(set-face-background 'isearch "yellow") ; When highlighting + ; while searching (set-face-foreground 'isearch "red") (setq x-pointer-foreground-color "black") ; Adds to bg color, ; so keep black -(setq x-pointer-background-color "blue") ; This is color +(setq x-pointer-background-color "blue") ; This is color ; you really ; want ptr/crsr @end lisp @@ -2971,7 +3017,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 @@ -3000,7 +3046,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 @@ -3024,7 +3070,7 @@ Starting with XEmacs 19.14, XEmacs uses the closest available color if the colormap is full, so it's O.K. now to start Netscape first. -@node Q3.2.5, Q3.3.1, Q3.2.4, Customization +@node Q3.2.5, Q3.2.6, Q3.2.4, Customization @unnumberedsubsec Q3.2.5: My tty supports color, but XEmacs doesn't use them. XEmacs tries to automatically determine whether your tty supports color, @@ -3036,7 +3082,36 @@ (set-device-class nil 'color)) @end lisp -@node Q3.3.1, Q3.3.2, Q3.2.5, Customization +@node Q3.2.6, Q3.3.1, Q3.2.5, Customization +@unnumberedsubsec Q3.2.6: Can I have pixmap backgrounds in XEmacs? +@c New +@email{jvillaci@@wahnsinnig.extreme.indiana.edu, Juan Villacis} writes: + +@quotation +There are several ways to do it. For example, you could specify a +default pixmap image to use in your @file{~/.Xresources}, e.g., + + +@example + Emacs*EmacsFrame.default.attributeBackgroundPixmap: /path/to/image.xpm +@end example + + +and then reload ~/.Xresources and restart XEmacs. Alternatively, +since each face can have its own pixmap background, a better way +would be to set a face's pixmap within your XEmacs init file, e.g., + +@lisp + (set-face-background-pixmap 'default "/path/to/image.xpm") + (set-face-background-pixmap 'bold "/path/to/another_image.xpm") +@end lisp + +and so on. You can also do this interactively via @kbd{M-x edit-faces}. + +@end quotation + +@unnumberedsec 3.3: The Modeline +@node Q3.3.1, Q3.3.2, Q3.2.6, Customization @unnumberedsubsec Q3.3.1: How can I make the modeline go away? @lisp @@ -3066,15 +3141,15 @@ Or select from the @code{Options} menu @iftex @* -@end iftex +@end iftex @code{Customize->Emacs->Editing->Basics->Line Number Mode} and/or @iftex @* -@end iftex +@end iftex @code{Customize->Emacs->Editing->Basics->Column Number Mode} -Or type @kbd{M-x customize RET editing-basics RET}. +Or type @kbd{M-x customize @key{RET} editing-basics @key{RET}}. @node Q3.3.3, Q3.3.4, Q3.3.2, Customization @unnumberedsubsec Q3.3.3: How do I get XEmacs to put the time of day on the modeline? @@ -3105,7 +3180,7 @@ mode: @lisp -(add-hook 'TeX-mode-hook +(add-hook 'TeX-mode-hook '(lambda () (setq fume-display-in-modeline-p nil))) @end lisp @@ -3129,7 +3204,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 @@ -3321,7 +3396,7 @@ Starting with XEmacs-20.3 you can also change this with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Environment->Windows->Scroll Step...} or type -@kbd{M-x customize RET windows RET}. +@kbd{M-x customize @key{RET} windows @key{RET}}. @node Q3.5.6, Q3.5.7, Q3.5.5, Customization @unnumberedsubsec Q3.5.6: How to map @kbd{Help} key alone on Sun type4 keyboard? @@ -3343,10 +3418,10 @@ @kbd{help} key when running OLWM}. OLWM grabs the @kbd{help} key, and retransmits it to the appropriate -client using +client using @iftex @* -@end iftex +@end iftex @code{XSendEvent}. Allowing Emacs to react to synthetic events is a security hole, so this is turned off by default. You can enable it by setting the variable @code{x-allow-sendevents} to t. You @@ -3355,7 +3430,7 @@ @node Q3.5.7, Q3.5.8, Q3.5.6, Customization @unnumberedsubsec Q3.5.7: How can you type in special characters in XEmacs? - +@c Changed One way is to use the package @code{x-compose}. Then you can use sequences like @kbd{Compose " a} to get ä, etc. @@ -3363,6 +3438,46 @@ 19.15 and later. Then you can use sequences like @kbd{C-x 8 " a} to get ä, etc. +@email{glynn@@sensei.co.uk, Glynn Clements} writes: + +@quotation +It depends upon your X server. + +Generally, the simplest way is to define a key as Multi_key with +xmodmap, e.g. +@c hey, show some respect, willya -- there's xkeycaps, isn't there? -- +@c chr ;) +@example + xmodmap -e 'keycode 0xff20 = Multi_key' +@end example + +You will need to pick an appropriate keycode. Use xev to find out the +keycodes for each key. + +[NB: On a `Windows' keyboard, recent versions of XFree86 automatically +define the right `Windows' key as Multi_key'.] + +Once you have Multi_key defined, you can use e.g. +@example + Multi a ' => á + Multi e " => ë + Multi c , => ç +@end example + +etc. + +Also, recent versions of XFree86 define various AltGr- +combinations as dead keys, i.e. +@example + AltGr [ => dead_diaeresis + AltGr ] => dead_tilde + AltGr ; => dead_acute +@end example +etc. + +Running @samp{xmodmap -pk} will list all of the defined keysyms. +@end quotation + @node Q3.5.8, Q3.5.9, Q3.5.7, Customization @unnumberedsubsec Q3.5.8: Why does @code{(global-set-key [delete-forward] 'delete-char)} complain? @@ -3404,11 +3519,11 @@ @code{delete-key-deletes-forward} to t. You can also change this with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Editing->Basics->Delete Key Deletes Forward} or -type @kbd{M-x customize RET editing-basics RET}. +type @kbd{M-x customize @key{RET} editing-basics @key{RET}}. Also @xref{Q3.5.4}. -@node Q3.5.10, Q3.6.1, Q3.5.9, Customization +@node Q3.5.10, Q3.5.11, Q3.5.9, Customization @unnumberedsubsec Q3.5.10: Can I turn on @dfn{sticky} modifier keys? Yes, with @code{(setq modifier-keys-are-sticky t)}. This will give the @@ -3423,7 +3538,33 @@ of the frame and back in, it cancels all currently ``stuck'' modifiers. @end quotation -@node Q3.6.1, Q3.6.2, Q3.5.10, Customization +@node Q3.5.11, Q3.6.1, Q3.5.10, Customization +@unnumberedsubsec Q3.5.11: How do I map the arrow keys? +@c New +Say you want to map @kbd{C-@key{right}} to forward-word: + +@email{sds@@usa.net, Sam Steingold} writes: + +@quotation +@lisp +; both XEmacs and Emacs +(define-key global-map [(control right)] 'forward-word) +@end lisp +or +@lisp +; Emacs only +(define-key global-map [C-right] 'forward-word) +@end lisp +or +@lisp +; ver > 20, both +(define-key global-map (kbd "C-") 'forward-word) +@end lisp +@end quotation + + + +@node Q3.6.1, Q3.6.2, Q3.5.11, Customization @unnumberedsec 3.6: The Cursor @unnumberedsubsec Q3.6.1: Is there a way to make the bar cursor thicker? @@ -3445,7 +3586,7 @@ Starting with XEmacs-20.3 you can also change these with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Environment->Display->Bar Cursor...} or type -@kbd{M-x customize RET display RET}. +@kbd{M-x customize @key{RET} display @key{RET}}. You can use a color to make it stand out better: @@ -3463,7 +3604,7 @@ Starting with XEmacs-20.3 you can also change this with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Environment->Display->Bar Cursor...} or type -@kbd{M-x customize RET display RET}. +@kbd{M-x customize @key{RET} display @key{RET}}. @node Q3.6.3, Q3.7.1, Q3.6.2, Customization @unnumberedsubsec Q3.6.3: Can I make the cursor blink? @@ -3549,7 +3690,7 @@ do I disable this? Examine the function @code{mouse-yank}, by typing @kbd{C-h f mouse-yank -RET}. +@key{RET}}. To get XEmacs to paste at the text cursor, add this your @file{.emacs}: @@ -3560,7 +3701,7 @@ Starting with XEmacs-20.2 you can also change this with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Editing->Mouse->Yank At Point...} or type -@kbd{M-x customize RET mouse RET}. +@kbd{M-x customize @key{RET} mouse @key{RET}}. @node Q3.7.7, Q3.7.8, Q3.7.6, Customization @unnumberedsubsec Q3.7.7: How do I select a rectangular region? @@ -3583,7 +3724,7 @@ Starting with XEmacs-20.2 you can also change this with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Editing->Mouse->Track Rectangle...} or type -@kbd{M-x customize RET mouse RET}. +@kbd{M-x customize @key{RET} mouse @key{RET}}. @example @@ -3645,7 +3786,7 @@ Starting with XEmacs-20.3 you can also change this with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Environment->Menu->Buffers Menu->Max Size...} or -type @kbd{M-x customize RET buffers-menu RET}. +type @kbd{M-x customize @key{RET} buffers-menu @key{RET}}. @node Q3.8.4, Q3.8.5, Q3.8.3, Customization @unnumberedsubsec Q3.8.4: Resources like @code{Emacs*menubar*font} are not working? @@ -3708,7 +3849,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 @@ -3794,7 +3935,7 @@ Automatic horizontal scrolling is now standard, starting with 19.14. @node Q3.10.1, Q3.10.2, Q3.9.4, Customization -@unnumberedsec Text Selections +@unnumberedsec 3.10: Text Selections @unnumberedsubsec Q3.10.1: How can I turn off or change highlighted selections? The @code{zmacs} mode allows for what some might call gratuitous @@ -3808,7 +3949,7 @@ Starting with XEmacs-20.2 you can also change this with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Editing->Basics->Zmacs -Regions} or type @kbd{M-x customize RET editing-basics RET}. +Regions} or type @kbd{M-x customize @key{RET} editing-basics @key{RET}}. To change the face for selection, look at @code{Options->Customize} on the menubar. @@ -3845,7 +3986,7 @@ @end lisp Starting with XEmacs-20.2 you can also change this with Customize. Type -@kbd{M-x customize-variable RET isearch-highlight RET}. +@kbd{M-x customize-variable @key{RET} isearch-highlight @key{RET}}. Note also that isearch-highlight affects query-replace and ispell. Instead of disabling isearch-highlight you may find that a better @@ -3922,7 +4063,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? @@ -3935,7 +4076,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? @@ -3949,10 +4090,11 @@ * Q4.7.3:: Byte compiling AUC TeX on XEmacs 19.14 * Q4.7.4:: Problems installing AUC TeX * Q4.7.5:: Is there a reason for an Emacs package not to be included in XEmacs? +* Q4.7.6:: Is there a MatLab mode? @end menu @node Q4.0.1, Q4.0.2, Subsystems, Subsystems -@unnumberedsec Reading Mail with VM +@unnumberedsec 4.0: Reading Mail with VM @unnumberedsubsec Q4.0.1: How do I set up VM to retrieve mail from a remote site using POP? Use @code{vm-spool-files}, like this for example: @@ -3975,8 +4117,11 @@ Also see the Mail Filtering FAQ at: @iftex @* -@end iftex -@uref{http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq/faq.html}. +@end iftex +@uref{ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/filtering-faq}. +@c Link above, +@c +@c was dead. @node Q4.0.3, Q4.0.4, Q4.0.2, Subsystems @unnumberedsubsec Q4.0.3: How can I get VM to automatically check for new mail? @@ -4009,7 +4154,7 @@ Set @code{vm-reply-ignored-addresses} to a list, like @lisp -(setq vm-reply-ignored-addresses +(setq vm-reply-ignored-addresses '("wing@@nuspl@@nvwls.cc.purdue.edu,netcom[0-9]*.netcom.com" "wing@@netcom.com" "wing@@666.com")) @end lisp @@ -4019,7 +4164,7 @@ @node Q4.0.7, Q4.0.8, Q4.0.6, Subsystems @unnumberedsubsec Q4.0.7: Is there a mailing list or FAQ for VM? -A FAQ for VM exists at @uref{http://www.cyberpass.net/~gorkab/vmfaq.htm}. +A FAQ for VM exists at @uref{http://www.cyberpass.net/~gorkab/vmfaq.htm}. VM has its own newsgroups gnu.emacs.vm.info and gnu.emacs.vm.bug. @@ -4070,7 +4215,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 @@ -4128,23 +4273,23 @@ @node Q4.0.11, Q4.0.12, Q4.0.10, Subsystems @unnumberedsubsec Q4.0.11: How do I make VM or mh-e display graphical smilies? - +@c Changed June For mh-e use the following: @lisp -(add-hook 'mh-show-mode-hook '(lambda () +(add-hook 'mh-show-mode-hook '(lambda () (smiley-region (point-min) (point-max)))) @end lisp -For vm use the following: +@email{bill@@carpenter.ORG, WJCarpenter} writes: +For VM use the following: @lisp -(require 'messagexmas) -(require 'smiley) -(add-hook 'vm-select-message-hook - '(lambda () - (smiley-region (point-min) - (point-max)))) + (autoload 'smiley-region "smiley" nil t) + (add-hook 'vm-select-message-hook + '(lambda () + (smiley-region (point-min) + (point-max)))) @end lisp For tm use the following: @@ -4177,7 +4322,7 @@ @end quotation @node Q4.1.1, Q4.1.2, Q4.0.12, Subsystems -@unnumberedsec Web browsing with W3 +@unnumberedsec 4.1: Web browsing with W3 @unnumberedsubsec Q4.1.1: What is W3? W3 is an advanced graphical browser written in Emacs lisp that runs on @@ -4199,7 +4344,7 @@ full-featured web browser. @node Q4.2.1, Q4.2.2, Q4.1.3, Subsystems -@unnumberedsec Reading Netnews and Mail with Gnus +@unnumberedsec 4.2: Reading Netnews and Mail with Gnus @unnumberedsubsec Q4.2.1: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Quassia Gnus, argh! The Gnus numbering issues are not meant for mere mortals to know them. @@ -4207,7 +4352,7 @@ excellent FAQ, maintained by Justin Sheehy, at: @example -@uref{http://www.ccs.neu.edu/software/gnus/} +@uref{http://www.ccs.neu.edu/software/contrib/gnus/} @end example See also Gnus home page @@ -4239,12 +4384,14 @@ @unnumberedsubsec Q4.2.4: How do I customize the From: line? How do I change the @code{From:} line? I have set gnus-user-from-line -to @example +to +@example Gail Gurman @end example @noindent , but XEmacs Gnus doesn't use -it. Instead it uses @example -Gail Mara Gurman @email{gailg@@deall} +it. Instead it uses +@example +Gail Mara Gurman @email{gailg@@deall} @end example @noindent and then complains that it's incorrect. Also, as you perhaps can see, my Message-ID is @@ -4258,20 +4405,11 @@ @end quotation @node Q4.3.1, Q4.3.2, Q4.2.4, Subsystems -@unnumberedsec Other Mail & News +@unnumberedsec 4.3: Other Mail & News @unnumberedsubsec Q4.3.1: How can I read and/or compose MIME messages? - -One answer is @code{tra-vm-mime}. You may find it at -@iftex -@* -@end iftex -@uref{http://lenkkari.cs.tut.fi/~tra/software/tra-vm-mime.el}. - -Another possibility is RMIME. You may find RMIME at -@iftex -@* -@end iftex -@uref{http://www.cinti.net/~rmoody/rmime/index.html}. +@c Changed June + +VM supports MIME natively. You probably want to use the Tools for MIME (tm). @xref{Q4.3.2} for details. @@ -4279,9 +4417,17 @@ @email{trey@@cs.berkeley.edu, Trey Jackson} has an Emacs & MIME web page at @iftex @* -@end iftex +@end iftex @uref{http://bmrc.berkeley.edu/~trey/emacs/mime.html}. + +Another possibility is RMIME. You may find RMIME at +@iftex +@* +@end iftex +@uref{http://www.cinti.net/~rmoody/rmime/index.html}. + + @node Q4.3.2, Q4.3.3, Q4.3.1, Subsystems @unnumberedsubsec Q4.3.2: What is TM and where do I get it? @@ -4295,7 +4441,7 @@ TM was written by @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} and @email{shuhei-k@@jaist.ac.jp, KOBAYASHI -Shuhei}. +Shuhei}. It is based on the work of @email{umerin@@mse.kyutech.ac.jp, UMEDA Masanobu}, the original writer of GNUS. @@ -4316,6 +4462,8 @@ @itemize @bullet @item @uref{ftp://ftp.jaist.ac.jp/pub/GNU/elisp/mime/} (Japan). @item @uref{ftp://ftp.nis.co.jp/pub/gnu/emacs-lisp/tm/} (Japan). +@c The host above is unknown. + @item @uref{ftp://ftp.nisiq.net/pub/gnu/emacs-lisp/tm/} (US). @item @uref{ftp://ftp.miranova.com/pub/gnus/jaist.ac.jp/} (US). @item @uref{ftp://ftp.unicamp.br/pub/mail/mime/tm/} (Brasil). @@ -4349,7 +4497,7 @@ Please refer to @email{jwz@@netscape.com, Jamie Zawinski's} notes at @iftex @* -@end iftex +@end iftex @uref{http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/movemail.html}. In particular, this document will show you how to make Netscape use the version of movemail configured for your system by the person who built @@ -4363,10 +4511,10 @@ @email{vroonhof@@math.ethz.ch, Jan Vroonhof} writes: latex2html is best found at the CTAN hosts and their mirrors -in +in @iftex @* -@end iftex +@end iftex @file{tex-archive/support/latex2html}. CTAN hosts are: @@ -4379,11 +4527,11 @@ There is a good mirror at ftp.cdrom.com; @iftex @* -@end iftex +@end iftex @uref{ftp://ftp.cdrom.com/pub/tex/ctan/support/latex2html/}. @node Q4.4.1, Q4.5.1, Q4.3.5, Subsystems -@unnumberedsec Sparcworks, EOS, and WorkShop +@unnumberedsec 4.4: Sparcworks, EOS, and WorkShop @unnumberedsubsec Q4.4.1: What is SPARCworks, EOS, and WorkShop? @email{turner@@lanl.gov, John Turner} writes: @@ -4394,7 +4542,7 @@ tools such as TeamWare (for configuration management), MakeTool, etc. @end quotation -See @uref{http://www.sun.com/sunsoft/Developer-products/} +See @uref{http://www.sun.com/software/Developer-products/} for more info. EOS stands for "Era on SPARCworks", but I don't know what Era stands @@ -4422,12 +4570,12 @@ details, check out @iftex @* -@end iftex -@uref{http://www.sun.com/sunsoft/Products/Developer-products/programs.html}. +@end iftex +@uref{http://www.sun.com/software/Products/Developer-products/programs.html}. @end quotation @node Q4.5.1, Q4.6.1, Q4.4.1, Subsystems -@unnumberedsec Energize +@unnumberedsec 4.5: Energize @unnumberedsubsec Q4.5.1: What is/was Energize? @email{gray@@meteor.harlequin.com, David N Gray} writes: @@ -4443,7 +4591,7 @@ @end quotation @node Q4.6.1, Q4.7.1, Q4.5.1, Subsystems -@unnumberedsec Infodock +@unnumberedsec 4.6: Infodock @unnumberedsubsec Q4.6.1: What is Infodock? InfoDock is an integrated productivity toolset, mainly aimed at @@ -4480,7 +4628,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 @@ -4534,7 +4682,7 @@ InfoDock questions, answers and discussion should go to the mail list @iftex @* -@end iftex +@end iftex @email{infodock@@infodock.com}. Use @email{infodock-request@@infodock.com} to be added or removed from the list. Always include your InfoDock version number when sending help @@ -4543,7 +4691,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 . - + @example cd @end example @@ -4556,7 +4704,7 @@ Login as @samp{anonymous} with your own @@ as a password. -@example +@example Name (ftp.xemacs.org): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: -@@ @@ -4603,7 +4751,7 @@ step-by-step installation instructions. @node Q4.7.1, Q4.7.2, Q4.6.1, Subsystems -@unnumberedsec Other Unbundled Packages +@unnumberedsec 4.7: Other Unbundled Packages @unnumberedsubsec Q4.7.1: What is AUC TeX? Where do you get it? AUC TeX is a package written by @email{abraham@@dina.kvl.dk, Per Abrahamsen}. @@ -4617,7 +4765,7 @@ The most recent version is always available by ftp at @iftex @* -@end iftex +@end iftex @uref{ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz}. In case you don't have access to anonymous ftp, you can get it by an @@ -4626,7 +4774,7 @@ WWW users may want to check out the AUC TeX page at @iftex @* -@end iftex +@end iftex @uref{http://sunsite.auc.dk/auctex/}. @node Q4.7.2, Q4.7.3, Q4.7.1, Subsystems @@ -4635,7 +4783,7 @@ Yes. Check out @dfn{dismal} (which stands for Dis' Mode Ain't Lotus) at @iftex @* -@end iftex +@end iftex @uref{ftp://cs.nyu.edu/pub/local/fox/dismal/}. @node Q4.7.3, Q4.7.4, Q4.7.2, Subsystems @@ -4644,7 +4792,7 @@ @email{bruncott@@dormeur.inria.fr, Georges Brun-Cottan} 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 @@ -4680,7 +4828,7 @@ @end itemize -@node Q4.7.5, , Q4.7.4, Subsystems +@node Q4.7.5, Q4.7.6, Q4.7.4, Subsystems @unnumberedsubsec Q4.7.5: Is there a reason for an Emacs package not to be included in XEmacs? The reason for an Emacs package not to be included in XEmacs is @@ -4719,6 +4867,24 @@ appreciated. @end enumerate +@node Q4.7.6, , Q4.7.5, Subsystems +@unnumberedsubsec Q4.7.5: Is there a MatLab mode? +@c New +Is there any way I can get syntax highlighting for MatLab .m files? +Can I "teach" emacs what words are MatLab commands, comments, etc. ? + +@email{elsner@@mathematik.tu-chemnitz.de, Ulrich Elsner} writes: +@quotation +One way to do this (and much more) is by using the +@iftex +@* +@end iftex +@uref{ftp://ftp.mathworks.com/pub/contrib/v5/tools/matlab.el, matlab mode}. + +Instructions on how to install this mode are included in this file. +@end quotation + + @node Miscellaneous, Current Events, Subsystems, Top @unnumbered 5 The Miscellaneous Stuff @@ -4737,8 +4903,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. @@ -4760,6 +4926,7 @@ * Q5.1.8:: I like recursion, does it slow things down? * Q5.1.9:: How do I put a glyph as annotation in a buffer? * Q5.1.10:: @code{map-extents} won't traverse all of my extents! +* Q5.1.11:: My elisp program is horribly slow. Is there an easy way to find out where it spends time? Sound: * Q5.2.1:: How do I turn off the sound? @@ -4783,7 +4950,7 @@ @end menu @node Q5.0.1, Q5.0.2, Miscellaneous, Miscellaneous -@unnumberedsec Major & Minor Modes +@unnumberedsec 5.0: Major & Minor Modes @unnumberedsubsec Q5.0.1: How can I do source code highlighting using font-lock? For most modes, font-lock is already set up and just needs to be turned @@ -4818,7 +4985,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 @@ -4868,7 +5035,7 @@ You can customize filling and adaptive filling with Customize. Select from the @code{Options} menu @code{Customize->Emacs->->Editing->Fill->Fill...} -or type @kbd{M-x customize RET fill RET}. +or type @kbd{M-x customize @key{RET} fill @key{RET}}. Note that well-behaving text-lookalike modes will run @code{text-mode-hook} by default (e.g. that's what Message does). For @@ -4927,7 +5094,7 @@ In the @code{*shell*} buffer: @lisp -M-x rename-buffer RET *shell-1* RET +M-x rename-buffer @key{RET} *shell-1* @key{RET} M-x shell RET @end lisp @@ -4987,7 +5154,7 @@ @unnumberedsubsec Q5.0.10: [This question intentionally left blank] Obsolete question, left blank to avoid renumbering - + @node Q5.0.11, Q5.0.12, Q5.0.10, Miscellaneous @unnumberedsubsec Q5.0.11: Filladapt doesn't work in 19.15 @@ -5003,7 +5170,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 @@ -5027,7 +5194,7 @@ Starting with XEmacs-20.3 you can also change this with Customize. Select from the @code{Options} menu @code{Customize->Emacs->Environment->Gnuserv->Gnuserv Frame...} or type -@kbd{M-x customize RET gnuserv RET}. +@kbd{M-x customize @key{RET} gnuserv @key{RET}}. @node Q5.0.13, Q5.0.14, Q5.0.12, Miscellaneous @@ -5110,7 +5277,7 @@ didn't put the binary into the public bin directory. It put it in @iftex @* -@end iftex +@end iftex @file{lib/xemacs-19.14/hppa1.1-hp-hpux9.05/gnuserv}. Shouldn't it have been put in @file{bin/hppa1.1-hp-hpux9.0}? @end quotation @@ -5152,7 +5319,7 @@ @end quotation @node Q5.1.1, Q5.1.2, Q5.0.20, Miscellaneous -@unnumberedsec Emacs Lisp Programming Techniques +@unnumberedsec 5.1: Emacs Lisp Programming Techniques @unnumberedsubsec Q5.1.1: What is the difference in key sequences between XEmacs and GNU Emacs? @email{clerik@@naggum.no, Erik Naggum} writes; @@ -5235,7 +5402,7 @@ the words described below, the characters of each word go directly as characters of the macro. The whitespace that separates words is ignored. Whitespace in the macro must be written explicitly, as in -@kbd{foo SPC bar RET}. +@kbd{foo @key{SPC} bar @key{RET}}. @itemize @bullet @item @@ -5247,8 +5414,8 @@ A word in angle brackets, e.g., @code{}, @code{}, or @code{}, represents a function key. (Note that in the standard configuration, the function key @code{} and the control key -@kbd{RET} are synonymous.) You can use angle brackets on the words -@kbd{RET}, @kbd{SPC}, etc., but they are not required there. +@key{RET} are synonymous.) You can use angle brackets on the words +@key{RET}, @key{SPC}, etc., but they are not required there. @item Keys can be written by their @sc{ascii} code, using a backslash followed @@ -5273,7 +5440,7 @@ @item Double angle brackets enclose command names: @code{<>} is -shorthand for @kbd{M-x next-line RET}. +shorthand for @kbd{M-x next-line @key{RET}}. @item Finally, @code{REM} or @code{;;} causes the rest of the line to be @@ -5282,10 +5449,10 @@ Any word may be prefixed by a multiplier in the form of a decimal number and @code{*}: @code{3*} @equiv{} @code{ }, -and @code{10*foo} @equiv{} +and @code{10*foo} @equiv{} @iftex @* -@end iftex +@end iftex @code{foofoofoofoofoofoofoofoofoofoo}. Multiple text keys can normally be strung together to form a word, but @@ -5479,27 +5646,27 @@ (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. +(e.g. @iftex @* -@end iftex +@end iftex @file{/usr/local/lib/xemacs-20.2/etc/recycle.xpm}). You can turn this to a function (that optionally prompts you for a file name), and inserts the glyph at @code{(point)} instead of @code{(point-min)}. -@node Q5.1.10, Q5.2.1, Q5.1.9, Miscellaneous +@node Q5.1.10, Q5.1.11, Q5.1.9, Miscellaneous @unnumberedsubsec Q5.1.10: @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 @@ -5523,7 +5690,20 @@ nil)) @end lisp -@node Q5.2.1, Q5.2.2, Q5.1.10, Miscellaneous +@node Q5.1.11, Q5.2.1, Q5.1.10, Miscellaneous +@unnumberedsubsec Q5.1.11: My elisp program is horribly slow. Is there +an easy way to find out where it spends time? +@c New + +z@email{hniksic@@srce.hr, Hrvoje Niksic} writes: +@quotation +Under XEmacs 20.4 and later you can use @kbd{M-x profile-key-sequence}, press a key +(say @key{RET} in the Gnus Group buffer), and get the results using +@kbd{M-x profile-results}. It should give you an idea of where the time +is being spent. +@end quotation + +@node Q5.2.1, Q5.2.2, Q5.1.11, Miscellaneous @unnumberedsubsec Q5.2.1: How do I turn off the sound? Add the following line to your @file{.emacs}: @@ -5533,13 +5713,13 @@ (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. Select from the @code{Options} menu @code{Customize->Emacs->Environment->Sound->Sound...} or type -@kbd{M-x customize RET sound RET}. +@kbd{M-x customize @key{RET} sound @key{RET}}. @node Q5.2.2, Q5.2.3, Q5.2.1, Miscellaneous @@ -5580,7 +5760,7 @@ @end quotation @node Q5.3.1, Q5.3.2, Q5.2.4, Miscellaneous -@unnumberedsec Miscellaneous +@unnumberedsec 5.3: Miscellaneous @unnumberedsubsec Q5.3.1: How do you make XEmacs indent CL if-clauses correctly? I'd like XEmacs to indent all the clauses of a Common Lisp @code{if} the @@ -5644,7 +5824,7 @@ The package @code{ps-print}, which is now included with XEmacs, provides the ability to do this. The source code contains complete instructions -on its use, in @file{@email{xemacs_src_root}/lisp/packages/ps-print.el}. +on its use, in @file{/lisp/packages/ps-print.el}. @node Q5.3.4, Q5.3.5, Q5.3.3, Miscellaneous @unnumberedsubsec Q5.3.4: Getting @kbd{M-x lpr} to work with postscript printer. @@ -5695,7 +5875,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 @@ -5716,7 +5896,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 = @{ @@ -5728,17 +5908,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 @@ -5769,7 +5949,7 @@ valid abbrevs, but @samp{&d}, and @samp{x d} are not. If this sounds confusing to you, (re-)read the online documentation for -abbrevs (@kbd{C-h i m XEmacs RET m Abbrevs RET}), and then come back and +abbrevs (@kbd{C-h i m XEmacs @key{RET} m Abbrevs @key{RET}}), and then come back and read this question/answer again. @end quotation @@ -5804,7 +5984,7 @@ cat ./file.face | sed 's/\\/\\\\/g' @iftex \ @* -@end iftex +@end iftex | sed 's/\"/\\\"/g' > ./file.face.quoted @end example @@ -5813,7 +5993,7 @@ couple of suggestions here---either something like: @lisp -(setq mail-default-headers +(setq mail-default-headers "X-Face: @email{Ugly looking text string here}") @end lisp @@ -5821,7 +6001,7 @@ @lisp (defun mail-insert-x-face () - (save-excursion + (save-excursion (goto-char (point-min)) (search-forward mail-header-separator) (beginning-of-line) @@ -5852,11 +6032,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 @@ -5867,7 +6047,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 @@ -5961,12 +6141,12 @@ @menu * Q6.0.1:: What is new in 20.2? * Q6.0.2:: What is new in 20.3? -* Q6.0.3:: What is new in 20.4? +* Q6.0.3:: What is new in 20.4? * Q6.0.4:: Procedural changes in XEmacs development. @end menu @node Q6.0.1, Q6.0.2, Current Events, Current Events -@unnumberedsec Changes +@unnumberedsec 6.0: Changes @unnumberedsubsec Q6.0.1: What is new in 20.2? The biggest changes in 20.2 include integration of EFS (the next @@ -6014,15 +6194,16 @@ Discussion about the development of XEmacs occurs on the xemacs-beta mailing list. Subscriptions to this list will now be fully automated instead of being handled by hand. Send a mail message to -@email{xemacs-beta-request@@xemacs.org} with a subject of subscribe to join -the list. Please note this is a developers mailing list for people who -have an active interest in the development process. +@email{xemacs-beta-request@@xemacs.org} with @samp{subscribe} as the +BODY of the message to join the list. Please note this is a developers +mailing list for people who have an active interest in the development +process. The discussion of NT XEmacs development is taking place on a separate -mailing list. Send mail to -@iftex -@* -@end iftex +mailing list. Send mail to +@iftex +@* +@end iftex @email{xemacs-nt-request@@xemacs.org} to subscribe. diff -r 090b52736db2 -r c42ec1d1cded nt/ChangeLog --- a/nt/ChangeLog Mon Aug 13 10:32:23 2007 +0200 +++ b/nt/ChangeLog Mon Aug 13 10:33:18 2007 +0200 @@ -1,3 +1,22 @@ +1998-05-08 Kirill M. Katsnelson + + * config.h (enum_field): Redefine to be unsigned int. + +1998-05-07 Kirill M. Katsnelson + + * xemacs.mak: Really honor minimal tagbits, indexed lrecord and + union type. + +1998-05-03 Kirill M. Katsnelson + + * inc/sys/socket.h: Removed encapsulating definitions for Winsock + functions. + +1998-05-04 Kirill M. Katsnelson + + * xemacs.mak: Defined PATH_PROGNAME and PATH_VERSION C macros. + Make _DEBUG defined only when DEBUG_XEMACS. + 1998-04-26 Kirill M. Katsnelson * xemacs.mak: Added glyphs-eimage.{c,obj} diff -r 090b52736db2 -r c42ec1d1cded nt/config.h --- a/nt/config.h Mon Aug 13 10:32:23 2007 +0200 +++ b/nt/config.h Mon Aug 13 10:33:18 2007 +0200 @@ -1,4 +1,4 @@ -/* XEmacs site configuration template file. -*- C -*- +/* XEmacs configuration file for Win32 -*- C -*- Copyright (C) 1986, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. This file is part of XEmacs. @@ -641,7 +641,7 @@ #endif /* compiler understands #pragma warning*/ -#define enum_field(enumeration_type) enum enumeration_type +#define enum_field(enumeration_type) unsigned int /* We want to avoid saving the signal mask if possible, because that necessitates a system call. */ diff -r 090b52736db2 -r c42ec1d1cded nt/inc/sys/socket.h --- a/nt/inc/sys/socket.h Mon Aug 13 10:32:23 2007 +0200 +++ b/nt/inc/sys/socket.h Mon Aug 13 10:33:18 2007 +0200 @@ -8,12 +8,6 @@ #undef _WINSOCKAPI_ #endif -/* avoid confusion with our version of select */ -#ifdef select -#undef select -#define MUST_REDEF_SELECT -#endif - #if 0 /* What's wrong with winsock.h version ? - kkm */ /* avoid clashing with our version of FD_SET if already defined */ #ifdef FD_SET @@ -34,12 +28,6 @@ #include -/* redefine select to reference our version */ -#ifdef MUST_REDEF_SELECT -#define select sys_select -#undef MUST_REDEF_SELECT -#endif - #if 0 /* What's wrong with winsock.h version ? - kkm */ /* revert to our version of FD_SET */ #undef FD_SET @@ -54,31 +42,6 @@ #undef timeval #endif -/* shadow functions where we provide our own wrapper */ -#define socket sys_socket -#define bind sys_bind -#define connect sys_connect -#define htons sys_htons -#define ntohs sys_ntohs -#define inet_addr sys_inet_addr -#define gethostname sys_gethostname -#define gethostbyname sys_gethostbyname -#define getservbyname sys_getservbyname - -int sys_socket(int af, int type, int protocol); -int sys_bind (int s, const struct sockaddr *addr, int namelen); -int sys_connect (int s, const struct sockaddr *addr, int namelen); -u_short sys_htons (u_short hostshort); -u_short sys_ntohs (u_short netshort); -unsigned long sys_inet_addr (const char * cp); -int sys_gethostname (char * name, int namelen); -struct hostent * sys_gethostbyname(const char * name); -struct servent * sys_getservbyname(const char * name, const char * proto); - -/* we are providing a real h_errno variable */ -#undef h_errno -extern int h_errno; - /* map winsock error codes to standard names */ #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS diff -r 090b52736db2 -r c42ec1d1cded nt/xemacs.mak --- a/nt/xemacs.mak Mon Aug 13 10:32:23 2007 +0200 +++ b/nt/xemacs.mak Mon Aug 13 10:33:18 2007 +0200 @@ -201,19 +201,37 @@ !endif !if $(DEBUG_XEMACS) -DEBUG_DEFINES=-DDEBUG_XEMACS +DEBUG_DEFINES=-DDEBUG_XEMACS -D_DEBUG DEBUG_FLAGS= -debugtype:both -debug:full !endif +!if $(USE_MINIMAL_TAGBITS) +TAGBITS_DEFINES=-DUSE_MINIMAL_TAGBITS +!endif +!if $(USE_INDEXED_LRECORD_IMPLEMENTATION) +LRECORD_DEFINES=-DUSE_INDEXED_LRECORD_IMPLEMENTATION +!endif +!if $(USE_UNION_TYPE) +UNION_DEFINES=-DUSE_UNION_TYPE +!endif + !include "..\version.sh" +!if defined(emacs_beta_version) +XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version)-b$(emacs_beta_version) +!else +XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version) +!endif + # Generic variables INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(XEMACS)\nt\inc -I$(XEMACS)\src -I$(XEMACS)\lwlib DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \ + $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \ -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \ - -DHAVE_CONFIG_H -D_DEBUG + -DHAVE_CONFIG_H -DPATH_PROGNAME=\"xemacs\" \ + -DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\" OUTDIR=obj diff -r 090b52736db2 -r c42ec1d1cded src/ChangeLog --- a/src/ChangeLog Mon Aug 13 10:32:23 2007 +0200 +++ b/src/ChangeLog Mon Aug 13 10:33:18 2007 +0200 @@ -1,10 +1,416 @@ -1998-05-03 Olivier Galibert - - * alloc.c (make_pure_float): Remove reference to obsolete 'next' - field. - (make_float): Ditto. - - * lisp.h (struct Lisp_Float): Remove obsolete 'next' field. +1998-05-06 Oliver Graf + + * Makefile.in.in: removed dragdrop.o from objs + * config.h.in: HAVE_DRAGNDROP added + * emacs.c: do syms_of_dragdrop only if HAVE_DRAGNDROP is defined + * event-Xt.c: dragdrop.h include now depends on HAVE_DRAGNDROP + changed calls to dnd_url_hexify_string + MIME data is now a list of MIME strings or lists + this was required by CDE, and a good idea in any case + * dragdrop.c (dnd_url_hexify_string): method prefix code added + * dragdrop.h: dnd_url_hexify_string prototype changed + * frame-x.c (x_cde_transfer_callback): CDE adapted the new API + +1998-05-05 Jonathan Harris + + * event-msw.c: now creates misc-user-events on dnd drops + +1998-05-05 Oliver Graf + + * events.h: changed comment for misc_user_events + * events.c (make-event): removed dnd_data defs + * frame.c: removed everything referring to drag_and_drop_functions + * frame-x.c (x_cde_transfer_callback): disabled (needs to be changed) + * lisp.h: removed Qdnd_data + * general.c: removed Qdnd_data + * symsinit.h: added syms_of_dragdrop + * frame.el: deleted default-drag-and-drop-functions + +1998-05-04 Oliver Graf + + * events.c: removed all dnd_drop stuff + * events.h: extended misc_user_data by button info + removed dnd_drop event + * emacs.c: added call to syms_of_dragdrop + * dragdrop.c: created + * dragdrop.h: created + * event-stream.c (enqueue_misc_user_event): initialization of the + new fields of misc_user_data + dnd_drop stuff removed + * keymap.c: drop symbols removed + * Makefile.in.in: added dragdrop.o to objs + +1998-05-09 SL Baur + + * EmacsFrame.c (EmacsFrameSetValues): Fix typo. + Suggested by: Kirill M. Katsnelson + +1998-05-09 Kirill M. Katsnelson + + * This change adds four scrollbar specifiers: + {horizontal,vertical}-scrollbar-visible-p and + scrollbar-on-{top,left}-p. + Spare parts supplied by Didier Verna + + * frameslots.h: Added slots for the four specifier caching. + + * frame.h: FRAME_SCROLLBAR_{WIDTH,HEIGHT} count for scrollbar + visible specifiers. + Removed old resource-only controlled scrollbar_on_* ints. + + * frame-x.c (x_layout_widgets): Removed (to x-scrollbar.el) + initialization of old style scrollbar placement from resources. + + * frame-tty.c (tty_init_frame_1): Removed initialization of old + style scrollbar placement. + + * frame-msw.c (mswindows_init_frame_1): Removed random + initialization of scrollbar sizes to 15 pixel. + + * redisplay-msw.c (mswindows_redisplay_deadbox_maybe): Use + scrollbar placement specifiers cached values from window, instead + of the old per-frame values. + (mswindows_output_vertical_divider): Ditto. + + * redisplay-x.c (x_output_vertical_divider): Ditto. + + * redisplay-output.c (redisplay_clear_bottom_of_window): Ditto. + + * scrollbar.c (update_scrollbar_instance): Ditto. + (specifier_vars_of_scrollbar): Declared the four specifiers. + + * window.h (struct window): Defined slots for caching the new + specifiers. + + * window.c (mark_window): Mark them. + (allocate_window): Initialize them. + (struct saved_window): Store them in a cool place. + (saved_window_equal): Compare them. + (save_window_save): Save them. + (Fset_window_configuration): Fetch them back. + (window_needs_vertical_divider): Check for scrollbar placement + using window cached specs. + (window_top_gutter_height): Ditto. + (window_bottom_gutter_height): Ditto. + (window_left_gutter_width): Ditto. + (window_right_gutter_width): Ditto. + (window_scrollbar_width): Account for scrollbar visibility + specification in window. + (window_scrollbar_height): Ditto. + +1998-04-18 Kirill M. Katsnelson + + * device.c (Fdevice_system_metrics): Added function. + Moved (device-pixel-height), (device-pixel-width), + (device-mm-width), (device-mm-height), (device-bitplanes), + (device-color-cells) to device.el, amd make them call + (device-system-metrics). + + * console.h (struct console_methods): Replaced methods: + device_pixel_width_method(), device_pixel_height_method(), + device_mm_width_method(), device_mm_height_method(), + device_bitplanes_method(), device_color_cells_method() + with single device_system_metrics_method(). + (device_metrics): Declared enumeration of supported + device system metrics. + + * device-msw.c (mswindows_device_system_metrics): Implement + device_system_metrics_method(), remove six obsolete methods. + + * device-tty.c (tty_device_system_metrics): Ditto. + + * device-x.c (x_device_system_metrics): Ditto. + +1998-05-10 Kirill M. Katsnelson + + * EmacsFrame.c (update_various_frame_slots): Do not store internal + border width there. + (EmacsFrameInitialize): Do it rather here. + (EmacsFrameSetValues): If EditRes has changed internal border + width, mark frame size as slipped. + +1998-05-06 Kirill M. Katsnelson + + * frame.h (struct frame): Added char_{width,height} member + variables and access macros + Added size_slipped redisplay bit and mark/clear macros. + + * redisplay.c (redisplay_frame): Adjust frame size if size slipped + bit is set. + (redisplay_device): Call redisplay_frame if size slipped bit is set. + + * frame.c (adjust_frame_size): Redisplay beats frame back in shape + with this. Added. + (frame_size_slipped): Added. + (internal_set_frame_size): Clear size slipped bit. + (change_frame_size_1): Store real charsize into frame object. + (vars_of_frame): Declared adjust-frame-function. + + * frame-msw.c (mswindows_update_frame_external_traits): Same + change as for frame-x.c + (mswindows_frame_size_fixed_p): Implemented the method. + + * frame-x.c (x_update_frame_external_traits): Do not call + Fset_frame_size to adjust frame, redisplay will do. + + * faces.c (update_EmacsFrame): Mark frame as slipped when default + font changes. + + * toolbar.c (compute_frame_toolbars_data): Removed obsoleted call + to change_frame_size. Redisplay will fix it later. + Removed toolbar_*_changed_in_frame specifier + change handlers. + (specifier_vars_of_toolbar): Calls to these routed to + frame_size_slipped generic handler. + + * toolbar-x.c: Removed toolbar_*_changed_in_frame device methods. + + * scrollbar-x.c: Removed scrollbar_*_changed_in_frame device + methods. + + * scrollbar.c: Removed scrollbar_*_changed_in_frame specifier + change handlers. + (specifier_vars_of_scrollbar): Calls to the above changed to + frame_size_slipped generic handler. + + * menubar-x.c (x_update_frame_menubar_internal): Do not resize + frame, just mark frame size as slipped. + + * device-x.c: Removed declaration of in_specifier_change_function. + + * EmacsFrame.c (EmacsFrameSetValues): Do not check + in_specifier_change_function. + (EmacsFrameSetValues): Simulate a call to resize callback when no + actual geometry change happened. + + * console.h (struct console_methods): Removed declarations for all + _changed_in_frame methods for toolbars and scrollbars. + Added frame_size_fixed_p method. + +1998-05-08 SL Baur + + * redisplay.c (decode_mode_spec): Guard against garbage + overwriting the stack. + +1998-05-08 Kirill M. Katsnelson + + * dired-msw.c (vars_of_dired_mswindows): Syntax fix for union + lisp object type. + + * menubar-msw.c (populate_menu_add_item): Ditto. + + * ntheap.c (sbrk): Ditto. + + * ntproc.c (create_child): Ditto. + (syms_of_ntproc): Ditto. + +1998-05-07 Andy Piper + + * glyphs-msw.c: updates to support total transparency. + (mswindows_initialize_image_instance_icon): don't resize bitmaps + for icons. + (mswindows_initialize_image_instance_mask): new function. + Use these new functions as appropriate. + + * glyphs-msw.h (mswindows_initialize_image_instance_icon): + function renamed. + + * frame-msw.c: use renamed mswindows_initialize_image_instance_icon. + + * redisplay-msw.c: MaskBlt bitmaps if we have a mask, BitBlt + otherwise. + +1998-05-07 Kirill M. Katsnelson + + * unexnt.c (read_in_bss): Removed unused variables, replaced exits + with aborts. + (map_in_heap): Ditto. + +1998-05-06 SL Baur + + * frame.c (adjust_frame_size): Don't mix integers and Lisp_Objects. + +1998-05-07 Kirill M. Katsnelson + + * print.c (write_string_to_stdio_stream): Under MS Windows, flush + stdio and stderr after output. Ouch. + +1998-05-05 Andy Piper + + * event-msw.c: comment out broken dnd stuff and don't use msw socket + support if we have cygwin select. + +1998-05-03 Kirill M. Katsnelson + + * events.h (STREAM_* defines): Defined constants for the parameter + FLAGS to create_stream_pair_cb(). + + * process.c (Fopen_network_stream_internal): Use flags from events.h + (Fopen_multicast_group_internal): Ditto. + + * process-unix.c (unix_create_process): Ditto. + + * event-unixoid.c (event_stream_unixoid_create_stream_pair): Ditto. + Changed #ifdef process type logic to catch configuretion errors + when no process type is defined. + + * event-msw.c: Implemented winsock_stream + (get_process_input_waitable): Differentiate network connections. + (emacs_mswindows_select_process): Ditto. + (emacs_mswindows_create_stream_pair): Ditto. + (emacs_mswindows_delete_stream_pair): Ditto. + + * process-nt.c: Implemented network connections. + (nt_init_process): Initialize Winsock. + + * sysdep.c (init_system_name): Ask for the right name right from + the system. + + * ntproc.c: Removed select emulation crap and dynamic Windock + loading. + + * nt.c: Removed a lot of terrible wrappers for socket functions. + + * s/windowsnt.h: Removed sys_select encapsulation. + +1998-05-05 Hrvoje Niksic + + * search.c (Fmatch_data): Synch with FSF. + +1998-05-04 Greg Klanderman + + * events.h: Add extern declarations for focus_follows_mouse and + investigate_frame_change(). + * cmdloop.c (Fcommand_loop_1): cleanup focus-follows-mouse + handling - move externs to events.h. + +1998-05-05 Andy Piper + + * glyphs-msw.c: generate an AND mask when creating an icon and really + make it an icon if that is what is required. + + * glyphs-msw.h (mswindows_create_icon_from_image): new cursor + argument. + + * frame-msw.c (mswindows_set_frame_pointer): set the frame cursor when + asked. + +1998-05-05 Michael Sperber [Mr. Preprocessor] + + * s/windowsnt.h: + * s/rtu.h: + * s/aix4.h: + * m/wicat.h: + * m/gould.h: + * m/gould-np1.h + * unexhp9k3.c: + * unexconvex.c: + * unexalpha.c: + * unexaix.c: + * regex.c: + * process-unix.c: + * mule-mcpath.c: + * msdos.c: + * lisp.h: + * gmalloc.c: + * getloadavg.c: + * broken-sun.h: + Removed references to ancient bcmp, bzero, and bcopy. + +1998-05-04 Andy Piper + + * gui.el: make gui-button-face colors apply in the mswindows + domain as well as for x. + + * objects-msw.c (mswindows_string_to_color): grok + rgb:rrrr/gggg/bbbb color formats used by xpm-button.el. + +1998-05-04 Greg Klanderman + + * window.c (Fselect_window): Add optional second argument + `norecord' to avoid recording a buffer change. + * window.h: change the EXFUN for Fselect_window. + * window.c (Fdelete_window): call Fselect_window with 2nd arg Qnil. + (Fother_window): ditto. + (temp_output_buffer_show): ditto. + (Fset_window_configuration): ditto. + (Fset_window_configuration): ditto. + * frame.c (Fselect_frame): ditto. + (Fset_frame_selected_window): ditto. + (delete_frame_internal): ditto. + * device.c (Fselect_device): ditto. + * console.c (Fselect_console): ditto. + * callint.c (Fcall_interactively): ditto. + +1998-05-05 Hrvoje Niksic + + * search.c (Fregexp_quote): Loop by characters, not by bytes. + +1998-05-05 Jan Vroonhof + + * redisplay.c (window_line_number): Guard against selected_device + = nil. + + * frame-x.c (x_init_frame_2): Revert to updating frame title. + +1998-05-05 SL Baur + + * emacs.c (shut_down_emacs): Update crash report information. + +1998-05-04 Kyle Jones + + * linuxplay.c: Initialize audio_dev to /dev/dsp at + compile time instead of at run-time. Don't initialize + mixer_fd, audio_fd and audio_vol to -1; none of them need + it, and XEmacs will crash on some architectures when + these variable are modified after being initialized. + Declare audio_dev, audio_vol, audio_fd, and mixer_fd as + static, since none of them need to be visible outside + linuxplay.c. + +1998-04-27 Hrvoje Niksic + + * eldap.c (make_ldap): New function. + (finalize_ldap): Use it. + (Fldap_open): Ditto. + + * eldap.c (struct Lisp_LDAP): Removed connection status symbol. + + * eldap.h (LDAP_LIVE_P): Removed + (CHECK_LIVE_LDAP): Adapt to changes in struct Lisp_LDAP + +1998-05-03 Hrvoje Niksic + + * lread.c: (read_escape): Restore handling of \M-a; clarify + comment. + +1998-05-04 Kyle Jones + + * realpath.c: Rename realpath() to xrealpath(). + + * fileio.c: Call xrealpath() instead of realpath(). + + * sysdep.h: Use #define to map xrealpath() calls to + realpath() on systems that have realpath(). + +1998-05-04 Martin Buchholz + + * rangetab.c: + * rangetab.h: Move #include's from rangetab.h into rangetab.c for + consistency. + * inline.c: include rangetab.h to get GCC inlines + +1998-05-03 SL Baur + + * event-stream.c (event_stream_next_event): Reverse previous patch to + slow down poll for quit. + Suggested by Kyle Jones + + * lread.c (read_escape): Turn off interpretation of "\M..." + Suggested by Olivier Galibert + + * lread.c (read_escape): add explanatory comment about why + FSF_KEYS are being turned off. 1998-05-02 SL Baur diff -r 090b52736db2 -r c42ec1d1cded src/EmacsFrame.c --- a/src/EmacsFrame.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/EmacsFrame.c Mon Aug 13 10:33:18 2007 +0200 @@ -254,8 +254,6 @@ { ew->emacs_frame.frame->pixheight = ew->core.height; ew->emacs_frame.frame->pixwidth = ew->core.width; - ew->emacs_frame.frame->internal_border_width = - ew->emacs_frame.internal_border_width; } static void @@ -267,6 +265,9 @@ if (!f) fatal ("can't create an emacs frame widget without a frame."); + + ew->emacs_frame.frame->internal_border_width = + ew->emacs_frame.internal_border_width; } void emacs_Xt_event_handler (Widget wid /* unused */, @@ -350,8 +351,9 @@ int rows; XtWidgetGeometry req, repl; + update_various_frame_slots (ew); + pixel_to_char_size (f, ew->core.width, ew->core.height, &columns, &rows); - update_various_frame_slots (ew); change_frame_size (f, rows, columns, 0); /* Now we tell the EmacsShell that we've changed the size of the non-fixed @@ -371,13 +373,14 @@ static Boolean EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, - ArgList dum1, Cardinal *dum2) + ArgList argv, Cardinal *argc) { EmacsFrame cur = (EmacsFrame) cur_widget; EmacsFrame new = (EmacsFrame) new_widget; + struct frame *f = new->emacs_frame.frame; Lisp_Object frame; - XSETFRAME (frame, new->emacs_frame.frame); + XSETFRAME (frame, f); in_resource_setting++; /* This function does not need to do much. Pretty much everything interesting will get done in the resize method, which will @@ -397,13 +400,18 @@ x_wm_set_shell_iconic_p (FRAME_X_SHELL_WIDGET (new->emacs_frame.frame), new->emacs_frame.iconic); - if (!in_specifier_change_function) - { /* If we got here, then we were likely called as a result of the EditRes protocol, so go ahead and change scrollbar-width and scrollbar-height. Otherwise, we're merely mirroring a change made to scrollbar-width etc. so don't do anything special. */ + if (cur->emacs_frame.internal_border_width != + new->emacs_frame.internal_border_width) + { + f->internal_border_width = new->emacs_frame.internal_border_width; + MARK_FRAME_SIZE_SLIPPED (f); + } + #ifdef HAVE_SCROLLBARS if (cur->emacs_frame.scrollbar_width != new->emacs_frame.scrollbar_width) @@ -468,8 +476,26 @@ make_int (new->emacs_frame.right_toolbar_border_width), frame, Qnil, Qnil); #endif /* HAVE_TOOLBARS */ + + in_resource_setting--; + + /* If the request was to resize us, but the size has not changed, Xt + will do nothing, and won't call our resize callback. Since such a + request might be issued as a result of hiding/showing menubar or + changing toolbar placement, where we rely on relayout made by the + callback, we go ahead and simulate such a call */ + if (cur->core.width == new->core.width + && cur->core.height == new->core.height) + { + int i; + for (i=0; i<*argc; i++) + if (strcmp (argv[i].name, XtNwidth) == 0 + || strcmp (argv[i].name, XtNheight) == 0) + { + EmacsFrameResize (new_widget); + break; + } } - in_resource_setting--; return False; diff -r 090b52736db2 -r c42ec1d1cded src/alloc.c --- a/src/alloc.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/alloc.c Mon Aug 13 10:33:18 2007 +0200 @@ -1271,6 +1271,7 @@ ALLOCATE_FIXED_TYPE (float, struct Lisp_Float, f); set_lheader_implementation (&(f->lheader), lrecord_float); + float_next (f) = ((struct Lisp_Float *) -1); float_data (f) = float_value; XSETFLOAT (val, f); return val; @@ -2748,6 +2749,7 @@ pure_bytes_used += sizeof (struct Lisp_Float); bump_purestat (&purestat_float, sizeof (struct Lisp_Float)); + float_next (f) = ((struct Lisp_Float *) -1); float_data (f) = num; XSETFLOAT (val, f); return val; diff -r 090b52736db2 -r c42ec1d1cded src/broken-sun.h --- a/src/broken-sun.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/broken-sun.h Mon Aug 13 10:33:18 2007 +0200 @@ -44,8 +44,6 @@ /* 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! */ int tolower (int); diff -r 090b52736db2 -r c42ec1d1cded src/callint.c --- a/src/callint.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/callint.c Mon Aug 13 10:33:18 2007 +0200 @@ -468,7 +468,7 @@ run_hook (Qmouse_leave_buffer_hook); #endif - Fselect_window (window); + Fselect_window (window, Qnil); } } } diff -r 090b52736db2 -r c42ec1d1cded src/cmdloop.c --- a/src/cmdloop.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/cmdloop.c Mon Aug 13 10:33:18 2007 +0200 @@ -535,12 +535,8 @@ { /* If focus_follows_mouse, make sure the frame with window manager focus is selected. */ - { extern void investigate_frame_change (void); - extern int focus_follows_mouse; - - if (focus_follows_mouse) - investigate_frame_change (); - } + if (focus_follows_mouse) + investigate_frame_change (); /* Make sure the current window's buffer is selected. */ { diff -r 090b52736db2 -r c42ec1d1cded src/config.h.in --- a/src/config.h.in Mon Aug 13 10:32:23 2007 +0200 +++ b/src/config.h.in Mon Aug 13 10:33:18 2007 +0200 @@ -441,6 +441,9 @@ /* Compile in support for OffiX Drag and Drop? */ #undef HAVE_OFFIX_DND +/* Compile in generic Drag'n'Drop API */ +#undef HAVE_DRAGNDROP + /* Compile in support for proper session-management. */ #undef HAVE_SESSION diff -r 090b52736db2 -r c42ec1d1cded src/console.c --- a/src/console.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/console.c Mon Aug 13 10:33:18 2007 +0200 @@ -271,7 +271,7 @@ if (!NILP (frame)) { struct frame *f = XFRAME(frame); - Fselect_window (FRAME_SELECTED_WINDOW (f)); + Fselect_window (FRAME_SELECTED_WINDOW (f), Qnil); } else error ("Can't select console with no frames."); diff -r 090b52736db2 -r c42ec1d1cded src/console.h --- a/src/console.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/console.h Mon Aug 13 10:33:18 2007 +0200 @@ -42,6 +42,22 @@ could be different, and input would come directly from the console). */ + +/* GCC does not like forward enum declaration. This needs to be + defined here. What a disgust! */ + +enum device_metrics +{ + color_default, color_select, color_balloon, color_3d_face, color_3d_light, + color_3d_dark, color_menu, color_menu_high, color_menu_button, + color_menu_unsel, color_toolbar, color_scrollbar, color_desktop, + color_workspace, font_default, font_menubar, font_dialog, size_cursor, + size_scrollbar, size_menu, size_toolbar, size_tbbutton, size_tbborder, + size_icon, size_icon_small, size_device, size_workspace, size_device_mm, + device_dpi, num_bit_planes, num_color_cells,mouse_buttons, + swap_buttons, show_sounds, slow_device, security, dbcs, ime, mid_east +}; + struct console_methods { CONST char *name; /* Used by print_console, print_device, print_frame */ @@ -70,12 +86,7 @@ void (*delete_device_method) (struct device *); void (*mark_device_method) (struct device *, void (*)(Lisp_Object)); void (*asynch_device_change_method) (void); - int (*device_pixel_width_method) (struct device *); - int (*device_pixel_height_method) (struct device *); - int (*device_mm_width_method) (struct device *); - int (*device_mm_height_method) (struct device *); - int (*device_bitplanes_method) (struct device *); - int (*device_color_cells_method) (struct device *); + Lisp_Object (*device_system_metrics_method) (struct device *, enum device_metrics); unsigned int (*device_implementation_flags_method) (); /* frame methods */ @@ -113,6 +124,7 @@ void (*popup_menu_method) (Lisp_Object menu, Lisp_Object event); Lisp_Object (*get_frame_parent_method) (struct frame *f); void (*update_frame_external_traits_method) (struct frame *f, Lisp_Object name); + int (*frame_size_fixed_p_method) (struct frame *f); /* redisplay methods */ int (*left_margin_width_method) (struct window *); @@ -215,15 +227,6 @@ #ifdef HAVE_TOOLBARS /* toolbar methods */ - void (*toolbar_size_changed_in_frame_method) (struct frame *f, - enum toolbar_pos pos, - Lisp_Object oldval); - void (*toolbar_border_width_changed_in_frame_method) (struct frame *f, - enum toolbar_pos pos, - Lisp_Object oldval); - void (*toolbar_visible_p_changed_in_frame_method) (struct frame *f, - enum toolbar_pos pos, - Lisp_Object oldval); void (*output_frame_toolbars_method) (struct frame *); void (*initialize_frame_toolbars_method) (struct frame *); void (*free_frame_toolbars_method) (struct frame *); @@ -240,11 +243,6 @@ void (*release_scrollbar_instance_method) (struct scrollbar_instance *); void (*create_scrollbar_instance_method) (struct frame *, int, struct scrollbar_instance *); - void (*scrollbar_width_changed_in_frame_method) (Lisp_Object, struct frame *, - Lisp_Object); - void (*scrollbar_height_changed_in_frame_method) (Lisp_Object, - struct frame *, - Lisp_Object); void (*update_scrollbar_instance_values_method) (struct window *, struct scrollbar_instance *, int, int, int, int, int, diff -r 090b52736db2 -r c42ec1d1cded src/depend --- a/src/depend Mon Aug 13 10:32:23 2007 +0200 +++ b/src/depend Mon Aug 13 10:33:18 2007 +0200 @@ -10,7 +10,7 @@ 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 lstream.h menubar-msw.h msdos.h mule-charset.h nt.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h systime.h syswait.h toolbar.h +event-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h dragdrop.h events-mod.h events.h frame.h frameslots.h lstream.h menubar-msw.h msdos.h mule-charset.h nt.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.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 glyphs-msw.h glyphs.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.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 @@ -25,7 +25,7 @@ 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 +frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h 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 bytecode.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 @@ -86,6 +86,7 @@ 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 +dragdrop.o: $(LISP_H) dragdrop.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 @@ -93,7 +94,7 @@ 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-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 dragdrop.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 @@ -122,7 +123,7 @@ 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 +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 rangetab.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 diff -r 090b52736db2 -r c42ec1d1cded src/device-msw.c --- a/src/device-msw.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/device-msw.c Mon Aug 13 10:33:18 2007 +0200 @@ -135,40 +135,30 @@ DdeUninitialize (mswindows_dde_mlid); } -static int -mswindows_device_pixel_width (struct device *d) -{ - return(DEVICE_MSWINDOWS_HORZRES(d)); -} - -static int -mswindows_device_pixel_height (struct device *d) -{ - return(DEVICE_MSWINDOWS_VERTRES(d)); -} - -static int -mswindows_device_mm_width (struct device *d) +static Lisp_Object +mswindows_device_system_metrics (struct device *d, + enum device_metrics m) { - return(DEVICE_MSWINDOWS_HORZSIZE(d)); -} - -static int -mswindows_device_mm_height (struct device *d) -{ - return(DEVICE_MSWINDOWS_VERTSIZE(d)); -} + switch (m) + { + case size_device: + return Fcons (make_int (DEVICE_MSWINDOWS_HORZRES(d)), + make_int (DEVICE_MSWINDOWS_VERTRES(d))); + break; + case size_device_mm: + return Fcons (make_int (DEVICE_MSWINDOWS_HORZSIZE(d)), + make_int (DEVICE_MSWINDOWS_VERTSIZE(d))); + break; + case num_bit_planes: + return make_int (DEVICE_MSWINDOWS_PLANES(d)); + break; + case num_color_cells: + return make_int (DEVICE_MSWINDOWS_CELLS(d)); + break; + } -static int -mswindows_device_bitplanes (struct device *d) -{ - return(DEVICE_MSWINDOWS_PLANES(d)); -} - -static int -mswindows_device_color_cells (struct device *d) -{ - return(DEVICE_MSWINDOWS_CELLS(d)); + /* Do not know such property */ + return Qnil; } static unsigned int @@ -208,12 +198,7 @@ CONSOLE_HAS_METHOD (mswindows, finish_init_device); /* CONSOLE_HAS_METHOD (mswindows, mark_device); */ CONSOLE_HAS_METHOD (mswindows, delete_device); - CONSOLE_HAS_METHOD (mswindows, device_pixel_width); - CONSOLE_HAS_METHOD (mswindows, device_pixel_height); - CONSOLE_HAS_METHOD (mswindows, device_mm_width); - CONSOLE_HAS_METHOD (mswindows, device_mm_height); - CONSOLE_HAS_METHOD (mswindows, device_bitplanes); - CONSOLE_HAS_METHOD (mswindows, device_color_cells); + CONSOLE_HAS_METHOD (mswindows, device_system_metrics); CONSOLE_HAS_METHOD (mswindows, device_implementation_flags); } diff -r 090b52736db2 -r c42ec1d1cded src/device-tty.c --- a/src/device-tty.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/device-tty.c Mon Aug 13 10:33:18 2007 +0200 @@ -180,20 +180,22 @@ #endif /* SIGWINCH */ -static int -tty_device_pixel_width (struct device *d) +static Lisp_Object +tty_device_system_metrics (struct device *d, + enum device_metrics m) { struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); - return CONSOLE_TTY_DATA (con)->width; -} + switch (m) + { + case size_device: + return Fcons (make_int (CONSOLE_TTY_DATA (con)->width), + make_int (CONSOLE_TTY_DATA (con)->height)); + break; + } -static int -tty_device_pixel_height (struct device *d) -{ - struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); - return CONSOLE_TTY_DATA (con)->height; + /* Do not know such property */ + return Qnil; } - /************************************************************************/ /* initialization */ @@ -215,8 +217,7 @@ #ifdef SIGWINCH CONSOLE_HAS_METHOD (tty, asynch_device_change); #endif /* SIGWINCH */ - CONSOLE_HAS_METHOD (tty, device_pixel_width); - CONSOLE_HAS_METHOD (tty, device_pixel_height); + CONSOLE_HAS_METHOD (tty, device_system_metrics); } void diff -r 090b52736db2 -r c42ec1d1cded src/device-x.c --- a/src/device-x.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/device-x.c Mon Aug 13 10:33:18 2007 +0200 @@ -97,8 +97,6 @@ /* Functions to synchronize mirroring resources and specifiers */ int in_resource_setting; -int in_specifier_change_function; - /************************************************************************/ /* helper functions */ @@ -1397,52 +1395,32 @@ return make_int (DEVICE_X_DEPTH (decode_x_device (device))); } -static int -x_device_pixel_width (struct device *d) -{ - Display *dpy = DEVICE_X_DISPLAY (d); - - return DisplayWidth (dpy, DefaultScreen (dpy)); -} - -static int -x_device_pixel_height (struct device *d) -{ - Display *dpy = DEVICE_X_DISPLAY (d); - - return DisplayHeight (dpy, DefaultScreen (dpy)); -} - -static int -x_device_mm_width (struct device *d) +static Lisp_Object +x_device_system_metrics (struct device *d, + enum device_metrics m) { Display *dpy = DEVICE_X_DISPLAY (d); - return DisplayWidthMM (dpy, DefaultScreen (dpy)); -} - -static int -x_device_mm_height (struct device *d) -{ - Display *dpy = DEVICE_X_DISPLAY (d); - - return DisplayHeightMM (dpy, DefaultScreen (dpy)); -} + switch (m) + { + case size_device: + return Fcons (make_int (DisplayWidth (dpy, DefaultScreen (dpy))), + make_int (DisplayHeight (dpy, DefaultScreen (dpy)))); + break; + case size_device_mm: + return Fcons (make_int (DisplayWidthMM (dpy, DefaultScreen (dpy))), + make_int (DisplayHeightMM (dpy, DefaultScreen (dpy)))); + break; + case num_bit_planes: + return make_int (DisplayPlanes (dpy, DefaultScreen (dpy))); + break; + case num_color_cells: + return make_int (DisplayCells (dpy, DefaultScreen (dpy))); + break; + } -static int -x_device_bitplanes (struct device *d) -{ - Display *dpy = DEVICE_X_DISPLAY (d); - - return DisplayPlanes (dpy, DefaultScreen (dpy)); -} - -static int -x_device_color_cells (struct device *d) -{ - Display *dpy = DEVICE_X_DISPLAY (d); - - return DisplayCells (dpy, DefaultScreen (dpy)); + /* Do not know such property */ + return Qnil; } DEFUN ("x-server-vendor", Fx_server_vendor, 0, 1, 0, /* @@ -1713,12 +1691,7 @@ CONSOLE_HAS_METHOD (x, finish_init_device); CONSOLE_HAS_METHOD (x, mark_device); CONSOLE_HAS_METHOD (x, delete_device); - CONSOLE_HAS_METHOD (x, device_pixel_width); - CONSOLE_HAS_METHOD (x, device_pixel_height); - CONSOLE_HAS_METHOD (x, device_mm_width); - CONSOLE_HAS_METHOD (x, device_mm_height); - CONSOLE_HAS_METHOD (x, device_bitplanes); - CONSOLE_HAS_METHOD (x, device_color_cells); + CONSOLE_HAS_METHOD (x, device_system_metrics); { /* Initialize variables to speed up X resource interactions */ @@ -1790,5 +1763,4 @@ error_occurred = 0; in_resource_setting = 0; - in_specifier_change_function = 0; } diff -r 090b52736db2 -r c42ec1d1cded src/device.c --- a/src/device.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/device.c Mon Aug 13 10:33:18 2007 +0200 @@ -56,6 +56,18 @@ /* Qcolor defined in general.c */ Lisp_Object Qgrayscale, Qmono; +/* Device metrics symbols */ +Lisp_Object Qcolor_default, Qcolor_select, Qcolor_balloon, Qcolor_3d_face; +Lisp_Object Qcolor_3d_light, Qcolor_3d_dark, Qcolor_menu, Qcolor_menu_high; +Lisp_Object Qcolor_menu_button, Qcolor_menu_unsel, Qcolor_toolbar; +Lisp_Object Qcolor_scrollbar, Qcolor_desktop, Qcolor_workspace, Qfont_default; +Lisp_Object Qfont_menubar, Qfont_dialog, Qsize_cursor, Qsize_scrollbar; +Lisp_Object Qsize_menu, Qsize_toolbar, Qsize_tbbutton, Qsize_tbborder, Qsize_icon; +Lisp_Object Qsize_icon_small, Qsize_device, Qsize_workspace, Qsize_device_mm; +Lisp_Object Qdevice_dpi, Qmouse_buttons, Qswap_buttons; +Lisp_Object Qshow_sounds, Qslow_device, Qsecurity, Qdbcs, Qime, Qmid_east; +Lisp_Object Qnum_bit_planes, Qnum_color_cells; + Lisp_Object Qdevicep, Qdevice_live_p; Lisp_Object Qdelete_device; Lisp_Object Qcreate_device_hook; @@ -262,7 +274,8 @@ selected_frame_1()->selected_device_1()->selected_console_1(). */ if (!NILP (DEVICE_SELECTED_FRAME (XDEVICE (device)))) Fselect_window (FRAME_SELECTED_WINDOW - (XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (device))))); + (XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (device)))), + Qnil); else error ("Can't select a device with no frames"); return Qnil; @@ -870,72 +883,6 @@ return Qnil; } -DEFUN ("device-pixel-width", Fdevice_pixel_width, 0, 1, 0, /* -Return the width in pixels of DEVICE, or nil if unknown. -*/ - (device)) -{ - struct device *d = decode_device (device); - int retval = DEVMETH_OR_GIVEN (d, device_pixel_width, (d), 0); - - return retval <= 0 ? Qnil : make_int (retval); -} - -DEFUN ("device-pixel-height", Fdevice_pixel_height, 0, 1, 0, /* -Return the height in pixels of DEVICE, or nil if unknown. -*/ - (device)) -{ - struct device *d = decode_device (device); - int retval = DEVMETH_OR_GIVEN (d, device_pixel_height, (d), 0); - - return retval <= 0 ? Qnil : make_int (retval); -} - -DEFUN ("device-mm-width", Fdevice_mm_width, 0, 1, 0, /* -Return the width in millimeters of DEVICE, or nil if unknown. -*/ - (device)) -{ - struct device *d = decode_device (device); - int retval = DEVMETH_OR_GIVEN (d, device_mm_width, (d), 0); - - return retval <= 0 ? Qnil : make_int (retval); -} - -DEFUN ("device-mm-height", Fdevice_mm_height, 0, 1, 0, /* -Return the height in millimeters of DEVICE, or nil if unknown. -*/ - (device)) -{ - struct device *d = decode_device (device); - int retval = DEVMETH_OR_GIVEN (d, device_mm_height, (d), 0); - - return retval <= 0 ? Qnil : make_int (retval); -} - -DEFUN ("device-bitplanes", Fdevice_bitplanes, 0, 1, 0, /* -Return the number of bitplanes of DEVICE, or nil if unknown. -*/ - (device)) -{ - struct device *d = decode_device (device); - int retval = DEVMETH_OR_GIVEN (d, device_bitplanes, (d), 0); - - return retval <= 0 ? Qnil : make_int (retval); -} - -DEFUN ("device-color-cells", Fdevice_color_cells, 0, 1, 0, /* -Return the number of color cells of DEVICE, or nil if unknown. -*/ - (device)) -{ - struct device *d = decode_device (device); - int retval = DEVMETH_OR_GIVEN (d, device_color_cells, (d), 0); - - return retval <= 0 ? Qnil : make_int (retval); -} - DEFUN ("set-device-baud-rate", Fset_device_baud_rate, 2, 2, 0, /* Set the output baud rate of DEVICE to RATE. On most systems, changing this value will affect the amount of padding @@ -958,6 +905,135 @@ return make_int (DEVICE_BAUD_RATE (decode_device (device))); } +DEFUN ("device-system-metrics", Fdevice_system_metrics, 2, 2, 0, /* +Get metrics for DEVICE as provided by the system. + +METRIC must be a symbol specifying requested metric. Note that +the metrics returned are these provided by the system internally, +not read from resources, so obtained from the mostly internal level. + +If a metric is not provided by the system, return value is nil. +Boolean values are returned as zero and non-zero integers. + +Metrics, by group, are: + +COLORS. Colors are returned as valid color instantiators. No other +assumption on the returned valie should be made (i.e. it can be a +string on one system but a color instance on another). For colors, +returned value is a cons of foreground and background colors. Note +that if the system provides only one color of the pair, the second +one may be nil. + +'color-default Standard window text foreground and background. +'color-select Selection highligh text and backgroun colors. +'color-balloon Ballon popup text and background colors. +'color-3d-face 3-D object (button, modeline) text and surface colors. +'color-3d-light Fore and back colors for 3-D edges facing light source. +'color-3d-dark Fore and back colors for 3-D edges facing away from + light source. +'color-menu Text and background for menus +'color-menu-high Selected menu item colors +'color-menu-button Menu button colors +'color-menu-unsel Unselectable menu item colors +'color-toolbar Toolbar foreground and background colors +'color-scrollbar Scrollbar foreground and background colors +'color-desktop Desktop window colors +'color-workspace Workspace window colors + +FONTS. Fonts are returned as valid font instantiators. No other +assumption on the returned value should be made (i.e. it can be a +string on one system but font instance on another). + +'font-default Default fixed width font. +'font-menubar Menubar font +'font-dialog Dialog boxes font + +GEOMETRY. These metrics are returned as conses of (X . Y). As with colors, +either car or cdr of the cons may be nil if the system does not provide one +of corresponding dimensions. +'size-cursor Mouse cursor size. +'size-scrollbar Scrollbars (WIDTH . HEIGHT) +'size-menu Menubar height, as (nil . HEIGHT) +'size-toolbar Toolbar width and height. +'size-tbbutton Toolbar button size. +'size-tbborder Toolbar border width and height. +'size-icon Icon dimensions. +'size-icon-small Small icon dimensions. +'size-device Device screen size in pixels. +'size-workspace Workspace size in pixels. This can be less than the above + if window manager has decorations which effectively shrink + the area remaining for application windows. +'size-device-mm Device screen size in millimeters. +'device-dpi Device resolution, in dots per inch. + +'num-bit-planes Integer, number of deive bit planes. +'num-color-cells Integer, number of device color cells. + +FEATURES. This group reports various device features. Boolean values retuned +as integer 1 for true and zero for false, or nil if the feature is unknown +for the system. + +'mouse-buttons Number of mouse buttons, or zero if no mouse (integer). +'swap-buttons Non-zero if left and right mouse buttons are swapped +'show-sounds User preference for visual over audible bell (boolean). +'slow-device Device is slow, avoid animation (boolean). +'security Non-zero if user environment is secure. +'dbcs Window system supports DBCS (boolean). +'ime Device embeds an input method editor (boolean). +'mid-east Non-zero if the window system is enabled for Hebrew + and Arabic (left-to-right reading) languages. +*/ + (device, metric)) +{ + struct device *d = decode_device (device); + enum device_metrics m; + + /* Decode metric */ + if (EQ (metric, Qcolor_default)) m = color_default; + else if (EQ (metric, Qcolor_select)) m = color_select; + else if (EQ (metric, Qcolor_balloon)) m = color_balloon; + else if (EQ (metric, Qcolor_3d_face)) m = color_3d_face; + else if (EQ (metric, Qcolor_3d_light)) m = color_3d_light; + else if (EQ (metric, Qcolor_3d_dark)) m = color_3d_dark; + else if (EQ (metric, Qcolor_menu)) m = color_menu; + else if (EQ (metric, Qcolor_menu_high)) m = color_menu_high; + else if (EQ (metric, Qcolor_menu_button)) m = color_menu_button; + else if (EQ (metric, Qcolor_menu_unsel)) m = color_menu_unsel; + else if (EQ (metric, Qcolor_toolbar)) m = color_toolbar; + else if (EQ (metric, Qcolor_scrollbar)) m = color_scrollbar; + else if (EQ (metric, Qcolor_desktop)) m = color_desktop; + else if (EQ (metric, Qcolor_workspace)) m = color_workspace; + else if (EQ (metric, Qfont_default)) m = font_default; + else if (EQ (metric, Qfont_menubar)) m = font_menubar; + else if (EQ (metric, Qfont_dialog)) m = font_dialog; + else if (EQ (metric, Qsize_cursor)) m = size_cursor; + else if (EQ (metric, Qsize_scrollbar)) m = size_scrollbar; + else if (EQ (metric, Qsize_menu)) m = size_menu; + else if (EQ (metric, Qsize_toolbar)) m = size_toolbar; + else if (EQ (metric, Qsize_tbbutton)) m = size_tbbutton; + else if (EQ (metric, Qsize_tbborder)) m = size_tbborder; + else if (EQ (metric, Qsize_icon)) m = size_icon; + else if (EQ (metric, Qsize_icon_small)) m = size_icon_small; + else if (EQ (metric, Qsize_device)) m = size_device; + else if (EQ (metric, Qsize_workspace)) m = size_workspace; + else if (EQ (metric, Qsize_device_mm)) m = size_device_mm; + else if (EQ (metric, Qdevice_dpi)) m = device_dpi; + else if (EQ (metric, Qnum_bit_planes)) m = num_bit_planes; + else if (EQ (metric, Qnum_color_cells)) m = num_color_cells; + else if (EQ (metric, Qmouse_buttons)) m = mouse_buttons; + else if (EQ (metric, Qswap_buttons)) m = swap_buttons; + else if (EQ (metric, Qshow_sounds)) m = show_sounds; + else if (EQ (metric, Qslow_device)) m = slow_device; + else if (EQ (metric, Qsecurity)) m = security; + else if (EQ (metric, Qdbcs)) m = dbcs; + else if (EQ (metric, Qime)) m = ime; + else if (EQ (metric, Qmid_east)) m = mid_east; + else + signal_simple_error ("Invalid device metric symbol", metric); + + return DEVMETH_OR_GIVEN (d, device_system_metrics, (d, m), Qnil); +} + Lisp_Object domain_device_type (Lisp_Object domain) { @@ -1095,12 +1171,7 @@ DEFSUBR (Fdevice_frame_list); DEFSUBR (Fdevice_class); DEFSUBR (Fset_device_class); - DEFSUBR (Fdevice_pixel_width); - DEFSUBR (Fdevice_pixel_height); - DEFSUBR (Fdevice_mm_width); - DEFSUBR (Fdevice_mm_height); - DEFSUBR (Fdevice_bitplanes); - DEFSUBR (Fdevice_color_cells); + DEFSUBR (Fdevice_system_metrics); DEFSUBR (Fset_device_baud_rate); DEFSUBR (Fdevice_baud_rate); DEFSUBR (Fdomain_device_type); @@ -1115,6 +1186,47 @@ /* Qcolor defined in general.c */ defsymbol (&Qgrayscale, "grayscale"); defsymbol (&Qmono, "mono"); + + /* Device metrics symbols */ + defsymbol (&Qcolor_default, "color-default"); + defsymbol (&Qcolor_select, "color-select"); + defsymbol (&Qcolor_balloon, "color-balloon"); + defsymbol (&Qcolor_3d_face, "color-3d-face"); + defsymbol (&Qcolor_3d_light, "color-3d-light"); + defsymbol (&Qcolor_3d_dark, "color-3d-dark"); + defsymbol (&Qcolor_menu, "color-menu"); + defsymbol (&Qcolor_menu_high, "color-menu-high"); + defsymbol (&Qcolor_menu_button, "color-menu-button"); + defsymbol (&Qcolor_menu_unsel, "color-menu-unsel"); + defsymbol (&Qcolor_toolbar, "color-toolbar"); + defsymbol (&Qcolor_scrollbar, "color-scrollbar"); + defsymbol (&Qcolor_desktop, "color-desktop"); + defsymbol (&Qcolor_workspace, "color-workspace"); + defsymbol (&Qfont_default, "font-default"); + defsymbol (&Qfont_menubar, "font-menubar"); + defsymbol (&Qfont_dialog, "font-dialog"); + defsymbol (&Qsize_cursor, "size-cursor"); + defsymbol (&Qsize_scrollbar, "size-scrollbar"); + defsymbol (&Qsize_menu, "size-menu"); + defsymbol (&Qsize_toolbar, "size-toolbar"); + defsymbol (&Qsize_tbbutton, "size-tbbutton"); + defsymbol (&Qsize_tbborder, "size-tbborder"); + defsymbol (&Qsize_icon, "size-icon"); + defsymbol (&Qsize_icon_small, "size-icon-small"); + defsymbol (&Qsize_device, "size-device"); + defsymbol (&Qsize_workspace, "size-workspace"); + defsymbol (&Qsize_device_mm, "size-device-mm"); + defsymbol (&Qnum_bit_planes, "num-bit-planes"); + defsymbol (&Qnum_color_cells, "num-color-cells"); + defsymbol (&Qdevice_dpi, "device-dpi"); + defsymbol (&Qmouse_buttons, "mouse-buttons"); + defsymbol (&Qswap_buttons, "swap-buttons"); + defsymbol (&Qshow_sounds, "show-sounds"); + defsymbol (&Qslow_device, "slow-device"); + defsymbol (&Qsecurity, "security"); + defsymbol (&Qdbcs, "dbcs"); + defsymbol (&Qime, "ime"); + defsymbol (&Qmid_east, "mid-east"); } void diff -r 090b52736db2 -r c42ec1d1cded src/dired-msw.c --- a/src/dired-msw.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/dired-msw.c Mon Aug 13 10:33:18 2007 +0200 @@ -86,13 +86,15 @@ #endif -Lisp_Object Vmswindows_ls_sort_case_insensitive; -Lisp_Object Vmswindows_ls_round_file_size; +static int mswindows_ls_sort_case_insensitive; +static int mswindows_ls_round_file_size; + Lisp_Object Qmswindows_insert_directory; extern Lisp_Object Vmswindows_downcase_file_names; /* in device-msw.c */ + enum mswindows_sortby { MSWINDOWS_SORT_BY_NAME, MSWINDOWS_SORT_BY_NAME_NOCASE, @@ -443,12 +445,9 @@ hide_dot = 1; display_size = 0; reverse = 0; - if (NILP(Vmswindows_ls_sort_case_insensitive)) - { - sort_by = MSWINDOWS_SORT_BY_NAME; - } else { - sort_by = MSWINDOWS_SORT_BY_NAME_NOCASE; - } + sort_by = (mswindows_ls_sort_case_insensitive + ? MSWINDOWS_SORT_BY_NAME_NOCASE + : MSWINDOWS_SORT_BY_NAME); nfiles = 0; while (1) { @@ -572,7 +571,7 @@ */ double total_size, file_size, block_size; - if ((block_size = XINT(Vmswindows_ls_round_file_size)) <= 0) + if ((block_size = mswindows_ls_round_file_size) <= 0) { block_size = 0; } @@ -635,13 +634,13 @@ void vars_of_dired_mswindows (void) { - DEFVAR_LISP ("mswindows-ls-sort-case-insensitive", &Vmswindows_ls_sort_case_insensitive, /* + DEFVAR_BOOL ("mswindows-ls-sort-case-insensitive", &mswindows_ls_sort_case_insensitive, /* *Non-nil means filenames are sorted in a case-insensitive fashion. Nil means filenames are sorted in a case-sensitive fashion, just like Unix. */ ); - Vmswindows_ls_sort_case_insensitive = Qt; + mswindows_ls_sort_case_insensitive = 1; - DEFVAR_INT ("mswindows-ls-round-file-size", &Vmswindows_ls_round_file_size /* + DEFVAR_INT ("mswindows-ls-round-file-size", &mswindows_ls_round_file_size /* *If non-zero, file sizes are rounded in terms of this block size when the file totals are being calculated. This is useful for getting a more accurate estimate of allocated disk space. Note that this only affects @@ -657,5 +656,5 @@ * We should allow something like a alist here, to make the size * dependent on the drive letter, etc.. */ - Vmswindows_ls_round_file_size = 4096; + mswindows_ls_round_file_size = 4096; } diff -r 090b52736db2 -r c42ec1d1cded src/dragdrop.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dragdrop.c Mon Aug 13 10:33:18 2007 +0200 @@ -0,0 +1,117 @@ +/* Drag'n'Drop definitions + created 03-may-98 by Oliver Graf + Copyright (C) 1998 Oliver Graf + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* This file should be Mule-ized. */ + +/* A short introduction to the new Drag'n'Drop Model: + + Currently only drops from OffiX are implemented. + + A drop generates a extended misc-user-event, as defined in events.[ch]. + This event contains the same as a eval and a button event. + The function of a drop is set to 'dragdrop-drop-dispatch' which will be + defined in ../lisp/dragdrop.el. + The object of the misc-user-event has the following format: + ( TYPE . DATA ) + TYPE is one of 'dragdrop-MIME and 'dragdrop-URL + DATA - if TYPE is 'dragdrop-URL, DATA is a list of valid URL strings. It + is always a list, also if only one URL string is within it. + - if TYPE is 'dragdrop-MIME, DATA is a list of MIME elements. + Each can be a string or a list. + if it is a string it is the pure MIME data complete with header + and body. + if it is a list it should look like + ( MIME-TYPE MIME-ENCODING MIME-DATA ) + MIME-TYPE should have the format as required by tm-view, but + is a string + MIME-ENC the same (a string in this case) + MIME-DATA is a string +*/ + +#include +#include "lisp.h" +#include "dragdrop.h" + +/* Drag'n'Drop data types known by XEmacs */ +Lisp_Object Qdragdrop_MIME; +Lisp_Object Qdragdrop_URL; + +/* External defined functions to handle Drag'n'Drop */ +Lisp_Object Qdragdrop_drop_dispatch; + +/* from wget -- thanxx Hrvoje */ +/* A list of unsafe characters for encoding, as per RFC1738. '@' and + ':' (not listed in RFC) were added because of user/password + encoding, and \033 for safe printing. */ + +#define URL_UNSAFE " <>\"#%{}|\\^~[]`@:\033" + +/* HEX digit -> ASCII char */ +#define HEXD2ASC(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'A')) + +/* Encodes the unsafe characters (listed in URL_UNSAFE) in a given + string, returning a malloc-ed %XX encoded string. + if method is != NULL it is prepended to the string. */ +char * +dnd_url_hexify_string (const char *s, const char *m) +{ + const char *b; + char *p, *res; + int i; + + b = s; + for (i = 0; *s; s++, i++) + if (strchr (URL_UNSAFE, *s)) + i += 2; /* Two more characters (hex digits) */ + if (m) + { + res = (char *)xmalloc (i + 1 + strlen (m)); + strcpy (res, m); + p = res + strlen (m); + } + else + { + res = (char *)xmalloc (i + 1); + p = res; + } + for (s = b; *s; s++) + if (strchr (URL_UNSAFE, *s)) + { + const unsigned char c = *s; + *p++ = '%'; + *p++ = HEXD2ASC (c >> 4); + *p++ = HEXD2ASC (c & 0xf); + } + else + *p++ = *s; + *p = '\0'; + return res; +} + +void +syms_of_dragdrop (void) +{ + defsymbol (&Qdragdrop_MIME, "dragdrop-MIME"); + defsymbol (&Qdragdrop_URL, "dragdrop-URL"); + defsymbol (&Qdragdrop_drop_dispatch, "dragdrop-drop-dispatch"); +} diff -r 090b52736db2 -r c42ec1d1cded src/dragdrop.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dragdrop.h Mon Aug 13 10:33:18 2007 +0200 @@ -0,0 +1,40 @@ +/* Definitions for the new drag and drop model; + created 03-may-98 by Oliver Graf + Copyright (C) 1998 Oliver Graf + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef _XEMACS_DRAGDROP_H_ +#define _XEMACS_DRAGDROP_H_ + +/* Drag'n'Drop data types known by XEmacs */ +extern Lisp_Object Qdragdrop_MIME; +extern Lisp_Object Qdragdrop_URL; + +/* External defined functions to handle Drag'n'Drop */ +extern Lisp_Object Qdragdrop_drop_dispatch; + +/* some utility functions */ +char *dnd_url_hexify_string (const char *s, const char *m); + +/* emacs interface */ +void syms_of_dragdrop (void); + +#endif /* _XEMACS_DRAGDROP_H_ */ diff -r 090b52736db2 -r c42ec1d1cded src/eldap.c --- a/src/eldap.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/eldap.c Mon Aug 13 10:33:18 2007 +0200 @@ -20,7 +20,7 @@ /* Synched up with: Not in FSF. */ -/* Author: Oscar Figueiredo */ +/* Author: Oscar Figueiredo with lots of support from Hrvoje Niksic */ /* This file provides lisp primitives for access to an LDAP library conforming to the API defined in RFC 1823. @@ -40,35 +40,28 @@ #include "eldap.h" #ifdef HAVE_NS_LDAP -#define HAVE_LDAP_SET_OPTION 1 -#define HAVE_LDAP_GET_ERRNO 1 +# define HAVE_LDAP_SET_OPTION 1 +# define HAVE_LDAP_GET_ERRNO 1 #else -#undef HAVE_LDAP_SET_OPTION -#undef HAVE_LDAP_GET_ERRNO +# undef HAVE_LDAP_SET_OPTION +# undef HAVE_LDAP_GET_ERRNO #endif static int ldap_default_port; static Lisp_Object Vldap_default_base; +/* Needed by the lrecord definition */ +Lisp_Object Qldapp; + /* ldap-open plist keywords */ extern Lisp_Object Qport, Qauth, Qbinddn, Qpasswd, Qderef, Qtimelimit, Qsizelimit; /* Search scope limits */ extern Lisp_Object Qbase, Qonelevel, Qsubtree; /* Authentication methods */ -#ifdef LDAP_AUTH_KRBV41 -extern Lisp_Object Qkrbv41; -#endif -#ifdef LDAP_AUTH_KRBV42 -extern Lisp_Object Qkrbv42; -#endif +extern Lisp_Object Qkrbv41, Qkrbv42; /* Deref policy */ extern Lisp_Object Qnever, Qalways, Qfind; -/* Connection status */ -extern Lisp_Object Qopen, Qclosed; - -static Lisp_Object Qldapp; - /************************************************************************/ /* Utility Functions */ @@ -77,7 +70,7 @@ static void signal_ldap_error (LDAP *ld) { -#if HAVE_LDAP_GET_ERRNO +#ifdef HAVE_LDAP_GET_ERRNO signal_simple_error ("LDAP error", build_string (ldap_err2string (ldap_get_lderrno (ld, NULL, NULL)))); @@ -104,25 +97,29 @@ LDAP *ld; /* Name of the host we connected to */ Lisp_Object host; - /* Status of the LDAP connection. - This is a symbol: open or closed */ - Lisp_Object status_symbol; + /* Status of the LDAP connection. */ + int livep; }; +static Lisp_Object +make_ldap (struct Lisp_LDAP *ldap) +{ + Lisp_Object lisp_ldap; + XSETLDAP (lisp_ldap, ldap); + return lisp_ldap; +} static Lisp_Object mark_ldap (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - struct Lisp_LDAP *ldap = XLDAP (obj); - ((markobj) (ldap->host)); - return ldap->status_symbol; + return XLDAP (obj)->host; } static void print_ldap (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - char buf[16]; + char buf[32]; struct Lisp_LDAP *ldap = XLDAP (obj); @@ -132,8 +129,8 @@ write_c_string ("#host, printcharfun, 1); - write_c_string (" state:",printcharfun); - print_internal (ldap->status_symbol, printcharfun, 1); + if (!ldap->livep) + write_c_string ("(dead) ",printcharfun); sprintf (buf, " 0x%x>", ldap); write_c_string (buf, printcharfun); } @@ -144,9 +141,9 @@ struct Lisp_LDAP *ldap = alloc_lcrecord_type (struct Lisp_LDAP, lrecord_ldap); - ldap->ld = (LDAP *) NULL; + ldap->ld = NULL; ldap->host = Qnil; - ldap->status_symbol = Qnil; + ldap->livep = 0; return ldap; } @@ -156,13 +153,10 @@ struct Lisp_LDAP *ldap = (struct Lisp_LDAP *) header; if (for_disksave) - { - Lisp_Object obj; - XSETLDAP (obj, ldap); - signal_simple_error - ("Can't dump an emacs containing LDAP objects", obj); - } - if (EQ (ldap->status_symbol, Qopen)) + signal_simple_error ("Can't dump an emacs containing LDAP objects", + make_ldap (ldap)); + + if (ldap->livep) ldap_unbind (ldap->ld); } @@ -185,7 +179,6 @@ return LDAPP (object) ? Qt : Qnil; } - DEFUN ("ldap-host", Fldap_host, 1, 1, 0, /* Return the server host of the connection LDAP, as a string. */ @@ -195,22 +188,14 @@ return (XLDAP (ldap))->host; } - - -DEFUN ("ldap-status", Fldap_status, 1, 1, 0, /* -Return the status of the connection LDAP. -This is a symbol, one of these: - -open -- for a LDAP connection that is open. -closed -- for a LDAP connection that is closed. +DEFUN ("ldap-live-p", Fldap_status, 1, 1, 0, /* +Return t if LDAP is an active LDAP connection. */ (ldap)) { CHECK_LDAP (ldap); - return (XLDAP (ldap))->status_symbol; + return (XLDAP (ldap))->livep ? Qt : Qnil; } - - /************************************************************************/ /* Opening/Closing a LDAP connection */ @@ -233,9 +218,8 @@ */ (host, plist)) { - /* This function can call lisp */ - - struct Lisp_LDAP *lisp_ldap; + /* This function can GC */ + struct Lisp_LDAP *ldap; LDAP *ld; int ldap_port = 0; int ldap_auth = LDAP_AUTH_SIMPLE; @@ -246,15 +230,11 @@ int ldap_sizelimit = 0; int err; - Lisp_Object ldap, list, keyword, value; - struct gcpro gcpro1; - - ldap = Qnil; - GCPRO1 (ldap); + Lisp_Object list, keyword, value; CHECK_STRING (host); - EXTERNAL_PROPERTY_LIST_LOOP(list, keyword, value, plist) + EXTERNAL_PROPERTY_LIST_LOOP (list, keyword, value, plist) { /* TCP Port */ if (EQ (keyword, Qport)) @@ -265,8 +245,6 @@ /* Authentication method */ if (EQ (keyword, Qauth)) { - CHECK_SYMBOL (value); - if (EQ (value, Qsimple)) ldap_auth = LDAP_AUTH_SIMPLE; #ifdef LDAP_AUTH_KRBV41 @@ -297,7 +275,6 @@ /* Deref */ else if (EQ (keyword, Qderef)) { - CHECK_SYMBOL (value); if (EQ (value, Qnever)) ldap_deref = LDAP_DEREF_NEVER; else if (EQ (value, Qsearch)) @@ -358,7 +335,7 @@ #endif /* not LDAP_REFERRALS */ #endif /* not HAVE_LDAP_SET_OPTION */ - /* ldap_bind_s calls select and may be wedged by spurious signals */ + /* ldap_bind_s calls select and may be wedged by SIGIO. */ slow_down_interrupts (); err = ldap_bind_s (ld, ldap_binddn, ldap_passwd, ldap_auth); speed_up_interrupts (); @@ -366,14 +343,12 @@ signal_simple_error ("Failed binding to the server", build_string (ldap_err2string (err))); - lisp_ldap = allocate_ldap (); - lisp_ldap->ld = ld; - lisp_ldap->host = host; - lisp_ldap->status_symbol = Qopen; - XSETLDAP (ldap,lisp_ldap); + ldap = allocate_ldap (); + ldap->ld = ld; + ldap->host = host; + ldap->livep = 1; - UNGCPRO; - return ldap; + return make_ldap (ldap); } @@ -387,7 +362,7 @@ CHECK_LIVE_LDAP (ldap); lldap = XLDAP (ldap); ldap_unbind (lldap->ld); - lldap->status_symbol = Qclosed; + lldap->livep = 0; return Qnil; } @@ -408,9 +383,9 @@ { struct ldap_unwind_struct *unwind = (struct ldap_unwind_struct *) get_opaque_ptr (unwind_obj); - if (unwind->res != (LDAPMessage *)NULL) + if (unwind->res) ldap_msgfree (unwind->res); - if (unwind->vals != (char **)NULL) + if (unwind->vals) ldap_value_free (unwind->vals); } @@ -431,7 +406,7 @@ */ (ldap, filter, base, scope, attrs, attrsonly)) { - /* This function can call lisp */ + /* This function can GC */ /* Vars for query */ LDAP *ld; @@ -451,14 +426,14 @@ struct gcpro gcpro1, gcpro2, gcpro3; list = entry = result = Qnil; - GCPRO3(list, entry, result); + GCPRO3 (list, entry, result); - unwind.res = (LDAPMessage *)NULL; - unwind.vals = (char **)NULL; + unwind.res = NULL; + unwind.vals = NULL; /* Do all the parameter checking */ CHECK_LIVE_LDAP (ldap); - ld = (XLDAP (ldap))->ld; + ld = XLDAP (ldap)->ld; /* Filter */ CHECK_STRING (filter); @@ -476,7 +451,6 @@ /* Search scope */ if (!NILP (scope)) { - CHECK_SYMBOL (scope); if (EQ (scope, Qbase)) ldap_scope = LDAP_SCOPE_BASE; else if (EQ (scope, Qonelevel)) @@ -510,7 +484,6 @@ /* Attributes only ? */ CHECK_SYMBOL (attrsonly); - /* Perform the search */ if (ldap_search (ld, NILP (base) ? "" : (char *) XSTRING_DATA (base), @@ -532,14 +505,18 @@ /* ldap_result calls select() and can get wedged by EINTR signals */ slow_down_interrupts (); - rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &(unwind.res)); + rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &unwind.res); speed_up_interrupts (); - while ( rc == LDAP_RES_SEARCH_ENTRY ) + while (rc == LDAP_RES_SEARCH_ENTRY) { QUIT; matches ++; e = ldap_first_entry (ld, unwind.res); - message ("Parsing results... %d", matches); + /* #### This call to message() is pretty fascist, because it + destroys the current echo area contents, even when invoked + from Lisp. It should use echo_area_message() instead, and + restore the old echo area contents later. */ + message ("Parsing ldap results... %d", matches); entry = Qnil; for (a= ldap_first_attribute (ld, e, &ptr); a != NULL; @@ -549,7 +526,7 @@ unwind.vals = ldap_get_values (ld, e, a); if (unwind.vals != NULL) { - for (i=0; unwind.vals[i]!=NULL; i++) + for (i = 0; unwind.vals[i] != NULL; i++) { list = Fcons (build_string (unwind.vals[i]), list); @@ -558,12 +535,12 @@ entry = Fcons (Fnreverse (list), entry); ldap_value_free (unwind.vals); - unwind.vals = (char **)NULL; + unwind.vals = NULL; } result = Fcons (Fnreverse (entry), result); ldap_msgfree (unwind.res); - unwind.res = (LDAPMessage *)NULL; + unwind.res = NULL; slow_down_interrupts (); rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &(unwind.res)); @@ -583,14 +560,12 @@ ldap_msgfree (unwind.res); unwind.res = (LDAPMessage *)NULL; - message ("Done."); - - result = Fnreverse (result); - clear_message (); + /* #### See above for calling message(). */ + message ("Parsing ldap results... done"); unbind_to (speccount, Qnil); UNGCPRO; - return result; + return Fnreverse (result); } @@ -598,7 +573,6 @@ syms_of_eldap (void) { defsymbol (&Qldapp, "ldapp"); - DEFSUBR (Fldapp); DEFSUBR (Fldap_host); DEFSUBR (Fldap_status); diff -r 090b52736db2 -r c42ec1d1cded src/eldap.h --- a/src/eldap.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/eldap.h Mon Aug 13 10:33:18 2007 +0200 @@ -38,13 +38,12 @@ #define GC_LDAPP(x) GC_RECORDP (x, ldap) #define CHECK_LDAP(x) CHECK_RECORD (x, ldap) #define CONCHECK_LDAP(x) CONCHECK_RECORD (x, ldap) -#define LDAP_LIVE_P(x) (EQ (x->status_symbol, Qopen)) -#define CHECK_LIVE_LDAP(ldap) do { \ - CHECK_LDAP (ldap); \ - if (!LDAP_LIVE_P (XLDAP (ldap))) \ - signal_simple_error ("Attempting to access closed LDAP connection", \ - ldap); \ +#define CHECK_LIVE_LDAP(ldap) do { \ + CHECK_LDAP (ldap); \ + if (!XLDAP (ldap)->livep) \ + signal_simple_error ("Attempting to access closed LDAP connection", \ + ldap); \ } while (0) diff -r 090b52736db2 -r c42ec1d1cded src/emacs.c --- a/src/emacs.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/emacs.c Mon Aug 13 10:33:18 2007 +0200 @@ -890,6 +890,9 @@ syms_of_elhash (); syms_of_emacs (); syms_of_eval (); +#ifdef HAVE_DRAGNDROP + syms_of_dragdrop (); +#endif syms_of_event_stream (); syms_of_events (); syms_of_extents (); @@ -2220,21 +2223,22 @@ ("Your files have been auto-saved.\n" "Use `M-x recover-session' to recover them.\n" "\n" +#ifdef INFODOCK + "Please report this bug by selecting `Report-Bug' in the InfoDock\n" + "menu.\n" +#else "Please report this bug by running the send-pr script included\n" "with XEmacs, or selecting `Send Bug Report' from the help menu.\n" "As a last resort send ordinary email to `crashes@xemacs.org'.\n" - "*MAKE SURE* to include as much configuration information as\n" - "possible; at the very least what OS and hardware you are running\n" - "on, and hopefully also what compiler and compiler options the\n" - "binary was compiled with, what options XEmacs was compiled with,\n" - "whether you are using a prebuilt binary from ftp.xemacs.org or\n" - "compiled XEmacs yourself for your system, etc.\n" +#endif + "*MAKE SURE* to include the information in the command\n" + "M-x describe-installation.\n" "\n" "If at all possible, *please* try to obtain a C stack backtrace;\n" "it will help us immensely in determining what went wrong.\n" "To do this, locate the core file that was produced as a result\n" "of this crash (it's usually called `core' and is located in the\n" - "directory in which you started XEmacs, or maybe in your home\n" + "directory in which you started the editor, or maybe in your home\n" "directory), and type\n" "\n" " gdb "); diff -r 090b52736db2 -r c42ec1d1cded src/event-Xt.c --- a/src/event-Xt.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/event-Xt.c Mon Aug 13 10:33:18 2007 +0200 @@ -58,7 +58,11 @@ #include "file-coding.h" #endif -#ifdef HAVE_OFFIX_DND +#ifdef HAVE_DRAGNDROP +#include "dragdrop.h" +#endif + +#if defined (HAVE_OFFIX_DND) #include "offix.h" #endif @@ -1123,11 +1127,11 @@ return 0; /* not for us */ XSETFRAME (emacs_event->channel, frame); - emacs_event->event_type = dnd_drop_event; + emacs_event->event_type = misc_user_event; emacs_event->timestamp = DEVICE_X_LAST_SERVER_TIMESTAMP (d); state=DndDragButtons(x_event); - + if (state & ShiftMask) modifiers |= MOD_SHIFT; if (state & ControlMask) modifiers |= MOD_CONTROL; if (state & xd->MetaMask) modifiers |= MOD_META; @@ -1141,12 +1145,12 @@ if (state & Button2Mask) button = Button2; if (state & Button1Mask) button = Button1; - emacs_event->event.dnd_drop.modifiers = modifiers; - emacs_event->event.dnd_drop.button = button; + emacs_event->event.misc.modifiers = modifiers; + emacs_event->event.misc.button = button; DndDropCoordinates(FRAME_X_TEXT_WIDGET(frame), x_event, - &(emacs_event->event.dnd_drop.x), - &(emacs_event->event.dnd_drop.y) ); + &(emacs_event->event.misc.x), + &(emacs_event->event.misc.y) ); DndGetData(x_event,&data,&size); @@ -1156,40 +1160,72 @@ case DndFiles: /* null terminated strings, end null */ { int len; + char *hurl = NULL; + while (*data) { - len = strlen ((char*) data); - l_item = make_ext_string (data, len, - FORMAT_FILENAME); - /* order is irrelevant */ + len = strlen ((char*)data); + hurl = dnd_url_hexify_string ((char *)data, "file:"); + l_item = make_string (hurl, strlen (hurl)); l_dndlist = Fcons (l_item, l_dndlist); - data += len+1; + data += len + 1; + xfree (hurl); } + l_type = Qdragdrop_URL; } break; case DndText: + l_type = Qdragdrop_MIME; + l_dndlist = list1 ( list3 ( make_string ("text/plain", 10), + make_string ("8bit", 4), + make_ext_string (data, + strlen((char *)data), + FORMAT_CTEXT) ) ); + break; case DndMIME: - /* is there a better way to format this ? */ - l_dndlist = make_ext_string (data, strlen((char *)data), - FORMAT_BINARY); + /* we have to parse this in some way to extract + content-type and params (in the tm way) and + content encoding. + OR: if data is string, let tm do the job + if data is list[2], give the first two + to tm... + */ + l_type = Qdragdrop_MIME; + l_dndlist = list1 ( make_ext_string (data, strlen((char *)data), + FORMAT_BINARY) ); break; case DndFile: case DndDir: case DndLink: case DndExe: - case DndURL: /* this could also break with FORMAT_FILENAME */ - l_dndlist = make_ext_string (data, strlen((char *)data), - FORMAT_FILENAME); + { + char *hurl = dnd_url_hexify_string (data, "file:"); + + l_dndlist = list1 ( make_string (hurl, strlen (hurl)) ); + l_type = Qdragdrop_URL; + + xfree (hurl); + } + break; + case DndURL: + /* as it is a real URL it should already be escaped + and escaping again will break them (cause % is unsave) */ + l_dndlist = list1 ( make_ext_string ((char *)data, + strlen ((char *)data), + FORMAT_FILENAME) ); + l_type = Qdragdrop_URL; break; default: /* Unknown, RawData and any other type */ - l_dndlist = make_ext_string (data, size, - FORMAT_BINARY); + l_dndlist = list1 ( list3 ( make_string ("application/octet-stream", 24), + make_string ("8bit", 4), + make_ext_string ((char *)data, size, + FORMAT_BINARY) ) ); + l_type = Qdragdrop_MIME; break; } - l_type=make_int(dtype); - - emacs_event->event.dnd_drop.data = Fcons (l_type, Fcons (l_dndlist, Qnil)); + emacs_event->event.misc.function = Qdragdrop_drop_dispatch; + emacs_event->event.misc.object = Fcons (l_type, l_dndlist); UNGCPRO; diff -r 090b52736db2 -r c42ec1d1cded src/event-msw.c --- a/src/event-msw.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/event-msw.c Mon Aug 13 10:33:18 2007 +0200 @@ -44,6 +44,7 @@ #endif #include "device.h" +#include "dragdrop.h" #include "events.h" #include "frame.h" #include "lstream.h" @@ -74,11 +75,6 @@ /* Timer ID used for button2 emulation */ #define BUTTON_2_TIMER_ID 1 -/* Drag and drop event data types (subset of types in offix-types.h) */ -#define DndFile 2 -#define DndFiles 3 -#define DndText 4 - extern Lisp_Object mswindows_get_toolbar_button_text (struct frame* f, int command_id); extern Lisp_Object @@ -445,8 +441,6 @@ /* Pipe outstream - writes process input */ /************************************************************************/ -#define MAX_FLUSH_TIME 500 - #define NTPIPE_SHOVE_STREAM_DATA(stream) \ LSTREAM_TYPE_DATA (stream, ntpipe_shove) @@ -606,6 +600,232 @@ } /************************************************************************/ +/* Winsock I/O stream */ +/************************************************************************/ +#if defined (HAVE_SOCKETS) && !defined(HAVE_MSG_SELECT) + +#define WINSOCK_READ_BUFFER_SIZE 1024 + +struct winsock_stream +{ + LPARAM user_data; /* Any user data stored in the stream object */ + SOCKET s; /* Socket handle (which is a Win32 handle) */ + OVERLAPPED ov; /* Overlapped I/O structure */ + void* buffer; /* Buffer. Allocated for input stream only */ + unsigned int bufsize; /* Number of bytes last read */ + unsigned int bufpos; /* Psition in buffer for next fetch */ + unsigned int error_p :1; /* I/O Error seen */ + unsigned int eof_p :1; /* EOF Error seen */ + unsigned int pending_p :1; /* There is a pending I/O operation */ + unsigned int blocking_p :1; /* Last write attempt would block */ +}; + +#define WINSOCK_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, winsock) + +DEFINE_LSTREAM_IMPLEMENTATION ("winsock", lstream_winsock, + sizeof (struct winsock_stream)); + +static void +winsock_initiate_read (struct winsock_stream *str) +{ + ResetEvent (str->ov.hEvent); + str->bufpos = 0; + + if (!ReadFile ((HANDLE)str->s, str->buffer, WINSOCK_READ_BUFFER_SIZE, + &str->bufsize, &str->ov)) + { + if (GetLastError () == ERROR_IO_PENDING) + str->pending_p = 1; + else if (GetLastError () == ERROR_HANDLE_EOF) + str->eof_p = 1; + else + str->error_p = 1; + } + else if (str->bufsize == 0) + str->eof_p = 1; +} + +static int +winsock_reader (Lstream *stream, unsigned char *data, size_t size) +{ + struct winsock_stream *str = WINSOCK_STREAM_DATA (stream); + + /* If the current operation is not yet complete, there's nothing to + give back */ + if (str->pending_p) + { + if (WaitForSingleObject (str->ov.hEvent, 0) == WAIT_TIMEOUT) + { + errno = EAGAIN; + return -1; + } + else + { + if (!GetOverlappedResult ((HANDLE)str->s, &str->ov, &str->bufsize, TRUE)) + { + if (GetLastError() == ERROR_HANDLE_EOF) + str->bufsize = 0; + else + str->error_p = 1; + } + if (str->bufsize == 0) + str->eof_p = 1; + str->pending_p = 0; + } + } + + if (str->eof_p) + return 0; + if (str->error_p) + return -1; + + /* Return as much of buffer as we have */ + size = min (size, (size_t) (str->bufsize - str->bufpos)); + memcpy (data, (void*)((BYTE*)str->buffer + str->bufpos), size); + str->bufpos += size; + + /* Read more if buffer is exhausted */ + if (str->bufsize == str->bufpos) + winsock_initiate_read (str); + + return size; +} + +static int +winsock_writer (Lstream *stream, CONST unsigned char *data, size_t size) +{ + struct winsock_stream *str = WINSOCK_STREAM_DATA (stream); + + if (str->pending_p) + { + if (WaitForSingleObject (str->ov.hEvent, 0) == WAIT_TIMEOUT) + { + str->blocking_p = 1; + return -1; + } + else + { + DWORD dw_unused; + if (!GetOverlappedResult ((HANDLE)str->s, &str->ov, &dw_unused, TRUE)) + str->error_p = 1; + str->pending_p = 0; + } + } + + str->blocking_p = 0; + + if (str->error_p) + return -1; + + if (size == 0) + return 0; + + { + ResetEvent (str->ov.hEvent); + + if (WriteFile ((HANDLE)str->s, data, size, NULL, &str->ov) + || GetLastError() == ERROR_IO_PENDING) + str->pending_p = 1; + else + str->error_p = 1; + } + + return str->error_p ? -1 : size; +} + +static int +winsock_closer (Lstream *lstr) +{ + struct winsock_stream *str = WINSOCK_STREAM_DATA (lstr); + + if (lstr->flags & LSTREAM_FL_READ) + shutdown (str->s, 0); + else + shutdown (str->s, 1); + + CloseHandle ((HANDLE)str->s); + if (str->pending_p) + WaitForSingleObject (str->ov.hEvent, INFINITE); + + if (lstr->flags & LSTREAM_FL_READ) + xfree (str->buffer); + + CloseHandle (str->ov.hEvent); + return 0; +} + +static int +winsock_was_blocked_p (Lstream *stream) +{ + struct winsock_stream *str = WINSOCK_STREAM_DATA (stream); + return str->blocking_p; +} + +static Lisp_Object +make_winsock_stream_1 (SOCKET s, LPARAM param, CONST char *mode) +{ + Lisp_Object obj; + Lstream *lstr = Lstream_new (lstream_winsock, mode); + struct winsock_stream *str = WINSOCK_STREAM_DATA (lstr); + + str->s = s; + str->blocking_p = 0; + str->error_p = 0; + str->eof_p = 0; + str->pending_p = 0; + str->user_data = param; + + xzero (str->ov); + str->ov.hEvent = CreateEvent (NULL, TRUE, FALSE, NULL); + + if (lstr->flags & LSTREAM_FL_READ) + { + str->buffer = xmalloc (WINSOCK_READ_BUFFER_SIZE); + winsock_initiate_read (str); + } + + lstr->flags |= LSTREAM_FL_CLOSE_AT_DISKSAVE; + XSETLSTREAM (obj, lstr); + return obj; +} + +static Lisp_Object +make_winsock_input_stream (SOCKET s, LPARAM param) +{ + return make_winsock_stream_1 (s, param, "r"); +} + +static Lisp_Object +make_winsock_output_stream (SOCKET s, LPARAM param) +{ + return make_winsock_stream_1 (s, param, "w"); +} + +static HANDLE +get_winsock_stream_waitable (Lstream *lstr) +{ + struct winsock_stream *str = WINSOCK_STREAM_DATA (lstr); + return str->ov.hEvent; +} + +static LPARAM +get_winsock_stream_param (Lstream *lstr) +{ + struct winsock_stream *str = WINSOCK_STREAM_DATA (lstr); + return str->user_data; +} + +static void +init_winsock_stream (void) +{ + LSTREAM_HAS_METHOD (winsock, reader); + LSTREAM_HAS_METHOD (winsock, writer); + LSTREAM_HAS_METHOD (winsock, closer); + LSTREAM_HAS_METHOD (winsock, was_blocked_p); +} +#endif /* defined (HAVE_SOCKETS) */ + +/************************************************************************/ /* Dispatch queue management */ /************************************************************************/ @@ -614,8 +834,7 @@ { return (sevt->event_type == key_press_event || sevt->event_type == button_press_event - || sevt->event_type == button_release_event - || sevt->event_type == dnd_drop_event); + || sevt->event_type == button_release_event); } /* @@ -1222,11 +1441,10 @@ { DWORD len = DdeGetData (hdata, NULL, 0, 0); char *cmd = alloca (len+1); -#ifdef __CYGWIN32__ - char *cmd_1; -#endif char *end; - Lisp_Object l_dndlist; + char *filename; + struct gcpro gcpro1, gcpro2; + Lisp_Object l_dndlist = Qnil; Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); struct Lisp_Event *event = XEVENT (emacs_event); @@ -1234,7 +1452,8 @@ cmd[len] = '\0'; DdeFreeDataHandle (hdata); - /* Check syntax & that it's an [Open("foo")] command */ + /* Check syntax & that it's an [Open("foo")] command, which we + * treat like a file drop */ /* #### Ought to be generalised and accept some other commands */ if (*cmd == '[') cmd++; @@ -1258,27 +1477,37 @@ end++; if (*end) return DDE_FNOTPROCESSED; + #ifdef __CYGWIN32__ - CYGWIN_CONV_PATH(cmd,cmd_1); - cmd = cmd_1; + filename = alloca (cygwin32_win32_to_posix_path_list_buf_size (cmd) + 5); + strcpy (filename, "file:"); + cygwin32_win32_to_posix_path_list (cmd, filename+5); +#else + dostounix_filename (cmd); + filename = alloca (strlen (cmd)+6); + strcpy (filename, "file:"); + strcat (filename, cmd); #endif - l_dndlist = make_ext_string (cmd, strlen(cmd), FORMAT_FILENAME); + GCPRO2 (emacs_event, l_dndlist); + l_dndlist = make_string (filename, strlen (filename)); event->channel = Qnil; event->timestamp = GetTickCount(); - event->event_type = dnd_drop_event; - event->event.dnd_drop.button = 0; - event->event.dnd_drop.modifiers = 0; - event->event.dnd_drop.x = -1; - event->event.dnd_drop.y = -1; - event->event.dnd_drop.data = Fcons (make_int (DndFile), - Fcons (l_dndlist, Qnil)); + event->event_type = misc_user_event; + event->event.misc.button = 1; + event->event.misc.modifiers = 0; + event->event.misc.x = -1; + event->event.misc.y = -1; + event->event.misc.function = Qdragdrop_drop_dispatch; + event->event.misc.object = Fcons (Qdragdrop_URL, + Fcons (l_dndlist, Qnil)); mswindows_enqueue_dispatch_event (emacs_event); - + UNGCPRO; return (HDDEDATA) DDE_FACK; } DdeFreeDataHandle (hdata); return (HDDEDATA) DDE_FNOTPROCESSED; + default: return (HDDEDATA) NULL; } @@ -1834,62 +2063,63 @@ { UINT filecount, i, len; POINT point; - char filename[MAX_PATH]; + char* filename; #ifdef __CYGWIN32__ char* fname; #endif - Lisp_Object l_type, l_dndlist = Qnil, l_item; + Lisp_Object l_dndlist = Qnil, l_item = Qnil; + struct gcpro gcpro1, gcpro2, gcpro3; emacs_event = Fmake_event (Qnil, Qnil); event = XEVENT(emacs_event); + GCPRO3 (emacs_event, l_dndlist, l_item); + if (!DragQueryPoint ((HANDLE) wParam, &point)) point.x = point.y = -1; /* outside client area */ - filecount = DragQueryFile ((HANDLE) wParam, -1, NULL, 0); - if (filecount == 1) + event->event_type = misc_user_event; + event->channel = mswindows_find_frame(hwnd); + event->timestamp = GetMessageTime(); + event->event.misc.button = 1; /* #### Should try harder */ + event->event.misc.modifiers = mswindows_modifier_state (NULL, 0); + event->event.misc.x = point.x; + event->event.misc.y = point.y; + event->event.misc.function = Qdragdrop_drop_dispatch; + + filecount = DragQueryFile ((HANDLE) wParam, 0xffffffff, NULL, 0); + for (i=0; i/ part and + * because they may contain reserved characters. But that's OK. */ #ifdef __CYGWIN32__ - CYGWIN_CONV_PATH(filename, fname); - len=strlen(fname); - l_dndlist = make_ext_string (fname, len, FORMAT_FILENAME); + fname = (char *)xmalloc (len+1); + DragQueryFile ((HANDLE) wParam, i, fname, len+1); + filename = xmalloc (cygwin32_win32_to_posix_path_list_buf_size (fname) + 5); + strcpy (filename, "file:"); + cygwin32_win32_to_posix_path_list (fname, filename+5); + xfree (fname); #else - l_dndlist = make_ext_string (filename, len, FORMAT_FILENAME); + filename = (char *)xmalloc (len+6); + strcpy (filename, "file:"); + DragQueryFile ((HANDLE) wParam, i, filename+5, len+1); + dostounix_filename (filename+5); #endif - } - else - { - l_type = make_int (DndFiles); - for (i=0; ichannel = mswindows_find_frame(hwnd); - event->timestamp = GetMessageTime(); - event->event_type = dnd_drop_event; - event->event.dnd_drop.button = 1; /* #### Should try harder */ - event->event.dnd_drop.modifiers = mswindows_modifier_state (NULL, 0); - event->event.dnd_drop.x = point.x; - event->event.dnd_drop.y = point.y; - event->event.dnd_drop.data = Fcons (l_type, Fcons (l_dndlist, Qnil)); + event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); mswindows_enqueue_dispatch_event (emacs_event); + UNGCPRO; } break; + defproc: default: return DefWindowProc (hwnd, message, wParam, lParam); @@ -2213,10 +2443,17 @@ static HANDLE get_process_input_waitable (struct Lisp_Process *process) { - Lisp_Object instr, outstr; + Lisp_Object instr, outstr, p; + XSETPROCESS (p, process); get_process_streams (process, &instr, &outstr); assert (!NILP (instr)); - return get_ntpipe_input_stream_waitable (XLSTREAM (instr)); +#if defined (HAVE_SOCKETS) && !defined(HAVE_MSG_SELECT) + return (network_connection_p (p) + ? get_winsock_stream_waitable (XLSTREAM (instr)) + : get_ntpipe_input_stream_waitable (XLSTREAM (instr))); +#else + return get_ntpipe_input_stream_waitable (XLSTREAM (instr)); +#endif } static void @@ -2229,11 +2466,16 @@ #ifdef HAVE_WIN32_PROCESSES { - HANDLE hprocess = get_nt_process_handle (process); - if (!add_waitable_handle (hprocess)) + Lisp_Object p; + XSETPROCESS (p, process); + if (!network_connection_p (p)) { - remove_waitable_handle (hev); - error ("Too many active processes"); + HANDLE hprocess = get_nt_process_handle (process); + if (!add_waitable_handle (hprocess)) + { + remove_waitable_handle (hev); + error ("Too many active processes"); + } } } #endif @@ -2321,14 +2563,22 @@ #error "So, WHICH kind of processes do you want?" #endif - *instream = (hin != INVALID_HANDLE_VALUE - ? make_ntpipe_input_stream (hin, fdi) - : Qnil); + *instream = (hin == INVALID_HANDLE_VALUE + ? Qnil +#if defined (HAVE_SOCKETS) && !defined (HAVE_MSG_SELECT) + : flags & STREAM_NETWORK_CONNECTION + ? make_winsock_input_stream ((SOCKET)hin, fdi) +#endif + : make_ntpipe_input_stream (hin, fdi)); #ifdef HAVE_WIN32_PROCESSES - *outstream = (hout != INVALID_HANDLE_VALUE - ? make_ntpipe_output_stream (hout, fdo) - : Qnil); + *outstream = (hout == INVALID_HANDLE_VALUE + ? Qnil +#if defined (HAVE_SOCKETS) && !defined (HAVE_MSG_SELECT) + : flags & STREAM_NETWORK_CONNECTION + ? make_winsock_output_stream ((SOCKET)hout, fdo) +#endif + : make_ntpipe_output_stream (hout, fdo)); #elif defined (HAVE_UNIX_PROCESSES) *outstream = (fdo >= 0 ? make_filedesc_output_stream (fdo, 0, -1, LSTR_BLOCKED_OK) @@ -2336,7 +2586,7 @@ #if defined(HAVE_UNIX_PROCESSES) && defined(HAVE_PTYS) /* FLAGS is process->pty_flag for UNIX_PROCESSES */ - if (flags && fdo >= 0) + if ((flags & STREAM_PTY_FLUSHING) && fdo >= 0) { Bufbyte eof_char = get_eof_char (fdo); int pty_max_bytes = get_pty_max_bytes (fdo); @@ -2345,7 +2595,12 @@ #endif #endif - return (NILP (*instream) ? USID_ERROR + return (NILP (*instream) + ? USID_ERROR +#if defined(HAVE_SOCKETS) && !defined(HAVE_MSG_SELECT) + : flags & STREAM_NETWORK_CONNECTION + ? HANDLE_TO_USID (get_winsock_stream_waitable (XLSTREAM (*instream))) +#endif : HANDLE_TO_USID (get_ntpipe_input_stream_waitable (XLSTREAM (*instream)))); } @@ -2355,7 +2610,12 @@ { /* Oh nothing special here for Win32 at all */ #if defined (HAVE_UNIX_PROCESSES) - int in = (NILP(instream) ? -1 + int in = (NILP(instream) + ? -1 +#if defined(HAVE_SOCKETS) && !defined(HAVE_MSG_SELECT) + : LSTREAM_TYPE_P (XLSTREAM (instream), winsock) + ? get_winsock_stream_param (XLSTREAM (instream)) +#endif : get_ntpipe_input_stream_param (XLSTREAM (instream))); int out = (NILP(outstream) ? -1 : filedesc_stream_fd (XLSTREAM (outstream))); @@ -2366,11 +2626,15 @@ close (out); #endif - return (NILP (instream) ? USID_DONTHASH + return (NILP (instream) + ? USID_DONTHASH +#if defined(HAVE_SOCKETS) && !defined(HAVE_MSG_SELECT) + : LSTREAM_TYPE_P (XLSTREAM (instream), winsock) + ? HANDLE_TO_USID (get_winsock_stream_waitable (XLSTREAM (instream))) +#endif : HANDLE_TO_USID (get_ntpipe_input_stream_waitable (XLSTREAM (instream)))); } - #ifndef HAVE_X_WINDOWS /* This is called from GC when a process object is about to be freed. If we've still got pointers to it in this file, we're gonna lose hard. @@ -2491,6 +2755,9 @@ { init_slurp_stream (); init_shove_stream (); +#if defined (HAVE_SOCKETS) && !defined(HAVE_MSG_SELECT) + init_winsock_stream (); +#endif } void diff -r 090b52736db2 -r c42ec1d1cded src/event-stream.c --- a/src/event-stream.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/event-stream.c Mon Aug 13 10:33:18 2007 +0200 @@ -557,15 +557,15 @@ Let's hope it doesn't. I think the code here is fairly clean and doesn't do this. */ emacs_is_blocking = 1; - - /* Do not poll for quit while blocking, because this prevents idle - XEmacs from swapping out from memory */ +#if 0 + /* Do this if the poll-for-quit timer seems to be taking too + much CPU time when idle ... */ reset_poll_for_quit (); - +#endif event_stream->next_event_cb (event); - +#if 0 init_poll_for_quit (); - +#endif emacs_is_blocking = 0; #ifdef DEBUG_XEMACS @@ -1609,8 +1609,12 @@ XEVENT (event)->event_type = misc_user_event; XEVENT (event)->channel = channel; - XEVENT (event)->event.eval.function = function; - XEVENT (event)->event.eval.object = object; + XEVENT (event)->event.misc.function = function; + XEVENT (event)->event.misc.object = object; + XEVENT (event)->event.misc.button = 0; + XEVENT (event)->event.misc.modifiers = 0; + XEVENT (event)->event.misc.x = -1; + XEVENT (event)->event.misc.y = -1; enqueue_command_event (event); return event; @@ -2239,9 +2243,6 @@ default: goto RETURN; case button_release_event: -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: -#endif case misc_user_event: /* don't echo menu accelerator keys */ reset_key_echo (command_builder, 1); @@ -4033,9 +4034,6 @@ if (EVENTP (event) && (XEVENT_TYPE (event) == button_press_event || XEVENT_TYPE (event) == button_release_event -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - || XEVENT_TYPE (event) == dnd_drop_event -#endif || XEVENT_TYPE (event) == misc_user_event)) { if (!n) @@ -4067,9 +4065,6 @@ { case button_press_event : case button_release_event : -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: -#endif case misc_user_event : if (n == 0) return event; @@ -4173,10 +4168,6 @@ else if (e->event_type == button_press_event || e->event_type == button_release_event) e->event.button.modifiers |= MOD_META; -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - else if (e->event_type == dnd_drop_event) - e->event.dnd_drop.modifiers |= MOD_META; -#endif else abort (); @@ -4276,9 +4267,6 @@ break; case button_press_event: case button_release_event: -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: -#endif case misc_user_event: Vcurrent_mouse_event = Fcopy_event (event, Qnil); break; @@ -4506,9 +4494,6 @@ { case button_press_event: case button_release_event: -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: -#endif case key_press_event: { Lisp_Object leaf = lookup_command_event (command_builder, event, 1); diff -r 090b52736db2 -r c42ec1d1cded src/event-unixoid.c --- a/src/event-unixoid.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/event-unixoid.c Mon Aug 13 10:33:18 2007 +0200 @@ -257,7 +257,7 @@ int infd, outfd; /* Decode inhandle and outhandle. Their meaning depends on the process implementation being used. */ -#ifdef HAVE_WIN32_PROCESSES +#if defined (HAVE_WIN32_PROCESSES) /* We're passed in Windows handles. Open new fds for them */ if ((HANDLE)inhandle != INVALID_HANDLE_VALUE) { @@ -282,12 +282,12 @@ outfd = -1; flags = 0; -#endif - -#ifdef HAVE_UNIX_PROCESSES +#elif defined (HAVE_UNIX_PROCESSES) /* We are passed plain old file descs */ infd = (int)inhandle; outfd = (int)outhandle; +#else +# error Which processes do you have? #endif *instream = (infd >= 0 @@ -300,7 +300,7 @@ #if defined(HAVE_UNIX_PROCESSES) && defined(HAVE_PTYS) /* FLAGS is process->pty_flag for UNIX_PROCESSES */ - if (flags && outfd >= 0) + if ((flags & STREAM_PTY_FLUSHING) && outfd >= 0) { Bufbyte eof_char = get_eof_char (outfd); int pty_max_bytes = get_pty_max_bytes (outfd); diff -r 090b52736db2 -r c42ec1d1cded src/events.c --- a/src/events.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/events.c Mon Aug 13 10:33:18 2007 +0200 @@ -66,11 +66,6 @@ Lisp_Object Qkey_press, Qbutton_press, Qbutton_release, Qmisc_user; Lisp_Object Qascii_character; -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) -Lisp_Object Qdnd_drop_event_p; -Lisp_Object Qdnd_drop; -#endif - EXFUN (Fevent_x_pixel, 1); EXFUN (Fevent_y_pixel, 1); @@ -138,9 +133,6 @@ case magic_event: case empty_event: case dead_event: -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: -#endif break; default: abort (); @@ -203,13 +195,14 @@ write_c_string ("#event.misc.function, printcharfun, 1); + write_c_string (" ", printcharfun); + print_internal (XEVENT (obj)->event.misc.object, printcharfun, 1); + write_c_string (")", printcharfun); + break; case eval_event: - write_c_string ("#<", printcharfun); - if (XEVENT (obj)->event_type == misc_user_event) - write_c_string ("misc-user", printcharfun); - else - write_c_string ("eval", printcharfun); - write_c_string ("-event (", printcharfun); + write_c_string ("#event.eval.function, printcharfun, 1); write_c_string (" ", printcharfun); print_internal (XEVENT (obj)->event.eval.object, printcharfun, 1); @@ -218,11 +211,6 @@ case dead_event: write_c_string ("#event.motion.y == e2->event.motion.y); case misc_user_event: + return (internal_equal (e1->event.eval.function, + e2->event.eval.function, 0) && + internal_equal (e1->event.eval.object, + e2->event.eval.object, 0) && + /* is this really needed for equality + or is x and y also important? */ + e1->event.misc.button == e2->event.misc.button && + e1->event.misc.modifiers == e2->event.misc.modifiers); + case eval_event: return (internal_equal (e1->event.eval.function, e2->event.eval.function, 0) && @@ -276,13 +273,6 @@ internal_equal (e1->event.magic_eval.object, e2->event.magic_eval.object, 0)); -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: - return (e1->event.dnd_drop.button == e2->event.dnd_drop.button && - e1->event.dnd_drop.modifiers == e2->event.dnd_drop.modifiers && - EQ (e1->event.dnd_drop.data, e2->event.dnd_drop.data)); -#endif - case magic_event: { struct console *con = XCONSOLE (CDFW_CONSOLE (e1->channel)); @@ -344,6 +334,10 @@ return HASH3 (hash, e->event.motion.x, e->event.motion.y); case misc_user_event: + return HASH5 (hash, internal_hash (e->event.misc.function, depth + 1), + internal_hash (e->event.misc.object, depth + 1), + e->event.misc.button, e->event.misc.modifiers); + case eval_event: return HASH3 (hash, internal_hash (e->event.eval.function, depth + 1), internal_hash (e->event.eval.object, depth + 1)); @@ -353,12 +347,6 @@ (unsigned long) e->event.magic_eval.internal_function, internal_hash (e->event.magic_eval.object, depth + 1)); -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: - return HASH4 (hash, e->event.dnd_drop.button, e->event.dnd_drop.modifiers, - LISP_HASH(e->event.dnd_drop.data)); -#endif - case magic_event: { struct console *con = XCONSOLE (CDFW_CONSOLE (EVENT_CHANNEL (e))); @@ -396,7 +384,7 @@ 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 + `button-release', or `motion'. If TYPE is nil, it defaults to `empty'. PLIST is a property list, the properties being compatible to those @@ -404,27 +392,24 @@ allowed: channel -- The event channel, a frame or a console. For - button-press, button-release, motion and dnd-drop - events, this must be a frame. For key-press + button-press, button-release, motion events, + this must be a frame. For key-press events, it must be a console. If channel is unspecified, it will be set to the selected frame or selected console, as appropriate. key -- The event key, a symbol or character. Allowed only for keypress events. button -- The event button, integer 1, 2 or 3. Allowed for - button-press, button-release and dnd-drag events. + button-press, button-release and misc-user events. modifiers -- The event modifiers, a list of modifier symbols. Allowed for key-press, button-press, button-release, motion and - dnd-drop events. + misc-user events. x -- The event X coordinate, an integer. This is relative to the left of CHANNEL's root window. Allowed for - motion, button-press, button-release and dnd-drop events. + motion, button-press, button-release and misc-user events. y -- The event Y coordinate, an integer. This is relative to the top of CHANNEL's root window. Allowed for - motion, button-press, button-release and dnd-drop events. - dnd-data -- The event DND data, a list of (INTEGER DATA). Allowed - for dnd-drop events, if support for DND has been - compiled into XEmacs. + motion, button-press, button-release and misc-user events. timestamp -- The event timestamp, a non-negative integer. Allowed for all types of events. If unspecified, it will be set to 0 by default. @@ -443,12 +428,11 @@ { Lisp_Object tail, keyword, value; Lisp_Object event = Qnil; - Lisp_Object dnd_data = Qnil; struct Lisp_Event *e; EMACS_INT coord_x = 0, coord_y = 0; - struct gcpro gcpro1, gcpro2; + struct gcpro gcpro1; - GCPRO2 (event, dnd_data); + GCPRO1 (event); if (NILP (type)) type = Qempty; @@ -493,13 +477,6 @@ e->event_type = misc_user_event; e->event.eval.function = e->event.eval.object = Qnil; } -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - else if (EQ (type, Qdnd_drop)) - { - e->event_type = dnd_drop_event; - e->event.dnd_drop.data = Qnil; - } -#endif else { /* Not allowed: Qprocess, Qtimeout, Qmagic, Qeval, Qmagic_eval. */ @@ -542,13 +519,17 @@ else if (EQ (keyword, Qbutton)) { if (e->event_type != button_press_event - && e->event_type != button_release_event) + && e->event_type != button_release_event + && e->event_type != misc_user_event) { WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); } CHECK_NATNUM (value); check_int_range (XINT (value), 0, 7); - e->event.button.button = XINT (value); + if (e->event_type == misc_user_event) + e->event.misc.button = XINT (value); + else + e->event.button.button = XINT (value); } else if (EQ (keyword, Qmodifiers)) { @@ -558,7 +539,8 @@ if (e->event_type != key_press_event && e->event_type != button_press_event && e->event_type != button_release_event - && e->event_type != pointer_motion_event) + && e->event_type != pointer_motion_event + && e->event_type != misc_user_event) { WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); } @@ -581,14 +563,17 @@ else if (e->event_type == button_press_event || e->event_type == button_release_event) e->event.button.modifiers = modifiers; - else /* pointer_motion_event */ + else if (e->event_type == pointer_motion_event) e->event.motion.modifiers = modifiers; + else /* misc_user_event */ + e->event.misc.modifiers = modifiers; } else if (EQ (keyword, Qx)) { if (e->event_type != pointer_motion_event && e->event_type != button_press_event - && e->event_type != button_release_event) + && e->event_type != button_release_event + && e->event_type != misc_user_event) { WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); } @@ -601,7 +586,8 @@ { if (e->event_type != pointer_motion_event && e->event_type != button_press_event - && e->event_type != button_release_event) + && e->event_type != button_release_event + && e->event_type != misc_user_event) { WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword); } @@ -626,34 +612,6 @@ 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)) - { - 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 ("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 to avoid corruption later. */ - e->event.dnd_drop.data = Fcopy_tree (value, Qnil); - } - } -#endif /* HAVE_OFFIX_DND || HAVE_MS_WINDOWS */ else signal_simple_error_2 ("Invalid property", keyword, value); } @@ -672,10 +630,7 @@ if (e->event_type == pointer_motion_event || e->event_type == button_press_event || e->event_type == button_release_event -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - || e->event_type == dnd_drop_event -#endif - ) + || e->event_type == misc_user_event) { struct frame *f = XFRAME (EVENT_CHANNEL (e)); @@ -688,15 +643,16 @@ e->event.motion.y = coord_y; } else if (e->event_type == button_press_event - || e->event_type == button_release_event -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - || e->event_type == dnd_drop_event -#endif - ) + || e->event_type == button_release_event) { e->event.button.x = coord_x; e->event.button.y = coord_y; } + else if (e->event_type == misc_user_event) + { + e->event.misc.x = coord_x; + e->event.misc.y = coord_y; + } } /* Finally, do some more validation. */ @@ -709,20 +665,14 @@ break; case button_press_event: case button_release_event: -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: -#endif if (!e->event.button.button) error ("Undefined button for %s event", e->event_type == button_press_event - ? "buton-press" : -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - e->event_type == button_release_event - ? "button-release" : "dnd-drop" -#else - "button-release" -#endif - ); + ? "buton-press" : "button-release"); + break; + case misc_user_event: + if (!e->event.misc.button) + error ("Undefined button for misc-user event"); break; default: break; @@ -977,9 +927,6 @@ case button_press_event: case button_release_event: case misc_user_event: -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: -#endif return 1; default: return 0; @@ -1249,9 +1196,6 @@ int mouse_p = 0; int mod = 0; Lisp_Object key; -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - int dnd_p = 0; -#endif switch (event->event_type) { @@ -1296,15 +1240,6 @@ else strcpy (buf, "???"); return; } -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: - { - dnd_p++; - mod = event->event.dnd_drop.modifiers; - key = make_char (event->event.dnd_drop.button + '0'); - break; - } -#endif case magic_eval_event: strcpy (buf, "magic-eval"); return; case pointer_motion_event: strcpy (buf, "motion"); return; case misc_user_event: strcpy (buf, "misc-user"); return; @@ -1330,14 +1265,6 @@ --mouse_p; } -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - switch (dnd_p) - { - case 1: - modprint1 ("drop"); - } -#endif - #undef modprint #undef modprint1 @@ -1473,9 +1400,6 @@ case process_event: return Qprocess; case timeout_event: return Qtimeout; case eval_event: return Qeval; -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: return Qdnd_drop; -#endif case magic_event: case magic_eval_event: return Qmagic; @@ -1515,6 +1439,14 @@ e = wrong_type_argument ((sym),(e)); \ } while (0) +#define CHECK_EVENT_TYPE3(e,t1,t2,t3,sym) do { \ + CHECK_LIVE_EVENT (e); \ + if (XEVENT(e)->event_type != (t1) && \ + XEVENT(e)->event_type != (t2) && \ + XEVENT(e)->event_type != (t3)) \ + e = wrong_type_argument ((sym),(e)); \ +} while (0) + DEFUN ("event-key", Fevent_key, 1, 1, 0, /* Return the Keysym of the key-press event EVENT. This will be a character if the event is associated with one, else a symbol. @@ -1530,30 +1462,18 @@ */ (event)) { -#if !defined(HAVE_OFFIX_DND) && !defined(HAVE_MS_WINDOWS) - CHECK_EVENT_TYPE2 (event, button_press_event, button_release_event, - Qbutton_event_p); + CHECK_EVENT_TYPE3 (event, button_press_event, button_release_event, + misc_user_event, Qbutton_event_p); #ifdef HAVE_WINDOW_SYSTEM - return make_int (XEVENT (event)->event.button.button); + if ( XEVENT (event)->event_type == misc_user_event) + return make_int (XEVENT (event)->event.misc.button); + else + return make_int (XEVENT (event)->event.button.button); #else /* !HAVE_WINDOW_SYSTEM */ return Qzero; #endif /* !HAVE_WINDOW_SYSTEM */ -#else /* HAVE_OFFIX_DND || HAVE_MS_WINDOWS */ - - CHECK_LIVE_EVENT (event); - if (XEVENT(event)->event_type == (button_press_event) || - XEVENT(event)->event_type == (button_release_event)) - /* we always have X if we have OffiX !! */ - return make_int (XEVENT (event)->event.button.button); - else if (XEVENT(event)->event_type == (dnd_drop_event)) - /* we always have X if we have OffiX !! */ - return make_int (XEVENT (event)->event.button.button); - else - return wrong_type_argument ((Qbutton_event_p),(event)); - -#endif } DEFUN ("event-modifier-bits", Fevent_modifier_bits, 1, 1, 0, /* @@ -1574,10 +1494,8 @@ return make_int (XEVENT (event)->event.button.modifiers); case pointer_motion_event: return make_int (XEVENT (event)->event.motion.modifiers); -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: - return make_int (XEVENT (event)->event.dnd_drop.modifiers); -#endif + case misc_user_event: + return make_int (XEVENT (event)->event.misc.modifiers); default: event = wrong_type_argument (intern ("key-or-mouse-event-p"), event); goto again; @@ -1619,13 +1537,11 @@ *x = XEVENT (event)->event.button.x; *y = XEVENT (event)->event.button.y; } -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - else if (XEVENT (event)->event_type == dnd_drop_event) + else if (XEVENT (event)->event_type == misc_user_event) { - *x = XEVENT (event)->event.dnd_drop.x; - *y = XEVENT (event)->event.dnd_drop.y; + *x = XEVENT (event)->event.misc.x; + *y = XEVENT (event)->event.misc.y; } -#endif else return 0; @@ -1776,12 +1692,10 @@ pix_x = XEVENT (event)->event.button.x; pix_y = XEVENT (event)->event.button.y; break; -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event : - pix_x = XEVENT (event)->event.dnd_drop.x; - pix_y = XEVENT (event)->event.dnd_drop.y; + case misc_user_event : + pix_x = XEVENT (event)->event.misc.x; + pix_y = XEVENT (event)->event.misc.y; break; -#endif default: dead_wrong_type_argument (Qmouse_event_p, event); } @@ -2103,6 +2017,7 @@ case timeout_event: return XEVENT (event)->event.timeout.function; case misc_user_event: + return XEVENT (event)->event.misc.function; case eval_event: return XEVENT (event)->event.eval.function; default: @@ -2124,6 +2039,7 @@ case timeout_event: return XEVENT (event)->event.timeout.object; case misc_user_event: + return XEVENT (event)->event.misc.object; case eval_event: return XEVENT (event)->event.eval.object; default: @@ -2132,28 +2048,6 @@ } } -DEFUN ("event-drag-and-drop-data", Fevent_drag_and_drop_data, 1, 1, 0, /* -Return the Dnd data list of EVENT. -EVENT should be a dnd_drop event. -*/ - (event)) -{ -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - again: - CHECK_LIVE_EVENT (event); - switch (XEVENT (event)->event_type) - { - case dnd_drop_event: - return XEVENT (event)->event.dnd_drop.data; - default: - event = wrong_type_argument (Qdnd_drop_event_p, event); - goto again; - } -#else /* !(HAVE_OFFIX_DND || HAVE_MS_WINDOWS) */ - return Qnil; -#endif /* HAVE_OFFIX_DND || HAVE_MS_WINDOWS */ -} - DEFUN ("event-properties", Fevent_properties, 1, 1, 0, /* Return a list of all of the properties of EVENT. This is in the form of a property list (alternating keyword/value pairs). @@ -2202,21 +2096,19 @@ break; case misc_user_event: + props = cons3 (Qobject, Fevent_object (event), props); + props = cons3 (Qfunction, Fevent_function (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 eval_event: 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 = 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 - case magic_eval_event: case magic_event: break; @@ -2283,7 +2175,6 @@ DEFSUBR (Fevent_process); DEFSUBR (Fevent_function); DEFSUBR (Fevent_object); - DEFSUBR (Fevent_drag_and_drop_data); defsymbol (&Qeventp, "eventp"); defsymbol (&Qevent_live_p, "event-live-p"); @@ -2296,10 +2187,6 @@ defsymbol (&Qbutton_release, "button-release"); defsymbol (&Qmisc_user, "misc-user"); defsymbol (&Qascii_character, "ascii-character"); -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - defsymbol (&Qdnd_drop_event_p, "dnd-drop-event-p"); - defsymbol (&Qdnd_drop, "dnd-drop"); -#endif } void diff -r 090b52736db2 -r c42ec1d1cded src/events.h --- a/src/events.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/events.h Mon Aug 13 10:33:18 2007 +0200 @@ -227,13 +227,19 @@ function An elisp function to call with this event object. internal_function Ignored. object Anything. + button What button went down or up. + modifiers Bucky-bits on that button: shift, control, meta, etc. + x, y Where it was at the button-state-change (in pixels). This is similar to an eval_event, except that it is generated by user actions: selections in the - menubar or scrollbar actions. It is a "command" - event, like key and mouse presses (and unlike mouse - motion, process output, and enter and leave window - hooks). In many ways, eval_events are not the same - as keypresses or misc_user_events. + menubar, scrollbar actions, or drag and drop actions. + It is a "command" event, like key and mouse presses + (and unlike mouse motion, process output, and enter + and leave window hooks). In many ways, eval_events + are not the same as keypresses or misc_user_events. + The button, modifiers, x, and y parts are only used + by the XEmacs Drag'n'Drop system. Don't depend on their + values for other types of misc_user_events. magic_event No user-serviceable parts within. This is for things @@ -259,18 +265,7 @@ a magic_event; the Lisp programmer need not know anything more. -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - dnd_drop_event - dnd_drag_event (* to be implemented *) - button What button went down or up. - modifiers Bucky-bits on that button: shift, control, meta, etc. - x, y Where it was at the button-state-change (in pixels). - data A list of type and data. - This events are created by Drag'n'Drop actions. - Currently only the OffiX Dnd Protocol is supported. - #endif - - */ +*/ /* Stream pairs description @@ -342,11 +337,15 @@ USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ , Lisp_Object* /* instream */, Lisp_Object* /* outstream */, - int /* pty_flag */); + int /* flags */); USID (*delete_stream_pair_cb) (Lisp_Object /* instream */, Lisp_Object /* outstream */); }; +/* Flags for create_stream_pair_cb() FLAGS parameter */ +#define STREAM_PTY_FLUSHING 0x0001 +#define STREAM_NETWORK_CONNECTION 0x0002 + extern struct event_stream *event_stream; typedef enum emacs_event_type @@ -362,9 +361,6 @@ magic_eval_event, eval_event, misc_user_event, -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - dnd_drop_event, -#endif dead_event } emacs_event_type; @@ -409,22 +405,21 @@ Lisp_Object object; }; +struct misc_user_data +{ + Lisp_Object function; + Lisp_Object object; + int button; + unsigned char modifiers; + int x, y; +}; + struct magic_eval_data { void (*internal_function) (Lisp_Object); Lisp_Object object; }; -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) -struct dnd_drop_data -{ - int button; - unsigned char modifiers; - int x, y; - Lisp_Object data; -}; -#endif - #if defined (HAVE_X_WINDOWS) && defined(emacs) # include #endif @@ -462,12 +457,10 @@ struct motion_data motion; struct process_data process; struct timeout_data timeout; - struct eval_data eval; /* misc_user_event uses this too */ + struct eval_data eval; /* misc_user_event no loger uses this */ + struct misc_user_data misc; /* because it needs position information */ union magic_data magic; struct magic_eval_data magic_eval; -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - struct dnd_drop_data dnd_drop; -#endif } event; }; @@ -595,6 +588,10 @@ int event_stream_add_async_timeout (EMACS_TIME thyme); void event_stream_remove_async_timeout (int id); +/* from event-stream.c -- focus sanity */ +extern int focus_follows_mouse; +void investigate_frame_change (void); + void emacs_handle_focus_change_preliminary (Lisp_Object frame_inp_and_dev); void emacs_handle_focus_change_final (Lisp_Object frame_inp_and_dev); diff -r 090b52736db2 -r c42ec1d1cded src/faces.c --- a/src/faces.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/faces.c Mon Aug 13 10:33:18 2007 +0200 @@ -1580,6 +1580,10 @@ update_EmacsFrame (Lisp_Object frame, Lisp_Object name) { struct frame *frm = XFRAME (frame); + + if (EQ (name, Qfont)) + MARK_FRAME_SIZE_SLIPPED (frm); + MAYBE_FRAMEMETH (frm, update_frame_external_traits, (frm, name)); } diff -r 090b52736db2 -r c42ec1d1cded src/frame-msw.c --- a/src/frame-msw.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/frame-msw.c Mon Aug 13 10:33:18 2007 +0200 @@ -115,12 +115,6 @@ mswindows_frame_target_rect.width = NILP (width) ? -1 : abs (XINT (width)); mswindows_frame_target_rect.height = NILP (height) ? -1 : abs (XINT (height)); - /* These shouldn't be here, but the window is created too early. - The initialization of scrollbar resources is done between - init_frame_1 and init_frame_2 in make_frame. jsparkes */ - f->scrollbar_width = make_int (15); - f->scrollbar_height = make_int (15); - f->frame_data = xnew_and_zero (struct mswindows_frame); /* Misc frame stuff */ @@ -369,7 +363,8 @@ { if (!XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon)) { - mswindows_create_icon_from_image(f->icon, f, 16); + mswindows_initialize_image_instance_icon (XIMAGE_INSTANCE (f->icon), + FALSE); } SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON, @@ -380,15 +375,14 @@ 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 + if (IMAGE_INSTANCEP (f->pointer) + && IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (f->pointer)) == IMAGE_POINTER) + { + SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HCURSOR, + (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->pointer)); + } } - static void mswindows_set_mouse_position (struct window *w, int x, int y) { @@ -626,38 +620,13 @@ static void mswindows_update_frame_external_traits (struct frame* frm, Lisp_Object name) { - if (EQ (name, Qfont)) - { - /* We resize the frame along with the font if user preference - of MS style compliance is turned off, and if font size has - really changed - */ - /* #### Frame gets resized after font here */ - if (1) - { - int new_char_height, new_char_width; - pixel_to_real_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm), - &new_char_width, &new_char_height); - if (new_char_width != FRAME_MSWINDOWS_CHARWIDTH (frm) - || new_char_height != FRAME_MSWINDOWS_CHARHEIGHT (frm)) - { - Lisp_Object frame; - XSETFRAME (frame, frm); - Fset_frame_size (frame, - make_int(FRAME_MSWINDOWS_CHARWIDTH (frm)), - make_int(FRAME_MSWINDOWS_CHARHEIGHT (frm)), - Qnil); - } - } +} - /* This resizes minibuffer and redraws modeline. */ - { - int width, height; - pixel_to_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm), - &width, &height); - change_frame_size (frm, height, width, 1); - } - } +static int +mswindows_frame_size_fixed_p (struct frame *f) +{ + /* Frame size cannot change if the frame is maximized */ + return IsZoomed (FRAME_MSWINDOWS_HANDLE (f)); } void @@ -693,6 +662,7 @@ CONSOLE_HAS_METHOD (mswindows, set_frame_icon); CONSOLE_HAS_METHOD (mswindows, get_frame_parent); CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits); + CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p); } void diff -r 090b52736db2 -r c42ec1d1cded src/frame-tty.c --- a/src/frame-tty.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/frame-tty.c Mon Aug 13 10:33:18 2007 +0200 @@ -54,10 +54,6 @@ f->order_count = CONSOLE_TTY_DATA (c)->frame_count; f->height = CONSOLE_TTY_DATA (c)->height; f->width = CONSOLE_TTY_DATA (c)->width; -#ifdef HAVE_SCROLLBARS - f->scrollbar_on_left = 1; - f->scrollbar_on_top = 0; -#endif } static void diff -r 090b52736db2 -r c42ec1d1cded src/frame-x.c --- a/src/frame-x.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/frame-x.c Mon Aug 13 10:33:18 2007 +0200 @@ -51,6 +51,10 @@ #include "frame.h" #include "window.h" +#ifdef HAVE_DRAGNDROP +#include "dragdrop.h" +#endif + #ifdef HAVE_OFFIX_DND #include "offix.h" #include "events-mod.h" @@ -1088,53 +1092,73 @@ x_cde_transfer_callback (Widget widget, XtPointer clientData, XtPointer callData) { - char *filePath, *buf; + char *filePath, *hurl; int ii; - Lisp_Object path = Qnil; Lisp_Object frame = Qnil; - Lisp_Object data = Qnil; + Lisp_Object l_type = Qnil; + Lisp_Object l_data = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; + /* + this needs to be changed to the new protocol: + - we need the button, modifier and pointer states to create a + correct misc_user_event + - the data must be converted to the new format (URL/MIME) + */ + return; + DtDndTransferCallbackStruct *transferInfo = (DtDndTransferCallbackStruct *) callData; if (transferInfo == NULL) return; - GCPRO3 (path, frame, data); + GCPRO3 (frame, l_type, l_data); frame = make_frame ((struct frame *) clientData); if (transferInfo->dropData->protocol == DtDND_FILENAME_TRANSFER) { + l_type = Qdragdrop_URL; + for (ii = 0; ii < transferInfo->dropData->numItems; ii++) { filePath = transferInfo->dropData->data.files[ii]; + hurl = dnd_url_hexify_string ((char *)filePath, "file:"); /* ### Mule-izing required */ - path = make_string ((Bufbyte *)filePath, strlen (filePath)); - va_run_hook_with_args (Qdrag_and_drop_functions, 2, frame, path); + l_data = Fcons ( make_string (hurl, strlen (hurl)), l_data ); + xfree (hurl); } } else if (transferInfo->dropData->protocol == DtDND_BUFFER_TRANSFER) { int speccount = specpdl_depth(); + l_type = Qdragdrop_MIME; + /* the meaning of this is not clear to me... */ record_unwind_protect(abort_current_drag, Qnil); drag_not_done = 1; for (ii = 0; ii < transferInfo->dropData->numItems; ii++) { - filePath = transferInfo->dropData->data.buffers[ii].name; - /* ### Mule-izing required */ - path = (filePath == NULL) ? Qnil - : make_string ((Bufbyte *)filePath, strlen (filePath)); - buf = transferInfo->dropData->data.buffers[ii].bp; - data = make_string((Bufbyte *)buf, - transferInfo->dropData->data.buffers[ii].size); - va_run_hook_with_args(Qdrag_and_drop_functions, 3, frame, path, - data); + /* let us forget this name thing for now... */ + /* filePath = transferInfo->dropData->data.buffers[ii].name; + path = (filePath == NULL) ? Qnil + : make_string ((Bufbyte *)filePath, strlen (filePath)); */ + /* what, if the data is no text, and how can I tell it? */ + l_data = Fcons ( list3 ( make_string ("text/plain", 10), + make_string ("8bit", 4), + make_ext_string (transferInfo->dropData->data.buffers[ii].bp, + transferInfo->dropData->data.buffers[ii].size, + FORMAT_CTEXT) ), + l_data ); } drag_not_done = 0; + /* and what is this */ unbind_to(speccount, Qnil); } + + /* where are button, mod and pos? -- query the pointer... */ + enqueue_misc_user_event ( frame, Qdragdrop_drop_dispatch, + Fcons (l_type, l_data) ); UNGCPRO; return; @@ -1626,26 +1650,8 @@ } #ifdef HAVE_SCROLLBARS - { - /* 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; - - 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 */ + f->scrollbar_y_offset = topbreadth + textbord; +#endif /* finally the text area */ XtConfigureWidget (text, text_x, text_y, @@ -2032,13 +2038,16 @@ update_frame_face_values (f); x_initialize_frame_size (f); - /* - * update_frame_title() can't be done here, because some of the - * modeline specs depend on the frame's device having a selected - * frame, and that may not have been set up yet. The redisplay - * will update the frame title anyway, so nothing is lost. + /* Kyle: + * update_frame_title() can't be done here, because some of the + * modeline specs depend on the frame's device having a selected + * frame, and that may not have been set up yet. The redisplay + * will update the frame title anyway, so nothing is lost. + * JV: + * It turns out it gives problems with FVWMs name based mapping. + * We'll just need to be carefull in the modeline specs. */ - /* update_frame_title (f); */ + update_frame_title (f); } static void @@ -2570,19 +2579,10 @@ MAYBE_DEVMETH (XDEVICE (frm->device), redraw_frame_toolbars, (frm)); #endif /* HAVE_TOOLBARS */ - /* The intent of this code is to cause the frame size in - characters to remain the same when the font changes, at the - expense of changing the frame size in pixels. It's not - totally clear that this is the right thing to do, but it's - not clearly wrong either. */ + /* Set window manager resize increment hints according to + the new character size */ if (EQ (name, Qfont)) - { - EmacsFrameRecomputeCellSize (FRAME_X_TEXT_WIDGET (frm)); - Fset_frame_size (frame, - make_int (frm->width), - make_int (frm->height), - Qnil); - } + EmacsFrameRecomputeCellSize (FRAME_X_TEXT_WIDGET (frm)); } diff -r 090b52736db2 -r c42ec1d1cded src/frame.c --- a/src/frame.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/frame.c Mon Aug 13 10:33:18 2007 +0200 @@ -54,9 +54,7 @@ Lisp_Object Vmap_frame_hook, Qmap_frame_hook; Lisp_Object Vunmap_frame_hook, Qunmap_frame_hook; int allow_deletion_of_last_visible_frame; -#if defined (HAVE_CDE) || defined (HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) -Lisp_Object Vdrag_and_drop_functions, Qdrag_and_drop_functions; -#endif +Lisp_Object Vadjust_frame_function; Lisp_Object Vmouse_motion_handler; Lisp_Object Vsynchronize_minibuffers; Lisp_Object Qsynchronize_minibuffers; @@ -617,8 +615,71 @@ FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) unhold_one_frame_size_changes (XFRAME (XCAR (frmcons))); } - - + +/* + * Frame size may change due to changes in scrollbars, toolbars, + * default font etc. These changes are applied early in redisplay + * frame. + */ +void +adjust_frame_size (struct frame *f) +{ + int keep_char_size = 0; + Lisp_Object frame; + XSETFRAME (frame, f); + + if (!f->size_slipped) + return; + + /* Don't adjust tty frames. #### May break when TTY have menubars. + Then, write an Vadjust_frame_function which will return t for TTY + frames. Another solution is frame_size_fixed_p method for TTYs, + which always returned yes it's fixed. + */ + if (!FRAME_WIN_P (f)) + { + CLEAR_FRAME_SIZE_SLIPPED (f); + return; + } + + /* frame_size_fixed_p tells that frame size cannot currently + be changed change due to external conditions */ + if (!FRAMEMETH_OR_GIVEN (f, frame_size_fixed_p, (f), 0)) + { + if (NILP (Vadjust_frame_function)) + keep_char_size = 1; + else if (EQ (Vadjust_frame_function, Qt)) + keep_char_size = 0; + else + keep_char_size = + NILP (call1_trapping_errors ("Error in adjust-frame-function", + Vadjust_frame_function, frame)); + + if (keep_char_size) + Fset_frame_size (frame, make_int (FRAME_CHARWIDTH(f)), + make_int (FRAME_CHARHEIGHT(f)), Qnil); + } + + if (!keep_char_size) + { + int height, width; + pixel_to_char_size (f, FRAME_PIXWIDTH(f), FRAME_PIXHEIGHT(f), + &width, &height); + change_frame_size (f, height, width, 0); + CLEAR_FRAME_SIZE_SLIPPED (f); + } +} + +/* + * This is a "specifier changed in frame" handler for various specifiers + * changing which causes frame size adjustment + */ +void +frame_size_slipped (Lisp_Object specifier, struct frame *f, + Lisp_Object oldval) +{ + MARK_FRAME_SIZE_SLIPPED(f); +} DEFUN ("framep", Fframep, 1, 1, 0, /* Return non-nil if OBJECT is a frame. @@ -681,7 +742,7 @@ /* select the frame's selected window. This will call selected_frame_1(). */ - Fselect_window (FRAME_SELECTED_WINDOW (XFRAME (frame))); + Fselect_window (FRAME_SELECTED_WINDOW (XFRAME (frame)), Qnil); /* Nothing should be depending on the return value of this function. But, of course, there is stuff out there which is. */ @@ -860,7 +921,7 @@ error ("In `set-frame-selected-window', WINDOW is not on FRAME"); if (XFRAME (frame) == selected_frame ()) - return Fselect_window (window); + return Fselect_window (window, Qnil); set_frame_selected_window (XFRAME (frame), window); return window; @@ -1459,7 +1520,7 @@ /* If the dying minibuffer window was selected, select the new one. */ if (minibuffer_selected) - Fselect_window (minibuf_window); + Fselect_window (minibuf_window, Qnil); } /* After this point, no errors must be allowed to occur. */ @@ -2480,6 +2541,9 @@ static void internal_set_frame_size (struct frame *f, int cols, int rows, int pretend) { + /* An explicit size change cancels any pending frame size adjustment */ + CLEAR_FRAME_SIZE_SLIPPED(f); + if (pretend || !HAS_FRAMEMETH_P (f, set_frame_size)) change_frame_size (f, rows, cols, 0); else @@ -2856,6 +2920,15 @@ f->pixwidth = newwidth; } + if (window_system_pixelated_geometry (frame)) + pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), + &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f)); + else + { + FRAME_CHARWIDTH (f) = FRAME_WIDTH (f); + FRAME_CHARHEIGHT (f) = FRAME_HEIGHT (f); + } + MARK_FRAME_TOOLBARS_CHANGED (f); MARK_FRAME_CHANGED (f); f->echo_area_garbaged = 1; @@ -2999,9 +3072,6 @@ defsymbol (&Qmouse_leave_frame_hook, "mouse-leave-frame-hook"); defsymbol (&Qmap_frame_hook, "map-frame-hook"); defsymbol (&Qunmap_frame_hook, "unmap-frame-hook"); -#if defined (HAVE_CDE) || defined (HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - defsymbol (&Qdrag_and_drop_functions, "drag-and-drop-functions"); -#endif defsymbol (&Qframep, "framep"); defsymbol (&Qframe_live_p, "frame-live-p"); @@ -3189,16 +3259,19 @@ */ ); allow_deletion_of_last_visible_frame = 0; -#if defined (HAVE_CDE) || defined (HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - DEFVAR_LISP ("drag-and-drop-functions", &Vdrag_and_drop_functions /* -Function or functions to run when an object is dropped on a frame. -Each function is called with either two or three args. If called with -two args, the args are a frame and a pathname. If with three, the -args are a frame, a pathname (which will be either a string or nil) -and the textual representation of the dragged object. + DEFVAR_LISP ("adjust-frame-function", &Vadjust_frame_function /* +Function or constant controlling adjustment of frame. +When scrollbars, toolbars, default font etc. change in frame, the frame +needs to be adjusted. The adjustment is controlled by this variable. +Legal values are: + nil to keep character frame size unchanged when possible (resize) + t to keep pixel size unchanged (never resize) + function symbol or lambda form. This function must return boolean + value which is treated as above. Function is passed one parameter, + the frame being adjusted. It function should not modify or delete + the frame. */ ); - Vdrag_and_drop_functions = Qnil; -#endif /* HAVE_CDE || HAVE_OFFIX_DND || HAVE_MS_WINDOWS */ + Vadjust_frame_function = Qnil; DEFVAR_LISP ("mouse-motion-handler", &Vmouse_motion_handler /* Handler for motion events. One arg, the event. diff -r 090b52736db2 -r c42ec1d1cded src/frame.h --- a/src/frame.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/frame.h Mon Aug 13 10:33:18 2007 +0200 @@ -47,13 +47,23 @@ through frame->device->console, but it's faster this way. */ struct console_methods *framemeths; - /* Size of this frame, in units of characters. */ - int height; - int width; + /* Size of text only area of this frame, excluding scrollbars, + toolbars and end of line glyphs. The size can be in charactes + or pixels, depending on units in which window system resizes + its windows */ + int height, width; - /* Size of this frame, in units of pixels. */ - int pixheight; - int pixwidth; + /* New height and width for pending size change, in the same units + as above. 0 if no change pending. */ + int new_height, new_width; + + /* Size of text-only are of the frame, in default font characters. + This may be inaccurate due to rounding error */ + int char_height, char_width; + + /* Size of the whole frame, including scrollbars, toolbars and end + of line glyphs, in pixels */ + int pixheight, pixwidth; #ifdef HAVE_TTY /* The count of frame number. This applies to TTY frames only. */ @@ -66,9 +76,6 @@ dependencies. */ int internal_border_width; - /* New height and width for pending size change. 0 if no change pending. */ - int new_height, new_width; - /* This frame's root window mirror. This structure exactly mirrors the frame's window structure but contains only pointers to the display structures. */ @@ -79,8 +86,6 @@ #ifdef HAVE_SCROLLBARS /* frame-local scrollbar information. See scrollbar.c. */ int scrollbar_y_offset; - int scrollbar_on_left; - int scrollbar_on_top; /* cache of created scrollbars */ struct scrollbar_instance *sb_vcache; @@ -176,6 +181,7 @@ unsigned int windows_structure_changed :1; unsigned int window_face_cache_reset :1; /* used by expose handler */ unsigned int echo_area_garbaged :1; /* used by Fredisplay_echo_area */ + unsigned int size_slipped :1; unsigned int size_change_pending :1; unsigned int mirror_dirty :1; @@ -378,6 +384,24 @@ windows_structure_changed = 1; \ } while (0) +#define MARK_FRAME_SIZE_SLIPPED(f) do { \ + struct frame *fwsc_f = (f); \ + fwsc_f->size_slipped = 1; \ + fwsc_f->modiff++; \ + if (!NILP (fwsc_f->device)) \ + { \ + struct device *fwsc_d = XDEVICE (fwsc_f->device); \ + MARK_DEVICE_FRAME_CHANGED (fwsc_d); \ + } \ + else \ + frame_changed = 1; \ +} while (0) + +#define CLEAR_FRAME_SIZE_SLIPPED(f) do { \ + struct frame *fwsc_f = (f); \ + fwsc_f->size_slipped = 0; \ +} while (0) + #define SET_FRAME_CLEAR(f) MARK_FRAME_CHANGED (f); (f)->clear = 1 #define FRAME_DEVICE(f) ((f)->device) #define FRAME_CONSOLE(f) DEVICE_CONSOLE (XDEVICE (FRAME_DEVICE (f))) @@ -388,11 +412,17 @@ #define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer) #define FRAME_HEIGHT(f) ((f)->height) #define FRAME_WIDTH(f) ((f)->width) +#define FRAME_CHARHEIGHT(f) ((f)->char_height) +#define FRAME_CHARWIDTH(f) ((f)->char_width) #define FRAME_PIXHEIGHT(f) ((f)->pixheight) #define FRAME_PIXWIDTH(f) ((f)->pixwidth) #ifdef HAVE_SCROLLBARS -#define FRAME_SCROLLBAR_WIDTH(f) XINT ((f)->scrollbar_width) -#define FRAME_SCROLLBAR_HEIGHT(f) XINT ((f)->scrollbar_height) +#define FRAME_SCROLLBAR_WIDTH(f) \ + (NILP ((f)->vertical_scrollbar_visible_p) ? \ + 0 : XINT ((f)->scrollbar_width)) +#define FRAME_SCROLLBAR_HEIGHT(f) \ + (NILP ((f)->horizontal_scrollbar_visible_p) ? \ + 0 : XINT ((f)->scrollbar_height)) #else #define FRAME_SCROLLBAR_WIDTH(f) 0 #define FRAME_SCROLLBAR_HEIGHT(f) 0 @@ -660,6 +690,9 @@ void change_frame_size (struct frame *frame, int newlength, int newwidth, int delay); +void adjust_frame_size (struct frame *frame); +void frame_size_slipped (Lisp_Object specifier, struct frame *f, + Lisp_Object oldval); void hold_frame_size_changes (void); void unhold_one_frame_size_changes (struct frame *f); void unhold_frame_size_changes (void); diff -r 090b52736db2 -r c42ec1d1cded src/frameslots.h --- a/src/frameslots.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/frameslots.h Mon Aug 13 10:33:18 2007 +0200 @@ -102,6 +102,12 @@ /* Width and height of the scrollbars. */ MARKED_SLOT (scrollbar_width); MARKED_SLOT (scrollbar_height); + /* Whether the scrollbars are visible */ + MARKED_SLOT (horizontal_scrollbar_visible_p); + MARKED_SLOT (vertical_scrollbar_visible_p); + /* Scrollbars location */ + MARKED_SLOT (scrollbar_on_left_p); + MARKED_SLOT (scrollbar_on_top_p); #endif #ifdef HAVE_TOOLBARS diff -r 090b52736db2 -r c42ec1d1cded src/general.c --- a/src/general.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/general.c Mon Aug 13 10:33:18 2007 +0200 @@ -70,7 +70,6 @@ Lisp_Object Qdevice; Lisp_Object Qdimension; Lisp_Object Qdisplay; -Lisp_Object Qdnd_data; Lisp_Object Qdoc_string; Lisp_Object Qdynarr_overhead; Lisp_Object Qempty; @@ -222,7 +221,6 @@ defsymbol (&Qdevice, "device"); defsymbol (&Qdimension, "dimension"); defsymbol (&Qdisplay, "display"); - defsymbol (&Qdnd_data, "dnd-data"); defsymbol (&Qdoc_string, "doc-string"); defsymbol (&Qdynarr_overhead, "dynarr-overhead"); defsymbol (&Qempty, "empty"); diff -r 090b52736db2 -r c42ec1d1cded src/getloadavg.c --- a/src/getloadavg.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/getloadavg.c Mon Aug 13 10:33:18 2007 +0200 @@ -713,7 +713,7 @@ for (i = 0; i < conf.config_maxclass; ++i) { struct class_stats stats; - bzero ((char *) &stats, sizeof stats); + memset ((char *) &stats, 0, sizeof stats); desc.sd_type = CPUTYPE_CLASS; desc.sd_objid = i; diff -r 090b52736db2 -r c42ec1d1cded src/glyphs-msw.c --- a/src/glyphs-msw.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/glyphs-msw.c Mon Aug 13 10:33:18 2007 +0200 @@ -1,9 +1,4 @@ /* mswindows-specific Lisp objects. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995 Tinker Systems - Copyright (C) 1995, 1996 Ben Wing - Copyright (C) 1995 Sun Microsystems Copyright (C) 1998 Andy Piper. This file is part of XEmacs. @@ -50,10 +45,14 @@ DEFINE_IMAGE_INSTANTIATOR_FORMAT (bmp); Lisp_Object Qbmp; Lisp_Object Vmswindows_bitmap_file_path; +static COLORREF transparent_color = RGB (1,1,1); static void mswindows_initialize_dibitmap_image_instance (struct Lisp_Image_Instance *ii, enum image_instance_type type); +static void +mswindows_initialize_image_instance_mask (struct Lisp_Image_Instance* image, + struct frame* f); COLORREF mswindows_string_to_color (CONST char *name); @@ -239,12 +238,15 @@ int dest_mask, void *bmp_data, int bmp_bits, - Lisp_Object instantiator) + Lisp_Object instantiator, + int x_hot, int y_hot, + int create_mask) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); struct device *d = XDEVICE (device); struct frame *f = XFRAME (DEVICE_SELECTED_FRAME (d)); void* bmp_buf=0; + int type; HBITMAP bitmap; HDC hdc; @@ -254,9 +256,13 @@ if (NILP (DEVICE_SELECTED_FRAME (d))) signal_simple_error ("No selected frame on mswindows device", device); - if (!(dest_mask & IMAGE_COLOR_PIXMAP_MASK)) + if (dest_mask & IMAGE_COLOR_PIXMAP_MASK) + type = IMAGE_COLOR_PIXMAP; + else if (dest_mask & IMAGE_POINTER_MASK) + type = IMAGE_POINTER; + else incompatible_image_types (instantiator, dest_mask, - IMAGE_COLOR_PIXMAP_MASK); + IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); hdc = FRAME_MSWINDOWS_DC (f); bitmap=CreateDIBSection (hdc, @@ -271,16 +277,28 @@ /* copy in the actual bitmap */ memcpy (bmp_buf, bmp_data, bmp_bits); - mswindows_initialize_dibitmap_image_instance (ii, IMAGE_COLOR_PIXMAP); + mswindows_initialize_dibitmap_image_instance (ii, type); IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = find_keyword_in_vector (instantiator, Q_file); IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap; - IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = bitmap; + IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; 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; + XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot); + XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot); + + if (create_mask) + { + mswindows_initialize_image_instance_mask (ii, f); + } + + if (type == IMAGE_POINTER) + { + mswindows_initialize_image_instance_icon(ii, TRUE); + } } static void @@ -315,77 +333,114 @@ /* Now create the pixmap and set up the image instance */ init_image_instance_from_dibitmap (ii, bmp_info, dest_mask, - bmp_data, bmp_bits, instantiator); + bmp_data, bmp_bits, instantiator, + 0, 0, 0); xfree (bmp_info); xfree (bmp_data); } -void -mswindows_create_icon_from_image(Lisp_Object image, struct frame* f, int size) +static void set_mono_pixel ( unsigned char* bits, + int bpline, int height, + int x, int y, int white ) +{ + int index; + unsigned char bitnum; + /* Find the byte on which this scanline begins */ + index = (height - y - 1) * bpline; + /* Find the byte containing this pixel */ + index += (x >> 3); + /* Which bit is it? */ + bitnum = (unsigned char)( 7 - (x % 8) ); + if( white ) /* Turn it on */ + bits[index] |= (1<bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); + bmp_info->bmiHeader.biHeight = height; + bmp_info->bmiHeader.biPlanes=1; + bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); + bmp_info->bmiHeader.biBitCount=1; + bmp_info->bmiHeader.biCompression=BI_RGB; + bmp_info->bmiHeader.biClrUsed = 2; + bmp_info->bmiHeader.biClrImportant = 2; + bmp_info->bmiHeader.biSizeImage = height * bpline; + bmp_info->bmiColors[0].rgbRed = 0; + bmp_info->bmiColors[0].rgbGreen = 0; + bmp_info->bmiColors[0].rgbBlue = 0; + bmp_info->bmiColors[0].rgbReserved = 0; + bmp_info->bmiColors[1].rgbRed = 255; + bmp_info->bmiColors[1].rgbGreen = 255; + bmp_info->bmiColors[1].rgbBlue = 255; + bmp_info->bmiColors[0].rgbReserved = 0; + + if (!(mask = CreateDIBSection (hcdc, + bmp_info, + DIB_RGB_COLORS, + &and_bits, + 0,0))) { - signal_simple_error("Icons must be 16x16 or 32x32", image); + xfree (bmp_info); + return; } -#if 0 - iIconWidth = GetSystemMetrics(SM_CXICON); - iIconHeight = GetSystemMetrics(SM_CYICON); -#endif - - SelectObject(hcdc, XIMAGE_INSTANCE_MSWINDOWS_BITMAP (image)); - - bmp = CreateCompatibleBitmap(hcdc, size, size); - DeleteObject( SelectObject(hdcDst, bmp) ); + xfree (bmp_info); + SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (image)); - if (!StretchBlt(hdcDst, 0, 0, size, size, - hcdc, 0, 0, - XIMAGE_INSTANCE_PIXMAP_WIDTH (image), - XIMAGE_INSTANCE_PIXMAP_HEIGHT (image), - SRCCOPY)) - { - printf("StretchBlt failed\n"); - } - - if (!(mask = CreateBitmap(size, size, 1, 1, NULL))) - { - printf("CreateBitmap() failed\n"); - } - if (!SelectObject(hdcDst, mask) - || - !SelectObject(hcdc, bmp)) - { - printf("SelectObject() failed\n"); - } - - if (!BitBlt(hdcDst, 0, 0, size, size, - hcdc, 0, 0, - NOTSRCCOPY)) - { - printf("BitBlt failed\n"); + for(i=0; i #endif -#if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG) #include -#else -#ifndef memset -#define memset(s, zero, n) bzero ((s), (n)) -#endif -#ifndef memcpy -#define memcpy(d, s, n) bcopy ((s), (d), (n)) -#endif -#endif - #include #ifdef HAVE_UNISTD_H diff -r 090b52736db2 -r c42ec1d1cded src/inline.c --- a/src/inline.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/inline.c Mon Aug 13 10:33:18 2007 +0200 @@ -58,6 +58,7 @@ #include "objects.h" #include "opaque.h" #include "process.h" +#include "rangetab.h" #include "specifier.h" #include "syntax.h" #include "window.h" diff -r 090b52736db2 -r c42ec1d1cded src/keymap.c --- a/src/keymap.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/keymap.c Mon Aug 13 10:33:18 2007 +0200 @@ -241,9 +241,6 @@ 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 Lisp_Object Qmenu_selection; /* Emacs compatibility */ Lisp_Object Qdown_mouse_1, Qdown_mouse_2, Qdown_mouse_3, Qdown_mouse_4, @@ -1442,32 +1439,6 @@ returned_value->modifiers = XEVENT (spec)->event.button.modifiers; break; } -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - case dnd_drop_event: - { - switch (XEVENT (spec)->event.dnd_drop.button) - { - case 1: - returned_value->keysym = Qdrop1; break; - case 2: - returned_value->keysym = Qdrop2; break; - case 3: - returned_value->keysym = Qdrop3; break; - case 4: - returned_value->keysym = Qdrop4; break; - case 5: - returned_value->keysym = Qdrop5; break; - case 6: - returned_value->keysym = Qdrop6; break; - case 7: - returned_value->keysym = Qdrop7; break; - default: - returned_value->keysym = Qdrop0; break; - } - returned_value->modifiers = XEVENT (spec)->event.dnd_drop.modifiers; - break; - } -#endif default: signal_error (Qwrong_type_argument, list2 (build_translated_string @@ -1562,14 +1533,7 @@ EQ (raw_key.keysym, Qbutton4) || EQ (raw_key.keysym, Qbutton4up) || EQ (raw_key.keysym, Qbutton5) || EQ (raw_key.keysym, Qbutton5up) || EQ (raw_key.keysym, Qbutton6) || EQ (raw_key.keysym, Qbutton6up) || - EQ (raw_key.keysym, Qbutton7) || EQ (raw_key.keysym, Qbutton7up) -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - || EQ (raw_key.keysym, Qdrop0) || EQ (raw_key.keysym, Qdrop1) || - EQ (raw_key.keysym, Qdrop2) || EQ (raw_key.keysym, Qdrop3) || - EQ (raw_key.keysym, Qdrop4) || EQ (raw_key.keysym, Qdrop5) || - EQ (raw_key.keysym, Qdrop6) || EQ (raw_key.keysym, Qdrop7) -#endif - ) + EQ (raw_key.keysym, Qbutton7) || EQ (raw_key.keysym, Qbutton7up)) error ("Mouse-clicks can't appear in saved keyboard macros."); XEVENT (event)->channel = Vselected_console; @@ -4296,16 +4260,6 @@ defsymbol (&Qbutton5up, "button5up"); defsymbol (&Qbutton6up, "button6up"); defsymbol (&Qbutton7up, "button7up"); -#if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) - defsymbol (&Qdrop0, "drop0"); - defsymbol (&Qdrop1, "drop1"); - defsymbol (&Qdrop2, "drop2"); - defsymbol (&Qdrop3, "drop3"); - defsymbol (&Qdrop4, "drop4"); - defsymbol (&Qdrop5, "drop5"); - defsymbol (&Qdrop6, "drop6"); - defsymbol (&Qdrop7, "drop7"); -#endif defsymbol (&Qmouse_1, "mouse-1"); defsymbol (&Qmouse_2, "mouse-2"); defsymbol (&Qmouse_3, "mouse-3"); diff -r 090b52736db2 -r c42ec1d1cded src/linuxplay.c --- a/src/linuxplay.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/linuxplay.c Mon Aug 13 10:33:18 2007 +0200 @@ -127,10 +127,10 @@ sampling format */ unsigned char linuxplay_sndbuf[SNDBUFSZ]; -int mix_fd = -1; -int audio_vol = -1; -int audio_fd = -1; -char *audio_dev = ""; +static int mix_fd; +static int audio_vol; +static int audio_fd; +static char *audio_dev = "/dev/dsp"; typedef enum {fmtIllegal,fmtRaw,fmtVoc,fmtWave,fmtSunAudio} fmtType; @@ -994,7 +994,7 @@ /* The VoxWare-SDK discourages opening /dev/audio; opening /dev/dsp and properly intializing it via ioctl() is prefered */ - if ((audio_fd=open((audio_dev="/dev/dsp"), + if ((audio_fd=open(audio_dev, (O_WRONLY|O_NDELAY),0)) < 0) { perror(audio_dev); if (mix_fd > 0 && mix_fd != audio_fd) { close(mix_fd); mix_fd = -1; } diff -r 090b52736db2 -r c42ec1d1cded src/lisp.h --- a/src/lisp.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/lisp.h Mon Aug 13 10:33:18 2007 +0200 @@ -166,13 +166,6 @@ #define xfree_1 xfree #endif /* ERROR_CHECK_MALLOC */ -/* We assume an ANSI C compiler and libraries and memcpy, memset, memcmp */ -/* (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) -#endif - #ifndef PRINTF_ARGS # if defined (__GNUC__) && (__GNUC__ >= 2) # define PRINTF_ARGS(string_index,first_to_check) \ @@ -1149,10 +1142,13 @@ #ifdef LISP_FLOAT_TYPE +/* Note: the 'next' field is there to ensure that there is enough room + for the next pointer float type's free list. */ + struct Lisp_Float { struct lrecord_header lheader; - double data; + union { double d; struct Lisp_Float *next; } data; }; DECLARE_LRECORD (float, struct Lisp_Float); @@ -1163,7 +1159,8 @@ #define CHECK_FLOAT(x) CHECK_RECORD (x, float) #define CONCHECK_FLOAT(x) CONCHECK_RECORD (x, float) -#define float_data(f) ((f)->data) +#define float_next(f) ((f)->data.next) +#define float_data(f) ((f)->data.d) #define XFLOATINT(n) extract_float (n) @@ -2720,7 +2717,7 @@ 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 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; diff -r 090b52736db2 -r c42ec1d1cded src/lread.c --- a/src/lread.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/lread.c Mon Aug 13 10:33:18 2007 +0200 @@ -68,7 +68,10 @@ Lisp_Object Qlocate_file_hash_table; Lisp_Object Qfset; +/* See read_escape() for an explanation of this. */ +#if 0 int fail_on_bucky_bit_character_escapes; +#endif /* This symbol is also used in fns.c */ #define FEATUREP_SYNTAX @@ -1593,11 +1596,21 @@ c = read_escape (readcharfun); return c | 0200; -#ifndef MULE -#define FSF_KEYS -#endif + /* Originally, FSF_KEYS provided a degree of FSF Emacs + compatibility by defining character "modifiers" alt, super, + hyper and shift to infest the characters (i.e. integers). + + However, this doesn't cut it for XEmacs 20, which + distinguishes characters from integers. Without Mule, ?\H-a + simply returns ?a because every character is clipped into + 0-255. Under Mule it is much worse -- ?\H-a with FSF_KEYS + produces an illegal character, and moves us to crash-land. + + For these reasons, FSF_KEYS hack is useless and without hope + of ever working under XEmacs 20. */ +#undef FSF_KEYS + #ifdef FSF_KEYS - #define alt_modifier (0x040000) #define super_modifier (0x080000) #define hyper_modifier (0x100000) @@ -3146,6 +3159,8 @@ */ ); Vsource_directory = Qnil; + /* See read_escape(). */ +#if 0 /* Used to be named `puke-on-fsf-keys' */ DEFVAR_BOOL ("fail-on-bucky-bit-character-escapes", &fail_on_bucky_bit_character_escapes /* @@ -3153,6 +3168,7 @@ character escape syntaxes or just read them incorrectly. */ ); fail_on_bucky_bit_character_escapes = 0; +#endif /* This must be initialized in init_lread otherwise it may start out with values saved when the image is dumped. */ diff -r 090b52736db2 -r c42ec1d1cded src/m/gould-np1.h --- a/src/m/gould-np1.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/m/gould-np1.h Mon Aug 13 10:33:18 2007 +0200 @@ -79,9 +79,6 @@ /* Data isn't right next to text on an NP1 */ #define NO_REMAP -/* The bcopy bug has reappeared */ -#define BROKEN_BCOPY - #ifndef GOULD_NP1 #define GOULD_NP1 #endif diff -r 090b52736db2 -r c42ec1d1cded src/m/gould.h --- a/src/m/gould.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/m/gould.h Mon Aug 13 10:33:18 2007 +0200 @@ -42,9 +42,6 @@ lib-src/sorted-doc tickles a compiler bug: remove the -g flag to cc in the makefile. - UTX/32 1.3 has a bug in the bcopy library routine. Fix it by - #define BROKEN_BCOPY in gould.h. - Version 19 incorporates support for releases 2.1 and later of UTX/32. A site running a pre-release of 2.1 should #define RELEASE2_1 in config.h. NOTE-END */ diff -r 090b52736db2 -r c42ec1d1cded src/m/wicat.h --- a/src/m/wicat.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/m/wicat.h Mon Aug 13 10:33:18 2007 +0200 @@ -106,10 +106,6 @@ #define LD_SWITCH_MACHINE "-e __start -N" -/* Sigh...cannot define this for WICAT cuz 0 length memcpy blows chunks */ - -#define BROKEN_BCOPY - /* * Define optimflags if you want to optimize. * - Set to null string for pre-4.2 C compiler diff -r 090b52736db2 -r c42ec1d1cded src/menubar-msw.c --- a/src/menubar-msw.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/menubar-msw.c Mon Aug 13 10:33:18 2007 +0200 @@ -283,7 +283,9 @@ path = list1 (gui_item.name); else { - Lisp_Object arg[2] = { path, list1 (gui_item.name) }; + Lisp_Object arg[2]; + arg[0] = path; + arg[1] = list1 (gui_item.name); /* Fappend gcpro'es its arg */ path = Fappend (2, arg); } diff -r 090b52736db2 -r c42ec1d1cded src/menubar-x.c --- a/src/menubar-x.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/menubar-x.c Mon Aug 13 10:33:18 2007 +0200 @@ -670,7 +670,6 @@ Boolean menubar_was_visible = XtIsManaged (FRAME_X_MENUBAR_WIDGET (f)); Boolean menubar_will_be_visible = menubar_was_visible; Boolean menubar_visibility_changed; - Cardinal new_num_top_widgets = 1; /* for the menubar */ Widget container = FRAME_X_CONTAINER_WIDGET (f); if (menubar_contents_changed) @@ -678,39 +677,14 @@ menubar_visibility_changed = menubar_was_visible != menubar_will_be_visible; - if (! (menubar_visibility_changed - )) + if (!menubar_visibility_changed) return; - /* Set menubar visibility */ - if (menubar_visibility_changed) - (menubar_will_be_visible ? XtManageChild : XtUnmanageChild) - (FRAME_X_MENUBAR_WIDGET (f)); + (menubar_will_be_visible ? XtManageChild : XtUnmanageChild) + (FRAME_X_MENUBAR_WIDGET (f)); - /* Note that new_num_top_widgets doesn't need to reflect the actual - number of top widgets, but just the limit of FRAME_X_TOP_WIDGETS (f)[]. */ - FRAME_X_NUM_TOP_WIDGETS (f) = new_num_top_widgets; - { - /* We want to end up as close in size as possible to what we - were before. So, ask the EmacsManager what size it wants to be - (suggesting the current size), and resize it to that size. It - in turn will call our query-geometry callback, which will round - the size to something that exactly fits the text widget. */ - XtWidgetGeometry req, repl; - Arg al [2]; - - req.request_mode = CWWidth | CWHeight; - XtSetArg (al [0], XtNwidth, &req.width); - XtSetArg (al [1], XtNheight, &req.height); - XtGetValues (container, al, 2); - XtQueryGeometry (container, &req, &repl); - EmacsManagerChangeSize (container, repl.width, repl.height); - /* The window size might not have changed but the text size - did; thus, the base size might be incorrect. So update it. */ - EmacsShellUpdateSizeHints (FRAME_X_SHELL_WIDGET (f)); - } - + MARK_FRAME_SIZE_SLIPPED (f); } static void diff -r 090b52736db2 -r c42ec1d1cded src/msdos.c --- a/src/msdos.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/msdos.c Mon Aug 13 10:33:18 2007 +0200 @@ -30,6 +30,7 @@ #include #ifdef MSDOS +#include #include #include #include @@ -663,7 +664,7 @@ Vwindow_system = intern ("pc"); - bzero (&the_only_x_display, sizeof the_only_x_display); + memset (&the_only_x_display, 0, sizeof the_only_x_display); the_only_x_display.background_pixel = 7; /* White */ the_only_x_display.foreground_pixel = 0; /* Black */ colors = getenv ("EMACSCOLORS"); @@ -1139,12 +1140,12 @@ else { val = Fvector (NUM_RECENT_DOSKEYS, keys); - bcopy (keys + recent_doskeys_index, - XVECTOR_DATA (val), - (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object)); - bcopy (keys, - XVECTOR_DATA (val) + NUM_RECENT_DOSKEYS - recent_doskeys_index, - recent_doskeys_index * sizeof (Lisp_Object)); + memcpy (keys + recent_doskeys_index, + XVECTOR_DATA (val), + (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object)); + memcpy (keys, + XVECTOR_DATA (val) + NUM_RECENT_DOSKEYS - recent_doskeys_index, + recent_doskeys_index * sizeof (Lisp_Object)); return val; } } diff -r 090b52736db2 -r c42ec1d1cded src/mule-mcpath.c --- a/src/mule-mcpath.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/mule-mcpath.c Mon Aug 13 10:33:18 2007 +0200 @@ -195,7 +195,7 @@ { if (path != buffer) /* It is not good to modify original path. */ { - bcopy (path, buffer, len - 1); /* no need to copy last /. */ + memcpy (path, buffer, len - 1); /* no need to copy last /. */ path = buffer; } path[len - 1] = 0; diff -r 090b52736db2 -r c42ec1d1cded src/nt.c --- a/src/nt.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/nt.c Mon Aug 13 10:33:18 2007 +0200 @@ -72,19 +72,6 @@ #include #include -#ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */ -#include -#undef socket -#undef bind -#undef connect -#undef htons -#undef ntohs -#undef inet_addr -#undef gethostname -#undef gethostbyname -#undef getservbyname -#endif - #include "nt.h" #include #include "ntheap.h" @@ -115,17 +102,6 @@ #endif } -#ifndef HAVE_SOCKETS -/* Emulate gethostname. */ -int -gethostname (char *buffer, int size) -{ - /* NT only allows small host names, so the buffer is - certainly large enough. */ - return !GetComputerName (buffer, &size); -} -#endif /* HAVE_SOCKETS */ - /* Emulate getloadavg. */ int getloadavg (double loadavg[], int nelem) @@ -1831,403 +1807,6 @@ return 0; } -#ifdef HAVE_SOCKETS - -/* Wrappers for winsock functions to map between our file descriptors - and winsock's handles; also set h_errno for convenience. - - To allow Emacs to run on systems which don't have winsock support - installed, we dynamically link to winsock on startup if present, and - otherwise provide the minimum necessary functionality - (eg. gethostname). */ - -/* function pointers for relevant socket functions */ -int (PASCAL *pfn_WSAStartup) (WORD wVersionRequired, LPWSADATA lpWSAData); -void (PASCAL *pfn_WSASetLastError) (int iError); -int (PASCAL *pfn_WSAGetLastError) (void); -int (PASCAL *pfn_socket) (int af, int type, int protocol); -int (PASCAL *pfn_bind) (SOCKET s, const struct sockaddr *addr, int namelen); -int (PASCAL *pfn_connect) (SOCKET s, const struct sockaddr *addr, int namelen); -int (PASCAL *pfn_ioctlsocket) (SOCKET s, long cmd, u_long *argp); -int (PASCAL *pfn_recv) (SOCKET s, char * buf, int len, int flags); -int (PASCAL *pfn_send) (SOCKET s, const char * buf, int len, int flags); -int (PASCAL *pfn_closesocket) (SOCKET s); -int (PASCAL *pfn_shutdown) (SOCKET s, int how); -int (PASCAL *pfn_WSACleanup) (void); - -u_short (PASCAL *pfn_htons) (u_short hostshort); -u_short (PASCAL *pfn_ntohs) (u_short netshort); -unsigned long (PASCAL *pfn_inet_addr) (const char * cp); -int (PASCAL *pfn_gethostname) (char * name, int namelen); -struct hostent * (PASCAL *pfn_gethostbyname) (const char * name); -struct servent * (PASCAL *pfn_getservbyname) (const char * name, const char * proto); - -/* SetHandleInformation is only needed to make sockets non-inheritable. */ -BOOL (WINAPI *pfn_SetHandleInformation) (HANDLE object, DWORD mask, DWORD flags); -#ifndef HANDLE_FLAG_INHERIT -#define HANDLE_FLAG_INHERIT 1 -#endif - -HANDLE winsock_lib; -static int winsock_inuse; - -BOOL -term_winsock (void) -{ - if (winsock_lib != NULL && winsock_inuse == 0) - { - /* Not sure what would cause WSAENETDOWN, or even if it can happen - after WSAStartup returns successfully, but it seems reasonable - to allow unloading winsock anyway in that case. */ - if (pfn_WSACleanup () == 0 || - pfn_WSAGetLastError () == WSAENETDOWN) - { - if (FreeLibrary (winsock_lib)) - winsock_lib = NULL; - return TRUE; - } - } - return FALSE; -} - -BOOL -init_winsock (int load_now) -{ - WSADATA winsockData; - - if (winsock_lib != NULL) - return TRUE; - - pfn_SetHandleInformation = NULL; - pfn_SetHandleInformation - = (void *) GetProcAddress (GetModuleHandle ("kernel32.dll"), - "SetHandleInformation"); - - winsock_lib = LoadLibrary ("wsock32.dll"); - - if (winsock_lib != NULL) - { - /* dynamically link to socket functions */ - -#define LOAD_PROC(fn) \ - if ((pfn_##fn = (void *) GetProcAddress (winsock_lib, #fn)) == NULL) \ - goto fail; - - LOAD_PROC( WSAStartup ); - LOAD_PROC( WSASetLastError ); - LOAD_PROC( WSAGetLastError ); - LOAD_PROC( socket ); - LOAD_PROC( bind ); - LOAD_PROC( connect ); - LOAD_PROC( ioctlsocket ); - LOAD_PROC( recv ); - LOAD_PROC( send ); - LOAD_PROC( closesocket ); - LOAD_PROC( shutdown ); - LOAD_PROC( htons ); - LOAD_PROC( ntohs ); - LOAD_PROC( inet_addr ); - LOAD_PROC( gethostname ); - LOAD_PROC( gethostbyname ); - LOAD_PROC( getservbyname ); - LOAD_PROC( WSACleanup ); - -#undef LOAD_PROC - - /* specify version 1.1 of winsock */ - if (pfn_WSAStartup (0x101, &winsockData) == 0) - { - if (winsockData.wVersion != 0x101) - goto fail; - - if (!load_now) - { - /* Report that winsock exists and is usable, but leave - socket functions disabled. I am assuming that calling - WSAStartup does not require any network interaction, - and in particular does not cause or require a dial-up - connection to be established. */ - - pfn_WSACleanup (); - FreeLibrary (winsock_lib); - winsock_lib = NULL; - } - winsock_inuse = 0; - return TRUE; - } - - fail: - FreeLibrary (winsock_lib); - winsock_lib = NULL; - } - - return FALSE; -} - - -int h_errno = 0; - -/* function to set h_errno for compatability; map winsock error codes to - normal system codes where they overlap (non-overlapping definitions - are already in */ -static void set_errno () -{ - if (winsock_lib == NULL) - h_errno = EINVAL; - else - h_errno = pfn_WSAGetLastError (); - - switch (h_errno) - { - case WSAEACCES: h_errno = EACCES; break; - case WSAEBADF: h_errno = EBADF; break; - case WSAEFAULT: h_errno = EFAULT; break; - case WSAEINTR: h_errno = EINTR; break; - case WSAEINVAL: h_errno = EINVAL; break; - case WSAEMFILE: h_errno = EMFILE; break; - case WSAENAMETOOLONG: h_errno = ENAMETOOLONG; break; - case WSAENOTEMPTY: h_errno = ENOTEMPTY; break; - } - errno = h_errno; -} - -static void check_errno () -{ - if (h_errno == 0 && winsock_lib != NULL) - pfn_WSASetLastError (0); -} - -/* [andrewi 3-May-96] I've had conflicting results using both methods, - but I believe the method of keeping the socket handle separate (and - insuring it is not inheritable) is the correct one. */ - -//#define SOCK_REPLACE_HANDLE - -#ifdef SOCK_REPLACE_HANDLE -#define SOCK_HANDLE(fd) ((SOCKET) _get_osfhandle (fd)) -#else -#define SOCK_HANDLE(fd) ((SOCKET) fd_info[fd].hnd) -#endif - -int -sys_socket(int af, int type, int protocol) -{ - int fd; - long s; - child_process * cp; - - if (winsock_lib == NULL) - { - h_errno = ENETDOWN; - return INVALID_SOCKET; - } - - check_errno (); - - /* call the real socket function */ - s = (long) pfn_socket (af, type, protocol); - - if (s != INVALID_SOCKET) - { - /* Although under NT 3.5 _open_osfhandle will accept a socket - handle, if opened with SO_OPENTYPE == SO_SYNCHRONOUS_NONALERT, - that does not work under NT 3.1. However, we can get the same - effect by using a backdoor function to replace an existing - descriptor handle with the one we want. */ - - /* allocate a file descriptor (with appropriate flags) */ - fd = _open ("NUL:", _O_RDWR); - if (fd >= 0) - { -#ifdef SOCK_REPLACE_HANDLE - /* now replace handle to NUL with our socket handle */ - CloseHandle ((HANDLE) _get_osfhandle (fd)); - _free_osfhnd (fd); - _set_osfhnd (fd, s); - /* setmode (fd, _O_BINARY); */ -#else - /* Make a non-inheritable copy of the socket handle. */ - { - HANDLE parent; - HANDLE new_s = INVALID_HANDLE_VALUE; - - parent = GetCurrentProcess (); - - /* Apparently there is a bug in NT 3.51 with some service - packs, which prevents using DuplicateHandle to make a - socket handle non-inheritable (causes WSACleanup to - hang). The work-around is to use SetHandleInformation - instead if it is available and implemented. */ - if (!pfn_SetHandleInformation - || !pfn_SetHandleInformation ((HANDLE) s, - HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT)) - { - DuplicateHandle (parent, - (HANDLE) s, - parent, - &new_s, - 0, - FALSE, - DUPLICATE_SAME_ACCESS); - pfn_closesocket (s); - s = (SOCKET) new_s; - } - fd_info[fd].hnd = (HANDLE) s; - } -#endif - - /* set our own internal flags */ - fd_info[fd].flags = FILE_SOCKET | FILE_BINARY | FILE_READ | FILE_WRITE; - - cp = new_child (); - if (cp) - { - cp->fd = fd; - cp->status = STATUS_READ_ACKNOWLEDGED; - - /* attach child_process to fd_info */ - if (fd_info[ fd ].cp != NULL) - { - DebPrint (("sys_socket: fd_info[%d] apparently in use!\n", fd)); - abort (); - } - - fd_info[ fd ].cp = cp; - - /* success! */ - winsock_inuse++; /* count open sockets */ - return fd; - } - - /* clean up */ - _close (fd); - } - pfn_closesocket (s); - h_errno = EMFILE; - } - set_errno (); - - return -1; -} - - -int -sys_bind (int s, const struct sockaddr * addr, int namelen) -{ - if (winsock_lib == NULL) - { - h_errno = ENOTSOCK; - return SOCKET_ERROR; - } - - check_errno (); - if (fd_info[s].flags & FILE_SOCKET) - { - int rc = pfn_bind (SOCK_HANDLE (s), addr, namelen); - if (rc == SOCKET_ERROR) - set_errno (); - return rc; - } - h_errno = ENOTSOCK; - return SOCKET_ERROR; -} - - -int -sys_connect (int s, const struct sockaddr * name, int namelen) -{ - if (winsock_lib == NULL) - { - h_errno = ENOTSOCK; - return SOCKET_ERROR; - } - - check_errno (); - if (fd_info[s].flags & FILE_SOCKET) - { - int rc = pfn_connect (SOCK_HANDLE (s), name, namelen); - if (rc == SOCKET_ERROR) - set_errno (); - return rc; - } - h_errno = ENOTSOCK; - return SOCKET_ERROR; -} - -u_short -sys_htons (u_short hostshort) -{ - return (winsock_lib != NULL) ? - pfn_htons (hostshort) : hostshort; -} - -u_short -sys_ntohs (u_short netshort) -{ - return (winsock_lib != NULL) ? - pfn_ntohs (netshort) : netshort; -} - -unsigned long -sys_inet_addr (const char * cp) -{ - return (winsock_lib != NULL) ? - pfn_inet_addr (cp) : INADDR_NONE; -} - -int -sys_gethostname (char * name, int namelen) -{ - if (winsock_lib != NULL) - return pfn_gethostname (name, namelen); - - if (namelen > MAX_COMPUTERNAME_LENGTH) - return !GetComputerName (name, &namelen); - - h_errno = EFAULT; - return SOCKET_ERROR; -} - -struct hostent * -sys_gethostbyname(const char * name) -{ - struct hostent * host; - - if (winsock_lib == NULL) - { - h_errno = ENETDOWN; - return NULL; - } - - check_errno (); - host = pfn_gethostbyname (name); - if (!host) - set_errno (); - return host; -} - -struct servent * -sys_getservbyname(const char * name, const char * proto) -{ - struct servent * serv; - - if (winsock_lib == NULL) - { - h_errno = ENETDOWN; - return NULL; - } - - check_errno (); - serv = pfn_getservbyname (name, proto); - if (!serv) - set_errno (); - return serv; -} - -#endif /* HAVE_SOCKETS */ - - /* Shadow main io functions: we need to handle pipes and sockets more intelligently, and implement non-blocking mode as well. */ @@ -2261,18 +1840,6 @@ } if (i == MAXDESC) { -#ifdef HAVE_SOCKETS - if (fd_info[fd].flags & FILE_SOCKET) - { -#ifndef SOCK_REPLACE_HANDLE - if (winsock_lib == NULL) abort (); - - pfn_shutdown (SOCK_HANDLE (fd), 2); - rc = pfn_closesocket (SOCK_HANDLE (fd)); -#endif - winsock_inuse--; /* count open sockets */ - } -#endif delete_child (cp); } } @@ -2415,11 +1982,7 @@ Sleep (0); } } -#ifdef HAVE_SOCKETS - else if (fd_info[fd].flags & FILE_SOCKET) - rc = pfn_recv (SOCK_HANDLE (fd), &cp->chr, sizeof (char), 0); -#endif - + if (rc == sizeof (char)) cp->status = STATUS_READ_SUCCEEDED; else @@ -2513,34 +2076,6 @@ if (to_read > 0) nchars += _read (fd, buffer, to_read); } -#ifdef HAVE_SOCKETS - else /* FILE_SOCKET */ - { - if (winsock_lib == NULL) abort (); - - /* do the equivalent of a non-blocking read */ - pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting); - if (waiting == 0 && nchars == 0) - { - h_errno = errno = EWOULDBLOCK; - return -1; - } - - if (waiting) - { - /* always use binary mode for sockets */ - int res = pfn_recv (SOCK_HANDLE (fd), buffer, count, 0); - if (res == SOCKET_ERROR) - { - DebPrint(("sys_read.recv failed with error %d on socket %ld\n", - pfn_WSAGetLastError (), SOCK_HANDLE (fd))); - set_errno (); - return -1; - } - nchars += res; - } - } -#endif } else { @@ -2628,21 +2163,7 @@ } } -#ifdef HAVE_SOCKETS - if (fd_info[fd].flags & FILE_SOCKET) - { - if (winsock_lib == NULL) abort (); - nchars = pfn_send (SOCK_HANDLE (fd), buffer, count, 0); - if (nchars == SOCKET_ERROR) - { - DebPrint(("sys_read.send failed with error %d on socket %ld\n", - pfn_WSAGetLastError (), SOCK_HANDLE (fd))); - set_errno (); - } - } - else -#endif - nchars = _write (fd, buffer, count); + nchars = _write (fd, buffer, count); return nchars; } @@ -2651,31 +2172,11 @@ void term_ntproc () { -#ifdef HAVE_SOCKETS - /* shutdown the socket interface if necessary */ - term_winsock (); -#endif } void init_ntproc () { -#ifdef HAVE_SOCKETS - /* Initialise the socket interface now if available and requested by - the user by defining PRELOAD_WINSOCK; otherwise loading will be - delayed until open-network-stream is called (win32-has-winsock can - also be used to dynamically load or reload winsock). - - Conveniently, init_environment is called before us, so - PRELOAD_WINSOCK can be set in the registry. */ - - /* Always initialize this correctly. */ - winsock_lib = NULL; - - if (getenv ("PRELOAD_WINSOCK") != NULL) - init_winsock (TRUE); -#endif - /* Initial preparation for subprocess support: replace our standard handles with non-inheritable versions. */ { diff -r 090b52736db2 -r c42ec1d1cded src/ntheap.c --- a/src/ntheap.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/ntheap.c Mon Aug 13 10:33:18 2007 +0200 @@ -189,13 +189,19 @@ if (!data_region_base) return NULL; +#ifndef USE_MINIMAL_TAGBITS /* Ensure that the addresses don't use the upper tag bits since the Lisp type goes there. */ - if (((unsigned long) data_region_base & ~VALMASK) != 0) +#ifdef USE_UNION_TYPE + if (((unsigned long) data_region_base & ~((1U << VALBITS) - 1)) != 0) +#else + if (((unsigned long) data_region_base & ~VALMASK) != 0) +#endif { printf ("Error: The heap was allocated in upper memory.\n"); exit (1); } +#endif data_region_end = data_region_base; real_data_region_end = data_region_end; diff -r 090b52736db2 -r c42ec1d1cded src/ntproc.c --- a/src/ntproc.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/ntproc.c Mon Aug 13 10:33:18 2007 +0200 @@ -327,7 +327,11 @@ cp->pid = -cp->pid; /* pid must fit in a Lisp_Int */ +#ifdef USE_UNION_TYPE + cp->pid = (cp->pid & ((1U << VALBITS) - 1)); +#else cp->pid = (cp->pid & VALMASK); +#endif *pPid = cp->pid; @@ -957,284 +961,6 @@ return pid; } -/* Emulate the select call - Wait for available input on any of the given rfds, or timeout if - a timeout is given and no input is detected - wfds and efds are not supported and must be NULL. - - For simplicity, we detect the death of child processes here and - synchronously call the SIGCHLD handler. Since it is possible for - children to be created without a corresponding pipe handle from which - to read output, we wait separately on the process handles as well as - the char_avail events for each process pipe. We only call - wait/reap_process when the process actually terminates. */ - -/* From ntterm.c */ -extern HANDLE keyboard_handle; -/* From process.c */ -extern int proc_buffered_char[]; - -int -sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, - EMACS_TIME *timeout) -{ - SELECT_TYPE orfds; - DWORD timeout_ms, start_time; - int i, nh, nc, nr; - DWORD active; - child_process *cp, *cps[MAX_CHILDREN]; - HANDLE wait_hnd[MAXDESC + MAX_CHILDREN]; - int fdindex[MAXDESC]; /* mapping from wait handles back to descriptors */ - - timeout_ms = timeout ? (timeout->tv_sec * 1000 + timeout->tv_usec / 1000) : INFINITE; - - /* If the descriptor sets are NULL but timeout isn't, then just Sleep. */ - if (rfds == NULL && wfds == NULL && efds == NULL && timeout != NULL) - { - Sleep (timeout_ms); - return 0; - } - - /* Otherwise, we only handle rfds, so fail otherwise. */ - if (rfds == NULL || wfds != NULL || efds != NULL) - { - errno = EINVAL; - return -1; - } - - orfds = *rfds; - FD_ZERO (rfds); - nr = 0; - - /* Build a list of pipe handles to wait on. */ - nh = 0; - for (i = 0; i < nfds; i++) - if (FD_ISSET (i, &orfds)) - { - if (i == 0) - { -#if 0 -/* Sync with FSF Emacs 19.34.6 note: ifdef'ed out in XEmacs */ - if (keyboard_handle) - { - /* Handle stdin specially */ - wait_hnd[nh] = keyboard_handle; - fdindex[nh] = i; - nh++; - } -#endif - - /* Check for any emacs-generated input in the queue since - it won't be detected in the wait */ - if (detect_input_pending ()) - { - FD_SET (i, rfds); - return 1; - } - } - else - { - /* Child process and socket input */ - cp = fd_info[i].cp; - if (cp) - { - int current_status = cp->status; - - if (current_status == STATUS_READ_ACKNOWLEDGED) - { - /* Tell reader thread which file handle to use. */ - cp->fd = i; - /* Wake up the reader thread for this process */ - cp->status = STATUS_READ_READY; - if (!SetEvent (cp->char_consumed)) - DebPrint (("nt_select.SetEvent failed with " - "%lu for fd %ld\n", GetLastError (), i)); - } - -#ifdef CHECK_INTERLOCK - /* slightly crude cross-checking of interlock between threads */ - - current_status = cp->status; - if (WaitForSingleObject (cp->char_avail, 0) == WAIT_OBJECT_0) - { - /* char_avail has been signalled, so status (which may - have changed) should indicate read has completed - but has not been acknowledged. */ - current_status = cp->status; - if (current_status != STATUS_READ_SUCCEEDED && - current_status != STATUS_READ_FAILED) - DebPrint (("char_avail set, but read not completed: status %d\n", - current_status)); - } - else - { - /* char_avail has not been signalled, so status should - indicate that read is in progress; small possibility - that read has completed but event wasn't yet signalled - when we tested it (because a context switch occurred - or if running on separate CPUs). */ - if (current_status != STATUS_READ_READY && - current_status != STATUS_READ_IN_PROGRESS && - current_status != STATUS_READ_SUCCEEDED && - current_status != STATUS_READ_FAILED) - DebPrint (("char_avail reset, but read status is bad: %d\n", - current_status)); - } -#endif - wait_hnd[nh] = cp->char_avail; - fdindex[nh] = i; - if (!wait_hnd[nh]) abort (); - nh++; -#ifdef FULL_DEBUG - DebPrint (("select waiting on child %d fd %d\n", - cp-child_procs, i)); -#endif - } - else - { - /* Unable to find something to wait on for this fd, skip */ - - /* Note that this is not a fatal error, and can in fact - happen in unusual circumstances. Specifically, if - sys_spawnve fails, eg. because the program doesn't - exist, and debug-on-error is t so Fsignal invokes a - nested input loop, then the process output pipe is - still included in input_wait_mask with no child_proc - associated with it. (It is removed when the debugger - exits the nested input loop and the error is thrown.) */ - - DebPrint (("sys_select: fd %ld is invalid! ignoring\n", i)); - } - } - } - -count_children: - /* Add handles of child processes. */ - nc = 0; - for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--) - /* Some child_procs might be sockets; ignore them. Also some - children may have died already, but we haven't finished reading - the process output; ignore them too. */ - if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess - && (cp->fd < 0 - || (fd_info[cp->fd].flags & FILE_SEND_SIGCHLD) == 0 - || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0) - ) - { - wait_hnd[nh + nc] = cp->procinfo.hProcess; - cps[nc] = cp; - nc++; - } - - /* Nothing to look for, so we didn't find anything */ - if (nh + nc == 0) - { - if (timeout) - Sleep (timeout_ms); - return 0; - } - - /* Wait for input or child death to be signalled. */ - start_time = GetTickCount (); - active = WaitForMultipleObjects (nh + nc, wait_hnd, FALSE, timeout_ms); - - if (active == WAIT_FAILED) - { - DebPrint (("select.WaitForMultipleObjects (%d, %lu) failed with %lu\n", - nh + nc, timeout_ms, GetLastError ())); - /* don't return EBADF - this causes wait_reading_process_input to - abort; WAIT_FAILED is returned when single-stepping under - Windows 95 after switching thread focus in debugger, and - possibly at other times. */ - errno = EINTR; - return -1; - } - else if (active == WAIT_TIMEOUT) - { - return 0; - } - else if (active >= WAIT_OBJECT_0 && - active < WAIT_OBJECT_0+MAXIMUM_WAIT_OBJECTS) - { - active -= WAIT_OBJECT_0; - } - else if (active >= WAIT_ABANDONED_0 && - active < WAIT_ABANDONED_0+MAXIMUM_WAIT_OBJECTS) - { - active -= WAIT_ABANDONED_0; - } - else - abort (); - - /* Loop over all handles after active (now officially documented as - being the first signalled handle in the array). We do this to - ensure fairness, so that all channels with data available will be - processed - otherwise higher numbered channels could be starved. */ - do - { - if (active >= nh) - { - cp = cps[active - nh]; - - /* We cannot always signal SIGCHLD immediately; if we have not - finished reading the process output, we must delay sending - SIGCHLD until we do. */ - - if (cp->fd >= 0 && (fd_info[cp->fd].flags & FILE_AT_EOF) == 0) - fd_info[cp->fd].flags |= FILE_SEND_SIGCHLD; - /* SIG_DFL for SIGCHLD is ignore */ - else - { -#ifdef FULL_DEBUG - DebPrint (("select is raising SIGCHLD handler for pid %d\n", - cp->pid)); -#endif - dead_child = cp; - /* msw_raise (SIGCHLD); -kkm: I will erase this file - slowly, line by line, character by character, - I will press undo often, to prolong this. - Even such a revenge will not be enough for it!!! */ - dead_child = NULL; - } - } - else if (fdindex[active] == 0) - { - /* Keyboard input available */ - FD_SET (0, rfds); - nr++; - } - else - { - /* must be a socket or pipe - read ahead should have - completed, either succeeding or failing. */ - FD_SET (fdindex[active], rfds); - nr++; - } - - /* Even though wait_reading_process_output only reads from at most - one channel, we must process all channels here so that we reap - all children that have died. */ - while (++active < nh + nc) - if (WaitForSingleObject (wait_hnd[active], 0) == WAIT_OBJECT_0) - break; - } while (active < nh + nc); - - /* If no input has arrived and timeout hasn't expired, wait again. */ - if (nr == 0) - { - DWORD elapsed = GetTickCount () - start_time; - - if (timeout_ms > elapsed) /* INFINITE is MAX_UINT */ - { - if (timeout_ms != INFINITE) - timeout_ms -= elapsed; - goto count_children; - } - } - - return nr; -} - /* Substitute for certain kill () operations */ static BOOL CALLBACK @@ -1493,75 +1219,6 @@ { process_dir = dir; } - -#ifdef HAVE_SOCKETS - -/* To avoid problems with winsock implementations that work over dial-up - connections causing or requiring a connection to exist while Emacs is - running, Emacs no longer automatically loads winsock on startup if it - is present. Instead, it will be loaded when open-network-stream is - first called. - - To allow full control over when winsock is loaded, we provide these - two functions to dynamically load and unload winsock. This allows - dial-up users to only be connected when they actually need to use - socket services. */ - -/* From nt.c */ -extern HANDLE winsock_lib; -extern BOOL term_winsock (void); -extern BOOL init_winsock (int load_now); - -extern Lisp_Object Vsystem_name; - -DEFUN ("win32-has-winsock", Fwin32_has_winsock, 0, 1, "", /* -Test for presence of the Windows socket library `winsock'. -Returns non-nil if winsock support is present, nil otherwise. - -If the optional argument LOAD-NOW is non-nil, the winsock library is -also loaded immediately if not already loaded. If winsock is loaded, -the winsock local hostname is returned (since this may be different from -the value of `system-name' and should supplant it), otherwise t is -returned to indicate winsock support is present. -*/ - (load_now)) -{ - int have_winsock; - - have_winsock = init_winsock (!NILP (load_now)); - if (have_winsock) - { - if (winsock_lib != NULL) - { - /* Return new value for system-name. The best way to do this - is to call init_system_name, saving and restoring the - original value to avoid side-effects. */ - Lisp_Object orig_hostname = Vsystem_name; - Lisp_Object hostname; - - init_system_name (); - hostname = Vsystem_name; - Vsystem_name = orig_hostname; - return hostname; - } - return Qt; - } - return Qnil; -} - -DEFUN ("win32-unload-winsock", Fwin32_unload_winsock, 0, 0, "", /* -Unload the Windows socket library `winsock' if loaded. -This is provided to allow dial-up socket connections to be disconnected -when no longer needed. Returns nil without unloading winsock if any -socket connections still exist. -*/ - ()) -{ - return term_winsock () ? Qt : Qnil; -} - -#endif /* HAVE_SOCKETS */ - /* Some miscellaneous functions that are Windows specific, but not GUI specific (ie. are applicable in terminal or batch mode as well). */ @@ -1818,10 +1475,6 @@ Qhigh = intern ("high"); Qlow = intern ("low"); -#ifdef HAVE_SOCKETS - DEFSUBR (Fwin32_has_winsock); - DEFSUBR (Fwin32_unload_winsock); -#endif DEFSUBR (Fwin32_short_file_name); DEFSUBR (Fwin32_long_file_name); DEFSUBR (Fwin32_set_process_priority); @@ -1862,7 +1515,7 @@ */ ); Vwin32_start_process_share_console = Qnil; - DEFVAR_INT ("win32-pipe-read-delay", &Vwin32_pipe_read_delay /* + DEFVAR_LISP ("win32-pipe-read-delay", &Vwin32_pipe_read_delay /* Forced delay before reading subprocess output. This is done to improve the buffering of subprocess output, by avoiding the inefficiency of frequently reading small amounts of data. @@ -1872,7 +1525,7 @@ of time slices to wait (effectively boosting the priority of the child process temporarily). A value of zero disables waiting entirely. */ ); - Vwin32_pipe_read_delay = 50; + Vwin32_pipe_read_delay = make_int (50); #if 0 DEFVAR_LISP ("win32-generate-fake-inodes", &Vwin32_generate_fake_inodes /* diff -r 090b52736db2 -r c42ec1d1cded src/objects-msw.c --- a/src/objects-msw.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/objects-msw.c Mon Aug 13 10:33:18 2007 +0200 @@ -740,7 +740,8 @@ if (*name == '#') { - /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB" */ + /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB" + or "rgb:rrrr/gggg/bbbb" */ unsigned int r, g, b; for (i=1; i #include #include +#ifdef HAVE_SOCKETS +#include +#endif /* Implemenation-specific data. Pointed to by Lisp_Process->process_data */ struct nt_process_data @@ -375,21 +378,9 @@ static void nt_alloc_process_data (struct Lisp_Process *p) { - p->process_data = xnew (struct nt_process_data); + p->process_data = xnew_and_zero (struct nt_process_data); } -#if 0 /* #### Need this method? */ -/* - * Mark any Lisp objects in Lisp_Process->process_data - */ - -static void -nt_mark_process_data (struct Lisp_Process *proc, - void (*markobj) (Lisp_Object)) -{ -} -#endif - static void nt_finalize_process_data (struct Lisp_Process *p, int for_disksave) { @@ -398,30 +389,17 @@ CloseHandle (NT_DATA(p)->h_process); } -#if 0 /* #### Need this method? */ /* * Initialize XEmacs process implemenation once */ - static void nt_init_process (void) { + /* Initialize winsock */ + WSADATA wsa_data; + /* Request Winsock v1.1 Note the order: (minor=1, major=1) */ + WSAStartup (MAKEWORD (1,1), &wsa_data); } -#endif - -#if 0 /* #### Need this method? */ -/* - * Initialize any process local data. This is called when newly - * created process is connected to real OS file handles. The - * handles are generally represented by void* type, but are - * of type HANDLE for Win32 - */ - -static void -nt_init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags) -{ -} -#endif /* * Fork off a subprocess. P is a pointer to newly created subprocess @@ -730,7 +708,198 @@ return send_result ? 0 : -1; } + +/*-----------------------------------------------------------------------*/ +/* Sockets connections */ +/*-----------------------------------------------------------------------*/ +#ifdef HAVE_SOCKETS +/* #### Hey MS, how long Winsock 2 for '95 will be in beta? */ + +#define SOCK_TIMER_ID 666 +#define XM_SOCKREPLY (WM_USER + 666) + +static int +get_internet_address (Lisp_Object host, struct sockaddr_in *address, + Error_behavior errb) +{ + char buf [MAXGETHOSTSTRUCT]; + HWND hwnd; + HANDLE hasync; + int success = 0; + + address->sin_family = AF_INET; + + /* First check if HOST is already a numeric address */ + { + unsigned long inaddr = inet_addr (XSTRING_DATA (host)); + if (inaddr != INADDR_NONE) + { + address->sin_addr.s_addr = inaddr; + return 1; + } + } + + /* Create a window which will receive completion messages */ + hwnd = CreateWindow ("STATIC", NULL, WS_OVERLAPPED, 0, 0, 1, 1, + NULL, NULL, NULL, NULL); + assert (hwnd); + + /* Post name resolution request */ + hasync = WSAAsyncGetHostByName (hwnd, XM_SOCKREPLY, XSTRING_DATA (host), + buf, sizeof (buf)); + if (hasync == NULL) + goto done; + + /* Set a timer to poll for quit every 250 ms */ + SetTimer (hwnd, SOCK_TIMER_ID, 250, NULL); + + while (1) + { + MSG msg; + GetMessage (&msg, hwnd, 0, 0); + if (msg.message == XM_SOCKREPLY) + { + /* Ok, got an answer */ + if (WSAGETASYNCERROR(msg.lParam) == NO_ERROR) + success = 1; + goto done; + } + else if (msg.message == WM_TIMER && msg.wParam == SOCK_TIMER_ID) + { + if (QUITP) + { + WSACancelAsyncRequest (hasync); + KillTimer (hwnd, SOCK_TIMER_ID); + DestroyWindow (hwnd); + REALLY_QUIT; + } + } + DispatchMessage (&msg); + } + + done: + KillTimer (hwnd, SOCK_TIMER_ID); + DestroyWindow (hwnd); + if (success) + { + /* BUF starts with struct hostent */ + struct hostent* he = (struct hostent*) buf; + address->sin_addr.s_addr = *(unsigned long*)he->h_addr_list[0]; + } + return success; +} + +static Lisp_Object +nt_canonicalize_host_name (Lisp_Object host) +{ + struct sockaddr_in address; + + if (!get_internet_address (host, &address, ERROR_ME_NOT)) + return host; + + if (address.sin_family == AF_INET) + return build_string (inet_ntoa (address.sin_addr)); + else + return host; +} + +/* open a TCP network connection to a given HOST/SERVICE. Treated + exactly like a normal process when reading and writing. Only + differences are in status display and process deletion. A network + connection has no PID; you cannot signal it. All you can do is + deactivate and close it via delete-process */ + +static void +nt_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object service, + Lisp_Object family, void** vinfd, void** voutfd) +{ + struct sockaddr_in address; + SOCKET s; + int port; + int retval; + + CHECK_STRING (host); + + if (!EQ (family, Qtcpip)) + error ("Unsupported protocol family \"%s\"", + string_data (symbol_name (XSYMBOL (family)))); + + if (INTP (service)) + port = htons ((unsigned short) XINT (service)); + else + { + struct servent *svc_info; + CHECK_STRING (service); + svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp"); + if (svc_info == 0) + error ("Unknown service \"%s\"", XSTRING_DATA (service)); + port = svc_info->s_port; + } + + get_internet_address (host, &address, ERROR_ME); + address.sin_port = port; + + s = socket (address.sin_family, SOCK_STREAM, 0); + if (s < 0) + report_file_error ("error creating socket", list1 (name)); + + /* We don't want to be blocked on connect */ + { + unsigned int nonblock = 1; + ioctlsocket (s, FIONBIO, &nonblock); + } + + retval = connect (s, (struct sockaddr *) &address, sizeof (address)); + if (retval != NO_ERROR && WSAGetLastError() != WSAEWOULDBLOCK) + goto connect_failed; + + /* Wait while connection is established */ + while (1) + { + fd_set fdset; + struct timeval tv; + int nsel; + + if (QUITP) + { + closesocket (s); + REALLY_QUIT; + } + + /* Poll for quit every 250 ms */ + tv.tv_sec = 0; + tv.tv_usec = 250 * 1000; + + FD_ZERO (&fdset); + FD_SET (s, &fdset); + nsel = select (0, NULL, &fdset, &fdset, &tv); + + if (nsel > 0) + { + /* Check was connnection successful or not */ + tv.tv_usec = 0; + nsel = select (0, NULL, NULL, &fdset, &tv); + if (nsel > 0) + goto connect_failed; + else + break; + } + } + + /* We are connected at this point */ + *vinfd = (void*)s; + DuplicateHandle (GetCurrentProcess(), (HANDLE)s, + GetCurrentProcess(), (LPHANDLE)voutfd, + 0, FALSE, DUPLICATE_SAME_ACCESS); + return; + + connect_failed: + closesocket (s); + report_file_error ("connection failed", list2 (host, name)); +} + +#endif /*-----------------------------------------------------------------------*/ /* Initialization */ @@ -741,23 +910,20 @@ { PROCESS_HAS_METHOD (nt, alloc_process_data); PROCESS_HAS_METHOD (nt, finalize_process_data); - /* PROCESS_HAS_METHOD (nt, mark_process_data); */ - /* PROCESS_HAS_METHOD (nt, init_process); */ - /* PROCESS_HAS_METHOD (nt, init_process_io_handles); */ + PROCESS_HAS_METHOD (nt, init_process); PROCESS_HAS_METHOD (nt, create_process); PROCESS_HAS_METHOD (nt, update_status_if_terminated); PROCESS_HAS_METHOD (nt, send_process); PROCESS_HAS_METHOD (nt, kill_child_process); PROCESS_HAS_METHOD (nt, kill_process_by_pid); -#if 0 /* Yet todo */ #ifdef HAVE_SOCKETS PROCESS_HAS_METHOD (nt, canonicalize_host_name); PROCESS_HAS_METHOD (nt, open_network_stream); #ifdef HAVE_MULTICAST +#error I won't do this until '95 has winsock2 PROCESS_HAS_METHOD (nt, open_multicast_group); #endif #endif -#endif } void diff -r 090b52736db2 -r c42ec1d1cded src/process-unix.c --- a/src/process-unix.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/process-unix.c Mon Aug 13 10:33:18 2007 +0200 @@ -776,7 +776,8 @@ /* Record this as an active process, with its channels. As a result, child_setup will close Emacs's side of the pipes. */ - init_process_io_handles (p, (void*)inchannel, (void*)outchannel, pty_flag); + init_process_io_handles (p, (void*)inchannel, (void*)outchannel, + pty_flag ? STREAM_PTY_FLUSHING : 0); /* Record the tty descriptor used in the subprocess. */ UNIX_DATA(p)->subtty = forkin; @@ -1600,7 +1601,7 @@ } /* This will be used for both sockets */ - bzero(&sa, sizeof(sa)); + memset (&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_port = theport; sa.sin_addr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); diff -r 090b52736db2 -r c42ec1d1cded src/process.c --- a/src/process.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/process.c Mon Aug 13 10:33:18 2007 +0200 @@ -715,7 +715,8 @@ XPROCESS (proc)->pid = Fcons (service, host); XPROCESS (proc)->buffer = buffer; - init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, 0); + init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, + STREAM_NETWORK_CONNECTION); event_stream_select_process (XPROCESS (proc)); @@ -765,7 +766,8 @@ XPROCESS (proc)->pid = Fcons (port, dest); XPROCESS (proc)->buffer = buffer; - init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, 0); + init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, + STREAM_NETWORK_CONNECTION); event_stream_select_process (XPROCESS (proc)); diff -r 090b52736db2 -r c42ec1d1cded src/rangetab.c --- a/src/rangetab.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/rangetab.c Mon Aug 13 10:33:18 2007 +0200 @@ -23,6 +23,8 @@ /* Written by Ben Wing, August 1995. */ +#include +#include "lisp.h" #include "rangetab.h" Lisp_Object Qrange_tablep; diff -r 090b52736db2 -r c42ec1d1cded src/rangetab.h --- a/src/rangetab.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/rangetab.h Mon Aug 13 10:33:18 2007 +0200 @@ -26,9 +26,6 @@ #ifndef _XEMACS_RANGETAB_H_ #define _XEMACS_RANGETAB_H_ -#include -#include "lisp.h" - typedef struct range_table_entry range_table_entry; struct range_table_entry { diff -r 090b52736db2 -r c42ec1d1cded src/redisplay-msw.c --- a/src/redisplay-msw.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/redisplay-msw.c Mon Aug 13 10:33:18 2007 +0200 @@ -524,16 +524,30 @@ } /* Select the bitmaps into the compatible DC. */ - if ((old=SelectObject(FRAME_MSWINDOWS_CDC(f), - IMAGE_INSTANCE_MSWINDOWS_BITMAP(p)))) + if ((old=SelectObject(FRAME_MSWINDOWS_CDC (f), + IMAGE_INSTANCE_MSWINDOWS_BITMAP (p)))) { - BitBlt(hdc, - x,y, - width, height, - FRAME_MSWINDOWS_CDC(f), - 0,0, - SRCCOPY); - SelectObject(FRAME_MSWINDOWS_CDC(f),old); + if (!IMAGE_INSTANCE_MSWINDOWS_MASK (p)) + { + BitBlt(hdc, + x,y, + width, height, + FRAME_MSWINDOWS_CDC (f), + 0,0, + SRCCOPY); + } + else + { + MaskBlt(hdc, + x,y, + width, height, + FRAME_MSWINDOWS_CDC (f), + 0,0, + IMAGE_INSTANCE_MSWINDOWS_MASK (p), + 0,0, + MAKEROP4(SRCINVERT,SRCCOPY)); + } + SelectObject (FRAME_MSWINDOWS_CDC (f),old); } else { @@ -678,12 +692,10 @@ int sbh = window_scrollbar_height (w); int sbw = window_scrollbar_width (w); RECT rect_dead, rect_paint; - struct frame *f; if (sbh == 0 || sbw == 0) return; - f = XFRAME (WINDOW_FRAME (w)); - if (f->scrollbar_on_left) + if (!NILP (w->scrollbar_on_left_p)) { rect_dead.left = WINDOW_LEFT (w); rect_dead.right = WINDOW_LEFT (w) + sbw; @@ -694,7 +706,7 @@ rect_dead.right = WINDOW_RIGHT (w); } - if (f->scrollbar_on_top) + if (!NILP (w->scrollbar_on_top_p)) { rect_dead.top = WINDOW_TOP (w); rect_dead.bottom = WINDOW_TOP (w) + sbh; @@ -707,8 +719,11 @@ } if (IntersectRect (&rect_paint, &rect_dead, prc)) - FillRect (FRAME_MSWINDOWS_DC (f), &rect_paint, - (HBRUSH) (COLOR_BTNFACE+1)); + { + struct frame *f = XFRAME (WINDOW_FRAME (w)); + FillRect (FRAME_MSWINDOWS_DC (f), &rect_paint, + (HBRUSH) (COLOR_BTNFACE+1)); + } } #endif /* HAVE_SCROLLBARS */ @@ -1191,7 +1206,7 @@ /* XXX Not sure about this */ #ifdef HAVE_SCROLLBARS - if (f->scrollbar_on_left) + if (!NILP (w->scrollbar_on_left_p)) rect.left = WINDOW_LEFT (w); else rect.left = WINDOW_RIGHT (w) - MSWINDOWS_DIVIDER_WIDTH; @@ -1201,7 +1216,7 @@ rect.right = rect.left + MSWINDOWS_DIVIDER_WIDTH; #ifdef HAVE_SCROLLBARS - if (f->scrollbar_on_top) + if (!NILP (w->scrollbar_on_top_p)) rect.top = WINDOW_TOP (w); else #endif diff -r 090b52736db2 -r c42ec1d1cded src/redisplay-output.c --- a/src/redisplay-output.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/redisplay-output.c Mon Aug 13 10:33:18 2007 +0200 @@ -1042,7 +1042,7 @@ ypos2 = WINDOW_TEXT_BOTTOM (w); #ifdef HAVE_SCROLLBARS /* This adjustment is to catch the intersection of any scrollbars. */ - if (f->windows_structure_changed && !f->scrollbar_on_top) + if (f->windows_structure_changed && NILP (w->scrollbar_on_top_p)) ypos2 += window_scrollbar_height (w); #endif @@ -1053,7 +1053,7 @@ ypos1 = WINDOW_TEXT_TOP (w); #ifdef HAVE_SCROLLBARS /* This adjustment is to catch the intersection of any scrollbars. */ - if (f->windows_structure_changed && f->scrollbar_on_top) + if (f->windows_structure_changed && !NILP (w->scrollbar_on_top_p)) ypos1 -= window_scrollbar_height (w); #endif } diff -r 090b52736db2 -r c42ec1d1cded src/redisplay-x.c --- a/src/redisplay-x.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/redisplay-x.c Mon Aug 13 10:33:18 2007 +0200 @@ -1408,7 +1408,7 @@ int y1, y2; #ifdef HAVE_SCROLLBARS - if (f->scrollbar_on_left) + if (!NILP (w->scrollbar_on_left_p)) #endif x1 = WINDOW_LEFT (w); #ifdef HAVE_SCROLLBARS @@ -1418,7 +1418,7 @@ x2 = x1 + X_DIVIDER_SPACING; #ifdef HAVE_SCROLLBARS - if (f->scrollbar_on_top) + if (!NILP (w->scrollbar_on_top_p)) y1 = WINDOW_TOP (w); else #endif diff -r 090b52736db2 -r c42ec1d1cded src/redisplay.c --- a/src/redisplay.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/redisplay.c Mon Aug 13 10:33:18 2007 +0200 @@ -5927,6 +5927,14 @@ if (f->size_change_pending) change_frame_size (f, f->new_height, f->new_width, 0); + /* If frame size might need to be changed, due to changed size + of toolbars, scroolabrs etc, change it now */ + if (f->size_slipped) + { + adjust_frame_size (f); + assert (!f->size_slipped); + } + /* The menubar, toolbar, and icon updates must be done before hold_frame_size_changes is called and we are officially 'in_display'. They may eval lisp code which may call Fsignal. @@ -6061,9 +6069,8 @@ if (f->buffers_changed || f->clip_changed || f->extents_changed || f->faces_changed || f->frame_changed || f->menubar_changed || f->modeline_changed || f->point_changed || f->size_changed || - f->toolbar_changed || f->windows_changed || - f->windows_structure_changed || - f->glyphs_changed) + f->toolbar_changed || f->windows_changed || f->size_slipped || + f->windows_structure_changed || f->glyphs_changed) { preempted = redisplay_frame (f, 0); } @@ -6270,11 +6277,14 @@ { struct device *d = XDEVICE (XFRAME (w->frame)->device); struct buffer *b = XBUFFER (w->buffer); + /* Be careful in the order of these tests. The first clasue will + fail if DEVICE_SELECTED_FRAME == Qnil (since w->frame cannot be). + This can occur when the frame title is computed really early */ Bufpos pos = - (((w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d)))) && + ((EQ(DEVICE_SELECTED_FRAME(d), w->frame) && + (w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame(d)))) && EQ(DEVICE_CONSOLE(d), Vselected_console) && - XDEVICE(CONSOLE_SELECTED_DEVICE(XCONSOLE(DEVICE_CONSOLE(d)))) == d && - EQ(DEVICE_SELECTED_FRAME(d), w->frame)) + XDEVICE(CONSOLE_SELECTED_DEVICE(XCONSOLE(DEVICE_CONSOLE(d)))) == d ) ? BUF_PT (b) : marker_position (w->pointm[type])); EMACS_INT line; @@ -6293,7 +6303,11 @@ represents. This function is largely unchanged from previous versions of the - redisplay engine. */ + redisplay engine. + + Warning! This code is also used for frame titles and can be called + very early in the device/frame update process! JV +*/ static void decode_mode_spec (struct window *w, Emchar spec, int type) @@ -6362,8 +6376,9 @@ #ifdef HAVE_TTY { struct frame *f = XFRAME (w->frame); - if (FRAME_TTY_P (f) && f->order_count > 1) + if (FRAME_TTY_P (f) && f->order_count > 1 && f->order_count <= 99999999) { + /* Naughty, naughty */ char * writable_str = alloca_array (char, 10); sprintf (writable_str, "-%d", f->order_count); str = writable_str; diff -r 090b52736db2 -r c42ec1d1cded src/regex.c --- a/src/regex.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/regex.c Mon Aug 13 10:33:18 2007 +0200 @@ -133,36 +133,7 @@ #define INC_CHARPTR(p) ((p)++) #define DEC_CHARPTR(p) ((p)--) -/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. - If nothing else has been done, use the method below. */ -#ifdef INHIBIT_STRING_HEADER -#if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY)) -#if !defined (bzero) && !defined (bcopy) -#undef INHIBIT_STRING_HEADER -#endif -#endif -#endif - -/* This is the normal way of making sure we have a bcopy and a bzero. - This is used in most programs--a few other programs avoid this - by defining INHIBIT_STRING_HEADER. */ -#ifndef INHIBIT_STRING_HEADER -#if defined (HAVE_STRING_H) || defined (STDC_HEADERS) || defined (_LIBC) #include -#ifndef bcmp -#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) -#endif -#ifndef bcopy -#define bcopy(s, d, n) memcpy ((d), (s), (n)) -#endif -#ifndef bzero -#define bzero(s, n) memset ((s), 0, (n)) -#endif -#else -#include -#endif -#endif - /* Define the syntax stuff for \<, \>, etc. */ @@ -2267,7 +2238,7 @@ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); /* Clear the whole map. */ - bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); + memset (b, 0, (1 << BYTEWIDTH) / BYTEWIDTH); /* charset_not matches newline according to a syntax bit. */ if ((re_opcode_t) b[-2] == charset_not @@ -3427,7 +3398,7 @@ assert (fastmap != NULL && p != NULL); INIT_FAIL_STACK (); - bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ + memset (fastmap, 0, 1 << BYTEWIDTH); /* Assume nothing's valid. */ bufp->fastmap_accurate = 1; /* It will be when we're done. */ bufp->can_be_null = 0; diff -r 090b52736db2 -r c42ec1d1cded src/s/aix4.h --- a/src/s/aix4.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/s/aix4.h Mon Aug 13 10:33:18 2007 +0200 @@ -5,7 +5,7 @@ /* AIX 4 does not have HFT any more. */ #undef AIXHFT -/* Get bzero, strcasecmp, and friends, for warning suppression. +/* Get strcasecmp, and friends, for warning suppression. These functions shouldn't actually be used, but don't try to fix it. */ #ifndef NOT_C_CODE #include diff -r 090b52736db2 -r c42ec1d1cded src/s/rtu.h --- a/src/s/rtu.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/s/rtu.h Mon Aug 13 10:33:18 2007 +0200 @@ -45,10 +45,6 @@ #define HAVE_PTYS -/* The system library bcopy() is broken in RTU. For one thing, it expects - the length to be less than 64k. */ -#define BROKEN_BCOPY - /* If your system uses COFF (Common Object File Format) then define the preprocessor symbol "COFF". */ diff -r 090b52736db2 -r c42ec1d1cded src/s/windowsnt.h --- a/src/s/windowsnt.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/s/windowsnt.h Mon Aug 13 10:33:18 2007 +0200 @@ -162,8 +162,6 @@ #define HAVE_MKDIR #define HAVE_RMDIR #define HAVE_RANDOM -#define HAVE_BCOPY -#define HAVE_BCMP #define HAVE_LOGB #define HAVE_FREXP #define HAVE_FMOD @@ -253,8 +251,6 @@ #define kill sys_kill int kill (int pid, int sig); -#define select sys_select - /* map to MSVC names */ #define chdir _chdir #define execlp _execlp diff -r 090b52736db2 -r c42ec1d1cded src/scrollbar-x.c --- a/src/scrollbar-x.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/scrollbar-x.c Mon Aug 13 10:33:18 2007 +0200 @@ -294,85 +294,6 @@ } } -/* A device method. */ -static void -x_scrollbar_width_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) -{ - XtWidgetGeometry req, repl; - Lisp_Object newval = f->scrollbar_width; - - in_specifier_change_function++; - - /* We want the text area to stay the same size. So, we query the - current size and then adjust it for the change in the scrollbar - width. */ - - /* mirror the value in the frame resources, unless it was already - done. */ - if (!in_resource_setting) - Xt_SET_VALUE (FRAME_X_TEXT_WIDGET (f), XtNscrollBarWidth, XINT (newval)); - - if (XtIsRealized (FRAME_X_CONTAINER_WIDGET (f))) - { - req.request_mode = 0; - - /* the query-geometry method looks at the current value of - f->scrollbar_width, so temporarily set it back to the old - one. */ - f->scrollbar_width = oldval; - XtQueryGeometry (FRAME_X_CONTAINER_WIDGET (f), &req, &repl); - f->scrollbar_width = newval; - - repl.width += XINT (newval) - XINT (oldval); - EmacsManagerChangeSize (FRAME_X_CONTAINER_WIDGET (f), repl.width, - repl.height); - } - - in_specifier_change_function--; -} - -/* A device method. */ -static void -x_scrollbar_height_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) -{ - XtWidgetGeometry req, repl; - Lisp_Object newval = f->scrollbar_height; - - in_specifier_change_function++; - - /* We want the text area to stay the same size. So, we query the - current size and then adjust it for the change in the scrollbar - height. */ - - /* mirror the value in the frame resources, unless it was already - done. Also don't do it if this is the when the frame is being - created -- the widgets don't even exist yet, and even if they - did, we wouldn't want to overwrite the resource information - (which might specify a user preference). */ - if (!in_resource_setting) - Xt_SET_VALUE (FRAME_X_TEXT_WIDGET (f), XtNscrollBarHeight, XINT (newval)); - - if (XtIsRealized (FRAME_X_CONTAINER_WIDGET (f))) - { - req.request_mode = 0; - - /* the query-geometry method looks at the current value of - f->scrollbar_height, so temporarily set it back to the old - one. */ - f->scrollbar_height = oldval; - XtQueryGeometry (FRAME_X_CONTAINER_WIDGET (f), &req, &repl); - f->scrollbar_height = newval; - - repl.height += XINT (newval) - XINT (oldval); - EmacsManagerChangeSize (FRAME_X_CONTAINER_WIDGET (f), repl.width, - repl.height); - } - - in_specifier_change_function--; -} - enum x_scrollbar_loop { X_FIND_SCROLLBAR_WINDOW_MIRROR, @@ -817,8 +738,6 @@ CONSOLE_HAS_METHOD (x, create_scrollbar_instance); CONSOLE_HAS_METHOD (x, update_scrollbar_instance_values); CONSOLE_HAS_METHOD (x, update_scrollbar_instance_status); - CONSOLE_HAS_METHOD (x, scrollbar_width_changed_in_frame); - CONSOLE_HAS_METHOD (x, scrollbar_height_changed_in_frame); CONSOLE_HAS_METHOD (x, scrollbar_pointer_changed_in_window); #ifdef MEMORY_USAGE_STATS CONSOLE_HAS_METHOD (x, compute_scrollbar_instance_usage); diff -r 090b52736db2 -r c42ec1d1cded src/scrollbar.c --- a/src/scrollbar.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/scrollbar.c Mon Aug 13 10:33:18 2007 +0200 @@ -57,11 +57,17 @@ #define DEFAULT_SCROLLBAR_WIDTH 15 #define DEFAULT_SCROLLBAR_HEIGHT 15 -/* Width of the scrollbar. */ +/* Width and height of the scrollbar. */ Lisp_Object Vscrollbar_width; +Lisp_Object Vscrollbar_height; -/* Height of the scrollbar. */ -Lisp_Object Vscrollbar_height; +/* Scrollbar visibility specifiers */ +Lisp_Object Vhorizontal_scrollbar_visible_p; +Lisp_Object Vvertical_scrollbar_visible_p; + +/* Scrollbar location specifiers */ +Lisp_Object Vscrollbar_on_left_p; +Lisp_Object Vscrollbar_on_top_p; Lisp_Object Vscrollbar_pointer_glyph; @@ -460,7 +466,7 @@ /* Scrollbars are always the farthest from the text area. */ if (vertical) { - x_offset = (f->scrollbar_on_left + x_offset = (!NILP (w->scrollbar_on_left_p) ? WINDOW_LEFT (w) : WINDOW_RIGHT (w) - scrollbar_width); y_offset = WINDOW_TEXT_TOP (w) + f->scrollbar_y_offset; @@ -469,7 +475,7 @@ { x_offset = WINDOW_TEXT_LEFT (w); y_offset = f->scrollbar_y_offset + - (f->scrollbar_on_top + (!NILP (w->scrollbar_on_top_p) ? WINDOW_TOP (w) : WINDOW_TEXT_BOTTOM (w) + window_bottom_toolbar_height (w)); } @@ -581,27 +587,6 @@ } } - -/* This function is called as a result of a change to the - `scrollbar-width' specifier. */ -static void -scrollbar_width_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) -{ - MAYBE_FRAMEMETH (f, scrollbar_width_changed_in_frame, - (specifier, f, oldval)); -} - -/* This function is called as a result of a change to the - `scrollbar-height' specifier. */ -static void -scrollbar_height_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) -{ - MAYBE_FRAMEMETH (f, scrollbar_height_changed_in_frame, - (specifier, f, oldval)); -} - /* This function is called as a result of a change to the `scrollbar-pointer' glyph. */ static void @@ -946,7 +931,7 @@ some_window_value_changed, slot_offset (struct frame, scrollbar_width), - scrollbar_width_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("scrollbar-height", &Vscrollbar_height /* *Height of horizontal scrollbars. @@ -962,7 +947,80 @@ some_window_value_changed, slot_offset (struct frame, scrollbar_height), - scrollbar_height_changed_in_frame); + frame_size_slipped); + + DEFVAR_SPECIFIER ("horizontal-scrollbar-visible-p", &Vhorizontal_scrollbar_visible_p /* +*Whether the horizontal scrollbar is visible. +This is a specifier; use `set-specifier' to change it. +*/ ); + Vhorizontal_scrollbar_visible_p = Fmake_specifier (Qboolean); + set_specifier_fallback (Vhorizontal_scrollbar_visible_p, + list1 (Fcons (Qnil, Qt))); + set_specifier_caching (Vhorizontal_scrollbar_visible_p, + slot_offset (struct window, + horizontal_scrollbar_visible_p), + some_window_value_changed, + slot_offset (struct frame, + horizontal_scrollbar_visible_p), + frame_size_slipped); + + DEFVAR_SPECIFIER ("vertical-scrollbar-visible-p", &Vvertical_scrollbar_visible_p /* +*Whether the vertical scrollbar is visible. +This is a specifier; use `set-specifier' to change it. +*/ ); + Vvertical_scrollbar_visible_p = Fmake_specifier (Qboolean); + set_specifier_fallback (Vvertical_scrollbar_visible_p, + list1 (Fcons (Qnil, Qt))); + set_specifier_caching (Vvertical_scrollbar_visible_p, + slot_offset (struct window, + vertical_scrollbar_visible_p), + some_window_value_changed, + slot_offset (struct frame, + vertical_scrollbar_visible_p), + frame_size_slipped); + + DEFVAR_SPECIFIER ("scrollbar-on-left-p", &Vscrollbar_on_left_p /* +*Whether the verical scrollbar is on the left side of window or frame. +This is a specifier; use `set-specifier' to change it. +*/ ); + Vscrollbar_on_left_p = Fmake_specifier (Qboolean); + + { + /* Klugde. Under X, we want athena scrollbars on the left, + while all other scrollbars go on the right by default. */ + Lisp_Object fallback = list1 (Fcons (Qnil, Qnil)); +#if defined (HAVE_X_WINDOWS) \ + && !defined (LWLIB_SCROLLBARS_MOTIF) \ + && !defined (LWLIB_SCROLLBARS_LUCID) \ + && !defined (LWLIB_SCROLLBARS_ATHENA3D) + + fallback = Fcons (Fcons (list1 (Qx), Qt), fallback); +#endif + set_specifier_fallback (Vscrollbar_on_left_p, fallback); + } + + set_specifier_caching (Vscrollbar_on_left_p, + slot_offset (struct window, + scrollbar_on_left_p), + some_window_value_changed, + slot_offset (struct frame, + scrollbar_on_left_p), + frame_size_slipped); + + DEFVAR_SPECIFIER ("scrollbar-on-top-p", &Vscrollbar_on_top_p /* +*Whether the verical scrollbar is on the top side of window or frame. +This is a specifier; use `set-specifier' to change it. +*/ ); + Vscrollbar_on_top_p = Fmake_specifier (Qboolean); + set_specifier_fallback (Vscrollbar_on_top_p, + list1 (Fcons (Qnil, Qnil))); + set_specifier_caching (Vscrollbar_on_top_p, + slot_offset (struct window, + scrollbar_on_top_p), + some_window_value_changed, + slot_offset (struct frame, + scrollbar_on_top_p), + frame_size_slipped); } void diff -r 090b52736db2 -r c42ec1d1cded src/search.c --- a/src/search.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/search.c Mon Aug 13 10:33:18 2007 +0200 @@ -2247,16 +2247,22 @@ return match_limit (num, 0); } -DEFUN ("match-data", Fmatch_data, 0, 0, 0, /* +DEFUN ("match-data", Fmatch_data, 0, 2, 0, /* Return a list containing all info on what the last regexp search matched. Element 2N is `(match-beginning N)'; element 2N + 1 is `(match-end N)'. All the elements are markers or nil (nil if the Nth pair didn't match) if the last match was on a buffer; integers or nil if a string was matched. Use `store-match-data' to reinstate the data in this list. + +If INTEGERS (the optional first argument) is non-nil, always use integers +\(rather than markers) to represent buffer positions. +If REUSE is a list, reuse it as part of the value. If REUSE is long enough +to hold all the values, and if INTEGERS is non-nil, no consing is done. */ - ()) + (integers, reuse)) { /* This function has been Mule-ized. */ + Lisp_Object tail, prev; Lisp_Object *data; int i; Charcount len; @@ -2273,7 +2279,8 @@ Bufpos start = search_regs.start[i]; if (start >= 0) { - if (EQ (last_thing_searched, Qt)) + if (EQ (last_thing_searched, Qt) + || !NILP (integers)) { data[2 * i] = make_int (start); data[2 * i + 1] = make_int (search_regs.end[i]); @@ -2298,7 +2305,26 @@ else data[2 * i] = data [2 * i + 1] = Qnil; } - return Flist (2 * len + 2, data); + if (!CONSP (reuse)) + return Flist (2 * len + 2, data); + + /* If REUSE is a list, store as many value elements as will fit + into the elements of REUSE. */ + for (i = 0, tail = reuse; CONSP (tail); i++, tail = XCDR (tail)) + { + if (i < 2 * len + 2) + XCAR (tail) = data[i]; + else + XCAR (tail) = Qnil; + prev = tail; + } + + /* If we couldn't fit all value elements into REUSE, + cons up the rest of them and add them to the end of REUSE. */ + if (i < 2 * len + 2) + XCDR (prev) = Flist (2 * len + 2 - i, data + i); + + return reuse; } @@ -2427,7 +2453,6 @@ */ (str)) { - /* This function has been Mule-ized. */ REGISTER Bufbyte *in, *out, *end; REGISTER Bufbyte *temp; @@ -2441,14 +2466,17 @@ end = in + XSTRING_LENGTH (str); out = temp; - for (; in != end; in++) + while (in < end) { - if (*in == '[' || *in == ']' - || *in == '*' || *in == '.' || *in == '\\' - || *in == '?' || *in == '+' - || *in == '^' || *in == '$') + Emchar c = charptr_emchar (in); + + if (c == '[' || c == ']' + || c == '*' || c == '.' || c == '\\' + || c == '?' || c == '+' + || c == '^' || c == '$') *out++ = '\\'; - *out++ = *in; + out += set_charptr_emchar (out, c); + INC_CHARPTR (in); } return make_string (temp, out - temp); diff -r 090b52736db2 -r c42ec1d1cded src/symsinit.h --- a/src/symsinit.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/symsinit.h Mon Aug 13 10:33:18 2007 +0200 @@ -69,6 +69,7 @@ void syms_of_dired (void); void syms_of_dll (void); void syms_of_doc (void); +void syms_of_dragdrop (void); void syms_of_editfns (void); void syms_of_elhash (void); void syms_of_emacs (void); diff -r 090b52736db2 -r c42ec1d1cded src/sysdep.c --- a/src/sysdep.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/sysdep.c Mon Aug 13 10:33:18 2007 +0200 @@ -2254,7 +2254,12 @@ void init_system_name (void) { -#ifndef HAVE_GETHOSTNAME +#if defined (WINDOWSNT) + char hostname [MAX_COMPUTERNAME_LENGTH + 1]; + size_t size = sizeof(hostname); + GetComputerName (hostname, &size); + Vsystem_name = build_string (hostname); +#elif !defined (HAVE_GETHOSTNAME) struct utsname uts; uname (&uts); Vsystem_name = build_string (uts.nodename); diff -r 090b52736db2 -r c42ec1d1cded src/toolbar-x.c --- a/src/toolbar-x.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/toolbar-x.c Mon Aug 13 10:33:18 2007 +0200 @@ -656,181 +656,6 @@ static void -x_toolbar_size_changed_in_frame_1 (struct frame *f, enum toolbar_pos pos, - Lisp_Object old_visibility) -{ - XtWidgetGeometry req, repl; - int newval; - int oldval = FRAME_X_OLD_TOOLBAR_SIZE (f, pos); - - if (NILP (f->toolbar_visible_p[pos])) - newval = 0; - else if (!f->init_finished && !INTP (f->toolbar_size[pos])) - /* the size might not be set at all if we're in the process of - creating the frame. Otherwise it better be, and we'll crash - out if not. */ - newval = 0; - else - { - Lisp_Object frame; - - XSETFRAME (frame, f); - newval = XINT (Fspecifier_instance (Vtoolbar_size[pos], frame, Qzero, - Qnil)); - } - - if (oldval == newval) - return; - - /* We want the text area to stay the same size. So, we query the - current size and then adjust it for the change in the toolbar - size. */ - - in_specifier_change_function++; - - if (!in_resource_setting) - /* mirror the value in the frame resources, unless already done. */ - 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; - Lisp_Object new_visibility = f->toolbar_visible_p[pos]; - - req.request_mode = 0; - /* the query-geometry method looks at the current value of - f->toolbar_size[pos], so temporarily set it back to the old - one. If we were called because of a visibility change we - also have to temporarily restore its old status as well. */ - f->toolbar_size[pos] = make_int (oldval); - if (!EQ (old_visibility, Qzero)) - f->toolbar_visible_p[pos] = old_visibility; - XtQueryGeometry (FRAME_X_CONTAINER_WIDGET (f), &req, &repl); - f->toolbar_size[pos] = make_int (newval); - if (!EQ (old_visibility, Qzero)) - f->toolbar_visible_p[pos] = new_visibility; - - if (change < 0) - { - x_clear_toolbar (f, pos, change); - mark_frame_toolbar_buttons_dirty (f, pos); - } - if (pos == LEFT_TOOLBAR || pos == RIGHT_TOOLBAR) - repl.width += change; - else - repl.height += change; - - MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); - EmacsManagerChangeSize (FRAME_X_CONTAINER_WIDGET (f), repl.width, - repl.height); - } - /* #### should this go within XtIsRealized()? probably not ... */ - FRAME_X_OLD_TOOLBAR_SIZE (f, pos) = newval; - in_specifier_change_function--; -} - -static void -x_toolbar_size_changed_in_frame (struct frame *f, enum toolbar_pos pos, - Lisp_Object oldval) -{ - x_toolbar_size_changed_in_frame_1 (f, pos, Qzero); -} - -static void -x_toolbar_visible_p_changed_in_frame (struct frame *f, enum toolbar_pos pos, - Lisp_Object oldval) -{ - x_toolbar_size_changed_in_frame_1 (f, pos, oldval); -} - -static void -x_toolbar_border_width_changed_in_frame (struct frame *f, enum toolbar_pos pos, - Lisp_Object lispoldval) -{ - XtWidgetGeometry req, repl; - int newval, oldval; - - if (NILP (f->toolbar_visible_p[pos]) || ZEROP (f->toolbar_size[pos])) - { - return; - } - else if (!f->init_finished && !INTP (f->toolbar_border_width[pos])) - /* the size might not be set at all if we're in the process of - creating the frame. Otherwise it better be, and we'll crash - out if not. */ - { - newval = 0; - } - else - { - Lisp_Object frame; - - XSETFRAME (frame, f); - newval = XINT (Fspecifier_instance (Vtoolbar_border_width[pos], - frame, Qzero, Qnil)); - } - - if (INTP (lispoldval)) - oldval = XINT (lispoldval); - else - oldval = 0; - - if (oldval == newval) - return; - - /* We want the text area to stay the same size. So, we query the - current size and then adjust it for the change in the toolbar - size. */ - - in_specifier_change_function++; - - if (!in_resource_setting) - /* mirror the value in the frame resources, unless already done. */ - 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); - - req.request_mode = 0; - - /* - * We want the current size, not the future size, so briefly - * reset the border width value so the query method returns - * the correct value. - */ - f->toolbar_border_width[pos] = make_int (oldval); - XtQueryGeometry (FRAME_X_CONTAINER_WIDGET (f), &req, &repl); - f->toolbar_border_width[pos] = make_int (newval); - - if (change < 0) - { - x_clear_toolbar (f, pos, change); - mark_frame_toolbar_buttons_dirty (f, pos); - } - if (pos == LEFT_TOOLBAR || pos == RIGHT_TOOLBAR) - repl.width += change; - else - repl.height += change; - - MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); - EmacsManagerChangeSize (FRAME_X_CONTAINER_WIDGET (f), repl.width, - repl.height); - } - in_specifier_change_function--; -} - -static void x_initialize_frame_toolbar_gcs (struct frame *f) { EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); @@ -971,7 +796,4 @@ CONSOLE_HAS_METHOD (x, output_toolbar_button); CONSOLE_HAS_METHOD (x, redraw_exposed_toolbars); CONSOLE_HAS_METHOD (x, redraw_frame_toolbars); - CONSOLE_HAS_METHOD (x, toolbar_size_changed_in_frame); - CONSOLE_HAS_METHOD (x, toolbar_border_width_changed_in_frame); - CONSOLE_HAS_METHOD (x, toolbar_visible_p_changed_in_frame); } diff -r 090b52736db2 -r c42ec1d1cded src/toolbar.c --- a/src/toolbar.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/toolbar.c Mon Aug 13 10:33:18 2007 +0200 @@ -759,14 +759,6 @@ set_frame_toolbar (f, BOTTOM_TOOLBAR); set_frame_toolbar (f, LEFT_TOOLBAR); set_frame_toolbar (f, RIGHT_TOOLBAR); - - if (!first_time_p) - { - int height, width; - pixel_to_char_size (f, FRAME_PIXWIDTH(f), FRAME_PIXHEIGHT(f), - &width, &height); - change_frame_size (f, height, width, 0); - } } void @@ -1233,65 +1225,6 @@ } static void -toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) -{ - int pos; - - for (pos = 0; pos < countof (Vtoolbar_size); pos++) - if (EQ (specifier, Vtoolbar_size[(enum toolbar_pos) pos])) - break; - - assert (pos < countof (Vtoolbar_size)); - - MAYBE_FRAMEMETH (f, toolbar_size_changed_in_frame, - (f, (enum toolbar_pos) pos, oldval)); - - /* Let redisplay know that something has possibly changed. */ - MARK_TOOLBAR_CHANGED; -} - -static void -toolbar_border_width_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) -{ - int pos; - - for (pos = 0; pos < countof (Vtoolbar_border_width); pos++) - { - if (EQ (specifier, Vtoolbar_border_width[(enum toolbar_pos) pos])) - break; - } - - assert (pos < countof (Vtoolbar_border_width)); - - MAYBE_FRAMEMETH (f, toolbar_border_width_changed_in_frame, - (f, (enum toolbar_pos) pos, oldval)); - - /* Let redisplay know that something has possibly changed. */ - MARK_TOOLBAR_CHANGED; -} - -static void -toolbar_visible_p_changed_in_frame (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval) -{ - int pos; - - for (pos = 0; pos < countof (Vtoolbar_visible_p); pos++) - if (EQ (specifier, Vtoolbar_visible_p[(enum toolbar_pos) pos])) - break; - - assert (pos < countof (Vtoolbar_visible_p)); - - MAYBE_FRAMEMETH (f, toolbar_visible_p_changed_in_frame, - (f, (enum toolbar_pos) pos, oldval)); - - /* Let redisplay know that something has possibly changed. */ - MARK_TOOLBAR_CHANGED; -} - -static void default_toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f, Lisp_Object oldval) { @@ -1673,7 +1606,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_size[TOP_TOOLBAR]), - toolbar_size_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("bottom-toolbar-height", &Vtoolbar_size[BOTTOM_TOOLBAR] /* @@ -1689,7 +1622,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_size[BOTTOM_TOOLBAR]), - toolbar_size_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("left-toolbar-width", &Vtoolbar_size[LEFT_TOOLBAR] /* @@ -1705,7 +1638,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_size[LEFT_TOOLBAR]), - toolbar_size_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("right-toolbar-width", &Vtoolbar_size[RIGHT_TOOLBAR] /* @@ -1721,7 +1654,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_size[RIGHT_TOOLBAR]), - toolbar_size_changed_in_frame); + frame_size_slipped); fb = Qnil; #ifdef HAVE_TTY @@ -1802,7 +1735,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_border_width[TOP_TOOLBAR]), - toolbar_border_width_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("bottom-toolbar-border-width", &Vtoolbar_border_width[BOTTOM_TOOLBAR] /* @@ -1818,7 +1751,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_border_width[BOTTOM_TOOLBAR]), - toolbar_border_width_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("left-toolbar-border-width", &Vtoolbar_border_width[LEFT_TOOLBAR] /* @@ -1834,7 +1767,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_border_width[LEFT_TOOLBAR]), - toolbar_border_width_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("right-toolbar-border-width", &Vtoolbar_border_width[RIGHT_TOOLBAR] /* @@ -1850,7 +1783,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_border_width[RIGHT_TOOLBAR]), - toolbar_border_width_changed_in_frame); + frame_size_slipped); fb = Qnil; #ifdef HAVE_TTY @@ -1914,7 +1847,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_visible_p[TOP_TOOLBAR]), - toolbar_visible_p_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", &Vtoolbar_visible_p[BOTTOM_TOOLBAR] /* @@ -1930,7 +1863,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_visible_p[BOTTOM_TOOLBAR]), - toolbar_visible_p_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("left-toolbar-visible-p", &Vtoolbar_visible_p[LEFT_TOOLBAR] /* @@ -1946,7 +1879,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_visible_p[LEFT_TOOLBAR]), - toolbar_visible_p_changed_in_frame); + frame_size_slipped); DEFVAR_SPECIFIER ("right-toolbar-visible-p", &Vtoolbar_visible_p[RIGHT_TOOLBAR] /* @@ -1962,7 +1895,7 @@ toolbar_geometry_changed_in_window, slot_offset (struct frame, toolbar_visible_p[RIGHT_TOOLBAR]), - toolbar_visible_p_changed_in_frame); + frame_size_slipped); /* initially, top inherits from default; this can be changed with `set-default-toolbar-position'. */ diff -r 090b52736db2 -r c42ec1d1cded src/unexaix.c --- a/src/unexaix.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/unexaix.c Mon Aug 13 10:33:18 2007 +0200 @@ -609,7 +609,7 @@ So write zeros for it. */ if (ret == -1 && errno == EFAULT) { - bzero (zeros, nwrite); + memset (zeros, 0, nwrite); write (new, zeros, nwrite); } else if (nwrite != ret) diff -r 090b52736db2 -r c42ec1d1cded src/unexalpha.c --- a/src/unexalpha.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/unexalpha.c Mon Aug 13 10:33:18 2007 +0200 @@ -302,7 +302,7 @@ * Construct new symbol table header */ - bcopy (oldptr + nhdr.fhdr.f_symptr, buffer, cbHDRR); + memcpy (oldptr + nhdr.fhdr.f_symptr, buffer, cbHDRR); #define symhdr ((pHDRR)buffer) newsyms = nhdr.aout.tsize + nhdr.aout.dsize; @@ -394,7 +394,7 @@ if (!strcmp(s,"_edata")) { found++; - bcopy (x, &n_edata, cbEXTR); + memcpy (x, &n_edata, cbEXTR); n_edata.asym.value = Brk; SEEK (new, newsyms + cbHDRR + i, "seeking to symbol _edata in %s", new_name); @@ -404,7 +404,7 @@ else if (!strcmp(s,"_end")) { found++; - bcopy (x, &n_end, cbEXTR); + memcpy (x, &n_end, cbEXTR); n_end.asym.value = Brk; SEEK (new, newsyms + cbHDRR + i, "seeking to symbol _end in %s", new_name); diff -r 090b52736db2 -r c42ec1d1cded src/unexconvex.c --- a/src/unexconvex.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/unexconvex.c Mon Aug 13 10:33:18 2007 +0200 @@ -492,7 +492,7 @@ if( lseek( new, (long) sptr->s_scnptr, 0 ) == -1 ) PERROR( "unexecing" ); - bzero (zeros, sizeof zeros); + memset (zeros, 0, sizeof zeros); ptr = (char *) sptr->s_vaddr; end = ptr + sptr->s_size; diff -r 090b52736db2 -r c42ec1d1cded src/unexhp9k3.c --- a/src/unexhp9k3.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/unexhp9k3.c Mon Aug 13 10:33:18 2007 +0200 @@ -235,7 +235,7 @@ char buf[1024]; int remaining = bytes; - bzero (buf, sizeof(buf)); + memset (buf, 0, sizeof(buf)); while (remaining > 0) { diff -r 090b52736db2 -r c42ec1d1cded src/unexnt.c --- a/src/unexnt.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/unexnt.c Mon Aug 13 10:33:18 2007 +0200 @@ -507,34 +507,22 @@ read_in_bss (char *filename) { HANDLE file; - unsigned long size, index, n_read, total_read; - char buffer[512], *bss; - int i; + unsigned long index, n_read; file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); - if (file == INVALID_HANDLE_VALUE) - { - i = GetLastError (); - exit (1); - } - + if (file == INVALID_HANDLE_VALUE) + abort (); + /* Seek to where the .bss section is tucked away after the heap... */ index = heap_index_in_executable + get_committed_heap_size (); if (SetFilePointer (file, index, NULL, FILE_BEGIN) == 0xFFFFFFFF) - { - i = GetLastError (); - exit (1); - } + abort (); - /* Ok, read in the saved .bss section and initialize all uninitialized variables. */ if (!ReadFile (file, bss_start, bss_size, &n_read, NULL)) - { - i = GetLastError (); - exit (1); - } + abort (); CloseHandle (file); } @@ -547,25 +535,18 @@ HANDLE file_mapping; void *file_base; unsigned long size, upper_size, n_read; - int i; file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (file == INVALID_HANDLE_VALUE) - { - i = GetLastError (); - exit (1); - } - + abort (); + size = GetFileSize (file, &upper_size); file_mapping = CreateFileMapping (file, NULL, PAGE_WRITECOPY, 0, size, NULL); if (!file_mapping) - { - i = GetLastError (); - exit (1); - } - + abort (); + size = get_committed_heap_size (); file_base = MapViewOfFileEx (file_mapping, FILE_MAP_COPY, 0, heap_index_in_executable, size, @@ -582,26 +563,17 @@ if (VirtualAlloc (get_heap_start (), get_committed_heap_size (), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE) == NULL) - { - i = GetLastError (); - exit (1); - } + abort (); /* Seek to the location of the heap data in the executable. */ - i = heap_index_in_executable; - if (SetFilePointer (file, i, NULL, FILE_BEGIN) == 0xFFFFFFFF) - { - i = GetLastError (); - exit (1); - } + if (SetFilePointer (file, heap_index_in_executable, + NULL, FILE_BEGIN) == 0xFFFFFFFF) + abort (); /* Read in the data. */ if (!ReadFile (file, get_heap_start (), get_committed_heap_size (), &n_read, NULL)) - { - i = GetLastError (); - exit (1); - } + abort (); CloseHandle (file); } diff -r 090b52736db2 -r c42ec1d1cded src/window.c --- a/src/window.c Mon Aug 13 10:32:23 2007 +0200 +++ b/src/window.c Mon Aug 13 10:33:18 2007 +0200 @@ -157,6 +157,10 @@ #ifdef HAVE_SCROLLBARS ((markobj) (window->scrollbar_width)); ((markobj) (window->scrollbar_height)); + ((markobj) (window->horizontal_scrollbar_visible_p)); + ((markobj) (window->vertical_scrollbar_visible_p)); + ((markobj) (window->scrollbar_on_left_p)); + ((markobj) (window->scrollbar_on_top_p)); ((markobj) (window->scrollbar_pointer)); #endif /* HAVE_SCROLLBARS */ ((markobj) (window->left_margin_width)); @@ -310,6 +314,10 @@ #ifdef HAVE_SCROLLBARS p->scrollbar_width = Qnil; p->scrollbar_height = Qnil; + p->horizontal_scrollbar_visible_p = Qnil; + p->vertical_scrollbar_visible_p = Qnil; + p->scrollbar_on_left_p = Qnil; + p->scrollbar_on_top_p = Qnil; #endif p->left_margin_width = Qnil; p->right_margin_width = Qnil; @@ -772,7 +780,7 @@ { #ifdef HAVE_SCROLLBARS return (!window_scrollbar_width (w) && - ((XFRAME (w->frame)->scrollbar_on_left) ? + (!NILP (w->scrollbar_on_left_p) ? !window_is_leftmost (w) : !window_is_rightmost (w))); #else @@ -786,7 +794,8 @@ #ifdef HAVE_SCROLLBARS if (!WINDOW_WIN_P (w) || MINI_WINDOW_P (w) - || NILP (w->buffer)) + || NILP (w->buffer) + || NILP (w->vertical_scrollbar_visible_p)) /* #### when does NILP (w->buffer) happen? */ return 0; @@ -805,6 +814,7 @@ if (!WINDOW_WIN_P (w) || MINI_WINDOW_P (w) || NILP (w->buffer) + || NILP (w->horizontal_scrollbar_visible_p) || !window_truncation_on (w)) return 0; @@ -997,7 +1007,7 @@ return 0; #ifdef HAVE_SCROLLBARS - if (XFRAME (w->frame)->scrollbar_on_top) + if (!NILP (w->scrollbar_on_top_p)) return window_scrollbar_height (w) + toolbar_height; else #endif @@ -1016,7 +1026,7 @@ window_modeline_height (w) + window_bottom_toolbar_height (w); #ifdef HAVE_SCROLLBARS - if (!XFRAME (w->frame)->scrollbar_on_top) + if (NILP (w->scrollbar_on_top_p)) return window_scrollbar_height (w) + other_height; else #endif @@ -1062,7 +1072,7 @@ return 0; #ifdef HAVE_SCROLLBARS - if (XFRAME (w->frame)->scrollbar_on_left) + if (!NILP (w->scrollbar_on_left_p)) { #endif return (window_left_right_gutter_width_internal (w, modeline) + @@ -1081,7 +1091,7 @@ return 0; #ifdef HAVE_SCROLLBARS - if (!XFRAME (w->frame)->scrollbar_on_left) + if (NILP (w->scrollbar_on_left_p)) { return (window_left_right_gutter_width_internal (w, modeline) + window_right_toolbar_width (w)); @@ -1819,7 +1829,7 @@ delete the selected window on any other frame, we shouldn't do anything but set the frame's selected_window slot. */ if (EQ (frame, Fselected_frame (Qnil))) - Fselect_window (alternative); + Fselect_window (alternative, Qnil); else set_frame_selected_window (f, alternative); } @@ -2294,7 +2304,7 @@ w = Fprevious_window (w, Qnil, frame, console); i++; } - Fselect_window (w); + Fselect_window (w, Qnil); return Qnil; } @@ -3118,12 +3128,15 @@ return Qnil; } -DEFUN ("select-window", Fselect_window, 1, 1, 0, /* +DEFUN ("select-window", Fselect_window, 1, 2, 0, /* Select WINDOW. Most editing will apply to WINDOW's buffer. The main editor command loop selects the buffer of the selected window before each command. + +With non-nil optional argument `norecord', do not modify the +global or per-frame buffer ordering. */ - (window)) + (window, norecord)) { struct window *w; Lisp_Object old_selected_window = Fselected_window (Qnil); @@ -3158,7 +3171,8 @@ select_frame_1 (WINDOW_FRAME (w)); /* also select the window's buffer */ - Frecord_buffer (w->buffer); + if (NILP (norecord)) + Frecord_buffer (w->buffer); Fset_buffer (w->buffer); /* Go to the point recorded in the window. @@ -3234,7 +3248,7 @@ record_unwind_protect (save_window_excursion_unwind, Fcurrent_window_configuration (Qnil)); - Fselect_window (window); + Fselect_window (window, Qnil); run_hook (Qtemp_buffer_show_hook); unbind_to (count, Qnil); } @@ -4537,6 +4551,10 @@ #ifdef HAVE_SCROLLBARS Lisp_Object scrollbar_width; Lisp_Object scrollbar_height; + Lisp_Object horizontal_scrollbar_visible_p; + Lisp_Object vertical_scrollbar_visible_p; + Lisp_Object scrollbar_on_left_p; + Lisp_Object scrollbar_on_top_p; Lisp_Object scrollbar_pointer; #endif /* HAVE_SCROLLBARS */ #ifdef HAVE_TOOLBARS @@ -4676,6 +4694,10 @@ #ifdef HAVE_SCROLLBARS EQ(win1->scrollbar_width, win2->scrollbar_width) && EQ(win1->scrollbar_height, win2->scrollbar_height) && + EQ(win1->horizontal_scrollbar_visible_p, win2->horizontal_scrollbar_visible_p) && + EQ(win1->vertical_scrollbar_visible_p, win2->vertical_scrollbar_visible_p) && + EQ(win1->scrollbar_on_left_p, win2->scrollbar_on_left_p) && + EQ(win1->scrollbar_on_top_p, win2->scrollbar_on_top_p) && EQ(win1->scrollbar_pointer, win2->scrollbar_pointer) && #endif /* HAVE_SCROLLBARS */ #ifdef HAVE_TOOLBARS @@ -4995,6 +5017,10 @@ #ifdef HAVE_SCROLLBARS w->scrollbar_width = p->scrollbar_width; w->scrollbar_height = p->scrollbar_height; + w->horizontal_scrollbar_visible_p = p->horizontal_scrollbar_visible_p; + w->vertical_scrollbar_visible_p = p->vertical_scrollbar_visible_p; + w->scrollbar_on_left_p = p->scrollbar_on_left_p; + w->scrollbar_on_top_p = p->scrollbar_on_top_p; w->scrollbar_pointer = p->scrollbar_pointer; #endif /* HAVE_SCROLLBARS */ #ifdef HAVE_TOOLBARS @@ -5125,9 +5151,10 @@ if (!minibuf_level && MINI_WINDOW_P (XWINDOW (config->current_window))) Fselect_window (Fnext_window (config->current_window, - Qnil, Qnil, Qnil)); + Qnil, Qnil, Qnil), + Qnil); else - Fselect_window (config->current_window); + Fselect_window (config->current_window, Qnil); if (!NILP (new_current_buffer)) Fset_buffer (new_current_buffer); else @@ -5256,6 +5283,10 @@ #ifdef HAVE_SCROLLBARS p->scrollbar_width = w->scrollbar_width; p->scrollbar_height = w->scrollbar_height; + p->horizontal_scrollbar_visible_p = w->horizontal_scrollbar_visible_p; + p->vertical_scrollbar_visible_p = w->vertical_scrollbar_visible_p; + p->scrollbar_on_left_p = w->scrollbar_on_left_p; + p->scrollbar_on_top_p = w->scrollbar_on_top_p; p->scrollbar_pointer = w->scrollbar_pointer; #endif /* HAVE_SCROLLBARS */ #ifdef HAVE_TOOLBARS diff -r 090b52736db2 -r c42ec1d1cded src/window.h --- a/src/window.h Mon Aug 13 10:32:23 2007 +0200 +++ b/src/window.h Mon Aug 13 10:33:18 2007 +0200 @@ -194,6 +194,12 @@ Lisp_Object scrollbar_width; /* Height of horizontal scrollbars. */ Lisp_Object scrollbar_height; + /* Whether the scrollbars are visible */ + Lisp_Object horizontal_scrollbar_visible_p; + Lisp_Object vertical_scrollbar_visible_p; + /* Scrollbar positions */ + Lisp_Object scrollbar_on_left_p; + Lisp_Object scrollbar_on_top_p; /* Pointer to use for vertical and horizontal scrollbars. */ Lisp_Object scrollbar_pointer; #endif /* HAVE_SCROLLBARS */ @@ -340,7 +346,7 @@ EXFUN (Fmove_to_window_line, 2); EXFUN (Frecenter, 2); EXFUN (Freplace_buffer_in_windows, 1); -EXFUN (Fselect_window, 1); +EXFUN (Fselect_window, 2); EXFUN (Fselected_window, 1); EXFUN (Fset_window_buffer, 2); EXFUN (Fset_window_hscroll, 2); diff -r 090b52736db2 -r c42ec1d1cded tests/Dnd/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/Dnd/README Mon Aug 13 10:33:18 2007 +0200 @@ -0,0 +1,41 @@ + * Sun May 3 1998 Oliver Graf + +This path contains test code for the new XEmacs +Drag'n'Drop code. + +Currently only drags are of interest. The internal +functions only work for OffiX. MSWindows and CDE +are broken with this patch. + +The OffiX functions in mouse.el also work no longer, +because drags are now misc-user-events. + +The misc-user-event now also responds as a button-x-event +to the event-* query functions. + +The function of a drag is called dragdrop-drop-dispatch +as you can see in droptest.el. From within the function +you can access the actual misc-user-event through the +current-mouse-event variable. + +dragtest.el works theoretically, but it needs to be +adapted to some new scheme fitting the drop code. + +Short description of the object part of a drop misc-user-event: +( TYPE . DATA ) +TYPE is either the symbol dragdrop_MIME + or the symbol dragdrop_URL + +DATA is a list of URL strings if TYPE is dragdrop_URL + if TYPE is dragdrop_MIME DATA is either a string + which contains the MIME data, or it is a list of + ( CONTENT-TYPE CONTENT-ENCODING MIME-DATA ) + + For DATA I am thinking of some different scheme: + perhaps it would be more efficient to split the + MIME data into header and body, make a plist from + the header (for easy access), pre-convert the body + to 8bit, and also attach the original data. + This would make the access easier, but it would + require that I do a lot of MIME stuff in C, a thing + that tm-mime-view already does for us. diff -r 090b52736db2 -r c42ec1d1cded tests/Dnd/README.OffiX --- a/tests/Dnd/README.OffiX Mon Aug 13 10:32:23 2007 +0200 +++ b/tests/Dnd/README.OffiX Mon Aug 13 10:33:18 2007 +0200 @@ -1,10 +0,0 @@ -This path contains test code for the OffiX Dnd functions -of XEmacs. - -dragtest.el: simple binding of button-press to offix-start-drag - -droptest.el: binds to the new drop event - -mouse.el in lisp/prim is also adapted to work with the new events. - -OffiX modifications by Oliver Graf diff -r 090b52736db2 -r c42ec1d1cded tests/Dnd/dragtest.el --- a/tests/Dnd/dragtest.el Mon Aug 13 10:32:23 2007 +0200 +++ b/tests/Dnd/dragtest.el Mon Aug 13 10:33:18 2007 +0200 @@ -1,6 +1,8 @@ ;; a simple test of the drag functions ;; -;; still to do: drag only after about 10 pix of movement +;; it still uses the old way, but it will work to test +;; the drop functions using droptest.el +;; (defun text-drag (event) (interactive "@e") diff -r 090b52736db2 -r c42ec1d1cded tests/Dnd/droptest.el --- a/tests/Dnd/droptest.el Mon Aug 13 10:32:23 2007 +0200 +++ b/tests/Dnd/droptest.el Mon Aug 13 10:33:18 2007 +0200 @@ -1,9 +1,118 @@ -;; a simple test of the drop event +;; a short example how to use the new Drag'n'Drop API in +;; combination with extents. ;; -(defun some-drop (event) +(defun dnd-drop-somewhere (object) + (message "Dropped somewhere else with :%s" object) + t) + +(defun do-nothing (object) + nil) + +(defun dnd-target1 (object) + (message "Drop on target1 with: %s" object) + t) + +(defun dnd-target2 (object) + (message "Drop on target2 with: %s" object) + t) + +(defun dnd-target3 (object) + (message "Drop on target3 with: %s" object) + t) + +(defun make-drop-targets () + (let ((buf (get-buffer-create "*DND misc-user extent test buffer*")) + (s nil) + (e nil)) + (set-buffer buf) + (pop-to-buffer buf) + (setq s (point)) + (insert "[ DROP TARGET 1]") + (setq e (point)) + (setq ext (make-extent s e)) + (set-extent-property ext 'dragdrop-drop-functions '(do-nothing dnd-target1)) + (set-extent-property ext 'mouse-face 'highlight) + (insert " ") + (setq s (point)) + (insert "[ DROP TARGET 2]") + (setq e (point)) + (setq ext (make-extent s e)) + (set-extent-property ext 'dragdrop-drop-functions '(dnd-target2)) + (set-extent-property ext 'mouse-face 'highlight) + (insert " ") + (setq s (point)) + (insert "[ DROP TARGET 3]") + (setq e (point)) + (setq ext (make-extent s e)) + (set-extent-property ext 'dragdrop-drop-functions '(dnd-target3)) + (set-extent-property ext 'mouse-face 'highlight) + (newline 2))) + +(defun make-drag-starters () + (let ((buf (get-buffer-create "*DND misc-user extent test buffer*")) + (s nil) + (e nil) + (ext nil) + (kmap nil)) + (set-buffer buf) + (pop-to-buffer buf) + (erase-buffer buf) + (insert "Try to drag data from one of the upper extents to one\nof the lower extents. Make sure that your minibuffer is big\ncause it is used to display the data.\n\nYou may also try to select some of this text and drag it with button2.") + (newline 2) + (setq s (point)) + (insert "[ TEXT DRAG TEST ]") + (setq e (point)) + (setq ext (make-extent s e)) + (set-extent-property ext 'mouse-face 'isearch) + (setq kmap (make-keymap)) + (define-key kmap [button1] 'text-drag) + (set-extent-property ext 'keymap kmap) + (insert " ") + (setq s (point)) + (insert "[ FILE DRAG TEST ]") + (setq e (point)) + (setq ext (make-extent s e)) + (set-extent-property ext 'mouse-face 'isearch) + (setq kmap (make-keymap)) + (define-key kmap [button1] 'file-drag) + (set-extent-property ext 'keymap kmap) + (insert " ") + (setq s (point)) + (insert "[ FILES DRAG TEST ]") + (setq e (point)) + (setq ext (make-extent s e)) + (set-extent-property ext 'mouse-face 'isearch) + (setq kmap (make-keymap)) + (define-key kmap [button1] 'files-drag) + (set-extent-property ext 'keymap kmap) + (insert " ") + (setq s (point)) + (insert "[ URL DRAG TEST ]") + (setq e (point)) + (setq ext (make-extent s e)) + (set-extent-property ext 'mouse-face 'isearch) + (setq kmap (make-keymap)) + (define-key kmap [button1] 'url-drag) + (set-extent-property ext 'keymap kmap) + (newline 3))) + +(defun text-drag (event) (interactive "@e") - (setq dnd-data (event-dnd-data event)) - (message "At %d,%d; button %d, data %s" (event-x event) (event-y event) (event-button event) (event-dnd-data event))) + (offix-start-drag event "That's a test")) + +(defun file-drag (event) + (interactive "@e") + (offix-start-drag event "/tmp/printcap" 2)) -(define-key global-map [drop1] 'some-drop) +(defun url-drag (event) + (interactive "@e") + (offix-start-drag event "http://www.xemacs.org/" 8)) + +(defun files-drag (event) + (interactive "@e") + (offix-start-drag event '("/tmp/dragtest" "/tmp/droptest" "/tmp/printcap") 3)) + +(setq dragdrop-drop-functions '(do-nothing dnd-drop-somewhere do-nothing)) +(make-drag-starters) +(make-drop-targets) diff -r 090b52736db2 -r c42ec1d1cded version.sh --- a/version.sh Mon Aug 13 10:32:23 2007 +0200 +++ b/version.sh Mon Aug 13 10:33:18 2007 +0200 @@ -1,8 +1,8 @@ #!/bin/sh emacs_major_version=21 emacs_minor_version=0 -emacs_beta_version=38 -xemacs_codename="Repartida" +emacs_beta_version=39 +xemacs_codename="Russian White" infodock_major_version=3 infodock_minor_version=90 -infodock_build_version=4 +infodock_build_version=6