Mercurial > hg > xemacs-beta
changeset 151:59463afc5666 r20-3b2
Import from CVS: tag r20-3b2
line wrap: on
line diff
--- a/CHANGES-beta Mon Aug 13 09:36:20 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 09:37:19 2007 +0200 @@ -1,6 +1,24 @@ -*- indented-text -*- +to 20.3 beta2. +-- mega configure patches courtesy of Martin Buchholz +-- edmacro.el-3.14 +-- eldoc.el-1.13 courtesy of Noah Friedman +-- strokes.el-2.2 courtesy of David Bakhash +-- eterm updates courtesy of Per Bothner +-- add-log.el gets new mode type variables for lisp-like, c-like, and tex-like + modes courtesy of Erik Naggum +-- add-log.el synched with Emacs 20.0 +-- gnudoit removed, Gnuserv updated courtesy of Hrvoje Niksic +-- miscellaneous bug fixes +-- Fix for multiple frame `cursor lockstep' bug courtesy of Kyle Jones +-- Continued configure/build cleanup +-- obsolete dynodump directories removed +-- Gnus-5.4.53 courtesy of Lars Magne Ingebrigtsen +-- vc-hooks.el, vc.el synched up with Emacs 19.34.94. +-- Bytecompiler optimization hacking courtesy of Jamie Zawinski + to 20.3 beta1. --- Custom-1.97 courtesy of Per Abraham +-- Custom-1.97 courtesy of Per Abrahamsen -- Obsolete files emacstool.c, emacsclient.c, emacsserver.c removed -- etags.c-11.90 courtesy of Francesco Potorti` -- Dragable modeline courtesy of Kyle Jones @@ -9,4 +27,3 @@ -- New variable `Info-button1-follows-hyperlink' to allow disabling the feature. -- Restore Gosling Emacs transpose-chars implementation as an option --- Bytecompiler optimization hacking courtesy of Jamie Zawinski
--- a/ChangeLog Mon Aug 13 09:36:20 2007 +0200 +++ b/ChangeLog Mon Aug 13 09:37:19 2007 +0200 @@ -1,3 +1,41 @@ +1997-05-22 Steven L Baur <steve@altair.xemacs.org> + + * XEmacs 20.3-beta2 is released. + +Thu May 22 04:19:09 1997 Martin Buchholz <mrb@eng.sun.com> + + * configure.in: Try to fix all reported bugs with 20.3-b1. + Change HAVE_WNN6 to WNN6. WNN6 correctly autodetected. + extra-verbose now default on beta builds. + extra-verbose now much more verbose. + Don't set libs_termcap to " ". + Detect -lXm AFTER detecting -lXpm. + Use runtime paths before running tests, since AC_TRY_RUN may + depend on it. + with-xim=motif only default on Solaris. + realpath moved from s&m to configure.in. + xemacs-version.h removed. main_1 now contains $canonical as well, + for even more useful backtraces. + termcap handling rewritten. + Create .sbinit for Sun's source browser. + Warn user if no XPM support present. + Warn user if compiling in error checking. + + * Makefile.in: use MAKE_SUBDIR consistently. Remove references to + dynodump. Remove core when cleaning. Remove config.log. + make distclean now functional. + +Tue Jun 4 10:15:54 1996 Per Bothner <bothner@deneb.cygnus.com> + + * etc/e/eterm.ti: Add kcub1, kcuf1, kcuu1, kcud1 capabilities. + +Sun May 18 13:03:20 1997 Steven L Baur <steve@altair.xemacs.org> + + * lwlib/Makefile.in.in (distclean): Clean up config.h. + + * Makefile.in (distclean): Remve config.log. + remove broken dynodump stuffs. + Sat May 17 20:30:54 1997 Steven L Baur <steve@altair.xemacs.org> * XEmacs 20.3-b1 is released.
--- a/INSTALL Mon Aug 13 09:36:20 2007 +0200 +++ b/INSTALL Mon Aug 13 09:37:19 2007 +0200 @@ -274,8 +274,13 @@ `/dev/dsp' is required for raw data and WAVE format files. The `--rel-alloc' option can be used to either enable or disable use -of the relocating allocator. Generally, it's best to go with the -default configuration for your system. +of the relocating allocator. Turning on --rel-alloc will allow XEmacs +to return unused memory to the operating system, thereby reducing its +memory footprint. However, it may make XEmacs runs more slowly, +especially if your system's `mmap' implemntation is missing or +inefficient. Generally, it's best to go with the default +configuration for your system. You can tweak this based on how you +use XEmacs, and the memory and cpu resources available on your system. The `--use-system-malloc' option can be use to either enable or disable use of the system malloc. Generally, it's best to go with the @@ -302,11 +307,11 @@ The `--with-xim' option enables use of the X11 XIM mechanism to allow an input method to input text into XEmacs. The input method is shared among all the X applications sharing an X display and using the same -language. The XIM support comes in 2 flavors: motif, and xlib. If -Motif support (the XmIm* set of functions) is available, it is -preferred when available. The xlib XIM support does not work quite as -well, so by default if the XmIm* routines are autodetected, then the -default is `--with-xim=motif', else `--with-xim=no'. +language. The XIM support comes in two flavors: `motif' and `xlib'. +The Motif support (the XmIm* functions) is preferred when available. +The xlib XIM support does not work quite as well. The XIM support has +been known to cause crashes due to bugs in X11, so it defaults to `no' +except on Solaris, where it is known to be stable. The `--with-canna' option enables the use of the Canna Japanese input method.
--- a/Makefile.in Mon Aug 13 09:36:20 2007 +0200 +++ b/Makefile.in Mon Aug 13 09:37:19 2007 +0200 @@ -32,14 +32,14 @@ # with them. # # Delete `.dvi' files here if they are not part of the distribution. -# +# # make distclean # Delete all files from the current directory that are created by # configuring or building the program. If you have unpacked the # source and built the program without creating any other files, # `make distclean' should leave only the files that were in the # distribution. -# +# # make realclean # Delete everything from the current directory that can be # reconstructed with this Makefile. This typically includes @@ -286,10 +286,9 @@ /bin/sh ${srcdir}/lib-src/ad2c ${srcdir}/etc/Emacs.ad ) > \ src/Emacs.ad.h -src: lib-src lwlib dynodump FRC.src +src: @SRC_SUBDIR_DEPS@ FRC.src lib-src: FRC.lib-src lwlib: FRC.lwlib -dynodump: FRC.dynodump .RECURSIVE: ${SUBDIR} @@ -309,9 +308,6 @@ lwlib/Makefile: ${srcdir}/lwlib/Makefile.in.in config.status ./config.status -dynodump/Makefile: ${srcdir}/dynodump/Makefile.in.in config.status - ./config.status - src/config.h: ${srcdir}/src/config.h.in ./config.status @@ -458,7 +454,6 @@ ### Some makes seem to remember that they've built something called FRC, ### so you can only use a given FRC once per makefile. FRC FRC.src.paths.h FRC.src FRC.lib-src FRC.lwlib FRC.mkdir FRC.dump-elcs: -FRC.dynodump: FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean: # ==================== Cleaning up and miscellanea ==================== @@ -471,11 +466,8 @@ ### target for GCC does not delete `libgcc.a', because recompiling it ### is rarely necessary and takes a lot of time. mostlyclean: FRC.mostlyclean - (cd src && $(MAKE) $(MFLAGS) mostlyclean) - (cd lib-src && $(MAKE) $(MFLAGS) mostlyclean) - (cd lwlib && $(MAKE) $(MFLAGS) mostlyclean) - (cd dynodump && $(MAKE) $(MFLAGS) mostlyclean) - -(cd man && $(MAKE) $(MFLAGS) mostlyclean) + for d in $(MAKE_SUBDIR); do (cd $$d && $(MAKE) $(MFLAGS) $@); done + -(cd man && $(MAKE) $(MFLAGS) $@) ### `clean' ### Delete all files from the current directory that are normally @@ -483,14 +475,12 @@ ### record the configuration. Also preserve files that could be made ### by building, but normally aren't because the distribution comes ### with them. -### +### ### Delete `.dvi' files here if they are not part of the distribution. clean: FRC.clean - (cd src && $(MAKE) $(MFLAGS) clean) - (cd lib-src && $(MAKE) $(MFLAGS) clean) - (cd lwlib && $(MAKE) $(MFLAGS) clean) - (cd dynodump && $(MAKE) $(MFLAGS) clean) - -(cd man && $(MAKE) $(MFLAGS) clean) + for d in $(MAKE_SUBDIR); do (cd $$d && $(MAKE) $(MFLAGS) $@); done + -(cd man && $(MAKE) $(MFLAGS) $@) + rm -f core ### `distclean' ### Delete all files from the current directory that are created by @@ -499,18 +489,16 @@ ### `make distclean' should leave only the files that were in the ### distribution. top_distclean=\ - rm -f config.status config-tmp-* build-install Installation ; \ - rm -f Makefile ${SUBDIR_MAKEFILES}; \ - (cd lock && rm -f *) + rm -f config.status config.log config-tmp-* build-install Installation ; \ + for d in src lib-src lwlib dynodump ; do \ + rm -f $$d/Makefile $$d/Makefile.in ; \ + done ; \ + rm -f core .sbinit Makefile lock/* distclean: FRC.distclean - -([ ! -d lock ] && mkdir lock) - -([ ! -d site-lisp ] && mkdir site-lisp) - (cd src && $(MAKE) $(MFLAGS) distclean) - (cd lib-src && $(MAKE) $(MFLAGS) distclean) - (cd lwlib && $(MAKE) $(MFLAGS) distclean) - (cd dynodump && $(MAKE) $(MFLAGS) distclean) - -(cd man && $(MAKE) $(MFLAGS) distclean) + -for d in lock site-lisp; do test -d $$d || mkdir $$d; done + for d in $(MAKE_SUBDIR); do (cd $$d && $(MAKE) $(MFLAGS) $@); done + -(cd man && $(MAKE) $(MFLAGS) $@) -${top_distclean} ### `realclean' @@ -518,18 +506,15 @@ ### reconstructed with this Makefile. This typically includes ### everything deleted by distclean, plus more: C source files ### produced by Bison, tags tables, info files, and so on. -### +### ### One exception, however: `make realclean' should not delete ### `configure' even if `configure' can be remade using a rule in the ### Makefile. More generally, `make realclean' should not delete ### anything that needs to exist in order to run `configure' and then ### begin to build the program. realclean: FRC.realclean - (cd src && $(MAKE) $(MFLAGS) realclean) - (cd lib-src && $(MAKE) $(MFLAGS) realclean) - (cd lwlib && $(MAKE) $(MFLAGS) realclean) - (cd dynodump && $(MAKE) $(MFLAGS) realclean) - -(cd man && $(MAKE) $(MFLAGS) realclean) + for d in $(MAKE_SUBDIR); do (cd $$d && $(MAKE) $(MFLAGS) $@); done + -(cd man && $(MAKE) $(MFLAGS) $@) -${top_distclean} ### This doesn't actually appear in the coding standards, but Karl @@ -537,11 +522,8 @@ ### the coding standards seem to come from. It's like distclean, but ### it deletes backup and autosave files too. extraclean: - (cd src && $(MAKE) $(MFLAGS) extraclean) - (cd lib-src && $(MAKE) $(MFLAGS) extraclean) - (cd lwlib && $(MAKE) $(MFLAGS) extraclean) - (cd dynodump && $(MAKE) $(MFLAGS) extraclean) - -(cd man && $(MAKE) $(MFLAGS) extraclean) + for d in $(MAKE_SUBDIR); do (cd $$d && $(MAKE) $(MFLAGS) $@); done + -(cd man && $(MAKE) $(MFLAGS) $@) -rm -f *~ \#* -${top_distclean}
--- a/configure Mon Aug 13 09:36:20 2007 +0200 +++ b/configure Mon Aug 13 09:37:19 2007 +0200 @@ -176,12 +176,12 @@ ac_ext=c -xe_cppflags='$c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS $CPPFLAGS' # $c_switch_x_machine $c_switch_x_system' -xe_ldflags='$ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site' # $ld_switch_x_machine $ld_switch_x_system' +xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' +xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' xe_libs='$xe_check_libs $X_PRE_LIBS $libs_x $X_EXTRA_LIBS $LIBS $libs_machine $libs_system $libs_standard' ac_cpp='$CPP '"$xe_cppflags" -ac_compile='${CC-cc} -c '"$CFLAGS $xe_cppflags"' conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest '"$CFLAGS $xe_cppflags $LDFLAGS $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' +ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cross_compiling=no if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then @@ -202,7 +202,7 @@ cache_file=/dev/null -MAKE_SUBDIR="src lib-src" +MAKE_SUBDIR="$MAKE_SUBDIR lib-src" && if test "$extra_verbose" = "yes"; then echo " Appending \"lib-src\" to \$MAKE_SUBDIR"; fi prefix='/usr/local' exec_prefix='${prefix}' @@ -234,13 +234,14 @@ use_system_malloc='default' energize_version='' native_sound_lib='' -error_check_default='no' +error_check_default='yes' error_check_extents=$error_check_default error_check_typecheck=$error_check_default error_check_bufpos=$error_check_default error_check_gc=$error_check_default error_check_malloc=$error_check_default debug=$error_check_default +extra_verbose=$error_check_default use_assertions='yes' with_gif='' with_toolbars='' @@ -373,7 +374,7 @@ --with-dnet (*) Compile with support for DECnet. --mail-locking=TYPE (*) Specify the locking to be used by movemail to prevent concurrent updates of mail spool files. Valid types - are \`lockf', \`flock', and \`lock-file'. + are \`lockf', \`flock', and \`file'. Internationalization options: @@ -383,10 +384,10 @@ --with-xim=motif (*) Used in conjunction with Mule support. Use either raw Xlib to provide XIM support, or the Motif XmIm* routines (when available). - If the XmIm* routines are autodetected, - then the default is --with-xim=motif, else --with-xim=no. - NOTE: On some systems like SunOS4 use of this option - will cause XEmacs to crash at startup. + NOTE: On some systems bugs in X11's XIM support + will cause XEmacs to crash, so by default, + no XIM support is compiled in, unless running + on Solaris and the XmIm* routines are detected. --with-canna (*) Compile with support for Canna (a Japanese input method used in conjunction with Mule support). --with-wnn (*) Compile with support for WNN (a multi-language input method @@ -587,7 +588,7 @@ with_database_gnudbm=no for x in `echo "$val" | sed 's/,/ /'` ; do case "$x" in - no ) : ;; + no ) ;; b | be | ber | berk | berkd | berkdb ) with_database_berkdb=yes ;; d | db | dbm ) with_database_dbm=yes ;; g | gn | gnu | gnud | gnudb | gnudbm ) with_database_gnudbm=yes ;; @@ -599,7 +600,7 @@ esac done if test "$with_database_dbm" = "yes" -a \ - "$with_database_gnudbm" = "yes" ; then + "$with_database_gnudbm" = "yes"; then (echo "$progname: Usage error:" echo " " "Only one of \`dbm' and \`gnudbm' may be specified with the \`--$optname' option." @@ -640,7 +641,7 @@ case "$val" in lockf ) val=lockf ;; flock ) val=flock ;; - file ) val=file ;; + file ) val=file ;; * ) (echo "$progname: Usage error:" echo " " "The \`--$optname' option must have one of these values: \`lockf', \`flock', or \`file'." @@ -684,7 +685,7 @@ echo " " "Valid types for the \`--$optname' option are: $types." echo " Use \`$progname --help' to show usage.") >&2 && exit 1 - elif test "$new_default" ; then + elif test -n "$new_default" ; then error_check_extents=$new_default error_check_typecheck=$new_default error_check_bufpos=$new_default @@ -700,8 +701,8 @@ prefix | exec_prefix | bindir | datadir | statedir | libdir | \ mandir | infodir | lispdir | etcdir | lockdir | archlibdir | \ sitelispdir | docdir ) - if test "$valomitted" = "yes" ; then - if test "$#" = 0 ; then + if test "$valomitted" = "yes"; then + if test "$#" = 0; then (echo "$progname: Usage error:" echo " " "The \`--$optname' option requires a value." echo " Use \`$progname --help' to show usage.") >&2 && exit 1; @@ -769,34 +770,15 @@ if test "$with_energize" = "yes" ; then with_menubars=lucid with_scrollbars=motif with_dialogs=motif with_tooltalk=yes - MAKE_SUBDIR="$MAKE_SUBDIR lwlib/energize" + MAKE_SUBDIR="$MAKE_SUBDIR lwlib/energize" && if test "$extra_verbose" = "yes"; then echo " Appending \"lwlib/energize\" to \$MAKE_SUBDIR"; fi fi test "$extra_verbose" = "yes" && verbose=yes -test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias -if test "$with_workshop" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining SUNPRO -EOF -cat >> confdefs.h <<\EOF -#define SUNPRO 1 -EOF -} - - extra_objs="$extra_objs sunpro.o" - with_tooltalk=yes -fi - case "site_includes" in *:* ) site_includes="`echo $site_includes | sed 's/:/ /g'`";; esac case "site_libraries" in *:* ) site_libraries="`echo $site_libraries | sed 's/:/ /g'`";; esac case "site_runtime_libraries" in *:* ) site_runtime_libraries="`echo $site_runtime_libraries | sed 's/:/ /g'`";; esac -if test "$debug" = "yes"; then - use_assertions=yes memory_usage_stats=yes - extra_objs="$extra_objs debug.o" -fi - test -n "$with_x" && with_x11="$with_x" if test "$run_in_place" = "yes"; then @@ -853,7 +835,7 @@ esac echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:857: checking whether ln -s works" >&5 +echo "configure:839: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -908,16 +890,9 @@ vpath %.in $(srcdir)' fi -for dir in ./src ./lib-src ./dynodump ./lwlib ./lock ; do - test ! -d "$dir" && mkdir "$dir" -done -if test "$with_energize" = "yes" -a ! -d ./lwlib/energize; then - mkdir ./lwlib/energize -fi - echo "checking "the configuration name"" 1>&6 -echo "configure:921: checking "the configuration name"" >&5 +echo "configure:896: checking "the configuration name"" >&5 internal_configuration=`echo $configuration | sed 's/-\(energize\|workshop\)//'` if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else exit $? @@ -927,7 +902,7 @@ -machine='' opsys='' need_dynodump=no +machine='' opsys='' case "$canonical" in sparc-*-* ) machine=sparc ;; @@ -982,10 +957,9 @@ *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;; *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* ) if test -z "$NON_GNU_CPP" ; then - if test -f /usr/ccs/lib/cpp - then NON_GNU_CPP=/usr/ccs/lib/cpp - else NON_GNU_CPP=/lib/cpp - fi + for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do + if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi + done fi opsys=usg5-4-2 ;; *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;; @@ -1083,18 +1057,12 @@ *-hp-hpux8* ) opsys=hpux8 ;; *-hp-hpux9* ) opsys=hpux9 ;; *-hp-hpux10* ) opsys=hpux10 ;; - * ) - case "`uname -r`" in - *.B8.* ) opsys=hpux8 ;; - *.08.* ) opsys=hpux8 ;; - *.09.* ) opsys=hpux9 ;; - *.10.* ) opsys=hpux10 ;; - * ) opsys=hpux ;; - esac - ;; + * ) opsys=hpux ;; esac - case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o";; esac + case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"strcat.o\"" + fi ;; esac if test "$opsys" = "hpux10"; then ansi_flag="-Ae"; else ansi_flag="-Aa"; fi NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E" @@ -1205,8 +1173,7 @@ *-solaris2* ) test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp RANLIB=':' - case "$canonical" in *-solaris2.[0-5]* ) need_dynodump=yes ;; esac - esac + esac case "$canonical" in i[3-9]86-*-sunos4*) opsys=sunos4-0 ;; @@ -1318,6 +1285,29 @@ opsysfile="s/${opsys}.h" +if test "$debug" = "yes"; then + use_assertions=yes memory_usage_stats=yes + extra_objs="$extra_objs debug.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"debug.o\"" + fi +fi + +test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias +if test "$with_workshop" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining SUNPRO +EOF +cat >> confdefs.h <<\EOF +#define SUNPRO 1 +EOF +} + + extra_objs="$extra_objs sunpro.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"sunpro.o\"" + fi + with_tooltalk=yes +fi + test -n "$CC" && cc_specified=yes SPECIFIED_CFLAGS="$CFLAGS" @@ -1328,7 +1318,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:1332: checking for $ac_word" >&5 +echo "configure:1322: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1354,7 +1344,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:1358: checking for $ac_word" >&5 +echo "configure:1348: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1399,23 +1389,23 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1403: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1393: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c -xe_cppflags='$c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS $CPPFLAGS' # $c_switch_x_machine $c_switch_x_system' -xe_ldflags='$ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site' # $ld_switch_x_machine $ld_switch_x_system' +xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' +xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' xe_libs='$xe_check_libs $X_PRE_LIBS $libs_x $X_EXTRA_LIBS $LIBS $libs_machine $libs_system $libs_standard' ac_cpp='$CPP '"$xe_cppflags" -ac_compile='${CC-cc} -c '"$CFLAGS $xe_cppflags"' conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest '"$CFLAGS $xe_cppflags $LDFLAGS $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' +ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1415 "configure" +#line 1405 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1409: \"$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 @@ -1435,19 +1425,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:1439: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1429: 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:1444: checking whether we are using GNU C" >&5 +echo "configure:1434: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1441: \"$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 @@ -1461,7 +1451,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1465: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1455: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1486,12 +1476,12 @@ fi -if test "$with_gcc" = "no" -a "$ac_cv_prog_gcc" = "yes"; then +if test "$with_gcc" = "no" -a "$ac_cv_prog_gcc" = "yes"; then CC=${NON_GNU_CC-cc} # 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:1495: checking for $ac_word" >&5 +echo "configure:1485: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1517,7 +1507,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:1521: checking for $ac_word" >&5 +echo "configure:1511: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1562,23 +1552,23 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1566: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1556: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c -xe_cppflags='$c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS $CPPFLAGS' # $c_switch_x_machine $c_switch_x_system' -xe_ldflags='$ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site' # $ld_switch_x_machine $ld_switch_x_system' +xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' +xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' xe_libs='$xe_check_libs $X_PRE_LIBS $libs_x $X_EXTRA_LIBS $LIBS $libs_machine $libs_system $libs_standard' ac_cpp='$CPP '"$xe_cppflags" -ac_compile='${CC-cc} -c '"$CFLAGS $xe_cppflags"' conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest '"$CFLAGS $xe_cppflags $LDFLAGS $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' +ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1578 "configure" +#line 1568 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1572: \"$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 @@ -1598,19 +1588,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:1602: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1592: 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:1607: checking whether we are using GNU C" >&5 +echo "configure:1597: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1604: \"$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 @@ -1624,7 +1614,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1628: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1618: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1648,12 +1638,12 @@ test "${CFLAGS+set}" = set || CFLAGS="-g" fi -elif test "$with_gcc" = "yes" -a "$ac_cv_prog_gcc" = "no" ; then +elif test "$with_gcc" = "yes" -a "$ac_cv_prog_gcc" = "no" ; then CC=gcc # 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:1657: checking for $ac_word" >&5 +echo "configure:1647: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1679,7 +1669,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:1683: checking for $ac_word" >&5 +echo "configure:1673: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1724,23 +1714,23 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1718: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c -xe_cppflags='$c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS $CPPFLAGS' # $c_switch_x_machine $c_switch_x_system' -xe_ldflags='$ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site' # $ld_switch_x_machine $ld_switch_x_system' +xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' +xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' xe_libs='$xe_check_libs $X_PRE_LIBS $libs_x $X_EXTRA_LIBS $LIBS $libs_machine $libs_system $libs_standard' ac_cpp='$CPP '"$xe_cppflags" -ac_compile='${CC-cc} -c '"$CFLAGS $xe_cppflags"' conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest '"$CFLAGS $xe_cppflags $LDFLAGS $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' +ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1740 "configure" +#line 1730 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1734: \"$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 @@ -1760,19 +1750,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:1764: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1754: 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:1769: checking whether we are using GNU C" >&5 +echo "configure:1759: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1766: \"$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 @@ -1786,7 +1776,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1790: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1780: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1816,7 +1806,7 @@ test -n "$NON_GNU_CPP" -a "$with_gcc" = "no" -a -z "$CPP" && CPP="$NON_GNU_CPP" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1820: checking how to run the C preprocessor" >&5 +echo "configure:1810: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1829,13 +1819,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1833 "configure" +#line 1823 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1846,13 +1836,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1850 "configure" +#line 1840 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1875,7 +1865,7 @@ case "$canonical" in - *-sun-sunos* ) test "$CPP" = "acc -E" && CPP="acc -E -Xs" ;; + *-sun-sunos* ) test "$CPP" = "acc -E" && CPP="acc -E -Xs" ;; esac @@ -1901,47 +1891,47 @@ #include "'$srcdir'/src/'$machfile'" #ifndef LIBS_MACHINE -#define LIBS_MACHINE +#define LIBS_MACHINE #endif configure___ libs_machine=LIBS_MACHINE #ifndef LIBS_SYSTEM -#define LIBS_SYSTEM +#define LIBS_SYSTEM #endif configure___ libs_system=LIBS_SYSTEM #ifndef LIBS_TERMCAP -#define LIBS_TERMCAP +#define LIBS_TERMCAP #endif configure___ libs_termcap=LIBS_TERMCAP #ifndef LIB_STANDARD -#define LIB_STANDARD +#define LIB_STANDARD #endif configure___ libs_standard=LIB_STANDARD #ifndef C_SWITCH_SYSTEM -#define C_SWITCH_SYSTEM +#define C_SWITCH_SYSTEM #endif configure___ c_switch_system=C_SWITCH_SYSTEM #ifndef C_SWITCH_MACHINE -#define C_SWITCH_MACHINE +#define C_SWITCH_MACHINE #endif configure___ c_switch_machine=C_SWITCH_MACHINE #ifndef C_SWITCH_X_SYSTEM -#define C_SWITCH_X_SYSTEM +#define C_SWITCH_X_SYSTEM #endif configure___ c_switch_x_system=C_SWITCH_X_SYSTEM #ifndef LD_SWITCH_X_SYSTEM -#define LD_SWITCH_X_SYSTEM +#define LD_SWITCH_X_SYSTEM #endif configure___ ld_switch_x_system=LD_SWITCH_X_SYSTEM #ifndef LD_SWITCH_SYSTEM -#define LD_SWITCH_SYSTEM +#define LD_SWITCH_SYSTEM #endif configure___ ld_switch_system=LD_SWITCH_SYSTEM @@ -1985,12 +1975,6 @@ configure___ mail_use_lockf=no #endif -#ifdef __SUNPRO_C -configure___ sunpro_c=yes -#else -configure___ sunpro_c=no -#endif - #ifdef THIS_IS_CONFIGURE @@ -2025,11 +2009,107 @@ fi rm $tempcname -if test "$cflags" != "NO_CFLAGS_DEFINED" ; then - REAL_CFLAGS=$cflags -fi - -UNEXEC_SRC="`echo $unexec | sed 's/\.o/.c/'`" +test "$cflags" != "NO_CFLAGS_DEFINED" && REAL_CFLAGS="$cflags" + +extra_objs="$extra_objs $unexec" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"$unexec\"" + fi + + +if test -n "$site_libraries"; then + for arg in $site_libraries; do + case "$arg" in -* ) ;; * ) arg="-L${arg}" ;; esac + ld_switch_site="$ld_switch_site $arg" && if test "$extra_verbose" = "yes"; then echo " Appending \"$arg\" to \$ld_switch_site"; fi + done +fi + +if test -n "$site_includes" ; then + for arg in $site_includes; do + case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac + c_switch_site="$c_switch_site $arg" && if test "$extra_verbose" = "yes"; then echo " Appending \"$arg\" to \$c_switch_site"; fi + done +fi + +for dir in "/usr/ccs/lib"; do + test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L${dir}\" to \$ld_switch_site"; fi +done + +if test -n "$site_runtime_libraries" ; then + LD_RUN_PATH="`echo $site_runtime_libraries | sed 's/ */:/'`" + export LD_RUN_PATH +fi + + +if test "$dynamic" = "no"; then add_runtime_path=no +elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes +else case "$canonical" in + *-solaris2.* | *-sgi-irix* ) add_runtime_path=yes ;; + * ) add_runtime_path=no ;; + esac +fi + +if test "$add_runtime_path" = "yes"; then + echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 +echo "configure:2054: 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" + cat > conftest.$ac_ext <<EOF +#line 2059 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + dash_r="$try_dash_r" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + xe_check_libs="" + test -n "$dash_r" && break + done + if test -n "$dash_r"; + then echo "$ac_t"""\"${dash_r}\""" 1>&6 + else echo "$ac_t""NONE" 1>&6 + fi +fi + + +if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then + ld_switch_site="`echo $ld_switch_site | sed \"s/${dash_r}[^ ]*//\"`" + ld_switch_x_site="`echo $ld_switch_x_site | sed \"s/${dash_r}[^ ]*//\"`" + + if test -n "$LD_RUN_PATH"; then + runpath="$LD_RUN_PATH" + else + runpath="" + for arg in $ld_switch_site $ld_switch_x_site; do + case "$arg" in -L* ) + dir=`echo "$arg" | sed 's/^-L//'` + if test -n "`ls ${dir}/*.s[ol] 2>/dev/null`"; then + test -n "$runpath" && runpath="${runpath}:" + runpath="${runpath}${dir}" + fi + ;; + esac + done + case "$canonical" in *-solaris2.[1-4]* ) + test "$need_motif" = "yes" && runpath="${runpath}:/opt/SUNWdt/lib" ;; + esac + fi + + if test -n "$runpath"; then + ld_switch_run="${dash_r}${runpath}" + test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" + fi +fi + + GNU_MALLOC=yes if test "$system_malloc" = "yes" ; then @@ -2043,11 +2123,10 @@ fi - # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2051: checking for $ac_word" >&5 +echo "configure:2130: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -2100,7 +2179,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:2104: checking for a BSD compatible install" >&5 +echo "configure:2183: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" @@ -2151,7 +2230,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:2155: checking for $ac_word" >&5 +echo "configure:2234: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2179,9 +2258,9 @@ echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2183: checking for AIX" >&5 -cat > conftest.$ac_ext <<EOF -#line 2185 "configure" +echo "configure:2262: checking for AIX" >&5 +cat > conftest.$ac_ext <<EOF +#line 2264 "configure" #include "confdefs.h" #ifdef _AIX yes @@ -2211,15 +2290,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2215: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2218 "configure" +echo "configure:2294: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2297 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2252,15 +2331,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2256: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2259 "configure" +echo "configure:2335: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2338 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2293,15 +2372,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2297: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2300 "configure" +echo "configure:2376: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2379 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2331,10 +2410,10 @@ done echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2335: checking for ANSI C header files" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2338 "configure" +echo "configure:2414: checking for ANSI C header files" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2417 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -2342,7 +2421,7 @@ #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2359,7 +2438,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2363 "configure" +#line 2442 "configure" #include "confdefs.h" #include <string.h> EOF @@ -2377,7 +2456,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2381 "configure" +#line 2460 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -2395,7 +2474,7 @@ if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. cat > conftest.$ac_ext <<EOF -#line 2399 "configure" +#line 2478 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2406,7 +2485,7 @@ exit (0); } EOF -if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then : else @@ -2431,10 +2510,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2435: checking whether time.h and sys/time.h may both be included" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2438 "configure" +echo "configure:2514: checking whether time.h and sys/time.h may both be included" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2517 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -2443,7 +2522,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2467,10 +2546,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:2471: checking for sys_siglist declaration in signal.h or unistd.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2474 "configure" +echo "configure:2550: checking for sys_siglist declaration in signal.h or unistd.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2553 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -2482,7 +2561,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:2486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -2507,9 +2586,9 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:2511: checking for struct utimbuf" >&5 -cat > conftest.$ac_ext <<EOF -#line 2513 "configure" +echo "configure:2590: checking for struct utimbuf" >&5 +cat > conftest.$ac_ext <<EOF +#line 2592 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME #include <sys/time.h> @@ -2528,7 +2607,7 @@ static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:2532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2611: \"$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 @@ -2548,10 +2627,10 @@ rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2552: checking return type of signal handlers" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2555 "configure" +echo "configure:2631: checking return type of signal handlers" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2634 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -2568,7 +2647,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:2572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2591,9 +2670,9 @@ echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:2595: checking for struct timeval" >&5 -cat > conftest.$ac_ext <<EOF -#line 2597 "configure" +echo "configure:2674: checking for struct timeval" >&5 +cat > conftest.$ac_ext <<EOF +#line 2676 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME #include <sys/time.h> @@ -2609,7 +2688,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:2613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -2631,10 +2710,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:2635: checking whether struct tm is in sys/time.h or time.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2638 "configure" +echo "configure:2714: checking whether struct tm is in sys/time.h or time.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2717 "configure" #include "confdefs.h" #include <sys/types.h> #include <time.h> @@ -2642,7 +2721,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2666,10 +2745,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:2670: checking for tm_zone in struct tm" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2673 "configure" +echo "configure:2749: checking for tm_zone in struct tm" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2752 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_cv_struct_tm> @@ -2677,7 +2756,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:2681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -2700,10 +2779,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:2704: checking for tzname" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2707 "configure" +echo "configure:2783: checking for tzname" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2786 "configure" #include "confdefs.h" #include <time.h> #ifndef tzname /* For SGI. */ @@ -2713,7 +2792,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:2717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -2739,10 +2818,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2743: checking for working const" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2746 "configure" +echo "configure:2822: checking for working const" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2825 "configure" #include "confdefs.h" int main() { @@ -2791,7 +2870,7 @@ ; return 0; } EOF -if { (eval echo configure:2795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2816,7 +2895,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:2820: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:2899: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -2841,12 +2920,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2845: checking whether byte ordering is bigendian" >&5 +echo "configure:2924: checking whether byte ordering is bigendian" >&5 ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext <<EOF -#line 2850 "configure" +#line 2929 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -2857,11 +2936,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:2861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext <<EOF -#line 2865 "configure" +#line 2944 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -2872,7 +2951,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:2876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2889,7 +2968,7 @@ rm -f conftest* if test $ac_cv_c_bigendian = unknown; then cat > conftest.$ac_ext <<EOF -#line 2893 "configure" +#line 2972 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -2902,7 +2981,7 @@ exit (u.c[sizeof (long) - 1] == 1); } EOF -if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_c_bigendian=no else @@ -2927,8 +3006,114 @@ fi +echo $ac_n "checking size of short""... $ac_c" 1>&6 +echo "configure:3011: checking size of short" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3014 "configure" +#include "confdefs.h" +#include <stdio.h> +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(short)); + exit(0); +} +EOF +if { (eval echo configure:3025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +then + ac_cv_sizeof_short=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_short=0 +fi +rm -fr conftest* +echo "$ac_t""$ac_cv_sizeof_short" 1>&6 +{ test "$extra_verbose" = "yes" && cat << EOF + Defining SIZEOF_SHORT = $ac_cv_sizeof_short +EOF +cat >> confdefs.h <<EOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +EOF +} + + +echo $ac_n "checking size of int""... $ac_c" 1>&6 +echo "configure:3046: checking size of int" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3049 "configure" +#include "confdefs.h" +#include <stdio.h> +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(int)); + exit(0); +} +EOF +if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +then + ac_cv_sizeof_int=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_int=0 +fi +rm -fr conftest* +echo "$ac_t""$ac_cv_sizeof_int" 1>&6 +{ test "$extra_verbose" = "yes" && cat << EOF + Defining SIZEOF_INT = $ac_cv_sizeof_int +EOF +cat >> confdefs.h <<EOF +#define SIZEOF_INT $ac_cv_sizeof_int +EOF +} + + +echo $ac_n "checking size of long""... $ac_c" 1>&6 +echo "configure:3081: checking size of long" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3084 "configure" +#include "confdefs.h" +#include <stdio.h> +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(long)); + exit(0); +} +EOF +if { (eval echo configure:3095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +then + ac_cv_sizeof_long=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_long=0 +fi +rm -fr conftest* +echo "$ac_t""$ac_cv_sizeof_long" 1>&6 +{ test "$extra_verbose" = "yes" && cat << EOF + Defining SIZEOF_LONG = $ac_cv_sizeof_long +EOF +cat >> confdefs.h <<EOF +#define SIZEOF_LONG $ac_cv_sizeof_long +EOF +} + + + echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:2932: checking for long file names" >&5 +echo "configure:3117: 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: @@ -2976,12 +3161,12 @@ echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6 -echo "configure:2980: checking for sqrt in -lm" >&5 +echo "configure:3165: checking for sqrt in -lm" >&5 ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'` xe_check_libs=" -lm " cat > conftest.$ac_ext <<EOF -#line 2985 "configure" +#line 3170 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2992,7 +3177,7 @@ sqrt() ; return 0; } EOF -if { (eval echo configure:2996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3181: \"$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 @@ -3004,7 +3189,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` @@ -3016,16 +3201,25 @@ EOF } - LIBS="-lm $LIBS" - -else - echo "$ac_t""no" 1>&6 -fi - + LIBS="-lm $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lm\" to \$LIBS"; fi + +else + echo "$ac_t""no" 1>&6 +fi + + + +{ test "$extra_verbose" = "yes" && cat << \EOF + Defining LISP_FLOAT_TYPE +EOF +cat >> confdefs.h <<\EOF +#define LISP_FLOAT_TYPE 1 +EOF +} echo "checking type of mail spool file locking" 1>&6 -echo "configure:3029: checking type of mail spool file locking" >&5 +echo "configure:3223: 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 @@ -3046,7 +3240,173 @@ fi -if test "$need_dynodump" = "yes" ; then + +echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 +echo "configure:3246: checking for kstat_open in -lkstat" >&5 +ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lkstat " +cat > conftest.$ac_ext <<EOF +#line 3251 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char kstat_open(); + +int main() { +kstat_open() +; return 0; } +EOF +if { (eval echo configure:3262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_lib +EOF +cat >> confdefs.h <<EOF +#define $ac_tr_lib 1 +EOF +} + + LIBS="-lkstat $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lkstat\" to \$LIBS"; fi + +else + echo "$ac_t""no" 1>&6 +fi + + + + +echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 +echo "configure:3296: checking for kvm_read in -lkvm" >&5 +ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lkvm " +cat > conftest.$ac_ext <<EOF +#line 3301 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char kvm_read(); + +int main() { +kvm_read() +; return 0; } +EOF +if { (eval echo configure:3312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_lib +EOF +cat >> confdefs.h <<EOF +#define $ac_tr_lib 1 +EOF +} + + LIBS="-lkvm $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lkvm\" to \$LIBS"; fi + +else + echo "$ac_t""no" 1>&6 +fi + + + + +echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 +echo "configure:3346: checking for cma_open in -lpthreads" >&5 +ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lpthreads " +cat > conftest.$ac_ext <<EOF +#line 3351 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char cma_open(); + +int main() { +cma_open() +; return 0; } +EOF +if { (eval echo configure:3362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_lib +EOF +cat >> confdefs.h <<EOF +#define $ac_tr_lib 1 +EOF +} + + LIBS="-lpthreads $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lpthreads\" to \$LIBS"; fi + +else + echo "$ac_t""no" 1>&6 +fi + + +if test "$ac_cv_lib_pthreads_cma_open" = "yes"; then + case "$opsys" in decosf*) c_switch_site="$c_switch_site -threads";; esac +fi + +echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 +echo "configure:3398: 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; + else echo "$ac_t""yes" 1>&6; ld_switch_site="$ld_switch_site -xildoff" && if test "$extra_verbose" = "yes"; then echo " Appending \"-xildoff\" to \$ld_switch_site"; fi + fi + else echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for dynodump""... $ac_c" 1>&6 +echo "configure:3408: checking for dynodump" >&5 +case "$canonical" in *-solaris2.[0-5]* ) + echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF Defining DYNODUMP EOF @@ -3055,22 +3415,19 @@ EOF } - MAKE_SUBDIR="$MAKE_SUBDIR dynodump" + MAKE_SUBDIR="$MAKE_SUBDIR dynodump" && if test "$extra_verbose" = "yes"; then echo " Appending \"dynodump\" to \$MAKE_SUBDIR"; fi case "$canonical" in sparc* ) dynodump_arch=sparc ;; powerpc* ) dynodump_arch=ppc ;; i*86* ) dynodump_arch=i386 ;; esac - test "$GCC" = "yes" && ld_switch_site="-fno-gnu-linker $ld_switch_site" -fi - -for dir in "/usr/ccs/lib"; do - test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" -done + test "$GCC" = "yes" && ld_switch_site="$ld_switch_site -fno-gnu-linker" && if test "$extra_verbose" = "yes"; then echo " Appending \"-fno-gnu-linker\" to \$ld_switch_site"; fi ;; + *) echo "$ac_t""no" 1>&6 ;; +esac echo "checking "for specified window system"" 1>&6 -echo "configure:3074: checking "for specified window system"" >&5 +echo "configure:3431: checking "for specified window system"" >&5 if test "$x_includes $x_libraries" = "NONE NONE"; then if test -n "$OPENWINHOME" \ @@ -3091,7 +3448,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:3095: checking for X" >&5 +echo "configure:3452: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -3151,12 +3508,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 3155 "configure" +#line 3512 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3225,14 +3582,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 3229 "configure" +#line 3586 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:3236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3593: \"$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. @@ -3341,17 +3698,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:3345: checking whether -R must be followed by a space" >&5 +echo "configure:3702: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <<EOF -#line 3348 "configure" +#line 3705 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:3355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -3367,14 +3724,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <<EOF -#line 3371 "configure" +#line 3728 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:3378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -3405,17 +3762,17 @@ # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). - if test "$with_dnet" = "no"; then + if test "$with_dnet" = "no" ; then ac_cv_lib_dnet_dnet_ntoa=no else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:3414: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:3771: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet " cat > conftest.$ac_ext <<EOF -#line 3419 "configure" +#line 3776 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3426,7 +3783,7 @@ dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:3430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3787: \"$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 @@ -3438,7 +3795,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" else @@ -3450,12 +3807,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:3454: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:3811: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet_stub " cat > conftest.$ac_ext <<EOF -#line 3459 "configure" +#line 3816 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3466,7 +3823,7 @@ dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:3470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3827: \"$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 @@ -3478,7 +3835,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" else @@ -3495,10 +3852,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:3499: checking for gethostbyname" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3502 "configure" +echo "configure:3856: checking for gethostbyname" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3859 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname(); below. */ @@ -3521,7 +3878,7 @@ ; return 0; } EOF -if { (eval echo configure:3525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -3542,12 +3899,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:3546: checking for gethostbyname in -lnsl" >&5 +echo "configure:3903: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` xe_check_libs=" -lnsl " cat > conftest.$ac_ext <<EOF -#line 3551 "configure" +#line 3908 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3558,7 +3915,7 @@ gethostbyname() ; return 0; } EOF -if { (eval echo configure:3562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3919: \"$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 @@ -3570,7 +3927,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" else @@ -3588,10 +3945,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:3592: checking for connect" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3595 "configure" +echo "configure:3949: checking for connect" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3952 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect(); below. */ @@ -3614,7 +3971,7 @@ ; return 0; } EOF -if { (eval echo configure:3618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -3637,12 +3994,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:3641: checking "$xe_msg_checking"" >&5 +echo "configure:3998: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocket $X_EXTRA_LIBS" cat > conftest.$ac_ext <<EOF -#line 3646 "configure" +#line 4003 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3653,7 +4010,7 @@ connect() ; return 0; } EOF -if { (eval echo configure:3657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4014: \"$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 @@ -3665,7 +4022,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" else @@ -3677,10 +4034,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:3681: checking for remove" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3684 "configure" +echo "configure:4038: checking for remove" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4041 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove(); below. */ @@ -3703,7 +4060,7 @@ ; return 0; } EOF -if { (eval echo configure:3707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -3724,12 +4081,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:3728: checking for remove in -lposix" >&5 +echo "configure:4085: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` xe_check_libs=" -lposix " cat > conftest.$ac_ext <<EOF -#line 3733 "configure" +#line 4090 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3740,7 +4097,7 @@ remove() ; return 0; } EOF -if { (eval echo configure:3744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4101: \"$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 @@ -3752,7 +4109,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" else @@ -3764,10 +4121,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:3768: checking for shmat" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3771 "configure" +echo "configure:4125: checking for shmat" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4128 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat(); below. */ @@ -3790,7 +4147,7 @@ ; return 0; } EOF -if { (eval echo configure:3794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -3811,12 +4168,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:3815: checking for shmat in -lipc" >&5 +echo "configure:4172: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` xe_check_libs=" -lipc " cat > conftest.$ac_ext <<EOF -#line 3820 "configure" +#line 4177 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3827,7 +4184,7 @@ shmat() ; return 0; } EOF -if { (eval echo configure:3831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4188: \"$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 @@ -3839,7 +4196,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" else @@ -3861,12 +4218,12 @@ # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:3865: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:4222: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` xe_check_libs=" -lICE " cat > conftest.$ac_ext <<EOF -#line 3870 "configure" +#line 4227 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3877,7 +4234,7 @@ IceConnectionNumber() ; return 0; } EOF -if { (eval echo configure:3881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4238: \"$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 @@ -3889,7 +4246,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" else @@ -3921,16 +4278,18 @@ EOF } - MAKE_SUBDIR="$MAKE_SUBDIR lwlib" + MAKE_SUBDIR="$MAKE_SUBDIR lwlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"lwlib\" to \$MAKE_SUBDIR"; fi for lib_dir in "/usr/dt/lib" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do inc_dir="`echo $lib_dir | sed 's/lib/include/'`" if test -d "$lib_dir" -a -d "$inc_dir"; then - case "$x_libraries" in *"$lib_dir"* ) : ;; *) - x_libraries="$lib_dir $x_libraries" X_LIBS="-L${lib_dir} $X_LIBS" + case "$x_libraries" in *"$lib_dir"* ) ;; *) + x_libraries="$lib_dir $x_libraries" + X_LIBS="-L${lib_dir} $X_LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;; esac - case "$x_includes" in "$inc_dir"* ) : ;; *) - x_includes="$inc_dir $x_includes" X_CFLAGS="-I${inc_dir} $X_CFLAGS" + case "$x_includes" in "$inc_dir"* ) ;; *) + x_includes="$inc_dir $x_includes" + X_CFLAGS="-I${inc_dir} $X_CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;; esac break; fi done @@ -3938,17 +4297,50 @@ for rel in "X11R6" "X11R5" "X11R4"; do lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include" if test -d "$lib_dir" -a -d "$inc_dir"; then - case "$x_libraries" in *"$lib_dir"* ) : ;; *) - x_libraries="$x_libraries $lib_dir" X_LIBS="$X_LIBS -L${lib_dir}" + case "$x_libraries" in *"$lib_dir"* ) ;; *) + x_libraries="$x_libraries $lib_dir" + X_LIBS="$X_LIBS -L${lib_dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L${lib_dir}\" to \$X_LIBS"; fi esac - case "$x_includes" in "$inc_dir"* ) : ;; *) - x_includes="$x_includes $inc_dir" X_CFLAGS="$X_CFLAGS -I${inc_dir}" + case "$x_includes" in "$inc_dir"* ) ;; *) + x_includes="$x_includes $inc_dir" + X_CFLAGS="$X_CFLAGS -I${inc_dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi esac break; fi done ld_switch_x_site="$X_LIBS" + +if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then + ld_switch_site="`echo $ld_switch_site | sed \"s/${dash_r}[^ ]*//\"`" + ld_switch_x_site="`echo $ld_switch_x_site | sed \"s/${dash_r}[^ ]*//\"`" + + if test -n "$LD_RUN_PATH"; then + runpath="$LD_RUN_PATH" + else + runpath="" + for arg in $ld_switch_site $ld_switch_x_site; do + case "$arg" in -L* ) + dir=`echo "$arg" | sed 's/^-L//'` + if test -n "`ls ${dir}/*.s[ol] 2>/dev/null`"; then + test -n "$runpath" && runpath="${runpath}:" + runpath="${runpath}${dir}" + fi + ;; + esac + done + case "$canonical" in *-solaris2.[1-4]* ) + test "$need_motif" = "yes" && runpath="${runpath}:/opt/SUNWdt/lib" ;; + esac + fi + + if test -n "$runpath"; then + ld_switch_run="${dash_r}${runpath}" + test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" + fi +fi + + if test "$extra_verbose" = "yes"; then echo; echo "X11 compilation variables:" echo "x_libraries = $x_libraries" @@ -3962,15 +4354,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:3966: checking for X11/Intrinsic.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3969 "configure" +echo "configure:4358: checking for X11/Intrinsic.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4361 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3994,12 +4386,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:3998: checking for XOpenDisplay in -lX11" >&5 +echo "configure:4390: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <<EOF -#line 4003 "configure" +#line 4395 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4010,7 +4402,7 @@ XOpenDisplay() ; return 0; } EOF -if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4406: \"$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 @@ -4022,7 +4414,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 have_lib_x11=yes else @@ -4035,12 +4427,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:4039: checking "$xe_msg_checking"" >&5 +echo "configure:4431: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 -b i486-linuxaout" cat > conftest.$ac_ext <<EOF -#line 4044 "configure" +#line 4436 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4051,7 +4443,7 @@ XGetFontProperty() ; return 0; } EOF -if { (eval echo configure:4055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4447: \"$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 @@ -4063,7 +4455,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site" else @@ -4074,18 +4466,19 @@ fi libs_x="-lX11" + test "$extra_verbose" = "yes" && echo " Setting libs_x to \"-lX11\"" case "$canonical" in *-sunos4.* ) # Bug workaround ld_switch_x_site="$ld_switch_x_site -u _XtToolkitInitialize" ;; esac echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:4084: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:4477: checking for XtOpenDisplay in -lXt" >&5 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lXt " cat > conftest.$ac_ext <<EOF -#line 4089 "configure" +#line 4482 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4096,7 +4489,7 @@ XtOpenDisplay() ; return 0; } EOF -if { (eval echo configure:4100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4493: \"$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 @@ -4108,9 +4501,9 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - libs_x="-lXt $libs_x" +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + libs_x="-lXt $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXt\" to \$libs_x"; fi else echo "$ac_t""no" 1>&6 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; } @@ -4119,29 +4512,29 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:4123: checking the version of X11 being used" >&5 +echo "configure:4516: checking the version of X11 being used" >&5 cat > conftest.$ac_ext <<EOF -#line 4125 "configure" +#line 4518 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; } EOF -if { (eval echo configure:4130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then - ./conftest foobar; rc=$? + ./conftest foobar; x11_release=$? else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - rc=4 + x11_release=4 fi rm -fr conftest* - echo "$ac_t""R${rc}" 1>&6 + echo "$ac_t""R${x11_release}" 1>&6 { test "$extra_verbose" = "yes" && cat << EOF - Defining THIS_IS_X11R${rc} + Defining THIS_IS_X11R${x11_release} EOF cat >> confdefs.h <<EOF -#define THIS_IS_X11R${rc} 1 +#define THIS_IS_X11R${x11_release} 1 EOF } @@ -4150,15 +4543,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4154: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4157 "configure" +echo "configure:4547: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4550 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4189,7 +4582,7 @@ echo $ac_n "checking for XFree86""... $ac_c" 1>&6 -echo "configure:4193: checking for XFree86" >&5 +echo "configure:4586: checking for XFree86" >&5 if test -d "/usr/X386/include" -o \ -f "/etc/XF86Config" -o \ -f "/etc/X11/XF86Config" -o \ @@ -4209,12 +4602,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:4213: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:4606: checking for XShapeSelectInput in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'` xe_check_libs=" -lXext " cat > conftest.$ac_ext <<EOF -#line 4218 "configure" +#line 4611 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4225,7 +4618,7 @@ XShapeSelectInput() ; return 0; } EOF -if { (eval echo configure:4229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4622: \"$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 @@ -4237,9 +4630,9 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - libs_x="-lXext $libs_x" +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + libs_x="-lXext $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXext\" to \$libs_x"; fi else echo "$ac_t""no" 1>&6 fi @@ -4252,12 +4645,12 @@ if test -z "$with_xmu"; then echo $ac_n "checking for XmuConvertStandardSelection in -lXmu""... $ac_c" 1>&6 -echo "configure:4256: checking for XmuConvertStandardSelection in -lXmu" >&5 +echo "configure:4649: checking for XmuConvertStandardSelection in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuConvertStandardSelection | sed 'y%./+-%__p_%'` xe_check_libs=" -lXmu " cat > conftest.$ac_ext <<EOF -#line 4261 "configure" +#line 4654 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4268,49 +4661,7 @@ XmuConvertStandardSelection() ; return 0; } EOF -if { (eval echo configure:4272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -xe_check_libs="" - -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - with_xmu=yes -else - echo "$ac_t""no" 1>&6 -with_xmu=no -fi - - - fi - if test "$with_xmu" = "no"; then - extra_objs="$extra_objs xmu.o" - else - libs_x="-lXmu $libs_x" - fi - - -echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:4302: checking for main in -lXbsd" >&5 -ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lXbsd " -cat > conftest.$ac_ext <<EOF -#line 4307 "configure" -#include "confdefs.h" - -int main() { -main() -; return 0; } -EOF -if { (eval echo configure:4314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4665: \"$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 @@ -4322,59 +4673,39 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - libs_x="-lXbsd $libs_x" -else - echo "$ac_t""no" 1>&6 -fi - - - - ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:4337: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4340 "configure" -#include "confdefs.h" -#include <Xm/Xm.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - -echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:4362: checking for XmStringFree in -lXm" >&5 -ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lXm " -cat > conftest.$ac_ext <<EOF -#line 4367 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XmStringFree(); +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_xmu=yes +else + echo "$ac_t""no" 1>&6 +with_xmu=no +fi + + + fi + if test "$with_xmu" = "no"; then + extra_objs="$extra_objs xmu.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"xmu.o\"" + fi + else + libs_x="-lXmu $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXmu\" to \$libs_x"; fi + fi + + +echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 +echo "configure:4697: checking for main in -lXbsd" >&5 +ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lXbsd " +cat > conftest.$ac_ext <<EOF +#line 4702 "configure" +#include "confdefs.h" int main() { -XmStringFree() +main() ; return 0; } EOF -if { (eval echo configure:4378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4709: \"$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 @@ -4386,29 +4717,23 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - have_motif=yes -else - echo "$ac_t""no" 1>&6 -have_motif=no -fi - - -else - echo "$ac_t""no" 1>&6 -have_motif=no -fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + libs_x="-lXbsd $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXbsd\" to \$libs_x"; fi +else + echo "$ac_t""no" 1>&6 +fi + echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6 -echo "configure:4407: checking for XawScrollbarSetThumb in -lXaw" >&5 +echo "configure:4732: checking for XawScrollbarSetThumb in -lXaw" >&5 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <<EOF -#line 4412 "configure" +#line 4737 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4419,7 +4744,7 @@ XawScrollbarSetThumb() ; return 0; } EOF -if { (eval echo configure:4423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4748: \"$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 @@ -4431,7 +4756,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 have_xaw=yes else @@ -4484,25 +4809,6 @@ esac fi -if test -n "$site_libraries"; then - for arg in $site_libraries; do - test -d "$arg" && arg="-L${arg}" - ld_switch_site="$ld_switch_site $arg" - done -fi - -if test -n "$site_runtime_libraries" ; then - LD_RUN_PATH="`echo $site_runtime_libraries | sed 's/ */:/'`" - export LD_RUN_PATH -fi - -if test -n "$site_includes" ; then - for arg in $site_includes; do - test -d "$arg" && arg="-I${arg}" - c_switch_site="$c_switch_site $arg" - done -fi - bitmapdir= @@ -4516,189 +4822,18 @@ test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h" esac -{ test "$extra_verbose" = "yes" && cat << \EOF - Defining LISP_FLOAT_TYPE -EOF -cat >> confdefs.h <<\EOF -#define LISP_FLOAT_TYPE 1 -EOF -} - - -echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:4530: checking for kstat_open in -lkstat" >&5 -ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lkstat " -cat > conftest.$ac_ext <<EOF -#line 4535 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char kstat_open(); - -int main() { -kstat_open() -; return 0; } -EOF -if { (eval echo configure:4546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -xe_check_libs="" - -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_lib -EOF -cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF -} - - LIBS="-lkstat $LIBS" - -else - echo "$ac_t""no" 1>&6 -fi - - - - -echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:4580: checking for kvm_read in -lkvm" >&5 -ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lkvm " -cat > conftest.$ac_ext <<EOF -#line 4585 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char kvm_read(); - -int main() { -kvm_read() -; return 0; } -EOF -if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -xe_check_libs="" - -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_lib -EOF -cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF -} - - LIBS="-lkvm $LIBS" - -else - echo "$ac_t""no" 1>&6 -fi - - - - -echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4630: checking for cma_open in -lpthreads" >&5 -ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lpthreads " -cat > conftest.$ac_ext <<EOF -#line 4635 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char cma_open(); - -int main() { -cma_open() -; return 0; } -EOF -if { (eval echo configure:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -xe_check_libs="" - -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_lib -EOF -cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF -} - - LIBS="-lpthreads $LIBS" - -else - echo "$ac_t""no" 1>&6 -fi - - -if test "$ac_cv_lib_pthreads_cma_open" = "yes"; then - case "$opsys" in decosf*) c_switch_site="$c_switch_site -threads";; esac -fi - -echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:4682: 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; - else echo "$ac_t""yes" 1>&6; ld_switch_site="$ld_switch_site -xildoff" - fi - else echo "$ac_t""no" 1>&6 -fi - test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6 -echo "configure:4694: checking for X11/Xauth.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4697 "configure" +echo "configure:4829: checking for X11/Xauth.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4832 "configure" #include "confdefs.h" #include <X11/Xauth.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4721,12 +4856,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:4725: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:4860: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <<EOF -#line 4730 "configure" +#line 4865 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4737,7 +4872,7 @@ XauGetAuthByAddr() ; return 0; } EOF -if { (eval echo configure:4741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4749,7 +4884,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -4768,20 +4903,20 @@ EOF } - libs_x="-lXau $libs_x" + libs_x="-lXau $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXau\" to \$libs_x"; fi fi test -z "$with_offix" && { ac_safe=`echo "OffiX/DragAndDrop.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for OffiX/DragAndDrop.h""... $ac_c" 1>&6 -echo "configure:4777: checking for OffiX/DragAndDrop.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4780 "configure" +echo "configure:4912: checking for OffiX/DragAndDrop.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4915 "configure" #include "confdefs.h" #include <OffiX/DragAndDrop.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4804,12 +4939,12 @@ } test -z "$with_offix" && { echo $ac_n "checking for DndInitialize in -lDnd""... $ac_c" 1>&6 -echo "configure:4808: checking for DndInitialize in -lDnd" >&5 +echo "configure:4943: checking for DndInitialize in -lDnd" >&5 ac_lib_var=`echo Dnd'_'DndInitialize | sed 'y%./+-%__p_%'` xe_check_libs=" -lDnd " cat > conftest.$ac_ext <<EOF -#line 4813 "configure" +#line 4948 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4820,7 +4955,7 @@ DndInitialize() ; return 0; } EOF -if { (eval echo configure:4824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4959: \"$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 @@ -4832,7 +4967,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -4851,7 +4986,7 @@ EOF } - libs_x="-lDnd $libs_x" + libs_x="-lDnd $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lDnd\" to \$libs_x"; fi fi test "$with_cde" = "yes" && with_tooltalk=yes # CDE requires tooltalk @@ -4859,15 +4994,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:4863: checking for ${dir}tt_c.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4866 "configure" +echo "configure:4998: checking for ${dir}tt_c.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5001 "configure" #include "confdefs.h" #include <${dir}tt_c.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4896,12 +5031,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:4900: checking "$xe_msg_checking"" >&5 +echo "configure:5035: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` xe_check_libs=" -ltt $extra_libs" cat > conftest.$ac_ext <<EOF -#line 4905 "configure" +#line 5040 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4912,7 +5047,7 @@ tt_message_create() ; return 0; } EOF -if { (eval echo configure:4916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5051: \"$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 @@ -4924,7 +5059,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 with_tooltalk=yes tt_libs="-ltt $extra_libs"; break else @@ -4953,21 +5088,23 @@ EOF } - libs_x="$tt_libs $libs_x" - extra_objs="$extra_objs tooltalk.o" + libs_x="$tt_libs $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$tt_libs\" to \$libs_x"; fi + extra_objs="$extra_objs tooltalk.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"tooltalk.o\"" + fi fi test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6 -echo "configure:4963: checking for Dt/Dt.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4966 "configure" +echo "configure:5100: checking for Dt/Dt.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5103 "configure" #include "confdefs.h" #include <Dt/Dt.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4990,12 +5127,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:4994: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:5131: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <<EOF -#line 4999 "configure" +#line 5136 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5006,7 +5143,7 @@ DtDndDragStart() ; return 0; } EOF -if { (eval echo configure:5010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5147: \"$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 @@ -5018,7 +5155,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -5037,7 +5174,7 @@ EOF } - libs_x="-lDtSvc $libs_x" + libs_x="-lDtSvc $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lDtSvc\" to \$libs_x"; fi with_tooltalk=yes # CDE requires Tooltalk with_motif=yes # CDE requires Motif fi @@ -5053,19 +5190,19 @@ echo $ac_n "checking for main in -lenergize""... $ac_c" 1>&6 -echo "configure:5057: checking for main in -lenergize" >&5 +echo "configure:5194: checking for main in -lenergize" >&5 ac_lib_var=`echo energize'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lenergize " cat > conftest.$ac_ext <<EOF -#line 5062 "configure" +#line 5199 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5206: \"$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 @@ -5077,9 +5214,9 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lenergize" +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + LIBS="-lenergize $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lenergize\" to \$LIBS"; fi energize_version="3.X" { test "$extra_verbose" = "yes" && cat << \EOF Defining ENERGIZE_3 @@ -5097,19 +5234,19 @@ if test -z "$energize_version"; then echo $ac_n "checking for main in -lconn""... $ac_c" 1>&6 -echo "configure:5101: checking for main in -lconn" >&5 +echo "configure:5238: checking for main in -lconn" >&5 ac_lib_var=`echo conn'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lconn " cat > conftest.$ac_ext <<EOF -#line 5106 "configure" +#line 5243 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5250: \"$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 @@ -5121,9 +5258,9 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lconn" +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + LIBS="-lconn $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lconn\" to \$LIBS"; fi energize_version="2.X" { test "$extra_verbose" = "yes" && cat << \EOF Defining ENERGIZE_2 @@ -5139,18 +5276,18 @@ fi - fi + fi ac_safe=`echo "editorconn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for editorconn.h""... $ac_c" 1>&6 -echo "configure:5146: checking for editorconn.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5149 "configure" +echo "configure:5283: checking for editorconn.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5286 "configure" #include "confdefs.h" #include <editorconn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5192,7 +5329,7 @@ echo "checking for graphics libraries" 1>&6 -echo "configure:5196: checking for graphics libraries" >&5 +echo "configure:5333: checking for graphics libraries" >&5 test -z "$with_gif" && with_gif=yes; if test "$with_gif" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF @@ -5203,20 +5340,22 @@ EOF } - extra_objs="$extra_objs dgif_lib.o gif_err.o gifalloc.o" + extra_objs="$extra_objs dgif_lib.o gif_err.o gifalloc.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"dgif_lib.o gif_err.o gifalloc.o\"" + fi fi test -z "$with_xpm" && { ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6 -echo "configure:5212: checking for X11/xpm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5215 "configure" +echo "configure:5351: checking for X11/xpm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5354 "configure" #include "confdefs.h" #include <X11/xpm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5239,12 +5378,12 @@ } test -z "$with_xpm" && { echo $ac_n "checking for XpmReadFileToData in -lXpm""... $ac_c" 1>&6 -echo "configure:5243: checking for XpmReadFileToData in -lXpm" >&5 +echo "configure:5382: checking for XpmReadFileToData in -lXpm" >&5 ac_lib_var=`echo Xpm'_'XpmReadFileToData | sed 'y%./+-%__p_%'` xe_check_libs=" -lXpm " cat > conftest.$ac_ext <<EOF -#line 5248 "configure" +#line 5387 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5255,7 +5394,7 @@ XpmReadFileToData() ; return 0; } EOF -if { (eval echo configure:5259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5398: \"$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 @@ -5267,7 +5406,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -5286,20 +5425,20 @@ EOF } - libs_x="-lXpm $libs_x" + libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi fi 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:5295: checking for compface.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5298 "configure" +echo "configure:5434: checking for compface.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5437 "configure" #include "confdefs.h" #include <compface.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5322,12 +5461,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:5326: checking for UnGenFace in -lcompface" >&5 +echo "configure:5465: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <<EOF -#line 5331 "configure" +#line 5470 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5338,7 +5477,7 @@ UnGenFace() ; return 0; } EOF -if { (eval echo configure:5342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5481: \"$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 @@ -5350,7 +5489,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -5369,20 +5508,20 @@ EOF } - libs_x="-lcompface $libs_x" + libs_x="-lcompface $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lcompface\" to \$libs_x"; fi fi test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6 -echo "configure:5378: checking for jpeglib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5381 "configure" +echo "configure:5517: checking for jpeglib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5520 "configure" #include "confdefs.h" #include <jpeglib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5405,12 +5544,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:5409: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:5548: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` xe_check_libs=" -ljpeg " cat > conftest.$ac_ext <<EOF -#line 5414 "configure" +#line 5553 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5421,7 +5560,7 @@ jpeg_destroy_decompress() ; return 0; } EOF -if { (eval echo configure:5425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5564: \"$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 @@ -5433,7 +5572,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -5452,20 +5591,20 @@ EOF } - libs_x="-ljpeg $libs_x" + libs_x="-ljpeg $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ljpeg\" to \$libs_x"; fi fi test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:5461: checking for png.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5464 "configure" +echo "configure:5600: checking for png.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5603 "configure" #include "confdefs.h" #include <png.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5487,10 +5626,10 @@ fi } test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:5491: checking for pow" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5494 "configure" +echo "configure:5630: checking for pow" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5633 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pow(); below. */ @@ -5513,7 +5652,7 @@ ; return 0; } EOF -if { (eval echo configure:5517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -5538,12 +5677,12 @@ xe_msg_checking="for png_read_image in -lpng" test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:5542: checking "$xe_msg_checking"" >&5 +echo "configure:5681: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` xe_check_libs=" -lpng $extra_libs" cat > conftest.$ac_ext <<EOF -#line 5547 "configure" +#line 5686 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5554,7 +5693,7 @@ png_read_image() ; return 0; } EOF -if { (eval echo configure:5558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5697: \"$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 @@ -5566,7 +5705,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 png_libs="-lpng $extra_libs" with_png=yes; break else @@ -5587,7 +5726,7 @@ EOF } - libs_x="$png_libs $libs_x" + libs_x="$png_libs $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$png_libs\" to \$libs_x"; fi fi if test "$with_tiff" = "yes"; then @@ -5599,8 +5738,78 @@ EOF } - libs_x="-ltiff $libs_x" -fi + libs_x="-ltiff $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ltiff\" to \$libs_x"; fi +fi + + ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 +echo "configure:5747: checking for Xm/Xm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5750 "configure" +#include "confdefs.h" +#include <Xm/Xm.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + +echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 +echo "configure:5772: checking for XmStringFree in -lXm" >&5 +ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lXm " +cat > conftest.$ac_ext <<EOF +#line 5777 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XmStringFree(); + +int main() { +XmStringFree() +; return 0; } +EOF +if { (eval echo configure:5788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + have_motif=yes +else + echo "$ac_t""no" 1>&6 +have_motif=no +fi + + +else + echo "$ac_t""no" 1>&6 +have_motif=no +fi + case "$with_menubars" in "" | "yes" | "athena" ) @@ -5627,7 +5836,7 @@ EOF } - libs_x="-lXaw $libs_x" ;; + libs_x="-lXaw $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXaw\" to \$libs_x"; fi ;; esac case "$all_widgets" in *motif* ) @@ -5750,24 +5959,46 @@ } -test "$with_menubars" != "no" && extra_objs="$extra_objs menubar.o" -test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar.o" -test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog.o" -test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar.o" -test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui.o" +test "$with_menubars" != "no" && extra_objs="$extra_objs menubar.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"menubar.o\"" + fi +test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"scrollbar.o\"" + fi +test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"dialog.o\"" + fi +test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"toolbar.o\"" + fi +test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"gui.o\"" + fi if test "$with_x11" = "yes"; then - test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-x.o" - test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-x.o" - test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog-x.o" - test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar-x.o" - test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" + test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-x.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"menubar-x.o\"" + fi + test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-x.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"scrollbar-x.o\"" + fi + test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog-x.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"dialog-x.o\"" + fi + test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar-x.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"toolbar-x.o\"" + fi + test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"gui-x.o\"" + fi fi test -z "$with_mule" && with_mule=no if test "$with_mule" = "yes" ; then + echo "checking for Mule-related features" 1>&6 +echo "configure:6002: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -5776,16 +6007,18 @@ EOF } - extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o mule-coding.o" + extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o mule-coding.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o mule-coding.o\"" + fi echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:5784: checking for strerror in -lintl" >&5 +echo "configure:6017: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <<EOF -#line 5789 "configure" +#line 6022 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5796,7 +6029,7 @@ strerror() ; return 0; } EOF -if { (eval echo configure:5800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6033: \"$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 @@ -5808,7 +6041,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` @@ -5820,7 +6053,7 @@ EOF } - LIBS="-lintl $LIBS" + LIBS="-lintl $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lintl\" to \$LIBS"; fi else echo "$ac_t""no" 1>&6 @@ -5829,18 +6062,19 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:5833: checking for Mule input methods" >&5 - case "$with_xim" in "" | "yes" ) +echo "configure:6066: checking for Mule input methods" >&5 + test -z "$with_xim" && case "$opsys" in sol2* ) ;; *) with_xim=no ;; esac + case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:5836: checking for XIM" >&5 +echo "configure:6070: checking for XIM" >&5 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:5839: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:6073: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <<EOF -#line 5844 "configure" +#line 6078 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5851,7 +6085,7 @@ XmImMbLookupString() ; return 0; } EOF -if { (eval echo configure:5855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6089: \"$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 @@ -5863,7 +6097,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 with_xim=motif else @@ -5891,8 +6125,10 @@ EOF } - extra_objs="$extra_objs input-method-xlib.o" - fi + extra_objs="$extra_objs input-method-xlib.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"input-method-xlib.o\"" + fi + fi if test "$with_xim" = "motif"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining XIM_MOTIF @@ -5903,22 +6139,23 @@ } need_motif=yes - extra_objs="$extra_objs input-method-motif.o" - fi + extra_objs="$extra_objs input-method-motif.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"input-method-motif.o\"" + fi fi - + fi test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support - test -z "$with_wnn" && { ac_safe=`echo "wnn/wnnerror.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for wnn/wnnerror.h""... $ac_c" 1>&6 -echo "configure:5914: checking for wnn/wnnerror.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5917 "configure" -#include "confdefs.h" -#include <wnn/wnnerror.h> + 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:6151: checking for wnn/jllib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6154 "configure" +#include "confdefs.h" +#include <wnn/jllib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5941,12 +6178,12 @@ } test -z "$with_wnn" && { echo $ac_n "checking for jl_dic_list in -lwnn""... $ac_c" 1>&6 -echo "configure:5945: checking for jl_dic_list in -lwnn" >&5 +echo "configure:6182: checking for jl_dic_list in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_dic_list | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <<EOF -#line 5950 "configure" +#line 6187 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5957,7 +6194,7 @@ jl_dic_list() ; return 0; } EOF -if { (eval echo configure:5961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6198: \"$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 @@ -5969,7 +6206,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -5988,16 +6225,18 @@ EOF } - libs_x="-lwnn $libs_x" - extra_objs="$extra_objs mule-wnnfns.o" + libs_x="-lwnn $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lwnn\" to \$libs_x"; fi + extra_objs="$extra_objs mule-wnnfns.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"mule-wnnfns.o\"" + fi echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6 -echo "configure:5996: checking for jl_fi_dic_list in -lwnn" >&5 +echo "configure:6235: checking for jl_fi_dic_list in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <<EOF -#line 6001 "configure" +#line 6240 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6008,7 +6247,7 @@ jl_fi_dic_list() ; return 0; } EOF -if { (eval echo configure:6012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6251: \"$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 @@ -6020,7 +6259,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 with_wnn6=yes else @@ -6029,26 +6268,26 @@ test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_WNN6 -EOF -cat >> confdefs.h <<\EOF -#define HAVE_WNN6 1 -EOF -} - - fi + Defining WNN6 +EOF +cat >> confdefs.h <<\EOF +#define WNN6 1 +EOF +} + + fi test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6 -echo "configure:6044: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6047 "configure" +echo "configure:6283: checking for canna/RK.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6286 "configure" #include "confdefs.h" #include <canna/RK.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6071,12 +6310,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:6075: checking for RkBgnBun in -lRKC" >&5 +echo "configure:6314: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <<EOF -#line 6080 "configure" +#line 6319 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6087,7 +6326,7 @@ RkBgnBun() ; return 0; } EOF -if { (eval echo configure:6091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6330: \"$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 @@ -6099,7 +6338,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -6110,12 +6349,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:6114: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:6353: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <<EOF -#line 6119 "configure" +#line 6358 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6126,7 +6365,7 @@ jrKanjiControl() ; return 0; } EOF -if { (eval echo configure:6130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6369: \"$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 @@ -6138,7 +6377,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 : else @@ -6157,28 +6396,60 @@ EOF } - libs_x="-lcanna -lRKC $libs_x" - extra_objs="$extra_objs mule-canna.o" - fi -else # "$with_mule" = "no" - for feature in xim canna wnn; do + libs_x="-lcanna -lRKC $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lcanna -lRKC\" to \$libs_x"; fi + extra_objs="$extra_objs mule-canna.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"mule-canna.o\"" + fi + fi +else for feature in xim canna wnn; do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then echo "configure: warning: "--with-${feature} ignored: Not valid without Mule support"" 1>&2 fi eval "with_${feature}=no" done -fi - - -test "$need_motif" = "yes" && libs_x="-lXm $libs_x" - -for ac_func in acosh asinh atanh cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random realpath rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset utimes waitpid +fi + +if test "$need_motif" = "yes" ; then + libs_x="-lXm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXm\" to \$libs_x"; fi + +if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then + ld_switch_site="`echo $ld_switch_site | sed \"s/${dash_r}[^ ]*//\"`" + ld_switch_x_site="`echo $ld_switch_x_site | sed \"s/${dash_r}[^ ]*//\"`" + + if test -n "$LD_RUN_PATH"; then + runpath="$LD_RUN_PATH" + else + runpath="" + for arg in $ld_switch_site $ld_switch_x_site; do + case "$arg" in -L* ) + dir=`echo "$arg" | sed 's/^-L//'` + if test -n "`ls ${dir}/*.s[ol] 2>/dev/null`"; then + test -n "$runpath" && runpath="${runpath}:" + runpath="${runpath}${dir}" + fi + ;; + esac + done + case "$canonical" in *-solaris2.[1-4]* ) + test "$need_motif" = "yes" && runpath="${runpath}:/opt/SUNWdt/lib" ;; + esac + fi + + if test -n "$runpath"; then + ld_switch_run="${dash_r}${runpath}" + test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" + fi +fi + +fi + +for ac_func in acosh asinh atanh 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 strcasecmp strerror tzset utimes waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6179: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6182 "configure" +echo "configure:6450: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6453 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6201,7 +6472,7 @@ ; return 0; } EOF -if { (eval echo configure:6205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6229,19 +6500,88 @@ done -test "$ac_cv_func_realpath" = "yes" && extra_objs="$extra_objs realpath.o" + +case "$opsys" in + linux* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"realpath.o\"" + fi ;; + * ) + for ac_func in realpath +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:6513: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6516 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_func +EOF +cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF +} + +else + echo "$ac_t""no" 1>&6 +fi +done + + test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"realpath.o\"" + fi ;; +esac + +test "$with_mocklisp" = "yes" && extra_objs="$extra_objs mocklisp.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"mocklisp.o\"" + fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:6236: checking whether netdb declares h_errno" >&5 -cat > conftest.$ac_ext <<EOF -#line 6238 "configure" +echo "configure:6576: checking whether netdb declares h_errno" >&5 +cat > conftest.$ac_ext <<EOF +#line 6578 "configure" #include "confdefs.h" #include <netdb.h> int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:6245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6585: \"$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 @@ -6261,16 +6601,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:6265: checking for sigsetjmp" >&5 -cat > conftest.$ac_ext <<EOF -#line 6267 "configure" +echo "configure:6605: checking for sigsetjmp" >&5 +cat > conftest.$ac_ext <<EOF +#line 6607 "configure" #include "confdefs.h" #include <setjmp.h> int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:6274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6614: \"$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 @@ -6290,11 +6630,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:6294: checking whether localtime caches TZ" >&5 +echo "configure:6634: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext <<EOF -#line 6298 "configure" +#line 6638 "configure" #include "confdefs.h" #include <time.h> #if STDC_HEADERS @@ -6329,7 +6669,7 @@ exit (0); } EOF -if { (eval echo configure:6333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then emacs_cv_localtime_cache=no else @@ -6358,9 +6698,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday cannot accept two arguments""... $ac_c" 1>&6 -echo "configure:6362: checking whether gettimeofday cannot accept two arguments" >&5 -cat > conftest.$ac_ext <<EOF -#line 6364 "configure" +echo "configure:6702: checking whether gettimeofday cannot accept two arguments" >&5 +cat > conftest.$ac_ext <<EOF +#line 6704 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME @@ -6382,7 +6722,7 @@ ; return 0; } EOF -if { (eval echo configure:6386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""no" 1>&6 else @@ -6404,19 +6744,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:6408: checking for inline" >&5 +echo "configure:6748: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 6413 "configure" +#line 6753 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:6420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -6461,17 +6801,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:6465: checking for working alloca.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6468 "configure" +echo "configure:6805: checking for working alloca.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6808 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:6475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -6495,10 +6835,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:6499: checking for alloca" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6502 "configure" +echo "configure:6839: checking for alloca" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6842 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -6521,7 +6861,7 @@ char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:6525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -6560,10 +6900,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:6564: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6567 "configure" +echo "configure:6904: checking whether alloca needs Cray hooks" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6907 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -6587,10 +6927,10 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6591: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6594 "configure" +echo "configure:6931: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6934 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6613,7 +6953,7 @@ ; return 0; } EOF -if { (eval echo configure:6617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6643,10 +6983,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:6647: checking stack direction for C alloca" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6650 "configure" +echo "configure:6987: checking stack direction for C alloca" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6990 "configure" #include "confdefs.h" find_stack_direction () { @@ -6665,7 +7005,7 @@ exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:6669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_c_stack_direction=1 else @@ -6687,13 +7027,15 @@ fi -test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" +test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"$ALLOCA\"" + fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:6694: checking for pid_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6697 "configure" +echo "configure:7036: checking for pid_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7039 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -6725,15 +7067,15 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:6729: checking for vfork.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6732 "configure" +echo "configure:7071: checking for vfork.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7074 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6761,10 +7103,10 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:6765: checking for working vfork" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6768 "configure" +echo "configure:7107: checking for working vfork" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7110 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -6859,7 +7201,7 @@ } } EOF -if { (eval echo configure:6863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_vfork_works=yes else @@ -6884,10 +7226,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:6888: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6891 "configure" +echo "configure:7230: checking for working strcoll" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7233 "configure" #include "confdefs.h" #include <string.h> main () @@ -6897,7 +7239,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:6901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -6921,125 +7263,19 @@ fi -echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:6926: checking size of short" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6929 "configure" -#include "confdefs.h" -#include <stdio.h> -main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(short)); - exit(0); -} -EOF -if { (eval echo configure:6940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_short=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_short=0 -fi -rm -fr conftest* -echo "$ac_t""$ac_cv_sizeof_short" 1>&6 -{ test "$extra_verbose" = "yes" && cat << EOF - Defining SIZEOF_SHORT = $ac_cv_sizeof_short -EOF -cat >> confdefs.h <<EOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -EOF -} - - -echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:6961: checking size of int" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6964 "configure" -#include "confdefs.h" -#include <stdio.h> -main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(int)); - exit(0); -} -EOF -if { (eval echo configure:6975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_int=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_int=0 -fi -rm -fr conftest* -echo "$ac_t""$ac_cv_sizeof_int" 1>&6 -{ test "$extra_verbose" = "yes" && cat << EOF - Defining SIZEOF_INT = $ac_cv_sizeof_int -EOF -cat >> confdefs.h <<EOF -#define SIZEOF_INT $ac_cv_sizeof_int -EOF -} - - -echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:6996: checking size of long" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6999 "configure" -#include "confdefs.h" -#include <stdio.h> -main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(long)); - exit(0); -} -EOF -if { (eval echo configure:7010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_long=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_long=0 -fi -rm -fr conftest* -echo "$ac_t""$ac_cv_sizeof_long" 1>&6 -{ test "$extra_verbose" = "yes" && cat << EOF - Defining SIZEOF_LONG = $ac_cv_sizeof_long -EOF -cat >> confdefs.h <<EOF -#define SIZEOF_LONG $ac_cv_sizeof_long -EOF -} - - - for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7035: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7038 "configure" +echo "configure:7271: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7274 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7071,10 +7307,10 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7075: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7078 "configure" +echo "configure:7311: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7314 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7097,7 +7333,7 @@ ; return 0; } EOF -if { (eval echo configure:7101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7125,10 +7361,10 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:7129: checking for working mmap" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7132 "configure" +echo "configure:7365: checking for working mmap" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7368 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -7268,7 +7504,7 @@ } EOF -if { (eval echo configure:7272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_mmap_fixed_mapped=yes else @@ -7304,10 +7540,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:7308: checking for socket" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7311 "configure" +echo "configure:7544: checking for socket" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7547 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket(); below. */ @@ -7330,7 +7566,7 @@ ; return 0; } EOF -if { (eval echo configure:7334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -7345,15 +7581,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:7349: checking for netinet/in.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7352 "configure" +echo "configure:7585: checking for netinet/in.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7588 "configure" #include "confdefs.h" #include <netinet/in.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7370,15 +7606,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:7374: checking for arpa/inet.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7377 "configure" +echo "configure:7610: checking for arpa/inet.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7613 "configure" #include "confdefs.h" #include <arpa/inet.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7403,9 +7639,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:7407: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:7643: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext <<EOF -#line 7409 "configure" +#line 7645 "configure" #include "confdefs.h" #include <sys/types.h> @@ -7416,7 +7652,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:7420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7656: \"$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 @@ -7447,10 +7683,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:7451: checking for msgget" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7454 "configure" +echo "configure:7687: checking for msgget" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7690 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char msgget(); below. */ @@ -7473,7 +7709,7 @@ ; return 0; } EOF -if { (eval echo configure:7477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -7488,15 +7724,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:7492: checking for sys/ipc.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7495 "configure" +echo "configure:7728: checking for sys/ipc.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7731 "configure" #include "confdefs.h" #include <sys/ipc.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7513,15 +7749,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:7517: checking for sys/msg.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7520 "configure" +echo "configure:7753: checking for sys/msg.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7756 "configure" #include "confdefs.h" #include <sys/msg.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7559,15 +7795,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:7563: checking for dirent.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7566 "configure" +echo "configure:7799: checking for dirent.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7802 "configure" #include "confdefs.h" #include <dirent.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7594,15 +7830,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:7598: checking for sys/dir.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7601 "configure" +echo "configure:7834: checking for sys/dir.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7837 "configure" #include "confdefs.h" #include <sys/dir.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7635,15 +7871,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:7639: checking for nlist.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7642 "configure" +echo "configure:7875: checking for nlist.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7878 "configure" #include "confdefs.h" #include <nlist.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7691,19 +7927,39 @@ exit 1 fi beta=`sed -ne 's/^.*XEmacs Lucid (beta\([0-9][0-9]*\)).*$/\1/p' "$file"` -test -n "$beta" && version="${version}-b${beta}" +test -n "$beta" && version="${version}-b${beta}" +{ test "$extra_verbose" = "yes" && cat << EOF + Defining EMACS_VERSION = $version +EOF +cat >> confdefs.h <<EOF +#define EMACS_VERSION $version +EOF +} + +main_1_id="`echo main_1_xemacs_${version}_${canonical} | sed 'y/.-/__/'`" +{ test "$extra_verbose" = "yes" && cat << EOF + Defining main_1 = $main_1_id +EOF +cat >> confdefs.h <<EOF +#define main_1 $main_1_id +EOF +} + echo "checking "for sound support"" 1>&6 -echo "configure:7700: checking "for sound support"" >&5 +echo "configure:7953: checking "for sound support"" >&5 case "$with_sound" in native | both ) with_native_sound=yes;; nas | no ) with_native_sound=no;; esac if test "$with_native_sound" != "no"; then if test -d "/usr/demo/SOUND"; then - sound_found="yes" extra_objs="$extra_objs sunplay.o" + sound_found="yes" + extra_objs="$extra_objs sunplay.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"sunplay.o\"" + fi if test -d "/usr/demo/SOUND/include" then sound_cflags="-I/usr/demo/SOUND/include" else sound_cflags="-I/usr/demo/SOUND" @@ -7719,12 +7975,12 @@ *-sgi-* ) echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:7723: checking for ALopenport in -laudio" >&5 +echo "configure:7979: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <<EOF -#line 7728 "configure" +#line 7984 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7735,7 +7991,7 @@ ALopenport() ; return 0; } EOF -if { (eval echo configure:7739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7995: \"$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 @@ -7747,7 +8003,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 native_sound_lib="-laudio" else @@ -7756,17 +8012,20 @@ if test "$native_sound_lib" = "-laudio"; then - sound_found="yes" extra_objs="$extra_objs sgiplay.o" sound_cflags="" + sound_found="yes" sound_cflags="" + extra_objs="$extra_objs sgiplay.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"sgiplay.o\"" + fi fi ;; hppa*-hp-hpux* ) echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:7765: checking for AOpenAudio in -lAlib" >&5 +echo "configure:8024: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <<EOF -#line 7770 "configure" +#line 8029 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7777,7 +8036,7 @@ AOpenAudio() ; return 0; } EOF -if { (eval echo configure:7781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8040: \"$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 @@ -7789,7 +8048,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 native_sound_lib="-lAlib" else @@ -7798,7 +8057,10 @@ if test "$native_sound_lib" = "-lAlib"; then - sound_found="yes" extra_objs="$extra_objs hpplay.o" + sound_found="yes" + extra_objs="$extra_objs hpplay.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"hpplay.o\"" + fi if test "$with_gcc" = "yes" # Kludge city then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples" else sound_cflags="+e -I/usr/audio/examples" @@ -7811,15 +8073,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:7815: checking for ${dir}/soundcard.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7818 "configure" +echo "configure:8077: checking for ${dir}/soundcard.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8080 "configure" #include "confdefs.h" #include <${dir}/soundcard.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7835,7 +8097,9 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 sound_found=yes - extra_objs="$extra_objs linuxplay.o" + extra_objs="$extra_objs linuxplay.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"linuxplay.o\"" + fi { test "$extra_verbose" = "yes" && cat << EOF Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h" EOF @@ -7870,7 +8134,7 @@ EOF } - test -n "$native_sound_lib" && LIBS="$LIBS $native_sound_lib" + test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$native_sound_lib\" to \$LIBS"; fi fi case "$with_sound" in both | nas ) @@ -7882,10 +8146,12 @@ EOF } - extra_objs="$extra_objs nas.o" - LIBS="$LIBS -laudio" + extra_objs="$extra_objs nas.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"nas.o\"" + fi + LIBS="-laudio $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-laudio\" to \$LIBS"; fi cat > conftest.$ac_ext <<EOF -#line 7889 "configure" +#line 8155 "configure" #include "confdefs.h" #include <audio/Xtutil.h> EOF @@ -7908,14 +8174,11 @@ esac - - -echo "checking "how to do terminal I/O"" 1>&6 -echo "configure:7915: checking "how to do terminal I/O"" >&5 - test -z "$with_tty" && with_tty=yes if test "$with_tty" = "yes" ; then + echo "checking for TTY-related features" 1>&6 +echo "configure:8182: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -7924,18 +8187,21 @@ EOF } + extra_objs="$extra_objs console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o redisplay-tty.o cm.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o redisplay-tty.o cm.o\"" + fi ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:7931: checking for termios.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7934 "configure" +echo "configure:8197: checking for termios.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8200 "configure" #include "confdefs.h" #include <termios.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7962,15 +8228,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:7966: checking for termio.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7969 "configure" +echo "configure:8232: checking for termio.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8235 "configure" #include "confdefs.h" #include <termio.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8005,15 +8271,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:8009: checking for gpm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8012 "configure" +echo "configure:8275: checking for gpm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8278 "configure" #include "confdefs.h" #include <gpm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8036,12 +8302,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for connect_to_gpm in -lgpm""... $ac_c" 1>&6 -echo "configure:8040: checking for connect_to_gpm in -lgpm" >&5 +echo "configure:8306: checking for connect_to_gpm in -lgpm" >&5 ac_lib_var=`echo gpm'_'connect_to_gpm | sed 'y%./+-%__p_%'` xe_check_libs=" -lgpm " cat > conftest.$ac_ext <<EOF -#line 8045 "configure" +#line 8311 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -8052,7 +8318,7 @@ connect_to_gpm() ; return 0; } EOF -if { (eval echo configure:8056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8322: \"$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 @@ -8064,7 +8330,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 with_gpm=yes else @@ -8082,30 +8348,32 @@ EOF } - extra_objs="$extra_objs gpmevent.o" - LIBS="$LIBS -lgpm" + extra_objs="$extra_objs gpmevent.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"gpmevent.o\"" + fi + LIBS="-lgpm $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgpm\" to \$LIBS"; fi fi if test -z "$with_ncurses"; then -echo $ac_n "checking for tparm in -lncurses""... $ac_c" 1>&6 -echo "configure:8093: checking for tparm in -lncurses" >&5 -ac_lib_var=`echo ncurses'_'tparm | sed 'y%./+-%__p_%'` +echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 +echo "configure:8361: checking for tgetent in -lncurses" >&5 +ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <<EOF -#line 8098 "configure" +#line 8366 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char tparm(); +char tgetent(); int main() { -tparm() +tgetent() ; return 0; } EOF -if { (eval echo configure:8109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8377: \"$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 @@ -8117,7 +8385,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 with_ncurses=yes else @@ -8138,15 +8406,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:8142: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8145 "configure" +echo "configure:8410: checking for ncurses/curses.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8413 "configure" #include "confdefs.h" #include <ncurses/curses.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8168,15 +8436,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:8172: checking for ncurses/term.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8175 "configure" +echo "configure:8440: checking for ncurses/term.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8443 "configure" #include "confdefs.h" #include <ncurses/term.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8196,23 +8464,25 @@ echo "$ac_t""no" 1>&6 fi - extra_objs="$extra_objs terminfo.o" - LIBS="$LIBS -lncurses" + extra_objs="$extra_objs terminfo.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"terminfo.o\"" + fi + LIBS="-lncurses $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lncurses\" to \$LIBS"; fi if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then save_c_switch_site="$c_switch_site" 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:8208: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8211 "configure" +echo "configure:8478: checking for ncurses/curses.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8481 "configure" #include "confdefs.h" #include <ncurses/curses.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8237,25 +8507,33 @@ else c_switch_site="$save_c_switch_site" fi fi - else -echo $ac_n "checking for tgoto in -ltermlib""... $ac_c" 1>&6 -echo "configure:8243: checking for tgoto in -ltermlib" >&5 -ac_lib_var=`echo termlib'_'tgoto | sed 'y%./+-%__p_%'` - -xe_check_libs=" -ltermlib " -cat > conftest.$ac_ext <<EOF -#line 8248 "configure" + else if test "$have_terminfo" = "yes"; then + extra_objs="$extra_objs terminfo.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"terminfo.o\"" + fi + if test -n "$libs_termcap"; then + LIBS="$libs_termcap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$libs_termcap\" to \$LIBS"; fi + else + for lib in curses termlib termcap; do + +echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 +echo "configure:8521: checking for tgetent in -l$lib" >&5 +ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'` + +xe_check_libs=" -l$lib " +cat > conftest.$ac_ext <<EOF +#line 8526 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char tgoto(); +char tgetent(); int main() { -tgoto() +tgetent() ; return 0; } EOF -if { (eval echo configure:8259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8537: \"$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 @@ -8267,34 +8545,42 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - have_libtermlib=yes -else - echo "$ac_t""no" 1>&6 -have_libtermlib=no -fi - - - -echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6 -echo "configure:8282: checking for tgoto in -ltermcap" >&5 -ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'` - -xe_check_libs=" -ltermcap " -cat > conftest.$ac_ext <<EOF -#line 8287 "configure" +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + LIBS="-l${lib} $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-l${lib}\" to \$LIBS"; fi; break +else + echo "$ac_t""no" 1>&6 +fi + + + done + fi + else extra_objs="$extra_objs tparam.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"tparam.o\"" + fi + case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac + if test -n "$libs_termcap"; then + LIBS="$libs_termcap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$libs_termcap\" to \$LIBS"; fi + else + +echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 +echo "configure:8568: checking for tgetent in -lcurses" >&5 +ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lcurses " +cat > conftest.$ac_ext <<EOF +#line 8573 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char tgoto(); +char tgetent(); int main() { -tgoto() +tgetent() ; return 0; } EOF -if { (eval echo configure:8298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8584: \"$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 @@ -8306,34 +8592,30 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - have_libtermcap=yes -else - echo "$ac_t""no" 1>&6 -have_libtermcap=no -fi - - - -echo $ac_n "checking for tparm in -lcurses""... $ac_c" 1>&6 -echo "configure:8321: checking for tparm in -lcurses" >&5 -ac_lib_var=`echo curses'_'tparm | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lcurses " -cat > conftest.$ac_ext <<EOF -#line 8326 "configure" +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + LIBS="-lcurses $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lcurses\" to \$LIBS"; fi +else + echo "$ac_t""no" 1>&6 + +echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 +echo "configure:8603: checking for tgetent in -ltermcap" >&5 +ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` + +xe_check_libs=" -ltermcap " +cat > conftest.$ac_ext <<EOF +#line 8608 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char tparm(); +char tgetent(); int main() { -tparm() +tgetent() ; return 0; } EOF -if { (eval echo configure:8337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8619: \"$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 @@ -8345,28 +8627,20 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - have_libcurses=yes -else - echo "$ac_t""no" 1>&6 -have_libcurses=no -fi - - - - if test "$have_terminfo" = "yes"; then - extra_objs="$extra_objs terminfo.o" - if test -n "$libs_termcap"; then LIBS="$LIBS $libs_termcap" - elif test "$have_libcurses" = "yes"; then LIBS="$LIBS -lcurses" - elif test "$have_libtermlib" = "yes"; then LIBS="$LIBS -ltermlib" - elif test "$have_libtermcap" = "yes"; then LIBS="$LIBS -ltermcap" - fi - else extra_objs="$extra_objs tparam.o" - if test -n "$libs_termcap"; then LIBS="$LIBS $libs_termcap" - elif test "$have_libtermcap" = "yes"; then LIBS="$LIBS -ltermcap" - elif test "$have_libcurses" = "yes"; then LIBS="$LIBS -lcurses" - else extra_objs="$extra_objs termcap.o" +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + LIBS="-ltermcap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ltermcap\" to \$LIBS"; fi +else + echo "$ac_t""no" 1>&6 +extra_objs="$extra_objs termcap.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"termcap.o\"" + fi +fi + + +fi + + fi fi fi @@ -8386,28 +8660,26 @@ EOF } -else # "$with_tty" = "no" - for feature in ncurses gpm; do +else for feature in ncurses gpm; do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then echo "configure: warning: "--with-${feature} ignored: Not valid without TTY support"" 1>&2 fi eval "with_${feature}=no" done -fi - +fi echo "checking for database support" 1>&6 -echo "configure:8401: checking for database support" >&5 - -if test "$with_database_gnudbm" != "no" ; then +echo "configure:8673: checking for database support" >&5 + +if test "$with_database_gnudbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:8406: checking for dbm_open in -lgdbm" >&5 +echo "configure:8678: checking for dbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdbm " cat > conftest.$ac_ext <<EOF -#line 8411 "configure" +#line 8683 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -8418,7 +8690,7 @@ dbm_open() ; return 0; } EOF -if { (eval echo configure:8422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8694: \"$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 @@ -8430,7 +8702,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 with_database_gnudbm=yes have_libgdbm=yes else @@ -8440,10 +8712,10 @@ if test "$with_database_gnudbm" != "yes"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:8444: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8447 "configure" +echo "configure:8716: checking for dbm_open" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8719 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbm_open(); below. */ @@ -8466,7 +8738,7 @@ ; return 0; } EOF -if { (eval echo configure:8470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -8485,7 +8757,7 @@ fi fi - if test "$with_database_gnudbm" = "yes" ; then + if test "$with_database_gnudbm" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DBM EOF @@ -8494,18 +8766,18 @@ EOF } - test "$have_libgdbm" = "yes" && LIBS="$LIBS -lgdbm" + test "$have_libgdbm" = "yes" && LIBS="-lgdbm $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgdbm\" to \$LIBS"; fi with_database_dbm=no else with_database_gnudbm=no fi fi -if test "$with_database_dbm" != "no" ; then +if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:8506: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8509 "configure" +echo "configure:8778: checking for dbm_open" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8781 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbm_open(); below. */ @@ -8528,7 +8800,7 @@ ; return 0; } EOF -if { (eval echo configure:8532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -8549,12 +8821,12 @@ if test "$need_libdbm" != "no"; then echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:8553: checking for dbm_open in -ldbm" >&5 +echo "configure:8825: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -ldbm " cat > conftest.$ac_ext <<EOF -#line 8558 "configure" +#line 8830 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -8565,7 +8837,7 @@ dbm_open() ; return 0; } EOF -if { (eval echo configure:8569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8841: \"$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 @@ -8577,7 +8849,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 with_database_dbm=yes need_libdbm=yes else @@ -8586,7 +8858,7 @@ fi - if test "$with_database_dbm" = "yes" ; then + if test "$with_database_dbm" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DBM EOF @@ -8595,17 +8867,17 @@ EOF } - test "$need_libdbm" = "yes" && LIBS="$LIBS -ldbm" + test "$need_libdbm" = "yes" && LIBS="-ldbm $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ldbm\" to \$LIBS"; fi else with_database_dbm=no fi fi if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for dbopen""... $ac_c" 1>&6 -echo "configure:8606: checking for dbopen" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8609 "configure" +echo "configure:8878: checking for dbopen" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8881 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbopen(); below. */ @@ -8628,7 +8900,7 @@ ; return 0; } EOF -if { (eval echo configure:8632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbopen=yes" else @@ -8649,12 +8921,12 @@ if test "$need_libdb" != "no"; then echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6 -echo "configure:8653: checking for dbopen in -ldb" >&5 +echo "configure:8925: checking for dbopen in -ldb" >&5 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <<EOF -#line 8658 "configure" +#line 8930 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -8665,7 +8937,7 @@ dbopen() ; return 0; } EOF -if { (eval echo configure:8669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8941: \"$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 @@ -8677,7 +8949,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 with_database_berkdb=yes need_libdb=yes else @@ -8689,7 +8961,7 @@ if test "$with_database_berkdb" = "yes"; then for path in "db/db.h" "db.h"; do cat > conftest.$ac_ext <<EOF -#line 8693 "configure" +#line 8965 "configure" #include "confdefs.h" #ifdef HAVE_INTTYPES_H #define __BIT_TYPES_DEFINED__ @@ -8707,7 +8979,7 @@ ; return 0; } EOF -if { (eval echo configure:8711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_path="$path"; break else @@ -8735,7 +9007,7 @@ EOF } - test "$need_libdb" = "yes" && LIBS="$LIBS -ldb" + test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ldb\" to \$LIBS"; fi else with_database_berkdb=no fi fi @@ -8751,18 +9023,20 @@ EOF } - extra_objs="$extra_objs database.o" + extra_objs="$extra_objs database.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"database.o\"" + fi fi if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:8761: checking for SOCKSinit in -lsocks" >&5 +echo "configure:9035: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <<EOF -#line 8766 "configure" +#line 9040 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -8773,7 +9047,7 @@ SOCKSinit() ; return 0; } EOF -if { (eval echo configure:8777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9051: \"$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 @@ -8785,7 +9059,7 @@ rm -f conftest* xe_check_libs="" -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` @@ -8797,7 +9071,7 @@ EOF } - LIBS="-lsocks $LIBS" + LIBS="-lsocks $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lsocks\" to \$LIBS"; fi else echo "$ac_t""no" 1>&6 @@ -8823,91 +9097,27 @@ EOF } - LIBS="$LIBS -Bstatic -lut -Bdynamic" -fi - - -if test "$dynamic" = "no"; then add_runtime_path=no -elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes -else case "$canonical" in - *-solaris2.* | *-sgi-irix* ) add_runtime_path=yes ;; - * ) add_runtime_path=no ;; - esac -fi - -if test "$add_runtime_path" = "yes"; then - echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:8841: 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" - cat > conftest.$ac_ext <<EOF -#line 8846 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:8853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - dash_r="$try_dash_r" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - xe_check_libs="" - test -n "$dash_r" && break - done - if test -n "$dash_r"; - then echo "$ac_t"""\"${dash_r}\""" 1>&6 - else echo "$ac_t""NONE" 1>&6 - fi -fi - -if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then - ld_switch_site="`echo $ld_switch_site | sed \"s/${dash_r}[^ ]*//\"`" - ld_switch_x_site="`echo $ld_switch_x_site | sed \"s/${dash_r}[^ ]*//\"`" - - if test -n "$LD_RUN_PATH"; then - runpath="$LD_RUN_PATH" - else - runpath="" - for arg in $ld_switch_site $ld_switch_x_site; do - case "$arg" in -L* ) - dir=`echo $arg | sed 's/^-L//'` - if test -n "`ls ${dir}/*.so 2>/dev/null`"; then - test -n "$runpath" && runpath="${runpath}:" - runpath="${runpath}${dir}" - fi - ;; - esac - done - case "$canonical" in *-solaris2.* ) - test "$have_motif" = "yes" && runpath="${runpath}:/opt/SUNWdt/lib" ;; - esac - fi - - if test -n "$runpath"; then - ld_switch_site="$ld_switch_site ${dash_r}${runpath}" - test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" - fi + LIBS="-Bstatic -lut -Bdynamic $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi fi c_switch_general="-DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system" c_switch_window_system="$c_switch_x_site $X_CFLAGS" c_switch_all="$c_switch_general $c_switch_window_system" -ld_switch_general="$ld_switch_site $ld_switch_machine $ld_switch_system" +ld_switch_general="$ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run" ld_switch_window_system="$ld_switch_x_site" ld_switch_all="$ld_switch_general $ld_switch_window_system" ld_libs_general="$LIBS $libs_machine $libs_system $libs_standard" ld_libs_window_system="$X_PRE_LIBS $libs_x $X_EXTRA_LIBS" ld_libs_all="$ld_libs_window_system $ld_libs_general" +SRC_SUBDIR_DEPS="$MAKE_SUBDIR" + +MAKE_SUBDIR="$MAKE_SUBDIR src" && if test "$extra_verbose" = "yes"; then echo " Appending \"src\" to \$MAKE_SUBDIR"; fi internal_makefile_list="Makefile" SUBDIR_MAKEFILES='' +test -d lock || mkdir lock for dir in $MAKE_SUBDIR; do + test -d "$dir" || mkdir "$dir" SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $dir/Makefile" internal_makefile_list="$internal_makefile_list $dir/Makefile.in" done @@ -8915,7 +9125,7 @@ if test "$extra_verbose" = "yes"; then - echo "" + echo "" echo "extra_objs = $extra_objs" echo "c_switch_general = $c_switch_general" echo "c_switch_window_system = $c_switch_window_system" @@ -8929,6 +9139,38 @@ echo "" fi +if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then + echo "creating src/gdbinit" + echo "source $srcdir/src/gdbinit" > src/gdbinit +fi + +cat > conftest.$ac_ext <<EOF +#line 9149 "configure" +#include "confdefs.h" + +int main() { +#ifndef __SUNPRO_C +#error No Sun source browser capability +#endif + +; return 0; } +EOF +if { (eval echo configure:9159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "creating .sbinit" +( echo "# For use with Sun WorkShop's Source browser." + echo "# See sbquery(1) and sbinit(4) for more information" + for dir in $MAKE_SUBDIR; do echo "import $dir"; done +) > .sbinit + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + +rm -f core + @@ -8979,14 +9221,6 @@ { test "$extra_verbose" = "yes" && cat << EOF - Defining EMACS_VERSION = $version -EOF -cat >> confdefs.h <<EOF -#define EMACS_VERSION $version -EOF -} - -{ test "$extra_verbose" = "yes" && cat << EOF Defining EMACS_CONFIGURATION = "$canonical" EOF cat >> confdefs.h <<EOF @@ -9010,14 +9244,6 @@ EOF } -{ test "$extra_verbose" = "yes" && cat << EOF - Defining UNEXEC_SRC = $UNEXEC_SRC -EOF -cat >> confdefs.h <<EOF -#define UNEXEC_SRC $UNEXEC_SRC -EOF -} - null_string="" @@ -9313,7 +9539,15 @@ fi test "$with_gif" = yes && echo " Compiling in support for GIF image conversion." -test "$with_xpm" = yes && echo " Compiling in support for XPM images." +if test "$with_xpm" = yes; then + echo " Compiling in support for XPM images." +else + echo " --------------------------------------------------------------------" + echo " WARNING: Compiling without XPM support." + echo " WARNING: You should strongly considering installing XPM." + echo " WARNING: Otherwise toolbars and other graphics will look suboptimal." + echo " --------------------------------------------------------------------" +fi test "$with_xface" = yes && echo " Compiling in support for X-Face message headers." test "$with_jpeg" = yes && echo " Compiling in support for JPEG image conversion." test "$with_png" = yes && echo " Compiling in support for PNG image conversion." @@ -9340,7 +9574,7 @@ test "$with_canna" = yes && echo " Compiling in support for Canna on Mule." if test "$with_wnn" = yes; then echo " Compiling in support for the WNN input method on Mule." - test "$with_wnn6" = yes && echo " WNN support for version 6." + test "$with_wnn6" = yes && echo " Using WNN version 6." fi test "$with_i18n3" = yes && echo " Compiling in I18N support, level 3 (doesn't currently work)." @@ -9376,9 +9610,17 @@ test "$debug" = yes && echo " Compiling in extra code for debugging." test "$memory_usage_stats" = yes && echo " Compiling in code for checking XEmacs memory usage." test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." +if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \ + != "no no no no no"; then + echo " WARNING: ---------------------------------------------------------" + echo " WARNING: Compiling in support for runtime error checking." + echo " WARNING: XEmacs will run noticeably more slowly as a result." + echo " WARNING: Error checking is on by default for XEmacs beta releases." + echo " WARNING: ---------------------------------------------------------" +fi echo "" ) | tee -a Installation -echo 'The above configure report is appended to "Installation" file.' +echo "The above configure report is appended to \"Installation\" file." echo "" @@ -9488,6 +9730,7 @@ s%@X_LIBS@%$X_LIBS%g s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g s%@ALLOCA@%$ALLOCA%g +s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g s%@version@%$version%g @@ -9743,7 +9986,7 @@ for dir in $MAKE_SUBDIR; do echo creating $dir/Makefile - ( set -e + ( cd $dir rm -f junk.c sed -e 's/^# Generated.*//' -e 's%/\*\*/#.*%%' < Makefile.in > junk.c; @@ -9758,7 +10001,6 @@ mv -f Makefile.new Makefile rm -f junk.c junk.cpp ) - test "$?" != 0 && exit "$?" # For debugging done exit 0 @@ -9767,18 +10009,3 @@ rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - -if test ! -f src/gdbinit && test -f $topsrcdir/src/gdbinit; then - echo "creating src/gdbinit" - echo "source $topsrcdir/src/gdbinit" > src/gdbinit -fi - -if test "$sunpro_c" = "yes"; then cat < EOF > .sbinit -# For use with Sun WorkShop's Source browser. -# See sbquery(1) and sbinit(4) for more information -import src -import lwlib -import lib-src -import dynodump -EOF -fi
--- a/configure.in Mon Aug 13 09:36:20 2007 +0200 +++ b/configure.in Mon Aug 13 09:37:19 2007 +0200 @@ -69,6 +69,28 @@ $2 ])dnl +dnl Redefine AC_TRY_RUN_NATIVE to not throw away stderr while running +dnl AC_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) +define([AC_TRY_RUN_NATIVE], +[cat > conftest.$ac_ext <<EOF +[#]line __oline__ "configure" +#include "confdefs.h" +[$1] +EOF +if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit) 2>&AC_FD_CC +then +dnl Do not remove the temporary files here, so they can be examined. + ifelse([$2], , :, [$2]) +else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +ifelse([$3], , , [ rm -fr conftest* + $3 +])dnl +fi +rm -fr conftest*]) + + dnl Avoid spurious cross-compiling warnings from AC_TRY_RUN dnl XEmacs is unlikely to ever cross-compile define([AC_TRY_RUN],[AC_TRY_RUN_NATIVE([$1], [$2], [$3])])dnl @@ -106,7 +128,7 @@ dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, OTHER-LIBRARIES] [, LDFLAGS]]]]) define([AC_CHECK_LIB], -[ifelse([$1],dnet, [if test "$with_dnet" = "no"; then +[ifelse([$1],dnet, [if test "$with_dnet" = "no" ; then ac_cv_lib_dnet_dnet_ntoa=no ifelse([$4], , , [$4] )dnl @@ -145,7 +167,7 @@ eval "ac_cv_lib_$ac_lib_var=no") xe_check_libs="" ])dnl -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then AC_MSG_RESULT(yes) ifelse([$3], , [changequote(, )dnl @@ -153,7 +175,7 @@ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_lib) - LIBS="-l$1 $LIBS" + XE_PREPEND([-l$1], LIBS) ], [$3]) else AC_MSG_RESULT(no) @@ -171,15 +193,40 @@ dnl ac_cpp='$CPP $CPPFLAGS' dnl ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC' dnl ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' -xe_cppflags='$c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS $CPPFLAGS' # $c_switch_x_machine $c_switch_x_system' -xe_ldflags='$ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site' # $ld_switch_x_machine $ld_switch_x_system' +dnl # $c_switch_x_machine $c_switch_x_system +dnl # $ld_switch_x_machine $ld_switch_x_system +xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' +xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' xe_libs='$xe_check_libs $X_PRE_LIBS $libs_x $X_EXTRA_LIBS $LIBS $libs_machine $libs_system $libs_standard' ac_cpp='$CPP '"$xe_cppflags" -ac_compile='${CC-cc} -c '"$CFLAGS $xe_cppflags"' conftest.$ac_ext 1>&AC_FD_CC' -ac_link='${CC-cc} -o conftest '"$CFLAGS $xe_cppflags $LDFLAGS $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AC_FD_CC' +ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&AC_FD_CC' +ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AC_FD_CC' cross_compiling=no ]) + +dnl XE_ADD_OBJS(foo.o ...) +define([XE_ADD_OBJS], +[extra_objs="$extra_objs [$1]" && dnl + if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"[$1]\"" + fi]) + +dnl XE_APPEND(value, varname) +define([XE_APPEND], +[[$2]="$[$2] [$1]" && dnl + if test "$extra_verbose" = "yes"; then echo " Appending \"[$1]\" to \$[$2]"; fi]) + +dnl XE_PREPEND(value, varname) +define([XE_PREPEND], +[[$2]="[$1] $[$2]" && dnl + if test "$extra_verbose" = "yes"; then echo " Prepending \"[$1]\" to \$[$2]"; fi]) + + +dnl Initialize some variables set by options. +dnl The variables have the same names as the options, with +dnl dashes changed to underlines. + define([AC_INIT_PARSE_ARGS],[ dnl Initialize some variables set by options. dnl The variables have the same names as the options, with @@ -249,7 +296,7 @@ dnl Prevent autoconf2 caching cache_file=/dev/null -MAKE_SUBDIR="src lib-src" +XE_APPEND(lib-src, MAKE_SUBDIR) dnl run_in_place='no' prefix='/usr/local' @@ -288,7 +335,7 @@ native_sound_lib='' dnl make normal error-checking be the default in alpha and beta versions, so dnl that bugs get noticed. Change this for released versions. -error_check_default='no' +error_check_default='yes' error_check_extents=$error_check_default error_check_typecheck=$error_check_default error_check_bufpos=$error_check_default @@ -297,6 +344,8 @@ dnl debug=yes must be set when error checking is present. This should be dnl fixed up. debug=$error_check_default +dnl Default to --extra-verbose when debugging +extra_verbose=$error_check_default dnl use-assertions should be 'yes' by default. Too many people in this dnl world have core dumps turned off by default or \"cannot find where the dnl core file went\". At least we should get some useful output ... @@ -438,7 +487,7 @@ --with-dnet (*) Compile with support for DECnet. --mail-locking=TYPE (*) Specify the locking to be used by movemail to prevent concurrent updates of mail spool files. Valid types - are \`lockf', \`flock', and \`lock-file'. + are \`lockf', \`flock', and \`file'. Internationalization options: @@ -448,10 +497,10 @@ --with-xim=motif (*) Used in conjunction with Mule support. Use either raw Xlib to provide XIM support, or the Motif XmIm* routines (when available). - If the XmIm* routines are autodetected, - then the default is --with-xim=motif, else --with-xim=no. - NOTE: On some systems like SunOS4 use of this option - will cause XEmacs to crash at startup. + NOTE: On some systems bugs in X11's XIM support + will cause XEmacs to crash, so by default, + no XIM support is compiled in, unless running + on Solaris and the XmIm* routines are detected. --with-canna (*) Compile with support for Canna (a Japanese input method used in conjunction with Mule support). --with-wnn (*) Compile with support for WNN (a multi-language input method @@ -683,7 +732,7 @@ with_database_gnudbm=no for x in `echo "$val" | sed 's/,/ /'` ; do case "$x" in - no ) : ;; + no ) ;; b | be | ber | berk | berkd | berkdb ) with_database_berkdb=yes ;; d | db | dbm ) with_database_dbm=yes ;; g | gn | gnu | gnud | gnudb | gnudbm ) with_database_gnudbm=yes ;; @@ -693,7 +742,7 @@ esac done if test "$with_database_dbm" = "yes" -a \ - "$with_database_gnudbm" = "yes" ; then + "$with_database_gnudbm" = "yes"; then USAGE_ERROR("Only one of \`dbm' and \`gnudbm' may be specified with the \`--$optname' option.") fi @@ -733,7 +782,7 @@ case "$val" in lockf ) val=lockf ;; flock ) val=flock ;; - file ) val=file ;; + file ) val=file ;; * ) USAGE_ERROR(["The \`--$optname' option must have one of these values: \`lockf', \`flock', or \`file'."]) ;; esac @@ -778,7 +827,7 @@ fi USAGE_ERROR(["Valid types for the \`--$optname' option are: $types."]) - elif test "$new_default" ; then + elif test -n "$new_default" ; then error_check_extents=$new_default error_check_typecheck=$new_default error_check_bufpos=$new_default @@ -800,8 +849,8 @@ mandir | infodir | lispdir | etcdir | lockdir | archlibdir | \ sitelispdir | docdir ) dnl If the value was omitted, get it from the next argument. - if test "$valomitted" = "yes" ; then - if test "$#" = 0 ; then + if test "$valomitted" = "yes"; then + if test "$#" = 0; then USAGE_ERROR("The \`--$optname' option requires a value."); fi val="$1"; shift @@ -879,20 +928,12 @@ dnl Argument interdependencies if test "$with_energize" = "yes" ; then with_menubars=lucid with_scrollbars=motif with_dialogs=motif with_tooltalk=yes - MAKE_SUBDIR="$MAKE_SUBDIR lwlib/energize" + XE_APPEND(lwlib/energize, MAKE_SUBDIR) fi dnl --extra-verbose implies --verbose test "$extra_verbose" = "yes" && verbose=yes -dnl Sun Development environment support -test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias -if test "$with_workshop" = "yes"; then - AC_DEFINE(SUNPRO) - extra_objs="$extra_objs sunpro.o" - with_tooltalk=yes -fi - dnl Allow use of either ":" or spaces for lists of directories define(COLON_TO_SPACE, [case "[$1]" in *:* [)] [$1]="`echo $[$1] | sed 's/:/ /g'`";; esac])dnl @@ -900,12 +941,6 @@ COLON_TO_SPACE(site_libraries) COLON_TO_SPACE(site_runtime_libraries) -dnl debug implies other options -if test "$debug" = "yes"; then - use_assertions=yes memory_usage_stats=yes - extra_objs="$extra_objs debug.o" -fi - dnl with_x is obsolete synonym for with_x11 test -n "$with_x" && with_x11="$with_x" @@ -1012,14 +1047,6 @@ vpath %.in $(srcdir)' fi -dnl Make the necessary directories, if they do not exist. -for dir in ./src ./lib-src ./dynodump ./lwlib ./lock ; do - test ! -d "$dir" && mkdir "$dir" -done -if test "$with_energize" = "yes" -a ! -d ./lwlib/energize; then - mkdir ./lwlib/energize -fi - dnl ------------------------------ dnl Determine the s&m files to use dnl ------------------------------ @@ -1057,7 +1084,7 @@ dnl "System V Release 4"; he writes, "The old convention encouraged" dnl "confusion between `system' and `release' levels'." -machine='' opsys='' need_dynodump=no +machine='' opsys='' dnl Straightforward machine determination case "$canonical" in @@ -1118,10 +1145,9 @@ *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;; *-*-sysv4.[[2-9]]* | *-sysvr4.[[2-9]]* ) if test -z "$NON_GNU_CPP" ; then - if test -f /usr/ccs/lib/cpp - then NON_GNU_CPP=/usr/ccs/lib/cpp - else NON_GNU_CPP=/lib/cpp - fi + for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do + if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi + done fi opsys=usg5-4-2 ;; *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;; @@ -1253,19 +1279,11 @@ *-hp-hpux8* ) opsys=hpux8 ;; *-hp-hpux9* ) opsys=hpux9 ;; *-hp-hpux10* ) opsys=hpux10 ;; - * ) - case "`uname -r`" in - *.B8.* ) opsys=hpux8 ;; - *.08.* ) opsys=hpux8 ;; - *.09.* ) opsys=hpux9 ;; - *.10.* ) opsys=hpux10 ;; - * ) opsys=hpux ;; - esac - ;; + * ) opsys=hpux ;; esac dnl HP has a broken "strcat" - case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o";; esac + case "$opsys" in hpux9 | hpux10 ) XE_ADD_OBJS(strcat.o) ;; esac if test "$opsys" = "hpux10"; then ansi_flag="-Ae"; else ansi_flag="-Aa"; fi NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E" @@ -1413,8 +1431,7 @@ *-solaris2* ) test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp RANLIB=':' - case "$canonical" in *-solaris2.[[0-5]]* ) need_dynodump=yes ;; esac - esac + esac case "$canonical" in dnl The last Sun386 ran 4.0. @@ -1552,6 +1569,20 @@ dnl Determine the compiler, set up for feature testing dnl -------------------------------------------------- +dnl debug implies other options +if test "$debug" = "yes"; then + use_assertions=yes memory_usage_stats=yes + XE_ADD_OBJS(debug.o) +fi + +dnl Sun Development environment support +test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias +if test "$with_workshop" = "yes"; then + AC_DEFINE(SUNPRO) + XE_ADD_OBJS(sunpro.o) + with_tooltalk=yes +fi + dnl Choose a compiler. test -n "$CC" && cc_specified=yes @@ -1564,10 +1595,10 @@ test -n "$NON_GNU_CC" -a "$with_gcc" = "no" -a -z "$CC" && CC="$NON_GNU_CC" AC_PROG_CC -if test "$with_gcc" = "no" -a "$ac_cv_prog_gcc" = "yes"; then +if test "$with_gcc" = "no" -a "$ac_cv_prog_gcc" = "yes"; then CC=${NON_GNU_CC-cc} AC_PROG_CC -elif test "$with_gcc" = "yes" -a "$ac_cv_prog_gcc" = "no" ; then +elif test "$with_gcc" = "yes" -a "$ac_cv_prog_gcc" = "no" ; then CC=gcc AC_PROG_CC fi @@ -1578,7 +1609,7 @@ AC_PROG_CPP case "$canonical" in - *-sun-sunos* ) test "$CPP" = "acc -E" && CPP="acc -E -Xs" ;; + *-sun-sunos* ) test "$CPP" = "acc -E" && CPP="acc -E -Xs" ;; esac dnl -------------------------------------------------------------------- @@ -1605,7 +1636,7 @@ dnl CPP_to_sh(CPP_SYMBOL, SH_VAR, DEFAULT_VALUE) define([CPP_to_sh], [[#]ifndef [$1] -[#]define [$1] [$3] +[#]define [$1]ifelse([$3],,, [ $3]) [#]endif configure___ [$2]=[$1] ]) @@ -1647,7 +1678,6 @@ CPP_boolean_to_sh(TERMINFO, have_terminfo) CPP_boolean_to_sh(MAIL_USE_FLOCK, mail_use_flock) CPP_boolean_to_sh(MAIL_USE_LOCKF, mail_use_lockf) -CPP_boolean_to_sh(__SUNPRO_C, sunpro_c) #ifdef THIS_IS_CONFIGURE @@ -1685,12 +1715,113 @@ rm $tempcname dnl override CFLAGS if user wishes -if test "$cflags" != "NO_CFLAGS_DEFINED" ; then - REAL_CFLAGS=$cflags +test "$cflags" != "NO_CFLAGS_DEFINED" && REAL_CFLAGS="$cflags" + +dnl Add unexec object to link line +XE_ADD_OBJS($unexec) + +dnl --------------------------------------------------------------- +dnl Add site and system specific flags to compile and link commands +dnl --------------------------------------------------------------- + +dnl --site-libraries (multiple dirs) +if test -n "$site_libraries"; then + for arg in $site_libraries; do + case "$arg" in -* ) ;; * ) arg="-L${arg}" ;; esac + XE_APPEND($arg, ld_switch_site) + done +fi + +dnl --site-includes (multiple dirs) +if test -n "$site_includes" ; then + for arg in $site_includes; do + case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac + XE_APPEND($arg, c_switch_site) + done +fi + +dnl Extra system-specific library directories - please add to list +for dir in "/usr/ccs/lib"; do + test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_site) +done + +dnl --site-runtime-libraries (multiple dirs) +if test -n "$site_runtime_libraries" ; then + LD_RUN_PATH="`echo $site_runtime_libraries | sed 's/ */:/'`" + export LD_RUN_PATH +fi + +dnl ------------------------------------- +dnl Compute runtime library path +dnl ------------------------------------- + +if test "$dynamic" = "no"; then add_runtime_path=no +elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes +else case "$canonical" in + *-solaris2.* | *-sgi-irix* ) add_runtime_path=yes ;; + * ) add_runtime_path=no ;; + esac fi -dnl Compute the unexec source name from the object name. -UNEXEC_SRC="`echo $unexec | sed 's/\.o/.c/'`" +if test "$add_runtime_path" = "yes"; then + dnl Try to autodetect runtime library flag (usually -R), + dnl and whether it works (or at least does no harm) + AC_MSG_CHECKING("for runtime libraries flag") + dash_r="" + for try_dash_r in "-R" "-R " "-rpath "; do + xe_check_libs="${try_dash_r}/no/such/file-or-directory" + AC_TRY_LINK(, , dash_r="$try_dash_r") + xe_check_libs="" + test -n "$dash_r" && break + done + if test -n "$dash_r"; + then AC_MSG_RESULT("\"${dash_r}\"") + else AC_MSG_RESULT(NONE) + fi +fi + +define([XE_COMPUTE_RUNPATH],[ +if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then + dnl Remove runtime paths from current ld switches + ld_switch_site="`echo $ld_switch_site | sed \"s/${dash_r}[[^ ]]*//\"`" + ld_switch_x_site="`echo $ld_switch_x_site | sed \"s/${dash_r}[[^ ]]*//\"`" + dnl PRINT_VAR(ld_switch_site, ld_switch_x_site) + + dnl Fix up Runtime path + dnl If LD_RUN_PATH is set in environment, use that. + dnl In this case, assume user has set the right value. + if test -n "$LD_RUN_PATH"; then + runpath="$LD_RUN_PATH" + else + dnl Add all directories with .so files to runpath + runpath="" + for arg in $ld_switch_site $ld_switch_x_site; do + case "$arg" in -L* ) + dir=`echo "$arg" | sed 's/^-L//'` + if test -n "`ls ${dir}/*.s[[ol]] 2>/dev/null`"; then + test -n "$runpath" && runpath="${runpath}:" + runpath="${runpath}${dir}" + fi + ;; + esac + done + dnl Sometimes /opt/SUNWdt/lib is the only installed Motif available + case "$canonical" in *-solaris2.[[1-4]]* ) + test "$need_motif" = "yes" && runpath="${runpath}:/opt/SUNWdt/lib" ;; + esac + fi + + if test -n "$runpath"; then + ld_switch_run="${dash_r}${runpath}" + test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" + fi +fi +])dnl +XE_COMPUTE_RUNPATH() + +dnl ----------------------------------- +dnl Do some misc autoconf-special tests +dnl ----------------------------------- dnl Do the opsystem or machine files prohibit the use of the GNU malloc? dnl Assume not, until told otherwise. @@ -1705,10 +1836,6 @@ (User chose not to use GNU allocators.)" fi -dnl ----------------------------------- -dnl Do some misc autoconf-special tests -dnl ----------------------------------- - dnl Some other nice autoconf tests. If you add a test here which dnl should make an entry in src/config.h, do not forget to add an dnl #undef clause to src/config.h.in for autoconf to modify. @@ -1780,6 +1907,11 @@ dnl check byte order AC_C_BIGENDIAN +dnl define SIZEOF_TYPE +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) + dnl check for long file names AC_SYS_LONG_FILE_NAMES @@ -1788,6 +1920,9 @@ dnl -lm might be required for some X libraries to link with later AC_CHECK_LIB(m, sqrt) +dnl Floating operation support is now unconditional +AC_DEFINE(LISP_FLOAT_TYPE) + dnl Determine type of mail locking from configure args and s&m headers AC_CHECKING(type of mail spool file locking) test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock @@ -1796,23 +1931,41 @@ elif test "$mail_locking" = "flock"; then AC_DEFINE(REAL_MAIL_USE_FLOCK) fi -dnl Dynodump -if test "$need_dynodump" = "yes" ; then +dnl Used by getloadavg() - does not require root priveleges +AC_CHECK_LIB(kstat, kstat_open) + +dnl Another way to get the load average +AC_CHECK_LIB(kvm, kvm_read) + +AC_CHECK_LIB(pthreads, cma_open) +if test "$ac_cv_lib_pthreads_cma_open" = "yes"; then + case "$opsys" in decosf*) c_switch_site="$c_switch_site -threads";; esac +fi + +AC_MSG_CHECKING(whether the -xildoff compiler flag is required) +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 AC_MSG_RESULT(no); + else AC_MSG_RESULT(yes); XE_APPEND(-xildoff, ld_switch_site) + fi + else AC_MSG_RESULT(no) +fi + +dnl Dynodump (Solaris 2.x, x<6) +AC_MSG_CHECKING(for dynodump) +case "$canonical" in *-solaris2.[[0-5]]* ) + AC_MSG_RESULT(yes) AC_DEFINE(DYNODUMP) - MAKE_SUBDIR="$MAKE_SUBDIR dynodump" + XE_APPEND(dynodump, MAKE_SUBDIR) case "$canonical" in sparc* ) dynodump_arch=sparc ;; powerpc* ) dynodump_arch=ppc ;; i*86* ) dynodump_arch=i386 ;; esac dnl Dynodump requires the system linker - test "$GCC" = "yes" && ld_switch_site="-fno-gnu-linker $ld_switch_site" -fi - -dnl Extra library directories - please add to list -for dir in "/usr/ccs/lib"; do - test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" -done + test "$GCC" = "yes" && XE_APPEND(-fno-gnu-linker, ld_switch_site) ;; + *) AC_MSG_RESULT(no) ;; +esac dnl ---------------------- dnl Choose a window system @@ -1851,18 +2004,20 @@ if test "$with_x11" = "yes"; then AC_DEFINE(HAVE_X_WINDOWS) - MAKE_SUBDIR="$MAKE_SUBDIR lwlib" + XE_APPEND(lwlib, MAKE_SUBDIR) dnl Try to find Motif/CDE/Tooltalk dirs dnl These take precedence over other X libs/includes, so PRE-pend for lib_dir in "/usr/dt/lib" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do inc_dir="`echo $lib_dir | sed 's/lib/include/'`" if test -d "$lib_dir" -a -d "$inc_dir"; then - case "$x_libraries" in *"$lib_dir"* ) : ;; *) - x_libraries="$lib_dir $x_libraries" X_LIBS="-L${lib_dir} $X_LIBS" + case "$x_libraries" in *"$lib_dir"* ) ;; *) + x_libraries="$lib_dir $x_libraries" + XE_PREPEND(-L${lib_dir}, X_LIBS) ;; esac - case "$x_includes" in "$inc_dir"* ) : ;; *) - x_includes="$inc_dir $x_includes" X_CFLAGS="-I${inc_dir} $X_CFLAGS" + case "$x_includes" in "$inc_dir"* ) ;; *) + x_includes="$inc_dir $x_includes" + XE_PREPEND(-I${inc_dir}, X_CFLAGS) ;; esac break; dnl only need ONE Motif implementation! fi @@ -1872,11 +2027,13 @@ for rel in "X11R6" "X11R5" "X11R4"; do lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include" if test -d "$lib_dir" -a -d "$inc_dir"; then - case "$x_libraries" in *"$lib_dir"* ) : ;; *) - x_libraries="$x_libraries $lib_dir" X_LIBS="$X_LIBS -L${lib_dir}" + case "$x_libraries" in *"$lib_dir"* ) ;; *) + x_libraries="$x_libraries $lib_dir" + XE_APPEND(-L${lib_dir}, X_LIBS) esac - case "$x_includes" in "$inc_dir"* ) : ;; *) - x_includes="$x_includes $inc_dir" X_CFLAGS="$X_CFLAGS -I${inc_dir}" + case "$x_includes" in "$inc_dir"* ) ;; *) + x_includes="$x_includes $inc_dir" + XE_APPEND(-I${inc_dir}, X_CFLAGS) esac break; dnl Only need ONE X11 implementation ! fi @@ -1884,6 +2041,8 @@ ld_switch_x_site="$X_LIBS" + XE_COMPUTE_RUNPATH() + if test "$extra_verbose" = "yes"; then echo; echo "X11 compilation variables:" PRINT_VAR(x_libraries, x_includes, X_CFLAGS, X_LIBS, X_PRE_LIBS, X_EXTRA_LIBS) @@ -1904,19 +2063,20 @@ -b i486-linuxaout) fi libs_x="-lX11" + test "$extra_verbose" = "yes" && echo " Setting libs_x to \"-lX11\"" case "$canonical" in *-sunos4.* ) # Bug workaround ld_switch_x_site="$ld_switch_x_site -u _XtToolkitInitialize" ;; esac - AC_CHECK_LIB(Xt, XtOpenDisplay, libs_x="-lXt $libs_x", + AC_CHECK_LIB(Xt, XtOpenDisplay, XE_PREPEND(-lXt, libs_x), [AC_MSG_ERROR("Unable to find X11 libraries.")]) AC_MSG_CHECKING(the version of X11 being used) AC_TRY_RUN([#include <X11/Intrinsic.h> main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; }], - [./conftest foobar; rc=$?],[rc=4],[rc=4]) - AC_MSG_RESULT(R${rc}) - AC_DEFINE_UNQUOTED(THIS_IS_X11R${rc}) + [./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4]) + AC_MSG_RESULT(R${x11_release}) + AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release}) AC_CHECK_HEADERS(X11/Xlocale.h) @@ -1933,7 +2093,7 @@ fi dnl Autodetect -lXext - AC_CHECK_LIB(Xext, XShapeSelectInput, libs_x="-lXext $libs_x") + AC_CHECK_LIB(Xext, XShapeSelectInput, XE_PREPEND(-lXext, libs_x)) dnl autodetect -lXmu case "$canonical" in *-sunos4.* ) # Bug workaround @@ -1943,19 +2103,14 @@ AC_CHECK_LIB(Xmu, XmuConvertStandardSelection, with_xmu=yes, with_xmu=no) fi if test "$with_xmu" = "no"; then - extra_objs="$extra_objs xmu.o" + XE_ADD_OBJS(xmu.o) else - libs_x="-lXmu $libs_x" + XE_PREPEND(-lXmu, libs_x) fi dnl Autodetect -lXbsd dnl #### Someone, please add a better function than main - AC_CHECK_LIB(Xbsd, main, libs_x="-lXbsd $libs_x") - - dnl autodetect Motif - but only add to libs_x later (if necessary) - AC_CHECK_HEADER(Xm/Xm.h, - [AC_CHECK_LIB(Xm, XmStringFree, have_motif=yes, have_motif=no)], - have_motif=no) + AC_CHECK_LIB(Xbsd, main, XE_PREPEND(-lXbsd, libs_x)) dnl Autodetect -lXaw AC_CHECK_LIB(Xaw, XawScrollbarSetThumb, have_xaw=yes, have_xaw=no) @@ -2012,28 +2167,6 @@ esac fi -dnl --site-libraries (multiple dirs) -if test -n "$site_libraries"; then - for arg in $site_libraries; do - test -d "$arg" && arg="-L${arg}" - ld_switch_site="$ld_switch_site $arg" - done -fi - -dnl --site-runtime-libraries (multiple dirs) -if test -n "$site_runtime_libraries" ; then - LD_RUN_PATH="`echo $site_runtime_libraries | sed 's/ */:/'`" - export LD_RUN_PATH -fi - -dnl --site-includes (multiple dirs) -if test -n "$site_includes" ; then - for arg in $site_includes; do - test -d "$arg" && arg="-I${arg}" - c_switch_site="$c_switch_site $arg" - done -fi - dnl FSF 19.29 has some bitmapdir stuff here. bitmapdir= @@ -2048,28 +2181,6 @@ test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h" esac -AC_DEFINE(LISP_FLOAT_TYPE) dnl Uhconditional - -dnl Used by getloadavg() - does not require root priveleges -AC_CHECK_LIB(kstat, kstat_open) - -dnl Another way to get the load average -AC_CHECK_LIB(kvm, kvm_read) - -AC_CHECK_LIB(pthreads, cma_open) -if test "$ac_cv_lib_pthreads_cma_open" = "yes"; then - case "$opsys" in decosf*) c_switch_site="$c_switch_site -threads";; esac -fi - -AC_MSG_CHECKING(whether the -xildoff compiler flag is required) -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 AC_MSG_RESULT(no); - else AC_MSG_RESULT(yes); ld_switch_site="$ld_switch_site -xildoff" - fi - else AC_MSG_RESULT(no) -fi - dnl Autodetect Xauth test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no test -z "$with_xauth" && { AC_CHECK_HEADER(X11/Xauth.h, ,with_xauth=no) } @@ -2077,7 +2188,7 @@ test -z "$with_xauth" && with_xauth=yes if test "$with_xauth" = "yes"; then AC_DEFINE(HAVE_XAUTH) - libs_x="-lXau $libs_x" + XE_PREPEND(-lXau, libs_x) fi dnl Autodetect OffiX @@ -2086,7 +2197,7 @@ test -z "$with_offix" && with_offix=yes if test "$with_offix" = "yes"; then AC_DEFINE(HAVE_OFFIX_DND) - libs_x="-lDnd $libs_x" + XE_PREPEND(-lDnd, libs_x) fi dnl Autodetect tooltalk @@ -2109,8 +2220,8 @@ if test "$with_tooltalk" = "yes"; then AC_DEFINE(TOOLTALK) AC_DEFINE_UNQUOTED(TT_C_H_PATH, "$tt_c_h_path") - libs_x="$tt_libs $libs_x" - extra_objs="$extra_objs tooltalk.o" + XE_PREPEND($tt_libs, libs_x) + XE_ADD_OBJS(tooltalk.o) fi dnl Autodetect CDE @@ -2119,7 +2230,7 @@ test -z "$with_cde" && with_cde=yes if test "$with_cde" = "yes" ; then AC_DEFINE(HAVE_CDE) - libs_x="-lDtSvc $libs_x" + XE_PREPEND(-lDtSvc, libs_x) with_tooltalk=yes # CDE requires Tooltalk with_motif=yes # CDE requires Motif fi @@ -2128,16 +2239,16 @@ if test "$with_energize" = "yes" ; then AC_DEFINE(ENERGIZE) AC_CHECK_LIB(energize, main, [ - LIBS="$LIBS -lenergize" + XE_PREPEND(-lenergize, LIBS) energize_version="3.X" AC_DEFINE(ENERGIZE_3)]) if test -z "$energize_version"; then AC_CHECK_LIB(conn, main, [ - LIBS="$LIBS -lconn" + XE_PREPEND(-lconn, LIBS) energize_version="2.X" AC_DEFINE(ENERGIZE_2)], [AC_MSG_ERROR(Unable to find Energize library.)]) - fi + fi AC_CHECK_HEADER(editorconn.h, , [AC_MSG_ERROR(Unable to find Energize editorconn.h header file.)]) @@ -2154,7 +2265,7 @@ test -z "$with_gif" && with_gif=yes; if test "$with_gif" = "yes"; then AC_DEFINE(HAVE_GIF) - extra_objs="$extra_objs dgif_lib.o gif_err.o gifalloc.o" + XE_ADD_OBJS(dgif_lib.o gif_err.o gifalloc.o) fi dnl Autodetect Xpm @@ -2163,7 +2274,7 @@ test -z "$with_xpm" && with_xpm=yes if test "$with_xpm" = "yes"; then AC_DEFINE(HAVE_XPM) - libs_x="-lXpm $libs_x" + XE_PREPEND(-lXpm, libs_x) fi dnl Autodetect XFACE @@ -2172,7 +2283,7 @@ test -z "$with_xface" && with_xface=yes if test "$with_xface" = "yes"; then AC_DEFINE(HAVE_XFACE) - libs_x="-lcompface $libs_x" + XE_PREPEND(-lcompface, libs_x) fi dnl autodetect JPEG @@ -2181,7 +2292,7 @@ test -z "$with_jpeg" && with_jpeg=yes if test "$with_jpeg" = "yes"; then AC_DEFINE(HAVE_JPEG) - libs_x="-ljpeg $libs_x" + XE_PREPEND(-ljpeg, libs_x) fi dnl autodetect PNG @@ -2196,15 +2307,20 @@ test -z "$with_png" && with_png=no if test "$with_png" = "yes"; then AC_DEFINE(HAVE_PNG) - libs_x="$png_libs $libs_x" + XE_PREPEND($png_libs, libs_x) fi dnl autodetect TIFF (not yet implemented) if test "$with_tiff" = "yes"; then AC_DEFINE(HAVE_TIFF) - libs_x="-ltiff $libs_x" + XE_PREPEND(-ltiff, libs_x) fi +dnl autodetect Motif - but only add to libs_x later (if necessary) + AC_CHECK_HEADER(Xm/Xm.h, + [AC_CHECK_LIB(Xm, XmStringFree, have_motif=yes, have_motif=no)], + have_motif=no) + dnl Finish ensuring that we have values for the various toolkit items. dnl Not all toolkits support all widgets dnl if Motif is available we use it for the dialog boxes. @@ -2226,7 +2342,7 @@ case "$all_widgets" in *athena* ) AC_DEFINE(LWLIB_USES_ATHENA) - libs_x="-lXaw $libs_x" ;; + XE_PREPEND(-lXaw, libs_x) ;; esac case "$all_widgets" in *motif* ) @@ -2251,36 +2367,38 @@ test "$with_scrollbars" = "motif" && AC_DEFINE(LWLIB_SCROLLBARS_MOTIF) test "$with_dialogs" = "motif" && AC_DEFINE(LWLIB_DIALOGS_MOTIF) -test "$with_menubars" != "no" && extra_objs="$extra_objs menubar.o" -test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar.o" -test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog.o" -test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar.o" -test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui.o" +test "$with_menubars" != "no" && XE_ADD_OBJS(menubar.o) +test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar.o) +test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog.o) +test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar.o) +test "$all_widgets" != "no no no no" && XE_ADD_OBJS(gui.o) if test "$with_x11" = "yes"; then - test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-x.o" - test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-x.o" - test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog-x.o" - test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar-x.o" - test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" + test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-x.o) + test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-x.o) + test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog-x.o) + test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar-x.o) + test "$all_widgets" != "no no no no" && XE_ADD_OBJS(gui-x.o) fi -dnl ------------------------ -dnl Misc other feature tests -dnl ------------------------ - -dnl Mule-dependent option processing +dnl ---------------------- +dnl Mule-dependent options +dnl ---------------------- + test -z "$with_mule" && with_mule=no if test "$with_mule" = "yes" ; then + AC_CHECKING(for Mule-related features) AC_DEFINE(MULE) - extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o mule-coding.o" + XE_ADD_OBJS(mule.o mule-ccl.o mule-charset.o mule-coding.o) dnl Use -lintl to get internationalized strerror for Mule AC_CHECK_LIB(intl, strerror) AC_CHECKING(for Mule input methods) dnl Do we have the XmIm* routines? And if so, do we want to use them? + dnl XIM seems to be flaky except on Solaris... + test -z "$with_xim" && case "$opsys" in sol2* ) ;; *) with_xim=no ;; esac case "$with_xim" in "" | "yes" ) AC_CHECKING(for XIM) AC_CHECK_LIB(Xm, XmImMbLookupString, with_xim=motif, with_xim=xlib) @@ -2289,27 +2407,27 @@ AC_DEFINE(HAVE_XIM) if test "$with_xim" = "xlib"; then AC_DEFINE(XIM_XLIB) - extra_objs="$extra_objs input-method-xlib.o" - fi + XE_ADD_OBJS(input-method-xlib.o) + fi if test "$with_xim" = "motif"; then AC_DEFINE(XIM_MOTIF) need_motif=yes - extra_objs="$extra_objs input-method-motif.o" - fi + XE_ADD_OBJS(input-method-motif.o) fi + fi dnl with_xim dnl Autodetect WNN test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support - test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/wnnerror.h, ,with_wnn=no) } + test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/jllib.h, ,with_wnn=no) } test -z "$with_wnn" && { AC_CHECK_LIB(wnn,jl_dic_list,[:],with_wnn=no) } test -z "$with_wnn" && with_wnn=yes if test "$with_wnn" = "yes"; then AC_DEFINE(HAVE_WNN) - libs_x="-lwnn $libs_x" - extra_objs="$extra_objs mule-wnnfns.o" + XE_PREPEND(-lwnn, libs_x) + XE_ADD_OBJS(mule-wnnfns.o) AC_CHECK_LIB(wnn, jl_fi_dic_list, with_wnn6=yes) - test "$with_wnn6" = "yes" && AC_DEFINE(HAVE_WNN6) - fi + test "$with_wnn6" = "yes" && AC_DEFINE(WNN6) + fi dnl Autodetect canna test -z "$with_canna" && { AC_CHECK_HEADER(canna/RK.h, , with_canna=no) } @@ -2318,25 +2436,41 @@ test -z "$with_canna" && with_canna=yes if test "$with_canna" = "yes"; then AC_DEFINE(HAVE_CANNA) - libs_x="-lcanna -lRKC $libs_x" - extra_objs="$extra_objs mule-canna.o" - fi -else # "$with_mule" = "no" + XE_PREPEND(-lcanna -lRKC, libs_x) + XE_ADD_OBJS(mule-canna.o) + fi +else dnl "$with_mule" = "no" for feature in xim canna wnn; do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then AC_MSG_WARN("--with-${feature} ignored: Not valid without Mule support") fi eval "with_${feature}=no" done -fi +fi dnl with_mule dnl At this point, we know whether we need the motif lib or not. -test "$need_motif" = "yes" && libs_x="-lXm $libs_x" - -AC_CHECK_FUNCS(acosh asinh atanh cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random realpath rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset utimes waitpid) - -test "$ac_cv_func_realpath" = "yes" && extra_objs="$extra_objs realpath.o" +if test "$need_motif" = "yes" ; then + XE_PREPEND(-lXm, libs_x) + XE_COMPUTE_RUNPATH() +fi + +AC_CHECK_FUNCS(acosh asinh atanh 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 strcasecmp strerror tzset utimes waitpid) + +dnl realpath is buggy on linux, decosf and aix4 + +dnl The realpath() in linux libc (4.6.27) sometimes fails with ELOOP. +dnl For example, call realpath on a file thirty-five or so directories deep +dnl and you get ELOOP even if no symlinks at all are involved. +case "$opsys" in + linux* | decosf4-0* | aix4* ) XE_ADD_OBJS(realpath.o) ;; + * ) + AC_CHECK_FUNCS(realpath) + test "$ac_cv_func_realpath" != "yes" && XE_ADD_OBJS(realpath.o) ;; +esac + +dnl mocklisp support - probably should excise it... +test "$with_mocklisp" = "yes" && XE_ADD_OBJS(mocklisp.o) dnl If netdb.h does not declare h_errno, we must declare it by hand. AC_MSG_CHECKING(whether netdb declares h_errno) @@ -2430,7 +2564,7 @@ AC_FUNC_ALLOCA -test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" +test -n "$ALLOCA" && XE_ADD_OBJS($ALLOCA) dnl Check whether vfork exists and works correctly. (This does more dnl than just check for its existence.) If so, it defines HAVE_VFORK_H. @@ -2441,10 +2575,6 @@ dnl than just check for its existence.) If so, it defines HAVE_STRCOLL. AC_FUNC_STRCOLL -AC_CHECK_SIZEOF(short) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(long) - AC_FUNC_MMAP dnl rel_alloc requires either GNU malloc or system malloc with mmap @@ -2497,7 +2627,10 @@ exit 1 fi beta=`sed -ne 's/^.*XEmacs Lucid (beta\([[0-9]][[0-9]]*\)).*$/\1/p' "$file"` -test -n "$beta" && version="${version}-b${beta}" +test -n "$beta" && version="${version}-b${beta}" +AC_DEFINE_UNQUOTED(EMACS_VERSION, $version) +main_1_id="`echo main_1_xemacs_${version}_${canonical} | sed 'y/.-/__/'`" +AC_DEFINE_UNQUOTED(main_1, $main_1_id) dnl Check for sound of various sorts. @@ -2511,7 +2644,8 @@ if test "$with_native_sound" != "no"; then dnl Autodetect Sun native sound from SUNWaudmo package if test -d "/usr/demo/SOUND"; then - sound_found="yes" extra_objs="$extra_objs sunplay.o" + sound_found="yes" + XE_ADD_OBJS(sunplay.o) if test -d "/usr/demo/SOUND/include" then sound_cflags="-I/usr/demo/SOUND/include" else sound_cflags="-I/usr/demo/SOUND" @@ -2527,12 +2661,14 @@ *-sgi-* ) AC_CHECK_LIB(audio, ALopenport, native_sound_lib="-laudio") if test "$native_sound_lib" = "-laudio"; then - sound_found="yes" extra_objs="$extra_objs sgiplay.o" sound_cflags="" + sound_found="yes" sound_cflags="" + XE_ADD_OBJS(sgiplay.o) fi ;; hppa*-hp-hpux* ) AC_CHECK_LIB(Alib, AOpenAudio, native_sound_lib="-lAlib") if test "$native_sound_lib" = "-lAlib"; then - sound_found="yes" extra_objs="$extra_objs hpplay.o" + sound_found="yes" + XE_ADD_OBJS(hpplay.o) if test "$with_gcc" = "yes" # Kludge city then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples" else sound_cflags="+e -I/usr/audio/examples" @@ -2545,7 +2681,7 @@ for dir in "machine" "sys" "linux"; do AC_CHECK_HEADER(${dir}/soundcard.h, sound_found=yes - extra_objs="$extra_objs linuxplay.o" + XE_ADD_OBJS(linuxplay.o) [AC_DEFINE_UNQUOTED(SOUNDCARD_H_PATH, "${dir}/soundcard.h")] break) done @@ -2562,28 +2698,28 @@ if test "$with_native_sound" = "yes"; then AC_DEFINE(HAVE_NATIVE_SOUND) - test -n "$native_sound_lib" && LIBS="$LIBS $native_sound_lib" + test -n "$native_sound_lib" && XE_PREPEND($native_sound_lib, LIBS) fi case "$with_sound" in both | nas ) AC_DEFINE(HAVE_NAS_SOUND) - extra_objs="$extra_objs nas.o" - LIBS="$LIBS -laudio" + XE_ADD_OBJS(nas.o) + XE_PREPEND(-laudio, LIBS) dnl If the nas library does not contain the error jump point, dnl then we force safer behaviour. AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[AC_DEFINE(NAS_NO_ERROR_JUMP)]) esac - +dnl --------------------- dnl TTY-dependent options - - -AC_CHECKING("how to do terminal I/O") +dnl --------------------- test -z "$with_tty" && with_tty=yes if test "$with_tty" = "yes" ; then + AC_CHECKING(for TTY-related features) AC_DEFINE(HAVE_TTY) + XE_ADD_OBJS(console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o redisplay-tty.o cm.o) dnl Check for terminal I/O variants dnl TERMIOS systems may have termio.h, but not vice-versa, I think. @@ -2598,20 +2734,20 @@ test -z "$with_gpm" && { AC_CHECK_LIB(gpm, connect_to_gpm, with_gpm=yes, with_gpm=no) } if test "$with_gpm" = "yes"; then AC_DEFINE(HAVE_GPM) - extra_objs="$extra_objs gpmevent.o" - LIBS="$LIBS -lgpm" + XE_ADD_OBJS(gpmevent.o) + XE_PREPEND(-lgpm, LIBS) fi dnl Autodetect ncurses. if test -z "$with_ncurses"; then - AC_CHECK_LIB(ncurses, tparm, with_ncurses=yes, with_ncurses=no) + AC_CHECK_LIB(ncurses, tgetent, with_ncurses=yes, with_ncurses=no) fi if test "$with_ncurses" = "yes"; then AC_DEFINE(HAVE_NCURSES) AC_CHECK_HEADER(ncurses/curses.h, curses_h_path=ncurses/curses.h) AC_CHECK_HEADER(ncurses/term.h, term_h_path=ncurses/term.h) - extra_objs="$extra_objs terminfo.o" - LIBS="$LIBS -lncurses" + XE_ADD_OBJS(terminfo.o) + XE_PREPEND(-lncurses, LIBS) if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then dnl Try again, and check for the bogus ncurses/ include bug. @@ -2626,37 +2762,41 @@ fi fi else dnl "$with_ncurses" = "no" - dnl Autodetect terminfo/-ltermlib/-ltermcap/-lcurses - AC_CHECK_LIB(termlib, tgoto, have_libtermlib=yes, have_libtermlib=no) - AC_CHECK_LIB(termcap, tgoto, have_libtermcap=yes, have_libtermcap=no) - AC_CHECK_LIB(curses, tparm, have_libcurses=yes, have_libcurses=no) - + dnl Autodetect terminfo/-lcurses/-ltermlib/-ltermcap if test "$have_terminfo" = "yes"; then - extra_objs="$extra_objs terminfo.o" - if test -n "$libs_termcap"; then LIBS="$LIBS $libs_termcap" - elif test "$have_libcurses" = "yes"; then LIBS="$LIBS -lcurses" - elif test "$have_libtermlib" = "yes"; then LIBS="$LIBS -ltermlib" - elif test "$have_libtermcap" = "yes"; then LIBS="$LIBS -ltermcap" - fi + XE_ADD_OBJS(terminfo.o) + if test -n "$libs_termcap"; then + XE_PREPEND($libs_termcap, LIBS) + else + for lib in curses termlib termcap; do + AC_CHECK_LIB($lib, tgetent, [XE_PREPEND(-l${lib}, LIBS)]; break) + done + fi else dnl "$have_terminfo" = "no" && "with_ncurses" = "no" - extra_objs="$extra_objs tparam.o" - if test -n "$libs_termcap"; then LIBS="$LIBS $libs_termcap" - elif test "$have_libtermcap" = "yes"; then LIBS="$LIBS -ltermcap" - elif test "$have_libcurses" = "yes"; then LIBS="$LIBS -lcurses" - else extra_objs="$extra_objs termcap.o" + XE_ADD_OBJS(tparam.o) + dnl The HP-UX curses library seems to have a badly broken version of select(2) + dnl that makes "poll: interrupted system call" messages to appear and + dnl Emacs suprocesses to hang (e.g. TeX compilation w/ AUCTeX) */ + case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac + if test -n "$libs_termcap"; then + XE_PREPEND($libs_termcap, LIBS) + else + AC_CHECK_LIB(curses, tgetent, [XE_PREPEND(-lcurses, LIBS)],[ + AC_CHECK_LIB(termcap, tgetent, [XE_PREPEND(-ltermcap, LIBS)], [ + XE_ADD_OBJS(termcap.o)])]) fi fi fi AC_DEFINE_UNQUOTED(CURSES_H_PATH, "${curses_h_path-curses.h}") AC_DEFINE_UNQUOTED(TERM_H_PATH, "${term_h_path-term.h}") -else # "$with_tty" = "no" +else dnl "$with_tty" = "no" for feature in ncurses gpm; do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then AC_MSG_WARN("--with-${feature} ignored: Not valid without TTY support") fi eval "with_${feature}=no" done -fi +fi dnl with_tty dnl Database support dnl <mdiers@logware.de> @@ -2670,27 +2810,27 @@ AC_CHECKING(for database support) -if test "$with_database_gnudbm" != "no" ; then +if test "$with_database_gnudbm" != "no"; then AC_CHECK_LIB(gdbm, dbm_open, with_database_gnudbm=yes have_libgdbm=yes) if test "$with_database_gnudbm" != "yes"; then AC_CHECK_FUNC(dbm_open, with_database_gnudbm=yes) fi - if test "$with_database_gnudbm" = "yes" ; then + if test "$with_database_gnudbm" = "yes"; then AC_DEFINE(HAVE_DBM) - test "$have_libgdbm" = "yes" && LIBS="$LIBS -lgdbm" + test "$have_libgdbm" = "yes" && XE_PREPEND(-lgdbm, LIBS) with_database_dbm=no else with_database_gnudbm=no fi fi -if test "$with_database_dbm" != "no" ; then +if test "$with_database_dbm" != "no"; then AC_CHECK_FUNC(dbm_open, with_database_dbm=yes need_libdbm=no) if test "$need_libdbm" != "no"; then AC_CHECK_LIB(dbm, dbm_open, with_database_dbm=yes need_libdbm=yes) fi - if test "$with_database_dbm" = "yes" ; then + if test "$with_database_dbm" = "yes"; then AC_DEFINE(HAVE_DBM) - test "$need_libdbm" = "yes" && LIBS="$LIBS -ldbm" + test "$need_libdbm" = "yes" && XE_PREPEND(-ldbm, LIBS) else with_database_dbm=no fi fi @@ -2720,7 +2860,7 @@ if test "$with_database_berkdb" = "yes"; then AC_DEFINE_UNQUOTED(DB_H_PATH, "$db_h_path") AC_DEFINE(HAVE_BERKELEY_DB) - test "$need_libdb" = "yes" && LIBS="$LIBS -ldb" + test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS) else with_database_berkdb=no fi fi @@ -2729,7 +2869,7 @@ "$with_database_dbm" = "yes" -o \ "$with_database_berkdb" = "yes"; then AC_DEFINE(HAVE_DATABASE) - extra_objs="$extra_objs database.o" + XE_ADD_OBJS(database.o) fi dnl Socks support @@ -2741,72 +2881,7 @@ dnl Usage tracking (undocumented and likely unused option) if test "$usage_tracking" = "yes"; then AC_DEFINE(USAGE_TRACKING) - LIBS="$LIBS -Bstatic -lut -Bdynamic" -fi - -dnl ------------------------------------- -dnl Compute runtime library path -dnl ------------------------------------- - -if test "$dynamic" = "no"; then add_runtime_path=no -elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes -else case "$canonical" in - *-solaris2.* | *-sgi-irix* ) add_runtime_path=yes ;; - * ) add_runtime_path=no ;; - esac -fi - -if test "$add_runtime_path" = "yes"; then - dnl Try to autodetect runtime library flag (usually -R), - dnl and whether it works (or at least does no harm) - AC_MSG_CHECKING("for runtime libraries flag") - dash_r="" - for try_dash_r in "-R" "-R " "-rpath "; do - xe_check_libs="${try_dash_r}/no/such/file-or-directory" - AC_TRY_LINK(, , dash_r="$try_dash_r") - xe_check_libs="" - test -n "$dash_r" && break - done - if test -n "$dash_r"; - then AC_MSG_RESULT("\"${dash_r}\"") - else AC_MSG_RESULT(NONE) - fi -fi - -if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then - dnl Remove runtime paths from current ld switches - ld_switch_site="`echo $ld_switch_site | sed \"s/${dash_r}[[^ ]]*//\"`" - ld_switch_x_site="`echo $ld_switch_x_site | sed \"s/${dash_r}[[^ ]]*//\"`" - dnl PRINT_VAR(ld_switch_site, ld_switch_x_site) - - dnl Fix up Runtime path - dnl If LD_RUN_PATH is set in environment, use that. - dnl In this case, assume user has set the right value. - if test -n "$LD_RUN_PATH"; then - runpath="$LD_RUN_PATH" - else - dnl Add all directories with .so files to runpath - runpath="" - for arg in $ld_switch_site $ld_switch_x_site; do - case "$arg" in -L* ) - dir=`echo $arg | sed 's/^-L//'` - if test -n "`ls ${dir}/*.so 2>/dev/null`"; then - test -n "$runpath" && runpath="${runpath}:" - runpath="${runpath}${dir}" - fi - ;; - esac - done - dnl Sometimes /opt/SUNWdt/lib is the only installed Motif available - case "$canonical" in *-solaris2.* ) - test "$have_motif" = "yes" && runpath="${runpath}:/opt/SUNWdt/lib" ;; - esac - fi - - if test -n "$runpath"; then - ld_switch_site="$ld_switch_site ${dash_r}${runpath}" - test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" - fi + XE_PREPEND(-Bstatic -lut -Bdynamic, LIBS) fi dnl -------------------------------- @@ -2816,17 +2891,22 @@ c_switch_general="-DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system" c_switch_window_system="$c_switch_x_site $X_CFLAGS" c_switch_all="$c_switch_general $c_switch_window_system" -ld_switch_general="$ld_switch_site $ld_switch_machine $ld_switch_system" +ld_switch_general="$ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run" ld_switch_window_system="$ld_switch_x_site" ld_switch_all="$ld_switch_general $ld_switch_window_system" ld_libs_general="$LIBS $libs_machine $libs_system $libs_standard" ld_libs_window_system="$X_PRE_LIBS $libs_x $X_EXTRA_LIBS" ld_libs_all="$ld_libs_window_system $ld_libs_general" -dnl Compute lists of Makefiles +dnl Compute lists of Makefiles and subdirs +SRC_SUBDIR_DEPS="$MAKE_SUBDIR" +AC_SUBST(SRC_SUBDIR_DEPS) +XE_APPEND(src, MAKE_SUBDIR) internal_makefile_list="Makefile" SUBDIR_MAKEFILES='' +test -d lock || mkdir lock for dir in $MAKE_SUBDIR; do + test -d "$dir" || mkdir "$dir" SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $dir/Makefile" internal_makefile_list="$internal_makefile_list $dir/Makefile.in" done @@ -2834,14 +2914,34 @@ AC_SUBST(SUBDIR_MAKEFILES) if test "$extra_verbose" = "yes"; then - echo "" - PRINT_VAR(extra_objs, - c_switch_general, c_switch_window_system, c_switch_all, - ld_switch_general, ld_switch_window_system, ld_switch_all, + echo "" + PRINT_VAR(extra_objs, + c_switch_general, c_switch_window_system, c_switch_all, + ld_switch_general, ld_switch_window_system, ld_switch_all, ld_libs_general, ld_libs_window_system, ld_libs_all) echo "" fi +dnl Create some auxiliary files +if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then + echo "creating src/gdbinit" + echo "source $srcdir/src/gdbinit" > src/gdbinit +fi + +dnl Create top level .sbinit for Sun compilers +AC_TRY_COMPILE([],[#ifndef __SUNPRO_C +#error No Sun source browser capability +#endif +],[echo "creating .sbinit" +( echo "# For use with Sun WorkShop's Source browser." + echo "# See sbquery(1) and sbinit(4) for more information" + for dir in $MAKE_SUBDIR; do echo "import $dir"; done +) > .sbinit +]) + +dnl There are no more compile tests; remove the core they created. +rm -f core + dnl ------------------------------------- dnl Substitute into Makefile and config.h dnl ------------------------------------- @@ -2901,11 +3001,9 @@ AC_SUBST(RANLIB) AC_SUBST(dynodump_arch) -AC_DEFINE_UNQUOTED(EMACS_VERSION, $version) AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "$canonical") AC_DEFINE_UNQUOTED(config_machfile, "$machfile") AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile") -AC_DEFINE_UNQUOTED(UNEXEC_SRC, $UNEXEC_SRC) dnl Following are deprecated @@ -3003,7 +3101,15 @@ fi test "$with_gif" = yes && echo " Compiling in support for GIF image conversion." -test "$with_xpm" = yes && echo " Compiling in support for XPM images." +if test "$with_xpm" = yes; then + echo " Compiling in support for XPM images." +else + echo " --------------------------------------------------------------------" + echo " WARNING: Compiling without XPM support." + echo " WARNING: You should strongly considering installing XPM." + echo " WARNING: Otherwise toolbars and other graphics will look suboptimal." + echo " --------------------------------------------------------------------" +fi test "$with_xface" = yes && echo " Compiling in support for X-Face message headers." test "$with_jpeg" = yes && echo " Compiling in support for JPEG image conversion." test "$with_png" = yes && echo " Compiling in support for PNG image conversion." @@ -3030,7 +3136,7 @@ test "$with_canna" = yes && echo " Compiling in support for Canna on Mule." if test "$with_wnn" = yes; then echo " Compiling in support for the WNN input method on Mule." - test "$with_wnn6" = yes && echo " WNN support for version 6." + test "$with_wnn6" = yes && echo " Using WNN version 6." fi test "$with_i18n3" = yes && echo " Compiling in I18N support, level 3 (doesn't currently work)." @@ -3066,9 +3172,17 @@ test "$debug" = yes && echo " Compiling in extra code for debugging." test "$memory_usage_stats" = yes && echo " Compiling in code for checking XEmacs memory usage." test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." +if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \ + != "no no no no no"; then + echo " WARNING: ---------------------------------------------------------" + echo " WARNING: Compiling in support for runtime error checking." + echo " WARNING: XEmacs will run noticeably more slowly as a result." + echo " WARNING: Error checking is on by default for XEmacs beta releases." + echo " WARNING: ---------------------------------------------------------" +fi echo "" ) | tee -a Installation -echo 'The above configure report is appended to "Installation" file.' +echo "The above configure report is appended to \"Installation\" file." echo "" dnl ----------------------------------- @@ -3089,7 +3203,7 @@ AC_OUTPUT($internal_makefile_list,[ for dir in $MAKE_SUBDIR; do echo creating $dir/Makefile - ( set -e + ( cd $dir rm -f junk.c sed -e 's/^# Generated.*//' -e 's%/\*\*/#.*%%' < Makefile.in > junk.c; @@ -3104,7 +3218,6 @@ mv -f Makefile.new Makefile rm -f junk.c junk.cpp ) - test "$?" != 0 && exit "$?" # For debugging done ], [CPP="$CPP" @@ -3112,19 +3225,3 @@ top_srcdir="$srcdir" MAKE_SUBDIR="$MAKE_SUBDIR" ]) - -if test ! -f src/gdbinit && test -f $topsrcdir/src/gdbinit; then - echo "creating src/gdbinit" - echo "source $topsrcdir/src/gdbinit" > src/gdbinit -fi - -if test "$sunpro_c" = "yes"; then dnl create useful .sbinit file - cat < EOF > .sbinit -# For use with Sun WorkShop's Source browser. -# See sbquery(1) and sbinit(4) for more information -import src -import lwlib -import lib-src -import dynodump -EOF -fi
--- a/dynodump/Makefile.in.in Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* Hey Emacs, this is a -*- Makefile -*- */ - -/* Makefile for dynodump subdirectory in XEmacs - Copyright (C) 1995 Board of Trustees, University of Illinois - -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. */ - -/* Avoid trouble on systems where the "SHELL" variable might be - inherited from the environment. */ -SHELL = /bin/sh - -/* Some people use these in paths they define. We do not want their paths - getting changed on them. */ -#undef sparc -#undef sun -#undef unix -#undef i386 -#undef ppc -#undef sgi - -/* ==================== Things "configure" will edit ==================== */ - -CC=@CC@ -CFLAGS=@CFLAGS@ -ARCH=@dynodump_arch@ - -/* Where to find the source code. This is set by the configure - "--srcdir" option. However, the value of ${srcdir} in - this makefile is not identical to what was specified with --srcdir, - since the variable here has "/dynodump" added at the end. */ -srcdir=@srcdir@ - -/* ========================= start of cpp stuff ========================= */ - -#define NO_SHORTNAMES -#define THIS_IS_YMAKEFILE -#define NOT_C_CODE -#include "../src/config.h" - -/* With the traditional VPATH setting, it is not possible to - simultaneously compile in-place and in another directory. The - mistaken definition is that *all* dependencies are searched for in - the VPATH directory, rather than just the dependencies that are not - themselves targets. Thus, if there is an up-to-date .o file in the - in-place location, it will not get recompiled in the not-in-place - location. - - The GNU Make "vpath" directive continues this tradition, but at - least lets you to restrict the classes of files that it applies to. - This allows us to kludge around the problem. */ -#ifdef USE_GNU_MAKE -vpath %.c @srcdir@ -vpath %.h @srcdir@ -/* now list files that should NOT be searched in the srcdir. - This includes any .c or .h that is built from something else - (e.g. a .in file). */ -/* none here */ -#else -VPATH=@srcdir@ -#endif - -#ifdef USE_GCC -# define PIC_ARG -fpic -#else -# define PIC_ARG -K pic -#endif - -INCLUDES = -I${srcdir} -I${srcdir}/$(ARCH) -ALL_CFLAGS = ${CFLAGS} PIC_ARG ${INCLUDES} -OBJS = _relocate.o dynodump.o syms.o uninit.o - -.c.o: - $(CC) -c $(ALL_CFLAGS) $< - -/* If we do not need dynodump, then do nothing. */ -#ifdef DYNODUMP -all:: dynodump.so -#else -all:: -#endif - -dynodump.so: ${srcdir}/_dynodump.h $(OBJS) - PATH=/usr/ccs/bin:/bin:$$PATH ld -o dynodump.so -G $(OBJS) -lelf -lmapmalloc - -_relocate.o: ${srcdir}/$(ARCH)/_relocate.c - $(CC) -c $(ALL_CFLAGS) ${srcdir}/$(ARCH)/_relocate.c - -uninit.o: ${srcdir}/$(ARCH)/uninit.c - $(CC) -c $(ALL_CFLAGS) ${srcdir}/$(ARCH)/uninit.c - -mostlyclean: - -rm -f *.o \#* - -clean: mostlyclean - -rm -f *.so *.so.1 - -distclean: clean - -rm -f Makefile Makefile.in - -realclean: distclean - rm -f TAGS - -versionclean: - true - -extraclean: realclean - -rm -f *~ \#*
--- a/dynodump/README Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ - DYNODUMP - -------- - -Dynodump, not to be confused with DinoTurd (as seen in Jurassic Park), -is a shared object that provides one function: - - int dynodump(char *new_file); - -dynodump(), called from a running program will write a new executable -in new_file a la unexec() in GNU Emacs. The difference lies in the -relocations. - -dynodump() will create an image with any relocations (which were -performed by the run-time dynamic linker) undone. This allows the new -image to be run in a different environment. There is, however, one -potentially major caveat. If a symbol reference gets updated during -the running of the calling program, its updated value will be lost. -An example (with additional blank lines for legibility): - - $ cat lib.c - char _foo[] = "hello"; - char _bar[] = "world"; - - $ cc -G -o lib.so lib.c - - $ cat prog.c - extern char _foo, _bar; - - int beenhere = 0; - char * foo = &_foo; - char * bar = &_bar; - - int - main(void) - { - (void) printf("%d: foo = %x\n", beenhere, foo); - (void) printf("%d: bar = %x, ", beenhere, bar); - - if (!beenhere) { - beenhere = 1; - bar++; - dynodump("newfile"); - } - (void) printf("%x\n", bar); - } - - $ cc -o prog prog.c -R. lib.so dynodump.so - - $ ./prog - 0: foo = ef7503cc - 0: bar = ef7503d2, ef7503d3 - - $ ./newfile - 1: foo = ef7503cc - 1: bar = ef7503d2, ef7503d2 - -Notice that in the run of newfile, bar points at "world" instead of -the perhaps expected "orld". - -Dynodump supports sparc, intel, and power pc architectures. - -Dynodump is buildable with GNU make and gcc. If it works for you -with these tools, let me know. - -unexec() --------- - -Also supplied is an unexsol2.c which belongs in the XEmacs src -directory with the other unex*.c files. The src/s/sol2.h should be -have the following added to it: - - #ifdef UNEXEC - #undef UNEXEC - #endif - #define UNEXEC unexsol2.o - -This unexec() will attempt to dlopen() the dynodump.so to find the -dynodump function. The default is "../dynodump/dynodump.so" which -should be appropriate for the typical XEmacs build (unless you used -configure to set up separate build and source trees). You may change -it by setting the DYNODUMP environment variable to the full path of -the dynodump shared object. - -Other notes: - -If you're using the 4.0 C compiler from Sun, you should arrange to -shut off the incremental linker. This is done with the -xildoff -option to the compiler. The common.mk and testsuite/Makefile files -have commentary and ready made lines for uncommenting for this -purpose. - -If you're interested in playing with the UltraSPARC specific options -to the aforementioned compiler, then the same makefiles have some -commentary and flags settings to point you in that direction. - -Questions: - -dynodump() was developed by Rod.Evans@Eng.Sun.COM and -Georg.Nikodym@Canada.Sun.COM. If you have questions, feel free to ask -them but be aware that Rod, "don't know jack about emacs." -
--- a/dynodump/_dynodump.h Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#pragma ident "@(#) $Id: _dynodump.h,v 1.1.1.1 1996/12/18 22:42:15 steve Exp $ - SMI" - -#ifndef _DYNODUMP_DOT_H -#define _DYNODUMP_DOT_H - -#include <libelf.h> -#include "machdep.h" - -/* General rounding macro */ -#define S_ROUND(x, a) (((int)(x) + (((int)(a) ? (int)(a) : 1) - 1)) & \ - ~(((int)(a) ? (int)(a) : 1) - 1)) - -/* - * Define a cache structure that is used to retain all elf section information. - */ -typedef struct cache { - Elf_Scn *c_scn; - Shdr *c_shdr; - Elf_Data *c_data; - char *c_name; -} Cache; - -/* - * Define any local prototypes. - */ -extern void update_dynamic(Cache *); -extern void update_reloc(Cache *, Cache *, Cache *, Cache *, Half shnum); -extern void update_sym(Cache *, Cache *, Addr); -extern void dynodump_uninit(void); - -#endif
--- a/dynodump/dynodump.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,559 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * dynodump(3x) dumps a running executable into a specified ELF file. The new - * file consists of the memory contents of the original file together with any - * heap. This heap is assigned to a new `.heap' section within the new file. - * - * The new file may be re-executed, and will contain any data modifications - * made to the original image up until the time dynodump(3x) was called. - * - * The original image may have undergone relocations (performed by ld.so.1) - * prior to control being transferred to the image. These relocations will - * reside as the data copied from the image. To prevent subsequent executions - * of the new image from undergoing the same relocations, any relocation entries - * (besides copy or jump slot relocations) are nulled out. Note that copy - * relocations such as required for __iob must be reinitialized each time the - * process starts, so it is not sufficient to simply null out the .dynamic - * sections relocation information. The effect of this is that if the new - * image was bound to definitions in any shared object dependencies, then these - * dependencies *must* reside in the same location as when dynodump(3x) was - * called. Any changes to the shared object dependencies of the new image, or - * uses of such things as LD_PRELOAD, may result in the bindings encoded in the - * image becoming invalid. - * - * The following flags modify the data of the image created: - * - * RTLD_SAVREL save the original relocation data. Under this option any - * relocation offset is reset to contain the same data as was - * found in the images original file. - * - * This option allows relocation information to be retained in the - * new image so that it may be re-executed when the new image is - * run. This allows far greater flexibility as the new image can - * now take advantage of new shared objects. - * - * Note. under this mechanism, any data item that undergoes - * relocation and is then further modified during the execution of - * the image before dynodump(3x) is called will lose the - * modification that occured during the applications execution. - * - * N.B. The above commentary is not quite correct in the flags have been hardwired - * to RTLD_SAVREL. - */ -#pragma ident "@(#) $Id: dynodump.c,v 1.1.1.2 1996/12/21 20:44:43 steve Exp $ - SMI" - -#define __EXTENSIONS__ -#include <sys/param.h> -#include <sys/procfs.h> -#include <fcntl.h> -#include <stdio.h> -#include <libelf.h> -#include <link.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <errno.h> -#include <malloc.h> -#include "machdep.h" -#include "_dynodump.h" - -/* - * Generic elf error message generator - */ -static int -elferr(const char * str) -{ - fprintf(stderr, "%s: %s\n", str, elf_errmsg(elf_errno())); - return (1); -} - -int dynodump (const char * file); -int -dynodump(const char * file) -{ - Elf *ielf, *oelf; - Ehdr *iehdr, *oehdr; - Phdr *iphdr, *ophdr, *data_phdr = 0; - Cache *icache, *ocache, *_icache, *_ocache; - Cache *data_cache = 0, *shstr_cache = 0; - Cache *heap_cache = 0; - Word heap_sz = 0; - Elf_Scn *scn; - Shdr *shdr; - Elf_Data *data, rundata; - Half ndx, _ndx; - int fd, _fd; - Addr edata, _addr; - char *istrs, *ostrs, *_ostrs, proc[16]; - const char heap[] = ".heap"; - prstatus_t pstat; - - /* make a call to the processor specific un-init stuff */ - dynodump_uninit(); - - /* - * Obtain a file descriptor for this process, - * for the executable and get a prstatus_t - * structure. - */ - sprintf(proc, "/proc/%ld", getpid()); - if (((_fd = open(proc, O_RDONLY, 0)) == -1) || - ((fd = ioctl(_fd, PIOCOPENM, (void *)0)) == -1) || - (ioctl(_fd, PIOCSTATUS, &pstat) == -1)) { - fprintf(stderr, "/proc: initialization error: %s\n", - strerror(errno)); - close(_fd); - return (1); - } - close(_fd); - - /* - * Initialize with the ELF library and make sure this is an executable - * ELF file we're dealing with. - */ - elf_version(EV_CURRENT); - if ((ielf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - close(fd); - return (elferr("elf_begin")); - } - close(fd); - - if ((elf_kind(ielf) != ELF_K_ELF) || - ((iehdr = elf_getehdr(ielf)) == NULL) || - (iehdr->e_type != ET_EXEC)) { - fprintf(stderr, "image is not an ELF executable\n"); - elf_end(ielf); - return (1); - } - /* - * Elf_elf_header(iehdr); - */ - - /* - * Create the new output file. - */ - if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC, 0777)) == -1) { - fprintf(stderr, "%s: open failed: %s\n", file, - strerror(errno)); - elf_end(ielf); - return (1); - } - if ((oelf = elf_begin(fd, ELF_C_WRITE, NULL)) == NULL) { - elf_end(ielf); - close(fd); - return (elferr("elf_begin")); - } - - /* - * Obtain the input program headers. Remember the data segments - * program header entry as this will be updated later to reflect the - * new .heap sections size. - */ - if ((iphdr = elf_getphdr(ielf)) == NULL) - return (elferr("elf_getphdr")); - - for (ndx = 0, ophdr = iphdr; ndx != iehdr->e_phnum; ndx++, ophdr++) { - /* - * Save the program header that contains the NOBITS section, or - * the last loadable program header if no NOBITS exists. - * A NOBITS section translates to a memory size requirement that - * is greater than the file data it is mapped from. - */ - if (ophdr->p_type == PT_LOAD) { - if (ophdr->p_filesz != ophdr->p_memsz) - data_phdr = ophdr; - else if (data_phdr) { - if (data_phdr->p_vaddr < ophdr->p_vaddr) - data_phdr = ophdr; - } else - data_phdr = ophdr; - } - } - if (data_phdr == 0) { - fprintf(stderr, "no data segment found!\n"); - return (0); - } - - /* - * Obtain the input files section header string table. - */ - if ((scn = elf_getscn(ielf, iehdr->e_shstrndx)) == NULL) - return (elferr("elf_getscn")); - if ((data = elf_getdata(scn, NULL)) == NULL) - return (elferr("elf_getdata")); - istrs = data->d_buf; - - /* - * Construct a cache to maintain the input files section information. - */ - if ((icache = (Cache *) malloc(iehdr->e_shnum * sizeof (Cache))) == 0) { - fprintf(stderr, "malloc failed: %s\n", strerror(errno)); - return (1); - } - _icache = icache; - _icache++; - - /* - * Traverse each section from the input file. - */ - for (ndx = 1, scn = 0; - (_icache->c_scn = elf_nextscn(ielf, scn)); - ndx++, scn = _icache->c_scn, _icache++) { - - if ((_icache->c_shdr = shdr = elf_getshdr(_icache->c_scn)) == NULL) - return (elferr("elf_getshdr")); - - if ((_icache->c_data = elf_getdata(_icache->c_scn, NULL)) == NULL) - return (elferr("elf_getdata")); - - _icache->c_name = istrs + (size_t)(shdr->sh_name); - - /* - * For each section that has a virtual address reestablish the - * data buffer to point to the memory image. - * - * if (shdr->sh_addr) - * _icache->c_data->d_buf = (void *)shdr->sh_addr; - */ - - /* - * Remember the last section of the data segment, the new .heap - * section will be added after this section. - * If we already have one, then set data_cache to the previous - * section and set heap_cache to this one. - */ - if ((shdr->sh_addr + shdr->sh_size) - == (data_phdr->p_vaddr + data_phdr->p_memsz)) { - if (strcmp(_icache->c_name, heap) == 0) { -#ifdef DEBUG - printf("Found a previous .heap section\n"); -#endif - data_cache = _icache - 1; - heap_cache = _icache; - heap_sz = shdr->sh_size; - } else { - data_cache = _icache; - } - } - - /* - * Remember the section header string table as this will be - * rewritten with the new .heap name. - */ - if ((shdr->sh_type == SHT_STRTAB) && - ((strcmp(_icache->c_name, ".shstrtab")) == 0)) - shstr_cache = _icache; - } - if (data_cache == 0) { - fprintf(stderr, "final data section not found!\n"); - return (0); - } - - /* - * Determine the new .heap section to create. - */ - rundata.d_buf = (void *)(data_cache->c_shdr->sh_addr + - data_cache->c_shdr->sh_size); - rundata.d_size = (int)sbrk(0) - (int)rundata.d_buf; - rundata.d_type = ELF_T_BYTE; - rundata.d_off = 0; - rundata.d_align = 1; - rundata.d_version = EV_CURRENT; - - /* - * From the new data buffer determine the new value for _end and _edata. - * This will also be used to update the data segment program header. - * - * If we had a .heap section, then its size is part of the program - * headers notion of data size. Because we're only going to output one - * heap section (ignoring the one in the running binary) we need to - * subract the size of that which we're ignoring. - */ - if (heap_cache) { - edata = S_ROUND((data_phdr->p_vaddr - + data_phdr->p_memsz - - heap_sz), rundata.d_align) + rundata.d_size; - } else { - edata = S_ROUND((data_phdr->p_vaddr + data_phdr->p_memsz), - rundata.d_align) + rundata.d_size; - } - - /* - * We're now ready to construct the new elf image. - * - * Obtain a new elf header and initialize it with any basic information - * that isn't calculated as part of elf_update(). Bump the section - * header string table index to account for the .heap section we'll be - * adding. - */ - if ((oehdr = elf_newehdr(oelf)) == NULL) - return (elferr("elf_newehdr")); - - oehdr->e_entry = iehdr->e_entry; - oehdr->e_machine = iehdr->e_machine; - oehdr->e_type = iehdr->e_type; - oehdr->e_flags = iehdr->e_flags; - /* - * If we already have a heap section, we don't need any adjustment - */ - if (heap_cache) - oehdr->e_shstrndx = iehdr->e_shstrndx; - else - oehdr->e_shstrndx = iehdr->e_shstrndx + 1; - -#ifdef DEBUG - printf("iehdr->e_flags = %x\n", iehdr->e_flags); - printf("iehdr->e_entry = %x\n", iehdr->e_entry); - printf("iehdr->e_shstrndx= %d\n", iehdr->e_shstrndx); - printf("iehdr->e_machine = %d\n", iehdr->e_machine); - printf("iehdr->e_type = 0x%x\n", iehdr->e_type); - printf("oehdr->e_machine = %d\n", oehdr->e_machine); - printf("oehdr->e_type = 0x%x\n", oehdr->e_type); -#endif - - /* - * Obtain a new set of program headers. Initialize these with the same - * information as the input program headers and update the data segment - * to reflect the new .heap section. - */ - if ((ophdr = elf_newphdr(oelf, iehdr->e_phnum)) == NULL) - return (elferr("elf_newphdr")); - - for (ndx = 0; ndx != iehdr->e_phnum; ndx++, iphdr++, ophdr++) { - *ophdr = *iphdr; - if (data_phdr == iphdr) - ophdr->p_filesz = ophdr->p_memsz = edata - ophdr->p_vaddr; - } - - /* - * Obtain a new set of sections. - */ - _icache = icache; - _icache++; - for (ndx = 1; ndx != iehdr->e_shnum; ndx++, _icache++) { - /* - * Skip the heap section of the running executable - */ - if (_icache == heap_cache) - continue; - /* - * Create a matching section header in the output file. - */ - if ((scn = elf_newscn(oelf)) == NULL) - return (elferr("elf_newscn")); - if ((shdr = elf_getshdr(scn)) == NULL) - return (elferr("elf_getshdr")); - *shdr = *_icache->c_shdr; - - /* - * Create a matching data buffer for this section. - */ - if ((data = elf_newdata(scn)) == NULL) - return (elferr("elf_newdata")); - *data = *_icache->c_data; - - /* - * For each section that has a virtual address reestablish the - * data buffer to point to the memory image. Note, we skip - * the plt section. - */ - if ((shdr->sh_addr) && (!((shdr->sh_type == SHT_PROGBITS) - && (strcmp(_icache->c_name, ".plt") == 0)))) - data->d_buf = (void *)shdr->sh_addr; - - /* - * Update any NOBITS section to indicate that it now contains - * data. - */ - if (shdr->sh_type == SHT_NOBITS) - shdr->sh_type = SHT_PROGBITS; - - /* - * Add the new .heap section after the last section of the - * present data segment. If we had a heap section, then - * this is the section preceding it. - */ - if (data_cache == _icache) { - if ((scn = elf_newscn(oelf)) == NULL) - return (elferr("elf_newscn")); - if ((shdr = elf_getshdr(scn)) == NULL) - return (elferr("elf_getshdr")); - shdr->sh_type = SHT_PROGBITS; - shdr->sh_flags = SHF_ALLOC | SHF_WRITE; - - if ((data = elf_newdata(scn)) == NULL) - return (elferr("elf_newdata")); - *data = rundata; - } - - /* - * Update the section header string table size to reflect the - * new section name (only if we didn't already have a heap). - */ - if (!heap_cache) { - if (shstr_cache && (shstr_cache == _icache)) { - data->d_size += sizeof (heap); - } - } - } - - /* - * Write out the new image, and obtain a new elf descriptor that will - * allow us to write to the new image. - */ - if (elf_update(oelf, ELF_C_WRITE) == -1) - return (elferr("elf_update")); - elf_end(oelf); - if ((oelf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) - return (elferr("elf_begin")); - if ((oehdr = elf_getehdr(oelf)) == NULL) - return (elferr("elf_getehdr")); - - /* - * Obtain the output files section header string table. - */ - if ((scn = elf_getscn(oelf, oehdr->e_shstrndx)) == NULL) - return (elferr("elf_getscn")); - if ((data = elf_getdata(scn, NULL)) == NULL) - return (elferr("elf_getdata")); - ostrs = _ostrs = data->d_buf; - *_ostrs++ = '\0'; - - /* - * Construct a cache to maintain the output files section information. - */ - if ((ocache = (Cache *)malloc(oehdr->e_shnum * sizeof (Cache))) == 0) { - fprintf(stderr, "malloc failed: %s\n", strerror(errno)); - return (1); - } - _ocache = ocache; - _ocache++; - _icache = icache; - _icache++; - - /* - * Traverse each section from the input file rebuilding the section - * header string table as we go. - */ - _ndx = _addr = 0; - for (ndx = 1, scn = 0; - (_ocache->c_scn = elf_nextscn(oelf, scn)); - ndx++, scn = _ocache->c_scn, _ocache++, _icache++) { - - const char *strs; - - if (_icache == heap_cache) { -#ifdef DEBUG - printf("ignoring .heap section in input\n"); -#endif - _icache++; - } - - if ((_ocache->c_shdr = shdr = - elf_getshdr(_ocache->c_scn)) == NULL) - return (elferr("elf_getshdr")); - if ((_ocache->c_data = - elf_getdata(_ocache->c_scn, NULL)) == NULL) - return (elferr("elf_getdata")); - - /* - * If were inserting the new .heap section, insert the new - * section name and initialize it's virtual address. - */ - if (_addr) { - strs = heap; - shdr->sh_addr = S_ROUND(_addr, shdr->sh_addralign); - _addr = 0; - } else { - strs = istrs + (size_t)(_icache->c_shdr->sh_name); - } - - strcpy(_ostrs, strs); - shdr->sh_name = _ostrs - ostrs; - _ocache->c_name = _ostrs; - _ostrs += strlen(strs) + 1; - - /* - * If we've inserted a new section any later section may need - * their sh_link fields updated. - * If we already had a heap section, then this is not required. - */ - if (!heap_cache) { - if (_ndx) { - if (_ocache->c_shdr->sh_link >= _ndx) - _ocache->c_shdr->sh_link++; - } - } - - /* - * If this is the last section of the original data segment - * determine sufficient information to initialize the new .heap - * section which will be obtained next. - */ - if (data_cache == _icache) { - _ndx = ndx + 1; - _addr = shdr->sh_addr + shdr->sh_size; - _icache--; - data_cache = 0; - } - } - - /* - * Now that we have a complete description of the new image update any - * sections that are required. - * - * o update the value of _edata and _end. - * - * o reset any relocation entries if necessary. - */ - _ocache = &ocache[1]; - _icache = &icache[1]; - for (ndx = 1; ndx < oehdr->e_shnum; ndx++, _ocache++, _icache++) { - if ((_ocache->c_shdr->sh_type == SHT_SYMTAB) || - (_ocache->c_shdr->sh_type == SHT_DYNSYM)) - update_sym(ocache, _ocache, edata); - - if (_ocache->c_shdr->sh_type == M_REL_SHT_TYPE) - update_reloc(ocache, _ocache, icache, _icache, oehdr->e_shnum); - } - - if (elf_update(oelf, ELF_C_WRITE) == -1) - return (elferr("elf_update")); - - elf_end(oelf); - elf_end(ielf); - return (0); -}
--- a/dynodump/i386/_relocate.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#pragma ident "@(#) $Id: _relocate.c,v 1.1.1.1 1996/12/18 22:42:15 steve Exp $ - SMI" - -/* LINTLIBRARY */ - -#include <libelf.h> -#include <string.h> -#include <machdep.h> -#include "_dynodump.h" - -void -update_reloc(Cache *ocache, Cache *_ocache, - Cache *icache, Cache *_icache, - Half shnum) -{ - Shdr *shdr; - Rel *rels; - int reln, cnt; - Cache *orcache, *ircache; - - /* - * Set up to readh the output relocation table. - */ - shdr = _ocache->c_shdr; - rels = (Rel *) _ocache->c_data->d_buf; - reln = shdr->sh_size / shdr->sh_entsize; - - /* - * Determine the section that is being relocated. - */ - orcache = &ocache[shdr->sh_info]; - shdr = _icache->c_shdr; - ircache = &icache[shdr->sh_info]; - - /* - * Determine the section that is being relocated. Note that for this - * stupid architecture the .rel.plt actually contains offsets into the - * .got. - */ - if (strcmp(_ocache->c_name, ".rel.plt")) { - orcache = &ocache[shdr->sh_info]; - shdr = _icache->c_shdr; - ircache = &icache[shdr->sh_info]; - } else { - Half ndx; - Cache * __ocache = ocache; - - for (__ocache++, ndx = 1; ndx != shnum; ndx++, __ocache++) { - if (strcmp(__ocache->c_name, ".got") == 0) { - orcache = __ocache; - ircache = &icache[ndx]; - break; - } - } - } - - /* - * Loop through the relocation table. - */ - for (cnt = 0; cnt < reln; cnt++, rels++) { - unsigned char *iaddr, *oaddr; - Addr off; - unsigned char type = ELF_R_TYPE(rels->r_info); - - /* - * Ignore some relocations as these can be safely carried out - * twice (they simply override any existing data). In fact, - * some relocations like __iob's copy relocation must be carried - * out each time the process restarts, otherwise stdio blows up. - */ - if ((type == R_386_COPY) || (type == R_386_NONE)) - continue; - - /* - * If we are required to restore the relocation location - * to its value prior to relocation, then read the - * location's original contents from the input image and - * copy it to the output image. - */ - off = rels->r_offset - ircache->c_shdr->sh_addr; - iaddr = (unsigned char *) ircache->c_data->d_buf + off; - oaddr = (unsigned char *) orcache->c_data->d_buf + off; - *(unsigned long *) oaddr = *(unsigned long *) iaddr; - } -}
--- a/dynodump/i386/machdep.h Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#pragma ident "@(#) $Id: machdep.h,v 1.1.1.1 1996/12/18 22:42:15 steve Exp $ - SMI" - -/* - * Global include file for all sgs Intel machine dependent macros, constants - * and declarations. - */ -#ifndef MACHDEP_DOT_H -#define MACHDEP_DOT_H - -#include <link.h> -#include <sys/elf_386.h> - -/* - * Make machine class dependent data types transparent to the common code - */ -#define Word Elf32_Word -#define Sword Elf32_Sword -#define Half Elf32_Half -#define Addr Elf32_Addr -#define Off Elf32_Off -#define Byte unsigned char - -#define Ehdr Elf32_Ehdr -#define Shdr Elf32_Shdr -#define Sym Elf32_Sym -#define Rel Elf32_Rel -#define Phdr Elf32_Phdr -#define Dyn Elf32_Dyn -#define Boot Elf32_Boot -#define Verdef Elf32_Verdef -#define Verdaux Elf32_Verdaux -#define Verneed Elf32_Verneed -#define Vernaux Elf32_Vernaux -#define Versym Elf32_Versym - -/* - * Make machine class dependent functions transparent to the common code - */ -#define ELF_R_TYPE ELF32_R_TYPE -#define ELF_R_INFO ELF32_R_INFO -#define ELF_R_SYM ELF32_R_SYM -#define ELF_ST_BIND ELF32_ST_BIND -#define ELF_ST_TYPE ELF32_ST_TYPE -#define ELF_ST_INFO ELF32_ST_INFO -#define elf_fsize elf32_fsize -#define elf_getehdr elf32_getehdr -#define elf_getphdr elf32_getphdr -#define elf_newehdr elf32_newehdr -#define elf_newphdr elf32_newphdr -#define elf_getshdr elf32_getshdr -#define elf_xlatetof elf32_xlatetof -#define elf_xlatetom elf32_xlatetom - -/* - * Make relocation types transparent to the common code - */ -#define M_REL_SHT_TYPE SHT_REL /* section header type */ - -#endif
--- a/dynodump/i386/uninit.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * This is where you put processor specific un-initialization things - * to deal with "initialization idempotency issues". - */ - -void -dynodump_uninit(void) -{ - return; -}
--- a/dynodump/ppc/_relocate.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,269 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#pragma ident "@(#) $Id: _relocate.c,v 1.1.1.1 1996/12/18 22:42:15 steve Exp $ - SMI" - -/* LINTLIBRARY */ - -#include <string.h> -#include <sys/elf_ppc.h> -#include "_dynodump.h" - - -/* - * NOTE: These macros will work reliably only on 32-bit 2's - * complement machines. The type of P in all cases should - * by unsigned char * - */ -#if defined(_BIG_ENDIAN) - -#define GET4(P) ((long)(((unsigned long)(P)[0] << 24) | \ - ((unsigned long)(P)[1] << 16) | \ - ((unsigned long)(P)[2] << 8) | \ - (unsigned long)(P)[3])) -#define PUT4(V, P) { \ - (P)[0] = (unsigned char)((V) >> 24); \ - (P)[1] = (unsigned char)((V) >> 16); \ - (P)[2] = (unsigned char)((V) >> 8); \ - (P)[3] = (unsigned char)(V); \ - } -#define GEThalf(P) ((long) (((unsigned long) (P)[0] << 8) | \ - ((unsigned long) (P)[1]))) -#define GETword(P) GET4(P) -#define PUThalf(V, P) { \ - (P)[0] = ((V) >> 8); \ - (P)[1] = ((V)); \ - } -#define PUTword(V, P) PUT4(V, P) - -#elif defined(_LITTLE_ENDIAN) - -#define GET4(P) ((long)(((unsigned long)(P)[0]) | \ - ((unsigned long)(P)[1] << 8) | \ - ((unsigned long)(P)[2] << 16) | \ - ((unsigned long)(P)[3]) << 24)) -#define PUT4(V, P) { \ - (P)[0] = (unsigned char)(V); \ - (P)[1] = (unsigned char)((V) >> 8); \ - (P)[2] = (unsigned char)((V) >> 16); \ - (P)[3] = (unsigned char)((V) >> 24); \ - } -#define GEThalf(P) ((long) (((unsigned long) (P)[0]) | \ - ((unsigned long) (P)[1] << 8))) -#define GETword(P) GET4(P) -#define PUThalf(V, P) { \ - (P)[0] = (V); \ - (P)[1] = ((V) >> 8); \ - } -#define PUTword(V, P) PUT4(V, P) - -#endif /* defined(_LITTLE_ENDIAN) */ - -/* - * NAME VALUE FIELD CALCULATION - * - * R_PPC_NONE 0 none none - * R_PPC_ADDR32 1 word32 S + A - * R_PPC_ADDR24 2 low24 (S + A) >> 2 - * R_PPC_ADDR16 3 half16 S + A - * R_PPC_ADDR16_LO 4 half16 #lo(S + A) - * R_PPC_ADDR16_HI 5 half16 #hi(S + A) - * R_PPC_ADDR16_HA 6 half16 #ha(S + A) - * R_PPC_ADDR14 7 low14 (S + A) >> 2 - * R_PPC_ADDR14_BRTAKEN 8 low14 (S + A) >> 2 - * R_PPC_ADDR14_BRNTAKEN 9 low14 (S + A) >> 2 - * R_PPC_REL24 10 low24 (S + A - P) >> 2 - * R_PPC_REL14 11 low14 (S + A - P) >> 2 - * R_PPC_REL14_BRTAKEN 12 low14 (S + A - P) >> 2 - * R_PPC_REL14_BRNTAKEN 13 low14 (S + A - P) >> 2 - * R_PPC_GOT16 14 half16 G + A - * R_PPC_GOT16_LO 15 half16 #lo(G + A) - * R_PPC_GOT16_HI 16 half16 #hi(G + A) - * R_PPC_GOT16_HA 17 half16 #ha(G + A) - * R_PPC_PLT24 18 low24 (L + A - P) >> 2 - * R_PPC_COPY 19 none none - * R_PPC_GLOB_DAT 20 word32 S + A - * R_PPC_JMP_SLOT 21 none see below - * R_PPC_RELATIVE 22 word32 B + A - * R_PPC_LOCAL24PC 23 low24 see below - * R_PPC_UADDR32 24 word32 S + A - * R_PPC_UADDR16 25 half16 S + A - * - * This is Figure 4-3: Relocation Types from the Draft Copy of - * the ABI, Printed on 7/25/94. - * - * The field column specifies how much of the data - * at the reference address is to be used. The data are assumed to be - * right-justified with the least significant bit at the right. - * In the case of plt24 addresses, the reference address is - * assumed to be that of a 6-word PLT entry. The address is the right- - * most 24 bits of the third word. - */ -static void -move_reloc(unsigned char *iaddr, unsigned char *oaddr, unsigned char type) -{ - switch(type) { - case R_PPC_NONE: - break; - - case R_PPC_ADDR32: - case R_PPC_UADDR32: - PUTword(GETword(iaddr), oaddr); - break; - - case R_PPC_ADDR24: - case R_PPC_REL24: - case R_PPC_PLT24: - case R_PPC_LOCAL24PC: - /* XXX - big assumption here that the original contents were masked - * properly. If this assumption proves correct, then these 24bit - * cases can be folded into the above 32bit cases. - */ - PUTword(GETword(iaddr), oaddr); - break; - - case R_PPC_ADDR16: - case R_PPC_UADDR16: - case R_PPC_GOT16: - PUThalf(GEThalf(iaddr), oaddr); - break; - - case R_PPC_ADDR16_LO: - case R_PPC_GOT16_LO: - /* XXX - more assumptions which if proved correct, we can - * do some folding with above cases - */ - PUThalf(GEThalf(iaddr), oaddr); - break; - - case R_PPC_ADDR16_HI: - case R_PPC_GOT16_HI: - /* XXX - more assumptions which if proved correct, we can - * do some folding with above cases - */ - PUThalf(GEThalf(iaddr), oaddr); - break; - - case R_PPC_ADDR16_HA: - case R_PPC_GOT16_HA: - /* XXX - more assumptions which if proved correct, we can - * do some folding with above cases - */ - PUThalf(GEThalf(iaddr), oaddr); - break; - - case R_PPC_ADDR14: - case R_PPC_ADDR14_BRTAKEN: - case R_PPC_ADDR14_BRNTAKEN: - case R_PPC_REL14: - case R_PPC_REL14_BRTAKEN: - case R_PPC_REL14_BRNTAKEN: - /* XXX - big assumption here that the original contents were masked - * properly. If this assumption proves correct, then these 14bit - * cases can be folded into the above 32bit cases. - */ - PUTword(GETword(iaddr), oaddr); - break; - - case R_PPC_COPY: - break; - - case R_PPC_GLOB_DAT: - case R_PPC_RELATIVE: - PUTword(GETword(iaddr), oaddr); - break; - - case R_PPC_JMP_SLOT: - break; - - default: - break; - } -} - -void -update_reloc(Cache *ocache, Cache *_ocache, Cache *icache, Cache *_icache, Half shnum) -{ - Shdr *shdr; - Rel *rels; - int reln, cnt; - Cache *orcache, * ircache; - - /* - * Set up to read the output relocation table. - */ - shdr = _ocache->c_shdr; - rels = (Rel *)_ocache->c_data->d_buf; - reln = shdr->sh_size / shdr->sh_entsize; - - /* - * Determine the section that is being relocated. - */ - orcache = &ocache[shdr->sh_info]; - shdr = _icache->c_shdr; - ircache = &icache[shdr->sh_info]; - - /* - * Loop through the relocation table. - */ - for (cnt = 0; cnt < reln; cnt++, rels++) { - unsigned char type = ELF_R_TYPE(rels->r_info); - - /* - * Ignore some relocations as these can safely be carried out - * twice (they simply override any existing data). In fact, - * some relocations like __iob's copy relocation must be carried - * out each time the process restarts otherwise stdio blows up. - */ - if ((type == R_PPC_COPY) || (type == R_PPC_JMP_SLOT) || - (type == R_PPC_NONE)) - continue; - - { - unsigned char *iaddr, *oaddr; - Addr off; - - /* - * If we are required to restore the relocation location - * to it's value prior to relocation, then read the - * locations original contents from the input image and - * copy it to the output image. - */ - off = rels->r_offset - ircache->c_shdr->sh_addr; - iaddr = (unsigned char *)ircache->c_data->d_buf + off; - oaddr = (unsigned char *)orcache->c_data->d_buf + off; - move_reloc(iaddr, oaddr, type); - } - } -}
--- a/dynodump/ppc/machdep.h Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#pragma ident "@(#) $Id: machdep.h,v 1.1.1.1 1996/12/18 22:42:15 steve Exp $ - SMI" - -/* - * Global include file for all sgs PowerPC machine dependent macros, constants - * and declarations. - */ -#ifndef MACHDEP_DOT_H -#define MACHDEP_DOT_H - -#include <link.h> -#include <sys/elf_ppc.h> - -/* - * Make machine class dependent data types transparent to the common code - */ -#define Word Elf32_Word -#define Sword Elf32_Sword -#define Half Elf32_Half -#define Addr Elf32_Addr -#define Off Elf32_Off -#define Byte unsigned char - -#define Ehdr Elf32_Ehdr -#define Shdr Elf32_Shdr -#define Sym Elf32_Sym -#define Rel Elf32_Rela -#define Phdr Elf32_Phdr -#define Dyn Elf32_Dyn -#define Boot Elf32_Boot -#define Verdef Elf32_Verdef -#define Verdaux Elf32_Verdaux -#define Verneed Elf32_Verneed -#define Vernaux Elf32_Vernaux -#define Versym Elf32_Versym - -/* - * Make machine class dependent functions transparent to the common code - */ -#define ELF_R_TYPE ELF32_R_TYPE -#define ELF_R_INFO ELF32_R_INFO -#define ELF_R_SYM ELF32_R_SYM -#define ELF_ST_BIND ELF32_ST_BIND -#define ELF_ST_TYPE ELF32_ST_TYPE -#define ELF_ST_INFO ELF32_ST_INFO -#define elf_fsize elf32_fsize -#define elf_getehdr elf32_getehdr -#define elf_getphdr elf32_getphdr -#define elf_newehdr elf32_newehdr -#define elf_newphdr elf32_newphdr -#define elf_getshdr elf32_getshdr - -#define M_REL_SHT_TYPE SHT_RELA /* section header type */ - -#endif
--- a/dynodump/ppc/uninit.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * This is where you put processor specific un-initialization things - * to deal with "initialization idempotency issues". - */ - -extern void __delete_all_module_tags(void); -extern void __exithandle(void); - -void -dynodump_uninit(void) -{ - /* There are 2 possible ways to do this. It is not clear which way - will be blessed by the Sun Gods. Both appear to work. */ - - /* _exithandle has recently been blessed. */ - - /* __delete_all_module_tags(); */ - _exithandle(); - - return; -}
--- a/dynodump/sparc/_relocate.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,294 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * Update the value of the `_edata' and `_end' symbols. - */ -#pragma ident "@(#) $Id: _relocate.c,v 1.1.1.1 1996/12/18 22:42:15 steve Exp $ - SMI" - -#include <libelf.h> -#include <string.h> -#include "machdep.h" -#include "_dynodump.h" - - -#define GETbyte(P) ((long)((unsigned long)(P)[0])) -#define GEThalf(P) ((long)(((unsigned long)(P)[0] << 8) | \ - ((unsigned long)(P)[1]))) -#define GETword(P) ((long)(((unsigned long)(P)[0] << 24) | \ - ((unsigned long)(P)[1] << 16) | \ - ((unsigned long)(P)[2] << 8) | \ - (unsigned long)(P)[3])) -#define GETdisp30(P) (GETword(P) & 0x3fffffff) -#define GETdisp22(P) (GETword(P) & 0x3fffff) -#define GETdisp16(P) (((GETword(P) & 0x300000) >> 6) | \ - (GETword(P) & 0x3fff)) -#define GETdisp19(P) (GETword(P) & 0x7ffff) -#define GETimm22(P) (GETword(P) & 0x3fffff) -#define GETimm5(P) (GEThalf((P)+2) & 0x1f) -#define GETimm6(P) (GEThalf((P)+2) & 0x2f) -#define GETimm7(P) (GEThalf((P)+2) & 0x3f) -#define GETsimm13(P) (GEThalf((P)+2) & 0x1fff) -#define GETsimm10(P) (GEThalf((P)+2) & 0x3ff) -#define GETsimm11(P) (GEThalf((P)+2) & 0x7ff) -#define GETplt22(P) (GETword((P)+8) & 0x3fffff) - -#define PUTbyte(V, P) (P)[0] = (V) -#define PUThalf(V, P) (P)[0] = ((V) >> 8); \ - (P)[1] = ((V)) -#define PUTword(V, P) (P)[0] = (unsigned char)((V) >> 24); \ - (P)[1] = (unsigned char)((V) >> 16); \ - (P)[2] = (unsigned char)((V) >> 8); \ - (P)[3] = (unsigned char)(V) -#define PUTdisp30(V, P) { \ - unsigned long int temp; \ - temp = GETword(P) & ~0x3fffffff; \ - temp |= ((V) & 0x3fffffff); \ - PUTword(temp, P); \ - } -#define PUTdisp22(V, P) { \ - unsigned long int temp; \ - temp = GETword(P) & ~0x3fffff; \ - temp |= ((V) & 0x3fffff); \ - PUTword(temp, P); \ - } -#define PUTimm22(V, P) { \ - unsigned long int temp; \ - temp = GETword(P) & ~0x3fffff; \ - temp |= ((V) & 0x3fffff); \ - PUTword(temp, P); \ - } -#define PUTimm5(V, P) { \ - unsigned long int temp; \ - temp = GEThalf(P+2) & ~0x1f; \ - temp |= ((V) & 0x1f); \ - PUThalf(temp, (P+2)); \ - } -#define PUTimm6(V, P) { \ - unsigned long int temp; \ - temp = GEThalf(P+2) & ~0x2f; \ - temp |= ((V) & 0x2f); \ - PUThalf(temp, (P+2)); \ - } -#define PUTimm7(V, P) { \ - unsigned long int temp; \ - temp = GEThalf(P+2) & ~0x3f; \ - temp |= ((V) & 0x3f); \ - PUThalf(temp, (P+2)); \ - } -#define PUTsimm13(V, P) { \ - unsigned long int temp; \ - temp = GEThalf(P+2) & ~0x1fff; \ - temp |= ((V) & 0x1fff); \ - PUThalf(temp, (P+2)); \ - } -#define PUTplt22(V, P) { \ - unsigned long int temp; \ - temp = GETword((P)+8) & ~0x3fffff; \ - temp |= ((V) & 0x3fffff); \ - PUTword(temp, ((P)+8)); \ - } -#define PUTsimm10(V, P) { \ - unsigned long int temp; \ - temp = GEThalf(P+2) & ~0x3ff; \ - temp |= ((V) & 0x3ff); \ - PUThalf(temp, (P+2)); \ - } -#define PUTsimm11(V, P) { \ - unsigned long int temp; \ - temp = GEThalf(P+2) & ~0x7ff; \ - temp |= ((V) & 0x7ff); \ - PUThalf(temp, (P+2)); \ - } -#define PUTdisp16(V, P) { \ - unsigned long int temp; \ - temp = GETword(P) & ~0x303fff; \ - temp |= ((V) & 0xc000) << 6; \ - temp |= ((V) & 0x3fff); \ - PUTword(temp, P); \ - } -#define PUTdisp19(V, P) { \ - unsigned long int temp; \ - temp = GETword(P) & ~0x7ffff; \ - temp |= ((V) & 0x7ffff); \ - PUTword(temp, P); \ - } - -static void -move_reloc(unsigned char * iaddr, unsigned char * oaddr, unsigned char type) -{ - switch (type) { - case R_SPARC_8: - case R_SPARC_DISP8: - PUTbyte(GETbyte(iaddr), oaddr); - break; - - case R_SPARC_16: - case R_SPARC_DISP16: - PUThalf(GEThalf(iaddr), oaddr); - break; - - case R_SPARC_32: - case R_SPARC_DISP32: - case R_SPARC_GLOB_DAT: - case R_SPARC_RELATIVE: - case R_SPARC_UA32: - PUTword(GETword(iaddr), oaddr); - break; - - case R_SPARC_WDISP30: - case R_SPARC_WPLT30: - PUTdisp30(GETdisp30(iaddr), oaddr); - break; - - case R_SPARC_WDISP22: - case R_SPARC_PC22: - PUTdisp22(GETdisp22(iaddr), oaddr); - break; - - case R_SPARC_HI22: - case R_SPARC_GOT22: - case R_SPARC_22: - PUTimm22(GETimm22(iaddr), oaddr); - break; - - case R_SPARC_13: - case R_SPARC_GOT13: - PUTsimm13(GETsimm13(iaddr), oaddr); - break; - - case R_SPARC_LO10: - case R_SPARC_GOT10: - case R_SPARC_PC10: -#ifdef R_SPARC_10 - case R_SPARC_10: -#endif - PUTsimm10(GETsimm10(iaddr), oaddr); - break; - -#ifdef R_SPARC_11 - case R_SPARC_11: - PUTsimm11(GETsimm11(iaddr), oaddr); - break; -#endif - -#ifdef R_SPARC_WDISP16 - case R_SPARC_WDISP16: - PUTdisp16(GETdisp16(iaddr), oaddr); - break; -#endif - -#ifdef R_SPARC_WDISP19 - case R_SPARC_WDISP19: - PUTdisp19(GETdisp19(iaddr), oaddr); - break; -#endif - -#ifdef R_SPARC_5 - case R_SPARC_5: - PUTimm5(GETimm5(iaddr), oaddr); - break; -#endif - -#ifdef R_SPARC_6 - case R_SPARC_6: - PUTimm6(GETimm6(iaddr), oaddr); - break; -#endif - -#ifdef R_SPARC_7 - case R_SPARC_7: - PUTimm7(GETimm7(iaddr), oaddr); - break; -#endif - - default: - break; - } -} - -void -update_reloc(Cache *ocache, Cache *_ocache, - Cache *icache, Cache *_icache, - Half shnum) -{ - Shdr *shdr; - Rel *rels; - int reln, cnt; - Cache *orcache, *ircache; - - /* - * Set up to read the output relocation table. - */ - shdr = _ocache->c_shdr; - rels = (Rel *)_ocache->c_data->d_buf; - reln = shdr->sh_size / shdr->sh_entsize; - - /* - * Determine the section that is being relocated. - */ - orcache = &ocache[shdr->sh_info]; - shdr = _icache->c_shdr; - ircache = &icache[shdr->sh_info]; - - /* - * Loop through the relocation table. - */ - for (cnt = 0; cnt < reln; cnt++, rels++) { - unsigned char *iaddr, *oaddr; - Addr off; - unsigned char type = ELF_R_TYPE(rels->r_info); - - /* - * Ignore some relocations as these can safely be carried out - * twice (they simply override any existing data). In fact, - * some relocations like __iob's copy relocation must be carried - * out each time the process restarts otherwise stdio blows up. - */ - if ((type == R_SPARC_COPY) || (type == R_SPARC_JMP_SLOT) || - (type == R_SPARC_NONE)) - continue; - - /* - * If we are required to restore the relocation location - * to it's value prior to relocation, then read the - * locations original contents from the input image and - * copy it to the output image. - */ - off = rels->r_offset - ircache->c_shdr->sh_addr; - iaddr = (unsigned char *)ircache->c_data->d_buf + off; - oaddr = (unsigned char *)orcache->c_data->d_buf + off; - move_reloc(iaddr, oaddr, type); - } -}
--- a/dynodump/sparc/machdep.h Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#pragma ident "@(#) $Id: machdep.h,v 1.1.1.1 1996/12/18 22:42:15 steve Exp $ - SMI" - -/* - * Global include file for all sgs SPARC machine dependent macros, constants - * and declarations. - */ -#ifndef MACHDEP_DOT_H -#define MACHDEP_DOT_H - -#include <link.h> -#include <sys/elf_SPARC.h> - -/* - * Make machine class dependent data types transparent to the common code - */ -#define Word Elf32_Word -#define Sword Elf32_Sword -#define Half Elf32_Half -#define Addr Elf32_Addr -#define Off Elf32_Off -#define Byte unsigned char - -#define Ehdr Elf32_Ehdr -#define Shdr Elf32_Shdr -#define Sym Elf32_Sym -#define Rel Elf32_Rela -#define Phdr Elf32_Phdr -#define Dyn Elf32_Dyn -#define Boot Elf32_Boot -#define Verdef Elf32_Verdef -#define Verdaux Elf32_Verdaux -#define Verneed Elf32_Verneed -#define Vernaux Elf32_Vernaux -#define Versym Elf32_Versym - -/* - * Make machine class dependent functions transparent to the common code - */ -#define ELF_R_TYPE ELF32_R_TYPE -#define ELF_R_INFO ELF32_R_INFO -#define ELF_R_SYM ELF32_R_SYM -#define ELF_ST_BIND ELF32_ST_BIND -#define ELF_ST_TYPE ELF32_ST_TYPE -#define ELF_ST_INFO ELF32_ST_INFO -#define elf_fsize elf32_fsize -#define elf_getehdr elf32_getehdr -#define elf_getphdr elf32_getphdr -#define elf_newehdr elf32_newehdr -#define elf_newphdr elf32_newphdr -#define elf_getshdr elf32_getshdr - -/* - * Make relocation types transparent to the common code - */ -#define M_REL_SHT_TYPE SHT_RELA /* section header type */ - -#endif
--- a/dynodump/sparc/uninit.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * This is where you put processor specific un-initialization things - * to deal with "initialization idempotency issues". - */ - -void dynodump_uninit(void); -void -dynodump_uninit(void) -{ - return; -}
--- a/dynodump/syms.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 1995 by Sun Microsystems, Inc. - * All rights reserved. - * - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify this source code without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. - * SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY - * OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT - * EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS - * ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN - * NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, - * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. - * - * This source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS - * SOURCE CODE OR ANY PART THEREOF. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * Update the value of the `_edata' and `_end' symbols. - */ -#pragma ident "@(#) $Id: syms.c,v 1.1.1.1 1996/12/18 22:42:15 steve Exp $ - SMI" - -#include <libelf.h> -#include <string.h> -#include "machdep.h" -#include "_dynodump.h" - -void -update_sym(Cache * cache, Cache * _cache, Addr edata) -{ - char *strs; - Sym *syms; - Shdr *shdr; - int symn, cnt; - - /* - * Set up to read the symbol table and its associated string table. - */ - shdr = _cache->c_shdr; - syms = (Sym *) _cache->c_data->d_buf; - symn = shdr->sh_size / shdr->sh_entsize; - - strs = (char *) cache[shdr->sh_link].c_data->d_buf; - - /* - * Loop through the symbol table looking for `_end' and `_edata'. - */ - for (cnt = 0; cnt < symn; cnt++, syms++) { - char *name = strs + syms->st_name; - - if (strcmp(name, "_end") && strcmp(name, "_edata")) - continue; - - syms->st_value = edata; - } -}
--- a/etc/e/eterm.ti Mon Aug 13 09:36:20 2007 +0200 +++ b/etc/e/eterm.ti Mon Aug 13 09:37:19 2007 +0200 @@ -8,6 +8,7 @@ il1=\E[L,il=\E[%p1%dL, clear=\E[H\E[J,ed=\\E[J,el=\E[K,el1=\E[1K, dl1=\E[M,dl=\E[%p1%dM,dch1=\E[P,dch=\E[%p1%dP, + kcub1=\E[D,kcuf1=\E[C,kcuu1=\E[A,kcud1=\E[B, smir=\E[4h,rmir=\E[4l,ich=\E[%p1%d@,mir, smcup=\E7\E[?47h,rmcup=\E[2J\E[?47l\E8, ht=\t, @@ -15,4 +16,3 @@ smul=\E[4m,rmul=\E[m, rev=\E[7m,bold=\E[1m,sgr0=\E[m, bel=^G,xenl,am, -
--- a/etc/sample.emacs Mon Aug 13 09:36:20 2007 +0200 +++ b/etc/sample.emacs Mon Aug 13 09:37:19 2007 +0200 @@ -16,12 +16,10 @@ ;; Basic Customization ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Enable the commands `narrow-to-region' ("C-x n n") and -;; `eval-expression' ("M-:", or "ESC :"). Both are useful -;; commands, but they can be confusing for a new user, so they're -;; disabled by default. +;; Enable the command `narrow-to-region' ("C-x n n"), a useful +;; command, but possibly confusing to a new user, so it's disabled by +;; default. (put 'narrow-to-region 'disabled nil) -(put 'eval-expression 'disabled nil) ;;; Define a variable to indicate whether we're running XEmacs/Lucid Emacs. ;;; (You do not have to defvar a global variable before using it -- @@ -54,10 +52,10 @@ ;; key sequence. (global-set-key [f4] 'set-mark-command) (global-set-key [f5] "\M-w") -(global-set-key [f6]"\C-y") +(global-set-key [f6] "\C-y") ;; Shift-F4 is "pop mark off of stack" -(global-set-key '(shift f4) (lambda () (interactive) (set-mark-command t))) +(global-set-key [(shift f4)] (lambda () (interactive) (set-mark-command t))) ;; Make F7 be `save-buffer' (global-set-key [f7] 'save-buffer) @@ -351,6 +349,14 @@ ;; Customization of Specific Packages ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Load gnuserv, which will allow you to connect to XEmacs sessions +;;; using `gnuclient'. + +;; If you never run more than one XEmacs at a time, you might want to +;; always start gnuserv. Otherwise it is preferable to specify +;; `-f gnuserv-start' on the command line to one of the XEmacsen. +; (gnuserv-start) + ;;; ******************** ;;; Load efs, which uses the FTP protocol as a pseudo-filesystem.
--- a/lib-src/ChangeLog Mon Aug 13 09:36:20 2007 +0200 +++ b/lib-src/ChangeLog Mon Aug 13 09:37:19 2007 +0200 @@ -1,3 +1,10 @@ +Tue May 20 23:22:00 1997 Steven L Baur <steve@altair.xemacs.org> + + * update-autoloads.sh (dirs): Remove obsolete directory lisp/vms + from exclusion list (it doesn't exist any more). Remove + lisp/eterm from exclusion list of directories searched for + autoloads. + Thu May 1 15:26:20 1997 Steven L Baur <steve@altair.xemacs.org> * update-elc.sh (mule_p): Test for mule bombs with change in format
--- a/lib-src/Makefile.in.in Mon Aug 13 09:36:20 2007 +0200 +++ b/lib-src/Makefile.in.in Mon Aug 13 09:37:19 2007 +0200 @@ -105,7 +105,7 @@ /* Things that a user might actually run, which should be installed in bindir. */ -INSTALLABLES = etags ctags b2m gnuclient gnuattach gnudoit +INSTALLABLES = etags ctags b2m gnuclient INSTALLABLE_SCRIPTS = rcs-checkin pstogif install-sid send-pr /* Things that Emacs runs internally, or during the build process, @@ -270,9 +270,9 @@ /* We need to #define emacs to get the right versions of some files. */ -lib_src_cppflags = -Demacs -I../src -I${srcdir} -I${srcdir}/../src $(CPPFLAGS) +lib_src_cppflags = -Demacs -I../src -I${srcdir} -I${srcdir}/../src $(CPPFLAGS) cflags = $(CFLAGS) $(lib_src_cppflags) $(c_switch_general) -ldflags = $(ld_switch_general) $(LDFLAGS) $(ld_libs_general) +ldflags = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general) /* CPP_CFLAGS = $(c_switch_general) -Demacs -DHAVE_CONFIG_H \ */ /* -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} */ @@ -479,8 +479,8 @@ /* Why oh why does HP not include half of the standard X distribution? */ #ifdef HAVE_XAUTH -cflags_gnuserv = $(CFLAGS) $(c_switch_all) $(lib_src_cppflags) -ldflags_gnuserv = $(ld_switch_all) $(LDFLAGS) $(ld_libs_all) +cflags_gnuserv = $(CFLAGS) $(lib_src_cppflags) $(c_switch_all) +ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) $(ld_libs_all) #else cflags_gnuserv = ${cflags} ldflags_gnuserv = ${ldflags} @@ -489,10 +489,6 @@ $(CC) -c ${cflags_gnuserv} ${srcdir}/gnuslib.c gnuclient: ${srcdir}/gnuclient.c gnuslib.o ${srcdir}/gnuserv.h $(CC) ${cflags_gnuserv} -o gnuclient ${srcdir}/gnuclient.c gnuslib.o $(ldflags_gnuserv) -gnuattach: ${srcdir}/gnuclient.c gnuslib.o ${srcdir}/gnuserv.h gnuclient - $(CC) ${cflags_gnuserv} -o gnuattach -DGNUATTACH ${srcdir}/gnuclient.c gnuslib.o $(ldflags_gnuserv) -gnudoit: ${srcdir}/gnudoit.c gnuslib.o ${srcdir}/gnuserv.h - $(CC) ${cflags_gnuserv} -o gnudoit ${srcdir}/gnudoit.c gnuslib.o $(ldflags_gnuserv) gnuserv: ${srcdir}/gnuserv.c gnuslib.o ${srcdir}/gnuserv.h $(CC) ${cflags_gnuserv} -o gnuserv ${srcdir}/gnuserv.c gnuslib.o $(ldflags_gnuserv)
--- a/lib-src/b2m.c Mon Aug 13 09:36:20 2007 +0200 +++ b/lib-src/b2m.c Mon Aug 13 09:37:19 2007 +0200 @@ -19,6 +19,8 @@ by Francesco Potorti` <pot@cnuce.cnr.it>. */ #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <time.h> #include <sys/types.h> #ifdef MSDOS
--- a/lib-src/gnuclient.c Mon Aug 13 09:36:20 2007 +0200 +++ b/lib-src/gnuclient.c Mon Aug 13 09:37:19 2007 +0200 @@ -124,6 +124,9 @@ signal (SIGHUP, pass_signal_to_emacs); signal (SIGQUIT, pass_signal_to_emacs); signal (SIGINT, pass_signal_to_emacs); +#ifdef SIGWINCH + signal (SIGWINCH, pass_signal_to_emacs); +#endif /* We want emacs to realize that we are resuming */ signal (SIGCONT, tell_emacs_to_resume); @@ -190,234 +193,395 @@ } /* filename_expand */ +/* Encase the string in quotes, escape all the backslashes and quotes + in string. */ +char * +clean_string (CONST char *s) +{ + int i = 0; + char *p, *res; + + for (p = s; *p; p++, i++) + { + if (*p == '\\' || *p == '\"') + ++i; + else if (*p == '\004') + i += 3; + } + p = res = (char *)malloc (i + 2 + 1); + *p++ = '\"'; + for (; *s; p++, s++) + { + switch (*s) + { + case '\\': + *p++ = '\\'; + *p = '\\'; + break; + case '\"': + *p++ = '\\'; + *p = '\"'; + break; + case '\004': + *p++ = '\\'; + *p++ = 'C'; + *p++ = '-'; + *p = 'd'; + break; + default: + *p = *s; + } + } + *p++ = '\"'; + *p = '\0'; + return res; +} + +#define GET_ARGUMENT(var, desc) do { \ + if (*(p + 1)) (var) = p + 1; \ + else \ + { \ + if (!argv[++i]) \ + { \ + fprintf (stderr, "%s: `%s' must be followed by an argument\n", \ + progname, desc); \ + exit (1); \ + } \ + (var) = argv[i]; \ + } \ + over = 1; \ +} while (0) + + int main (int argc, char *argv[]) { - int starting_line = 1; /* line to start editing at */ - char command[MAXPATHLEN+50]; /* emacs command buffer */ - char fullpath[MAXPATHLEN+1]; /* full pathname to file */ - int qflg = 0; /* quick edit, don't wait for - * user to finish */ - int view = 0; /* view only. */ - int errflg = 0; /* option error */ - int c; /* char from getopt */ - int s; /* socket / msqid to server */ - int connect_type; /* CONN_UNIX, CONN_INTERNET, or - * CONN_IPC */ + int starting_line = 1; /* line to start editing at */ + char command[MAXPATHLEN+50]; /* emacs command buffer */ + char fullpath[MAXPATHLEN+1]; /* full pathname to file */ + char *eval_form = NULL; /* form to evaluate with `-eval' */ + char *eval_function = NULL; /* function to evaluate with `-f' */ + char *load_library = NULL; /* library to load */ + int quick = 0; /* quick edit, don't wait for user to + finish */ + int batch = 0; /* batch mode */ + int view = 0; /* view only. */ + int nofiles = 0; + int errflg = 0; /* option error */ + int c; /* char from getopt */ + int s; /* socket / msqid to server */ + int connect_type; /* CONN_UNIX, CONN_INTERNET, or + * CONN_IPC */ int suppress_windows_system = 0; char *display; #ifdef INTERNET_DOMAIN_SOCKETS - char *hostarg = NULL; /* remote hostname */ - char thishost[HOSTNAMSZ]; /* this hostname */ - char remotepath[MAXPATHLEN+1]; /* remote pathname */ - int rflg = 0; /* pathname given on cmdline */ - u_short portarg = 0; /* port to server */ - char *ptr; /* return from getenv */ + char *hostarg = NULL; /* remote hostname */ + char *remotearg; + char thishost[HOSTNAMSZ]; /* this hostname */ + char remotepath[MAXPATHLEN+1]; /* remote pathname */ + char *path; + int rflg = 0; /* pathname given on cmdline */ + char *portarg; + u_short port = 0; /* port to server */ #endif /* INTERNET_DOMAIN_SOCKETS */ #ifdef SYSV_IPC - struct msgbuf *msgp; /* message */ + struct msgbuf *msgp; /* message */ #endif /* SYSV_IPC */ char *tty; - char buffer[GSERV_BUFSZ+1]; /* buffer to read pid */ + char buffer[GSERV_BUFSZ + 1]; /* buffer to read pid */ + char result[GSERV_BUFSZ + 1]; + int i; #ifdef INTERNET_DOMAIN_SOCKETS memset (remotepath, 0, sizeof (remotepath)); #endif /* INTERNET_DOMAIN_SOCKETS */ - progname = argv[0]; + progname = strrchr (argv[0], '/'); + if (progname) + ++progname; + else + progname = argv[0]; display = getenv ("DISPLAY"); if (!display) suppress_windows_system = 1; - while ((c = getopt (argc, argv, - -#ifdef INTERNET_DOMAIN_SOCKETS - "n:h:p:r:qv" -#else /* !INTERNET_DOMAIN_SOCKETS */ - "n:qv" -#endif /* !INTERNET_DOMAIN_SOCKETS */ - - )) != EOF) - switch (c) - { - case 'n': - if (*optarg == 'w') - suppress_windows_system++; - else - errflg++; - break; - case 'q': /* quick mode specified */ - qflg++; + for (i = 1; argv[i] && !errflg; i++) + { + if (*argv[i] != '-') break; - case 'v': - view++; - break; - + if (!strcmp (argv[i], "-batch")) + batch = 1; + else if (!strcmp (argv[i], "-eval")) + { + if (!argv[++i]) + { + fprintf (stderr, "%s: `-eval' must be followed by an argument\n", + progname); + exit (1); + } + eval_form = argv[i]; + } + else if (!strcmp (argv[i], "-display")) + { + suppress_windows_system = 0; + if (!argv[++i]) + { + fprintf (stderr, "%s: `-display' must be followed by an argument\n", + progname); + exit (1); + } + display = argv[i]; + } + else if (!strcmp (argv[i], "-nw")) + suppress_windows_system = 1; + else + { + /* Iterate over one-letter options. */ + char *p; + int over = 0; + for (p = argv[i] + 1; *p && !over; p++) + { + switch (*p) + { + case 'q': + quick = 1; + break; + case 'v': + view = 1; + break; + case 'f': + GET_ARGUMENT (eval_function, "-f"); + break; + case 'l': + GET_ARGUMENT (load_library, "-l"); + break; #ifdef INTERNET_DOMAIN_SOCKETS - case 'h': /* server host name specified */ - hostarg = optarg; - break; - case 'r': /* remote path from server specifed */ - strcpy (remotepath,optarg); - rflg++; - break; - case 'p': /* port number specified */ - portarg = atoi (optarg); - break; + case 'h': + GET_ARGUMENT (hostarg, "-h"); + break; + case 'p': + GET_ARGUMENT (portarg, "-p"); + port = atoi (portarg); + break; + case 'r': + GET_ARGUMENT (remotearg, "-r"); + strcpy (remotepath, remotearg); + rflg = 1; + break; #endif /* INTERNET_DOMAIN_SOCKETS */ - - case '?': - errflg++; - } /* switch */ + default: + errflg = 1; + } + } /* for */ + } /* else */ + } /* for */ if (errflg) { fprintf (stderr, #ifdef INTERNET_DOMAIN_SOCKETS - "usage: %s [-q] [-h hostname] [-p port] [-r pathname] " + "usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval expr]\n" + " [-h host] [-p port] [-r file-name] [[+line] file] ...\n", +#else /* !INTERNET_DOMAIN_SOCKETS */ + "usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval expr] " "[[+line] path] ...\n", -#else /* !INTERNET_DOMAIN_SOCKETS */ - "usage: %s [-nw] [-q] [[+line] path] ...\n", #endif /* !INTERNET_DOMAIN_SOCKETS */ progname); exit (1); - } /* if */ - - if (suppress_windows_system) + } + if (batch && argv[i]) { - tty = ttyname (0); - if (!tty) - { - fprintf (stderr, "%s: Not connected to a tty", progname); - exit (1); - } - } - /* This next stuff added in an attempt to make handling of the tty - do the right thing when dealing with signals. The idea is to - pass all the appropriate signals to the emacs process. */ - - connect_type = make_connection (NULL, (u_short) 0, &s); - - send_string (s, "(gnuserv-eval '(emacs-pid))"); - send_string (s, EOT_STR); - - if (read_line (s, buffer) == 0) - { - fprintf (stderr, "%s: Could not establish emacs procces id\n", + fprintf (stderr, "%s: Cannot specify `-batch' with file names\n", progname); exit (1); } - /* Don't do disconnect_from_server becasue we have already read - data, and disconnect doesn't do anything else. */ -#ifdef SYSV_IPC - if (connect_type == (int) CONN_IPC) - disconnect_from_ipc_server (s, msgp, FALSE); + *result = '\0'; + if (eval_function || eval_form || load_library) + { +#if defined(INTERNET_DOMAIN_SOCKETS) + connect_type = make_connection (hostarg, port, &s); +#else + connect_type = make_connection (NULL, (u_short) 0, &s); +#endif + sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : ""); + send_string (s, command); + if (load_library) + { + sprintf (command, " (load-library %s)", clean_string (load_library)); + send_string (s, command); + } + if (eval_form) + { + sprintf (command, " %s", eval_form); + send_string (s, command); + } + if (eval_function) + { + sprintf (command, " (%s)", eval_function); + send_string (s, command); + } + send_string (s, "))"); + send_string (s, EOT_STR); + if (read_line (s, result) == 0) + { + fprintf (stderr, "%s: Could not read\n", progname); + exit (1); + } + } /* eval_function || eval_form || load_library */ + else if (batch) + { + fprintf (stderr, "%s: `-batch' requires an evaluation\n", + progname); + exit (1); + } + + if (!batch) + { + if (suppress_windows_system) + { + tty = ttyname (0); + if (!tty) + { + fprintf (stderr, "%s: Not connected to a tty", progname); + exit (1); + } + } + +#if defined(INTERNET_DOMAIN_SOCKETS) + connect_type = make_connection (hostarg, port, &s); +#else + connect_type = make_connection (NULL, (u_short) 0, &s); +#endif + + send_string (s, "(gnuserv-eval '(emacs-pid))"); + send_string (s, EOT_STR); + + if (read_line (s, buffer) == 0) + { + fprintf (stderr, "%s: Could not establish emacs procces id\n", + progname); + exit (1); + } + /* Don't do disconnect_from_server becasue we have already read + data, and disconnect doesn't do anything else. */ +#ifndef INTERNET_DOMAIN_SOCKETS + if (connect_type == (int) CONN_IPC) + disconnect_from_ipc_server (s, msgp, FALSE); #endif /* !SYSV_IPC */ - emacs_pid = (pid_t)atol(buffer); - initialize_signals(); + emacs_pid = (pid_t)atol(buffer); + initialize_signals(); -#if defined(INTERNET_DOMAIN_SOCKETS) && !defined(GNUATTACH) - connect_type = make_connection (hostarg, portarg, &s); +#if defined(INTERNET_DOMAIN_SOCKETS) + connect_type = make_connection (hostarg, port, &s); #else - connect_type = make_connection (NULL, (u_short) 0, &s); + connect_type = make_connection (NULL, (u_short) 0, &s); #endif #ifdef INTERNET_DOMAIN_SOCKETS - if (connect_type == (int) CONN_INTERNET) - { - gethostname (thishost, HOSTNAMSZ); - if (!rflg) - { /* attempt to generate a path + if (connect_type == (int) CONN_INTERNET) + { + char *ptr; + gethostname (thishost, HOSTNAMSZ); + if (!rflg) + { /* attempt to generate a path * to this machine */ - if ((ptr = getenv ("GNU_NODE")) != NULL) - /* user specified a path */ - strcpy (remotepath, ptr); - } + if ((ptr = getenv ("GNU_NODE")) != NULL) + /* user specified a path */ + strcpy (remotepath, ptr); + } #if 0 /* This is really bogus... re-enable it if you must have it! */ #if defined (hp9000s300) || defined (hp9000s800) - else if (strcmp (thishost,hostarg)) - { /* try /net/thishost */ - strcpy (remotepath, "/net/"); /* (this fails using internet - addresses) */ - strcat (remotepath, thishost); - } + else if (strcmp (thishost,hostarg)) + { /* try /net/thishost */ + strcpy (remotepath, "/net/"); /* (this fails using internet + addresses) */ + strcat (remotepath, thishost); + } #endif #endif - } - else - { /* same machines, no need for path */ - remotepath[0] = '\0'; /* default is the empty path */ - } + } + else + { /* same machines, no need for path */ + remotepath[0] = '\0'; /* default is the empty path */ + } #endif /* INTERNET_DOMAIN_SOCKETS */ #ifdef SYSV_IPC - if ((msgp = (struct msgbuf *) - malloc (sizeof *msgp + GSERV_BUFSZ)) == NULL) - { - fprintf (stderr, "%s: not enough memory for message buffer\n", progname); - exit (1); - } /* if */ + if ((msgp = (struct msgbuf *) + malloc (sizeof *msgp + GSERV_BUFSZ)) == NULL) + { + fprintf (stderr, "%s: not enough memory for message buffer\n", progname); + exit (1); + } /* if */ - msgp->mtext[0] = '\0'; /* ready for later strcats */ + msgp->mtext[0] = '\0'; /* ready for later strcats */ #endif /* SYSV_IPC */ - if (suppress_windows_system) - { - ptr = getenv ("TERM"); - if (!ptr) + if (suppress_windows_system) { - fprintf (stderr, "%s: unknown terminal type\n", progname); - exit (1); + char *term = getenv ("TERM"); + if (!term) + { + fprintf (stderr, "%s: unknown terminal type\n", progname); + exit (1); + } + sprintf (command, "(gnuserv-edit-files '(tty %s %s %d) '(", + clean_string (tty), clean_string (term), getpid ()); } - sprintf (command, - "(gnuserv-edit-files '(tty \"%s\" \"%s\" %d) '(", - tty, ptr, getpid ()); - } - else /* !suppress_windows_system */ - { - sprintf (command, "(gnuserv-edit-files '(x \"%s\") '(", - display); - } /* !suppress_windows_system */ - send_string (s, command); + else /* !suppress_windows_system */ + { + sprintf (command, "(gnuserv-edit-files '(x %s) '(", + clean_string (display)); + } /* !suppress_windows_system */ + send_string (s, command); - if (!suppress_windows_system && (optind == argc)) - qflg = 1; + if (!argv[i]) + nofiles = 1; - for (; optind < argc; optind++) - { - if (optind < argc - 1 && *argv[optind] == '+') - starting_line = atoi (argv[optind++]); - else - starting_line = 1; - /* If the last argument is +something, treat it as a file. */ - if (optind == argc) + for (; argv[i]; i++) { - starting_line = 1; - --optind; - } - filename_expand (fullpath, argv[optind]); - sprintf (command, "(%d . \"%s%s\")", starting_line, + if (i < argc - 1 && *argv[i] == '+') + starting_line = atoi (argv[i++]); + else + starting_line = 1; + /* If the last argument is +something, treat it as a file. */ + if (i == argc) + { + starting_line = 1; + --i; + } + filename_expand (fullpath, argv[i]); #ifdef INTERNET_DOMAIN_SOCKETS - remotepath, -#else /* !INTERNET_DOMAIN_SOCKETS */ - "", + path = malloc (strlen (remotepath) + strlen (fullpath) + 1); + sprintf (path, "%s%s", remotepath, fullpath); +#else + path = malloc (strlen (fullpath)); + strcpy (path, fullpath); #endif - fullpath); + sprintf (command, "(%d . %s)", starting_line, clean_string (path)); + send_string (s, command); + free (path); + } /* for */ + + sprintf (command, ")%s%s", + (quick || (nofiles && !suppress_windows_system)) ? " 'quick" : "", + view ? " 'view" : ""); send_string (s, command); - } /* for */ - - sprintf (command, ") %s)", qflg ? "'quick" : (view ? "'view" : "")); - send_string (s, command); + send_string (s, ")"); #ifdef SYSV_IPC - if (connect_type == (int) CONN_IPC) - disconnect_from_ipc_server (s, msgp, FALSE); + if (connect_type == (int) CONN_IPC) + disconnect_from_ipc_server (s, msgp, FALSE); #else /* !SYSV_IPC */ - if (connect_type != (int) CONN_IPC) - disconnect_from_server (s, FALSE); + if (connect_type != (int) CONN_IPC) + disconnect_from_server (s, FALSE); #endif /* !SYSV_IPC */ + } /* not batch */ + + if (batch && !quick) + printf ("%s\n", result); return 0;
--- a/lib-src/gnudoit.c Mon Aug 13 09:36:20 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -*-C-*- - Client code to locally and remotely evaluate lisp forms using GNU Emacs. - - This file is part of GNU Emacs. - - Copying is permitted under those conditions described by the GNU - General Public License. - - Copyright (C) 1989 Free Software Foundation, Inc. - - Author: Andy Norman (ange@hplb.hpl.hp.com). - - Please mail bugs and suggestions to the author at the above address. -*/ - -/* - * This file incorporates new features added by Bob Weiner <weiner@mot.com>, - * Darrell Kindred <dkindred@cmu.edu> and Arup Mukherjee <arup@cmu.edu>. - * Please see the note at the end of the README file for details. - * - * (If gnuserv came bundled with your emacs, the README file is probably - * ../etc/gnuserv.README relative to the directory containing this file) - */ - -#if 0 -static char rcsid [] = "!Header: gnudoit.c,v 2.1 95/02/16 11:59:02 arup alpha !"; -#endif - -#include "gnuserv.h" -#include "getopt.h" - -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif /* HAVE_UNISTD_H */ - -#if !defined(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && !defined(INTERNET_DOMAIN_SOCKETS) -int -main (int argc, char *argv[]) -{ - fprintf (stderr,"Sorry, the Emacs server is only supported on systems that have\n"); - fprintf (stderr,"Unix Domain sockets, Internet Domain sockets or System V IPC.\n"); - exit (1); -} /* main */ -#else /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */ - -int -main (int argc, char *argv[]) -{ - int qflg = 0; /* don't wait around for - * gnu emacs to eval cmd */ - int errflg = 0; /* option error */ - int c; /* char from getopt */ - int s; /* socket / msqid to server */ - int connect_type; /* CONN_UNIX, CONN_INTERNET, or - * CONN_IPC */ -#ifdef INTERNET_DOMAIN_SOCKETS - char *hostarg = NULL; /* remote hostname argument */ - u_short portarg = 0; /* port number */ -#endif /* INTERNET_DOMAIN_SOCKETS */ -#ifdef SYSV_IPC - struct msgbuf *msgp; /* message */ -#endif /* SYSV_IPC */ - - progname = argv[0]; - - while ((c = getopt(argc, argv, -#ifdef INTERNET_DOMAIN_SOCKETS - "qh:p:" -#else /* !INTERNET_DOMAIN_SOCKETS */ - "q" -#endif /* !INTERNET_DOMAIN_SOCKETS */ - )) != EOF) - switch (c) { -#ifdef INTERNET_DOMAIN_SOCKETS - case 'h': /* host name specified */ - hostarg = optarg; - break; - case 'p': /* port number specified */ - portarg = atoi(optarg); - break; -#endif /* INTERNET_DOMAIN_SOCKETS */ - case 'q': /* quick mode specified */ - qflg++; - break; - case '?': - errflg++; - }; /* switch */ - - if (errflg) { - fprintf(stderr, -#ifdef INTERNET_DOMAIN_SOCKETS - "usage: %s [-q] [-h hostname] [-p port] [sexpr]...\n", -#else /* !INTERNET_DOMAIN_SOCKETS */ - "usage: %s [-q] [sexpr]...\n", -#endif /* !INTERNET_DOMAIN_SOCKETS */ - progname); - exit (1); - }; /* if */ - -#ifdef INTERNET_DOMAIN_SOCKETS - connect_type = make_connection(hostarg, portarg, &s); -#else - connect_type = make_connection(NULL, (u_short) 0, &s); -#endif - -#ifdef SYSV_IPC - if ((msgp = (struct msgbuf *) - malloc(sizeof *msgp + GSERV_BUFSZ)) == NULL) { - fprintf(stderr,"%s: not enough memory for message buffer\n",progname); - exit(1); - }; /* if */ - - msgp->mtext[0] = '\0'; /* ready for later strcats */ -#endif /* SYSV_IPC */ - - if (qflg) { - send_string(s,"(gnuserv-eval-quickly '(progn "); - } - else { - send_string(s,"(gnuserv-eval '(progn "); - }; - - if (optind < argc) { - for (; optind < argc; optind++) { - send_string(s, argv[optind]); - send_string(s, " "); - } - } else { - /* no sexp on the command line, so read it from stdin */ - int nb; - char buf[GSERV_BUFSZ]; - while ((nb = read(fileno(stdin), buf, GSERV_BUFSZ-1)) > 0) { - buf[nb] = '\0'; - send_string(s, buf); - } - } - send_string(s,"))"); - -#ifdef SYSV_IPC - if (connect_type == (int) CONN_IPC) - disconnect_from_ipc_server(s,msgp,!qflg); - else -#else /* !SYSV_IPC */ - disconnect_from_server(s,!qflg); -#endif /* !SYSV_IPC */ - - return 0; - -} /* main */ - -#endif /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */
--- a/lib-src/update-autoloads.sh Mon Aug 13 09:36:20 2007 +0200 +++ b/lib-src/update-autoloads.sh Mon Aug 13 09:37:19 2007 +0200 @@ -29,11 +29,9 @@ -a $dir != lisp/CVS \ -a $dir != lisp/SCCS \ -a $dir != lisp/egg \ - -a $dir != lisp/eterm \ -a $dir != lisp/its \ -a $dir != lisp/mule \ - -a $dir != lisp/quail \ - -a $dir != lisp/vms ; then + -a $dir != lisp/quail; then dirs="$dirs $dir" fi done
--- a/lisp/ChangeLog Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/ChangeLog Mon Aug 13 09:37:19 2007 +0200 @@ -1,3 +1,130 @@ +Thu May 22 04:19:09 1997 Martin Buchholz <mrb@eng.sun.com> + + * prim/files.el (auto-mode-alist): Reorg. Support + pre-processed fortran files. *.m4 files now default to autoconf mode. + + * prim/about.el: Promote Hrvoje. Picture still needed... + + * modes/ksh-mode.el: _ has symbol syntax. + * modes/m4-mode.el: _ has symbol syntax. + * modes/pascal.el: _ has symbol syntax. + * modes/f90.el: _ has symbol syntax. + * modes/cperl-mode.el: _ has symbol syntax. + * modes/autoconf-mode.el: _ has symbol syntax. + +1997-05-22 Steven L Baur <steve@altair.xemacs.org> + + * prim/files.el (save-buffer): From Hrvoje Niksic. Don't clear + zmacs region. + + * packages/func-menu.el: Update for David Hughes' new email + address. + +1997-05-21 Noah Friedman <friedman@prep.ai.mit.edu> + + * eldoc.el (eldoc-message-commands): Move docstring into comments, + since this isn't a user variable. + (eldoc-message-commands-table-size, eldoc-use-idle-timer-p, + eldoc-function-argstring-from-docstring-method-table): Use defvar, + not defconst. + (eldoc-last-data): Use cons explicitly; don't rely on dotted pair + read syntax. I'm worried the latter might get compiled as + read-only data someday. + (eldoc-docstring-message): If truncating symbol name, show ending + of name rather than beginning. The former is generally more unique. + (eldoc-function-argstring-from-docstring-method-table): Handle + pathological `save-restriction' case. + [top level]: Add `indent-for-tab-command' to eldoc-message-commands. + +1997-05-21 Steven L Baur <steve@altair.xemacs.org> + + * x11/x-menubar.el (default-menubar): strokes added to mouse + menu. + +Wed May 21 17:12:28 1997 Per Bothner <bothner@deneb.cygnus.com> + + * eterm/term.el (term-send-raw): Better XEmacs character event + handling. + * eterm/term.el (term-char-mode): Re-do Meta-handling by temporarily + setting meta-prefix-char to -1 while building keymaps. + (term-send-raw-meta): Removed. + +Tue Mar 11 20:15:26 1997 Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> + + * eterm/term.el (term-completion-addsuffix): Doc fix. + (term-dynamic-complete-as-filename): Support the case where + term-completion-addsuffix is a (DIRSUFFIX . FILESUFFIX) cons + pair. + +Tue Jun 4 10:15:54 1996 Per Bothner <bothner@deneb.cygnus.com> + + * eterm/term.el: Add kd, kl, kr, du capabilities. + * eterm/e/eterm.ti: Add kcub1, kcuf1, kcuu1, kcud1 capabilities. + +Wed May 15 14:38:45 1996 Per Bothner <bothner@deneb.cygnus.com> + + * eterm/term.el (term-send-raw-string): send-string -> + process-send-string. + * eterm/term.el (term-arguments): Remove unused local 'values'. + * eterm/term.el (term-handle-deferred-scroll): Fix off-by-one bug, + + * eterm/term.el: Merge changes from FSF (mostly typos). + +Mon Sep 25 17:19:51 1995 Per Bothner <bothner@kalessin.cygnus.com> + + * eterm/term.el (term-emulate-terminal): On CR, set + term-current-column to term-start-line-column, not 0. + +1997-05-21 Steven L Baur <steve@altair.xemacs.org> + + * packages/add-log.el (change-log-font-lock-keywords): Tweak + font-lock-keywords. + +1997-05-21 Erik Naggum <erik@naggum.no> + + * lisp/add-log.el (add-log-lisp-like-modes, add-log-c-like-modes, + add-log-tex-like-modes): New variables. + (add-log-current-defun): Use them instead of constant lists. + +1997-05-21 Steven L Baur <steve@altair.xemacs.org> + + * packages/add-log.el: Synch to Emacs 20.0. + + * prim/obsolete.el (read-minibuffer): Make compatible not obsolete. + (read-input): Ditto. + +Tue May 20 20:32:59 1997 Steven L Baur <steve@altair.xemacs.org> + + * prim/subr.el (buffer-substring-no-properties): Clean out extents + too. + +Mon May 19 19:48:35 1997 Steven L Baur <steve@altair.xemacs.org> + + * prim/process.el (shell-command-on-region): Remove region active + test (which played havoc with the hack in call-interactively to + place explicit calls to region-beginning and region-end in + interactive specs in the command history). + +Mon May 19 18:13:50 1997 Hrvoje Niksic <hniksic@srce.hr> + + * utils/easymenu.el (easy-menu-add): Check for existing, before + entering MENU to `easy-menu-all-popups'. + +Sun May 18 09:11:50 1997 Steven L Baur <steve@altair.xemacs.org> + + * prim/files.el (revert-buffer): Add optional third parameter to + preserve buffer modes (from Emacs 19.34.94). + (after-find-file): Add optional fifth parameter to preserve buffer + modes (from Emacs 19.34.94). + + * packages/vc.el: Synch with Emacs 19.34.94 because our version was + hopeless. + (vc-checkout): Autoload. + (vc-find-binary): Ditto. + + * prim/files.el (find-buffer-visiting): Restore because FSF vc.el + needs it. + Fri Apr 25 13:21:46 1997 Per Abrahamsen <abraham@dina.kvl.dk> * apropos.el (apropos): Add support for customization groups. @@ -1344,7 +1471,7 @@ * modes/m4-mode.el: Changed m4-program to point to /usr/bin/m4. -Sun Jan 12 18:49:30 1997 ~~ ~~/MORIOKA Tomohiko <morioka@jaist.ac.jp> +Sun Jan 12 18:49:30 1997 $B<i2,(B $BCNI'(B/MORIOKA Tomohiko <morioka@jaist.ac.jp> * mule/mule-misc.el: `-columns' -> `-width' and define `-columns' alias @@ -1894,7 +2021,7 @@ * utils/smtpmail.el: New file from Emacs 19.34. -Fri Dec 6 09:28:04 1996 ~~ ~~/MORIOKA Tomohiko <morioka@jaist.ac.jp> +Fri Dec 6 09:28:04 1996 $B<i2,(B $BCNI'(B/MORIOKA Tomohiko <morioka@jaist.ac.jp> * prim/startup.el (set-default-load-path): Set default-load-path dynamically since file-detect.el is dumped with XEmacs.
--- a/lisp/bytecomp/byte-optimize.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/bytecomp/byte-optimize.el Mon Aug 13 09:37:19 2007 +0200 @@ -649,8 +649,10 @@ ;; (byte-optimize-two-args-right form) ;; form)) +;; jwz: (byte-optimize-approx-equal 0.0 0.0) was returning nil +;; in xemacs 19.15 because it used < instead of <=. (defun byte-optimize-approx-equal (x y) - (< (* (abs (- x y)) 100) (abs (+ x y)))) + (<= (* (abs (- x y)) 100) (abs (+ x y)))) ;; Collect all the constants from FORM, after the STARTth arg, ;; and apply FUN to them to make one argument at the end. @@ -697,6 +699,22 @@ (condition-case () (eval form) (error form))) + + ;; `add1' and `sub1' are a marginally fewer instructions + ;; than `plus' and `minus', so use them when possible. + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) 1)) + (list '1+ (nth 1 form))) ; (+ x 1) --> (1+ x) + ((and (null (nthcdr 3 form)) + (eq (nth 1 form) 1)) + (list '1+ (nth 2 form))) ; (+ 1 x) --> (1+ x) + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) -1)) + (list '1- (nth 1 form))) ; (+ x -1) --> (1- x) + ((and (null (nthcdr 3 form)) + (eq (nth 1 form) -1)) + (list '1- (nth 2 form))) ; (+ -1 x) --> (1- x) + ;;; It is not safe to delete the function entirely ;;; (actually, it would be safe if we know the sole arg ;;; is not a marker). @@ -717,6 +735,7 @@ (numberp last)) (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form)) (delq last (copy-sequence (nthcdr 3 form)))))))) + (setq form ;;; It is not safe to delete the function entirely ;;; (actually, it would be safe if we know the sole arg ;;; is not a marker). @@ -728,6 +747,18 @@ (cons (car form) (cdr (cdr form))) form)) ;;; ) + ) + + ;; `add1' and `sub1' are a marginally fewer instructions than `plus' + ;; and `minus', so use them when possible. + (cond ((and (null (nthcdr 3 form)) + (eq (nth 2 form) 1)) + (list '1- (nth 1 form))) ; (- x 1) --> (1- x) + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) -1)) + (list '1+ (nth 1 form))) ; (- x -1) --> (1+ x) + (t + form)) ) (defun byte-optimize-multiply (form)
--- a/lisp/custom/ChangeLog Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/custom/ChangeLog Mon Aug 13 09:37:19 2007 +0200 @@ -1,3 +1,8 @@ +Tue May 20 19:17:01 1997 Steven L Baur <steve@altair.xemacs.org> + + * cus-edit.el (mule): New group for MULE merged emacsen. + (auto-save): Spelling fix. + Tue May 13 16:05:34 1997 Per Abrahamsen <abraham@dina.kvl.dk> * Version 1.97 released.
--- a/lisp/custom/cus-edit.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/custom/cus-edit.el Mon Aug 13 09:37:19 2007 +0200 @@ -307,7 +307,7 @@ :group 'environment) (defgroup auto-save nil - "Preventing accidential loss of data." + "Preventing accidental loss of data." :group 'data) (defgroup processes-basics nil @@ -318,6 +318,10 @@ "Windows within a frame." :group 'processes) +(defgroup mule nil + "MULE Emacs internationalization." + :group 'emacs) + ;;; Utilities. (defun custom-quote (sexp)
--- a/lisp/electric/electric.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/electric/electric.el Mon Aug 13 09:37:19 2007 +0200 @@ -75,9 +75,9 @@ current-mouse-event (and (or (button-press-event-p last-command-event) (button-release-event-p last-command-event) - (menu-event-p last-command-event)) + (misc-user-event-p last-command-event)) last-command-event) - this-command (if (menu-event-p last-command-event) + this-command (if (misc-user-event-p last-command-event) last-command-event (key-binding cmd t)) cmd this-command)
--- a/lisp/eterm/term.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/eterm/term.el Mon Aug 13 09:37:19 2007 +0200 @@ -1,5 +1,6 @@ -;; term.el --- general command interpreter in a window stuff -;; Copyright (C) 1988, 1990, 1992, 1994, 1995 Free Software Foundation, Inc. +;;; term.el --- general command interpreter in a window stuff + +;; Copyright (C) 1988-1995, 1997 Free Software Foundation, Inc. ;; Author: Per Bothner <bothner@cygnus.com> ;; Based on comint mode written by: Olin Shivers <shivers@cs.cmu.edu> @@ -18,75 +19,81 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Commentary: -;;; The changelog is at the end of this file. +;; The changelog is at the end of this file. -;;; Please send me bug reports, bug fixes, and extensions, so that I can -;;; merge them into the master source. -;;; - Per Bothner (bothner@cygnus.com) +;; Please send me bug reports, bug fixes, and extensions, so that I can +;; merge them into the master source. +;; - Per Bothner (bothner@cygnus.com) -;;; This file defines a general command-interpreter-in-a-buffer package -;;; (term mode). The idea is that you can build specific process-in-a-buffer -;;; modes on top of term mode -- e.g., lisp, shell, scheme, T, soar, .... -;;; This way, all these specific packages share a common base functionality, -;;; and a common set of bindings, which makes them easier to use (and -;;; saves code, implementation time, etc., etc.). +;; This file defines a general command-interpreter-in-a-buffer package +;; (term mode). The idea is that you can build specific process-in-a-buffer +;; modes on top of term mode -- e.g., lisp, shell, scheme, T, soar, .... +;; This way, all these specific packages share a common base functionality, +;; and a common set of bindings, which makes them easier to use (and +;; saves code, implementation time, etc., etc.). -;;; For hints on converting existing process modes (e.g., tex-mode, -;;; background, dbx, gdb, kermit, prolog, telnet) to use term-mode -;;; instead of shell-mode, see the notes at the end of this file. +;; For hints on converting existing process modes (e.g., tex-mode, +;; background, dbx, gdb, kermit, prolog, telnet) to use term-mode +;; instead of shell-mode, see the notes at the end of this file. -;;; Brief Command Documentation: -;;;============================================================================ -;;; Term Mode Commands: (common to all derived modes, like cmushell & cmulisp -;;; mode) -;;; -;;; m-p term-previous-input Cycle backwards in input history -;;; m-n term-next-input Cycle forwards -;;; m-r term-previous-matching-input Previous input matching a regexp -;;; m-s comint-next-matching-input Next input that matches -;;; return term-send-input -;;; c-c c-a term-bol Beginning of line; skip prompt. -;;; c-d term-delchar-or-maybe-eof Delete char unless at end of buff. -;;; c-c c-u term-kill-input ^u -;;; c-c c-w backward-kill-word ^w -;;; c-c c-c term-interrupt-subjob ^c -;;; c-c c-z term-stop-subjob ^z -;;; c-c c-\ term-quit-subjob ^\ -;;; c-c c-o term-kill-output Delete last batch of process output -;;; c-c c-r term-show-output Show last batch of process output -;;; c-c c-h term-dynamic-list-input-ring List input history -;;; -;;; Not bound by default in term-mode -;;; term-send-invisible Read a line w/o echo, and send to proc -;;; (These are bound in shell-mode) -;;; term-dynamic-complete Complete filename at point. -;;; term-dynamic-list-completions List completions in help buffer. -;;; term-replace-by-expanded-filename Expand and complete filename at point; -;;; replace with expanded/completed name. -;;; term-kill-subjob No mercy. -;;; term-show-maximum-output Show as much output as possible. -;;; term-continue-subjob Send CONT signal to buffer's process -;;; group. Useful if you accidentally -;;; suspend your process (with C-c C-z). +;; Brief Command Documentation: +;;============================================================================ +;; Term Mode Commands: (common to all derived modes, like cmushell & cmulisp +;; mode) +;; +;; m-p term-previous-input Cycle backwards in input history +;; m-n term-next-input Cycle forwards +;; m-r term-previous-matching-input Previous input matching a regexp +;; m-s comint-next-matching-input Next input that matches +;; return term-send-input +;; c-c c-a term-bol Beginning of line; skip prompt. +;; c-d term-delchar-or-maybe-eof Delete char unless at end of buff. +;; c-c c-u term-kill-input ^u +;; c-c c-w backward-kill-word ^w +;; c-c c-c term-interrupt-subjob ^c +;; c-c c-z term-stop-subjob ^z +;; c-c c-\ term-quit-subjob ^\ +;; c-c c-o term-kill-output Delete last batch of process output +;; c-c c-r term-show-output Show last batch of process output +;; c-c c-h term-dynamic-list-input-ring List input history +;; +;; Not bound by default in term-mode +;; term-send-invisible Read a line w/o echo, and send to proc +;; (These are bound in shell-mode) +;; term-dynamic-complete Complete filename at point. +;; term-dynamic-list-completions List completions in help buffer. +;; term-replace-by-expanded-filename Expand and complete filename at point; +;; replace with expanded/completed name. +;; term-kill-subjob No mercy. +;; term-show-maximum-output Show as much output as possible. +;; term-continue-subjob Send CONT signal to buffer's process +;; group. Useful if you accidentally +;; suspend your process (with C-c C-z). -;;; term-mode-hook is the term mode hook. Basically for your keybindings. -;;; term-load-hook is run after loading in this package. +;; term-mode-hook is the term mode hook. Basically for your keybindings. +;; term-load-hook is run after loading in this package. -;;; Code: +;; Code: -;;; This is passed to the inferior in the EMACS environment variable, -;;; so it is important to increase it if there are protocol-relevant changes. +;; This is passed to the inferior in the EMACS environment variable, +;; so it is important to increase it if there are protocol-relevant changes. (defconst term-protocol-version "0.95") (require 'ring) (require 'ehelp) +(if (fboundp 'defgroup) nil + (defmacro defgroup (&rest forms) nil) + (defmacro defcustom (name init doc &rest forms) + (list 'defvar name init doc))) + (defgroup term nil "General command interpreter in a window" :group 'processes @@ -229,9 +236,12 @@ The default is nil. -See variable `term-scroll-show-maximum-output'. -This variable is buffer-local." - :type 'boolean +See variable `term-scroll-show-maximum-output'. This variable is buffer-local." + :type '(choice (const :tag "off" nil) + (const t) + (const all) + (const this) + (const others)) :group 'term) (defcustom term-scroll-show-maximum-output nil @@ -299,7 +309,7 @@ "Called each time a process is exec'd by term-exec. This is called after the process is cranked up. It is useful for things that must be done each time a process is executed in a term-mode buffer (e.g., -(process-kill-without-query)). In contrast, the term-mode-hook is only +\(process-kill-without-query)). In contrast, the term-mode-hook is only executed once when the buffer is created." :type 'hook :group 'term) @@ -316,7 +326,7 @@ (defvar term-ptyp t "True if communications via pty; false if by pipe. Buffer local. -This is to work around a bug in emacs process signalling.") +This is to work around a bug in emacs process signaling.") (defvar term-last-input-match "" "Last string searched for by term input history search, for defaulting. @@ -667,7 +677,7 @@ (goto-char (process-mark proc)) (if (term-pager-enabled) (setq term-pager-count (term-current-row))) - (send-string proc chars)))) + (process-send-string proc chars)))) (defun term-send-raw () "Send the last character typed through the terminal-emulator @@ -677,9 +687,9 @@ (term-if-xemacs (if (key-press-event-p last-input-event) (let ((mods (event-modifiers last-input-event)) - (key (event-key last-input-event)) - meta) - (if (memq 'meta mods) + (key (event-key last-input-event)) + meta) + (if (memq 'meta mods) (progn (setq meta t) (setq mods (delq 'meta mods)))) @@ -689,12 +699,14 @@ nil ;; no meta mucking t ;; allow non-ASCII ))) - (if ascii - (if meta - (term-send-raw-string (format "\e%c" ascii)) - (term-send-raw-string (make-string 1 ascii))) - (command-execute (key-binding last-input-event))))))) - + (cond (ascii + (if meta + (term-send-raw-string (format "\e%c" ascii)) + (term-send-raw-string (make-string 1 ascii)))) + (t (command-execute (key-binding last-input-event)))))) + (let ((cmd (lookup-key (current-global-map) (this-command-keys)))) + (and cmd (call-interactively cmd))))) + (term-ifnot-xemacs ;; Convert `return' to C-m, etc. (if (and (symbolp last-input-char) @@ -702,23 +714,6 @@ (setq last-input-char (get last-input-char 'ascii-character))) (term-send-raw-string (make-string 1 last-input-char)))) -(defun term-send-raw-meta () - (interactive) - (if (symbolp last-input-char) - ;; Convert `return' to C-m, etc. - (let ((tmp (get last-input-char 'event-symbol-elements))) - (if tmp - (setq last-input-char (car tmp))) - (if (symbolp last-input-char) - (progn - (setq tmp (get last-input-char 'ascii-character)) - (if tmp (setq last-input-char tmp)))))) - (term-send-raw-string (if (and (numberp last-input-char) - (> last-input-char 127) - (< last-input-char 256)) - (make-string 1 last-input-char) - (format "\e%c" last-input-char)))) - (defun term-mouse-paste (click arg) "Insert the last stretch of killed text at the position clicked on." (interactive "e\nP") @@ -736,10 +731,18 @@ (t (1- arg))))))) ;; Which would be better: "\e[A" or "\eOA"? readline accepts either. +;; Both xterm and dtterm (CDE) send "\e[A", which argues for that choice. +;; The xterm termcap claims ku=\EOA; the dtterm terminfo entry says ku=\E[A. (defun term-send-up () (interactive) (term-send-raw-string "\e[A")) (defun term-send-down () (interactive) (term-send-raw-string "\e[B")) (defun term-send-right () (interactive) (term-send-raw-string "\e[C")) (defun term-send-left () (interactive) (term-send-raw-string "\e[D")) +(defun term-send-home () (interactive) (term-send-raw-string "\e[H")) +(defun term-send-end () (interactive) (term-send-raw-string "\eOw")) +(defun term-send-prior () (interactive) (term-send-raw-string "\e[5~")) +(defun term-send-next () (interactive) (term-send-raw-string "\e[6~")) +(defun term-send-del () (interactive) (term-send-raw-string "\C-?")) +(defun term-send-backspace () (interactive) (term-send-raw-string "\C-H")) (defun term-set-escape-char (c) "Change term-escape-char and keymaps that depend on it." @@ -747,7 +750,7 @@ (define-key term-raw-map term-escape-char 'term-send-raw)) (setq c (make-string 1 c)) (define-key term-raw-map c term-raw-escape-map) - ;; Define standard binings in term-raw-escape-map + ;; Define standard bindings in term-raw-escape-map (define-key term-raw-escape-map "\C-x" (lookup-key (current-global-map) "\C-x")) (define-key term-raw-escape-map "\C-v" @@ -766,32 +769,38 @@ intervention from emacs, except for the escape character (usually C-c)." (interactive) (if (not term-raw-map) - (let ((map (make-keymap))) + ;; Initialize term-raw-map. + (let* ((map (make-keymap)) + (save-meta-prefix-char meta-prefix-char) + (i 0)) + ;; Temporarily disable meta-prefix-char while building keymaps. + (setq meta-prefix-char -1) (term-if-xemacs - (set (make-local-variable 'meta-prefix-char) -1) (set-keymap-default-binding map 'term-send-raw)) (term-ifnot-xemacs - (let ((esc-map (make-keymap)) - (i 0)) - (while (< i 128) - (define-key map (make-string 1 i) 'term-send-raw) - (define-key esc-map (make-string 1 i) 'term-send-raw-meta) - (setq i (1+ i))) - (define-key map "\e" esc-map))) + (while (< i 128) + (define-key map (make-string 1 i) 'term-send-raw) + (setq i (1+ i)))) (setq term-raw-map map) (setq term-raw-escape-map (copy-keymap (lookup-key (current-global-map) "\C-x"))) - (term-if-emacs19 - (term-if-xemacs - (define-key term-raw-map [button2] 'term-mouse-paste)) - (term-ifnot-xemacs - (define-key term-raw-map [mouse-2] 'term-mouse-paste) - (define-key term-raw-map [menu-bar terminal] term-terminal-menu) - (define-key term-raw-map [menu-bar signals] term-signals-menu)) - (define-key term-raw-map [up] 'term-send-up) - (define-key term-raw-map [down] 'term-send-down) - (define-key term-raw-map [right] 'term-send-right) - (define-key term-raw-map [left] 'term-send-left)) + (define-key term-raw-map [up] 'term-send-up) + (define-key term-raw-map [down] 'term-send-down) + (define-key term-raw-map [right] 'term-send-right) + (define-key term-raw-map [left] 'term-send-left) + (define-key term-raw-map [home] 'term-send-home) + (define-key term-raw-map [end] 'term-send-end) + (define-key term-raw-map [prior] 'term-send-prior) + (define-key term-raw-map [next] 'term-send-next) + (term-if-xemacs + (define-key term-raw-map [button2] 'term-mouse-paste)) + (term-ifnot-xemacs + (define-key term-raw-map [mouse-2] 'term-mouse-paste) + (define-key term-raw-map [menu-bar terminal] term-terminal-menu) + (define-key term-raw-map [menu-bar signals] term-signals-menu) + (define-key term-raw-map [delete] 'term-send-del) + (define-key term-raw-map [backspace] 'term-send-backspace)) + (setq meta-prefix-char save-meta-prefix-char) (term-set-escape-char ?\C-c))) ;; FIXME: Emit message? Cfr ilisp-raw-message (if (term-in-line-mode) @@ -827,7 +836,7 @@ (if (term-in-char-mode) (if (term-pager-enabled) '(": char page %s") '(": char %s")) (if (term-pager-enabled) '(": line page %s") '(": line %s")))) - (set-buffer-modified-p (buffer-modified-p))) ;; Force mode line update. + (force-mode-line-update)) (defun term-check-proc (buffer) "True if there is a process associated w/buffer BUFFER, and @@ -910,11 +919,12 @@ :nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt\ :al=\\E[L:dl=\\E[M:DL=\\E[%%dM:AL=\\E[%%dL:cs=\\E[%%i%%d;%%dr:sf=\\n\ :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\ -:dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi:\ +:dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi\ +:kd=\\E[B:kl=\\E[D:kr=\\E[C:ku=\\E[A\ :so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m\ :UP=\\E[%%dA:DO=\\E[%%dB:LE=\\E[%%dD:RI=\\E[%%dC" ;;; : -undefine ic - "termcap capabilties supported") + "termcap capabilities supported") ;;; This auxiliary function cranks up the process for term-exec in ;;; the appropriate environment. @@ -1428,7 +1438,7 @@ (let ((argpart "[^ \n\t\"'`]+\\|\\(\"[^\"]*\"\\|'[^']*'\\|`[^`]*`\\)") (args ()) (pos 0) (count 0) - beg str value quotes) + beg str quotes) ;; Build a list of all the args until we have as many as we want. (while (and (or (null mth) (<= count mth)) (string-match argpart string pos)) @@ -1639,7 +1649,7 @@ (while (not done) (if stars (message "%s%s" prompt (make-string (length ans) ?*)) - (message prompt)) + (message "%s" prompt)) (setq c (read-char)) (cond ((= c ?\C-g) ;; This function may get called from a process filter, where @@ -2037,7 +2047,7 @@ (let ((H) (todo (+ count (/ (current-column) term-width)))) (end-of-line) - ;; The loop interates over buffer lines; + ;; The loop iterates over buffer lines; ;; H is the number of screen lines in the current line, i.e. ;; the ceiling of dividing the buffer line width by term-width. (while (and (<= (setq H (max (/ (+ (current-column) term-width -1) @@ -2062,7 +2072,7 @@ (progn (beginning-of-line) (not (bobp)))) (setq todo (- todo H)) - (backward-char)) ;; Move to end of previos line + (backward-char)) ;; Move to end of previous line. (if (and (>= todo H) (> todo 0)) (+ count todo (- 1 H)) ;; Hit beginning of buffer. (move-to-column (* (- H todo 1) term-width)) @@ -2241,7 +2251,7 @@ (setq i temp)) (t ;; Not followed by LF or can't optimize: (term-vertical-motion 0) - (setq term-current-column 0)))) + (setq term-current-column term-start-line-column)))) ((eq char ?\n) (if (not (and term-kill-echo-list (term-check-kill-echo-list))) @@ -2383,15 +2393,15 @@ (defun term-handle-deferred-scroll () (let ((count (- (term-current-row) term-height))) - (if (> count 0) + (if (>= count 0) (save-excursion (goto-char term-home-marker) - (term-vertical-motion count) + (term-vertical-motion (1+ count)) (set-marker term-home-marker (point)) (setq term-current-row (1- term-height)))))) ;;; Handle a character assuming (eq terminal-state 2) - -;;; i.e. we have previousely seen Escape followed by ?[. +;;; i.e. we have previously seen Escape followed by ?[. (defun term-handle-ansi-escape (proc char) (cond @@ -2476,7 +2486,7 @@ (defun term-scroll-region (top bottom) "Set scrolling region. TOP is the top-most line (inclusive) of the new scrolling region, -while BOTTOM is the line folling the new scrolling region (e.g. exclusive). +while BOTTOM is the line following the new scrolling region (e.g. exclusive). The top-most line is line 0." (setq term-scroll-start (if (or (< top 0) (>= top term-height)) @@ -2532,6 +2542,7 @@ (substring string (1+ first-colon) second-colon)))) (setq term-pending-frame (cons filename fileline)))) ((= (aref string 0) ?/) + ;; FIXME: If cd fails, should ignore, and not raise error. (cd (substring string 1))) ;; Allowing the inferior to call functions in emacs is ;; probably too big a security hole. @@ -2622,7 +2633,7 @@ (setq tmp (make-sparse-keymap "More pages?")) (define-key tmp [help] '("Help" . term-pager-help)) (define-key tmp [disable] - '("Diable paging" . term-fake-pager-disable)) + '("Disable paging" . term-fake-pager-disable)) (define-key tmp [discard] '("Discard remaining output" . term-pager-discard)) (define-key tmp [eob] '("Goto to end" . term-pager-eob)) @@ -2646,7 +2657,7 @@ mode-line-buffer-identification " [Type ? for help] " "%-")) - (set-buffer-modified-p (buffer-modified-p))) ;;No-op, but updates mode line. + (force-mode-line-update)) (defun term-pager-line (lines) (interactive "p") @@ -2759,7 +2770,7 @@ (use-local-map term-pager-old-local-map) (setq term-pager-old-local-map nil) (setq mode-line-format term-old-mode-line-format) - (set-buffer-modified-p (buffer-modified-p)) ;; Updates mode line. + (force-mode-line-update) (setq term-pager-count new-count) (set-process-filter process term-pager-old-filter) (funcall term-pager-old-filter process "") @@ -2997,7 +3008,9 @@ (defvar term-completion-addsuffix t "*If non-nil, add a `/' to completed directories, ` ' to file names. -This mirrors the optional behavior of tcsh.") +If a cons pair, it should be of the form (DIRSUFFIX . FILESUFFIX) where +DIRSUFFIX and FILESUFFIX are strings added on unambiguous or exact +completion. This mirrors the optional behavior of tcsh.") (defvar term-completion-recexact nil "*If non-nil, use shortest completion if characters cannot be added. @@ -3085,6 +3098,12 @@ (let* ((completion-ignore-case nil) (completion-ignored-extensions term-completion-fignore) (success t) + (dirsuffix (cond ((not term-completion-addsuffix) "") + ((not (consp term-completion-addsuffix)) "/") + (t (car term-completion-addsuffix)))) + (filesuffix (cond ((not term-completion-addsuffix) "") + ((not (consp term-completion-addsuffix)) " ") + (t (cdr term-completion-addsuffix)))) (filename (or (term-match-partial-filename) "")) (pathdir (file-name-directory filename)) (pathnondir (file-name-nondirectory filename)) @@ -3105,14 +3124,13 @@ (length pathnondir))) (cond ((symbolp (file-name-completion completion directory)) ;; We inserted a unique completion. - (if term-completion-addsuffix - (insert (if (file-directory-p file) "/" " "))) + (insert (if (file-directory-p file) dirsuffix filesuffix)) (or mini-flag (message "Completed"))) ((and term-completion-recexact term-completion-addsuffix (string-equal pathnondir completion) (file-exists-p file)) ;; It's not unique, but user wants shortest match. - (insert (if (file-directory-p file) "/" " ")) + (insert (if (file-directory-p file) dirsuffix filesuffix)) (or mini-flag (message "Completed shortest"))) ((or term-completion-autolist (string-equal pathnondir completion)) @@ -3221,7 +3239,10 @@ (set-window-configuration conf)) (if (eq first ?\ ) (set-window-configuration conf) - (setq unread-command-events (append key nil))))))) + (term-ifnot-xemacs + (setq unread-command-events (listify-key-sequence key))) + (term-if-xemacs + (setq unread-command-events (append key nil)))))))) ;;; Converting process modes to use term mode ;;; ===========================================================================
--- a/lisp/gnus/ChangeLog Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/ChangeLog Mon Aug 13 09:37:19 2007 +0200 @@ -1,3 +1,85 @@ +Sun May 18 07:35:43 1997 Lars Magne Ingebrigtsen <larsi@menja.ifi.uio.no> + + * gnus.el: Gnus v5.4.53 is released. + +Sun May 18 06:20:57 1997 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> + + * message.el (message-set-auto-save-file-name): Create unique auto + save file names. + + * gnus-topic.el (gnus-topic-tallied-groups): Removed. + (gnus-topic-prepare-topic): Output right number of articles in + each sub-topic. + + * gnus-sum.el (gnus-summary-next-group): Don't pass on killed + buffers. + + * nnmail.el (nnmail-article-group): When crossposted to `junk', do + `junk'. + + * gnus-util.el (gnus-kill-all-overlays): Remove nil overlays from + list. + + * gnus-art.el (gnus-article-treat-html): Don't kill buf. + + * gnus-group.el (gnus-group-find-new-newsgroups): Newish function. + +Sun May 18 06:16:41 1997 Kim-Minh Kaplan <kimminh.kaplan@utopia.eunet.fr> + + * gnus-picon.el (gnus-picons-has-modeline-p): new user variable. + (gnus-picons-set-buffer): new function. + (gnus-picons-prepare-for-annotations): use it. + (gnus-picons-network-display-internal): ditto. + (gnus-picons-make-annotation): new function. + (gnus-picons-display-x-face): use it. + (gnus-article-display-picons): ditto. + (gnus-picons-display-picon-or-name): ditto. + (gnus-picons-display-pairs): ditto. Remember the correct + order of insertion of annotations. + (gnus-picons-display-glyph): use gnus-picons-make-annotation. + (gnus-article-display-picons): move group annotations in article + buffer to the correct place if displaying in article buffer. + (gnus-picons-network-search-internal): don't display "@" if there + is no domain picon works again. Check that the picons still + need be displayed. Add the bar bar.xpm separator if + gnus-picons-display-as-address. + (gnus-picons-network-display-callback): check that the picon still + need be displayed. + (gnus-picons-lock): function deleted. + (gnus-picons-remove): don't use it. New way of locking. + (gnus-picons-next-job-internal): new way of locking. Handle + new tag 'bar. + (gnus-picons-next-job): new way of locking. + (gnus-picons-buffer): variable deleted. + (gnus-picons-remove-all): modified accordingly. + (gnus-group-annotations-lock): variable deleted. + (gnus-article-annotations-lock): variable deleted. + (gnus-x-face-annotations-lock): variable deleted. + (gnus-picons-news-directories): renamed, was + gnus-picons-news-directory. + (gnus-picons-url-retrieve): do not change url-show-status. + (gnus-picons-clear-cache): also clear gnus-picons-url-alist. + +Sun May 18 05:57:31 1997 Michael R. Cook <mcook@cognex.com> + + * gnus-topic.el (gnus-topic-toggle-display-empty-topics): New + function. + +Sun May 18 05:52:59 1997 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> + + * nnfolder.el (nnfolder-request-create-group): Read folder. + +Sat May 17 22:45:07 1997 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> + + * gnus-sum.el (gnus-summary-search-article): Require gnus-asynch. + + * nnweb.el (nnweb-dejanews-wash-article): Remove "More Headers". + +Sun May 11 20:07:21 1997 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> + + * gnus-art.el (article-hide-pgp): Run hook. + (gnus-article-hide-pgp-hook): New variable. + Sat May 10 00:37:32 1997 Lars Magne Ingebrigtsen <larsi@menja.ifi.uio.no> * gnus.el: Gnus v5.4.52 is released.
--- a/lisp/gnus/gnus-art.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/gnus-art.el Mon Aug 13 09:37:19 2007 +0200 @@ -395,6 +395,11 @@ :type 'hook :group 'gnus-article-various) +(defcustom gnus-article-hide-pgp-hook nil + "*A hook called after successfully hiding a PGP signature." + :type 'hook + :group 'gnus-article-various) + (defcustom gnus-article-button-face 'bold "Face used for highlighting buttons in the article buffer. @@ -964,7 +969,8 @@ (while (re-search-forward "^- " nil t) (gnus-article-hide-text-type (match-beginning 0) (match-end 0) 'pgp)) - (widen)))))) + (widen))) + (run-hooks 'gnus-article-hide-pgp-hook)))) (defun article-hide-pem (&optional arg) "Toggle hiding of any PEM headers and signatures in the current article. @@ -1130,8 +1136,7 @@ (setq buf (buffer-string)))) (when buf (delete-region (point-min) (point-max)) - (insert buf) - (kill-buffer buf)) + (insert buf)) (widen) (goto-char (point-min)) (set-window-start (get-buffer-window (current-buffer)) (point-min))
--- a/lisp/gnus/gnus-group.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/gnus-group.el Mon Aug 13 09:37:19 2007 +0200 @@ -444,7 +444,7 @@ "r" gnus-group-read-init-file "B" gnus-group-browse-foreign-server "b" gnus-group-check-bogus-groups - "F" gnus-find-new-newsgroups + "F" gnus-group-find-new-groups "\C-c\C-d" gnus-group-describe-group "\M-d" gnus-group-describe-all-groups "\C-c\C-a" gnus-group-apropos @@ -689,7 +689,7 @@ ["First unread group" gnus-group-first-unread-group t] ["Best unread group" gnus-group-best-unread-group t]) ["Delete bogus groups" gnus-group-check-bogus-groups t] - ["Find new newsgroups" gnus-find-new-newsgroups t] + ["Find new newsgroups" gnus-group-find-new-groups t] ["Transpose" gnus-group-transpose-groups (gnus-group-group-name)] ["Read a directory as a group..." gnus-group-enter-directory t])) @@ -3088,6 +3088,15 @@ (gnus-check-bogus-newsgroups (and (not silent) (not gnus-expert-user))) (gnus-group-list-groups)) +(defun gnus-group-find-new-groups (&optional arg) + "Search for new groups and add them. +Each new group will be treated with `gnus-subscribe-newsgroup-method.' +If ARG (the prefix), use the `ask-server' method to query +the server for new groups." + (interactive "P") + (gnus-find-new-newsgroups arg) + (gnus-group-list-groups)) + (defun gnus-group-edit-global-kill (&optional article group) "Edit the global kill file. If GROUP, edit that local kill file instead."
--- a/lisp/gnus/gnus-picon.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/gnus-picon.el Mon Aug 13 09:37:19 2007 +0200 @@ -23,9 +23,6 @@ ;;; Commentary: -;;; TODO: -;; See the comment in gnus-picons-remove - ;;; Code: (require 'gnus) @@ -45,17 +42,18 @@ also add gnus-article-display-picons to gnus-article-display-hook." :group 'gnus-visual) -(defcustom gnus-picons-buffer "*Icon Buffer*" - "Buffer name to display the icons in if gnus-picons-display-where is 'picons." - :type 'string - :group 'picons) - (defcustom gnus-picons-display-where 'picons "Where to display the group and article icons. Legal values are `article' and `picons'." :type '(choice symbol string) :group 'picons) +(defcustom gnus-picons-has-modeline-p t + "Wether the picons window should have a modeline. +This is only useful if `gnus-picons-display-where' is `picons'." + :type 'boolean + :group 'picons) + (defcustom gnus-picons-database "/usr/local/faces" "Defines the location of the faces database. For information on obtaining this database of pretty pictures, please @@ -63,10 +61,12 @@ :type 'directory :group 'picons) -(defcustom gnus-picons-news-directory "news" +(defcustom gnus-picons-news-directories '("news") "Sub-directory of the faces database containing the icons for newsgroups." - :type 'string + :type '(repeat string) :group 'picons) +(define-obsolete-variable-alias 'gnus-picons-news-directory + 'gnus-picons-news-directories) (defcustom gnus-picons-user-directories '("local" "users" "usenix" "misc") "List of directories to search for user faces." @@ -152,14 +152,11 @@ (defvar gnus-group-annotations nil "List of annotations added/removed when selecting/exiting a group") -(defvar gnus-group-annotations-lock nil) (defvar gnus-article-annotations nil "List of annotations added/removed when selecting an article") -(defvar gnus-article-annotations-lock nil) (defvar gnus-x-face-annotations nil "List of annotations added/removed when selecting an article with an X-Face.") -(defvar gnus-x-face-annotations-lock nil) (defvar gnus-picons-jobs-alist nil "List of jobs that still need be done. @@ -173,37 +170,27 @@ ;;; Functions: -(defsubst gnus-picons-lock (symbol) - (intern (concat (symbol-name symbol) "-lock"))) - (defun gnus-picons-remove (symbol) "Remove all annotations in variable named SYMBOL. This function is careful to set it to nil before removing anything so that asynchronous process don't get crazy." - ;; clear the lock - (set (gnus-picons-lock symbol) nil) + (setq gnus-picons-jobs-alist (remassq symbol gnus-picons-jobs-alist)) + ;; notify running job that it may have been preempted + (if (eq (car gnus-picons-job-already-running) symbol) + (setq gnus-picons-job-already-running t)) ;; clear all annotations (mapc (function (lambda (item) (if (annotationp item) (delete-annotation item)))) (prog1 (symbol-value symbol) - (set symbol nil))) - ;; FIXME: there's a race condition here. If a job is already - ;; running, it has already removed itself from this queue... But - ;; will still display its picon. - ;; TODO: push a request to clear an annotation. Then - ;; gnus-picons-next-job will be able to clean up when it gets the - ;; hand - (setq gnus-picons-jobs-alist (remassq symbol gnus-picons-jobs-alist))) + (set symbol nil)))) (defun gnus-picons-remove-all () "Removes all picons from the Gnus display(s)." (interactive) (gnus-picons-remove 'gnus-article-annotations) (gnus-picons-remove 'gnus-group-annotations) - (gnus-picons-remove 'gnus-x-face-annotations) - (when (bufferp gnus-picons-buffer) - (kill-buffer gnus-picons-buffer))) + (gnus-picons-remove 'gnus-x-face-annotations)) (defun gnus-get-buffer-name (variable) "Returns the buffer name associated with the contents of a variable." @@ -214,6 +201,22 @@ ((stringp newvar) newvar)))) ((stringp variable) variable))) +(defun gnus-picons-set-buffer () + (set-buffer + (get-buffer-create (gnus-get-buffer-name gnus-picons-display-where))) + (gnus-add-current-to-buffer-list) + (goto-char (point-min)) + (if (and (eq gnus-picons-display-where 'article) + gnus-picons-display-article-move-p) + (if (search-forward "\n\n" nil t) + (forward-line -1) + (goto-char (point-max))) + (setq buffer-read-only t) + (unless gnus-picons-has-modeline-p + (set-specifier has-modeline-p + (list (list (current-buffer) + (cons nil gnus-picons-has-modeline-p))))))) + (defun gnus-picons-prepare-for-annotations (annotations) "Prepare picons buffer for puting annotations memorized in ANNOTATIONS. ANNOTATIONS should be a symbol naming a variable wich contains a list of @@ -221,19 +224,14 @@ ;; let drawing catch up (when gnus-picons-refresh-before-display (sit-for 0)) - (set-buffer (get-buffer-create - (gnus-get-buffer-name gnus-picons-display-where))) - (gnus-add-current-to-buffer-list) - (goto-char (point-min)) - (if (and (eq gnus-picons-display-where 'article) - gnus-picons-display-article-move-p) - (when (search-forward "\n\n" nil t) - (forward-line -1)) - (make-local-variable 'inhibit-read-only) - (setq buffer-read-only t - inhibit-read-only nil)) + (gnus-picons-set-buffer) (gnus-picons-remove annotations)) +(defsubst gnus-picons-make-annotation (&rest args) + (let ((annot (apply 'make-annotation args))) + (set-extent-property annot 'duplicable nil) + annot)) + (defun gnus-picons-article-display-x-face () "Display the x-face header bitmap in the 'gnus-picons-display-where buffer." ;; delete any old ones. @@ -265,7 +263,7 @@ (save-excursion (gnus-picons-prepare-for-annotations 'gnus-x-face-annotations) (setq gnus-x-face-annotations - (cons (make-annotation + (cons (gnus-picons-make-annotation (vector 'xface :data (concat "X-Face: " (buffer-substring beg end buf))) @@ -276,7 +274,7 @@ (annot (save-excursion (gnus-picons-prepare-for-annotations 'gnus-x-face-annotations) - (make-annotation nil nil 'text))) + (gnus-picons-make-annotation nil nil 'text))) (process (start-process-shell-command "gnus-x-face" nil gnus-picons-convert-x-face))) (push annot gnus-x-face-annotations) @@ -306,18 +304,23 @@ (message-tokenize-header (substring from (1+ at-idx)) ".")))) (gnus-picons-prepare-for-annotations 'gnus-article-annotations) + ;; if display in article buffer, the group annotations + ;; wrongly placed. Move them here + (if (eq gnus-picons-display-where 'article) + (dolist (ext gnus-group-annotations) + (set-extent-endpoints ext (point) (point)))) (if (null gnus-picons-piconsearch-url) (setq gnus-article-annotations (nconc gnus-article-annotations (gnus-picons-display-pairs (gnus-picons-lookup-pairs addrs gnus-picons-domain-directories) - (not (or gnus-picons-display-as-address - gnus-article-annotations)) + gnus-picons-display-as-address "." t) (if (and gnus-picons-display-as-address addrs) - (list (make-annotation [string :data "@"] nil - 'text nil nil nil t))) + (list (gnus-picons-make-annotation + [string :data "@"] nil + 'text nil nil nil t))) (gnus-picons-display-picon-or-name (gnus-picons-lookup-user username addrs) username t))) @@ -340,13 +343,13 @@ (gnus-picons-display-pairs (gnus-picons-lookup-pairs (reverse (message-tokenize-header gnus-newsgroup-name ".")) - gnus-picons-news-directory) + gnus-picons-news-directories) t ".")) (push (list 'gnus-group-annotations 'search nil (message-tokenize-header gnus-newsgroup-name ".") - (if (listp gnus-picons-news-directory) - gnus-picons-news-directory - (list gnus-picons-news-directory)) + (if (listp gnus-picons-news-directories) + gnus-picons-news-directories + (list gnus-picons-news-directories)) nil) gnus-picons-jobs-alist) (gnus-picons-next-job)) @@ -404,40 +407,36 @@ (defun gnus-picons-display-picon-or-name (picon name &optional right-p) (cond (picon (gnus-picons-display-glyph picon name right-p)) - (gnus-picons-display-as-address (list (make-annotation + (gnus-picons-display-as-address (list (gnus-picons-make-annotation (vector 'string :data name) nil 'text nil nil nil right-p))))) (defun gnus-picons-display-pairs (pairs &optional bar-p dot-p right-p) "Display picons in list PAIRS." - (let ((bar (and bar-p (or gnus-picons-display-as-address - (annotations-in-region (point) - (min (point-max) - (1+ (point))) - (current-buffer))))) - (domain-p (and gnus-picons-display-as-address dot-p)) + (let ((domain-p (and gnus-picons-display-as-address dot-p)) pair picons) + (if (and bar-p domain-p right-p) + (setq picons (gnus-picons-display-glyph + (gnus-picons-try-face gnus-xmas-glyph-directory + "bar.") + nil right-p))) (while pairs (setq pair (pop pairs) - picons (nconc (if (and domain-p picons (not right-p)) - (list (make-annotation - (vector 'string :data dot-p) - nil 'text nil nil nil right-p))) + picons (nconc picons (gnus-picons-display-picon-or-name (car pair) (cadr pair) right-p) - (if (and domain-p pairs right-p) - (list (make-annotation + (if (and domain-p pairs) + (list (gnus-picons-make-annotation (vector 'string :data dot-p) - nil 'text nil nil nil right-p))) - (when (and bar domain-p) - (setq bar nil) + nil 'text nil nil nil right-p)))))) + (if (and bar-p domain-p (not right-p)) + (setq picons (nconc picons (gnus-picons-display-glyph (gnus-picons-try-face gnus-xmas-glyph-directory "bar.") - nil t)) - picons))) + nil right-p)))) picons)) (defun gnus-picons-try-face (dir &optional filebase) @@ -456,7 +455,8 @@ glyph)) (defun gnus-picons-display-glyph (glyph &optional part rightp) - (let ((new (make-annotation glyph (point) 'text nil nil nil rightp))) + (let ((new (gnus-picons-make-annotation glyph (point) + 'text nil nil nil rightp))) (when (and part gnus-picons-display-as-address) (set-annotation-data new (cons new (make-glyph (vector 'string :data part)))) @@ -466,8 +466,8 @@ (if (and (eq major-mode 'gnus-article-mode) (not gnus-picons-display-as-address) (not part)) - (list (make-annotation [string :data " "] - (point) 'text nil nil nil rightp)))))) + (list (gnus-picons-make-annotation [string :data " "] (point) + 'text nil nil nil rightp)))))) (defun gnus-picons-action-toggle (data) "Toggle annotation" @@ -480,7 +480,8 @@ (defun gnus-picons-clear-cache () "Clear the picons cache" (interactive) - (setq gnus-picons-glyph-alist nil)) + (setq gnus-picons-glyph-alist nil + gnus-picons-url-alist nil)) (gnus-add-shutdown 'gnus-picons-close 'gnus) @@ -497,14 +498,13 @@ (defun gnus-picons-url-retrieve (url fn arg) (let ((old-asynch (default-value 'url-be-asynchronous)) (url-working-buffer (generate-new-buffer " *picons*")) - (url-request-method nil) (url-package-name "Gnus") - (url-package-version gnus-version-number)) + (url-package-version gnus-version-number) + url-request-method) (setq-default url-be-asynchronous t) (save-excursion (set-buffer url-working-buffer) (setq url-be-asynchronous t - url-show-status nil url-current-callback-data arg url-current-callback-func fn) (url-retrieve url t)) @@ -588,8 +588,7 @@ ;;; picon network display functions : (defun gnus-picons-network-display-internal (sym-ann glyph part right-p) - (set-buffer - (get-buffer-create (gnus-get-buffer-name gnus-picons-display-where))) + (gnus-picons-set-buffer) (set sym-ann (nconc (symbol-value sym-ann) (gnus-picons-display-picon-or-name glyph part right-p))) (gnus-picons-next-job-internal)) @@ -599,7 +598,11 @@ w3-image-mappings))))) (kill-buffer (current-buffer)) (push (cons url glyph) gnus-picons-glyph-alist) - (gnus-picons-network-display-internal sym-ann glyph part right-p))) + ;; only do the job if it has not been preempted. + (if (equal gnus-picons-job-already-running + (list sym-ann 'picon url part right-p)) + (gnus-picons-network-display-internal sym-ann glyph part right-p) + (gnus-picons-next-job-internal)))) (defun gnus-picons-network-display (url part sym-ann right-p) (let ((cache (assoc url gnus-picons-glyph-alist))) @@ -665,8 +668,16 @@ (if (and gnus-picons-display-as-address new-jobs) (push (list sym-ann "@" right-p) new-jobs)) (push (list sym-ann 'picon (cdr cache) user right-p) new-jobs)) - (setq gnus-picons-jobs-alist (nconc (nreverse new-jobs) - gnus-picons-jobs-alist)) + (if (and gnus-picons-display-as-address (not right-p)) + (push (list sym-ann 'bar right-p) new-jobs)) + ;; only put the jobs in the queue if this job has not been preempted. + (if (equal gnus-picons-job-already-running + (list sym-ann 'search user addrs dbs right-p)) + (setq gnus-picons-jobs-alist + (nconc (if (and gnus-picons-display-as-address right-p) + (list (list sym-ann 'bar right-p))) + (nreverse new-jobs) + gnus-picons-jobs-alist))) (gnus-picons-next-job-internal))) (defun gnus-picons-network-search-callback (user addrs dbs sym-ann right-p) @@ -696,31 +707,33 @@ (gnus-picons-network-search-internal user addrs dbs sym-ann right-p)))) ;;; Main jobs dispatcher function -;; Given that XEmacs is not really multi threaded, this locking should -;; be sufficient (defun gnus-picons-next-job-internal () - (if gnus-picons-jobs-alist - (let* ((job (pop gnus-picons-jobs-alist)) + (if (setq gnus-picons-job-already-running (pop gnus-picons-jobs-alist)) + (let* ((job gnus-picons-job-already-running) (sym-ann (pop job)) (tag (pop job))) (if tag (cond ((stringp tag);; (SYM-ANN "..." RIGHT-P) (gnus-picons-network-display-internal sym-ann nil tag (pop job))) + ((eq 'bar tag) + (gnus-picons-network-display-internal + sym-ann (gnus-picons-try-face gnus-xmas-glyph-directory + "bar.") + nil (pop job))) ((eq 'search tag);; (SYM-ANN 'search USER ADDRS DBS RIGHT-P) (gnus-picons-network-search (pop job) (pop job) (pop job) sym-ann (pop job))) ((eq 'picon tag);; (SYM-ANN 'picon URL PART RIGHT-P) (gnus-picons-network-display (pop job) (pop job) sym-ann (pop job))) - (t (error "Unknown picon job tag %s" tag))))) - (setq gnus-picons-job-already-running nil))) + (t (setq gnus-picons-job-already-running nil) + (error "Unknown picon job tag %s" tag))))))) (defun gnus-picons-next-job () - "Start processing the job queue." + "Start processing the job queue if it is not in progress" (unless gnus-picons-job-already-running - (setq gnus-picons-job-already-running t) (gnus-picons-next-job-internal))) (provide 'gnus-picon)
--- a/lisp/gnus/gnus-sum.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/gnus-sum.el Mon Aug 13 09:37:19 2007 +0200 @@ -5145,7 +5145,8 @@ (if (and (or (eq t unreads) (and unreads (not (zerop unreads)))) (gnus-summary-read-group - target-group nil no-article current-buffer)) + target-group nil no-article + (and (buffer-name current-buffer) current-buffer))) (setq entered t) (setq current-group target-group target-group nil))))))) @@ -6331,6 +6332,9 @@ "Search for an article containing REGEXP. Optional argument BACKWARD means do search for backward. `gnus-select-article-hook' is not called during the search." + ;; We have to require this here to make sure that the following + ;; dynamic binding isn't shadowed by autoloading. + (require 'gnus-asynch) (let ((gnus-select-article-hook nil) ;Disable hook. (gnus-article-display-hook nil) (gnus-mark-article-hook nil) ;Inhibit marking as read.
--- a/lisp/gnus/gnus-topic.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/gnus-topic.el Mon Aug 13 09:37:19 2007 +0200 @@ -77,7 +77,6 @@ (defvar gnus-topic-killed-topics nil) (defvar gnus-topic-inhibit-change-level nil) -(defvar gnus-topic-tallied-groups nil) (defconst gnus-topic-line-format-alist `((?n name ?s) @@ -362,8 +361,6 @@ (let ((buffer-read-only nil) (lowest (or lowest 1))) - (setq gnus-topic-tallied-groups nil) - (when (or (not gnus-topic-alist) (not gnus-topology-checked-p)) (gnus-topic-check-topology)) @@ -439,10 +436,7 @@ (gnus-info-level info) (gnus-info-marks info) (car entry) (gnus-info-method info))))) (when (and (listp entry) - (numberp (car entry)) - (not (member (gnus-info-group (setq info (nth 2 entry))) - gnus-topic-tallied-groups))) - (push (gnus-info-group info) gnus-topic-tallied-groups) + (numberp (car entry))) (incf unread (car entry))) (when (listp entry) (setq tick t))) @@ -648,7 +642,6 @@ (setq gnus-topic-active-topology nil gnus-topic-active-alist nil gnus-topic-killed-topics nil - gnus-topic-tallied-groups nil gnus-topology-checked-p nil)) (defun gnus-topic-check-topology () @@ -900,7 +893,8 @@ "\C-i" gnus-topic-indent [tab] gnus-topic-indent "r" gnus-topic-rename - "\177" gnus-topic-delete) + "\177" gnus-topic-delete + "h" gnus-topic-toggle-display-empty-topics) (gnus-define-keys (gnus-topic-sort-map "S" gnus-group-topic-map) "s" gnus-topic-sort-groups @@ -930,7 +924,8 @@ ["Rename" gnus-topic-rename t] ["Create" gnus-topic-create-topic t] ["Mark" gnus-topic-mark-topic t] - ["Indent" gnus-topic-indent t]) + ["Indent" gnus-topic-indent t] + ["Toggle hide empty" gnus-topic-toggle-display-empty-topics t]) ["List active" gnus-topic-list-active t])))) (defun gnus-topic-mode (&optional arg redisplay) @@ -1305,6 +1300,15 @@ gnus-killed-list gnus-zombie-list) (gnus-group-list-groups 9 nil 1))) +(defun gnus-topic-toggle-display-empty-topics () + "Show/hide topics that have no unread articles." + (interactive) + (setq gnus-topic-display-empty-topics + (not gnus-topic-display-empty-topics)) + (message "%s empty topics" + (if gnus-topic-display-empty-topics + "Showing" "Hiding"))) + ;;; Topic sorting functions (defun gnus-topic-edit-parameters (group)
--- a/lisp/gnus/gnus-util.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/gnus-util.el Mon Aug 13 09:37:19 2007 +0200 @@ -528,7 +528,7 @@ (unless gnus-xemacs (let* ((overlayss (overlay-lists)) (buffer-read-only nil) - (overlays (nconc (car overlayss) (cdr overlayss)))) + (overlays (delq nil (nconc (car overlayss) (cdr overlayss))))) (while overlays (delete-overlay (pop overlays))))))
--- a/lisp/gnus/gnus.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/gnus.el Mon Aug 13 09:37:19 2007 +0200 @@ -226,7 +226,7 @@ :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) -(defconst gnus-version-number "5.4.52" +(defconst gnus-version-number "5.4.53" "Version number for this version of Gnus.") (defconst gnus-version (format "Gnus v%s" gnus-version-number)
--- a/lisp/gnus/message.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/message.el Mon Aug 13 09:37:19 2007 +0200 @@ -2968,7 +2968,7 @@ (let ((name (make-temp-name (expand-file-name (concat (file-name-as-directory message-autosave-directory) - "msg."))))) + "msg." (buffer-name)))))) (setq buffer-auto-save-file-name (save-excursion (prog1
--- a/lisp/gnus/nnfolder.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/nnfolder.el Mon Aug 13 09:37:19 2007 +0200 @@ -276,7 +276,8 @@ (when group (unless (assoc group nnfolder-group-alist) (push (list group (cons 1 0)) nnfolder-group-alist) - (nnmail-save-active nnfolder-group-alist nnfolder-active-file))) + (nnmail-save-active nnfolder-group-alist nnfolder-active-file) + (nnfolder-read-folder group))) t) (deffoo nnfolder-request-list (&optional server)
--- a/lisp/gnus/nnmail.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/nnmail.el Mon Aug 13 09:37:19 2007 +0200 @@ -1082,7 +1082,10 @@ ;; See whether the split methods returned `junk'. (if (equal group-art '(junk)) nil - (nreverse (delq 'junk group-art))))))) + ;; The article may be "cross-posted" to `junk'. What + ;; to do? Just remove the `junk' spec. Don't really + ;; see anything else to do... + (nreverse (delq (assq 'junk group-art) group-art))))))) (defun nnmail-insert-lines () "Insert how many lines there are in the body of the mail.
--- a/lisp/gnus/nnweb.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/gnus/nnweb.el Mon Aug 13 09:37:19 2007 +0200 @@ -441,7 +441,10 @@ (replace-match "\\1 " t) (forward-line 1)) (when (re-search-forward "\n\n+" nil t) - (replace-match "\n" t t)))) + (replace-match "\n" t t)) + (goto-char (point-min)) + (when (search-forward "[More Headers]" nil t) + (replace-match "" t t)))) (defun nnweb-dejanews-search (search) (nnweb-fetch-form
--- a/lisp/locale/ja/locale-start.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/locale/ja/locale-start.el Mon Aug 13 09:37:19 2007 +0200 @@ -36,34 +36,34 @@ ,@(if (featurep 'sparcworks) `( "\ -$(B%5%s$O!"(BWorkShop/Emacs $(BE}9g2=%Q%C%1!<%8$N$_$r%5%]!<%H$7$^$9!#(B -$(BB>$N(B XEmacs $(B%Q%C%1!<%8$O$9$Y$F!"!V8=>u$N$^$^!W$G6!5k$5$l$^$9!#(B -$(B>\:Y(B ($(B1QJ8(B) $(B$O(B" (key describe-no-warranty) "$(B$H%?%$%W$7$F!"(B -1991 $(BG/(B 6 $(B7nHG(B GPL $(B%P!<%8%g%s(B 2 $(B$r$4Mw$/$@$5$$!#(B -$(BK\(B XEmacs $(B$O4pK\%a%K%e!<$K8B$jF|K\8l2=$5$l$F$$$^$9!#AH$_9~$^$l$?(B -$(B%a!<%k(B (VM$(B!"(BMH) $(B$d%K%e!<%9$rFI$`$?$a$N%Q%C%1!<%8(B (Gnus) $(BEy$O!"(B -$(BF|K\8l$r40`z$K$O=hM}$G$-$^$;$s$N$G!"$4;HMQ$K$J$k>l9g$O==J,$4Cm0U(B -$(B$/$@$5$$!#(B\n") +$B%5%s$O!"(BWorkShop/Emacs $BE}9g2=%Q%C%1!<%8$N$_$r%5%]!<%H$7$^$9!#(B +$BB>$N(B XEmacs $B%Q%C%1!<%8$O$9$Y$F!"!V8=>u$N$^$^!W$G6!5k$5$l$^$9!#(B +$B>\:Y(B ($B1QJ8(B) $B$O(B" (key describe-no-warranty) "$B$H%?%$%W$7$F!"(B +1991 $BG/(B 6 $B7nHG(B GPL $B%P!<%8%g%s(B 2 $B$r$4Mw$/$@$5$$!#(B +$BK\(B XEmacs $B$O4pK\%a%K%e!<$K8B$jF|K\8l2=$5$l$F$$$^$9!#AH$_9~$^$l$?(B +$B%a!<%k(B (VM$B!"(BMH) $B$d%K%e!<%9$rFI$`$?$a$N%Q%C%1!<%8(B (Gnus) $BEy$O!"(B +$BF|K\8l$r40`z$K$O=hM}$G$-$^$;$s$N$G!"$4;HMQ$K$J$k>l9g$O==J,$4Cm0U(B +$B$/$@$5$$!#(B\n") - '("XEmacs $(B$K$O(B *$(B$^$C$?$/2?$N(B* $(BJ]>c$b$"$j$^$;$s!#>\:Y$O!"(B" - (key describe-no-warranty) "$(B$r%?%$%W$7$F$/$@$5$$!#(B\n")) + '("XEmacs $B$K$O(B *$B$^$C$?$/2?$N(B* $BJ]>c$b$"$j$^$;$s!#>\:Y$O!"(B" + (key describe-no-warranty) "$B$r%?%$%W$7$F$/$@$5$$!#(B\n")) - "XEmacs $(B$NJ#@=$O5v2D$5$l$F$$$^$9!#5v2D$N>r7o$r8+$k$K$O!"(B\n" - (key describe-copying) " $(B$H%?%$%W$7$F$/$@$5$$!#(B\n" - "$(B:G?7HG$N<hF@J}K!$K$D$$$F$O!"(B" (key describe-distribution) - " $(B$H%?%$%W$7$F$/$@$5$$!#(B\n\n" + "XEmacs $B$NJ#@=$O5v2D$5$l$F$$$^$9!#5v2D$N>r7o$r8+$k$K$O!"(B\n" + (key describe-copying) " $B$H%?%$%W$7$F$/$@$5$$!#(B\n" + "$B:G?7HG$N<hF@J}K!$K$D$$$F$O!"(B" (key describe-distribution) + " $B$H%?%$%W$7$F$/$@$5$$!#(B\n\n" - "$(B%X%k%W>pJs$r8+$k$K$O!"(B" (key help-command) " $(B$H%?%$%W!"$^$?$O(B" - (face bold "$(B%X%k%W(B") "$(B%a%K%e!<$r;HMQ(B\n" - "$(B$7$F$/$@$5$$(B\n" - (key advertised-undo) " $(B$K$h$jJQ99$r<h$j>C$;$^$;$9!#(B(C- $(B$O!"(BControl $(B%-!<$G$9!#(B)\n" - "XEmacs $(B$r=*N;$9$k$K$O!"(B" (key save-buffers-kill-emacs) " $(B$H%?%$%W$7$F$/$@$5$$!#(B\n" - (key help-with-tutorial) " $(B$G(B XEmacs $(B$N;HMQJ}K!$N<B=,$r3+;O$G$-$^$9!#(B\n" - (key info) " $(B$K$h$j!"(BInfo $(B%b!<%I$KF~$j!"%*%s%i%$%s$N%I%-%e%a%s%H$r(B\n" - "$(BFI$`$3$H$,$G$-$^$9!#(B\n" + "$B%X%k%W>pJs$r8+$k$K$O!"(B" (key help-command) " $B$H%?%$%W!"$^$?$O(B" + (face bold "$B%X%k%W(B") "$B%a%K%e!<$r;HMQ(B\n" + "$B$7$F$/$@$5$$(B\n" + (key advertised-undo) " $B$K$h$jJQ99$r<h$j>C$;$^$;$9!#(B(C- $B$O!"(BControl $B%-!<$G$9!#(B)\n" + "XEmacs $B$r=*N;$9$k$K$O!"(B" (key save-buffers-kill-emacs) " $B$H%?%$%W$7$F$/$@$5$$!#(B\n" + (key help-with-tutorial) " $B$G(B XEmacs $B$N;HMQJ}K!$N<B=,$r3+;O$G$-$^$9!#(B\n" + (key info) " $B$K$h$j!"(BInfo $B%b!<%I$KF~$j!"%*%s%i%$%s$N%I%-%e%a%s%H$r(B\n" + "$BFI$`$3$H$,$G$-$^$9!#(B\n" (face (bold red) ( "\ -$(BIQHK$K?R$M$i$l$k<ALd$H$=$NEz$($O!"(BXEmacs $(BLdEz=8$K$"$j$^$9!#(B\n" - "$(B%X%k%W%a%K%e!<$r;HMQ$9$k$+!"(B"(key xemacs-local-faq) " $(B$H%?%$%W$7$F$/$@$5$$!#(B")))) +$BIQHK$K?R$M$i$l$k<ALd$H$=$NEz$($O!"(BXEmacs $BLdEz=8$K$"$j$^$9!#(B\n" + "$B%X%k%W%a%K%e!<$r;HMQ$9$k$+!"(B"(key xemacs-local-faq) " $B$H%?%$%W$7$F$/$@$5$$!#(B")))) (defun command-line-do-help (arg) @@ -72,26 +72,26 @@ (princ (concat "\n" (emacs-version) "\n\n")) (princ (if (featurep 'x) - "XEmacs $(B$O!"(BX $(B%D!<%k%-%C%H$NI8=`%3%^%s%I%*%W%7%g%s$r$9$Y$FG'<1$7$^$9!#(B\n$(B$=$l$K2C$($F!"(B" - "XEmacs $(B$O!"(B ")) - (princ " $(B0J2<$N%*%W%7%g%s$rG'<1$7!"=P8==g$K=hM}$7$^$9(B: + "XEmacs $B$O!"(BX $B%D!<%k%-%C%H$NI8=`%3%^%s%I%*%W%7%g%s$r$9$Y$FG'<1$7$^$9!#(B\n$B$=$l$K2C$($F!"(B" + "XEmacs $B$O!"(B ")) + (princ " $B0J2<$N%*%W%7%g%s$rG'<1$7!"=P8==g$K=hM}$7$^$9(B: - -t $(B%G%P%$%9L>(B $(BC<Kv$NBe$o$j$K;XDj$N(B TTY $(B%G%P%$%9$r;HMQ$7$FF~=PNO$r(B - $(B9T$J$&!#(B-nw $(B$,<+F0E*$K2>Dj$5$l$k!#(B - -nw $(B%&%#%s%I%&%7%9%F%`$r;HMQ$;$:!"8=(B TTY $(B$r;HMQ!#(B($(BCm(B: TTY - $(B%b!<%I$G$NF|K\8lI=<($O!"K\%P!<%8%g%s$N(B XEmacs $(B$G$O$G$-(B - $(B$^$;$s!#(B) - -batch $(BHsBPOCE*;HMQ!#%a%C%;!<%8$O!"I8=`%(%i!<(B (stderr) $(B%X!#(B - -debug-init $(B=i4|2=%U%!%$%k$G$N%(%i!<H/@8;~$K$O%G%P%C%,$r5/F0!#(B - -unmapped $(B=i4|%U%l!<%`$N%^%C%W$r$7$J$$!#(B - -no-site-file $(B%5%$%HFC2==i4|2=%U%!%$%k(B (site-start.el) $(B$rFI$_9~$^$J$$!#(B - -no-init-file $(B%f!<%6!<FC2==i4|2=%U%!%$%k(B (~/.emacs) $(B$rFI$_9~$^$J$$!#(B - -q -no-init-file $(B$HF15A!#(B - -user $(B%f!<%6!<L>(B $(B<+J,$N=i4|2=%U%!%$%k$NBe$o$j$K;XDj%f!<%6!<$N%U%!%$%k$r;HMQ!#(B - -u $(B%f!<%6!<L>(B -user $(B$HF15A!#(B\n") -;; $(B1Q8lHG$G$O!"0J2<$N$h$&$J%3!<%I$K$h$j!"%I%-%e%a%s%H$N0lIt$,I=<($5$l$F$$$?$,!"(B -;; $(B$3$l$G$O!"1Q8l$N%I%-%e%a%s%H$7$+I=<($G$-$J$$$N$G!"$3$N%3!<%I$O%3%a%s%H%"%&%H$7!"(B -;; $(BC1=c$K@bL@$r0u;z$9$k%3!<%I$HCV$-49$($k!#(B + -t $B%G%P%$%9L>(B $BC<Kv$NBe$o$j$K;XDj$N(B TTY $B%G%P%$%9$r;HMQ$7$FF~=PNO$r(B + $B9T$J$&!#(B-nw $B$,<+F0E*$K2>Dj$5$l$k!#(B + -nw $B%&%#%s%I%&%7%9%F%`$r;HMQ$;$:!"8=(B TTY $B$r;HMQ!#(B($BCm(B: TTY + $B%b!<%I$G$NF|K\8lI=<($O!"K\%P!<%8%g%s$N(B XEmacs $B$G$O$G$-(B + $B$^$;$s!#(B) + -batch $BHsBPOCE*;HMQ!#%a%C%;!<%8$O!"I8=`%(%i!<(B (stderr) $B%X!#(B + -debug-init $B=i4|2=%U%!%$%k$G$N%(%i!<H/@8;~$K$O%G%P%C%,$r5/F0!#(B + -unmapped $B=i4|%U%l!<%`$N%^%C%W$r$7$J$$!#(B + -no-site-file $B%5%$%HFC2==i4|2=%U%!%$%k(B (site-start.el) $B$rFI$_9~$^$J$$!#(B + -no-init-file $B%f!<%6!<FC2==i4|2=%U%!%$%k(B (~/.emacs) $B$rFI$_9~$^$J$$!#(B + -q -no-init-file $B$HF15A!#(B + -user $B%f!<%6!<L>(B $B<+J,$N=i4|2=%U%!%$%k$NBe$o$j$K;XDj%f!<%6!<$N%U%!%$%k$r;HMQ!#(B + -u $B%f!<%6!<L>(B -user $B$HF15A!#(B\n") +;; $B1Q8lHG$G$O!"0J2<$N$h$&$J%3!<%I$K$h$j!"%I%-%e%a%s%H$N0lIt$,I=<($5$l$F$$$?$,!"(B +;; $B$3$l$G$O!"1Q8l$N%I%-%e%a%s%H$7$+I=<($G$-$J$$$N$G!"$3$N%3!<%I$O%3%a%s%H%"%&%H$7!"(B +;; $BC1=c$K@bL@$r0u;z$9$k%3!<%I$HCV$-49$($k!#(B ;; (let ((l command-switch-alis\nt) ;; (insert (lambda (&rest x) ;; (princ " ") @@ -130,32 +130,32 @@ ;; (princ doc) ;; (terpri)))) ;; (setq l (cdr l)))) -;; $(BCV$-49$(ItJ,3+;O(B +;; $BCV$-49$(ItJ,3+;O(B (princ "\ - -help XEmacs $(B;HMQK!$rI=<($7$F=*N;!#(B - -flags -help $(B$HF15A!#(B - -h -help $(B$HF15A!#(B - -? -help $(B$HF15A!#(B - -version $(B%P!<%8%g%s>pJs$rI=<($7$F=*N;!#(B - -V -version $(B$HF15A!#(B - -funcall $(B4X?tL>(B $(B;XDj$N(B lisp $(B4X?t$r0z?t$J$7$G5/F0!#(B - -f $(B4X?tL>(B -funcall $(B$HF15A!#(B - -eval $(B%U%)!<%`(B lisp $(B$N%U%)!<%`$rI>2A!#0zMQ(B (quote) $(B$OCm0U?<$/9T$J$C$F$/$@$5$$!#(B - -load $(B%U%!%$%kL>(B $(B;XDj$N(B lisp $(B%3!<%I$r(B XEmacs $(B$KFI$_9~$`!#(B - -l $(B%U%!%$%kL>(B -load $(B$HF15A!#(B - -insert $(B%U%!%$%kL>(B $(B8=%P%C%U%!$K%U%!%$%k$rA^F~!#(B - -i $(B%U%!%$%kL>(B -insert $(B$HF15A!#(B - -kill XEmacs $(B$r=*N;!#(B - -tooltalk ToolTalk $(B%5!<%P!<$K@\B3!#(B\n") -;; $(BCV$-49$(ItJ,=*N;(B + -help XEmacs $B;HMQK!$rI=<($7$F=*N;!#(B + -flags -help $B$HF15A!#(B + -h -help $B$HF15A!#(B + -? -help $B$HF15A!#(B + -version $B%P!<%8%g%s>pJs$rI=<($7$F=*N;!#(B + -V -version $B$HF15A!#(B + -funcall $B4X?tL>(B $B;XDj$N(B lisp $B4X?t$r0z?t$J$7$G5/F0!#(B + -f $B4X?tL>(B -funcall $B$HF15A!#(B + -eval $B%U%)!<%`(B lisp $B$N%U%)!<%`$rI>2A!#0zMQ(B (quote) $B$OCm0U?<$/9T$J$C$F$/$@$5$$!#(B + -load $B%U%!%$%kL>(B $B;XDj$N(B lisp $B%3!<%I$r(B XEmacs $B$KFI$_9~$`!#(B + -l $B%U%!%$%kL>(B -load $B$HF15A!#(B + -insert $B%U%!%$%kL>(B $B8=%P%C%U%!$K%U%!%$%k$rA^F~!#(B + -i $B%U%!%$%kL>(B -insert $B$HF15A!#(B + -kill XEmacs $B$r=*N;!#(B + -tooltalk ToolTalk $B%5!<%P!<$K@\B3!#(B\n") +;; $BCV$-49$(ItJ,=*N;(B (princ "\ - +N $(B%U%!%$%kL>(B $(B;XDj%U%!%$%k$r(B N $(B9TL\$+$iI=<(!#(B + +N $B%U%!%$%kL>(B $B;XDj%U%!%$%k$r(B N $B9TL\$+$iI=<(!#(B -$(BB>$N$9$Y$F7A<0$N0z?t$O%U%!%$%kL>$H2r<a$5$l!"JT=8$N$?$a$K%P%C%U%!$KFI$_9~$^(B -$(B$l$^$9!#(B +$BB>$N$9$Y$F7A<0$N0z?t$O%U%!%$%kL>$H2r<a$5$l!"JT=8$N$?$a$K%P%C%U%!$KFI$_9~$^(B +$B$l$^$9!#(B -XEmacs $(B$K$O!"%*%s%i%$%s$N<+=,=q$H%^%K%e%"%k(B ($(BN>J}$H$b1Q8lHG$N$_(B) $(B$,IUB0$7(B -$(B$F$$$^$9!#<+=,=q$r3+;O$9$k$K$O!"(BXEmacs $(B3+;O8e$K!"(B^Ht (Control-h t) $(B$r%?%$%W(B -$(B$7$F$/$@$5$$!#%^%K%e%"%k$rFI$`$K$O!"(B^Hi$(B!"$5$i$K>\$7$$%X%k%W>pJs$O!"(B^H^H^H -(Control-h $(B$r(B 3 $(B2s(B) $(B$r%?%$%W$7$F$/$@$5$$!#(B\n") +XEmacs $B$K$O!"%*%s%i%$%s$N<+=,=q$H%^%K%e%"%k(B ($BN>J}$H$b1Q8lHG$N$_(B) $B$,IUB0$7(B +$B$F$$$^$9!#<+=,=q$r3+;O$9$k$K$O!"(BXEmacs $B3+;O8e$K!"(B^Ht (Control-h t) $B$r%?%$%W(B +$B$7$F$/$@$5$$!#%^%K%e%"%k$rFI$`$K$O!"(B^Hi$B!"$5$i$K>\$7$$%X%k%W>pJs$O!"(B^H^H^H +(Control-h $B$r(B 3 $B2s(B) $B$r%?%$%W$7$F$/$@$5$$!#(B\n") (kill-emacs 0)))
--- a/lisp/modes/autoconf-mode.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/modes/autoconf-mode.el Mon Aug 13 09:37:19 2007 +0200 @@ -42,7 +42,7 @@ "syntax table used in autoconf mode") (setq autoconf-mode-syntax-table (make-syntax-table)) (modify-syntax-entry ?\" "\"" autoconf-mode-syntax-table) -(modify-syntax-entry ?\' "\"" autoconf-mode-syntax-table) +;;(modify-syntax-entry ?\' "\"" autoconf-mode-syntax-table) (modify-syntax-entry ?# "<\n" autoconf-mode-syntax-table) (modify-syntax-entry ?\n ">#" autoconf-mode-syntax-table) (modify-syntax-entry ?\( "." autoconf-mode-syntax-table)
--- a/lisp/modes/cperl-mode.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/modes/cperl-mode.el Mon Aug 13 09:37:19 2007 +0200 @@ -32,7 +32,7 @@ ;;; Corrections made by Ilya Zakharevich ilya@math.mps.ohio-state.edu ;;; XEmacs changes by Peter Arius arius@informatik.uni-erlangen.de -;; $Id: cperl-mode.el,v 1.5 1997/04/27 19:30:26 steve Exp $ +;; $Id: cperl-mode.el,v 1.6 1997/05/23 01:36:22 steve Exp $ ;;; To use this mode put the following into your .emacs file: @@ -842,7 +842,7 @@ (modify-syntax-entry ?# "<" cperl-mode-syntax-table) (modify-syntax-entry ?' "\"" cperl-mode-syntax-table) (modify-syntax-entry ?` "\"" cperl-mode-syntax-table) - (modify-syntax-entry ?_ "w" cperl-mode-syntax-table) + (modify-syntax-entry ?_ "_" cperl-mode-syntax-table) (modify-syntax-entry ?: "_" cperl-mode-syntax-table) (modify-syntax-entry ?| "." cperl-mode-syntax-table))
--- a/lisp/modes/f90.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/modes/f90.el Mon Aug 13 09:37:19 2007 +0200 @@ -143,6 +143,10 @@ ;;; Code: +(eval-when-compile + (defvar deactivate-mark) + (defvar mark-active)) + (defconst bug-f90-mode "T.Einarsson@clab.ericsson.se" "Address of mailing list for F90 mode bugs.") @@ -488,19 +492,24 @@ (if f90-mode-syntax-table () (setq f90-mode-syntax-table (make-syntax-table)) - (modify-syntax-entry ?\! "<" f90-mode-syntax-table) ; beg. comment - (modify-syntax-entry ?\n ">" f90-mode-syntax-table) ; end comment - (modify-syntax-entry ?_ "w" f90-mode-syntax-table) ; underscore in names + (modify-syntax-entry ?\! "<" f90-mode-syntax-table) ; beg. comment + (modify-syntax-entry ?\n ">" f90-mode-syntax-table) ; end comment (modify-syntax-entry ?\' "\"" f90-mode-syntax-table) ; string quote (modify-syntax-entry ?\" "\"" f90-mode-syntax-table) ; string quote - (modify-syntax-entry ?\` "w" f90-mode-syntax-table) ; for abbrevs - (modify-syntax-entry ?\r " " f90-mode-syntax-table) ; return is whitespace - (modify-syntax-entry ?+ "." f90-mode-syntax-table) - (modify-syntax-entry ?- "." f90-mode-syntax-table) - (modify-syntax-entry ?= "." f90-mode-syntax-table) - (modify-syntax-entry ?* "." f90-mode-syntax-table) - (modify-syntax-entry ?/ "." f90-mode-syntax-table) - (modify-syntax-entry ?\\ "/" f90-mode-syntax-table)) ; escape chars + (modify-syntax-entry ?\` "w" f90-mode-syntax-table) ; for abbrevs + (modify-syntax-entry ?\r " " f90-mode-syntax-table) ; return is whitespace + (modify-syntax-entry ?+ "." f90-mode-syntax-table) + (modify-syntax-entry ?- "." f90-mode-syntax-table) + (modify-syntax-entry ?= "." f90-mode-syntax-table) + (modify-syntax-entry ?* "." f90-mode-syntax-table) + (modify-syntax-entry ?/ "." f90-mode-syntax-table) + (modify-syntax-entry ?\\ "/" f90-mode-syntax-table) + (modify-syntax-entry ?. "." f90-mode-syntax-table) + (modify-syntax-entry ?% "." f90-mode-syntax-table) ; not in f77 + (modify-syntax-entry ?$ "_" f90-mode-syntax-table) + (modify-syntax-entry ?@ "_" f90-mode-syntax-table) + (modify-syntax-entry ?_ "_" f90-mode-syntax-table) + ) ; escape chars ;; keys (defvar f90-mode-map ()
--- a/lisp/modes/fortran.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/modes/fortran.el Mon Aug 13 09:37:19 2007 +0200 @@ -228,18 +228,20 @@ (setq fortran-mode-syntax-table (make-syntax-table)) (modify-syntax-entry ?\; "w" fortran-mode-syntax-table) (modify-syntax-entry ?\r " " fortran-mode-syntax-table) - (modify-syntax-entry ?+ "." fortran-mode-syntax-table) - (modify-syntax-entry ?- "." fortran-mode-syntax-table) - (modify-syntax-entry ?= "." fortran-mode-syntax-table) + (modify-syntax-entry ?+ "." fortran-mode-syntax-table) + (modify-syntax-entry ?- "." fortran-mode-syntax-table) + (modify-syntax-entry ?= "." fortran-mode-syntax-table) ;; XEmacs change ;;(modify-syntax-entry ?* "." fortran-mode-syntax-table) - (modify-syntax-entry ?/ "." fortran-mode-syntax-table) + (modify-syntax-entry ?/ "." fortran-mode-syntax-table) (modify-syntax-entry ?\' "\"" fortran-mode-syntax-table) (modify-syntax-entry ?\" "\"" fortran-mode-syntax-table) - (modify-syntax-entry ?\\ "/" fortran-mode-syntax-table) - (modify-syntax-entry ?. "w" fortran-mode-syntax-table) - (modify-syntax-entry ?_ "w" fortran-mode-syntax-table) - (modify-syntax-entry ?\! "<" fortran-mode-syntax-table) + (modify-syntax-entry ?\\ "/" fortran-mode-syntax-table) + (modify-syntax-entry ?. "_" fortran-mode-syntax-table) + (modify-syntax-entry ?_ "_" fortran-mode-syntax-table) + (modify-syntax-entry ?$ "_" fortran-mode-syntax-table) + (modify-syntax-entry ?@ "_" fortran-mode-syntax-table) + (modify-syntax-entry ?\! "<" fortran-mode-syntax-table) ;; XEmacs change ;;(modify-syntax-entry ?\n ">" fortran-mode-syntax-table) @@ -319,7 +321,7 @@ ;; ;; Program, subroutine and function declarations, plus calls. (list (concat "\\<\\(block[ \t]*data\\|call\\|entry\\|function\\|" - "program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?") + "program\\|subroutine\\)\\>[ \t]*\\(\\(\\sw\\|\\s_\\)+\\)?") '(1 font-lock-keyword-face) '(2 font-lock-function-name-face nil t)))) @@ -1687,8 +1689,7 @@ (fortran-break-line)))))) )) (defun fortran-break-line () - (let ((opoint (point)) - (bol (save-excursion (beginning-of-line) (point))) + (let ((bol (save-excursion (beginning-of-line) (point))) (eol (save-excursion (end-of-line) (point))) (comment-string nil))
--- a/lisp/modes/ksh-mode.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/modes/ksh-mode.el Mon Aug 13 09:37:19 2007 +0200 @@ -24,7 +24,7 @@ ;; LCD Archive Entry: ;; ksh-mode|Gary F. Ellison|Gary.F.Ellison@ATT.COM ;; |Mode for editing sh/ksh/bash scripts -;; |$Date: 1997/03/08 23:26:25 $|$Revision: 1.2 $|~/modes/ksh-mode.el.Z| +;; |$Date: 1997/05/23 01:36:24 $|$Revision: 1.3 $|~/modes/ksh-mode.el.Z| ;; Author: Gary F. Ellison <Gary.F.Ellison@ATT.COM> ;; AT&T Laboratories @@ -33,10 +33,10 @@ ;; ;; Maintainer: Gary F. Ellison <Gary.F.Ellison@ATT.COM> ;; Created: Fri Jun 19 -;; $Revision: 1.2 $ +;; $Revision: 1.3 $ ;; Keywords: shell, korn, bourne, sh, ksh, bash ;; -;; Delta On $Date: 1997/03/08 23:26:25 $ +;; Delta On $Date: 1997/05/23 01:36:24 $ ;; Last Modified By: Gary Ellison ;; Last Modified On: Mon Sep 11 12:26:47 1995 ;; Update Count : 35 @@ -231,7 +231,7 @@ ;; Conception of this mode. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defconst ksh-mode-version "$Revision: 1.2 $" +(defconst ksh-mode-version "$Revision: 1.3 $" "*Version numbers of this version of ksh-mode") ;; @@ -431,7 +431,7 @@ (modify-syntax-entry ?\n ">" ksh-mode-syntax-table) (modify-syntax-entry ?\f ">" ksh-mode-syntax-table) (modify-syntax-entry ?# "<" ksh-mode-syntax-table) - (modify-syntax-entry ?_ "w" ksh-mode-syntax-table) + (modify-syntax-entry ?_ "_" ksh-mode-syntax-table) (modify-syntax-entry ?< "." ksh-mode-syntax-table) (modify-syntax-entry ?> "." ksh-mode-syntax-table) (modify-syntax-entry ?& "." ksh-mode-syntax-table) @@ -468,7 +468,7 @@ ;;;###autoload (defun ksh-mode () - "ksh-mode $Revision: 1.2 $ - Major mode for editing (Bourne, Korn or Bourne again) + "ksh-mode $Revision: 1.3 $ - Major mode for editing (Bourne, Korn or Bourne again) shell scripts. Special key bindings and commands: \\{ksh-mode-map}
--- a/lisp/modes/m4-mode.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/modes/m4-mode.el Mon Aug 13 09:37:19 2007 +0200 @@ -28,7 +28,7 @@ ;; It also sets the font-lock syntax stuff for colorization ;; By Drew Csillag (drew@staff.prodigy.com) -;; $Id: m4-mode.el,v 1.3 1997/05/18 03:39:57 steve Exp $ +;; $Id: m4-mode.el,v 1.4 1997/05/23 01:36:24 steve Exp $ ;; History: @@ -121,9 +121,9 @@ (modify-syntax-entry ?\n ">#" m4-mode-syntax-table) (modify-syntax-entry ?{ "_" m4-mode-syntax-table) (modify-syntax-entry ?} "_" m4-mode-syntax-table) -(modify-syntax-entry ?* "w" m4-mode-syntax-table) -(modify-syntax-entry ?_ "w" m4-mode-syntax-table) -(modify-syntax-entry ?\" "w" m4-mode-syntax-table) +(modify-syntax-entry ?* "." m4-mode-syntax-table) +(modify-syntax-entry ?_ "_" m4-mode-syntax-table) +(modify-syntax-entry ?\" "w" m4-mode-syntax-table) (defvar m4-mode-map (let ((map (make-sparse-keymap)))
--- a/lisp/modes/pascal.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/modes/pascal.el Mon Aug 13 09:37:19 2007 +0200 @@ -156,7 +156,7 @@ (modify-syntax-entry ?> "." pascal-mode-syntax-table) (modify-syntax-entry ?& "." pascal-mode-syntax-table) (modify-syntax-entry ?| "." pascal-mode-syntax-table) - (modify-syntax-entry ?_ "w" pascal-mode-syntax-table) + (modify-syntax-entry ?_ "_" pascal-mode-syntax-table) (modify-syntax-entry ?\' "\"" pascal-mode-syntax-table)) (defconst pascal-font-lock-keywords (purecopy
--- a/lisp/modes/sendmail.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/modes/sendmail.el Mon Aug 13 09:37:19 2007 +0200 @@ -1005,8 +1005,8 @@ t) (or soft (progn (goto-char end) - (insert "\n" field ": ") - (skip-chars-backward "\n"))) + (insert field ": \n") + (forward-char -1))) nil))) (defun mail-text ()
--- a/lisp/packages/add-log.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/packages/add-log.el Mon Aug 13 09:37:19 2007 +0200 @@ -1,6 +1,6 @@ ;;; add-log.el --- change log maintenance commands for Emacs -;; Copyright (C) 1985, 1986, 1988, 1993, 1994 Free Software Foundation, Inc. +;; Copyright (C) 1985, 86, 88, 93, 94, 1997 Free Software Foundation, Inc. ;; Keywords: maint @@ -21,7 +21,7 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: Emacs 20.0. ;;; Commentary: @@ -60,6 +60,7 @@ string) :group 'change-log) +;; XEmacs; ;; So that the dump-time value doesn't go into loaddefs.el with the autoload. (or add-log-full-name (setq add-log-full-name (user-full-name))) @@ -71,14 +72,36 @@ string) :group 'change-log) +;; XEmacs: ;; So that the dump-time value doesn't go into loaddefs.el with the autoload. (or add-log-mailing-address (setq add-log-mailing-address (user-mail-address))) (defvar change-log-font-lock-keywords - '(("^[SMTWF].+" . font-lock-function-name-face) ; Date line. - ("^\t\\* \\([^ :\n]+\\)" 1 font-lock-comment-face) ; File name. - ("(\\([^)\n]+\\)):" 1 font-lock-keyword-face)) ; Function name. + '(;; + ;; Date lines, new and old styles. + ("^\\sw.........[0-9: ]*" + (0 font-lock-string-face) + ("\\([^<]+\\)<\\([A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\\)>" nil nil + (1 font-lock-reference-face) + (2 font-lock-variable-name-face))) + ;; + ;; File names. + ("^\t\\* \\([^ ,:([\n]+\\)" + (1 font-lock-function-name-face) + ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 font-lock-function-name-face))) + ;; + ;; Function or variable names. + ("(\\([^ ,:\n]+\\)" + (1 font-lock-keyword-face) + ("\\=, \\([^ ,:\n]+\\)" nil nil (1 font-lock-keyword-face))) + ;; + ;; Conditionals. + ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 font-lock-variable-name-face)) + ;; + ;; Acknowledgments. + ("^\t\\(From\\|Reported by\\)" 1 font-lock-comment-face) + ) "Additional expressions to highlight in Change Log mode.") (put 'change-log-mode 'font-lock-defaults '(change-log-font-lock-keywords t)) @@ -87,16 +110,31 @@ "Keymap for Change Log major mode.") (if change-log-mode-map nil - (setq change-log-mode-map (make-sparse-keymap)) - (define-key change-log-mode-map "\M-q" 'change-log-fill-paragraph)) + (setq change-log-mode-map (make-sparse-keymap))) + +(defvar change-log-time-zone-rule nil + "Time zone used for calculating change log time stamps. +It takes the same format as the TZ argument of `set-time-zone-rule'. +If nil, use local time.") + +(defun iso8601-time-zone (time) + (let* ((utc-offset (or (car (current-time-zone time)) 0)) + (sign (if (< utc-offset 0) ?- ?+)) + (sec (abs utc-offset)) + (ss (% sec 60)) + (min (/ sec 60)) + (mm (% min 60)) + (hh (/ min 60))) + (format (cond ((not (zerop ss)) "%c%02d:%02d:%02d") + ((not (zerop mm)) "%c%02d:%02d") + (t "%c%02d")) + sign hh mm ss))) (defun change-log-name () (or change-log-default-name (if (eq system-type 'vax-vms) - "$CHANGE_LOG$.TXT" - (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) - "changelo" - "ChangeLog")))) + "$CHANGE_LOG$.TXT" + "ChangeLog"))) ;;;###autoload (defun prompt-for-change-log-name () @@ -180,7 +218,8 @@ Second arg is file name of change log. If nil, uses `change-log-default-name'. Third arg OTHER-WINDOW non-nil means visit in other window. Fourth arg NEW-ENTRY non-nil means always create a new entry at the front; -never append to an existing entry." +never append to an existing entry. Today's date is calculated according to +`change-log-time-zone-rule' if non-nil, otherwise in local time." (interactive (list current-prefix-arg (prompt-for-change-log-name))) (or add-log-full-name @@ -220,14 +259,23 @@ (change-log-mode)) (undo-boundary) (goto-char (point-min)) - (if (looking-at (concat (regexp-quote (substring (current-time-string) - 0 10)) - ".* " (regexp-quote add-log-full-name) - " <" (regexp-quote add-log-mailing-address))) - (forward-line 1) - (insert (current-time-string) - " " add-log-full-name - " <" add-log-mailing-address ">\n\n")) + (let ((new-entry (concat (if change-log-time-zone-rule + (let ((tz (getenv "TZ")) + (now (current-time))) + (unwind-protect + (progn + (set-time-zone-rule + change-log-time-zone-rule) + (concat + (format-time-string "%Y-%m-%d " now) + (iso8601-time-zone now))) + (set-time-zone-rule tz))) + (format-time-string "%Y-%m-%d")) + " " add-log-full-name + " <" add-log-mailing-address ">"))) + (if (looking-at (regexp-quote new-entry)) + (forward-line 1) + (insert new-entry "\n\n"))) ;; Search only within the first paragraph. (if (looking-at "\n*[^\n* \t]") @@ -300,14 +348,6 @@ (add-change-log-entry whoami file-name t)) ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) -(defvar change-log-mode-map nil - "Keymap for Change Log major mode.") -(if change-log-mode-map - nil - (setq change-log-mode-map (make-sparse-keymap)) - (set-keymap-name change-log-mode-map 'change-log-mode-map) - (define-key change-log-mode-map "\M-q" 'change-log-fill-paragraph)) - ;;;###autoload (defun change-log-mode () "Major mode for editing change logs; like Indented Text Mode. @@ -325,17 +365,21 @@ indent-tabs-mode t tab-width 8) (use-local-map change-log-mode-map) + (set (make-local-variable 'fill-paragraph-function) + 'change-log-fill-paragraph) ;; Let each entry behave as one paragraph: ;; We really do want "^" in paragraph-start below: it is only the lines that ;; begin at column 0 (despite the left-margin of 8) that we are looking for. - (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\sw") - (set (make-local-variable 'paragraph-separate) "\\s *$\\|\f\\|^\\sw") + (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\<") + (set (make-local-variable 'paragraph-separate) "\\s *$\\|\f\\|^\\<") ;; Let all entries for one day behave as one page. ;; Match null string on the date-line so that the date-line ;; is grouped with what follows. (set (make-local-variable 'page-delimiter) "^\\<\\|^\f") (set (make-local-variable 'version-control) 'never) (set (make-local-variable 'adaptive-fill-regexp) "\\s *") + ;;(set (make-local-variable 'font-lock-defaults) + ;;'(change-log-font-lock-keywords t)) (run-hooks 'change-log-mode-hook)) ;; It might be nice to have a general feature to replace this. The idea I @@ -346,10 +390,11 @@ "Fill the paragraph, but preserve open parentheses at beginning of lines. Prefix arg means justify as well." (interactive "P") - (let ((end (save-excursion (forward-paragraph) (point))) - (beg (save-excursion (backward-paragraph)(point))) + (let ((end (progn (forward-paragraph) (point))) + (beg (progn (backward-paragraph) (point))) (paragraph-start (concat paragraph-start "\\|\\s *\\s("))) - (fill-region beg end justify))) + (fill-region beg end justify) + t)) (defcustom add-log-current-defun-header-regexp "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[-_a-zA-Z]+\\)[ \t]*[:=]" @@ -358,6 +403,21 @@ :group 'change-log) ;;;###autoload +(defvar add-log-lisp-like-modes + '(emacs-lisp-mode lisp-mode scheme-mode lisp-interaction-mode) + "*Modes that look like Lisp to `add-log-current-defun'.") + +;;;###autoload +(defvar add-log-c-like-modes + '(c-mode c++-mode c++-c-mode objc-mode) + "*Modes that look like C to `add-log-current-defun'.") + +;;;###autoload +(defvar add-log-tex-like-modes + '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) + "*Modes that look like TeX to `add-log-current-defun'.") + +;;;###autoload (defun add-log-current-defun () "Return name of function definition point is in, or nil. @@ -373,8 +433,7 @@ (condition-case nil (save-excursion (let ((location (point))) - (cond ((memq major-mode '(emacs-lisp-mode lisp-mode scheme-mode - lisp-interaction-mode)) + (cond ((memq major-mode add-log-lisp-like-modes) ;; If we are now precisely at the beginning of a defun, ;; make sure beginning-of-defun finds that one ;; rather than the previous one. @@ -393,14 +452,15 @@ (skip-chars-forward " '") (buffer-substring (point) (progn (forward-sexp 1) (point)))))) - ((and (memq major-mode '(c-mode c++-mode c++-c-mode objc-mode)) - (save-excursion (beginning-of-line) - ;; Use eq instead of = here to avoid - ;; error when at bob and char-after - ;; returns nil. - (while (eq (char-after (- (point) 2)) ?\\) - (forward-line -1)) - (looking-at "[ \t]*#[ \t]*define[ \t]"))) + ((and (memq major-mode add-log-c-like-modes) + (save-excursion + (beginning-of-line) + ;; Use eq instead of = here to avoid + ;; error when at bob and char-after + ;; returns nil. + (while (eq (char-after (- (point) 2)) ?\\) + (forward-line -1)) + (looking-at "[ \t]*#[ \t]*define[ \t]"))) ;; Handle a C macro definition. (beginning-of-line) (while (eq (char-after (- (point) 2)) ?\\) ;not =; note above @@ -409,7 +469,7 @@ (skip-chars-forward " \t") (buffer-substring (point) (progn (forward-sexp 1) (point)))) - ((memq major-mode '(c-mode c++-mode c++-c-mode objc-mode)) + ((memq major-mode add-log-c-like-modes) (beginning-of-line) ;; See if we are in the beginning part of a function, ;; before the open brace. If so, advance forward. @@ -504,10 +564,7 @@ (looking-at "struct \\|union \\|class ") (setq middle (point))) (buffer-substring middle end))))))))) - ((memq major-mode - '(TeX-mode plain-TeX-mode LaTeX-mode;; tex-mode.el - plain-tex-mode latex-mode;; cmutex.el - )) + ((memq major-mode add-log-tex-like-modes) (if (re-search-backward "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)" nil t) (progn
--- a/lisp/packages/func-menu.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/packages/func-menu.el Mon Aug 13 09:37:19 2007 +0200 @@ -1,6 +1,6 @@ ;;; func-menu.el --- Jump to a function within a buffer. ;;; -;;; David Hughes <ukchugd@ukpmr.cs.philips.nl> +;;; David Hughes <d.hughes@videonetworks.com> ;;; Last modified: David Hughes 13th January 1997 ;;; Version: 2.45 ;;; Keywords: tools, c, lisp @@ -65,7 +65,7 @@ ;;; Peter Pezaris <pez@dwwc.com> ;;; ;;; Made menu placement more flexible -;;; Bob Weiner <weiner@infodock.com> +;;; Bob Weiner <weiner@altrasoft.com> ;;; ;;; Fortran90 regexp ;;; John Turner <turner@xdiv.lanl.gov> @@ -74,7 +74,7 @@ ;;; Andy Piper <andyp@parallax.co.uk> ;;; ;;; Java support -;;; Bob Weiner <weiner@infodock.com> +;;; Bob Weiner <weiner@altrasoft.com> ;;; Heddy Boubaker <boubaker@dgac.fr> ;;; ;;; Patch for fume-rescan-buffer{-trigger} @@ -173,7 +173,7 @@ ;;; Philippe Queinnec <queinnec@cenatls.cena.dgac.fr> ;;; ;;; Assembly support -;;; Bob Weiner <weiner@infodock.com> +;;; Bob Weiner <weiner@altrasoft.com> ;;; ;;; Removal of cl dependencies ;;; Russell Ritchie <russell@gssec.bt.co.uk> @@ -220,7 +220,7 @@ :tag "Func Menu" :group 'tools) -(defconst fume-developer "David Hughes <ukchugd@ukpmr.cs.philips.nl>") +(defconst fume-developer "David Hughes <d.hughes@videonetworks.com>") (defun fume-about () (interactive) @@ -421,7 +421,7 @@ :type 'string :group 'fume) -;;; Bob Weiner <weiner@infodock.com> +;;; Bob Weiner <weiner@altrasoft.com> (defvar fume-menu-path nil "Menubar menu under which the function menu should be installed. Nil means install it on the menubar itself. Otherwise, it should be a list @@ -587,9 +587,10 @@ ;;; C ;;; ;;; Danny Bar-Dov <danny@acet02.amil.co.il> +;;; Bob Weiner <weiner@altrasoft.com> added #define macro support. (defvar fume-function-name-regexp-c (concat - "^[a-zA-Z0-9_]+\\s-?" ; type specs; there can be no + "^\\([a-zA-Z0-9]+\\|#define\\)\\s-?" ; type specs; there can be no "\\([a-zA-Z0-9_*]+\\s-+\\)?" ; more than 3 tokens, right? "\\([a-zA-Z0-9_*]+\\s-+\\)?" "\\([*&]+\\s-*\\)?" ; pointer @@ -605,16 +606,18 @@ ;;; Mike Battaglia <mbattagl@spd.dsccc.com> ;;; Oliver Schittko <schittko@fokus.gmd.de> ;;; Tom Murray <tmurray@hpindck.cup.hp.com> +;;; Bob Weiner <weiner@altrasoft.com> added #define macro support. (defvar fume-function-name-regexp-c++ (cons (concat - "^\\(template\\s +<[^>]+>\\s +\\)?" ; template formals + "^\\(#define\\s-+\\|" + "\\(template\\s-+<[^>]+>\\s-+\\)?" ; template formals "\\([a-zA-Z0-9_*&<,>:]+\\s-+\\)?" ; type specs; there can be no "\\([a-zA-Z0-9_*&<,>\"]+\\s-+\\)?" ; more than 3 tokens, right? - "\\([a-zA-Z0-9_*&<,>]+\\s-+\\)?" + "\\([a-zA-Z0-9_*&<,>]+\\s-+\\)?\\)" "\\(\\([a-zA-Z0-9_&~:<,>*]\\|\\(\\s +::\\s +\\)\\)+\\)" "\\(o?perator\\s *.[^(]*\\)?\\(\\s-\\|\n\\)*(" ; name - ) 5) + ) 6) "Expression to get C++ function names") ;;; FORTRAN @@ -1092,7 +1095,7 @@ ;;; <jrm@odi.com> ;;; <ajp@eng.cam.ac.uk> ;;; <schittko@fokus.gmd.de> -;;; <ukchugd@ukpmr.cs.philips.nl> - speedup, David Hughes 24th November 1996 +;;; <d.hughes@videonetworks.com> - speedup, David Hughes 24th November 1996 ;;; (defun fume-match-find-next-function-name (buffer) ;; General next function name in BUFFER finder using match. @@ -1125,7 +1128,7 @@ (fume-find-next-sexp buffer)) ;;; Specialised routine to find the next Java function -;;; Bob Weiner <weiner@infodock.com> +;;; Bob Weiner <weiner@altrasoft.com> ;;; Heddy Boubaker <boubaker@dgac.fr> ;;; (defun fume-find-next-java-function-name (buffer) @@ -1140,7 +1143,7 @@ (not (fume-cc-inside-comment))) ;; This is a method definition and we're not in a comment (let ((str (buffer-substring beg end))) - ;; Bob Weiner <weiner@infodock.com> added exact match + ;; Bob Weiner <weiner@altrasoft.com> added exact match ;; delimiters so function names that happen to contain ;; any of these terms are not eliminated. The old version ;; would ignore "notify()" since it contained "if". @@ -1429,7 +1432,7 @@ ;;; Assembly -;;; Bob Weiner <weiner@infodock.com> +;;; Bob Weiner <weiner@altrasoft.com> ;;; (defun fume-find-next-asm-function-name (buffer) "Searches for the next assembler function in BUFFER." @@ -2114,7 +2117,7 @@ (defvar fume-list-trampled-buffer nil) ;;; Espen Skoglund <espensk@stud.cs.uit.no> -;;; David Hughes <ukchugd@ukpmr.cs.philips.nl> +;;; David Hughes <d.hughes@videonetworks.com> ;;; (defun fume-prompt-function-goto (&optional other-window-p) "Goto function prompted for in minibuffer (with completion).
--- a/lisp/packages/gnuserv.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/packages/gnuserv.el Mon Aug 13 09:37:19 2007 +0200 @@ -1,7 +1,7 @@ ;;; gnuserv.el --- Lisp interface code between Emacs and gnuserv ;; Copyright (C) 1989-1997 Free Software Foundation, Inc. -;; Version: 3.1 +;; Version: 3.2 ;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el ;; Hrvoje Niksic <hniksic@srce.hr> ;; Keywords: environment, processes, terminals @@ -77,7 +77,7 @@ ;;; Code: (defconst gnuserv-rcs-version - "$Id: gnuserv.el,v 1.8 1997/05/18 03:40:06 steve Exp $") + "$Id: gnuserv.el,v 1.9 1997/05/23 01:36:30 steve Exp $") (defgroup gnuserv nil "The gnuserv suite of programs to talk to Emacs from outside." @@ -154,6 +154,16 @@ :type 'hook :group 'gnuserv) +(defcustom gnuserv-init-hook nil + "*Hook run after the server is started." + :type 'hook + :group 'gnuserv) + +(defcustom gnuserv-shutdown-hook nil + "*Hook run before the server exits." + :type 'hook + :group 'gnuserv) + (defcustom gnuserv-kill-quietly nil "*Non-nil means to kill buffers with clients attached without requiring confirmation." :type 'boolean @@ -230,7 +240,8 @@ ;; identification, so we'll make a "minor mode". (defvar gnuserv-minor-mode nil) (make-variable-buffer-local 'gnuserv-mode) -(pushnew '(gnuserv-minor-mode " Server") minor-mode-alist) +(pushnew '(gnuserv-minor-mode " Server") minor-mode-alist + :test 'equal) ;; Sample gnuserv-frame functions @@ -263,14 +274,45 @@ ;;; Communication functions +;; We used to restart the server here, but it's too risky -- if +;; something goes awry, it's too easy to wind up in a loop. (defun gnuserv-sentinel (proc msg) (case (process-status proc) - (exit (message "Gnuserv subprocess exited; restarting") - ;; This will also kill all the existing clients. - (gnuserv-start-1)) - (closed (message "Gnuserv subprocess closed")) - (signal (message "Gnuserv subprocess killed")))) + (exit + (message + (substitute-command-keys + "Gnuserv subprocess exited; restart with `\\[gnuserv-start]'")) + (gnuserv-prepare-shutdown)) + (signal + (message + (substitute-command-keys + "Gnuserv subprocess killed; restart with `\\[gnuserv-start]'")) + (gnuserv-prepare-shutdown)) + (closed + (message + (substitute-command-keys + "Gnuserv subprocess closed; restart with `\\[gnuserv-start]'")) + (gnuserv-prepare-shutdown)))) +;; This function reads client requests from our current server. Every +;; client is identified by a unique ID within the server +;; (incidentally, the same ID is the file descriptor the server uses +;; to communicate to client). +;; +;; The request string can arrive in several chunks. As the request +;; ends with \C-d, we check for that character at the end of string. +;; If not found, keep reading, and concatenating to former strings. +;; So, if at first read we receive "5 (gn", that text will be stored +;; to gnuserv-string. If we then receive "us)\C-d", the two will be +;; concatenated, `current-client' will be set to 5, and `(gnus)' form +;; will be evaluated. +;; +;; Server will send the following: +;; +;; "ID <text>\C-d" (no quotes) +;; +;; ID - file descriptor of the given client; +;; <text> - the actual contents of the request. (defun gnuserv-process-filter (proc string) "Process gnuserv client requests to execute Emacs commands." (setq gnuserv-string (concat gnuserv-string string)) @@ -298,6 +340,16 @@ (error "%s: invalid response from gnuserv" gnuserv-string) (setq gnuserv-string ""))))) +;; This function is somewhat of a misnomer. Actually, we write to the +;; server (using `process-send-string' to gnuserv-process), which +;; interprets what we say and forwards it to the client. The +;; incantation server understands is (from gnuserv.c): +;; +;; "FD/LEN:<text>\n" (no quotes) +;; FD - file descriptor of the given client (which we obtained from +;; the server earlier); +;; LEN - length of the stuff we are about to send; +;; <text> - the actual contents of the request. (defun gnuserv-write-to-client (client-id form) "Write the given form to the given client via the gnuserv process." (when (eq (process-status gnuserv-process) 'run) @@ -306,7 +358,6 @@ (length result) result))) (process-send-string gnuserv-process s)))) - ;; The following two functions are helper functions, used by ;; gnuclient. @@ -325,82 +376,90 @@ ;; "Execute" a client connection, called by gnuclient. This is the ;; backbone of gnuserv.el. -(defun gnuserv-edit-files (type list &optional flags) +(defun gnuserv-edit-files (type list &rest flags) "For each (line-number . file) pair in LIST, edit the file at line-number. The visited buffers are memorized, so that when \\[gnuserv-edit] is invoked in such a buffer, or when it is killed, or the client's device deleted, the client will be invoked that the edit is finished. TYPE should either be a (tty TTY TERM PID) list, or (x DISPLAY) list. -If FLAGS is `quick', just edit the files in Emacs. -If FLAGS is `view', view the files read-only." - (or (not flags) - (memq flags '(quick view)) - (error "Invalid flag %s" flags)) - (let* ((old-device-num (length (device-list))) - (new-frame nil) - (dest-frame (if (functionp gnuserv-frame) - (funcall gnuserv-frame (car type)) - gnuserv-frame)) - ;; The gnuserv-frame dependencies are ugly. - (device (cond ((frame-live-p dest-frame) - (frame-device dest-frame)) - ((null dest-frame) - (case (car type) - (tty (apply 'make-tty-device (cdr type))) - (x (make-x-device (cadr type))) - (t (error "Invalid device type")))) - (t - (selected-device)))) - (frame (cond ((frame-live-p dest-frame) - dest-frame) - ((null dest-frame) - (setq new-frame (make-frame nil device)) - new-frame) - (t (selected-frame)))) - (client (make-gnuclient :id gnuserv-current-client - :device device - :frame new-frame))) - (setq gnuserv-current-client nil) - ;; If the device was created by this client, push it to the list. - (and (/= old-device-num (length (device-list))) - (push device gnuserv-devices)) - ;; Visit all the listed files. - (while list - (let ((line (caar list)) (path (cdar list))) - (select-frame frame) - ;; Visit the file. - (funcall (if (eq flags 'view) - gnuserv-view-file-function - gnuserv-find-file-function) - path) - (goto-line line) - (run-hooks 'gnuserv-visit-hook) - ;; Don't memorize the quick and view buffers. - (when (null flags) - (pushnew (current-buffer) (gnuclient-buffers client)) - (setq gnuserv-minor-mode t)) - (pop list))) - (cond ((and flags (device-on-window-system-p device)) - ;; Exit if on X device, and quick or view. - ;; NOTE: if the client is to finish now, it must absolutely - ;; /not/ be included to the list of clients. This way the - ;; client-ids should be unique. - (gnuserv-write-to-client (gnuclient-id client) nil)) - (t - ;; Else, the client gets a vote. - (push client gnuserv-clients) - ;; Explain buffer exit options. If dest-frame is nil, the - ;; user can exit via `delete-frame'. OTOH, if FLAGS are - ;; nil and there are some buffers, the user can exit via - ;; `gnuserv-edit'. - (if (and (null flags) - (gnuclient-buffers client)) - (message (substitute-command-keys - "Type `\\[gnuserv-edit]' to finish editing")) - (or dest-frame - (message (substitute-command-keys - "Type `\\[delete-frame]' to finish editing")))))))) +If a flag is `quick', just edit the files in Emacs. +If a flag is `view', view the files read-only." + (let (quick view) + (mapc (lambda (flag) + (case flag + (quick (setq quick t)) + (view (setq view t)) + (t (error "Invalid flag %s" flag)))) + flags) + (let* ((old-device-num (length (device-list))) + (new-frame nil) + (dest-frame (if (functionp gnuserv-frame) + (funcall gnuserv-frame (car type)) + gnuserv-frame)) + ;; The gnuserv-frame dependencies are ugly. + (device (cond ((frame-live-p dest-frame) + (frame-device dest-frame)) + ((null dest-frame) + (case (car type) + (tty (apply 'make-tty-device (cdr type))) + (x (make-x-device (cadr type))) + (t (error "Invalid device type")))) + (t + (selected-device)))) + (frame (cond ((frame-live-p dest-frame) + dest-frame) + ((null dest-frame) + (setq new-frame (make-frame nil device)) + new-frame) + (t (selected-frame)))) + (client (make-gnuclient :id gnuserv-current-client + :device device + :frame new-frame))) + (setq gnuserv-current-client nil) + ;; If the device was created by this client, push it to the list. + (and (/= old-device-num (length (device-list))) + (push device gnuserv-devices)) + (and (frame-iconified-p frame) + (deiconify-frame frame)) + ;; Visit all the listed files. + (while list + (let ((line (caar list)) (path (cdar list))) + (select-frame frame) + ;; Visit the file. + (funcall (if view + gnuserv-view-file-function + gnuserv-find-file-function) + path) + (goto-line line) + (run-hooks 'gnuserv-visit-hook) + ;; Don't memorize the quick and view buffers. + (unless (or quick view) + (pushnew (current-buffer) (gnuclient-buffers client)) + (setq gnuserv-minor-mode t)) + (pop list))) + (cond + ((and (or quick view) + (device-on-window-system-p device)) + ;; Exit if on X device, and quick or view. NOTE: if the + ;; client is to finish now, it must absolutely /not/ be + ;; included to the list of clients. This way the client-ids + ;; should be unique. + (gnuserv-write-to-client (gnuclient-id client) nil)) + (t + ;; Else, the client gets a vote. + (push client gnuserv-clients) + ;; Explain buffer exit options. If dest-frame is nil, the + ;; user can exit via `delete-frame'. OTOH, if FLAGS are nil + ;; and there are some buffers, the user can exit via + ;; `gnuserv-edit'. + (if (and (not (or quick view)) + (gnuclient-buffers client)) + (message (substitute-command-keys + "Type `\\[gnuserv-edit]' to finish editing")) + (or dest-frame + (message (substitute-command-keys + "Type `\\[delete-frame]' to finish editing"))))))))) ;;; Functions that hook into Emacs in various way to enable operation @@ -408,7 +467,9 @@ ;; Defined later. (add-hook 'kill-emacs-hook 'gnuserv-kill-all-clients t) -;; A helper function; used by others. +;; A helper function; used by others. Try avoiding it whenever +;; possible, because it is slow, and conses a list. Use +;; `gnuserv-buffer-p' when appropriate, for instance. (defun gnuserv-buffer-clients (buffer) "Returns a list of clients to which BUFFER belongs." (let ((client gnuserv-clients) @@ -419,6 +480,13 @@ (pop client)) res)) +;; Like `gnuserv-buffer-clients', but returns a boolean; doesn't +;; collect a list. +(defun gnuserv-buffer-p (buffer) + (member* buffer gnuserv-clients + :test 'memq + :key 'gnuclient-buffers)) + ;; This function makes sure that a killed buffer is deleted off the ;; list for the particular client. ;; @@ -443,7 +511,7 @@ ;; living client. (defun gnuserv-kill-buffer-query-function () (or gnuserv-kill-quietly - (not (gnuserv-buffer-clients (current-buffer))) + (not (gnuserv-buffer-p (current-buffer))) (yes-or-no-p (format "Buffer %s belongs to gnuserv client(s); kill anyway? " (current-buffer))))) @@ -538,7 +606,7 @@ ;;; Higher-level functions ;; Choose a `next' server buffer, according to several criteria, and -;; return it. If none appropriate are found, return nil. +;; return it. If none are found, return nil. (defun gnuserv-next-buffer () (let* ((frame (selected-frame)) (device (selected-device)) @@ -555,18 +623,20 @@ (setq client (car (member* device gnuserv-clients :key 'gnuclient-device)))) (car (gnuclient-buffers client))) - ;; Else, try to find just any client, and return its first buffer. - (gnuserv-clients - (car (gnuclient-buffers (car gnuserv-clients)))) - ;; Oh, give up. + ;; Else, try to find any client with at least one buffer, and + ;; return its first buffer. + ((setq client + (car (member-if-not 'null gnuserv-clients + :key 'gnuserv-buffers))) + (car (gnuclient-buffers client))) + ;; Oh, give up. (t nil)))) (defun gnuserv-buffer-done (buffer) "Mark BUFFER as \"done\" for its client(s). -Calls `gnuserv-done-function' and returns another gnuserv buffer as a -suggestion for the new current buffer." +Does the save/backup queries first, and calls `gnuserv-done-function'." ;; Check whether this is the real thing. - (unless (gnuserv-buffer-clients buffer) + (unless (gnuserv-buffer-p buffer) (error "%s does not belong to a gnuserv client" buffer)) ;; Backup/ask query. (if (gnuserv-temp-file-p buffer) @@ -578,8 +648,7 @@ (if (and (buffer-modified-p) (y-or-n-p (concat "Save file " buffer-file-name "? "))) (save-buffer buffer))) - (gnuserv-buffer-done-1 buffer) - (gnuserv-next-buffer)) + (gnuserv-buffer-done-1 buffer)) ;; Called by `gnuserv-start-1' to clean everything. Hooked into ;; `kill-emacs-hook', too. @@ -587,29 +656,53 @@ "Kill all the gnuserv clients. Ruthlessly." (mapc 'gnuserv-kill-client gnuserv-clients)) -;; Actually start the process. Kills all the clients before-hand. -(defun gnuserv-start-1 (&optional leave-dead) +;; This serves to run the hook and reset +;; `allow-deletion-of-last-visible-frame'. +(defun gnuserv-prepare-shutdown () + (setq allow-deletion-of-last-visible-frame nil) + (run-hooks 'gnuserv-shutdown-hook)) + +;; This is a user-callable function, too. +(defun gnuserv-shutdown () + "Shutdown the gnuserv server, if one is currently running. +All the clients will be disposed of via the normal methods." + (interactive) (gnuserv-kill-all-clients) (when gnuserv-process (set-process-sentinel gnuserv-process nil) + (gnuserv-prepare-shutdown) (condition-case () (delete-process gnuserv-process) - (error nil))) + (error nil)) + (setq gnuserv-process nil) + (message "Killed server"))) + +;; Actually start the process. Kills all the clients before-hand. +(defun gnuserv-start-1 (&optional leave-dead) + ;; Shutdown the existing server, if any. + (gnuserv-shutdown) ;; If we already had a server, clear out associated status. (unless leave-dead - (setq gnuserv-string "") - (setq gnuserv-current-client nil) + (setq gnuserv-string "" + gnuserv-current-client nil) (let ((process-connection-type t)) - (setq gnuserv-process + (setq gnuserv-process (start-process "gnuserv" nil gnuserv-program))) (set-process-sentinel gnuserv-process 'gnuserv-sentinel) (set-process-filter gnuserv-process 'gnuserv-process-filter) - (process-kill-without-query gnuserv-process))) + (process-kill-without-query gnuserv-process) + (setq allow-deletion-of-last-visible-frame t) + (run-hooks 'gnuserv-init-hook))) ;;; User-callable functions: ;;;###autoload +(defun gnuserv-running-p () + "Return non-nil if a gnuserv process is running from this XEmacs session." + (not (not gnuserv-process))) + +;;;###autoload (defun gnuserv-start (&optional leave-dead) "Allow this Emacs process to be a server for client processes. This starts a gnuserv communications subprocess through which @@ -618,35 +711,44 @@ Prefix arg means just kill any existing server communications subprocess." (interactive "P") - ;; kill it dead! (and gnuserv-process (not leave-dead) (message "Restarting gnuserv")) (gnuserv-start-1 leave-dead)) -;;;###autoload -(defun gnuserv-edit (&optional arg) +(defun gnuserv-edit (&optional count) "Mark the current gnuserv editing buffer as \"done\", and switch to next one. -The `gnuserv-done-function' is used to dispose of the buffer after marking it -as done; it is `kill-buffer' by default. +Run with a numeric prefix argument, repeat the operation that number +of times. If given a universal prefix argument, close all the buffers +of this buffer's clients. + +The `gnuserv-done-function' (bound to `kill-buffer' by default) is +called to dispose of the buffer after marking it as done. Files that match `gnuserv-temp-file-regexp' are considered temporary and are saved unconditionally and backed up if `gnuserv-make-temp-file-backup' -is non-nil. They are disposed of using `gnuserv-done-temp-file-function'. +is non-nil. They are disposed of using `gnuserv-done-temp-file-function' +(also bound to `kill-buffer' by default). -When all of a client's buffers are marked as \"done\", the client is notified. - -If invoked with a prefix argument, or if there is no gnuserv process -running, only starts server process. Invoked with \\[gnuserv-edit]." +When all of a client's buffers are marked as \"done\", the client is notified." (interactive "P") - (if (or arg (not gnuserv-process) - (memq (process-status gnuserv-process) '(signal exit))) - (gnuserv-start) - (switch-to-buffer (or (gnuserv-buffer-done (current-buffer)) - (current-buffer))))) + (when (null count) + (setq count 1)) + (cond ((numberp count) + (let (next) + (while (natnump (decf count)) + (gnuserv-buffer-done (current-buffer)) + (setq next (gnuserv-next-buffer)) + (when next + (switch-to-buffer next))))) + (count + (let* ((buf (current-buffer)) + (clients (gnuserv-buffer-clients buf))) + (unless clients + (error "%s does not belong to a gnuserv client" buf)) + (mapc 'gnuserv-kill-client (gnuserv-buffer-clients buf)))))) -;;;###autoload (global-set-key "\C-x#" 'gnuserv-edit) (provide 'gnuserv)
--- a/lisp/packages/vc-hooks.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/packages/vc-hooks.el Mon Aug 13 09:37:19 2007 +0200 @@ -1,44 +1,61 @@ ;;; vc-hooks.el --- resident support for version-control -;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. -;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. +;; Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. -;; Author: Eric S. Raymond <esr@snark.thyrsus.com> -;; Maintainer: ttn@netcom.com -;; Version: 5.3 + CVS hacks by ceder@lysator.liu.se made in Jan-Feb 1994. -;; -;; XEmacs fixes, CVS fixes, and general improvements -;; by Jonathan Stigelman <Stig@hackvan.com> +;; Author: Eric S. Raymond <esr@snark.thyrsus.com> +;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> +;; XEmacs conversion: Steve Baur <steve@altair.xemacs.org> -;; This file is part of XEmacs. +;; This file is part of GNU Emacs. -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. -;; XEmacs is 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. +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Synched up with: FSF 19.28. - ;;; Commentary: +;; This is the always-loaded portion of VC. +;; It takes care VC-related activities that are done when you visit a file, +;; so that vc.el itself is loaded only when you use a VC command. ;; See the commentary of vc.el. ;;; Code: +;; Customization Variables (the rest is in vc.el) + +(defvar vc-default-back-end nil + "*Back-end actually used by this interface; may be SCCS or RCS. +The value is only computed when needed to avoid an expensive search.") + +(defvar vc-handle-cvs t + "*If non-nil, use VC for files managed with CVS. +If it is nil, don't use VC for those files.") + +(defvar vc-rcsdiff-knows-brief nil + "*Indicates whether rcsdiff understands the --brief option. +The value is either `yes', `no', or nil. If it is nil, VC tries +to use --brief and sets this variable to remember whether it worked.") + +(defvar vc-path + (if (file-directory-p "/usr/sccs") + '("/usr/sccs") + nil) + "*List of extra directories to search for version control commands.") + (defvar vc-master-templates '(("%sRCS/%s,v" . RCS) ("%s%s,v" . RCS) ("%sRCS/%s" . RCS) ("%sSCCS/s.%s" . SCCS) ("%ss.%s". SCCS) - ("%s%s@@" . CC) vc-find-cvs-master) "*Where to look for version-control master files. The first pair corresponding to a given back end is used as a template @@ -48,31 +65,69 @@ "*If non-nil, backups of registered files are made as with other files. If nil (the default), files covered by version control don't get backups.") +(defvar vc-follow-symlinks 'ask + "*Indicates what to do if you visit a symbolic link to a file +that is under version control. Editing such a file through the +link bypasses the version control system, which is dangerous and +probably not what you want. + If this variable is t, VC follows the link and visits the real file, +telling you about it in the echo area. If it is `ask', VC asks for +confirmation whether it should follow the link. If nil, the link is +visited and a warning displayed.") + (defvar vc-display-status t "*If non-nil, display revision number and lock status in modeline. Otherwise, not displayed.") +(defvar vc-consult-headers t + "*If non-nil, identify work files by searching for version headers.") + +(defvar vc-keep-workfiles t + "*If non-nil, don't delete working files after registering changes. +If the back-end is CVS, workfiles are always kept, regardless of the +value of this flag.") + +(defvar vc-mistrust-permissions nil + "*If non-nil, don't assume that permissions and ownership track +version-control status. If nil, do rely on the permissions. +See also variable `vc-consult-headers'.") + +(defun vc-mistrust-permissions (file) + ;; Access function to the above. + (or (eq vc-mistrust-permissions 't) + (and vc-mistrust-permissions + (funcall vc-mistrust-permissions + (vc-backend-subdirectory-name file))))) + ;; Tell Emacs about this new kind of minor mode -;(if (not (assoc 'vc-mode minor-mode-alist)) -; (setq minor-mode-alist (cons '(vc-mode vc-mode) -; minor-mode-alist))) -;; NO! Do it right. +;;(if (not (assoc 'vc-mode minor-mode-alist)) +;; (setq minor-mode-alist (cons '(vc-mode vc-mode) +;; minor-mode-alist))) + +;; XEmacs: (add-minor-mode 'vc-mode 'vc-mode) -(defvar vc-mode nil) ; used for modeline flag +(defvar vc-mode nil) ; used for modeline flag +;; End XEmacs addition. + (make-variable-buffer-local 'vc-mode) (put 'vc-mode 'permanent-local t) ;; We need a notion of per-file properties because the version -;; control state of a file is expensive to derive --- we don't -;; want to recompute it even on every find. +;; control state of a file is expensive to derive --- we compute +;; them when the file is initially found, keep them up to date +;; during any subsequent VC operations, and forget them when +;; the buffer is killed. (defmacro vc-error-occurred (&rest body) (list 'condition-case nil (cons 'progn (append body '(nil))) '(error t))) -(defvar vc-file-prop-obarray (make-vector 17 0) +(defvar vc-file-prop-obarray [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] "Obarray for per-file properties.") +(defvar vc-buffer-backend t) +(make-variable-buffer-local 'vc-buffer-backend) + (defun vc-file-setprop (file property value) ;; set per-file property (put (intern file vc-file-prop-obarray) property value)) @@ -81,10 +136,608 @@ ;; get per-file property (get (intern file vc-file-prop-obarray) property)) +(defun vc-file-clearprops (file) + ;; clear all properties of a given file + (setplist (intern file vc-file-prop-obarray) nil)) + +;;; Functions that determine property values, by examining the +;;; working file, the master file, or log program output + +(defun vc-match-substring (bn) + (buffer-substring (match-beginning bn) (match-end bn))) + +(defun vc-lock-file (file) + ;; Generate lock file name corresponding to FILE + (let ((master (vc-name file))) + (and + master + (string-match "\\(.*/\\)s\\.\\(.*\\)" master) + (concat + (substring master (match-beginning 1) (match-end 1)) + "p." + (substring master (match-beginning 2) (match-end 2)))))) + +(defun vc-parse-buffer (patterns &optional file properties) + ;; Use PATTERNS to parse information out of the current buffer. + ;; Each element of PATTERNS is a list of 2 to 3 elements. The first element + ;; is the pattern to be matched, and the second (an integer) is the + ;; number of the subexpression that should be returned. If there's + ;; a third element (also the number of a subexpression), that + ;; subexpression is assumed to be a date field and we want the most + ;; recent entry matching the template. + ;; If FILE and PROPERTIES are given, the latter must be a list of + ;; properties of the same length as PATTERNS; each property is assigned + ;; the corresponding value. + (mapcar (function (lambda (p) + (goto-char (point-min)) + (cond + ((eq (length p) 2) ;; search for first entry + (let ((value nil)) + (if (re-search-forward (car p) nil t) + (setq value (vc-match-substring (elt p 1)))) + (if file + (progn (vc-file-setprop file (car properties) value) + (setq properties (cdr properties)))) + value)) + ((eq (length p) 3) ;; search for latest entry + (let ((latest-date "") (latest-val)) + (while (re-search-forward (car p) nil t) + (let ((date (vc-match-substring (elt p 2)))) + (if (string< latest-date date) + (progn + (setq latest-date date) + (setq latest-val + (vc-match-substring (elt p 1))))))) + (if file + (progn (vc-file-setprop file (car properties) latest-val) + (setq properties (cdr properties)))) + latest-val))))) + patterns) + ) + +(defun vc-insert-file (file &optional limit blocksize) + ;; Insert the contents of FILE into the current buffer. + ;; Optional argument LIMIT is a regexp. If present, + ;; the file is inserted in chunks of size BLOCKSIZE + ;; (default 8 kByte), until the first occurrence of + ;; LIMIT is found. The function returns nil if FILE + ;; doesn't exist. + (erase-buffer) + (cond ((file-exists-p file) + (cond (limit + (if (not blocksize) (setq blocksize 8192)) + (let (found s) + (while (not found) + (setq s (buffer-size)) + (goto-char (1+ s)) + (setq found + (or (zerop (car (cdr + (insert-file-contents file nil s + (+ s blocksize))))) + (progn (beginning-of-line) + (re-search-forward limit nil t))))))) + (t (insert-file-contents file))) + (set-buffer-modified-p nil) + (auto-save-mode nil) + t) + (t nil))) + +(defun vc-parse-locks (file locks) + ;; Parse RCS or SCCS locks. + ;; The result is a list of the form ((VERSION USER) (VERSION USER) ...), + ;; which is returned and stored into the property `vc-master-locks'. + (if (not locks) + (vc-file-setprop file 'vc-master-locks 'none) + (let ((found t) (index 0) master-locks version user) + (cond ((eq (vc-backend file) 'SCCS) + (while (string-match "^\\([0-9.]+\\) [0-9.]+ \\([^ ]+\\) .*\n?" + locks index) + (setq version (substring locks + (match-beginning 1) (match-end 1))) + (setq user (substring locks + (match-beginning 2) (match-end 2))) + (setq master-locks (append master-locks + (list (cons version user)))) + (setq index (match-end 0)))) + ((eq (vc-backend file) 'RCS) + (while (string-match "[ \t\n]*\\([^:]+\\):\\([0-9.]+\\)" + locks index) + (setq version (substring locks + (match-beginning 2) (match-end 2))) + (setq user (substring locks + (match-beginning 1) (match-end 1))) + (setq master-locks (append master-locks + (list (cons version user)))) + (setq index (match-end 0))) + (if (string-match ";[ \t\n]+strict;" locks index) + (vc-file-setprop file 'vc-checkout-model 'manual) + (vc-file-setprop file 'vc-checkout-model 'implicit)))) + (vc-file-setprop file 'vc-master-locks (or master-locks 'none))))) + +(defun vc-simple-command (okstatus command file &rest args) + ;; Simple version of vc-do-command, for use in vc-hooks only. + ;; Don't switch to the *vc-info* buffer before running the + ;; command, because that would change its default directory + (save-excursion (set-buffer (get-buffer-create "*vc-info*")) + (erase-buffer)) + (let ((exec-path (append vc-path exec-path)) exec-status + ;; Add vc-path to PATH for the execution of this command. + (process-environment + (cons (concat "PATH=" (getenv "PATH") + path-separator + (mapconcat 'identity vc-path path-separator)) + process-environment))) + (setq exec-status + (apply 'call-process command nil "*vc-info*" nil + (append args (list file)))) + (cond ((> exec-status okstatus) + (switch-to-buffer (get-file-buffer file)) + (shrink-window-if-larger-than-buffer + (display-buffer "*vc-info*")) + (error "Couldn't find version control information"))) + exec-status)) + +(defun vc-fetch-master-properties (file) + ;; Fetch those properties of FILE that are stored in the master file. + ;; For an RCS file, we don't get vc-latest-version vc-your-latest-version + ;; here because that is slow. + ;; That gets done if/when the functions vc-latest-version + ;; and vc-your-latest-version get called. + (save-excursion + (cond + ((eq (vc-backend file) 'SCCS) + (set-buffer (get-buffer-create "*vc-info*")) + (if (vc-insert-file (vc-lock-file file)) + (vc-parse-locks file (buffer-string)) + (vc-file-setprop file 'vc-master-locks 'none)) + (vc-insert-file (vc-name file) "^\001e") + (vc-parse-buffer + (list '("^\001d D \\([^ ]+\\)" 1) + (list (concat "^\001d D \\([^ ]+\\) .* " + (regexp-quote (vc-user-login-name)) " ") 1)) + file + '(vc-latest-version vc-your-latest-version))) + + ((eq (vc-backend file) 'RCS) + (set-buffer (get-buffer-create "*vc-info*")) + (vc-insert-file (vc-name file) "^[0-9]") + (vc-parse-buffer + (list '("^head[ \t\n]+\\([^;]+\\);" 1) + '("^branch[ \t\n]+\\([^;]+\\);" 1) + '("^locks[ \t\n]*\\([^;]*;\\([ \t\n]*strict;\\)?\\)" 1)) + file + '(vc-head-version + vc-default-branch + vc-master-locks)) + ;; determine vc-master-workfile-version: it is either the head + ;; of the trunk, the head of the default branch, or the + ;; "default branch" itself, if that is a full revision number. + (let ((default-branch (vc-file-getprop file 'vc-default-branch))) + (cond + ;; no default branch + ((or (not default-branch) (string= "" default-branch)) + (vc-file-setprop file 'vc-master-workfile-version + (vc-file-getprop file 'vc-head-version))) + ;; default branch is actually a revision + ((string-match "^[0-9]+\\.[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*$" + default-branch) + (vc-file-setprop file 'vc-master-workfile-version default-branch)) + ;; else, search for the head of the default branch + (t (vc-insert-file (vc-name file) "^desc") + (vc-parse-buffer (list (list + (concat "^\\(" + (regexp-quote default-branch) + "\\.[0-9]+\\)\ndate[ \t]+\\([0-9.]+\\);") 1 2)) + file '(vc-master-workfile-version))))) + ;; translate the locks + (vc-parse-locks file (vc-file-getprop file 'vc-master-locks))) + + ((eq (vc-backend file) 'CVS) + (save-excursion + ;; Call "cvs status" in the right directory, passing only the + ;; nondirectory part of the file name -- otherwise CVS might + ;; silently give a wrong result. + (let ((default-directory (file-name-directory file))) + (vc-simple-command 0 "cvs" (file-name-nondirectory file) "status")) + (set-buffer (get-buffer "*vc-info*")) + (vc-parse-buffer + ;; CVS 1.3 says "RCS Version:", other releases "RCS Revision:", + ;; and CVS 1.4a1 says "Repository revision:". + '(("\\(RCS Version\\|RCS Revision\\|Repository revision\\):[\t ]+\\([0-9.]+\\)" 2) + ("^File: [^ \t]+[ \t]+Status: \\(.*\\)" 1)) + file + '(vc-latest-version vc-cvs-status)) + ;; Translate those status values that we understand into symbols. + ;; Any other value is converted to nil. + (let ((status (vc-file-getprop file 'vc-cvs-status))) + (cond + ((string-match "Up-to-date" status) + (vc-file-setprop file 'vc-cvs-status 'up-to-date) + (vc-file-setprop file 'vc-checkout-time + (nth 5 (file-attributes file)))) + ((vc-file-setprop file 'vc-cvs-status + (cond + ((string-match "Locally Modified" status) 'locally-modified) + ((string-match "Needs Merge" status) 'needs-merge) + ((string-match "Needs \\(Checkout\\|Patch\\)" status) + 'needs-checkout) + ((string-match "Unresolved Conflict" status) 'unresolved-conflict) + ((string-match "Locally Added" status) 'locally-added) + (t 'unknown) + )))))))) + (if (get-buffer "*vc-info*") + (kill-buffer (get-buffer "*vc-info*"))))) + +;;; Functions that determine property values, by examining the +;;; working file, the master file, or log program output + +(defun vc-consult-rcs-headers (file) + ;; Search for RCS headers in FILE, and set properties + ;; accordingly. This function can be disabled by setting + ;; vc-consult-headers to nil. + ;; Returns: nil if no headers were found + ;; (or if the feature is disabled, + ;; or if there is currently no buffer + ;; visiting FILE) + ;; 'rev if a workfile revision was found + ;; 'rev-and-lock if revision and lock info was found + (cond + ((or (not vc-consult-headers) + (not (get-file-buffer file))) nil) + ((let (status version locking-user) + (save-excursion + (set-buffer (get-file-buffer file)) + (goto-char (point-min)) + (cond + ;; search for $Id or $Header + ;; ------------------------- + ((or (and (search-forward "$Id: " nil t) + (looking-at "[^ ]+ \\([0-9.]+\\) ")) + (and (progn (goto-char (point-min)) + (search-forward "$Header: " nil t)) + (looking-at "[^ ]+ \\([0-9.]+\\) "))) + (goto-char (match-end 0)) + ;; if found, store the revision number ... + (setq version (buffer-substring-no-properties (match-beginning 1) + (match-end 1))) + ;; ... and check for the locking state + (cond + ((looking-at + (concat "[0-9]+[/-][01][0-9][/-][0-3][0-9] " ; date + "[0-2][0-9]:[0-5][0-9]+:[0-6][0-9]+\\([+-][0-9:]+\\)? " ; time + "[^ ]+ [^ ]+ ")) ; author & state + (goto-char (match-end 0)) ; [0-6] in regexp handles leap seconds + (cond + ;; unlocked revision + ((looking-at "\\$") + (setq locking-user 'none) + (setq status 'rev-and-lock)) + ;; revision is locked by some user + ((looking-at "\\([^ ]+\\) \\$") + (setq locking-user + (buffer-substring-no-properties (match-beginning 1) + (match-end 1))) + (setq status 'rev-and-lock)) + ;; everything else: false + (nil))) + ;; unexpected information in + ;; keyword string --> quit + (nil))) + ;; search for $Revision + ;; -------------------- + ((re-search-forward (concat "\\$" + "Revision: \\([0-9.]+\\) \\$") + nil t) + ;; if found, store the revision number ... + (setq version (buffer-substring-no-properties (match-beginning 1) + (match-end 1))) + ;; and see if there's any lock information + (goto-char (point-min)) + (if (re-search-forward (concat "\\$" "Locker:") nil t) + (cond ((looking-at " \\([^ ]+\\) \\$") + (setq locking-user (buffer-substring-no-properties + (match-beginning 1) + (match-end 1))) + (setq status 'rev-and-lock)) + ((looking-at " *\\$") + (setq locking-user 'none) + (setq status 'rev-and-lock)) + (t + (setq locking-user 'none) + (setq status 'rev-and-lock))) + (setq status 'rev))) + ;; else: nothing found + ;; ------------------- + (t nil))) + (if status (vc-file-setprop file 'vc-workfile-version version)) + (and (eq status 'rev-and-lock) + (eq (vc-backend file) 'RCS) + (vc-file-setprop file 'vc-locking-user locking-user) + ;; If the file has headers, we don't want to query the master file, + ;; because that would eliminate all the performance gain the headers + ;; brought us. We therefore use a heuristic for the checkout model + ;; now: If we trust the file permissions, and the file is not + ;; locked, then if the file is read-only the checkout model is + ;; `manual', otherwise `implicit'. + (not (vc-mistrust-permissions file)) + (not (vc-locking-user file)) + (if (string-match ".r-..-..-." (nth 8 (file-attributes file))) + (vc-file-setprop file 'vc-checkout-model 'manual) + (vc-file-setprop file 'vc-checkout-model 'implicit))) + status)))) + +;;; Access functions to file properties +;;; (Properties should be _set_ using vc-file-setprop, but +;;; _retrieved_ only through these functions, which decide +;;; if the property is already known or not. A property should +;;; only be retrieved by vc-file-getprop if there is no +;;; access function.) + +;;; properties indicating the backend +;;; being used for FILE + +(defun vc-backend-subdirectory-name (&optional file) + ;; Where the master and lock files for the current directory are kept + (symbol-name + (or + (and file (vc-backend file)) + vc-default-back-end + (setq vc-default-back-end (if (vc-find-binary "rcs") 'RCS 'SCCS))))) + +(defun vc-name (file) + "Return the master name of a file, nil if it is not registered. +For CVS, the full name of CVS/Entries is returned." + (or (vc-file-getprop file 'vc-name) + (let ((name-and-type (vc-registered file))) + (if name-and-type + (progn + (vc-file-setprop file 'vc-backend (cdr name-and-type)) + (vc-file-setprop file 'vc-name (car name-and-type))))))) + +(defun vc-backend (file) + "Return the version-control type of a file, nil if it is not registered." + (and file + (or (vc-file-getprop file 'vc-backend) + (let ((name-and-type (vc-registered file))) + (if name-and-type + (progn + (vc-file-setprop file 'vc-name (car name-and-type)) + (vc-file-setprop file 'vc-backend (cdr name-and-type)))))))) + +(defun vc-checkout-model (file) + ;; Return `manual' if the user has to type C-x C-q to check out FILE. + ;; Return `implicit' if the file can be modified without locking it first. + (or + (vc-file-getprop file 'vc-checkout-model) + (cond + ((eq (vc-backend file) 'SCCS) + (vc-file-setprop file 'vc-checkout-model 'manual)) + ((eq (vc-backend file) 'RCS) + (vc-consult-rcs-headers file) + (or (vc-file-getprop file 'vc-checkout-model) + (progn (vc-fetch-master-properties file) + (vc-file-getprop file 'vc-checkout-model)))) + ((eq (vc-backend file) 'CVS) + (vc-file-setprop file 'vc-checkout-model + (if (getenv "CVSREAD") 'manual 'implicit)))))) + +;;; properties indicating the locking state + +(defun vc-cvs-status (file) + ;; Return the cvs status of FILE + ;; (Status field in output of "cvs status") + (cond ((vc-file-getprop file 'vc-cvs-status)) + (t (vc-fetch-master-properties file) + (vc-file-getprop file 'vc-cvs-status)))) + +(defun vc-master-locks (file) + ;; Return the lock entries in the master of FILE. + ;; Return 'none if there are no such entries, and a list + ;; of the form ((VERSION USER) (VERSION USER) ...) otherwise. + (cond ((vc-file-getprop file 'vc-master-locks)) + (t (vc-fetch-master-properties file) + (vc-file-getprop file 'vc-master-locks)))) + +(defun vc-master-locking-user (file) + ;; Return the master file's idea of who is locking + ;; the current workfile version of FILE. + ;; Return 'none if it is not locked. + (let ((master-locks (vc-master-locks file)) lock) + (if (eq master-locks 'none) 'none + ;; search for a lock on the current workfile version + (setq lock (assoc (vc-workfile-version file) master-locks)) + (cond (lock (cdr lock)) + ('none))))) + +(defun vc-lock-from-permissions (file) + ;; If the permissions can be trusted for this file, determine the + ;; locking state from them. Returns (user-login-name), `none', or nil. + ;; This implementation assumes that any file which is under version + ;; control and has -rw-r--r-- is locked by its owner. This is true + ;; for both RCS and SCCS, which keep unlocked files at -r--r--r--. + ;; We have to be careful not to exclude files with execute bits on; + ;; scripts can be under version control too. Also, we must ignore the + ;; group-read and other-read bits, since paranoid users turn them off. + ;; This hack wins because calls to the somewhat expensive + ;; `vc-fetch-master-properties' function only have to be made if + ;; (a) the file is locked by someone other than the current user, + ;; or (b) some untoward manipulation behind vc's back has changed + ;; the owner or the `group' or `other' write bits. + (let ((attributes (file-attributes file))) + (if (not (vc-mistrust-permissions file)) + (cond ((string-match ".r-..-..-." (nth 8 attributes)) + (vc-file-setprop file 'vc-locking-user 'none)) + ((and (= (nth 2 attributes) (user-uid)) + (string-match ".rw..-..-." (nth 8 attributes))) + (vc-file-setprop file 'vc-locking-user (vc-user-login-name))) + (nil))))) + +(defun vc-user-login-name (&optional uid) + ;; Return the name under which the user is logged in, as a string. + ;; (With optional argument UID, return the name of that user.) + ;; This function does the same as `user-login-name', but unlike + ;; that, it never returns nil. If a UID cannot be resolved, that + ;; UID is returned as a string. + (or (user-login-name uid) + (and uid (number-to-string uid)) + (number-to-string (user-uid)))) + +(defun vc-file-owner (file) + ;; Return who owns FILE (user name, as a string). + (vc-user-login-name (nth 2 (file-attributes file)))) + +(defun vc-rcs-lock-from-diff (file) + ;; Diff the file against the master version. If differences are found, + ;; mark the file locked. This is only used for RCS with non-strict + ;; locking. (If "rcsdiff" doesn't understand --brief, we do a double-take + ;; and remember the fact for the future.) + (let* ((version (concat "-r" (vc-workfile-version file))) + (status (if (eq vc-rcsdiff-knows-brief 'no) + (vc-simple-command 1 "rcsdiff" file version) + (vc-simple-command 2 "rcsdiff" file "--brief" version)))) + (if (eq status 2) + (if (not vc-rcsdiff-knows-brief) + (setq vc-rcsdiff-knows-brief 'no + status (vc-simple-command 1 "rcsdiff" file version)) + (error "rcsdiff failed.")) + (if (not vc-rcsdiff-knows-brief) (setq vc-rcsdiff-knows-brief 'yes))) + (if (zerop status) + (vc-file-setprop file 'vc-locking-user 'none) + (vc-file-setprop file 'vc-locking-user (vc-file-owner file))))) + +(defun vc-locking-user (file) + ;; Return the name of the person currently holding a lock on FILE. + ;; Return nil if there is no such person. + ;; Under CVS, a file is considered locked if it has been modified since + ;; it was checked out. + ;; The property is cached. It is only looked up if it is currently nil. + ;; Note that, for a file that is not locked, the actual property value + ;; is `none', to distinguish it from an unknown locking state. That value + ;; is converted to nil by this function, and returned to the caller. + (let ((locking-user (vc-file-getprop file 'vc-locking-user))) + (if locking-user + ;; if we already know the property, return it + (if (eq locking-user 'none) nil locking-user) + + ;; otherwise, infer the property... + (cond + ((eq (vc-backend file) 'CVS) + (or (and (eq (vc-checkout-model file) 'manual) + (vc-lock-from-permissions file)) + (and (equal (vc-file-getprop file 'vc-checkout-time) + (nth 5 (file-attributes file))) + (vc-file-setprop file 'vc-locking-user 'none)) + (vc-file-setprop file 'vc-locking-user (vc-file-owner file)))) + + ((eq (vc-backend file) 'RCS) + (let (p-lock) + + ;; Check for RCS headers first + (or (eq (vc-consult-rcs-headers file) 'rev-and-lock) + + ;; If there are no headers, try to learn it + ;; from the permissions. + (and (setq p-lock (vc-lock-from-permissions file)) + (if (eq p-lock 'none) + + ;; If the permissions say "not locked", we know + ;; that the checkout model must be `manual'. + (vc-file-setprop file 'vc-checkout-model 'manual) + + ;; If the permissions say "locked", we can only trust + ;; this *if* the checkout model is `manual'. + (eq (vc-checkout-model file) 'manual))) + + ;; Otherwise, use lock information from the master file. + (vc-file-setprop file 'vc-locking-user + (vc-master-locking-user file))) + + ;; Finally, if the file is not explicitly locked + ;; it might still be locked implicitly. + (and (eq (vc-file-getprop file 'vc-locking-user) 'none) + (eq (vc-checkout-model file) 'implicit) + (vc-rcs-lock-from-diff file)))) + + ((eq (vc-backend file) 'SCCS) + (or (vc-lock-from-permissions file) + (vc-file-setprop file 'vc-locking-user + (vc-master-locking-user file))))) + + ;; convert a possible 'none value + (setq locking-user (vc-file-getprop file 'vc-locking-user)) + (if (eq locking-user 'none) nil locking-user)))) + +;;; properties to store current and recent version numbers + +(defun vc-latest-version (file) + ;; Return version level of the latest version of FILE + (cond ((vc-file-getprop file 'vc-latest-version)) + (t (vc-fetch-properties file) + (vc-file-getprop file 'vc-latest-version)))) + +(defun vc-your-latest-version (file) + ;; Return version level of the latest version of FILE checked in by you + (cond ((vc-file-getprop file 'vc-your-latest-version)) + (t (vc-fetch-properties file) + (vc-file-getprop file 'vc-your-latest-version)))) + +(defun vc-master-workfile-version (file) + ;; Return the master file's idea of what is the current workfile version. + ;; This property is defined for RCS only. + (cond ((vc-file-getprop file 'vc-master-workfile-version)) + (t (vc-fetch-master-properties file) + (vc-file-getprop file 'vc-master-workfile-version)))) + +(defun vc-fetch-properties (file) + ;; Fetch vc-latest-version and vc-your-latest-version + ;; if that wasn't already done. + (cond + ((eq (vc-backend file) 'RCS) + (save-excursion + (set-buffer (get-buffer-create "*vc-info*")) + (vc-insert-file (vc-name file) "^desc") + (vc-parse-buffer + (list '("^\\([0-9]+\\.[0-9.]+\\)\ndate[ \t]+\\([0-9.]+\\);" 1 2) + (list (concat "^\\([0-9]+\\.[0-9.]+\\)\n" + "date[ \t]+\\([0-9.]+\\);[ \t]+" + "author[ \t]+" + (regexp-quote (vc-user-login-name)) ";") 1 2)) + file + '(vc-latest-version vc-your-latest-version)) + (if (get-buffer "*vc-info*") + (kill-buffer (get-buffer "*vc-info*"))))) + (t (vc-fetch-master-properties file)) + )) + +(defun vc-workfile-version (file) + ;; Return version level of the current workfile FILE + ;; This is attempted by first looking at the RCS keywords. + ;; If there are no keywords in the working file, + ;; vc-master-workfile-version is taken. + ;; Note that this property is cached, that is, it is only + ;; looked up if it is nil. + ;; For SCCS, this property is equivalent to vc-latest-version. + (cond ((vc-file-getprop file 'vc-workfile-version)) + ((eq (vc-backend file) 'SCCS) (vc-latest-version file)) + ((eq (vc-backend file) 'RCS) + (if (vc-consult-rcs-headers file) + (vc-file-getprop file 'vc-workfile-version) + (let ((rev (cond ((vc-master-workfile-version file)) + ((vc-latest-version file))))) + (vc-file-setprop file 'vc-workfile-version rev) + rev))) + ((eq (vc-backend file) 'CVS) + (if (vc-consult-rcs-headers file) ;; CVS + (vc-file-getprop file 'vc-workfile-version) + (catch 'found + (vc-find-cvs-master (file-name-directory file) + (file-name-nondirectory file))) + (vc-file-getprop file 'vc-workfile-version))))) + ;;; actual version-control code starts here (defun vc-registered (file) - (let (handler) + (let (handler handlers) (if (boundp 'file-name-handler-alist) (setq handler (find-file-name-handler file 'vc-registered))) (if handler @@ -95,122 +748,131 @@ (catch 'found (mapcar (function (lambda (s) - (if (atom s) - (funcall s dirname basename) - (let ((trial (format (car s) dirname basename))) - (if (and (file-exists-p trial) - ;; Make sure the file we found with name - ;; TRIAL is not the source file itself. - ;; That can happen with RCS-style names - ;; if the file name is truncated - ;; (e.g. to 14 chars). See if either - ;; directory or attributes differ. - (or (not (string= dirname - (file-name-directory trial))) - (not (equal - (file-attributes file) - (file-attributes trial))))) - (throw 'found (cons trial (cdr s)))))))) + (if (atom s) + (funcall s dirname basename) + (let ((trial (format (car s) dirname basename))) + (if (and (file-exists-p trial) + ;; Make sure the file we found with name + ;; TRIAL is not the source file itself. + ;; That can happen with RCS-style names + ;; if the file name is truncated + ;; (e.g. to 14 chars). See if either + ;; directory or attributes differ. + (or (not (string= dirname + (file-name-directory trial))) + (not (equal + (file-attributes file) + (file-attributes trial))))) + (throw 'found (cons trial (cdr s)))))))) vc-master-templates) nil))))) (defun vc-find-cvs-master (dirname basename) ;; Check if DIRNAME/BASENAME is handled by CVS. ;; If it is, do a (throw 'found (cons MASTER 'CVS)). - ;; Note: If the file is ``cvs add''ed but not yet ``cvs commit''ed - ;; the MASTER will not actually exist yet. The other parts of VC - ;; checks for this condition. This function returns something random if - ;; DIRNAME/BASENAME is not handled by CVS. - (and (string= "" dirname) (setq dirname default-directory)) - (if (and (file-directory-p (concat dirname "CVS/")) + ;; Note: This function throws the name of CVS/Entries + ;; NOT that of the RCS master file (because we wouldn't be able + ;; to access it under remote CVS). + ;; The function returns nil if DIRNAME/BASENAME is not handled by CVS. + (if (and vc-handle-cvs + (file-directory-p (concat dirname "CVS/")) (file-readable-p (concat dirname "CVS/Entries"))) - (let ((fname (concat dirname basename)) - sbuf rev) + (let (buffer time (fold case-fold-search) + (file (concat dirname basename))) (unwind-protect (save-excursion - (set-buffer (generate-new-buffer " vc-scratch")) - (setq sbuf (current-buffer)) - (insert-file-contents (concat dirname "CVS/Entries")) + (setq buffer (set-buffer (get-buffer-create "*vc-info*"))) + (vc-insert-file (concat dirname "CVS/Entries")) + (goto-char (point-min)) + ;; make sure the file name is searched + ;; case-sensitively + (setq case-fold-search nil) (cond + ;; normal entry ((re-search-forward - (concat "^/" (regexp-quote basename) "/\\([0-9.]*\\)/.*/\\(T\\([^/\n]+\\)\\)?$") + (concat "^/" (regexp-quote basename) + "/\\([^/]*\\)/[^ /]* \\([A-Z][a-z][a-z]\\) *\\([0-9]*\\) \\([0-9]*\\):\\([0-9]*\\):\\([0-9]*\\) \\([0-9]*\\)") nil t) - ;; We found it. Store version number, and branch tag - (setq rev (buffer-substring (match-beginning 1) - (match-end 1))) - (vc-file-setprop fname 'vc-your-latest-version rev) - ;; XEmacs - we put something useful in the modeline - (vc-file-setprop fname 'sticky-tag - (cond ((string= "0" rev) "newfile") - ((match-beginning 3) - (buffer-substring (match-beginning 3) - (match-end 3))) - (t "main"))) - (erase-buffer) - (insert-file-contents (concat dirname "CVS/Repository")) - (let ((master - (concat (file-name-as-directory - (buffer-substring (point-min) - (1- (point-max)))) - basename - ",v"))) - (throw 'found (cons master 'CVS)))))) - (kill-buffer sbuf))))) + (setq case-fold-search fold) ;; restore the old value + ;; We found it. Store away version number now that we + ;; are anyhow so close to finding it. + (vc-file-setprop file + 'vc-workfile-version + (match-string 1)) + ;; If the file hasn't been modified since checkout, + ;; store the checkout-time. + (let ((mtime (nth 5 (file-attributes file))) + (second (string-to-number (match-string 6))) + (minute (string-to-number (match-string 5))) + (hour (string-to-number (match-string 4))) + (day (string-to-number (match-string 3))) + (year (string-to-number (match-string 7)))) + (if (equal mtime + (encode-time + second minute hour day + (/ (string-match + (match-string 2) + "xxxJanFebMarAprMayJunJulAugSepOctNovDec") + 3) + year 0)) + (vc-file-setprop file 'vc-checkout-time mtime) + (vc-file-setprop file 'vc-checkout-time 0))) + (throw 'found (cons (concat dirname "CVS/Entries") 'CVS))) + ;; entry for a "locally added" file (not yet committed) + ((re-search-forward + (concat "^/" (regexp-quote basename) "/0/Initial ") nil t) + (setq case-fold-search fold) ;; restore the old value + (vc-file-setprop file 'vc-checkout-time 0) + (vc-file-setprop file 'vc-workfile-version "0") + (throw 'found (cons (concat dirname "CVS/Entries") 'CVS))) + (t (setq case-fold-search fold) ;; restore the old value + nil))) + (kill-buffer buffer))))) -(defun vc-name (file) - "Return the master name of a file, nil if it is not registered." - (or (vc-file-getprop file 'vc-name) - (let ((name-and-type (vc-registered file))) - (if name-and-type - (progn - (vc-file-setprop file 'vc-backend (cdr name-and-type)) - (vc-file-setprop file 'vc-name (car name-and-type))))))) - -(defun vc-backend-deduce (file) - "Return the version-control type of a file, nil if it is not registered." - (and file - (or (vc-file-getprop file 'vc-backend) - (let ((name-and-type (vc-registered file))) - (if name-and-type - (progn - (vc-file-setprop file 'vc-name (car name-and-type)) - (vc-file-setprop file 'vc-backend (cdr name-and-type)))))))) +(defun vc-buffer-backend () + "Return the version-control type of the visited file, or nil if none." + (if (eq vc-buffer-backend t) + (setq vc-buffer-backend (vc-backend (buffer-file-name))) + vc-buffer-backend)) (defun vc-toggle-read-only (&optional verbose) "Change read-only status of current buffer, perhaps via version control. -If the buffer is visiting a file registered with a form of version control -that locks files by making them read-only (i.e.: not CVS), then check the -file in or out. Otherwise, just change the read-only flag of the buffer. - -If you provide a prefix argument, we pass it on to `vc-next-action'." +If the buffer is visiting a file registered with version control, +then check the file in or out. Otherwise, just change the read-only flag +of the buffer. With prefix argument, ask for version number." (interactive "P") - (let ((vc-type (vc-backend-deduce (buffer-file-name)))) - (cond ((and vc-type - buffer-read-only - (file-writable-p buffer-file-name) - (/= 0 (user-uid))) - ;; XEmacs - The buffer isn't read-only because it's locked, so - ;; keep vc out of this... - (toggle-read-only)) - ((and vc-type (not (eq 'CVS vc-type))) - (vc-next-action verbose)) - (t - (toggle-read-only))) - )) - + (if (vc-backend (buffer-file-name)) + (vc-next-action verbose) + (toggle-read-only))) (define-key global-map "\C-x\C-q" 'vc-toggle-read-only) -(defun vc-file-owner (file) - ;; XEmacs - vc-locking-user is just WAY too slow. - (let* ((fa (file-attributes file))) - (cond ((eq ?w (aref (nth 8 fa) 2)) ; -rw-r--r-- - ;; #### - if it's writable, we trust unix...dumb move? - (user-login-name (nth 2 fa))) - (t - ;; big slowness here... - (require 'vc) - (vc-locking-user file) - )))) +(defun vc-after-save () + ;; Function to be called by basic-save-buffer (in files.el). + ;; If the file in the current buffer is under version control, + ;; not locked, and the checkout model for it is `implicit', + ;; mark it "locked" and redisplay the mode line. + (let ((file (buffer-file-name))) + (and (vc-file-getprop file 'vc-backend) + ;; ...check the property directly, not through the function of the + ;; same name. Otherwise Emacs would check for a master file + ;; each time a non-version-controlled buffer is saved. + ;; The property is computed when the file is visited, so if it + ;; is `nil' now, it is certain that the file is NOT + ;; version-controlled. + (or (and (equal (vc-file-getprop file 'vc-checkout-time) + (nth 5 (file-attributes file))) + ;; File has been saved in the same second in which + ;; it was checked out. Clear the checkout-time + ;; to avoid confusion. + (vc-file-setprop file 'vc-checkout-time nil)) + t) + (not (vc-locking-user file)) + (eq (vc-checkout-model file) 'implicit) + (vc-file-setprop file 'vc-locking-user (vc-user-login-name)) + (or (and (eq (vc-backend file) 'CVS) + (vc-file-setprop file 'vc-cvs-status nil)) + t) + (vc-mode-line file)))) (defun vc-mode-line (file &optional label) "Set `vc-mode' to display type of version control for FILE. @@ -218,166 +880,119 @@ visiting FILE. Second optional arg LABEL is put in place of version control system name." (interactive (list buffer-file-name nil)) - (if file - (let ((vc-type (vc-backend-deduce file))) - (setq vc-mode - (if vc-type - (concat " " (or label (symbol-name vc-type)) - (if vc-display-status - (vc-status file vc-type))))) - ;; Even root shouldn't modify a registered file without - ;; locking it first. - (and vc-type - (not (string= (user-login-name) (vc-file-owner file))) - (setq buffer-read-only t)) - (and (null vc-type) - (file-symlink-p file) - (let ((link-type (vc-backend-deduce (file-symlink-p file)))) - (if link-type - (message - "Warning: symbolic link to %s-controlled source file" - link-type)))) - (redraw-modeline) - ;;(set-buffer-modified-p (buffer-modified-p)) ;;use this if Emacs 18 - vc-type))) - -(defun vc-status (file vc-type) - ;; Return string for placement in modeline by `vc-mode-line'. - ;; If FILE is not registered, return nil. - ;; If FILE is registered but not locked, return " REV" if there is a head - ;; revision and " @@" otherwise. - ;; If FILE is locked then return all locks in a string of the - ;; form " LOCKER1:REV1 LOCKER2:REV2 ...", where "LOCKERi:" is empty if you - ;; are the locker, and otherwise is the name of the locker followed by ":". - - ;; Algorithm: - - ;; Check for master file corresponding to FILE being visited. - ;; - ;; RCS: Insert the first few characters of the master file into a - ;; work buffer. Search work buffer for "locks...;" phrase; if not - ;; found, then keep inserting more characters until the phrase is - ;; found. Extract the locks, and remove control characters - ;; separating them, like newlines; the string " user1:revision1 - ;; user2:revision2 ..." is returned. - ;; - ;; SCCS: Check if the p-file exists. If it does, read it and - ;; extract the locks, giving them the right format. Else use prs to - ;; find the revision number. - ;; - ;; CVS: vc-find-cvs-master has already stored the current revision - ;; number and sticky-tag for the file. XEmacs displays the sticky-tag. - - ;; Limitations: - - ;; The output doesn't show which version you are actually looking at. - ;; The modeline can get quite cluttered when there are multiple locks. - ;; The head revision is probably not what you want if you've used `rcs -b'. - - (let ((master (vc-name file)) - found - status) - - ;; If master file exists, then parse its contents, otherwise we - ;; return the nil value of this if form. - (if (and master vc-type) - (save-excursion - - ;; Create work buffer. - (set-buffer (get-buffer-create " *vc-status*")) - (setq buffer-read-only nil - default-directory (file-name-directory master)) - (erase-buffer) - - ;; Set the `status' var to the return value. - (cond + (let ((vc-type (vc-backend file))) + (setq vc-mode + (and vc-type + (concat " " (or label (symbol-name vc-type)) + (and vc-display-status (vc-status file))))) + ;; If the file is locked by some other user, make + ;; the buffer read-only. Like this, even root + ;; cannot modify a file that someone else has locked. + (and vc-type + (equal file (buffer-file-name)) + (vc-locking-user file) + (not (string= (vc-user-login-name) (vc-locking-user file))) + (setq buffer-read-only t)) + ;; If the user is root, and the file is not owner-writable, + ;; then pretend that we can't write it + ;; even though we can (because root can write anything). + ;; This way, even root cannot modify a file that isn't locked. + (and vc-type + (equal file (buffer-file-name)) + (not buffer-read-only) + (zerop (user-real-uid)) + (zerop (logand (file-modes (buffer-file-name)) 128)) + (setq buffer-read-only t)) + (force-mode-line-update) + ;;(set-buffer-modified-p (buffer-modified-p)) ;;use this if Emacs 18 + vc-type)) - ;; RCS code. - ((eq vc-type 'RCS) - ;; Check if we have enough of the header. - ;; If not, then keep including more. - (while - (not (or found - (let ((s (buffer-size))) - (goto-char (1+ s)) - (zerop (car (cdr (insert-file-contents - master nil s (+ s 8192)))))))) - (beginning-of-line) - (setq found (re-search-forward "^locks\\([^;]*\\);" nil t))) - - (if found - ;; Clean control characters and self-locks from text. - (let* ((lock-pattern - (concat "[ \b\t\n\v\f\r]+\\(" - (regexp-quote (user-login-name)) - ":\\)?")) - (locks - (save-restriction - (narrow-to-region (match-beginning 1) (match-end 1)) - (goto-char (point-min)) - (while (re-search-forward lock-pattern nil t) - (replace-match (if (eobp) "" ":") t t)) - (buffer-string)))) - (setq status - (if (not (string-equal locks "")) - locks - (goto-char (point-min)) - (if (looking-at "head[ \b\t\n\v\f\r]+\\([.0-9]+\\)") - (concat "-" - (buffer-substring (match-beginning 1) - (match-end 1))) - " @@")))))) +(defun vc-status (file) + ;; Return string for placement in modeline by `vc-mode-line'. + ;; Format: + ;; + ;; "-REV" if the revision is not locked + ;; ":REV" if the revision is locked by the user + ;; ":LOCKER:REV" if the revision is locked by somebody else + ;; " @@" for a CVS file that is added, but not yet committed + ;; + ;; In the CVS case, a "locked" working file is a + ;; working file that is modified with respect to the master. + ;; The file is "locked" from the moment when the user saves + ;; the modified buffer. + ;; + ;; This function assumes that the file is registered. - ;; SCCS code. - ((eq vc-type 'SCCS) - ;; Build the name of the p-file and put it in the work buffer. - (insert master) - (search-backward "/s.") - (delete-char 2) - (insert "/p") - (if (not (file-exists-p (buffer-string))) - ;; No lock. - (let ((exec-path (if (boundp 'vc-path) (append exec-path vc-path) - exec-path))) - (erase-buffer) - (insert "-") - (if (zerop (call-process "prs" nil t nil "-d:I:" master)) - (setq status (buffer-substring 1 (1- (point-max)))))) - ;; Locks exist. - (insert-file-contents (buffer-string) nil nil nil t) - (while (looking-at "[^ ]+ \\([^ ]+\\) \\([^ ]+\\).*\n") - (replace-match " \\2:\\1")) - (setq status (buffer-string)) - (aset status 0 ?:))) - ;; CVS code. - ((eq vc-type 'CVS) - ;; sticky-tag is initialized by vc-backend-deduce - (setq status (concat ":" (vc-file-getprop file 'sticky-tag) "-" - (vc-file-getprop file 'vc-your-latest-version) - )) - ) - ;; ClearCase code. - ((eq vc-type 'CC) - (require 'vc) - (setq status (concat ":" (vc-latest-version file))) - )) + (let ((locker (vc-locking-user file)) + (rev (vc-workfile-version file))) + (cond ((string= "0" rev) + " @@") + ((not locker) + (concat "-" rev)) + ((string= locker (vc-user-login-name)) + (concat ":" rev)) + (t + (concat ":" locker ":" rev))))) - ;; Clean work buffer. - (erase-buffer) - (set-buffer-modified-p nil) - status)))) +(defun vc-follow-link () + ;; If the current buffer visits a symbolic link, this function makes it + ;; visit the real file instead. If the real file is already visited in + ;; another buffer, make that buffer current, and kill the buffer + ;; that visits the link. + (let* ((truename (abbreviate-file-name (file-chase-links buffer-file-name))) + (true-buffer (find-buffer-visiting truename)) + (this-buffer (current-buffer))) + (if (eq true-buffer this-buffer) + (progn + (kill-buffer this-buffer) + ;; In principle, we could do something like set-visited-file-name. + ;; However, it can't be exactly the same as set-visited-file-name. + ;; I'm not going to work out the details right now. -- rms. + (set-buffer (find-file-noselect truename))) + (set-buffer true-buffer) + (kill-buffer this-buffer)))) ;;; install a call to the above as a find-file hook (defun vc-find-file-hook () ;; Recompute whether file is version controlled, ;; if user has killed the buffer and revisited. - (if buffer-file-name - (vc-file-setprop buffer-file-name 'vc-backend nil)) - (if (and (vc-mode-line buffer-file-name) (not vc-make-backup-files)) - (progn - ;; Use this variable, not make-backup-files, - ;; because this is for things that depend on the file name. - (set (make-local-variable 'backup-inhibited) t)))) + (cond + (buffer-file-name + (vc-file-clearprops buffer-file-name) + (cond + ((vc-backend buffer-file-name) + (vc-mode-line buffer-file-name) + (cond ((not vc-make-backup-files) + ;; Use this variable, not make-backup-files, + ;; because this is for things that depend on the file name. + (make-local-variable 'backup-inhibited) + (setq backup-inhibited t)))) + ((let* ((link (file-symlink-p buffer-file-name)) + (link-type (and link (vc-backend (file-chase-links link))))) + (if link-type + (cond ((eq vc-follow-symlinks nil) + (message + "Warning: symbolic link to %s-controlled source file" link-type)) + ((or (not (eq vc-follow-symlinks 'ask)) + ;; If we already visited this file by following + ;; the link, don't ask again if we try to visit + ;; it again. GUD does that, and repeated questions + ;; are painful. + (get-file-buffer + (abbreviate-file-name (file-chase-links buffer-file-name)))) + + (vc-follow-link) + (message "Followed link to %s" buffer-file-name) + (vc-find-file-hook)) + (t + (if (yes-or-no-p (format + "Symbolic link to %s-controlled source file; follow link? " link-type)) + (progn (vc-follow-link) + (message "Followed link to %s" buffer-file-name) + (vc-find-file-hook)) + (message + "Warning: editing through the link bypasses version control") + )))))))))) (add-hook 'find-file-hooks 'vc-find-file-hook) @@ -385,80 +1000,87 @@ (defun vc-file-not-found-hook () "When file is not found, try to check it out from RCS or SCCS. Returns t if checkout was successful, nil otherwise." - (if (vc-backend-deduce buffer-file-name) + (if (vc-backend buffer-file-name) (save-excursion (require 'vc) + (setq default-directory (file-name-directory (buffer-file-name))) (not (vc-error-occurred (vc-checkout buffer-file-name)))))) (add-hook 'find-file-not-found-hooks 'vc-file-not-found-hook) +;; Discard info about a file when we kill its buffer. +(defun vc-kill-buffer-hook () + (if (stringp (buffer-file-name)) + (progn + (vc-file-clearprops (buffer-file-name)) + (kill-local-variable 'vc-buffer-backend)))) + +;;;(add-hook 'kill-buffer-hook 'vc-kill-buffer-hook) + ;;; Now arrange for bindings and autoloading of the main package. ;;; Bindings for this have to go in the global map, as we'll often ;;; want to call them from random buffers. -; XEmacs - this is preloaded. let's not be obtuse! -(defconst vc-prefix-map - (let ((map (make-sparse-keymap))) - (set-keymap-name map 'vc-prefix-map) - (define-key map "a" 'vc-update-change-log) - (define-key map "c" 'vc-cancel-version) - (define-key map "d" 'vc-directory) - (define-key map "h" 'vc-insert-headers) - (define-key map "i" 'vc-register) - (define-key map "l" 'vc-print-log) - (define-key map "r" 'vc-retrieve-snapshot) - (define-key map "s" 'vc-create-snapshot) - (define-key map "u" 'vc-revert-buffer) - (define-key map "v" 'vc-next-action) - (define-key map "=" 'vc-diff) - (define-key map "?" 'vc-file-status) ; XEmacs - this doesn't fit elsewhere - (define-key map "~" 'vc-version-other-window) - (global-set-key "\C-xv" map) - map - )) +(setq vc-prefix-map (lookup-key global-map "\C-xv")) +(if (not (keymapp vc-prefix-map)) + (progn + (setq vc-prefix-map (make-sparse-keymap)) + (define-key global-map "\C-xv" vc-prefix-map) + (define-key vc-prefix-map "a" 'vc-update-change-log) + (define-key vc-prefix-map "c" 'vc-cancel-version) + (define-key vc-prefix-map "d" 'vc-directory) + (define-key vc-prefix-map "h" 'vc-insert-headers) + (define-key vc-prefix-map "i" 'vc-register) + (define-key vc-prefix-map "l" 'vc-print-log) + (define-key vc-prefix-map "r" 'vc-retrieve-snapshot) + (define-key vc-prefix-map "s" 'vc-create-snapshot) + (define-key vc-prefix-map "u" 'vc-revert-buffer) + (define-key vc-prefix-map "v" 'vc-next-action) + (define-key vc-prefix-map "=" 'vc-diff) + #+xemacs (define-key vc-prefix-map "?" 'vc-file-status) + (define-key vc-prefix-map "~" 'vc-version-other-window))) -;; FSF menus... -;; (if (not (boundp 'vc-menu-map)) -;; ;; Don't do the menu bindings if menu-bar.el wasn't loaded to defvar -;; ;; vc-menu-map. -;; () -;; ;;(define-key vc-menu-map [show-files] -;; ;; '("Show Files under VC" . (vc-directory t))) -;; (define-key vc-menu-map [vc-directory] '("Show Locked Files" . vc-directory)) -;; (define-key vc-menu-map [separator1] '("----")) -;; (define-key vc-menu-map [vc-rename-file] '("Rename File" . vc-rename-file)) -;; (define-key vc-menu-map [vc-version-other-window] -;; '("Show Other Version" . vc-version-other-window)) -;; (define-key vc-menu-map [vc-diff] '("Compare with Last Version" . vc-diff)) -;; (define-key vc-menu-map [vc-update-change-log] -;; '("Update ChangeLog" . vc-update-change-log)) -;; (define-key vc-menu-map [vc-print-log] '("Show History" . vc-print-log)) -;; (define-key vc-menu-map [separator2] '("----")) -;; (define-key vc-menu-map [undo] '("Undo Last Check-In" . vc-cancel-version)) -;; (define-key vc-menu-map [vc-revert-buffer] -;; '("Revert to Last Version" . vc-revert-buffer)) -;; (define-key vc-menu-map [vc-insert-header] -;; '("Insert Header" . vc-insert-headers)) -;; (define-key vc-menu-map [vc-menu-check-in] '("Check In" . vc-next-action)) -;; (define-key vc-menu-map [vc-check-out] '("Check Out" . vc-toggle-read-only)) -;; (define-key vc-menu-map [vc-register] '("Register" . vc-register)) -;; (put 'vc-rename-file 'menu-enable 'vc-mode) -;; (put 'vc-version-other-window 'menu-enable 'vc-mode) -;; (put 'vc-diff 'menu-enable 'vc-mode) -;; (put 'vc-update-change-log 'menu-enable -;; '(eq (vc-backend-deduce (buffer-file-name)) 'RCS)) -;; (put 'vc-print-log 'menu-enable 'vc-mode) -;; (put 'vc-cancel-version 'menu-enable 'vc-mode) -;; (put 'vc-revert-buffer 'menu-enable 'vc-mode) -;; (put 'vc-insert-headers 'menu-enable 'vc-mode) -;; (put 'vc-next-action 'menu-enable '(and vc-mode (not buffer-read-only))) -;; (put 'vc-toggle-read-only 'menu-enable '(and vc-mode buffer-read-only)) -;; (put 'vc-register 'menu-enable '(not vc-mode)) -;; ) +;; Emacs menus +;(if (not (boundp 'vc-menu-map)) +; ;; Don't do the menu bindings if menu-bar.el wasn't loaded to defvar +; ;; vc-menu-map. +; () +; ;;(define-key vc-menu-map [show-files] +; ;; '("Show Files under VC" . (vc-directory t))) +; (define-key vc-menu-map [vc-directory] '("Show Locked Files" . vc-directory)) +; (define-key vc-menu-map [separator1] '("----")) +; (define-key vc-menu-map [vc-rename-file] '("Rename File" . vc-rename-file)) +; (define-key vc-menu-map [vc-version-other-window] +; '("Show Other Version" . vc-version-other-window)) +; (define-key vc-menu-map [vc-diff] '("Compare with Last Version" . vc-diff)) +; (define-key vc-menu-map [vc-update-change-log] +; '("Update ChangeLog" . vc-update-change-log)) +; (define-key vc-menu-map [vc-print-log] '("Show History" . vc-print-log)) +; (define-key vc-menu-map [separator2] '("----")) +; (define-key vc-menu-map [undo] '("Undo Last Check-In" . vc-cancel-version)) +; (define-key vc-menu-map [vc-revert-buffer] +; '("Revert to Last Version" . vc-revert-buffer)) +; (define-key vc-menu-map [vc-insert-header] +; '("Insert Header" . vc-insert-headers)) +; (define-key vc-menu-map [vc-menu-check-in] '("Check In" . vc-next-action)) +; (define-key vc-menu-map [vc-check-out] '("Check Out" . vc-toggle-read-only)) +; (define-key vc-menu-map [vc-register] '("Register" . vc-register))) -;; #### - sync with fsf menus +;(put 'vc-rename-file 'menu-enable 'vc-mode) +;(put 'vc-version-other-window 'menu-enable 'vc-mode) +;(put 'vc-diff 'menu-enable 'vc-mode) +;(put 'vc-update-change-log 'menu-enable +; '(eq (vc-buffer-backend) 'RCS)) +;(put 'vc-print-log 'menu-enable 'vc-mode) +;(put 'vc-cancel-version 'menu-enable 'vc-mode) +;(put 'vc-revert-buffer 'menu-enable 'vc-mode) +;(put 'vc-insert-headers 'menu-enable 'vc-mode) +;(put 'vc-next-action 'menu-enable 'vc-mode) +;(put 'vc-toggle-read-only 'menu-enable 'vc-mode) +;(put 'vc-register 'menu-enable '(and buffer-file-name (not vc-mode))) + (defconst vc-menu - '("Version Control" + '("VC" :filter vc-menu-filter ["" vc-next-action buffer-file-name nil] ;; ^^^ this gets changed to checkin, checkout, register, or steal @@ -492,7 +1114,7 @@ (defun vc-menu-filter (menu-items) (let* ((result menu-items) ; modify in-place (case-fold-search t) - (type (vc-backend-deduce buffer-file-name)) + (type (vc-backend buffer-file-name)) (file (if buffer-file-name (file-name-nondirectory buffer-file-name) (buffer-name))) @@ -541,8 +1163,7 @@ (add-menu-button '("Tools") "---" "Compare")) )) -;; #### called by files.el. Define it like this until we're merged. -(defun vc-after-save ()) +;;; End XEmacs menus (provide 'vc-hooks)
--- a/lisp/packages/vc.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/packages/vc.el Mon Aug 13 09:37:19 2007 +0200 @@ -1,33 +1,28 @@ ;;; vc.el --- drive a version-control system from within Emacs -;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. -;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. +;; Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -;; Author: Eric S. Raymond <esr@snark.thyrsus.com> -;; Maintainer: ttn@netcom.com -;; Version: 5.6 +;; Author: Eric S. Raymond <esr@snark.thyrsus.com> +;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> +;; XEmacs conversion: Steve Baur <steve@altair.xemacs.org> -;; This file is part of XEmacs. +;; This file is part of GNU Emacs. -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. -;; XEmacs is 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. +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with GNU Emacs; 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: It's not clear at this point. -;;; mly synched this with FSF at version 5.4. Stig did a whole lot -;;; of stuff to it since then, and so has the FSF. - ;;; Commentary: ;; This mode is fully documented in the Emacs user's manual. @@ -36,20 +31,21 @@ ;; Paul Eggert <eggert@twinsun.com>, Sebastian Kremer <sk@thp.uni-koeln.de>, ;; and Richard Stallman contributed valuable criticism, support, and testing. ;; CVS support was added by Per Cederqvist <ceder@lysator.liu.se> -;; in Jan-Feb 1994. -;; -;; XEmacs fixes, CVS fixes, and general improvements -;; by Jonathan Stigelman <Stig@hackvan.com> +;; in Jan-Feb 1994. Further enhancements came from ttn.netcom.com and +;; Andre Spiegel <spiegel@inf.fu-berlin.de>. ;; ;; Supported version-control systems presently include SCCS, RCS, and CVS. -;; The RCS lock-stealing code doesn't work right unless you use RCS 5.6.2 -;; or newer. Currently (January 1994) that is only a beta test release. +;; +;; Some features will not work with old RCS versions. Where +;; appropriate, VC finds out which version you have, and allows or +;; disallows those features (stealing locks, for example, works only +;; from 5.6.2 onwards). ;; Even initial checkins will fail if your RCS version is so old that ci ;; doesn't understand -t-; this has been known to happen to people running ;; NExTSTEP 3.0. ;; -;; The RCS code assumes strict locking. You can support the RCS -x option -;; by adding pairs to the vc-master-templates list. +;; You can support the RCS -x option by adding pairs to the +;; vc-master-templates list. ;; ;; Proper function of the SCCS diff commands requires the shellscript vcdiff ;; to be installed somewhere on Emacs's path for executables. @@ -75,67 +71,77 @@ (require 'vc-hooks) (require 'ring) -(eval-when-compile (require 'dired)) ; for dired-map-over-marks macro +(eval-when-compile (require 'dired)) ; for dired-map-over-marks macro (if (not (assoc 'vc-parent-buffer minor-mode-alist)) (setq minor-mode-alist (cons '(vc-parent-buffer vc-parent-buffer-name) minor-mode-alist))) +;; To implement support for a new version-control system, add another +;; branch to the vc-backend-dispatch macro and fill it in in each +;; call. The variable vc-master-templates in vc-hooks.el will also +;; have to change. + +(defmacro vc-backend-dispatch (f s r c) + "Execute FORM1, FORM2 or FORM3 for SCCS, RCS or CVS respectively. +If FORM3 is `RCS', use FORM2 for CVS as well as RCS. +\(CVS shares some code with RCS)." + (list 'let (list (list 'type (list 'vc-backend f))) + (list 'cond + (list (list 'eq 'type (quote 'SCCS)) s) ;; SCCS + (list (list 'eq 'type (quote 'RCS)) r) ;; RCS + (list (list 'eq 'type (quote 'CVS)) ;; CVS + (if (eq c 'RCS) r c)) + ))) + ;; General customization -(defvar vc-default-back-end nil - "*Back-end actually used by this interface; may be SCCS or RCS. -The value is only computed when needed to avoid an expensive search.") (defvar vc-suppress-confirm nil "*If non-nil, treat user as expert; suppress yes-no prompts on some things.") -(defvar vc-keep-workfiles t - "*If non-nil, don't delete working files after registering changes. -If the back-end is CVS, workfiles are always kept, regardless of the -value of this flag.") (defvar vc-initial-comment nil - "*Prompt for initial comment when a file is registered.") + "*If non-nil, prompt for initial comment when a file is registered.") (defvar vc-command-messages nil - "*Display run messages from back-end commands.") -(defvar vc-mistrust-permissions 'file-symlink-p - "*Don't assume that permissions and ownership track version-control status.") + "*If non-nil, display run messages from back-end commands.") +(defvar vc-register-switches nil + "*A string or list of strings specifying extra switches passed +to the register program by \\[vc-register].") (defvar vc-checkin-switches nil - "*Extra switches passed to the checkin program by \\[vc-checkin].") + "*A string or list of strings specifying extra switches passed +to the checkin program by \\[vc-checkin].") (defvar vc-checkout-switches nil - "*Extra switches passed to the checkout program by \\[vc-checkout].") -(defvar vc-path - (if (file-exists-p "/usr/sccs") - '("/usr/sccs") nil) - "*List of extra directories to search for version control commands.") -(defvar vc-directory-exclusion-list '("SCCS" "RCS") - "*Directory names ignored by functions that recursively walk file trees.") + "*A string or list of strings specifying extra switches passed +to the checkout program by \\[vc-checkout].") +(defvar vc-directory-exclusion-list '("SCCS" "RCS" "CVS") + "*A list of directory names ignored by functions that recursively +walk file trees.") (defconst vc-maximum-comment-ring-size 32 "Maximum number of saved comments in the comment ring.") -;;; XEmacs - This is dumped into loaddefs.el already. -;(defvar diff-switches "-c" -; "*A string or list of strings specifying switches to be passed to diff.") +;;; This is duplicated in diff.el. +;;; XEmacs: remove +;;(defvar diff-switches "-c" +;; "*A string or list of strings specifying switches to be be passed to diff.") + +;;;###autoload +(defvar vc-before-checkin-hook nil + "*Normal hook (list of functions) run before a file gets checked in. +See `run-hooks'.") ;;;###autoload (defvar vc-checkin-hook nil - "*List of functions called after a checkin is done. See `run-hooks'.") - -;;;###autoload -(defvar vc-before-checkin-hook nil - "*List of functions called before a checkin is done. See `run-hooks'.") - -(defvar vc-make-buffer-writable-hook nil - "*List of functions called when a buffer is made writable. See `run-hooks.' -This hook is only used when the version control system is CVS. It -might be useful for sites who uses locking with CVS, or who uses link -farms to gold trees.") + "*Normal hook (List of functions) run after a checkin is done. +See `run-hooks'.") ;; Header-insertion hair (defvar vc-header-alist '((SCCS "\%W\%") (RCS "\$Id\$") (CVS "\$Id\$")) - "*Header keywords to be inserted when `vc-insert-headers' is executed.") + "*Header keywords to be inserted by `vc-insert-headers'. +Must be a list of two-element lists, the first element of each must +be `RCS', `CVS', or `SCCS'. The second element is the string to +be inserted for this particular backend.") (defvar vc-static-header-alist '(("\\.c$" . "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n#endif /* lint */\n")) @@ -151,11 +157,23 @@ is sensitive to blank lines.") ;; Default is to be extra careful for super-user. -(defvar vc-checkout-carefully (= (user-uid) 0) ; #### - this prevents preloading! +(defvar vc-checkout-carefully (= (user-uid) 0) "*Non-nil means be extra-careful in checkout. Verify that the file really is not locked and that its contents match what the master file says.") +(defvar vc-rcs-release nil + "*The release number of your RCS installation, as a string. +If nil, VC itself computes this value when it is first needed.") + +(defvar vc-sccs-release nil + "*The release number of your SCCS installation, as a string. +If nil, VC itself computes this value when it is first needed.") + +(defvar vc-cvs-release nil + "*The release number of your CVS installation, as a string. +If nil, VC itself computes this value when it is first needed.") + ;; Variables the user doesn't need to know about. (defvar vc-log-entry-mode nil) (defvar vc-log-operation nil) @@ -175,15 +193,106 @@ (defvar vc-dired-mode nil) (make-variable-buffer-local 'vc-dired-mode) -(defvar vc-comment-ring nil) +(defvar vc-comment-ring (make-ring vc-maximum-comment-ring-size)) (defvar vc-comment-ring-index nil) (defvar vc-last-comment-match nil) -;; File property caching +;; Back-portability to Emacs 18 + +(defun file-executable-p-18 (f) + (let ((modes (file-modes f))) + (and modes (not (zerop (logand 292)))))) + +(defun file-regular-p-18 (f) + (let ((attributes (file-attributes f))) + (and attributes (not (car attributes))))) + +; Conditionally rebind some things for Emacs 18 compatibility +(if (not (boundp 'minor-mode-map-alist)) + (progn + (setq compilation-old-error-list nil) + (fset 'file-executable-p 'file-executable-p-18) + (fset 'shrink-window-if-larger-than-buffer 'beginning-of-buffer) + )) + +(if (not (fboundp 'file-regular-p)) + (fset 'file-regular-p 'file-regular-p-18)) + +;;; Find and compare backend releases + +(defun vc-backend-release (backend) + ;; Returns which backend release is installed on this system. + (cond + ((eq backend 'RCS) + (or vc-rcs-release + (and (zerop (vc-do-command nil nil "rcs" nil nil "-V")) + (save-excursion + (set-buffer (get-buffer "*vc*")) + (setq vc-rcs-release + (car (vc-parse-buffer + '(("^RCS version \\([0-9.]+ *.*\\)" 1))))))) + (setq vc-rcs-release 'unknown))) + ((eq backend 'CVS) + (or vc-cvs-release + (and (zerop (vc-do-command nil 1 "cvs" nil nil "-v")) + (save-excursion + (set-buffer (get-buffer "*vc*")) + (setq vc-cvs-release + (car (vc-parse-buffer + '(("^Concurrent Versions System (CVS) \\([0-9.]+\\)" + 1))))))) + (setq vc-cvs-release 'unknown))) + ((eq backend 'SCCS) + vc-sccs-release))) -(defun vc-file-clearprops (file) - ;; clear all properties of a given file - (setplist (intern file vc-file-prop-obarray) nil)) +(defun vc-release-greater-or-equal (r1 r2) + ;; Compare release numbers, represented as strings. + ;; Release components are assumed cardinal numbers, not decimal + ;; fractions (5.10 is a higher release than 5.9). Omitted fields + ;; are considered lower (5.6.7 is earlier than 5.6.7.1). + ;; Comparison runs till the end of the string is found, or a + ;; non-numeric component shows up (5.6.7 is earlier than "5.6.7 beta", + ;; which is probably not what you want in some cases). + ;; This code is suitable for existing RCS release numbers. + ;; CVS releases are handled reasonably, too (1.3 < 1.4* < 1.5). + (let (v1 v2 i1 i2) + (catch 'done + (or (and (string-match "^\\.?\\([0-9]+\\)" r1) + (setq i1 (match-end 0)) + (setq v1 (string-to-number (match-string 1 r1))) + (or (and (string-match "^\\.?\\([0-9]+\\)" r2) + (setq i2 (match-end 0)) + (setq v2 (string-to-number (match-string 1 r2))) + (if (> v1 v2) (throw 'done t) + (if (< v1 v2) (throw 'done nil) + (throw 'done + (vc-release-greater-or-equal + (substring r1 i1) + (substring r2 i2))))))) + (throw 'done t))) + (or (and (string-match "^\\.?\\([0-9]+\\)" r2) + (throw 'done nil)) + (throw 'done t))))) + +(defun vc-backend-release-p (backend release) + ;; Return t if we have RELEASE of BACKEND or better + (let (i r (ri 0) (ii 0) is rs (installation (vc-backend-release backend))) + (if (not (eq installation 'unknown)) + (cond + ((or (eq backend 'RCS) (eq backend 'CVS)) + (vc-release-greater-or-equal installation release)))))) + +;;; functions that operate on RCS revision numbers + +(defun vc-trunk-p (rev) + ;; return t if REV is a revision on the trunk + (not (eq nil (string-match "\\`[0-9]+\\.[0-9]+\\'" rev)))) + +(defun vc-branch-part (rev) + ;; return the branch part of a revision number REV + (substring rev 0 (string-match "\\.[0-9]+\\'" rev))) + +;; File property caching (defun vc-clear-context () "Clear all cached file properties and the comment ring." @@ -191,10 +300,63 @@ (fillarray vc-file-prop-obarray nil) ;; Note: there is potential for minor lossage here if there is an open ;; log buffer with a nonzero local value of vc-comment-ring-index. - (setq vc-comment-ring nil)) + (setq vc-comment-ring (make-ring vc-maximum-comment-ring-size))) + +(defun vc-file-clear-masterprops (file) + ;; clear all properties of FILE that were retrieved + ;; from the master file + (vc-file-setprop file 'vc-latest-version nil) + (vc-file-setprop file 'vc-your-latest-version nil) + (vc-backend-dispatch file + (progn ;; SCCS + (vc-file-setprop file 'vc-master-locks nil)) + (progn ;; RCS + (vc-file-setprop file 'vc-default-branch nil) + (vc-file-setprop file 'vc-head-version nil) + (vc-file-setprop file 'vc-master-workfile-version nil) + (vc-file-setprop file 'vc-master-locks nil)) + (progn + (vc-file-setprop file 'vc-cvs-status nil)))) + +(defun vc-head-version (file) + ;; Return the RCS head version of FILE + (cond ((vc-file-getprop file 'vc-head-version)) + (t (vc-fetch-master-properties file) + (vc-file-getprop file 'vc-head-version)))) ;; Random helper functions +(defun vc-latest-on-branch-p (file) + ;; return t iff the current workfile version of FILE is + ;; the latest on its branch. + (vc-backend-dispatch file + ;; SCCS + (string= (vc-workfile-version file) (vc-latest-version file)) + ;; RCS + (let ((workfile-version (vc-workfile-version file)) tip-version) + (if (vc-trunk-p workfile-version) + (progn + ;; Re-fetch the head version number. This is to make + ;; sure that no-one has checked in a new version behind + ;; our back. + (vc-fetch-master-properties file) + (string= (vc-file-getprop file 'vc-head-version) + workfile-version)) + ;; If we are not on the trunk, we need to examine the + ;; whole current branch. (vc-master-workfile-version + ;; is not what we need.) + (save-excursion + (set-buffer (get-buffer-create "*vc-info*")) + (vc-insert-file (vc-name file) "^desc") + (setq tip-version (car (vc-parse-buffer (list (list + (concat "^\\(" (regexp-quote (vc-branch-part workfile-version)) + "\\.[0-9]+\\)\ndate[ \t]+\\([0-9.]+\\);") 1 2))))) + (if (get-buffer "*vc-info*") + (kill-buffer (get-buffer "*vc-info*"))) + (string= tip-version workfile-version)))) + ;; CVS + t)) + (defun vc-registration-error (file) (if file (error "File %s is not under version control" file) @@ -202,44 +364,47 @@ (defvar vc-binary-assoc nil) +;; XEmacs: Function referred to in vc-hooks.el +;;;###autoload (defun vc-find-binary (name) "Look for a command anywhere on the subprocess-command search path." (or (cdr (assoc name vc-binary-assoc)) - ;; XEmacs - use locate-file - (let ((full (locate-file name exec-path nil 1))) - (if full - (setq vc-binary-assoc (cons (cons name full) vc-binary-assoc))) - full))) + (catch 'found + (mapcar + (function + (lambda (s) + (if s + (let ((full (concat s "/" name))) + (if (file-executable-p full) + (progn + (setq vc-binary-assoc + (cons (cons name full) vc-binary-assoc)) + (throw 'found full))))))) + exec-path) + nil))) -(defun vc-do-command (okstatus command file last &rest flags) +(defun vc-do-command (buffer okstatus command file last &rest flags) "Execute a version-control command, notifying user and checking for errors. +Output from COMMAND goes to BUFFER, or *vc* if BUFFER is nil. The command is successful if its exit status does not exceed OKSTATUS. -Output from COMMAND goes to buffer *vc*. The last argument of the command is -the master name of FILE if LAST is 'MASTER, or the workfile of FILE if LAST is -'WORKFILE; this is appended to an optional list of FLAGS." - (setq file (expand-file-name file)) - (let ((camefrom (current-buffer)) - (pwd (file-name-directory (expand-file-name file))) + (If OKSTATUS is nil, that means to ignore errors.) +The last argument of the command is the master name of FILE if LAST is +`MASTER', or the workfile of FILE if LAST is `WORKFILE'; this is appended +to an optional list of FLAGS." + (and file (setq file (expand-file-name file))) + (if (not buffer) (setq buffer "*vc*")) + (if vc-command-messages + (message "Running %s on %s..." command file)) + (let ((obuf (current-buffer)) (camefrom (current-buffer)) (squeezed nil) (vc-file (and file (vc-name file))) + (olddir default-directory) status) -;;; #### - don't know why this code was here...to beautify the echo message? -;;; the version of code below doesn't break default-directory, but it -;;; still might mess up CVS and RCS because they like to operate on -;;; files in the current directory. --Stig -;;; -;;; (if (string-match (concat "^" (regexp-quote pwd)) file) -;;; (setq file (substring file (match-end 0))) -;;; (setq pwd (file-name-directory file))) - (if vc-command-messages - (message "Running %s on %s..." command file)) - (set-buffer (get-buffer-create "*vc*")) - (setq default-directory pwd - file (file-name-nondirectory file)) - + (set-buffer (get-buffer-create buffer)) (set (make-local-variable 'vc-parent-buffer) camefrom) (set (make-local-variable 'vc-parent-buffer-name) (concat " from " (buffer-name camefrom))) + (setq default-directory olddir) (erase-buffer) @@ -249,18 +414,27 @@ (if (and vc-file (eq last 'MASTER)) (setq squeezed (append squeezed (list vc-file)))) (if (eq last 'WORKFILE) - (setq squeezed (append squeezed (list file)))) - (let ((exec-path (if vc-path (append vc-path exec-path) exec-path)) + (progn + (let* ((pwd (expand-file-name default-directory)) + (preflen (length pwd))) + (if (string= (substring file 0 preflen) pwd) + (setq file (substring file preflen)))) + (setq squeezed (append squeezed (list file))))) + (let ((exec-path (append vc-path exec-path)) ;; Add vc-path to PATH for the execution of this command. - (process-environment (copy-sequence process-environment))) - (setenv "PATH" (mapconcat 'identity exec-path ":")) + (process-environment + (cons (concat "PATH=" (getenv "PATH") + path-separator + (mapconcat 'identity vc-path path-separator)) + process-environment)) + (w32-quote-process-args t)) (setq status (apply 'call-process command nil t nil squeezed))) (goto-char (point-max)) - (set-buffer-modified-p nil) ; XEmacs - fsf uses `not-modified' + (set-buffer-modified-p nil) (forward-line -1) - (if (or (not (integerp status)) (< okstatus status)) + (if (or (not (integerp status)) (and okstatus (< okstatus status))) (progn - (pop-to-buffer "*vc*") + (pop-to-buffer buffer) (goto-char (point-min)) (shrink-window-if-larger-than-buffer) (error "Running %s...FAILED (%s)" command @@ -271,13 +445,14 @@ (if vc-command-messages (message "Running %s...OK" command)) ) - (set-buffer camefrom) + (set-buffer obuf) status) ) ;;; Save a bit of the text around POSN in the current buffer, to help ;;; us find the corresponding position again later. This works even ;;; if all markers are destroyed or corrupted. +;;; A lot of this was shamelessly lifted from Sebastian Kremer's rcs.el mode. (defun vc-position-context (posn) (list posn (buffer-size) @@ -304,51 +479,48 @@ ;; to beginning of OSTRING (- (point) (length context-string)))))))) -(defun vc-revert-buffer1 (&optional arg no-confirm) - ;; Most of this was shamelessly lifted from Sebastian Kremer's rcs.el mode. - ;; Revert buffer, try to keep point and mark where user expects them in spite - ;; of changes because of expanded version-control key words. - ;; This is quite important since otherwise typeahead won't work as expected. - (interactive "P") - (widen) +(defun vc-buffer-context () + ;; Return a list '(point-context mark-context reparse); from which + ;; vc-restore-buffer-context can later restore the context. (let ((point-context (vc-position-context (point))) ;; Use mark-marker to avoid confusion in transient-mark-mode. - ;; XEmacs - mark-marker t - (mark-context (if (eq (marker-buffer (mark-marker t)) (current-buffer)) - (vc-position-context (mark-marker t)))) + (mark-context (if (eq (marker-buffer (mark-marker #+xemacs t)) + (current-buffer)) + (vc-position-context (mark-marker #+xemacs t)))) + ;; Make the right thing happen in transient-mark-mode. + (mark-active nil) ;; We may want to reparse the compilation buffer after revert (reparse (and (boundp 'compilation-error-list) ;compile loaded - ;; Construct a list; each elt is nil or a buffer - ;; iff that buffer is a compilation output buffer - ;; that contains markers into the current buffer. - (save-excursion - (mapcar (function - (lambda (buffer) - (set-buffer buffer) - (let ((errors (or - compilation-old-error-list - compilation-error-list)) - (buffer-error-marked-p nil)) - (while (and (consp errors) - (not buffer-error-marked-p)) - (and (markerp (cdr (car errors))) - (eq buffer - (marker-buffer - (cdr (car errors)))) - (setq buffer-error-marked-p t)) - (setq errors (cdr errors))) - (if buffer-error-marked-p buffer)))) - (buffer-list)))))) + (let ((curbuf (current-buffer))) + ;; Construct a list; each elt is nil or a buffer + ;; iff that buffer is a compilation output buffer + ;; that contains markers into the current buffer. + (save-excursion + (mapcar (function + (lambda (buffer) + (set-buffer buffer) + (let ((errors (or + compilation-old-error-list + compilation-error-list)) + (buffer-error-marked-p nil)) + (while (and (consp errors) + (not buffer-error-marked-p)) + (and (markerp (cdr (car errors))) + (eq buffer + (marker-buffer + (cdr (car errors)))) + (setq buffer-error-marked-p t)) + (setq errors (cdr errors))) + (if buffer-error-marked-p buffer)))) + (buffer-list))))))) + (list point-context mark-context reparse))) - ;; The FSF version intentionally runs font-lock here. That - ;; usually just leads to a correctly font-locked buffer being - ;; redone. #### We should detect the cases where the font-locking - ;; may be incorrect (such as on reverts). We know that it is fine - ;; during regular checkin and checkouts. - - ;; the actual revisit - (revert-buffer arg no-confirm) - +(defun vc-restore-buffer-context (context) + ;; Restore point/mark, and reparse any affected compilation buffers. + ;; CONTEXT is that which vc-buffer-context returns. + (let ((point-context (nth 0 context)) + (mark-context (nth 1 context)) + (reparse (nth 2 context))) ;; Reparse affected compilation buffers. (while reparse (if (car reparse) @@ -375,6 +547,17 @@ (let ((new-mark (vc-find-position-by-context mark-context))) (if new-mark (set-mark new-mark)))))) +(defun vc-revert-buffer1 (&optional arg no-confirm) + ;; Revert buffer, try to keep point and mark where user expects them in spite + ;; of changes because of expanded version-control key words. + ;; This is quite important since otherwise typeahead won't work as expected. + (interactive "P") + (widen) + (let ((context (vc-buffer-context))) + ;; t means don't call normal-mode; that's to preserve various minor modes. + (revert-buffer arg no-confirm t) + (vc-restore-buffer-context context))) + (defun vc-buffer-sync (&optional not-urgent) ;; Make sure the current buffer and its working file are in sync @@ -387,132 +570,56 @@ nil (error "Aborted"))))) -;;;###autoload -(defun vc-file-status () - "Display the current status of the file being visited. -Currently, this is only defined for CVS. The information provided in the -modeline is generally sufficient for RCS and SCCS." - ;; by Stig@hackvan.com - (interactive) - (vc-buffer-sync t) - (let ((type (vc-backend-deduce buffer-file-name)) - (file buffer-file-name)) - (cond ((null type) - (if buffer-file-name - (message "`%s' is not registered with a version control system." - buffer-file-name) - (ding) - (message "Buffer `%s' has no associated file." - (buffer-name (current-buffer))))) - ((eq 'CVS type) - (vc-do-command 0 "cvs" file 'WORKFILE "status" "-v") - (set-buffer "*vc*") - (set-buffer-modified-p nil) - ;; reparse the status information, since we have it handy... - (vc-parse-buffer '("Status: \\(.*\\)") file '(vc-cvs-status)) - (goto-char (point-min)) - (shrink-window-if-larger-than-buffer - (display-buffer (current-buffer)))) - ((eq 'CC type) - (vc-do-command 0 "cleartool" file 'WORKFILE "describe") - (set-buffer "*vc*") - (set-buffer-modified-p nil) - (goto-char (point-min)) - (shrink-window-if-larger-than-buffer - (display-buffer (current-buffer)))) - (t - (ding) - (message "Operation not yet defined for RCS or SCCS."))) - )) (defun vc-workfile-unchanged-p (file &optional want-differences-if-changed) ;; Has the given workfile changed since last checkout? - (cond ((and (eq 'CVS (vc-backend-deduce file)) - (not want-differences-if-changed)) - - (let ((status (vc-file-getprop file 'vc-cvs-status))) - ;; #### - should this have some kind of timeout? how often does - ;; this get called? possibly the cached information should be - ;; flushed out of hand. The only concern is the VC menu, which - ;; may indirectly call this function. - (or status ; #### - caching is error-prone - (setq status (car (vc-log-info "cvs" file 'WORKFILE '("status") - '("Status: \\(.*\\)") - '(vc-cvs-status))))) - (string= status "Up-to-date"))) - (t - (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) - (lastmod (nth 5 (file-attributes file))) - unchanged) - (or (equal checkout-time lastmod) - (and (or (not checkout-time) want-differences-if-changed) - (setq unchanged - (zerop (vc-backend-diff file nil nil - (not want-differences-if-changed)))) - ;; 0 stands for an unknown time; it can't match any mod time. - (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0)) - unchanged)))))) + (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) + (lastmod (nth 5 (file-attributes file)))) + (or (equal checkout-time lastmod) + (and (or (not checkout-time) want-differences-if-changed) + (let ((unchanged (zerop (vc-backend-diff file nil nil + (not want-differences-if-changed))))) + ;; 0 stands for an unknown time; it can't match any mod time. + (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0)) + unchanged))))) (defun vc-next-action-on-file (file verbose &optional comment) ;;; If comment is specified, it will be used as an admin or checkin comment. (let ((vc-file (vc-name file)) - (vc-type (vc-backend-deduce file)) - owner version) + (vc-type (vc-backend file)) + owner version buffer) (cond ;; if there is no master file corresponding, create one ((not vc-file) - (vc-register verbose comment)) - - ;; if there is no lock on the file, assert one and get it - ((and (not (eq vc-type 'CVS)) ;There are no locks in CVS. - (not (setq owner (vc-locking-user file)))) - (if (and vc-checkout-carefully - (not (vc-workfile-unchanged-p file t))) - (if (save-window-excursion - (pop-to-buffer "*vc*") - (goto-char (point-min)) - (insert (format "Changes to %s since last lock:\n\n" file)) - (not (beep)) - (yes-or-no-p - "File has unlocked changes, claim lock retaining changes? ")) - (progn (vc-backend-steal file) - (vc-mode-line file)) - (if (not (yes-or-no-p "Revert to checked-in version, instead? ")) - (error "Checkout aborted.") - (vc-revert-buffer1 t t) - (vc-checkout-writable-buffer file)) - ) + (vc-register verbose comment) + (if vc-initial-comment + (setq vc-log-after-operation-hook + 'vc-checkout-writable-buffer-hook) (vc-checkout-writable-buffer file))) - ;; a checked-out version exists, but the user may not own the lock - ((and (not (eq vc-type 'CVS)) ;There are no locks in CVS. - (not (string-equal owner (user-login-name)))) - (if comment - (error "Sorry, you can't steal the lock on %s this way" file)) - (vc-steal-lock - file - (and verbose (read-string "Version to steal: ")) - owner)) - - ;; changes to the master file needs to be merged back into the - ;; working file + ;; CVS: changes to the master file need to be + ;; merged back into the working file ((and (eq vc-type 'CVS) - ;; "0" means "added, but not yet committed" - (not (string= (vc-file-getprop file 'vc-your-latest-version) "0")) - (progn - (vc-fetch-properties file) - (not (string= (vc-file-getprop file 'vc-your-latest-version) - (vc-file-getprop file 'vc-latest-version))))) - (vc-buffer-sync) - (if (yes-or-no-p (format "%s is not up-to-date. Merge in changes now? " - (buffer-name))) + (or (eq (vc-cvs-status file) 'needs-checkout) + (eq (vc-cvs-status file) 'needs-merge))) + (if (or vc-dired-mode + (yes-or-no-p + (format "%s is not up-to-date. Merge in changes now? " + (buffer-name)))) (progn - (if (and (buffer-modified-p) + (if vc-dired-mode + (and (setq buffer (get-file-buffer file)) + (buffer-modified-p buffer) + (switch-to-buffer-other-window buffer) + (vc-buffer-sync t)) + (setq buffer (current-buffer)) + (vc-buffer-sync t)) + (if (and buffer (buffer-modified-p buffer) (not (yes-or-no-p (format "Buffer %s modified; merge file on disc anyhow? " - (buffer-name))))) + (buffer-name buffer))))) (error "Merge aborted")) (if (not (zerop (vc-backend-merge-news file))) ;; Overlaps detected - what now? Should use some @@ -520,65 +627,129 @@ ;; emerge, but for now, simply warn the user with a ;; message. (message "Conflicts detected!")) - (vc-resynch-window file t (not (buffer-modified-p)))) - + (and buffer + (vc-resynch-buffer file t (not (buffer-modified-p buffer))))) (error "%s needs update" (buffer-name)))) - ((and buffer-read-only (eq vc-type 'CVS)) - (toggle-read-only) - ;; Sites who make link farms to a read-only gold tree (or - ;; something similar) can use the hook below to break the - ;; sym-link. - (run-hooks 'vc-make-buffer-writable-hook)) - - ;; OK, user owns the lock on the file (or we are running CVS) - (t - (find-file file) - - ;; give luser a chance to save before checking in. - (vc-buffer-sync) + ;; If there is no lock on the file, assert one and get it. + ;; (With implicit checkout, make sure not to lose unsaved changes.) + ((progn (and (eq (vc-checkout-model file) 'implicit) + (buffer-modified-p buffer) + (vc-buffer-sync)) + (not (setq owner (vc-locking-user file)))) + (if (and vc-checkout-carefully + (not (vc-workfile-unchanged-p file t))) + (if (save-window-excursion + (pop-to-buffer "*vc-diff*") + (goto-char (point-min)) + (insert-string (format "Changes to %s since last lock:\n\n" + file)) + (not (beep)) + (yes-or-no-p + (concat "File has unlocked changes, " + "claim lock retaining changes? "))) + (progn (vc-backend-steal file) + (vc-mode-line file)) + (if (not (yes-or-no-p "Revert to checked-in version, instead? ")) + (error "Checkout aborted") + (vc-revert-buffer1 t t) + (vc-checkout-writable-buffer file)) + ) + (if verbose + (if (not (eq vc-type 'SCCS)) + (vc-checkout file nil + (read-string "Branch or version to move to: ")) + (error "Sorry, this is not implemented for SCCS")) + (if (vc-latest-on-branch-p file) + (vc-checkout-writable-buffer file) + (if (yes-or-no-p + "This is not the latest version. Really lock it? ") + (vc-checkout-writable-buffer file) + (if (yes-or-no-p "Lock the latest version instead? ") + (vc-checkout-writable-buffer file + (if (vc-trunk-p (vc-workfile-version file)) + "" ;; this means check out latest on trunk + (vc-branch-part (vc-workfile-version file))))))) + ))) - ;; Revert if file is unchanged and buffer is too. - ;; If buffer is modified, that means the user just said no - ;; to saving it; in that case, don't revert, - ;; because the user might intend to save - ;; after finishing the log entry. - (if (and (vc-workfile-unchanged-p file) - (not (buffer-modified-p))) - (progn - (if (eq vc-type 'CVS) - (message "No changes to %s" file) + ;; a checked-out version exists, but the user may not own the lock + ((and (not (eq vc-type 'CVS)) + (not (string-equal owner (vc-user-login-name)))) + (if comment + (error "Sorry, you can't steal the lock on %s this way" file)) + (and (eq vc-type 'RCS) + (not (vc-backend-release-p 'RCS "5.6.2")) + (error "File is locked by %s" owner)) + (vc-steal-lock + file + (if verbose (read-string "Version to steal: ") + (vc-workfile-version file)) + owner)) + + ;; OK, user owns the lock on the file + (t + (if vc-dired-mode + (find-file-other-window file) + (find-file file)) - (vc-backend-revert file) - ;; DO NOT revert the file without asking the user! - (vc-resynch-window file t nil))) + ;; give luser a chance to save before checking in. + (vc-buffer-sync) - ;; user may want to set nonstandard parameters - (if verbose - (setq version (read-string "New version level: "))) + ;; Revert if file is unchanged and buffer is too. + ;; If buffer is modified, that means the user just said no + ;; to saving it; in that case, don't revert, + ;; because the user might intend to save + ;; after finishing the log entry. + (if (and (vc-workfile-unchanged-p file) + (not (buffer-modified-p))) + ;; DO NOT revert the file without asking the user! + (cond + ((yes-or-no-p "Revert to master version? ") + (vc-backend-revert file) + (vc-resynch-window file t t))) - ;; OK, let's do the checkin - (vc-checkin file version comment) - ))))) + ;; user may want to set nonstandard parameters + (if verbose + (setq version (read-string "New version level: "))) + + ;; OK, let's do the checkin + (vc-checkin file version comment) + ))))) (defun vc-next-action-dired (file rev comment) - ;; We've accepted a log comment, now do a vc-next-action using it on all - ;; marked files. - (set-buffer vc-parent-buffer) - (dired-map-over-marks - (save-window-excursion - (let ((file (dired-get-filename))) + ;; Do a vc-next-action-on-file on all the marked files, possibly + ;; passing on the log comment we've just entered. + (let ((configuration (current-window-configuration)) + (dired-buffer (current-buffer)) + (dired-dir default-directory)) + (dired-map-over-marks + (let ((file (dired-get-filename)) p + (default-directory default-directory)) (message "Processing %s..." file) + ;; Adjust the default directory so that checkouts + ;; go to the right place. + (setq default-directory (file-name-directory file)) (vc-next-action-on-file file nil comment) - (message "Processing %s...done" file))) - nil t) - ) + (set-buffer dired-buffer) + (setq default-directory dired-dir) + (vc-dired-update-line file) + (set-window-configuration configuration) + (message "Processing %s...done" file)) + nil t))) ;; Here's the major entry point. ;;;###autoload (defun vc-next-action (verbose) "Do the next logical checkin or checkout operation on the current file. + If you call this from within a VC dired buffer with no files marked, +it will operate on the file in the current line. + If you call this from within a VC dired buffer, and one or more +files are marked, it will accept a log message and then operate on +each one. The log message will be used as a comment for any register +or checkin operations, but ignored when doing checkouts. Attempted +lock steals will raise an error. + A prefix argument lets you specify the version number to use. For RCS and SCCS files: If the file is not already registered, this registers it for version @@ -600,37 +771,31 @@ If the file is not already registered, this registers it for version control. This does a \"cvs add\", but no \"cvs commit\". If the file is added but not committed, it is committed. - If the file has not been changed, neither in your working area or -in the repository, a message is printed and nothing is done. If your working file is changed, but the repository file is unchanged, this pops up a buffer for entry of a log message; when the message has been entered, it checks in the resulting changes along with the logmessage as change commentary. A writable file is retained. If the repository file is changed, you are asked if you want to -merge in the changes into your working copy. - -The following is true regardless of which version control system you -are using: +merge in the changes into your working copy." - If you call this from within a VC dired buffer with no files marked, -it will operate on the file in the current line. - If you call this from within a VC dired buffer, and one or more -files are marked, it will accept a log message and then operate on -each one. The log message will be used as a comment for any register -or checkin operations, but ignored when doing checkouts. Attempted -lock steals will raise an error. - - For checkin, a prefix argument lets you specify the version number to use." (interactive "P") (catch 'nogo (if vc-dired-mode (let ((files (dired-get-marked-files))) - (if (= (length files) 1) - (find-file-other-window (car files)) - (vc-start-entry nil nil nil - "Enter a change comment for the marked files." - 'vc-next-action-dired) - (throw 'nogo nil)))) + (if (string= "" + (mapconcat + (function (lambda (f) + (if (eq (vc-backend f) 'CVS) + (if (or (eq (vc-cvs-status f) 'locally-modified) + (eq (vc-cvs-status f) 'locally-added)) + "@" "") + (if (vc-locking-user f) "@" "")))) + files "")) + (vc-next-action-dired nil nil "dummy") + (vc-start-entry nil nil nil + "Enter a change comment for the marked files." + 'vc-next-action-dired)) + (throw 'nogo nil))) (while vc-parent-buffer (pop-to-buffer vc-parent-buffer)) (if buffer-file-name @@ -639,15 +804,17 @@ ;;; These functions help the vc-next-action entry point -(defun vc-checkout-writable-buffer (&optional file) +(defun vc-checkout-writable-buffer (&optional file rev) "Retrieve a writable copy of the latest version of the current buffer's file." - (vc-checkout (or file (buffer-file-name)) t) + (vc-checkout (or file (buffer-file-name)) t rev) ) ;;;###autoload (defun vc-register (&optional override comment) "Register the current file into your version-control system." (interactive "P") + (or buffer-file-name + (error "No visited file")) (let ((master (vc-name buffer-file-name))) (and master (file-exists-p master) (error "This file is already registered")) @@ -661,6 +828,10 @@ (not (file-exists-p buffer-file-name))) (set-buffer-modified-p t)) (vc-buffer-sync) + (cond ((not vc-make-backup-files) + ;; inhibit backup for this buffer + (make-local-variable 'backup-inhibited) + (setq backup-inhibited t))) (vc-admin buffer-file-name (and override @@ -670,7 +841,7 @@ (defun vc-resynch-window (file &optional keep noquery) ;; If the given file is in the current buffer, - ;; either revert on it so we see expanded keyworks, + ;; either revert on it so we see expanded keywords, ;; or unvisit it (depending on vc-keep-workfiles) ;; NOQUERY if non-nil inhibits confirmation for reverting. ;; NOQUERY should be t *only* if it is known the only difference @@ -678,38 +849,47 @@ (and (string= buffer-file-name file) (if keep (progn + ;; temporarily remove vc-find-file-hook, so that + ;; we don't lose the properties + (remove-hook 'find-file-hooks 'vc-find-file-hook) (vc-revert-buffer1 t noquery) + (add-hook 'find-file-hooks 'vc-find-file-hook) (vc-mode-line buffer-file-name)) - (progn - (delete-window) - (kill-buffer (current-buffer)))))) + (kill-buffer (current-buffer))))) -(defun vc-start-entry (file rev comment msg action &optional after-hook before-hook) +(defun vc-resynch-buffer (file &optional keep noquery) + ;; if FILE is currently visited, resynch its buffer + (let ((buffer (get-file-buffer file))) + (if buffer + (save-excursion + (set-buffer buffer) + (vc-resynch-window file keep noquery))))) + +(defun vc-start-entry (file rev comment msg action &optional after-hook) ;; Accept a comment for an operation on FILE revision REV. If COMMENT ;; is nil, pop up a VC-log buffer, emit MSG, and set the ;; action on close to ACTION; otherwise, do action immediately. ;; Remember the file's buffer in vc-parent-buffer (current one if no file). ;; AFTER-HOOK specifies the local value for vc-log-operation-hook. - ;; BEFORE-HOOK specifies a hook to run before even asking for the - ;; checkin comments. (let ((parent (if file (find-file-noselect file) (current-buffer)))) - (when before-hook - (save-excursion - (set-buffer parent) - (run-hooks before-hook))) + (if vc-before-checkin-hook + (if file + (save-excursion + (set-buffer parent) + (run-hooks 'vc-before-checkin-hook)) + (run-hooks 'vc-before-checkin-hook))) (if comment (set-buffer (get-buffer-create "*VC-log*")) (pop-to-buffer (get-buffer-create "*VC-log*"))) (set (make-local-variable 'vc-parent-buffer) parent) (set (make-local-variable 'vc-parent-buffer-name) (concat " from " (buffer-name vc-parent-buffer))) - (vc-mode-line (or file " (no file)")) - (vc-log-mode) + (if file (vc-mode-line file)) + (vc-log-mode file) (make-local-variable 'vc-log-after-operation-hook) (if after-hook (setq vc-log-after-operation-hook after-hook)) (setq vc-log-operation action) - (setq vc-log-file file) (setq vc-log-version rev) (if comment (progn @@ -727,20 +907,18 @@ (vc-start-entry file rev (or comment (not vc-initial-comment)) "Enter initial comment." 'vc-backend-admin - nil 'vc-before-checkin-hook)) + nil)) -(defun vc-checkout (file &optional writable) +;; XEmacs: Function referred to in vc-hooks.el. +;;;###autoload +(defun vc-checkout (file &optional writable rev) "Retrieve a copy of the latest version of the given file." - ;; XEmacs - ftp is suppressed by the check for a filename handler in - ;; vc-registered, so this is needless surplussage ;; If ftp is on this system and the name matches the ange-ftp format ;; for a remote file, the user is trying something that won't work. - ;; (if (and (string-match "^/[^/:]+:" file) (vc-find-binary "ftp")) - ;; (error "Sorry, you can't check out files over FTP")) - (vc-backend-checkout file writable) - (if (string-equal file buffer-file-name) - (vc-resynch-window file t t)) - ) + (if (and (string-match "^/[^/:]+:" file) (vc-find-binary "ftp")) + (error "Sorry, you can't check out files over FTP")) + (vc-backend-checkout file writable rev) + (vc-resynch-buffer file t t)) (defun vc-steal-lock (file rev &optional owner) "Steal the lock on the current workfile." @@ -785,7 +963,7 @@ popped up to accept a comment." (vc-start-entry file rev comment "Enter a change comment." 'vc-backend-checkin - 'vc-checkin-hook 'vc-before-checkin-hook)) + 'vc-checkin-hook)) ;;; Here is a checkin hook that may prove useful to sites using the ;;; ChangeLog facility supported by Emacs. @@ -800,7 +978,7 @@ ;; Make sure the defvar for add-log-current-defun-function has been executed ;; before binding it. (require 'add-log) - (let ( ; Extract the comment first so we get any error before doing anything. + (let (;; Extract the comment first so we get any error before doing anything. (comment (ring-ref vc-comment-ring 0)) ;; Don't let add-change-log-entry insert a defun name. (add-log-current-defun-function 'ignore) @@ -823,8 +1001,8 @@ (indent-to indentation)) (setq end (point)))) ;; Fill the inserted text, preserving open-parens at bol. - (let ((paragraph-separate (concat paragraph-separate "\\|^\\s *\\s(")) - (paragraph-start (concat paragraph-start "\\|^\\s *\\s("))) + (let ((paragraph-separate (concat paragraph-separate "\\|\\s *\\s(")) + (paragraph-start (concat paragraph-start "\\|\\s *\\s("))) (beginning-of-line) (fill-region (point) end)) ;; Canonicalize the white space at the end of the entry so it is @@ -847,8 +1025,6 @@ ;; Comment too long? (vc-backend-logentry-check vc-log-file) ;; Record the comment in the comment ring - (if (null vc-comment-ring) - (setq vc-comment-ring (make-ring vc-maximum-comment-ring-size))) (ring-insert vc-comment-ring (buffer-string)) )) ;; Sync parent buffer in case the user modified it while editing the comment. @@ -857,25 +1033,28 @@ (set-buffer vc-parent-buffer) (or vc-dired-mode (vc-buffer-sync))) - ;; OK, do it to it - (if vc-log-operation - (save-excursion - (funcall vc-log-operation - vc-log-file - vc-log-version - (buffer-string))) - (error "No log operation is pending")) - ;; save the vc-log-after-operation-hook of log buffer - (let ((after-hook vc-log-after-operation-hook)) + (if (not vc-log-operation) (error "No log operation is pending")) + ;; save the parameters held in buffer-local variables + (let ((log-operation vc-log-operation) + (log-file vc-log-file) + (log-version vc-log-version) + (log-entry (buffer-string)) + (after-hook vc-log-after-operation-hook)) ;; Return to "parent" buffer of this checkin and remove checkin window (pop-to-buffer vc-parent-buffer) (let ((logbuf (get-buffer "*VC-log*"))) (delete-windows-on logbuf) (kill-buffer logbuf)) + ;; OK, do it to it + (save-excursion + (funcall log-operation + log-file + log-version + log-entry)) ;; Now make sure we see the expanded headers (if buffer-file-name (vc-resynch-window buffer-file-name vc-keep-workfiles t)) - (run-hooks after-hook))) + (run-hooks after-hook 'vc-finish-logentry-hook))) ;; Code for access to the comment ring @@ -883,7 +1062,7 @@ "Cycle backwards through comment history." (interactive "*p") (let ((len (ring-length vc-comment-ring))) - (cond ((or (not len) (<= len 0)) ; XEmacs change from Barry Warsaw + (cond ((<= len 0) (message "Empty comment ring") (ding)) (t @@ -894,7 +1073,7 @@ (if (null vc-comment-ring-index) (setq vc-comment-ring-index (if (> arg 0) -1 - (if (< arg 0) 1 0)))) + (if (< arg 0) 1 0)))) (setq vc-comment-ring-index (mod (+ vc-comment-ring-index arg) len)) (message "%d" (1+ vc-comment-ring-index)) @@ -914,7 +1093,7 @@ (if (null vc-comment-ring-index) (setq vc-comment-ring-index -1)) (let ((str (regexp-quote str)) - (len (ring-length vc-comment-ring)) + (len (ring-length vc-comment-ring)) (n (1+ vc-comment-ring-index))) (while (and (< n len) (not (string-match str (ring-ref vc-comment-ring n)))) (setq n (+ n 1))) @@ -931,6 +1110,7 @@ (if (null vc-comment-ring-index) (setq vc-comment-ring-index 0)) (let ((str (regexp-quote str)) + (len (ring-length vc-comment-ring)) (n vc-comment-ring-index)) (while (and (>= n 0) (not (string-match str (ring-ref vc-comment-ring n)))) (setq n (- n 1))) @@ -947,11 +1127,11 @@ checked in version of that file. This uses no arguments. With a prefix argument, it reads the file name to use and two version designators specifying which versions to compare." - (interactive "P") + (interactive (list current-prefix-arg t)) (if vc-dired-mode (set-buffer (find-file-noselect (dired-get-filename)))) (while vc-parent-buffer - (pop-to-buffer vc-parent-buffer)) + (pop-to-buffer vc-parent-buffer)) (if historic (call-interactively 'vc-version-diff) (if (or (null buffer-file-name) (null (vc-name buffer-file-name))) @@ -964,7 +1144,7 @@ (vc-buffer-sync not-urgent) (setq unchanged (vc-workfile-unchanged-p buffer-file-name)) (if unchanged - (message "No changes to %s since latest version." file) + (message "No changes to %s since latest version" file) (vc-backend-diff file) ;; Ideally, we'd like at this point to parse the diff so that ;; the buffer effectively goes into compilation mode and we @@ -973,23 +1153,22 @@ ;; problem is that the `old' file doesn't exist to be ;; visited. This plays hell with numerous assumptions in ;; the diff.el and compile.el machinery. - (pop-to-buffer "*vc*") + (set-buffer "*vc-diff*") (setq default-directory (file-name-directory file)) (if (= 0 (buffer-size)) (progn (setq unchanged t) - (message "No changes to %s since latest version." file)) + (message "No changes to %s since latest version" file)) + (pop-to-buffer "*vc-diff*") (goto-char (point-min)) (shrink-window-if-larger-than-buffer))) (not unchanged)))) -;;;###autoload (defun vc-version-diff (file rel1 rel2) "For FILE, report diffs between two stored versions REL1 and REL2 of it. If FILE is a directory, generate diffs between versions for all registered files in or below it." - ;; XEmacs - better prompt - (interactive "FFile or directory to diff: \nsOlder version (default is repository): \nsNewer version (default is workfile): ") + (interactive "FFile or directory to diff: \nsOlder version: \nsNewer version: ") (if (string-equal rel1 "") (setq rel1 nil)) (if (string-equal rel2 "") (setq rel2 nil)) (if (file-directory-p file) @@ -1004,9 +1183,10 @@ " and " (or rel2 "current workfile(s)") ":\n\n") - (set-buffer (get-buffer-create "*vc*")) + (set-buffer (get-buffer-create "*vc-diff*")) (cd file) (vc-file-tree-walk + default-directory (function (lambda (f) (message "Looking at %s" f) (and @@ -1022,7 +1202,7 @@ ) (if (zerop (vc-backend-diff file rel1 rel2)) (message "No changes to %s between %s and %s." file rel1 rel2) - (pop-to-buffer "*vc*")))) + (pop-to-buffer "*vc-diff*")))) ;;;###autoload (defun vc-version-other-window (rev) @@ -1033,15 +1213,15 @@ (if vc-dired-mode (set-buffer (find-file-noselect (dired-get-filename)))) (while vc-parent-buffer - (pop-to-buffer vc-parent-buffer)) + (pop-to-buffer vc-parent-buffer)) (if (and buffer-file-name (vc-name buffer-file-name)) (let* ((version (if (string-equal rev "") (vc-latest-version buffer-file-name) rev)) (filename (concat buffer-file-name ".~" version "~"))) - (or (file-exists-p filename) - (vc-backend-checkout buffer-file-name nil version filename)) - (find-file-other-window filename)) + (or (file-exists-p filename) + (vc-backend-checkout buffer-file-name nil version filename)) + (find-file-other-window filename)) (vc-registration-error buffer-file-name))) ;; Header-insertion code @@ -1055,7 +1235,7 @@ (if vc-dired-mode (find-file-other-window (dired-get-filename))) (while vc-parent-buffer - (pop-to-buffer vc-parent-buffer)) + (pop-to-buffer vc-parent-buffer)) (save-excursion (save-restriction (widen) @@ -1065,44 +1245,57 @@ (let* ((delims (cdr (assq major-mode vc-comment-alist))) (comment-start-vc (or (car delims) comment-start "#")) (comment-end-vc (or (car (cdr delims)) comment-end "")) - (hdstrings (cdr (assoc (vc-backend-deduce buffer-file-name) - vc-header-alist)))) - (mapcar #'(lambda (s) - (insert comment-start-vc "\t" s "\t" - comment-end-vc "\n")) + (hdstrings (cdr (assoc (vc-backend (buffer-file-name)) vc-header-alist)))) + (mapcar (function (lambda (s) + (insert comment-start-vc "\t" s "\t" + comment-end-vc "\n"))) hdstrings) (if vc-static-header-alist - (mapcar #'(lambda (f) - (if (and buffer-file-name - (string-match (car f) buffer-file-name)) - (insert (format (cdr f) (car hdstrings))))) + (mapcar (function (lambda (f) + (if (string-match (car f) buffer-file-name) + (insert (format (cdr f) (car hdstrings)))))) vc-static-header-alist)) ) ))))) -;; The VC directory submode. Coopt Dired for this. +(defun vc-clear-headers () + ;; Clear all version headers in the current buffer, i.e. reset them + ;; to the nonexpanded form. Only implemented for RCS, yet. + ;; Don't lose point and mark during this. + (let ((context (vc-buffer-context))) + (goto-char (point-min)) + (while (re-search-forward "\\$\\([A-Za-z]+\\): [^\\$]+\\$" nil t) + (replace-match "$\\1$")) + (vc-restore-buffer-context context))) + +;; The VC directory major mode. Coopt Dired for this. ;; All VC commands get mapped into logical equivalents. -;; XEmacs -(defvar vc-dired-prefix-map (let ((map (make-sparse-keymap))) - (set-keymap-name map 'vc-dired-prefix-map) - (define-key map "\C-xv" vc-prefix-map) - map)) - -(or (not (boundp 'minor-mode-map-alist)) - (assq 'vc-dired-mode minor-mode-map-alist) - (setq minor-mode-map-alist - (cons (cons 'vc-dired-mode vc-dired-prefix-map) - minor-mode-map-alist))) - -(defun vc-dired-mode () - "The augmented Dired minor mode used in VC directory buffers. +(define-derived-mode vc-dired-mode dired-mode "Dired under VC" + "The major mode used in VC directory buffers. It is derived from Dired. All Dired commands operate normally. Users currently locking listed files are listed in place of the file's owner and group. Keystrokes bound to VC commands will execute as though they had been called on a buffer attached to the file named in the current Dired buffer line." - (setq vc-dired-mode t) - (setq vc-mode " under VC")) + (setq vc-dired-mode t)) + +(define-key vc-dired-mode-map "\C-xv" vc-prefix-map) +(define-key vc-dired-mode-map "g" 'vc-dired-update) +(define-key vc-dired-mode-map "=" 'vc-diff) + +(defun vc-dired-state-info (file) + ;; Return the string that indicates the version control status + ;; on a VC dired line. + (let ((cvs-state (and (eq (vc-backend file) 'CVS) + (vc-cvs-status file)))) + (if cvs-state + (cond ((eq cvs-state 'up-to-date) nil) + ((eq cvs-state 'needs-checkout) "patch") + ((eq cvs-state 'locally-modified) "modified") + ((eq cvs-state 'needs-merge) "merge") + ((eq cvs-state 'unresolved-conflict) "conflict") + ((eq cvs-state 'locally-added) "added")) + (vc-locking-user file)))) (defun vc-dired-reformat-line (x) ;; Hack a directory-listing line, plugging in locking-user info in @@ -1115,101 +1308,165 @@ ;; (insert (concat x "\t"))) ;; ;; This code, like dired, assumes UNIX -l format. - (forward-word 1) ; skip over any extra field due to -ibs options - (cond ((numberp x) ; This hack is used by the CVS code. See vc-locking-user. - (cond - ((re-search-forward "\\([0-9]+ \\)\\([^ ]+\\)\\( .*\\)" nil 0) - (save-excursion - (goto-char (match-beginning 2)) - (insert "(") - (goto-char (1+ (match-end 2))) - (insert ")") - (delete-char (- 17 (- (match-end 2) (match-beginning 2)))) - (insert (substring " " 0 - (- 7 (- (match-end 2) (match-beginning 2))))))))) - (t - (if x (setq x (concat "(" x ")"))) - (if (re-search-forward "\\([0-9]+ \\).................\\( .*\\)" nil 0) - (let ((rep (substring (concat x " ") 0 9))) - (replace-match (concat "\\1" rep "\\2") t))) - ))) + (let ((pos (point)) limit perm owner date-and-file) + (end-of-line) + (setq limit (point)) + (goto-char pos) + (cond + ((or + (re-search-forward ;; owner and group +"\\([drwxlts-]+ \\) *[0-9]+ \\([^ ]+\\) +[^ ]+ +[0-9]+\\( [^ 0-9]+ [0-9 ][0-9] .*\\)" + limit t) + (re-search-forward ;; only owner displayed +"\\([drwxlts-]+ \\) *[0-9]+ \\([^ ]+\\) +[0-9]+\\( [^ 0-9]+ [0-9 ][0-9] .*\\)" + limit t)) + (setq perm (match-string 1) + owner (match-string 2) + date-and-file (match-string 3))) + ((re-search-forward ;; OS/2 -l format, no links, owner, group +"\\([drwxlts-]+ \\) *[0-9]+\\( [^ 0-9]+ [0-9 ][0-9] .*\\)" + limit t) + (setq perm (match-string 1) + date-and-file (match-string 2)))) + (if x (setq x (concat "(" x ")"))) + (let ((rep (substring (concat x " ") 0 10))) + (replace-match (concat perm rep date-and-file))))) + +(defun vc-dired-update-line (file) + ;; Update the vc-dired listing line of file -- it is assumed + ;; that point is already on this line. Don't use dired-do-redisplay + ;; for this, because it cannot handle the way vc-dired deals with + ;; subdirectories. + (beginning-of-line) + (forward-char 2) + (let ((start (point))) + (forward-line 1) + (beginning-of-line) + (delete-region start (point)) + (insert-directory file dired-listing-switches) + (forward-line -1) + (end-of-line) + (delete-char (- (length file))) + (insert (substring file (length (expand-file-name default-directory)))) + (goto-char start)) + (vc-dired-reformat-line (vc-dired-state-info file))) +(defun vc-dired-update (verbose) + (interactive "P") + (vc-directory default-directory verbose)) + +;;; Note in Emacs 18 the following defun gets overridden +;;; with the symbol 'vc-directory-18. See below. ;;;###autoload -(defun vc-directory (dir verbose &optional nested) - "Show version-control status of all files in the directory DIR. -If the second argument VERBOSE is non-nil, show all files; -otherwise show only files that current locked in the version control system. -Interactively, supply a prefix arg to make VERBOSE non-nil. - -If the optional third argument NESTED is non-nil, -scan the entire tree of subdirectories of the current directory." - (interactive "DVC status of directory: \nP") - (let* (nonempty - (dl (+ 1 (length (directory-file-name (expand-file-name dir))))) - (filelist nil) (userlist nil) - dired-buf - (subfunction - (function (lambda (f) - (if (vc-registered f) - (let ((user (vc-locking-user f))) - (and (or verbose user) - (setq filelist (cons (substring f dl) filelist)) - (setq userlist (cons user userlist))))))))) - (let ((default-directory (expand-file-name dir))) - (if nested - (vc-file-tree-walk subfunction) - (vc-dir-all-files subfunction))) - (save-excursion - (dired (cons dir (nreverse filelist)) - dired-listing-switches) - (rename-buffer (generate-new-buffer-name "VC-DIRED")) - (setq dired-buf (current-buffer)) - (setq nonempty (not (zerop (buffer-size))))) +(defun vc-directory (dirname verbose) + "Show version-control status of the current directory and subdirectories. +Normally it creates a Dired buffer that lists only the locked files +in all these directories. With a prefix argument, it lists all files." + (interactive "DDired under VC (directory): \nP") + (require 'dired) + (setq dirname (expand-file-name dirname)) + ;; force a trailing slash + (if (not (eq (elt dirname (1- (length dirname))) ?/)) + (setq dirname (concat dirname "/"))) + (let (nonempty + (dl (if (featurep 'xemacs) + (+ 1 (length (directory-file-name (expand-file-name dir)))) + (length dirname))) + (filelist nil) (statelist nil) + (old-dir default-directory) + dired-buf + dired-buf-mod-count) + (vc-file-tree-walk + dirname + (function + (lambda (f) + (if (vc-registered f) + (let ((state (vc-dired-state-info f))) + (and (or verbose state) + (setq filelist (cons (substring f dl) filelist)) + (setq statelist (cons state statelist)))))))) + (save-window-excursion + (save-excursion + ;; This uses a semi-documented feature of dired; giving a switch + ;; argument forces the buffer to refresh each time. + (setq dired-buf + (dired-internal-noselect + (cons dirname (nreverse filelist)) + dired-listing-switches 'vc-dired-mode)) + (setq nonempty (not (eq 0 (length filelist)))))) + (switch-to-buffer dired-buf) + ;; Make a few modifications to the header + (setq buffer-read-only nil) + (goto-char (point-min)) + (forward-line 1) ;; Skip header line + (let ((start (point))) ;; Erase (but don't remove) the + (end-of-line) ;; "wildcard" line. + (delete-region start (point))) + (beginning-of-line) (if nonempty (progn - (pop-to-buffer dired-buf) - (vc-dired-mode) - (goto-char (point-min)) - (setq buffer-read-only nil) - (forward-line 1) ; Skip header line + ;; Plug the version information into the individual lines (mapcar (function (lambda (x) - (forward-char 2) ; skip dired's mark area - (vc-dired-reformat-line x) - (forward-line 1))) ; go to next line - (nreverse userlist)) - (dired-insert-set-properties (point-min) (point-max)) + (forward-char 2) ;; skip dired's mark area + (vc-dired-reformat-line x) + (forward-line 1))) ;; go to next line + (nreverse statelist)) + (if (featurep 'xemacs) + (dired-insert-set-properties (point-min) (point-max))) (setq buffer-read-only t) (goto-char (point-min)) + (dired-next-line 2) ) + (dired-next-line 1) + (insert " ") + (setq buffer-read-only t) (message "No files are currently %s under %s" - (if verbose "registered" "locked") default-directory)) + (if verbose "registered" "locked") dirname)) )) -(defun make-string-stringlist (stringlist) - "Turn a list of strings into a string of space-delimited elements." - (save-excursion - (let ((tlist stringlist) - (buf (generate-new-buffer "*stringlist*"))) - (set-buffer buf) - (insert (car tlist)) - (setq tlist (cdr tlist)) - (while (not (null tlist)) - (setq s (car tlist)) - (insert s) - (if (cdr tlist) (insert " ")) - (setq tlist (cdr tlist))) - (setq string (buffer-string)) - (kill-this-buffer) - string - ))) +;; Emacs 18 version +(defun vc-directory-18 (verbose) + "Show version-control status of all files under the current directory." + (interactive "P") + (let (nonempty (dir default-directory)) + (save-excursion + (set-buffer (get-buffer-create "*vc-status*")) + (erase-buffer) + (cd dir) + (vc-file-tree-walk + default-directory + (function (lambda (f) + (if (vc-registered f) + (let ((user (vc-locking-user f))) + (if (or user verbose) + (insert (format + "%s %s\n" + (concat user) f)))))))) + (setq nonempty (not (zerop (buffer-size))))) + + (if nonempty + (progn + (pop-to-buffer "*vc-status*" t) + (goto-char (point-min)) + (shrink-window-if-larger-than-buffer))) + (message "No files are currently %s under %s" + (if verbose "registered" "locked") default-directory)) + ) + +(or (boundp 'minor-mode-map-alist) + (fset 'vc-directory 'vc-directory-18)) ;; Named-configuration support for SCCS (defun vc-add-triple (name file rev) (save-excursion - (find-file (concat (vc-backend-subdirectory-name file) "/" vc-name-assoc-file)) + (find-file (expand-file-name + vc-name-assoc-file + (file-name-as-directory + (expand-file-name (vc-backend-subdirectory-name file) + (file-name-directory file))))) (goto-char (point-max)) (insert name "\t:\t" file "\t" rev "\n") (basic-save-buffer) @@ -1218,7 +1475,12 @@ (defun vc-record-rename (file newname) (save-excursion - (find-file (concat (vc-backend-subdirectory-name file) "/" vc-name-assoc-file)) + (find-file + (expand-file-name + vc-name-assoc-file + (file-name-as-directory + (expand-file-name (vc-backend-subdirectory-name file) + (file-name-directory file))))) (goto-char (point-min)) ;; (replace-regexp (concat ":" (regexp-quote file) "$") (concat ":" newname)) (while (re-search-forward (concat ":" (regexp-quote file) "$") nil t) @@ -1235,22 +1497,37 @@ (and (>= firstchar ?0) (<= firstchar ?9))) name) (t - (car (vc-master-info - (concat (vc-backend-subdirectory-name file) "/" vc-name-assoc-file) - (list (concat name "\t:\t" file "\t\\(.+\\)")))) - ))) + (save-excursion + (set-buffer (get-buffer-create "*vc-info*")) + (vc-insert-file + (expand-file-name + vc-name-assoc-file + (file-name-as-directory + (expand-file-name (vc-backend-subdirectory-name file) + (file-name-directory file))))) + (prog1 + (car (vc-parse-buffer + (list (list (concat name "\t:\t" file "\t\\(.+\\)") 1)))) + (kill-buffer "*vc-info*")))) + )) ;; Named-configuration entry points -(defun vc-locked-example () - ;; Return an example of why the current directory is not ready to be snapshot - ;; or nil if no such example exists. - (catch 'vc-locked-example - (vc-file-tree-walk - (function (lambda (f) - (if (and (vc-registered f) (vc-locking-user f)) - (throw 'vc-locked-example f))))) - nil)) +(defun vc-snapshot-precondition () + ;; Scan the tree below the current directory. + ;; If any files are locked, return the name of the first such file. + ;; (This means, neither snapshot creation nor retrieval is allowed.) + ;; If one or more of the files are currently visited, return `visited'. + ;; Otherwise, return nil. + (let ((status nil)) + (catch 'vc-locked-example + (vc-file-tree-walk + default-directory + (function (lambda (f) + (and (vc-registered f) + (if (vc-locking-user f) (throw 'vc-locked-example f) + (if (get-file-buffer f) (setq status 'visited))))))) + status))) ;;;###autoload (defun vc-create-snapshot (name) @@ -1259,10 +1536,11 @@ directory. For each file, the version level of its latest version becomes part of the named configuration." (interactive "sNew snapshot name: ") - (let ((locked (vc-locked-example))) - (if locked - (error "File %s is locked" locked) + (let ((result (vc-snapshot-precondition))) + (if (stringp result) + (error "File %s is locked" result) (vc-file-tree-walk + default-directory (function (lambda (f) (and (vc-name f) (vc-backend-assign-name f name))))) @@ -1275,14 +1553,19 @@ Otherwise, all registered files are checked out (unlocked) at their version levels in the snapshot." (interactive "sSnapshot name to retrieve: ") - (let ((locked (vc-locked-example))) - (if locked - (error "File %s is locked" locked) + (let ((result (vc-snapshot-precondition)) + (update nil)) + (if (stringp result) + (error "File %s is locked" result) + (if (eq result 'visited) + (setq update (yes-or-no-p "Update the affected buffers? "))) (vc-file-tree-walk + default-directory (function (lambda (f) (and (vc-name f) (vc-error-occurred - (vc-backend-checkout f nil name)))))) + (vc-backend-checkout f nil name) + (if update (vc-resynch-buffer f t t))))))) ))) ;; Miscellaneous other entry points @@ -1294,21 +1577,55 @@ (if vc-dired-mode (set-buffer (find-file-noselect (dired-get-filename)))) (while vc-parent-buffer - (pop-to-buffer vc-parent-buffer)) + (pop-to-buffer vc-parent-buffer)) (if (and buffer-file-name (vc-name buffer-file-name)) (let ((file buffer-file-name)) - (vc-backend-print-log file) + (vc-backend-print-log file) (pop-to-buffer (get-buffer-create "*vc*")) (setq default-directory (file-name-directory file)) + (goto-char (point-max)) (forward-line -1) (while (looking-at "=*\n") (delete-char (- (match-end 0) (match-beginning 0))) (forward-line -1)) (goto-char (point-min)) (if (looking-at "[\b\t\n\v\f\r ]+") (delete-char (- (match-end 0) (match-beginning 0)))) - (shrink-window-if-larger-than-buffer) + (shrink-window-if-larger-than-buffer) + ;; move point to the log entry for the current version + (and (not (eq (vc-backend file) 'SCCS)) + (re-search-forward + ;; also match some context, for safety + (concat "----\nrevision " (vc-workfile-version file) + "\\(\tlocked by:.*\n\\|\n\\)date: ") nil t) + ;; set the display window so that + ;; the whole log entry is displayed + (let (start end lines) + (beginning-of-line) (forward-line -1) (setq start (point)) + (if (not (re-search-forward "^----*\nrevision" nil t)) + (setq end (point-max)) + (beginning-of-line) (forward-line -1) (setq end (point))) + (setq lines (count-lines start end)) + (cond + ;; if the global information and this log entry fit + ;; into the window, display from the beginning + ((< (count-lines (point-min) end) (window-height)) + (goto-char (point-min)) + (recenter 0) + (goto-char start)) + ;; if the whole entry fits into the window, + ;; display it centered + ((< (1+ lines) (window-height)) + (goto-char start) + (recenter (1- (- (/ (window-height) 2) (/ lines 2))))) + ;; otherwise (the entry is too large for the window), + ;; display from the start + (t + (goto-char start) + (recenter 0))))) ) - (vc-registration-error buffer-file-name))) + (vc-registration-error buffer-file-name) + ) + ) ;;;###autoload (defun vc-revert-buffer () @@ -1321,20 +1638,28 @@ (if vc-dired-mode (find-file-other-window (dired-get-filename))) (while vc-parent-buffer - (pop-to-buffer vc-parent-buffer)) + (pop-to-buffer vc-parent-buffer)) (let ((file buffer-file-name) + ;; This operation should always ask for confirmation. + (vc-suppress-confirm nil) (obuf (current-buffer)) (changed (vc-diff nil t))) - (if (and changed (or vc-suppress-confirm - (not (yes-or-no-p "Discard changes? ")))) + (if (and changed (not (yes-or-no-p "Discard changes? "))) (progn - (delete-window) + (if (and (window-dedicated-p (selected-window)) + (one-window-p t 'selected-frame)) + (make-frame-invisible (selected-frame)) + (delete-window)) (error "Revert cancelled")) (set-buffer obuf)) (if changed - (delete-window)) + (if (and (window-dedicated-p (selected-window)) + (one-window-p t 'selected-frame)) + (make-frame-invisible (selected-frame)) + (delete-window))) (vc-backend-revert file) (vc-resynch-window file t t) - )) + ) + ) ;;;###autoload (defun vc-cancel-version (norevert) @@ -1345,19 +1670,63 @@ (find-file-other-window (dired-get-filename))) (while vc-parent-buffer (pop-to-buffer vc-parent-buffer)) - (let* ((target (concat (vc-latest-version (buffer-file-name)))) - (yours (concat (vc-your-latest-version (buffer-file-name)))) - (prompt (if (string-equal yours target) - "Remove your version %s from master? " - "Version %s was not your change. Remove it anyway? "))) - (if (null (yes-or-no-p (format prompt target))) + (cond + ((not (vc-registered (buffer-file-name))) + (vc-registration-error (buffer-file-name))) + ((eq (vc-backend (buffer-file-name)) 'CVS) + (error "Unchecking files under CVS is dangerous and not supported in VC")) + ((vc-locking-user (buffer-file-name)) + (error "This version is locked; use vc-revert-buffer to discard changes")) + ((not (vc-latest-on-branch-p (buffer-file-name))) + (error "This is not the latest version--VC cannot cancel it"))) + (let* ((target (vc-workfile-version (buffer-file-name))) + (recent (if (vc-trunk-p target) "" (vc-branch-part target))) + (config (current-window-configuration)) done) + (if (null (yes-or-no-p (format "Remove version %s from master? " target))) nil + (setq norevert (or norevert (not + (yes-or-no-p "Revert buffer to most recent remaining version? ")))) (vc-backend-uncheck (buffer-file-name) target) - (if (or norevert - (not (yes-or-no-p "Revert buffer to most recent remaining version? "))) - (vc-mode-line (buffer-file-name)) - (vc-checkout (buffer-file-name) nil))) - )) + ;; Check out the most recent remaining version. If it fails, because + ;; the whole branch got deleted, do a double-take and check out the + ;; version where the branch started. + (while (not done) + (condition-case err + (progn + (if norevert + ;; Check out locked, but only to disc, and keep + ;; modifications in the buffer. + (vc-backend-checkout (buffer-file-name) t recent) + ;; Check out unlocked, and revert buffer. + (vc-checkout (buffer-file-name) nil recent)) + (setq done t)) + ;; If the checkout fails, vc-do-command signals an error. + ;; We catch this error, check the reason, correct the + ;; version number, and try a second time. + (error (set-buffer "*vc*") + (goto-char (point-min)) + (if (search-forward "no side branches present for" nil t) + (progn (setq recent (vc-branch-part recent)) + ;; vc-do-command popped up a window with + ;; the error message. Get rid of it, by + ;; restoring the old window configuration. + (set-window-configuration config)) + ;; No, it was some other error: re-signal it. + (signal (car err) (cdr err)))))) + ;; If norevert, clear version headers and mark the buffer modified. + (if norevert + (progn + (set-visited-file-name (buffer-file-name)) + (if (not vc-make-backup-files) + ;; inhibit backup for this buffer + (progn (make-local-variable 'backup-inhibited) + (setq backup-inhibited t))) + (if (eq (vc-backend (buffer-file-name)) 'RCS) + (progn (setq buffer-read-only nil) + (vc-clear-headers))) + (vc-mode-line (buffer-file-name)))) + (message "Version %s has been removed from the master" target) + ))) ;;;###autoload (defun vc-rename-file (old new) @@ -1369,10 +1738,8 @@ ;; consider to be wrong. When the famous, long-awaited rename database is ;; implemented things might change for the better. This is unlikely to occur ;; until CVS 2.0 is released. --ceder 1994-01-23 21:27:51 - (if (eq (vc-backend-deduce old) 'CVS) - (error "Renaming files under CVS is dangerous and not supported in VC.")) - (if (eq (vc-backend-deduce old) 'CC) - (error "VC's ClearCase support cannot rename files.")) + (if (eq (vc-backend old) 'CVS) + (error "Renaming files under CVS is dangerous and not supported in VC")) (let ((oldbuf (get-file-buffer old))) (if (and oldbuf (buffer-modified-p oldbuf)) (error "Please save files before moving them")) @@ -1383,20 +1750,20 @@ (let ((oldmaster (vc-name old))) (if oldmaster (progn - (if (vc-locking-user old) + (if (vc-locking-user old) (error "Please check in files before moving them")) (if (or (file-symlink-p oldmaster) ;; This had FILE, I changed it to OLD. -- rms. (file-symlink-p (vc-backend-subdirectory-name old))) - (error "This is not a safe thing to do in the presence of symbolic links")) + (error "This is not a safe thing to do in the presence of symbolic links")) (rename-file - oldmaster - (let ((backend (vc-backend-deduce old)) + oldmaster + (let ((backend (vc-backend old)) (newdir (or (file-name-directory new) "")) (newbase (file-name-nondirectory new))) (catch 'found (mapcar - (function + (function (lambda (s) (if (eq backend (cdr s)) (let* ((newmaster (format (car s) newdir newbase)) @@ -1408,61 +1775,65 @@ (error "New file lacks a version control directory")))))) (if (or (not oldmaster) (file-exists-p old)) (rename-file old new))) - ;; ?? Renaming a file might change its contents due to keyword expansion. - ;; We should really check out a new copy if the old copy was precisely equal - ;; to some checked in version. However, testing for this is tricky.... +; ?? Renaming a file might change its contents due to keyword expansion. +; We should really check out a new copy if the old copy was precisely equal +; to some checked in version. However, testing for this is tricky.... (if oldbuf - (save-excursion + (save-excursion (set-buffer oldbuf) - (set-visited-file-name new) + (let ((buffer-read-only buffer-read-only)) + (set-visited-file-name new)) + (vc-backend new) + (vc-mode-line new) (set-buffer-modified-p nil)))) ;; This had FILE, I changed it to OLD. -- rms. (vc-backend-dispatch old - (vc-record-rename old new) ;SCCS - ;; #### - This CAN kinda be done for both rcs and - ;; cvs. It needs to be implemented. -- Stig - nil ;RCS - nil ;CVS - nil ;CC - ) + (vc-record-rename old new) ;SCCS + nil ;RCS + nil ;CVS + ) ) ;;;###autoload -(defun vc-rename-this-file (new) - (interactive "FVC rename file to: ") - (vc-rename-file buffer-file-name new)) +(defun vc-update-change-log (&rest args) + "Find change log file and add entries from recent RCS/CVS logs. +Normally, find log entries for all registered files in the default +directory using `rcs2log', which finds CVS logs preferentially. +The mark is left at the end of the text prepended to the change log. + +With prefix arg of C-u, only find log entries for the current buffer's file. -;;;###autoload -(defun vc-update-change-log (&rest args) - "Find change log file and add entries from recent RCS logs. -The mark is left at the end of the text prepended to the change log. -With prefix arg of C-u, only find log entries for the current buffer's file. -With any numeric prefix arg, find log entries for all files currently visited. -Otherwise, find log entries for all registered files in the default directory. -From a program, any arguments are passed to the `rcs2log' script." +With any numeric prefix arg, find log entries for all currently visited +files that are under version control. This puts all the entries in the +log for the default directory, which may not be appropriate. + +From a program, any arguments are assumed to be filenames and are +passed to the `rcs2log' script after massaging to be relative to the +default directory." (interactive (cond ((consp current-prefix-arg) ;C-u (list buffer-file-name)) - (current-prefix-arg ;Numeric argument. + (current-prefix-arg ;Numeric argument. (let ((files nil) (buffers (buffer-list)) file) (while buffers (setq file (buffer-file-name (car buffers))) - (and file (vc-backend-deduce file) - (setq files (cons file files))) + (and file (vc-backend file) + (setq files (cons file files))) (setq buffers (cdr buffers))) files)) (t - (let ((RCS (concat default-directory "RCS"))) - (and (file-directory-p RCS) - (mapcar (function - (lambda (f) - (if (string-match "\\(.*\\),v$" f) - (substring f 0 (match-end 1)) - f))) - (directory-files RCS nil "...\\|^[^.]\\|^.[^.]"))))))) - (let ((odefault default-directory)) + ;; `rcs2log' will find the relevant RCS or CVS files + ;; relative to the curent directory if none supplied. + nil))) + (let ((odefault default-directory) + (full-name (or add-log-full-name + (user-full-name) + (user-login-name) + (format "uid%d" (number-to-string (user-uid))))) + (mailing-address (or add-log-mailing-address + user-mail-address))) (find-file-other-window (find-change-log)) (barf-if-buffer-read-only) (vc-buffer-sync) @@ -1471,283 +1842,24 @@ (push-mark) (message "Computing change log entries...") (message "Computing change log entries... %s" - (if (or (null args) - (eq 0 (apply 'call-process "rcs2log" nil t nil - "-n" - (user-login-name) - (user-full-name) - user-mail-address - (mapcar (function - (lambda (f) - (file-relative-name - (if (file-name-absolute-p f) - f - (concat odefault f))))) - args)))) + (if (eq 0 (apply 'call-process "rcs2log" nil '(t nil) nil + "-u" + (concat (vc-user-login-name) + "\t" + full-name + "\t" + mailing-address) + (mapcar (function + (lambda (f) + (file-relative-name + (if (file-name-absolute-p f) + f + (concat odefault f))))) + args))) "done" "failed")))) -;; Functions for querying the master and lock files. - -;; XEmacs - use match-string instead... -;; (defun vc-match-substring (bn) -;; (buffer-substring (match-beginning bn) (match-end bn))) - -(defun vc-parse-buffer (patterns &optional file properties) - ;; Each pattern is of the form: - ;; regex ; subex is 1, and date-subex is 2 (or nil) - ;; (regex subex date-subex) - ;; - ;; Use PATTERNS to parse information out of the current buffer by matching - ;; each REGEX in the list and the returning the string matched by SUBEX. - ;; If a DATE-SUBEX is present, then the SUBEX from the match with the - ;; highest value for DATE-SUBEX (string comparison is used) will be - ;; returned. - ;; - ;; If FILE and PROPERTIES are given, the latter must be a list of - ;; properties of the same length as PATTERNS; each property is assigned - ;; the corresponding value. - ;; - (let (pattern regex subex date-subex latest-date val values date) - (while (setq pattern (car patterns)) - (if (stringp pattern) - (setq regex pattern - subex 1 - date-subex (and (string-match "\\\\(.*\\\\(" regex) 2)) - (setq regex (car pattern) - subex (nth 1 pattern) - date-subex (nth 2 pattern))) - (goto-char (point-min)) - (if date-subex - (progn - (setq latest-date "" val nil) - (while (re-search-forward regex nil t) - (setq date (match-string date-subex)) - (if (string< latest-date date) - (setq latest-date date - val (match-string subex)))) - val) - ;; no date subex, so just take the first match... - (setq val (and (re-search-forward regex nil t) (match-string subex)))) - (if file (vc-file-setprop file (car properties) val)) - (setq values (cons val values) - patterns (cdr patterns) - properties (cdr properties))) - values - )) - -(defun vc-master-info (file fields &optional rfile properties) - ;; Search for information in a master file. - (if (and file (file-exists-p file)) - (save-excursion - (let ((buf)) - (setq buf (create-file-buffer file)) - (set-buffer buf)) - (erase-buffer) - (insert-file-contents file) - (set-buffer-modified-p nil) - (auto-save-mode nil) - (prog1 - (vc-parse-buffer fields rfile properties) - (kill-buffer (current-buffer))) - ) - (if rfile - (mapcar - (function (lambda (p) (vc-file-setprop rfile p nil))) - properties)) - ) - ) - -(defun vc-log-info (command file last flags patterns &optional properties) - ;; Search for information in log program output - (if (and file (file-exists-p file)) - (save-excursion - (set-buffer (get-buffer-create "*vc*")) - (apply 'vc-do-command 0 command file last flags) - (set-buffer-modified-p nil) - (prog1 - (vc-parse-buffer patterns file properties) - (kill-buffer (current-buffer)) - ) - ) - (if file - (mapcar - (function (lambda (p) (vc-file-setprop file p nil))) - properties)) - ) - ) - -(defun vc-locking-user (file) - "Return the name of the person currently holding a lock on FILE. -Return nil if there is no such person. -Under CVS, a file is considered locked if it has been modified since it -was checked out...even though it may well be writable by you." - (setq file (expand-file-name file)) ; use full pathname - (cond ((eq (vc-backend-deduce file) 'CVS) - (if (vc-workfile-unchanged-p file t) - nil - ;; XEmacs - ahead of the pack... - (user-login-name (nth 2 (file-attributes file))))) - (t - ;; #### - this can probably be cleaned up as a result of the changes to - ;; user-login-name... - (if (or (not vc-keep-workfiles) - (eq vc-mistrust-permissions 't) - (and vc-mistrust-permissions - (funcall vc-mistrust-permissions (vc-backend-subdirectory-name - file)))) - (vc-true-locking-user file) - ;; This implementation assumes that any file which is under version - ;; control and has -rw-r--r-- is locked by its owner. This is true - ;; for both RCS and SCCS, which keep unlocked files at -r--r--r--. - ;; We have to be careful not to exclude files with execute bits on; - ;; scripts can be under version control too. Also, we must ignore - ;; the group-read and other-read bits, since paranoid users turn them off. - ;; This hack wins because calls to the very expensive vc-fetch-properties - ;; function only have to be made if (a) the file is locked by someone - ;; other than the current user, or (b) some untoward manipulation - ;; behind vc's back has changed the owner or the `group' or `other' - ;; write bits. - (let ((attributes (file-attributes file))) - (cond ((string-match ".r-..-..-." (nth 8 attributes)) - nil) - ((and (= (nth 2 attributes) (user-uid)) - (string-match ".rw..-..-." (nth 8 attributes))) - (user-login-name)) - (t - (vc-true-locking-user file)))) ; #### - this looks recursive!!! - )))) +;; Collect back-end-dependent stuff here -(defun vc-true-locking-user (file) - ;; The slow but reliable version - (vc-fetch-properties file) - (vc-file-getprop file 'vc-locking-user)) - -(defun vc-latest-version (file) - ;; Return version level of the latest version of FILE - (vc-fetch-properties file) - (vc-file-getprop file 'vc-latest-version)) - -(defun vc-your-latest-version (file) - ;; Return version level of the latest version of FILE checked in by you - (vc-fetch-properties file) - (vc-file-getprop file 'vc-your-latest-version)) - -;; Collect back-end-dependent stuff here -;; -;; Everything eventually funnels through these functions. To implement -;; support for a new version-control system, add another branch to the -;; vc-backend-dispatch macro and fill it in in each call. The variable -;; vc-master-templates in vc-hooks.el will also have to change. - -(put 'vc-backend-dispatch 'lisp-indent-function 'defun) - -(defmacro vc-backend-dispatch (f s r c a) - "Execute FORM1, FORM2 or FORM3 depending whether we're using SCCS, RCS, CVS -or ClearCase. -If FORM3 is RCS, use FORM2 even if we are using CVS. (CVS shares some code -with RCS)." - (list 'let (list (list 'type (list 'vc-backend-deduce f))) - (list 'cond - (list (list 'eq 'type (quote 'SCCS)) s) ; SCCS - (list (list 'eq 'type (quote 'RCS)) r) ; RCS - (list (list 'eq 'type (quote 'CVS)) ; CVS - (if (eq c 'RCS) r c)) - (list (list 'eq 'type (quote 'CC)) a) ; CC - ))) - -(defun vc-lock-file (file) - ;; Generate lock file name corresponding to FILE - (let ((master (vc-name file))) - (and - master - (string-match "\\(.*/\\)s\\.\\(.*\\)" master) - (concat - (substring master (match-beginning 1) (match-end 1)) - "p." - (substring master (match-beginning 2) (match-end 2)))))) - - -(defun vc-fetch-properties (file) - ;; Re-fetch all properties associated with the given file. - ;; Currently these properties are: - ;; vc-locking-user - ;; vc-locked-version - ;; vc-latest-version - ;; vc-your-latest-version - ;; vc-cvs-status (cvs only) - ;; vc-cc-predecessor (ClearCase only) - (vc-backend-dispatch - file - ;; SCCS - (progn - (vc-master-info (vc-lock-file file) - (list - "^[^ ]+ [^ ]+ \\([^ ]+\\)" - "^\\([^ ]+\\)") - file - '(vc-locking-user vc-locked-version)) - (vc-master-info (vc-name file) - (list - "^\001d D \\([^ ]+\\)" - (concat "^\001d D \\([^ ]+\\) .* " - (regexp-quote (user-login-name)) " ") - ) - file - '(vc-latest-version vc-your-latest-version)) - ) - ;; RCS - (vc-log-info "rlog" file 'MASTER nil - (list - "^locks: strict\n\t\\([^:]+\\)" - "^locks: strict\n\t[^:]+: \\(.+\\)" - "^revision[\t ]+\\([0-9.]+\\).*\ndate: \\([ /0-9:]+\\);" - (concat - "^revision[\t ]+\\([0-9.]+\\)\n.*author: " - (regexp-quote (user-login-name)) - ";")) - '(vc-locking-user vc-locked-version - vc-latest-version vc-your-latest-version)) - ;; CVS - ;; Don't fetch vc-locking-user and vc-locked-version here, since they - ;; should always be nil anyhow. Don't fetch vc-your-latest-version, since - ;; that is done in vc-find-cvs-master. - (vc-log-info - "cvs" file 'WORKFILE '("status") - ;; CVS 1.3 says "RCS Version:", other releases "RCS Revision:", - ;; and CVS 1.4a1 says "Repository revision:". The regexp below - ;; matches much more, but because of the way vc-log-info is - ;; implemented it is impossible to use additional groups. - '(("\\(RCS Version\\|RCS Revision\\|Repository revision\\):[\t ]+\\([0-9.]+\\)" 2) - "Status: \\(.*\\)") - '(vc-latest-version - vc-cvs-status)) - ;; CC - (vc-log-info "cleartool" file 'WORKFILE '("describe") - (list - "checked out .* by .* (\\([^ .]+\\)..*@.*)" - "from \\([^ ]+\\) (reserved)" - "version [^\"]*\".*@@\\([^ ]+\\)\"" - "version [^\"]*\".*@@\\([^ ]+\\)\"" - "predecessor version: \\([^ ]+\\)\n") - '(vc-locking-user vc-locked-version - vc-latest-version vc-your-latest-version - vc-cc-predecessor)) - )) - -(defun vc-backend-subdirectory-name (&optional file) - ;; Where the master and lock files for the current directory are kept - (let ((backend - (or - (and file (vc-backend-deduce file)) - vc-default-back-end - (setq vc-default-back-end (if (vc-find-binary "rcs") 'RCS 'SCCS))))) - (cond - ((eq backend 'SCCS) "SCCS") - ((eq backend 'RCS) "RCS") - ((eq backend 'CVS) "CVS") - ((eq backend 'CC) "@@")) - )) - (defun vc-backend-admin (file &optional rev comment) ;; Register a file into the version-control system ;; Automatically retrieves a read-only version of the file with @@ -1757,175 +1869,216 @@ (or vc-default-back-end (setq vc-default-back-end (if (vc-find-binary "rcs") 'RCS 'SCCS))) (message "Registering %s..." file) - (let ((backend - (cond + (let ((switches + (if (stringp vc-register-switches) + (list vc-register-switches) + vc-register-switches)) + (backend + (cond ((file-exists-p (vc-backend-subdirectory-name)) vc-default-back-end) ((file-exists-p "RCS") 'RCS) ((file-exists-p "SCCS") 'SCCS) - ((file-exists-p "CVS") 'CVS) - ((file-exists-p "@@") 'CC) + ((file-exists-p "CVS") 'CVS) (t vc-default-back-end)))) (cond ((eq backend 'SCCS) - (vc-do-command 0 "admin" file 'MASTER ; SCCS - (and rev (concat "-r" rev)) - "-fb" - (concat "-i" file) - (and comment (concat "-y" comment)) - (format - (car (rassq 'SCCS vc-master-templates)) - (or (file-name-directory file) "") - (file-name-nondirectory file))) + (apply 'vc-do-command nil 0 "admin" file 'MASTER ;; SCCS + (and rev (concat "-r" rev)) + "-fb" + (concat "-i" file) + (and comment (concat "-y" comment)) + (format + (car (rassq 'SCCS vc-master-templates)) + (or (file-name-directory file) "") + (file-name-nondirectory file)) + switches) (delete-file file) (if vc-keep-workfiles - (vc-do-command 0 "get" file 'MASTER))) + (vc-do-command nil 0 "get" file 'MASTER))) ((eq backend 'RCS) - (vc-do-command 0 "ci" file 'MASTER ; RCS - (concat (if vc-keep-workfiles "-u" "-r") rev) - (and comment (concat "-t-" comment)) - file)) - ((eq backend 'CVS) - ;; #### - should maybe check to see if the master file is - ;; already in the repository...in which case we need to add the - ;; appropriate branch tag and do an update. - ;; #### - note that adding a file is a 2 step process in CVS... - (vc-do-command 0 "cvs" file 'WORKFILE "add") - (vc-do-command 0 "cvs" file 'WORKFILE "commit" - (and comment (not (string= comment "")) - (concat "-m" comment))) - ) - ((eq backend 'CC) - (vc-do-command 0 "cleartool" file 'WORKFILE ; CC - "mkelem" - (if (string-equal "" comment) - "-nc") - (if (not (string-equal "" comment)) - "-c") - (if (not (string-equal "" comment)) - comment) - ) - (vc-do-command 0 "cleartool" file 'WORKFILE - "checkin" "-identical" "-nc" - ) + (apply 'vc-do-command nil 0 "ci" file 'WORKFILE ;; RCS + ;; if available, use the secure registering option + (and (vc-backend-release-p 'RCS "5.6.4") "-i") + (concat (if vc-keep-workfiles "-u" "-r") rev) + (and comment (concat "-t-" comment)) + switches)) + ((eq backend 'CVS) + (apply 'vc-do-command nil 0 "cvs" file 'WORKFILE ;; CVS + "add" + (and comment (string-match "[^\t\n ]" comment) + (concat "-m" comment)) + switches) ))) (message "Registering %s...done" file) ) (defun vc-backend-checkout (file &optional writable rev workfile) ;; Retrieve a copy of a saved version into a workfile - (let ((filename (or workfile file))) + (let ((filename (or workfile file)) + (file-buffer (get-file-buffer file)) + switches) (message "Checking out %s..." filename) (save-excursion - ;; Change buffers to get local value of vc-checkin-switches. - (set-buffer (or (get-file-buffer file) (current-buffer))) - (vc-backend-dispatch - file - ;; SCCS - (if workfile - ;; Some SCCS implementations allow checking out directly to a - ;; file using the -G option, but then some don't so use the - ;; least common denominator approach and use the -p option - ;; ala RCS. - (let ((vc-modes (logior (file-modes (vc-name file)) - (if writable 128 0))) - (failed t)) - (unwind-protect - (progn - (apply 'vc-do-command - 0 "/bin/sh" file 'MASTER "-c" - ;; Some shells make the "" dummy argument into $0 - ;; while others use the shell's name as $0 and - ;; use the "" as $1. The if-statement - ;; converts the latter case to the former. - (format "if [ x\"$1\" = x ]; then shift; fi; \ - umask %o; exec >\"$1\" || exit; \ - shift; umask %o; exec get \"$@\"" - (logand 511 (lognot vc-modes)) - (logand 511 (lognot (default-file-modes)))) - "" ; dummy argument for shell's $0 - filename - (if writable "-e") - "-p" (and rev - (concat "-r" (vc-lookup-triple file rev))) - vc-checkout-switches) - (setq failed nil)) - (and failed (file-exists-p filename) (delete-file filename)))) - (apply 'vc-do-command 0 "get" file 'MASTER ; SCCS - (if writable "-e") - (and rev (concat "-r" (vc-lookup-triple file rev))) - vc-checkout-switches)) - ;; RCS - (if workfile - ;; RCS doesn't let us check out into arbitrary file names directly. - ;; Use `co -p' and make stdout point to the correct file. - (let ((vc-modes (logior (file-modes (vc-name file)) - (if writable 128 0))) - (failed t)) - (unwind-protect - (progn - (apply 'vc-do-command - 0 "/bin/sh" file 'MASTER "-c" - ;; See the SCCS case, above, regarding the - ;; if-statement. - (format "if [ x\"$1\" = x ]; then shift; fi; \ - umask %o; exec >\"$1\" || exit; \ - shift; umask %o; exec co \"$@\"" - (logand 511 (lognot vc-modes)) - (logand 511 (lognot (default-file-modes)))) - "" ; dummy argument for shell's $0 - filename - (if writable "-l") - (concat "-p" rev) - vc-checkout-switches) - (setq failed nil)) - (and failed (file-exists-p filename) (delete-file filename)))) - (apply 'vc-do-command 0 "co" file 'MASTER - (if writable "-l") - (and rev (concat "-r" rev)) - vc-checkout-switches)) - ;; CVS - (if workfile - ;; CVS is much like RCS - (let ((failed t)) - (unwind-protect - (progn - (apply 'vc-do-command - 0 "/bin/sh" file 'WORKFILE "-c" - "exec >\"$1\" || exit; shift; exec cvs update \"$@\"" - "" ; dummy argument for shell's $0 - workfile - (concat "-r" rev) - "-p" - vc-checkout-switches) - (setq failed nil)) - (and failed (file-exists-p filename) (delete-file filename)))) - (apply 'vc-do-command 0 "cvs" file 'WORKFILE - "update" - (and rev (concat "-r" rev)) - file - vc-checkout-switches)) - ;; CC - (if (or rev workfile) - (error "VC's ClearCase support currently checks out /main/LATEST.") - (apply 'vc-do-command 0 "cleartool" file 'WORKFILE - "checkout" "-nc" - vc-checkout-switches)) - )) - (or workfile - (vc-file-setprop file - 'vc-checkout-time (nth 5 (file-attributes file)))) - (message "Checking out %s...done" filename)) - ) + ;; Change buffers to get local value of vc-checkout-switches. + (if file-buffer (set-buffer file-buffer)) + (setq switches (if (stringp vc-checkout-switches) + (list vc-checkout-switches) + vc-checkout-switches)) + ;; Save this buffer's default-directory + ;; and use save-excursion to make sure it is restored + ;; in the same buffer it was saved in. + (let ((default-directory default-directory)) + (save-excursion + ;; Adjust the default-directory so that the check-out creates + ;; the file in the right place. + (setq default-directory (file-name-directory filename)) + (vc-backend-dispatch file + (progn ;; SCCS + (and rev (string= rev "") (setq rev nil)) + (if workfile + ;; Some SCCS implementations allow checking out directly to a + ;; file using the -G option, but then some don't so use the + ;; least common denominator approach and use the -p option + ;; ala RCS. + (let ((vc-modes (logior (file-modes (vc-name file)) + (if writable 128 0))) + (failed t)) + (unwind-protect + (progn + (apply 'vc-do-command + nil 0 "/bin/sh" file 'MASTER "-c" + ;; Some shells make the "" dummy argument into $0 + ;; while others use the shell's name as $0 and + ;; use the "" as $1. The if-statement + ;; converts the latter case to the former. + (format "if [ x\"$1\" = x ]; then shift; fi; \ + umask %o; exec >\"$1\" || exit; \ + shift; umask %o; exec get \"$@\"" + (logand 511 (lognot vc-modes)) + (logand 511 (lognot (default-file-modes)))) + "" ; dummy argument for shell's $0 + filename + (if writable "-e") + "-p" + (and rev + (concat "-r" (vc-lookup-triple file rev))) + switches) + (setq failed nil)) + (and failed (file-exists-p filename) + (delete-file filename)))) + (apply 'vc-do-command nil 0 "get" file 'MASTER ;; SCCS + (if writable "-e") + (and rev (concat "-r" (vc-lookup-triple file rev))) + switches) + (vc-file-setprop file 'vc-workfile-version nil))) + (if workfile ;; RCS + ;; RCS doesn't let us check out into arbitrary file names directly. + ;; Use `co -p' and make stdout point to the correct file. + (let ((vc-modes (logior (file-modes (vc-name file)) + (if writable 128 0))) + (failed t)) + (unwind-protect + (progn + (apply 'vc-do-command + nil 0 "/bin/sh" file 'MASTER "-c" + ;; See the SCCS case, above, regarding the + ;; if-statement. + (format "if [ x\"$1\" = x ]; then shift; fi; \ + umask %o; exec >\"$1\" || exit; \ + shift; umask %o; exec co \"$@\"" + (logand 511 (lognot vc-modes)) + (logand 511 (lognot (default-file-modes)))) + "" ; dummy argument for shell's $0 + filename + (if writable "-l") + (concat "-p" rev) + switches) + (setq failed nil)) + (and failed (file-exists-p filename) (delete-file filename)))) + (let (new-version) + ;; if we should go to the head of the trunk, + ;; clear the default branch first + (and rev (string= rev "") + (vc-do-command nil 0 "rcs" file 'MASTER "-b")) + ;; now do the checkout + (apply 'vc-do-command + nil 0 "co" file 'MASTER + ;; If locking is not strict, force to overwrite + ;; the writable workfile. + (if (eq (vc-checkout-model file) 'implicit) "-f") + (if writable "-l") + (if rev (concat "-r" rev) + ;; if no explicit revision was specified, + ;; check out that of the working file + (let ((workrev (vc-workfile-version file))) + (if workrev (concat "-r" workrev) + nil))) + switches) + ;; determine the new workfile version + (save-excursion + (set-buffer "*vc*") + (goto-char (point-min)) + (setq new-version + (if (re-search-forward "^revision \\([0-9.]+\\).*\n" nil t) + (buffer-substring (match-beginning 1) (match-end 1))))) + (vc-file-setprop file 'vc-workfile-version new-version) + ;; if necessary, adjust the default branch + (and rev (not (string= rev "")) + (vc-do-command nil 0 "rcs" file 'MASTER + (concat "-b" (if (vc-latest-on-branch-p file) + (if (vc-trunk-p new-version) nil + (vc-branch-part new-version)) + new-version)))))) + (if workfile ;; CVS + ;; CVS is much like RCS + (let ((failed t)) + (unwind-protect + (progn + (apply 'vc-do-command + nil 0 "/bin/sh" file 'WORKFILE "-c" + "exec >\"$1\" || exit; shift; exec cvs update \"$@\"" + "" ; dummy argument for shell's $0 + workfile + (concat "-r" rev) + "-p" + switches) + (setq failed nil)) + (and failed (file-exists-p filename) (delete-file filename)))) + ;; default for verbose checkout: clear the sticky tag + ;; so that the actual update will get the head of the trunk + (and rev (string= rev "") + (vc-do-command nil 0 "cvs" file 'WORKFILE "update" "-A")) + ;; If a revision was specified, check that out. + (if rev + (apply 'vc-do-command nil 0 "cvs" file 'WORKFILE + (and writable (eq (vc-checkout-model file) 'manual) "-w") + "update" + (and rev (not (string= rev "")) + (concat "-r" rev)) + switches) + ;; If no revision was specified, simply make the file writable. + (and writable + (or (eq (vc-checkout-model file) 'manual) + (zerop (logand 128 (file-modes file)))) + (set-file-modes file (logior 128 (file-modes file))))) + (if rev (vc-file-setprop file 'vc-workfile-version nil)))) + (cond + ((not workfile) + (vc-file-clear-masterprops file) + (if writable + (vc-file-setprop file 'vc-locking-user (vc-user-login-name))) + (vc-file-setprop file + 'vc-checkout-time (nth 5 (file-attributes file))))) + (message "Checking out %s...done" filename)))))) (defun vc-backend-logentry-check (file) (vc-backend-dispatch file - (if (>= (buffer-size) 512) ; SCCS - (progn - (goto-char 512) - (error - "Log must be less than 512 characters; point is now at pos 512"))) - nil ; RCS - nil ; CVS - nil) ; CC + (if (>= (buffer-size) 512) ;; SCCS + (progn + (goto-char 512) + (error + "Log must be less than 512 characters; point is now at pos 512"))) + nil ;; RCS + nil) ;; CVS ) (defun vc-backend-checkin (file rev comment) @@ -1933,66 +2086,130 @@ ;; Automatically retrieves a read-only version of the file with ;; keywords expanded if vc-keep-workfiles is non-nil, otherwise ;; it deletes the workfile. + ;; Adaptation for RCS branch support: if this is an explicit checkin, + ;; or if the checkin creates a new branch, set the master file branch + ;; accordingly. (message "Checking in %s..." file) + ;; "This log message intentionally left almost blank". + ;; RCS 5.7 gripes about white-space-only comments too. + (or (and comment (string-match "[^\t\n ]" comment)) + (setq comment "*** empty log message ***")) (save-excursion ;; Change buffers to get local value of vc-checkin-switches. (set-buffer (or (get-file-buffer file) (current-buffer))) - (vc-backend-dispatch file - (progn - (apply 'vc-do-command 0 "delta" file 'MASTER - (if rev (concat "-r" rev)) - (concat "-y" comment) - vc-checkin-switches) - (if vc-keep-workfiles - (vc-do-command 0 "get" file 'MASTER)) - ) - (apply 'vc-do-command 0 "ci" file 'MASTER - (concat (if vc-keep-workfiles "-u" "-r") rev) - (if (not (string-equal "" comment)) - (concat "-m" comment)) - vc-checkin-switches) - (progn - (apply 'vc-do-command 0 "cvs" file 'WORKFILE - "ci" - (if (not (string-equal "" comment)) - (concat "-m" comment)) - vc-checkin-switches) - (vc-file-setprop file 'vc-checkout-time - (nth 5 (file-attributes file)))) - (progn - (apply 'vc-do-command 0 "cleartool" file 'WORKFILE - "checkin" "-identical" - (if (string-equal "" comment) - "-nc") - (if (not (string-equal "" comment)) - "-c") - (if (not (string-equal "" comment)) - comment) - vc-checkin-switches) - (vc-file-setprop file 'vc-checkout-time - (nth 5 (file-attributes file)))) - )) - (vc-file-setprop file 'vc-locking-user nil) - (message "Checking in %s...done" file) - ) + (let ((switches + (if (stringp vc-checkin-switches) + (list vc-checkin-switches) + vc-checkin-switches))) + ;; Clear the master-properties. Do that here, not at the + ;; end, because if the check-in fails we want them to get + ;; re-computed before the next try. + (vc-file-clear-masterprops file) + (vc-backend-dispatch file + ;; SCCS + (progn + (apply 'vc-do-command nil 0 "delta" file 'MASTER + (if rev (concat "-r" rev)) + (concat "-y" comment) + switches) + (vc-file-setprop file 'vc-locking-user 'none) + (vc-file-setprop file 'vc-workfile-version nil) + (if vc-keep-workfiles + (vc-do-command nil 0 "get" file 'MASTER)) + ) + ;; RCS + (let ((old-version (vc-workfile-version file)) new-version) + (apply 'vc-do-command nil 0 "ci" file 'MASTER + ;; if available, use the secure check-in option + (and (vc-backend-release-p 'RCS "5.6.4") "-j") + (concat (if vc-keep-workfiles "-u" "-r") rev) + (concat "-m" comment) + switches) + (vc-file-setprop file 'vc-locking-user 'none) + (vc-file-setprop file 'vc-workfile-version nil) + + ;; determine the new workfile version + (set-buffer "*vc*") + (goto-char (point-min)) + (if (or (re-search-forward + "new revision: \\([0-9.]+\\);" nil t) + (re-search-forward + "reverting to previous revision \\([0-9.]+\\)" nil t)) + (progn (setq new-version (buffer-substring (match-beginning 1) + (match-end 1))) + (vc-file-setprop file 'vc-workfile-version new-version))) + + ;; if we got to a different branch, adjust the default + ;; branch accordingly + (cond + ((and old-version new-version + (not (string= (vc-branch-part old-version) + (vc-branch-part new-version)))) + (vc-do-command nil 0 "rcs" file 'MASTER + (if (vc-trunk-p new-version) "-b" + (concat "-b" (vc-branch-part new-version)))) + ;; If this is an old RCS release, we might have + ;; to remove a remaining lock. + (if (not (vc-backend-release-p 'RCS "5.6.2")) + ;; exit status of 1 is also accepted. + ;; It means that the lock was removed before. + (vc-do-command nil 1 "rcs" file 'MASTER + (concat "-u" old-version)))))) + ;; CVS + (progn + ;; explicit check-in to the trunk requires a + ;; double check-in (first unexplicit) (CVS-1.3) + (condition-case nil + (progn + (if (and rev (vc-trunk-p rev)) + (apply 'vc-do-command nil 0 "cvs" file 'WORKFILE + "ci" "-m" "intermediate" + switches)) + (apply 'vc-do-command nil 0 "cvs" file 'WORKFILE + "ci" (if rev (concat "-r" rev)) + (concat "-m" comment) + switches)) + (error (if (eq (vc-cvs-status file) 'needs-merge) + ;; The CVS output will be on top of this message. + (error "Type C-x 0 C-x C-q to merge in changes") + (error "Check-in failed")))) + ;; determine and store the new workfile version + (set-buffer "*vc*") + (goto-char (point-min)) + (if (re-search-forward + "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" nil t) + (vc-file-setprop file 'vc-workfile-version + (buffer-substring (match-beginning 2) + (match-end 2))) + (vc-file-setprop file 'vc-workfile-version nil)) + ;; if this was an explicit check-in, remove the sticky tag + (if rev + (vc-do-command nil 0 "cvs" file 'WORKFILE "update" "-A")) + (vc-file-setprop file 'vc-locking-user 'none) + (vc-file-setprop file 'vc-checkout-time + (nth 5 (file-attributes file))))))) + (message "Checking in %s...done" file)) (defun vc-backend-revert (file) ;; Revert file to latest checked-in version. + ;; (for RCS, to workfile version) (message "Reverting %s..." file) + (vc-file-clear-masterprops file) (vc-backend-dispatch - file - (progn ; SCCS - (vc-do-command 0 "unget" file 'MASTER nil) - (vc-do-command 0 "get" file 'MASTER nil)) - (vc-do-command 0 "co" file 'MASTER ; RCS. This deletes the work file. - "-f" "-u") - (progn ; CVS - (delete-file file) - (vc-do-command 0 "cvs" file 'WORKFILE "update")) - (vc-do-command 0 "cleartool" file 'WORKFILE ; CC - "unco" "-rm") - ) - (vc-file-setprop file 'vc-locking-user nil) + file + ;; SCCS + (progn + (vc-do-command nil 0 "unget" file 'MASTER nil) + (vc-do-command nil 0 "get" file 'MASTER nil)) + ;; RCS + (vc-do-command nil 0 "co" file 'MASTER + "-f" (concat "-u" (vc-workfile-version file))) + ;; CVS + (progn + (delete-file file) + (vc-do-command nil 0 "cvs" file 'WORKFILE "update"))) + (vc-file-setprop file 'vc-locking-user 'none) + (vc-file-setprop file 'vc-checkout-time (nth 5 (file-attributes file))) (message "Reverting %s...done" file) ) @@ -2000,124 +2217,131 @@ ;; Steal the lock on the current workfile. Needs RCS 5.6.2 or later for -M. (message "Stealing lock on %s..." file) (vc-backend-dispatch file - (progn ; SCCS - (vc-do-command 0 "unget" file 'MASTER "-n" (if rev (concat "-r" rev))) - (vc-do-command 0 "get" file 'MASTER "-g" (if rev (concat "-r" rev))) - ) - (vc-do-command 0 "rcs" file 'MASTER ; RCS - "-M" (concat "-u" rev) (concat "-l" rev)) - (error "You cannot steal a CVS lock; there are no CVS locks to steal.") ; CVS - (error "VC's ClearCase support cannot steal locks.") ; CC - ) - (vc-file-setprop file 'vc-locking-user (user-login-name)) + (progn ;SCCS + (vc-do-command nil 0 "unget" file 'MASTER "-n" (if rev (concat "-r" rev))) + (vc-do-command nil 0 "get" file 'MASTER "-g" (if rev (concat "-r" rev))) + ) + (vc-do-command nil 0 "rcs" file 'MASTER ;RCS + "-M" (concat "-u" rev) (concat "-l" rev)) + (error "You cannot steal a CVS lock; there are no CVS locks to steal") ;CVS + ) + (vc-file-setprop file 'vc-locking-user (vc-user-login-name)) (message "Stealing lock on %s...done" file) ) (defun vc-backend-uncheck (file target) - ;; Undo the latest checkin. Note: this code will have to get a lot - ;; smarter when we support multiple branches. + ;; Undo the latest checkin. (message "Removing last change from %s..." file) (vc-backend-dispatch file - (vc-do-command 0 "rmdel" file 'MASTER (concat "-r" target)) - (vc-do-command 0 "rcs" file 'MASTER (concat "-o" target)) - (error "Unchecking files under CVS is dangerous and not supported in VC.") - (error "VC's ClearCase support cannot cancel checkins.") - ) + (vc-do-command nil 0 "rmdel" file 'MASTER (concat "-r" target)) + (vc-do-command nil 0 "rcs" file 'MASTER (concat "-o" target)) + nil ;; this is never reached under CVS + ) (message "Removing last change from %s...done" file) ) (defun vc-backend-print-log (file) - ;; Print change log associated with FILE to buffer *vc*. + ;; Get change log associated with FILE. (vc-backend-dispatch - file - (vc-do-command 0 "prs" file 'MASTER) - (vc-do-command 0 "rlog" file 'MASTER) - (vc-do-command 0 "cvs" file 'WORKFILE "log") - (vc-do-command 0 "cleartool" file 'WORKFILE "lshistory"))) + file + (vc-do-command nil 0 "prs" file 'MASTER) + (vc-do-command nil 0 "rlog" file 'MASTER) + (vc-do-command nil 0 "cvs" file 'WORKFILE "log"))) (defun vc-backend-assign-name (file name) ;; Assign to a FILE's latest version a given NAME. (vc-backend-dispatch file - (vc-add-triple name file (vc-latest-version file)) ; SCCS - (vc-do-command 0 "rcs" file 'MASTER (concat "-n" name ":")) ; RCS - (vc-do-command 0 "cvs" file 'WORKFILE "tag" name) ; CVS - (vc-do-command 0 "cleartool" file 'WORKFILE ; CC - "mklabel" "-replace" "-nc" name) - ) + (vc-add-triple name file (vc-latest-version file)) ;; SCCS + (vc-do-command nil 0 "rcs" file 'MASTER (concat "-n" name ":")) ;; RCS + (vc-do-command nil 0 "cvs" file 'WORKFILE "tag" name) ;; CVS + ) ) (defun vc-backend-diff (file &optional oldvers newvers cmp) ;; Get a difference report between two versions of FILE. ;; Get only a brief comparison report if CMP, a difference report otherwise. - (let ((backend (vc-backend-deduce file))) + (let ((backend (vc-backend file)) options status + (diff-switches-list (if (listp diff-switches) + diff-switches + (list diff-switches)))) (cond ((eq backend 'SCCS) (setq oldvers (vc-lookup-triple file oldvers)) - (setq newvers (vc-lookup-triple file newvers)))) - (cond - ;; SCCS and RCS shares a lot of code. - ((or (eq backend 'SCCS) (eq backend 'RCS)) - (let* ((command (if (eq backend 'SCCS) - "vcdiff" - "rcsdiff")) - (mode (if (eq backend 'RCS) 'WORKFILE 'MASTER)) - (options (append (list (and cmp "--brief") - "-q" - (and oldvers (concat "-r" oldvers)) - (and newvers (concat "-r" newvers))) - (and (not cmp) - (if (listp diff-switches) - diff-switches - (list diff-switches))))) - (status (apply 'vc-do-command 2 command file mode options))) - ;; Some RCS versions don't understand "--brief"; work around this. - (if (eq status 2) - (apply 'vc-do-command 1 command file 'WORKFILE - (if cmp (cdr options) options)) - status))) + (setq newvers (vc-lookup-triple file newvers)) + (setq options (append (list (and cmp "--brief") "-q" + (and oldvers (concat "-r" oldvers)) + (and newvers (concat "-r" newvers))) + (and (not cmp) diff-switches-list))) + (apply 'vc-do-command "*vc-diff*" 1 "vcdiff" file 'MASTER options)) + ((eq backend 'RCS) + (if (not oldvers) (setq oldvers (vc-workfile-version file))) + ;; If we know that --brief is not supported, don't try it. + (setq cmp (and cmp (not (eq vc-rcsdiff-knows-brief 'no)))) + (setq options (append (list (and cmp "--brief") "-q" + (concat "-r" oldvers) + (and newvers (concat "-r" newvers))) + (and (not cmp) diff-switches-list))) + (setq status (apply 'vc-do-command "*vc-diff*" 2 + "rcsdiff" file 'WORKFILE options)) + ;; If --brief didn't work, do a double-take and remember it + ;; for the future. + (if (eq status 2) + (prog1 + (apply 'vc-do-command "*vc-diff*" 1 "rcsdiff" file 'WORKFILE + (if cmp (cdr options) options)) + (if cmp (setq vc-rcsdiff-knows-brief 'no))) + ;; If --brief DID work, remember that, too. + (and cmp (not vc-rcsdiff-knows-brief) + (setq vc-rcsdiff-knows-brief 'yes)) + status)) ;; CVS is different. - ;; cmp is not yet implemented -- we always do a full diff. ((eq backend 'CVS) - (if (string= (vc-file-getprop file 'vc-your-latest-version) "0") ; CVS + (if (string= (vc-workfile-version file) "0") ;; This file is added but not yet committed; there is no master file. - ;; diff it against /dev/null. (if (or oldvers newvers) - (error "No revisions of %s exists" file) - (apply 'vc-do-command - 1 "diff" file 'WORKFILE "/dev/null" - (if (listp diff-switches) - diff-switches - (list diff-switches)))) + (error "No revisions of %s exist" file) + (if cmp 1 ;; file is added but not committed, + ;; we regard this as "changed". + ;; diff it against /dev/null. + (apply 'vc-do-command + "*vc-diff*" 1 "diff" file 'WORKFILE + (append (if (listp diff-switches) + diff-switches + (list diff-switches)) '("/dev/null"))))) + ;; cmp is not yet implemented -- we always do a full diff. (apply 'vc-do-command - 1 "cvs" file 'WORKFILE "diff" + "*vc-diff*" 1 "cvs" file 'WORKFILE "diff" (and oldvers (concat "-r" oldvers)) (and newvers (concat "-r" newvers)) (if (listp diff-switches) - diff-switches - (list diff-switches))))) - ;; ClearCase is completely different. - ((eq backend 'CC) - (apply 'vc-do-command 2 "cleardiff" file nil - (if cmp "-status_only") - (concat file "@@" - (or oldvers - (vc-file-getprop file 'vc-cc-predecessor))) - (if newvers - (concat file "@@" newvers) - file) - nil)) + diff-switches + (list diff-switches))))) (t (vc-registration-error file))))) (defun vc-backend-merge-news (file) ;; Merge in any new changes made to FILE. - (vc-backend-dispatch - file - (error "vc-backend-merge-news not meaningful for SCCS files") ; SCCS - (error "vc-backend-merge-news not meaningful for RCS files") ; RCS - (vc-do-command 1 "cvs" file 'WORKFILE "update") ; CVS - (error "vc-backend-merge-news not meaningful for ClearCase files") ; CC - )) + (message "Merging changes into %s..." file) + (prog1 + (vc-backend-dispatch + file + (error "vc-backend-merge-news not meaningful for SCCS files") ;SCCS + (error "vc-backend-merge-news not meaningful for RCS files") ;RCS + (save-excursion ; CVS + (vc-file-clear-masterprops file) + (vc-file-setprop file 'vc-workfile-version nil) + (vc-file-setprop file 'vc-locking-user nil) + (vc-do-command nil 0 "cvs" file 'WORKFILE "update") + ;; CVS doesn't return an error code if conflicts are detected. + ;; Since we want to warn the user about it (and possibly start + ;; emerge later), scan the output and see if this occurred. + (set-buffer (get-buffer "*vc*")) + (goto-char (point-min)) + (if (re-search-forward "^cvs update: conflicts found in .*" nil t) + 1 ;; error code for caller + 0 ;; no conflict detected + ))) + (message "Merging changes into %s...done" file))) (defun vc-check-headers () "Check if the current file has any headers in it." @@ -2125,74 +2349,73 @@ (save-excursion (goto-char (point-min)) (vc-backend-dispatch buffer-file-name - (re-search-forward "%[MIRLBSDHTEGUYFPQCZWA]%" nil t) ; SCCS - (re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t) ; RCS - 'RCS ; CVS works like RCS in this regard. - nil ; ClearCase does not recognise headers. - ) + (re-search-forward "%[MIRLBSDHTEGUYFPQCZWA]%" nil t) ;; SCCS + (re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t) ;; RCS + 'RCS ;; CVS works like RCS in this regard. + ) )) ;; Back-end-dependent stuff ends here. ;; Set up key bindings for use while editing log messages -(defun vc-log-mode () +(defun vc-log-mode (&optional file) "Minor mode for driving version-control tools. These bindings are added to the global keymap when you enter this mode: -\\[vc-next-action] perform next logical version-control operation on current file -\\[vc-register] register current file -\\[vc-toggle-read-only] like next-action, but won't register files -\\[vc-insert-headers] insert version-control headers in current file -\\[vc-print-log] display change history of current file -\\[vc-revert-buffer] revert buffer to latest version -\\[vc-cancel-version] undo latest checkin -\\[vc-diff] show diffs between file versions -\\[vc-version-other-window] visit old version in another window -\\[vc-directory] show all files locked by any user in or below . -\\[vc-update-change-log] add change log entry from recent checkins +\\[vc-next-action] perform next logical version-control operation on current file +\\[vc-register] register current file +\\[vc-toggle-read-only] like next-action, but won't register files +\\[vc-insert-headers] insert version-control headers in current file +\\[vc-print-log] display change history of current file +\\[vc-revert-buffer] revert buffer to latest version +\\[vc-cancel-version] undo latest checkin +\\[vc-diff] show diffs between file versions +\\[vc-version-other-window] visit old version in another window +\\[vc-directory] show all files locked by any user in or below . +\\[vc-update-change-log] add change log entry from recent checkins While you are entering a change log message for a version, the following additional bindings will be in effect. -\\[vc-finish-logentry] proceed with check in, ending log message entry +\\[vc-finish-logentry] proceed with check in, ending log message entry Whenever you do a checkin, your log comment is added to a ring of saved comments. These can be recalled as follows: -\\[vc-next-comment] replace region with next message in comment ring -\\[vc-previous-comment] replace region with previous message in comment ring -\\[vc-comment-search-reverse] search backward for regexp in the comment ring -\\[vc-comment-search-forward] search backward for regexp in the comment ring +\\[vc-next-comment] replace region with next message in comment ring +\\[vc-previous-comment] replace region with previous message in comment ring +\\[vc-comment-search-reverse] search backward for regexp in the comment ring +\\[vc-comment-search-forward] search backward for regexp in the comment ring Entry to the change-log submode calls the value of text-mode-hook, then the value of vc-log-mode-hook. Global user options: - vc-initial-comment If non-nil, require user to enter a change - comment upon first checkin of the file. + vc-initial-comment If non-nil, require user to enter a change + comment upon first checkin of the file. - vc-keep-workfiles Non-nil value prevents workfiles from being - deleted when changes are checked in + vc-keep-workfiles Non-nil value prevents workfiles from being + deleted when changes are checked in - vc-suppress-confirm Suppresses some confirmation prompts, - notably for reversions. + vc-suppress-confirm Suppresses some confirmation prompts, + notably for reversions. - vc-header-alist Which keywords to insert when adding headers - with \\[vc-insert-headers]. Defaults to - '(\"\%\W\%\") under SCCS, '(\"\$Id\$\") under - RCS and CVS. + vc-header-alist Which keywords to insert when adding headers + with \\[vc-insert-headers]. Defaults to + '(\"\%\W\%\") under SCCS, '(\"\$Id\$\") under + RCS and CVS. - vc-static-header-alist By default, version headers inserted in C files - get stuffed in a static string area so that - ident(RCS/CVS) or what(SCCS) can see them in - the compiled object code. You can override - this by setting this variable to nil, or change - the header template by changing it. + vc-static-header-alist By default, version headers inserted in C files + get stuffed in a static string area so that + ident(RCS/CVS) or what(SCCS) can see them in + the compiled object code. You can override + this by setting this variable to nil, or change + the header template by changing it. - vc-command-messages if non-nil, display run messages from the - actual version-control utilities (this is - intended primarily for people hacking vc - itself). + vc-command-messages if non-nil, display run messages from the + actual version-control utilities (this is + intended primarily for people hacking vc + itself). " (interactive) (set-syntax-table text-mode-syntax-table) @@ -2201,18 +2424,18 @@ (setq major-mode 'vc-log-mode) (setq mode-name "VC-Log") (make-local-variable 'vc-log-file) + (setq vc-log-file file) (make-local-variable 'vc-log-version) (make-local-variable 'vc-comment-ring-index) (set-buffer-modified-p nil) (setq buffer-file-name nil) (run-hooks 'text-mode-hook 'vc-log-mode-hook) - ) +) ;; Initialization code, to be done just once at load-time (if vc-log-entry-mode nil (setq vc-log-entry-mode (make-sparse-keymap)) - (set-keymap-name vc-log-entry-mode 'vc-log-entry-mode) ; XEmacs (define-key vc-log-entry-mode "\M-n" 'vc-next-comment) (define-key vc-log-entry-mode "\M-p" 'vc-previous-comment) (define-key vc-log-entry-mode "\M-r" 'vc-comment-search-reverse) @@ -2222,16 +2445,16 @@ ;;; These things should probably be generally available -(defun vc-file-tree-walk (func &rest args) - "Walk recursively through default directory. +(defun vc-file-tree-walk (dirname func &rest args) + "Walk recursively through DIRNAME. Invoke FUNC f ARGS on each non-directory file f underneath it." - (vc-file-tree-walk-internal default-directory func args) - (message "Traversing directory %s...done" default-directory)) + (vc-file-tree-walk-internal (expand-file-name dirname) func args) + (message "Traversing directory %s...done" dirname)) (defun vc-file-tree-walk-internal (file func args) (if (not (file-directory-p file)) (apply func file args) - (message "Traversing directory %s..." file) + (message "Traversing directory %s..." (abbreviate-file-name file)) (let ((dir (file-name-as-directory file))) (mapcar (function @@ -2240,27 +2463,19 @@ (string-equal f "..") (member f vc-directory-exclusion-list) (let ((dirf (concat dir f))) - (or - (file-symlink-p dirf) ; Avoid possible loops - (vc-file-tree-walk-internal dirf func args)))))) + (or + (file-symlink-p dirf) ;; Avoid possible loops + (vc-file-tree-walk-internal dirf func args)))))) (directory-files dir))))) -(defun vc-dir-all-files (func &rest args) - "Invoke FUNC f ARGS on each regular file f in default directory." - (let ((dir default-directory)) - (message "Scanning directory %s..." dir) - (mapcar (function (lambda (f) - (let ((dirf (expand-file-name f dir))) - (if (not (file-directory-p dirf)) - (apply func dirf args))))) - (directory-files dir)) - (message "Scanning directory %s...done" dir))) - (provide 'vc) ;;; DEVELOPER'S NOTES ON CONCURRENCY PROBLEMS IN THIS CODE ;;; ;;; These may be useful to anyone who has to debug or extend the package. +;;; (Note that this information corresponds to versions 5.x. Some of it +;;; might have been invalidated by the additions to support branching +;;; and RCS keyword lookup. AS, 1995/03/24) ;;; ;;; A fundamental problem in VC is that there are time windows between ;;; vc-next-action's computations of the file's version-control state and @@ -2283,7 +2498,7 @@ ;;; during the entire execution of vc-next-action, or (b) detect and ;;; recover from errors resulting from dispatch on an out-of-date state. ;;; -;;; Alternative (a) appears to be unfeasible. The problem is that we can't +;;; Alternative (a) appears to be infeasible. The problem is that we can't ;;; guarantee that the lock will ever be removed. Suppose a user starts a ;;; checkin, the change message buffer pops up, and the user, having wandered ;;; off to do something else, simply forgets about it? @@ -2324,7 +2539,7 @@ ;;; B 5 . 6 7 8 co -l get -e checkout ;;; C 9 10 . 11 12 co -u unget; get revert ;;; D 13 14 15 . 16 ci -u -m<comment> delta -y<comment>; get checkin -;;; E 17 18 19 20 . rcs -u -M ; rcs -l unget -n ; get -g steal lock +;;; E 17 18 19 20 . rcs -u -M -l unget -n ; get -g steal lock ;;; ;;; All commands take the master file name as a last argument (not shown). ;;; @@ -2382,7 +2597,9 @@ ;;; Potential cause: someone else's admin during window P, with ;;; caller's admin happening before their checkout. ;;; -;;; RCS: ci will fail with a "no lock set by <user>" message. +;;; RCS: Prior to version 5.6.4, ci fails with message +;;; "no lock set by <user>". From 5.6.4 onwards, VC uses the new +;;; ci -i option and the message is "<file>,v: already exists". ;;; SCCS: admin will fail with error (ad19). ;;; ;;; We can let these errors be passed up to the user. @@ -2391,7 +2608,9 @@ ;;; ;;; Potential cause: self-race during window P. ;;; -;;; RCS: will revert the file to the last saved version and unlock it. +;;; RCS: Prior to version 5.6.4, reverts the file to the last saved +;;; version and unlocks it. From 5.6.4 onwards, VC uses the new +;;; ci -i option, failing with message "<file>,v: already exists". ;;; SCCS: will fail with error (ad19). ;;; ;;; Either of these consequences is acceptable. @@ -2400,8 +2619,10 @@ ;;; ;;; Potential cause: self-race during window P. ;;; -;;; RCS: will register the caller's workfile as a delta with a -;;; null change comment (the -t- switch will be ignored). +;;; RCS: Prior to version 5.6.4, VC registers the caller's workfile as +;;; a delta with a null change comment (the -t- switch will be +;;; ignored). From 5.6.4 onwards, VC uses the new ci -i option, +;;; failing with message "<file>,v: already exists". ;;; SCCS: will fail with error (ad19). ;;; ;;; 4. File looked unregistered but is locked by someone else. @@ -2409,7 +2630,10 @@ ;;; Potential cause: someone else's admin during window P, with ;;; caller's admin happening *after* their checkout. ;;; -;;; RCS: will fail with a "no lock set by <user>" message. +;;; RCS: Prior to version 5.6.4, ci fails with a +;;; "no lock set by <user>" message. From 5.6.4 onwards, +;;; VC uses the new ci -i option, failing with message +;;; "<file>,v: already exists". ;;; SCCS: will fail with error (ad19). ;;; ;;; We can let these errors be passed up to the user. @@ -2497,11 +2721,13 @@ ;;; ;;; Potential cause: master file got nuked during window P. ;;; -;;; RCS: Checks in the user's version as an initial delta. +;;; RCS: Prior to version 5.6.4, checks in the user's version as an +;;; initial delta. From 5.6.4 onwards, VC uses the new ci -j +;;; option, failing with message "no such file or directory". ;;; SCCS: will fail with error ut4. ;;; -;;; This case is kind of nasty. It means VC may fail to detect the -;;; loss of previous version information. +;;; This case is kind of nasty. Under RCS prior to version 5.6.4, +;;; VC may fail to detect the loss of previous version information. ;;; ;;; 14. File looks like it's locked by the calling user and changed, but it's ;;; actually unlocked. @@ -2568,7 +2794,7 @@ ;;; ;;; In order of decreasing severity: ;;; -;;; Cases 11 and 15 under RCS are the only one that potentially lose work. +;;; Cases 11 and 15 are the only ones that potentially lose work. ;;; They would require a self-race for this to happen. ;;; ;;; Case 13 in RCS loses information about previous deltas, retaining
--- a/lisp/prim/about.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/prim/about.el Mon Aug 13 09:37:19 2007 +0200 @@ -105,23 +105,25 @@ (about-xref "collaboration" 'history "An XEmacs History Lesson") (insert "\n\tof Lucid, Inc. with Sun Microsystems, Inc. and the University of Illinois with additional support having been provided by - Amdahl Corporation and INS Engineering Corporation.\n\n\t") + Amdahl Corporation, INS Engineering Corporation, and a huge amount of + volunteer effort.\n\n\t") - (insert "In almost all circumstances, Emacs-Lisp code written for + (insert "In most circumstances, Emacs-Lisp code written for GNU Emacs versions 18 and 19 will run under XEmacs without requiring any modifications, or at most will require small - changes to accommodate an improved functional interface.\n\n\t") + changes to accommodate a different and usually improved + functional interface.\n\n\t") (insert "XEmacs provides a great number of ") (about-xref "new features" 'features "See a list of the new features.") - (insert ". More details - on XEmacs's functionality, including bundled packages can be - obtained through the ") + (insert " not found in GNU Emacs. + More details on XEmacs's functionality, including bundled packages, + can be obtained through the ") (about-xref "`info`" 'info "Look at the info pages") (insert " on-line information system. - The WWW page for XEmacs can be browsed, using any WWW browser, at\n\t\t") + The Web page for XEmacs can be browsed, using any Web browser, at\n\t\t") (about-xref "http://www.xemacs.org/" 'w3-xemacs "Go to the XEmacs World Wide Web page") (insert "\n\n\tNote that w3 (XEmacs's own browser), might need customization (due to firewalls) in order to work correctly.\n\n\t") @@ -130,21 +132,36 @@ The developers responsible for the " emacs-short-version " release are: * ") (about-xref "Steve Baur" 'steve "Find out more about Steve Baur") (insert " <steve@altair.xemacs.org> - * ") (about-xref "Martin Buchholz" 'mrb "Find out more about Martin Buchholz") (insert " <mrb@eng.sun.com> + * ") (about-xref "Martin Buchholz" 'mrb "Find out more about Martin Buchholz") (insert " <mrb@xemacs.org> + * ") (about-xref "Hrvoje Niksic" 'hrvoje "Find out more about Hrvoje Niksic") (insert " <hrvoje@srce.hr> * ") (about-xref "Chuck Thompson" 'cthomp "Find out more about Chuck Thompson") (insert " <cthomp@xemacs.org> * ") (about-xref "Ben Wing" 'wing "Find out more about Ben Wing") (insert " <wing@xemacs.org> * ") (about-xref "And many other contributors..." 'others "Read about the legion of XEmacs hackers") (insert " - Chuck Thompson was Mr. XEmacs from 19.11 through 19.14. Ben Wing - was crucial to each of those releases. + Chuck Thompson and Ben Wing were co-maintainers of XEmacs from 19.11 through 19.14. + Chuck Thompson was responsible for putting out the releases, + rewriting the redisplay engine and acting as keeper of the source code base. + Ben Wing did most of the rest of the coding, including adding the Mule support + and rewriting much of the internal C code. 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. + the last release actually named Lucid Emacs. + + 19.8 contained a great number of significant changes. + These included a new lisp object system, rewritten minibuffer + and command loop code, and a great deal of code merging with the + newly released GNU Emacs 19 (all done by Richard Mlynarik); + and also the replacement of the previous redisplay mechanism with + the more powerful Epoch redisplay mechanism (done by Chuck Thompson). + + 19.9 contained two significant feature additions from Chuck Thompson: + scrollbars and configure support, and one from Ben Wing, the external widget support. + + 19.10 contained a number of contributions from Chuck Thompson and Ben Wing. * ") (about-xref "Jamie Zawinski" 'jwz "Find out more about Jamie Zawinski") (insert " <jwz@netscape.com> - * ") (about-xref "Richard Mlynarik" 'mly "Find out more about Richard Mlynarik") (insert " <mly@adoc.xerox.com>") + * ") (about-xref "Richard Mlynarik" 'mly "Find out more about Richard Mlynarik") (insert " <mly@adoc.xerox.com>") (insert "\n\n\tClick ") (about-xref "here" 'kill-buffer "Exit the About page") (insert " to remove (kill) this buffer.") @@ -298,6 +315,7 @@ ('stig "About Jonathan Stigelman") ('steve "About Steve Baur") ('mrb "About Martin Buchholz") + ('hrvoje "About Hrvoje Niksic") ('kyle "About Kyle Jones") ('larsi "About Lars Magne Ingebrigtsen") ('jens "About Jens Lautenbacher") @@ -579,6 +597,22 @@ (about-xref "here" prev-page "Return to previous page") (insert " to go back to the previous page.\n") ) + ((eq xref 'hrvoje) + (about-face "Hrvoje Niksic" 'bold) + (insert " <hniksic@srce.hr> + + Hrvoje is currently a student at the Faculty of Electrical + Engineering and Computing in Zagreb, Croatia. He works part- + time at SRCE, where he helps run the network machines. + In his free time he is helping develop free software (especially + XEmacs, as well as GNU software) and is writing his own -- he has + written a small network mirroring utility Wget, see + \"ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/\".") + + (insert "\n\n\tClick ") + (about-xref "here" prev-page "Return to previous page") + (insert " to go back to the previous page.\n") + ) ((eq xref 'cthomp) (about-face "Chuck Thompson" 'bold) (insert " <cthomp@xemacs.org> @@ -1098,15 +1132,6 @@ Author of the code used to connect XEmacs with ToolTalk, and of an early client of the external Emacs widget. - Hrvoje Niksic <hniksic@srce.hr> - Hrvoje is currently a student at the Faculty of Electrical - Engineering and Computing in Zagreb, Croatia. He works part- - time at SRCE, where he helps run the network machines. - In his free time he is helping develop free software (especially - XEmacs, as well as GNU software) and is writing his own -- he has - written a small network mirroring utility Wget, see - \"ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/\". - In addition to those just mentioned, the following people have spent a great deal of effort providing feedback, testing beta versions of XEmacs, providing patches to the source code, or
--- a/lisp/prim/auto-autoloads.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/prim/auto-autoloads.el Mon Aug 13 09:37:19 2007 +0200 @@ -1565,6 +1565,89 @@ ;;;*** +;;;### (autoloads (term make-term) "term" "eterm/term.el") + +(autoload 'make-term "term" "\ +Make a term process NAME in a buffer, running PROGRAM. +The name of the buffer is made by surrounding NAME with `*'s. +If there is already a running process in that buffer, it is not restarted. +Optional third arg STARTFILE is the name of a file to send the contents of to +the process. Any more args are arguments to PROGRAM." nil nil) + +(autoload 'term "term" "\ +Start a terminal-emulator in a new buffer." t nil) + +;;;*** + +;;;### (autoloads (tperldb txdb tdbx tsdb tgdb) "tgud" "eterm/tgud.el") + +(autoload 'tgdb "tgud" "\ +Run gdb on program FILE in buffer *tgud-FILE*. +The directory containing FILE becomes the initial working directory +and source-file directory for your debugger." t nil) + +(autoload 'tsdb "tgud" "\ +Run sdb on program FILE in buffer *tgud-FILE*. +The directory containing FILE becomes the initial working directory +and source-file directory for your debugger." t nil) + +(autoload 'tdbx "tgud" "\ +Run dbx on program FILE in buffer *tgud-FILE*. +The directory containing FILE becomes the initial working directory +and source-file directory for your debugger." t nil) + +(autoload 'txdb "tgud" "\ +Run xdb on program FILE in buffer *tgud-FILE*. +The directory containing FILE becomes the initial working directory +and source-file directory for your debugger. + +You can set the variable 'tgud-xdb-directories' to a list of program source +directories if your program contains sources from more than one directory." t nil) + +(autoload 'tperldb "tgud" "\ +Run perldb on program FILE in buffer *tgud-FILE*. +The directory containing FILE becomes the initial working directory +and source-file directory for your debugger." t nil) + +;;;*** + +;;;### (autoloads (tshell) "tshell" "eterm/tshell.el") + +(defvar tshell-prompt-pattern "^[^#$%>\n]*[#$%>] *" "\ +Regexp to match prompts in the inferior shell. +Defaults to \"^[^#$%>\\n]*[#$%>] *\", which works pretty well. +This variable is used to initialise `term-prompt-regexp' in the +shell buffer. + +The pattern should probably not match more than one line. If it does, +tshell-mode may become confused trying to distinguish prompt from input +on lines which don't start with a prompt. + +This is a fine thing to set in your `.emacs' file.") + +(autoload 'tshell "tshell" "\ +Run an inferior shell, with I/O through buffer *shell*. +If buffer exists but shell process is not running, make new shell. +If buffer exists and shell process is running, just switch to buffer `*shell*'. +Program used comes from variable `explicit-shell-file-name', + or (if that is nil) from the ESHELL environment variable, + or else from SHELL if there is no ESHELL. +If a file `~/.emacs_SHELLNAME' exists, it is given as initial input + (Note that this may lose due to a timing error if the shell + discards input when it starts up.) +The buffer is put in Tshell mode, giving commands for sending input +and controlling the subjobs of the shell. See `tshell-mode'. +See also the variable `tshell-prompt-pattern'. + +The shell file name (sans directories) is used to make a symbol name +such as `explicit-csh-args'. If that symbol is a variable, +its value is used as a list of arguments when invoking the shell. +Otherwise, one argument `-i' is passed to the shell. + +\(Type \\[describe-mode] in the shell buffer for a list of commands.)" t nil) + +;;;*** + ;;;### (autoloads (blackbox) "blackbox" "games/blackbox.el") (autoload 'blackbox "blackbox" "\ @@ -3689,7 +3772,7 @@ ;;;### (autoloads (ksh-mode) "ksh-mode" "modes/ksh-mode.el") (autoload 'ksh-mode "ksh-mode" "\ -ksh-mode $Revision: 1.28 $ - Major mode for editing (Bourne, Korn or Bourne again) +ksh-mode $Revision: 1.29 $ - Major mode for editing (Bourne, Korn or Bourne again) shell scripts. Special key bindings and commands: \\{ksh-mode-map} @@ -4622,6 +4705,19 @@ ;;;*** +;;;### (autoloads (strokes-mode) "strokes" "modes/strokes.el") + +(defvar strokes-enabled-p nil "\ +Variable determining whether `strokes' is globally enabled") + +(autoload 'strokes-mode "strokes" "\ +Toggle strokes being enabled. +With ARG, turn strokes on if and only if ARG is positive or true. +Note that `strokes-mode' is a global mode. Think of it as a minor +mode in all buffers when activated." t nil) + +;;;*** + ;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl" "modes/tcl.el") (autoload 'tcl-mode "tcl" "\ @@ -5040,7 +5136,7 @@ (autoload 'vhdl-mode "vhdl-mode" "\ Major mode for editing VHDL code. -vhdl-mode $Revision: 1.28 $ +vhdl-mode $Revision: 1.29 $ To submit a problem report, enter `\\[vhdl-submit-bug-report]' from a vhdl-mode buffer. This automatically sets up a mail buffer with version information already added. You just need to add a description of the @@ -5341,7 +5437,8 @@ Second arg is file name of change log. If nil, uses `change-log-default-name'. Third arg OTHER-WINDOW non-nil means visit in other window. Fourth arg NEW-ENTRY non-nil means always create a new entry at the front; -never append to an existing entry." t nil) +never append to an existing entry. Today's date is calculated according to +`change-log-time-zone-rule' if non-nil, otherwise in local time." t nil) (autoload 'add-change-log-entry-other-window "add-log" "\ Find change log file in other window and add an entry for today. @@ -5357,6 +5454,15 @@ Each entry behaves as a paragraph, and the entries for one day as a page. Runs `change-log-mode-hook'." t nil) +(defvar add-log-lisp-like-modes '(emacs-lisp-mode lisp-mode scheme-mode lisp-interaction-mode) "\ +*Modes that look like Lisp to `add-log-current-defun'.") + +(defvar add-log-c-like-modes '(c-mode c++-mode c++-c-mode objc-mode) "\ +*Modes that look like C to `add-log-current-defun'.") + +(defvar add-log-tex-like-modes '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) "\ +*Modes that look like TeX to `add-log-current-defun'.") + (autoload 'add-log-current-defun "add-log" "\ Return name of function definition point is in, or nil. @@ -6386,10 +6492,13 @@ ;;;*** -;;;### (autoloads (gnuserv-edit gnuserv-start) "gnuserv" "packages/gnuserv.el") +;;;### (autoloads (gnuserv-start gnuserv-running-p) "gnuserv" "packages/gnuserv.el") (defcustom gnuserv-frame nil "*The frame to be used to display all edited files.\nIf nil, then a new frame is created for each file edited.\nIf t, then the currently selected frame will be used.\nIf a function, then this will be called with a symbol `x' or `tty' as the\nonly argument, and its return value will be interpreted as above." :tag "Gnuserv Frame" :type '(radio (const :tag "Create new frame each time" nil) (const :tag "Use selected frame" t) (function-item :tag "Use main Emacs frame" gnuserv-main-frame-function) (function-item :tag "Use visible frame, otherwise create new" gnuserv-visible-frame-function) (function-item :tag "Create special Gnuserv frame and use it" gnuserv-special-frame-function) (function :tag "Other")) :group 'gnuserv) +(autoload 'gnuserv-running-p "gnuserv" "\ +Return non-nil if a gnuserv process is running from this XEmacs session." nil nil) + (autoload 'gnuserv-start "gnuserv" "\ Allow this Emacs process to be a server for client processes. This starts a gnuserv communications subprocess through which @@ -6398,23 +6507,6 @@ Prefix arg means just kill any existing server communications subprocess." t nil) -(autoload 'gnuserv-edit "gnuserv" "\ -Mark the current gnuserv editing buffer as \"done\", and switch to next one. - -The `gnuserv-done-function' is used to dispose of the buffer after marking it -as done; it is `kill-buffer' by default. - -Files that match `gnuserv-temp-file-regexp' are considered temporary and -are saved unconditionally and backed up if `gnuserv-make-temp-file-backup' -is non-nil. They are disposed of using `gnuserv-done-temp-file-function'. - -When all of a client's buffers are marked as \"done\", the client is notified. - -If invoked with a prefix argument, or if there is no gnuserv process -running, only starts server process. Invoked with \\[gnuserv-edit]." t nil) - -(global-set-key "#" 'gnuserv-edit) - ;;;*** ;;;### (autoloads (gopher-atpoint gopher) "gopher" "packages/gopher.el") @@ -7450,21 +7542,29 @@ ;;;*** -;;;### (autoloads (vc-update-change-log vc-rename-this-file vc-rename-file vc-cancel-version vc-revert-buffer vc-print-log vc-retrieve-snapshot vc-create-snapshot vc-directory vc-insert-headers vc-version-other-window vc-version-diff vc-diff vc-register vc-next-action vc-file-status) "vc" "packages/vc.el") - -(defvar vc-checkin-hook nil "\ -*List of functions called after a checkin is done. See `run-hooks'.") +;;;### (autoloads (vc-update-change-log vc-rename-file vc-cancel-version vc-revert-buffer vc-print-log vc-retrieve-snapshot vc-create-snapshot vc-directory vc-insert-headers vc-version-other-window vc-diff vc-checkout vc-register vc-next-action vc-find-binary) "vc" "packages/vc.el") (defvar vc-before-checkin-hook nil "\ -*List of functions called before a checkin is done. See `run-hooks'.") - -(autoload 'vc-file-status "vc" "\ -Display the current status of the file being visited. -Currently, this is only defined for CVS. The information provided in the -modeline is generally sufficient for RCS and SCCS." t nil) +*Normal hook (list of functions) run before a file gets checked in. +See `run-hooks'.") + +(defvar vc-checkin-hook nil "\ +*Normal hook (List of functions) run after a checkin is done. +See `run-hooks'.") + +(autoload 'vc-find-binary "vc" "\ +Look for a command anywhere on the subprocess-command search path." nil nil) (autoload 'vc-next-action "vc" "\ Do the next logical checkin or checkout operation on the current file. + If you call this from within a VC dired buffer with no files marked, +it will operate on the file in the current line. + If you call this from within a VC dired buffer, and one or more +files are marked, it will accept a log message and then operate on +each one. The log message will be used as a comment for any register +or checkin operations, but ignored when doing checkouts. Attempted +lock steals will raise an error. + A prefix argument lets you specify the version number to use. For RCS and SCCS files: If the file is not already registered, this registers it for version @@ -7486,31 +7586,19 @@ If the file is not already registered, this registers it for version control. This does a \"cvs add\", but no \"cvs commit\". If the file is added but not committed, it is committed. - If the file has not been changed, neither in your working area or -in the repository, a message is printed and nothing is done. If your working file is changed, but the repository file is unchanged, this pops up a buffer for entry of a log message; when the message has been entered, it checks in the resulting changes along with the logmessage as change commentary. A writable file is retained. If the repository file is changed, you are asked if you want to -merge in the changes into your working copy. - -The following is true regardless of which version control system you -are using: - - If you call this from within a VC dired buffer with no files marked, -it will operate on the file in the current line. - If you call this from within a VC dired buffer, and one or more -files are marked, it will accept a log message and then operate on -each one. The log message will be used as a comment for any register -or checkin operations, but ignored when doing checkouts. Attempted -lock steals will raise an error. - - For checkin, a prefix argument lets you specify the version number to use." t nil) +merge in the changes into your working copy." t nil) (autoload 'vc-register "vc" "\ Register the current file into your version-control system." t nil) +(autoload 'vc-checkout "vc" "\ +Retrieve a copy of the latest version of the given file." nil nil) + (autoload 'vc-diff "vc" "\ Display diffs between file versions. Normally this compares the current file and buffer with the most recent @@ -7518,11 +7606,6 @@ With a prefix argument, it reads the file name to use and two version designators specifying which versions to compare." t nil) -(autoload 'vc-version-diff "vc" "\ -For FILE, report diffs between two stored versions REL1 and REL2 of it. -If FILE is a directory, generate diffs between versions for all registered -files in or below it." t nil) - (autoload 'vc-version-other-window "vc" "\ Visit version REV of the current buffer in another window. If the current buffer is named `F', the version is named `F.~REV~'. @@ -7534,13 +7617,9 @@ the variable `vc-header-alist'." t nil) (autoload 'vc-directory "vc" "\ -Show version-control status of all files in the directory DIR. -If the second argument VERBOSE is non-nil, show all files; -otherwise show only files that current locked in the version control system. -Interactively, supply a prefix arg to make VERBOSE non-nil. - -If the optional third argument NESTED is non-nil, -scan the entire tree of subdirectories of the current directory." t nil) +Show version-control status of the current directory and subdirectories. +Normally it creates a Dired buffer that lists only the locked files +in all these directories. With a prefix argument, it lists all files." t nil) (autoload 'vc-create-snapshot "vc" "\ Make a snapshot called NAME. @@ -7571,15 +7650,21 @@ (autoload 'vc-rename-file "vc" "\ Rename file OLD to NEW, and rename its master file likewise." t nil) -(autoload 'vc-rename-this-file "vc" nil t nil) - (autoload 'vc-update-change-log "vc" "\ -Find change log file and add entries from recent RCS logs. +Find change log file and add entries from recent RCS/CVS logs. +Normally, find log entries for all registered files in the default +directory using `rcs2log', which finds CVS logs preferentially. The mark is left at the end of the text prepended to the change log. + With prefix arg of C-u, only find log entries for the current buffer's file. -With any numeric prefix arg, find log entries for all files currently visited. -Otherwise, find log entries for all registered files in the default directory. -From a program, any arguments are passed to the `rcs2log' script." t nil) + +With any numeric prefix arg, find log entries for all currently visited +files that are under version control. This puts all the entries in the +log for the default directory, which may not be appropriate. + +From a program, any arguments are assumed to be filenames and are +passed to the `rcs2log' script after massaging to be relative to the +default directory." t nil) ;;;*** @@ -8771,10 +8856,6 @@ (define-key ctl-x-map "\C-k" 'edit-kbd-macro) -(defvar edmacro-eight-bits nil "\ -*Non-nil if edit-kbd-macro should leave 8-bit characters intact. -Default nil means to write characters above \\177 in octal notation.") - (autoload 'edit-kbd-macro "edmacro" "\ Edit a keyboard macro. At the prompt, type any key sequence which is bound to a keyboard macro.
--- a/lisp/prim/custom-load.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/prim/custom-load.el Mon Aug 13 09:37:19 2007 +0200 @@ -15,7 +15,7 @@ (put 'custom-faces 'custom-loads '("cus-edit")) (put 'execute 'custom-loads '()) (put 'gnus-message 'custom-loads '("message")) -(put 'mouse 'custom-loads '("mouse" "outl-mouse" "avoid")) +(put 'mouse 'custom-loads '("mouse" "outl-mouse" "strokes" "avoid")) (put 'mail-abbrevs 'custom-loads '("mail-abbrevs")) (put 'gnus-summary-sort 'custom-loads '("gnus-sum")) (put 'nnmail-procmail 'custom-loads '("nnmail")) @@ -30,7 +30,7 @@ (put 'widgets 'custom-loads '("wid-browse" "wid-edit")) (put 'minibuffer 'custom-loads '("minibuf" "detached-minibuf")) (put 'environment 'custom-loads '("minibuf" "modeline" "x-toolbar" "cus-edit" "dired-faces" "gnuserv" "sound")) -(put 'shell 'custom-loads '("shell")) +(put 'shell 'custom-loads '("shell" "term")) (put 'sound 'custom-loads '("sound")) (put 'gnus-article-buttons 'custom-loads '("gnus-art")) (put 'gnus-extract-archive 'custom-loads '("gnus-uu")) @@ -111,13 +111,14 @@ (put 'gnus-summary-maneuvering 'custom-loads '("gnus-sum")) (put 'avoid 'custom-loads '("avoid")) (put 'f90 'custom-loads '("f90")) +(put 'term 'custom-loads '("term")) (put 'gnus-extract 'custom-loads '("gnus" "gnus-uu")) (put 'help 'custom-loads '("help" "cus-edit" "info" "man")) (put 'supercite 'custom-loads '("supercite")) (put 'generic-sc 'custom-loads '("generic-sc")) (put 'local 'custom-loads '("calendar" "gopher")) (put 'nnmail-split 'custom-loads '("nnmail")) -(put 'keyboard 'custom-loads '()) +(put 'keyboard 'custom-loads '("edmacro")) (put 'minubuffer 'custom-loads '("minibuf")) (put 'asm 'custom-loads '("asm-mode")) (put 'url-gateway 'custom-loads '("url-gw")) @@ -160,6 +161,7 @@ (put 'nnmail-retrieve 'custom-loads '("nnmail")) (put 'ediff-ptch 'custom-loads '()) (put 'url-history 'custom-loads '("url-vars")) +(put 'strokes 'custom-loads '("strokes")) (put 'message-interface 'custom-loads '("message")) (put 'gnus-group 'custom-loads '("gnus-topic" "gnus")) (put 'remote-compile 'custom-loads '("rcompile")) @@ -218,6 +220,7 @@ (put 'gnus-summary-format 'custom-loads '("gnus-sum")) (put 'gnus-score-decay 'custom-loads '("gnus-score")) (put 'fill 'custom-loads '("filladapt")) +(put 'edmacro 'custom-loads '("edmacro")) (put 'balloon-help 'custom-loads '("balloon-help")) (put 'gnus-extract-post 'custom-loads '("gnus-uu")) (put 'debug 'custom-loads '()) @@ -239,7 +242,7 @@ (put 'enriched 'custom-loads '("enriched")) (put 'gnus-article-highlight 'custom-loads '("gnus-art")) (put 'emacs 'custom-loads '("cus-edit")) -(put 'processes 'custom-loads '("background" "comint" "rlogin" "shell" "cus-edit" "executable" "gnuserv" "ispell" "metamail" "rcompile" "passwd")) +(put 'processes 'custom-loads '("background" "comint" "rlogin" "shell" "cus-edit" "term" "executable" "gnuserv" "ispell" "metamail" "rcompile" "passwd")) (put 'news 'custom-loads '("gnus" "message" "supercite" "highlight-headers")) (put 'rexx 'custom-loads '("rexx-mode")) (put 'w3-hooks 'custom-loads '("w3-cus")) @@ -280,6 +283,6 @@ (put 'ps-print-color 'custom-loads '("ps-print")) (put 'info 'custom-loads '("info")) (put 'w3-scripting 'custom-loads '("w3-script")) -(put 'unix 'custom-loads '("rlogin" "shell" "sh-script")) +(put 'unix 'custom-loads '("rlogin" "shell" "term" "sh-script")) (put 'x 'custom-loads '()) (put 'c 'custom-loads '("cc-mode" "cmacexp"))
--- a/lisp/prim/files.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/prim/files.el Mon Aug 13 09:37:19 2007 +0200 @@ -824,39 +824,42 @@ directory where the file was found. If you *do not* want that, add the logical name to this list as a string.") -;(defun find-buffer-visiting (filename) -; "Return the buffer visiting file FILENAME (a string). -;This is like `get-file-buffer', except that it checks for any buffer -;visiting the same file, possibly under a different name. -;If there is no such live buffer, return nil." -; (let ((buf (get-file-buffer filename)) -; (truename (abbreviate-file-name (file-truename filename)))) -; (or buf -; (let ((list (buffer-list)) found) -; (while (and (not found) list) -; (save-excursion -; (set-buffer (car list)) -; (if (and buffer-file-name -; (string= buffer-file-truename truename)) -; (setq found (car list)))) -; (setq list (cdr list))) -; found) -; (let ((number (nthcdr 10 (file-attributes truename))) -; (list (buffer-list)) found) -; (and number -; (while (and (not found) list) -; (save-excursion -; (set-buffer (car list)) -; (if (and buffer-file-number -; (equal buffer-file-number number) -; ;; Verify this buffer's file number -; ;; still belongs to its file. -; (file-exists-p buffer-file-name) -; (equal (nthcdr 10 (file-attributes buffer-file-name)) -; number)) -; (setq found (car list)))) -; (setq list (cdr list)))) -; found)))) +;; This function is needed by FSF vc.el. I hope somebody can make it +;; work for XEmacs. -sb. +(defun find-buffer-visiting (filename) + "Return the buffer visiting file FILENAME (a string). +This is like `get-file-buffer', except that it checks for any buffer +visiting the same file, possibly under a different name. +If there is no such live buffer, return nil." + (let ((buf (get-file-buffer filename)) + (truename (abbreviate-file-name (file-truename filename)))) + (or buf + (let ((list (buffer-list)) found) + (while (and (not found) list) + (save-excursion + (set-buffer (car list)) + (if (and buffer-file-name + (string= buffer-file-truename truename)) + (setq found (car list)))) + (setq list (cdr list))) + found) + (let ((number (nthcdr 10 (file-attributes truename))) + (list (buffer-list)) found) + (and buffer-file-numbers-unique + number + (while (and (not found) list) + (save-excursion + (set-buffer (car list)) + (if (and buffer-file-number + (equal buffer-file-number number) + ;; Verify this buffer's file number + ;; still belongs to its file. + (file-exists-p buffer-file-name) + (equal (nthcdr 10 (file-attributes buffer-file-name)) + number)) + (setq found (car list)))) + (setq list (cdr list)))) + found)))) (defun insert-file-contents-literally (filename &optional visit beg end replace) "Like `insert-file-contents', q.v., but only reads in the file. @@ -1010,7 +1013,8 @@ (defvar after-find-file-from-revert-buffer nil) (defun after-find-file (&optional error warn noauto - after-find-file-from-revert-buffer) + after-find-file-from-revert-buffer + nomodes) "Called after finding a file and by the default revert function. Sets buffer mode, parses local variables. Optional args ERROR, WARN, and NOAUTO: ERROR non-nil means there was an @@ -1019,6 +1023,7 @@ NOAUTO means don't mess with auto-save mode. Fourth arg AFTER-FIND-FILE-FROM-REVERT-BUFFER non-nil means this call was from `revert-buffer'. +Fifth arg NOMODES non-nil means don't alter the file's modes. Finishes by calling the functions in `find-file-hooks'." (setq buffer-read-only (not (file-writable-p buffer-file-name))) (if noninteractive @@ -1032,9 +1037,9 @@ (if (and warn (file-newer-than-file-p (make-auto-save-file-name) buffer-file-name)) - (gettext "Auto save file is newer; consider M-x recover-file") + (format "%s has auto save data; consider M-x recover-file" (setq not-serious t) - (if error (gettext "(New file)") nil))) + (if error (gettext "(New file)") nil)))) ((not error) (setq not-serious t) (gettext "Note: file is write protected")) @@ -1048,23 +1053,18 @@ ;; than when we save the buffer, because we want ;; autosaving to work. (setq buffer-read-only nil) - (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))) - nil)))) + (if (file-exists-p (file-name-directory (directory-file-name (file-name-directory buffer-file-name)))) + "Use M-x make-dir RET RET to create the directory" + "Use C-u M-x make-dir RET RET to create directory and its parents"))))) (if msg (progn (message msg) (or not-serious (sit-for 1 t))))) (if (and auto-save-default (not noauto)) (auto-save-mode t))) - (normal-mode t) - (run-hooks 'find-file-hooks)) + (unless nomodes + (normal-mode t) + (run-hooks 'find-file-hooks))) (defun normal-mode (&optional find-file) "Choose the major mode for this buffer automatically. @@ -1956,7 +1956,7 @@ `dired-kept-versions' controls dired's clean-directory (.) command. If `delete-old-versions' is nil, system will query user before trimming versions. Otherwise it does it silently." - (interactive "p") + (interactive "_p") (let ((modp (buffer-modified-p)) (large (> (buffer-size) 50000)) (make-backup-files (or (and make-backup-files (not (eq args 0))) @@ -2418,11 +2418,17 @@ If `revert-buffer-function' is used to override the normal revert mechanism, this hook is not used.") -(defun revert-buffer (&optional ignore-auto noconfirm) +(defun revert-buffer (&optional ignore-auto noconfirm preserve-modes) "Replace the buffer text with the text of the visited file on disk. This undoes all changes since the file was visited or saved. With a prefix argument, offer to revert from latest auto-save file, if that is more recent than the visited file. + +This command also works for special buffers that contain text which +doesn't come from a file, but reflects some other data base instead: +for example, Dired buffers and buffer-list buffers. In these cases, +it reconstructs the buffer contents from the appropriate data base. + When called from Lisp, the first argument is IGNORE-AUTO; only offer to revert from the auto-save file when this is nil. Note that the sense of this argument is the reverse of the prefix argument, for the @@ -2432,6 +2438,9 @@ Optional second argument NOCONFIRM means don't ask for confirmation at all. +Optional third argument PRESERVE-MODES non-nil means don't alter +the files modes. Normally we reinitialize them using `normal-mode'. + If the value of `revert-buffer-function' is non-nil, it is called to do the work. @@ -2498,8 +2507,9 @@ ;; Recompute the truename in case changes in symlinks ;; have changed the truename. ;XEmacs: already done by insert-file-contents - ;(compute-buffer-file-truename) - (after-find-file nil nil t t) + ;;(setq buffer-file-truename + ;;(abbreviate-file-name (file-truename buffer-file-name))) + (after-find-file nil nil t t preserve-modes) ;; Run after-revert-hook as it was before we reverted. (setq-default revert-buffer-internal-hook global-hook) (if local-hook-p
--- a/lisp/prim/frame.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/prim/frame.el Mon Aug 13 09:37:19 2007 +0200 @@ -837,9 +837,8 @@ (or (get mode 'frame-name) get-frame-for-buffer-default-frame-name))) - -(defun get-frame-for-buffer-make-new-frame (buffer &optional frame-name) - (let* ((fr (make-frame (and frame-name (list (cons 'name frame-name))))) +(defun get-frame-for-buffer-make-new-frame (buffer &optional frame-name plist) + (let* ((fr (make-frame plist)) (w (frame-root-window fr))) ;; ;; Make the one buffer being displayed in this newly created @@ -874,6 +873,7 @@ ;; name. That always takes priority. ;; (let ((limit (get name 'instance-limit)) + (defaults (get name 'frame-defaults)) (matching-frames '()) frames frame already-visible) ;; Sort the list so that iconic frames will be found last. They @@ -911,7 +911,11 @@ ((or (null matching-frames) (eq limit 0) ; means create with reckless abandon (and limit (< (length matching-frames) limit))) - (get-frame-for-buffer-make-new-frame buffer name)) + (get-frame-for-buffer-make-new-frame + buffer + name + (alist-to-plist (acons 'name name + (plist-to-alist defaults))))) (t ;; do not switch any of the window/buffer associations in an ;; existing frame; this function only picks a frame; the
--- a/lisp/prim/obsolete.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/prim/obsolete.el Mon Aug 13 09:37:19 2007 +0200 @@ -357,9 +357,9 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer -(define-obsolete-function-alias 'read-minibuffer +(define-compatible-function-alias 'read-minibuffer 'read-expression) ; misleading name -(define-obsolete-function-alias 'read-input 'read-string) +(define-compatible-function-alias 'read-input 'read-string) (make-obsolete 'read-no-blanks-input 'read-string) ; mocklisp crud ;;;;;;;;;;;;;;;;;;;;;;;;;;;; misc
--- a/lisp/prim/process.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/prim/process.el Mon Aug 13 09:37:19 2007 +0200 @@ -192,19 +192,17 @@ If OUTPUT-BUFFER is not a buffer and not nil, insert output in the current buffer. In either case, the output is inserted after point (leaving mark after it)." - (interactive (if (not (region-exists-p)) - (error "The region is not active now") - (let ((string + (interactive (let ((string ;; Do this before calling region-beginning ;; and region-end, in case subprocess output ;; relocates them while we are in the minibuffer. - (read-shell-command "Shell command on region: "))) - ;; call-interactively recognizes region-beginning and - ;; region-end specially, leaving them in the history. - (list (region-beginning) (region-end) - string - current-prefix-arg - current-prefix-arg)))) + (read-shell-command "Shell command on region: "))) + ;; call-interactively recognizes region-beginning and + ;; region-end specially, leaving them in the history. + (list (region-beginning) (region-end) + string + current-prefix-arg + current-prefix-arg))) (if (or replace (and output-buffer (not (or (bufferp output-buffer) (stringp output-buffer)))))
--- a/lisp/prim/subr.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/prim/subr.el Mon Aug 13 09:37:19 2007 +0200 @@ -509,9 +509,11 @@ ;;;; Miscellanea. (defun buffer-substring-no-properties (beg end) - "Return the text from BEG to END, without text properties, as a string." + "Return the text from BEG to END, without extents, as a string." (let ((string (buffer-substring beg end))) - (set-text-properties 0 (length string) nil string) + (map-extents (lambda (ext &rest junk) + (delete-extent ext)) + string) string)) (defun ignore (&rest ignore)
--- a/lisp/utils/easymenu.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/utils/easymenu.el Mon Aug 13 09:37:19 2007 +0200 @@ -1,11 +1,11 @@ ;;; easymenu.el - Easy menu support for Emacs 19 and XEmacs. ;; -;; $Id: easymenu.el,v 1.3 1997/04/16 04:08:03 steve Exp $ +;; $Id: easymenu.el,v 1.4 1997/05/23 01:36:43 steve Exp $ ;; ;; LCD Archive Entry: ;; easymenu|Per Abrahamsen|abraham@iesd.auc.dk| ;; Easy menu support for XEmacs| -;; $Date: 1997/04/16 04:08:03 $|$Revision: 1.3 $|~/misc/easymenu.el.gz| +;; $Date: 1997/05/23 01:36:43 $|$Revision: 1.4 $|~/misc/easymenu.el.gz| ;; Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. @@ -168,7 +168,7 @@ "Add MENU to the current menu bar." (if (featurep 'menubar) (progn - (setq easy-menu-all-popups (cons menu easy-menu-all-popups)) + (pushnew menu easy-menu-all-popups) (setq mode-popup-menu (cons (easy-menu-title) (reverse easy-menu-all-popups)))
--- a/lisp/utils/edmacro.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/utils/edmacro.el Mon Aug 13 09:37:19 2007 +0200 @@ -5,7 +5,7 @@ ;; Author: Dave Gillespie <daveg@synaptics.com> ;; Hrvoje Niksic <hniksic@srce.hr> -- XEmacs port ;; Maintainer: Hrvoje Niksic <hniksic@srce.hr> -;; Version: 3.10 +;; Version: 3.14 ;; Keywords: abbrev ;; This file is part of XEmacs. @@ -88,39 +88,42 @@ ;; Emacs 19.18.) This package does not work with Emacs 18 or ;; Lucid Emacs. -;; Ported to XEmacs. -hniksic +;; Ported to XEmacs. This code will not run on GNU Emacs 19. -hniksic ;;; Code: (eval-when-compile (require 'cl)) +(defgroup edmacro nil + "Keyboard macro editor." + :group 'keyboard) + +(defcustom edmacro-eight-bits nil + "*Non-nil if edit-kbd-macro should leave 8-bit characters intact. +Default nil means to write characters above \\177 in octal notation." + :type 'boolean + :group 'edmacro) + +(defcustom edmacro-format-hook nil + "*Hook run after formatting the keyboard macro." + :type 'hook + :group 'edmacro) + +(defvar edmacro-finish-hook nil) +(defvar edmacro-store-hook nil) +(defvar edmacro-original-buffer nil) + ;;; The user-level commands for editing macros. ;;;###autoload (define-key ctl-x-map "\C-k" 'edit-kbd-macro) -;;;###autoload -(defvar edmacro-eight-bits nil - "*Non-nil if edit-kbd-macro should leave 8-bit characters intact. -Default nil means to write characters above \\177 in octal notation.") - -(if (fboundp 'mapvector) - (defalias 'edmacro-mapvector 'mapvector) - (defun edmacro-mapvector (fun seq) - (map 'vector fun seq))) - (defvar edmacro-mode-map nil) (unless edmacro-mode-map (setq edmacro-mode-map (make-sparse-keymap)) (define-key edmacro-mode-map "\C-c\C-c" 'edmacro-finish-edit) (define-key edmacro-mode-map "\C-c\C-q" 'edmacro-insert-key)) -(defvar edmacro-store-hook) -(defvar edmacro-finish-hook) -(defvar edmacro-original-buffer) - -;; A lot of cruft here, but I got it to work eventually. Could use -;; some cleaning up. ;;;###autoload (defun edit-kbd-macro (keys &optional prefix finish-hook store-hook) "Edit a keyboard macro. @@ -130,74 +133,72 @@ its command name. With a prefix argument, format the macro in a more concise way." (interactive "kKeyboard macro to edit (C-x e, M-x, C-h l, or keys): \nP") - (when keys - (setq keys (edmacro-events-to-keys keys)) - (let ((cmd (if (arrayp keys) (key-binding keys) keys)) - (mac nil)) - (cond (store-hook - (setq mac keys) - (setq cmd nil)) - ((or (eq cmd 'call-last-kbd-macro) - (and (arrayp keys) - (= 1 (length keys)) - (eq ?\r (aref keys 0)))) - (or last-kbd-macro - (y-or-n-p "No keyboard macro defined. Create one? ") - (keyboard-quit)) - (setq mac (or last-kbd-macro "")) - (setq cmd 'last-kbd-macro)) - ((eq cmd 'execute-extended-command) - (setq cmd (read-command "Name of keyboard macro to edit: ")) - (if (string-equal cmd "") - (error "No command name given")) - (setq mac (symbol-function cmd))) - ((eq cmd 'view-lossage) - (setq mac (recent-keys)) - (setq cmd 'last-kbd-macro)) - ((null cmd) - (error "Key sequence %s is not defined" (key-description keys))) - ((symbolp cmd) - (setq mac (symbol-function cmd))) - (t - (setq mac cmd) - (setq cmd nil))) - (unless (arrayp mac) - (error "Key sequence %s is not a keyboard macro" - (key-description keys))) - (message "Formatting keyboard macro...") - (let* ((oldbuf (current-buffer)) - (mmac (edmacro-fix-menu-commands mac)) - (fmt (edmacro-format-keys mmac 1)) - (fmtv (edmacro-format-keys mmac (not prefix))) - (buf (get-buffer-create "*Edit Macro*"))) - (message "Formatting keyboard macro...done") - (switch-to-buffer buf) - (kill-all-local-variables) - (use-local-map edmacro-mode-map) - (setq buffer-read-only nil) - (setq major-mode 'edmacro-mode) - (setq mode-name "Edit Macro") - (set (make-local-variable 'edmacro-original-buffer) oldbuf) - (set (make-local-variable 'edmacro-finish-hook) finish-hook) - (set (make-local-variable 'edmacro-store-hook) store-hook) - (erase-buffer) - (insert ";; Keyboard Macro Editor. Press C-c C-c to finish; " - "press C-x k RET to cancel.\n") - (insert ";; Original keys: " fmt "\n") - (unless store-hook - (insert "\nCommand: " (if cmd (symbol-name cmd) "none") "\n") - (let ((keys (where-is-internal (or cmd mac)))) - (if keys - (while keys - (insert "Key: " (edmacro-format-keys (pop keys) 1) "\n")) - (insert "Key: none\n")))) - (insert "\nMacro:\n\n") - (save-excursion - (insert fmtv "\n")) - (recenter '(4)) - (when (eq mac mmac) - (set-buffer-modified-p nil)) - (run-hooks 'edmacro-format-hook))))) + (when (vectorp keys) + (setq keys (edmacro-events-to-keys keys))) + (let ((cmd (if (symbolp keys) keys (key-binding keys))) + (mac nil)) + (cond (store-hook + (setq mac keys) + (setq cmd nil)) + ((or (eq cmd 'call-last-kbd-macro) + (and (arrayp keys) + (= 1 (length keys)) + (or (eq 'return (aref keys 0)) + (eq ?\r (aref keys 0)) + (equal '(control ?m) (aref keys 0))))) + (or last-kbd-macro + (y-or-n-p "No keyboard macro defined. Create one? ") + (keyboard-quit)) + (setq mac (or last-kbd-macro [])) + (setq cmd 'last-kbd-macro)) + ((eq cmd 'execute-extended-command) + (setq cmd (edmacro-minibuf-read "Name of keyboard macro to edit: ")) + (if (string-equal cmd "") + (error "No command name given")) + (setq mac (symbol-function cmd))) + ((eq cmd 'view-lossage) + (setq mac (recent-keys)) + (setq cmd 'last-kbd-macro)) + ((null cmd) + (error "Key sequence `%s' is not defined" (key-description keys))) + ((symbolp cmd) + (setq mac (symbol-function cmd))) + (t + (setq mac cmd) + (setq cmd nil))) + (unless (arrayp mac) + (error "Key sequence `%s' is not a keyboard macro" + (key-description keys))) + (message "Formatting keyboard macro...") + (let ((oldbuf (current-buffer)) + (fmt (edmacro-format-keys mac)) + (fmtv (edmacro-format-keys mac (not prefix))) + (buf (get-buffer-create "*Edit Macro*"))) + (message "Formatting keyboard macro...done") + (switch-to-buffer buf) + (kill-all-local-variables) + (use-local-map edmacro-mode-map) + (setq buffer-read-only nil) + (setq major-mode 'edmacro-mode) + (setq mode-name "Edit Macro") + (set (make-local-variable 'edmacro-original-buffer) oldbuf) + (set (make-local-variable 'edmacro-finish-hook) finish-hook) + (set (make-local-variable 'edmacro-store-hook) store-hook) + (erase-buffer) + (insert ";; Keyboard Macro Editor. Press C-c C-c to finish; " + "press C-x k RET to cancel.\n") + (insert ";; Original keys: " fmt "\n") + (unless store-hook + (insert "\nCommand: " (if cmd (symbol-name cmd) "none") "\n") + (let ((keys (where-is-internal (or cmd mac)))) + (if keys + (insert "Key: " (edmacro-format-keys (car keys)) "\n") + (insert "Key: none\n")))) + (insert "\nMacro:\n\n") + (save-excursion + (insert fmtv "\n")) + (recenter '(4)) + (run-hooks 'edmacro-format-hook)))) ;;; The next two commands are provided for convenience and backward ;;; compatibility. @@ -228,7 +229,7 @@ Second argument NEED-VECTOR means to return an event vector always." (interactive "r") (if (stringp start) - (edmacro-parse-keys start end) + (edmacro-parse-keys start) (setq last-kbd-macro (edmacro-parse-keys (buffer-substring start end))))) ;;;###autoload @@ -245,6 +246,7 @@ or nil, use a compact 80-column format." (and macro (symbolp macro) (setq macro (symbol-function macro))) (edmacro-format-keys (or macro last-kbd-macro) verbose)) + ;;; Commands for *Edit Macro* buffer. @@ -289,9 +291,10 @@ (or (not (fboundp b)) (not (arrayp (symbol-function b)))) (not (y-or-n-p - (format "Key %s is already defined; %s" - (edmacro-format-keys key 1) - "proceed? "))) + (format + "Key `%s' is already defined; %s" + (edmacro-format-keys key) + "proceed? "))) (keyboard-quit)))))) t) ((looking-at "Macro:[ \t\n]*") @@ -305,8 +308,7 @@ (str (buffer-substring top (point-max))) (modp (buffer-modified-p)) (obuf edmacro-original-buffer) - (store-hook edmacro-store-hook) - (finish-hook edmacro-finish-hook)) + (store-hook edmacro-store-hook)) (unless (or cmd keys store-hook (equal str "")) (error "No command name or keys specified")) (when modp @@ -335,9 +337,7 @@ (global-set-key key (or cmd mac))))))))) (kill-buffer buf) (when (buffer-name obuf) - (switch-to-buffer obuf)) - (when finish-hook - (funcall finish-hook))))) + (switch-to-buffer obuf))))) (defun edmacro-insert-key (key) "Insert the written name of a key in the buffer." @@ -421,140 +421,196 @@ (interactive) (error "This mode can be enabled only by `edit-kbd-macro'")) (put 'edmacro-mode 'mode-class 'special) + - (defun edmacro-int-char (int) - (if (fboundp 'char-to-int) - (char-to-int int) + (if (fboundp 'int-char) + (int-char int) int)) +(defvar edmacro-read-history nil) + +;; Completing read on named keyboard macros only. +(defun edmacro-minibuf-read (prompt) + (intern (completing-read + prompt obarray + (lambda (arg) + (and (commandp arg) + (vectorp (symbol-function arg)))) + t nil 'edmacro-read-history))) + +(defvar edmacro-char-to-word + '((?\0 . "NUL") + (?\r . "RET") + (?\n . "LFD") + (?\t . "TAB") + (?\e . "ESC") + (?\ . "SPC") + (?\C-? . "DEL"))) + +(defvar edmacro-modifiers + '(("C" . control) + ("M" . meta) + ("S" . shift) + ("Sh" . shift) + ("A" . alt) + ("H" . hyper) + ("s" . super))) + ;;; Parsing a human-readable keyboard macro. ;; Changes for XEmacs -- these two functions re-written from scratch. ;; edmacro-parse-keys always returns a vector. edmacro-format-keys ;; accepts a vector (but works with a string too). Vector may contain ;; keypress events. -hniksic -(defun edmacro-parse-keys (string &optional ignored) +(defun edmacro-parse-keys (string) (let* ((pos 0) (case-fold-search nil) - (word-to-sym '(("NUL" . ?\0) - ("RET" . return) - ("LFD" . linefeed) - ("TAB" . tab) - ("ESC" . escape) - ("SPC" . space) - ("BS" . backspace) - ("DEL" . delete))) - (char-to-word '((?\0 . "NUL") - (?\r . "RET") - (?\n . "LFD") - (?\t . "TAB") - (?\e . "ESC") - (?\ . "SPC") - (?\C-? . "DEL"))) - (modifier-prefix-alist '(("C" . control) - ("M" . meta) - ("S" . shift) - ("Sh" . shift) - ("A" . alt) - ("H" . hyper) - ("s" . super))) - ;; string-to-symbol-or-char converter - (conv (lambda (arg) - (if (= (length arg) 1) - (aref arg 0) - (if (string-match "^<\\([^>]+\\)>$" arg) - (setq arg (match-string 1 arg))) - (let ((match (assoc arg word-to-sym))) - (if match - (cdr match) - (intern arg)))))) - (conv-chars (lambda (arg) - (let ((match (assoc arg char-to-word))) - (if match - (cdr (assoc (cdr match) word-to-sym)) - arg)))) res) (while (and (< pos (length string)) - (string-match "[^ \t\n\f]+" string pos)) - (let ((word (substring string (match-beginning 0) (match-end 0))) - (times 1) - (force-sym nil) - (add nil) - match) + (string-match "[^ \t\r\n\f]+" string pos)) + (let ((word (substring string (match-beginning 0) (match-end 0)))) (setq pos (match-end 0)) - (when (string-match "\\([0-9]+\\)\\*." word) - (setq times (string-to-int (substring word 0 (match-end 1)))) - (setq word (substring word (1+ (match-end 1))))) - (when (string-match "^<\\([^<>]+\\)>$" word) - (setq word (match-string 1 word)) - (setq force-sym t)) - (setq match (assoc word word-to-sym)) - ;; Add an element; `add' holds the list of elements to be - ;; added. - (cond ((string-match "^\\\\[0-7]+" word) - ;; Octal value of character. - (setq add - (list - (edmacro-int-char - (edmacro-octal-string-to-integer (substring word 1)))))) - ((string-match "^<<.+>>$" word) - ;; Extended command. - (setq add - (nconc - (list - (if (eq (key-binding [(meta x)]) - 'execute-extended-command) - '(meta x) - (or (car (where-is-internal - 'execute-extended-command)) - '(meta x)))) - (mapcar conv-chars (concat (substring word 2 -2) "\r"))) - )) - ((or (equal word "REM") (string-match "^;;" word)) - ;; Comment (discard to EOL) . - (setq pos (string-match "$" string pos))) - (match - ;; Convert to symbol. - (setq add (list (cdr match)))) - ((string-match "^\\^" word) - ;; ^X == C-x - (if (/= (length word) 2) - (error "^ must be followed by one character")) - (setq add (list 'control (aref word 0)))) - ((string-match "^\\([MCSsAH]\\|Sh\\)-" word) - ;; Parse C-* and stuff - (setq - add - (list - (let ((pos1 0) - (r1 nil) - follow curpart prefix) - (while (progn (setq curpart (substring word pos1)) - (string-match "^\\([MCSsAH]\\|Sh\\)-" - curpart)) - (setq prefix (assoc (match-string 1 curpart) - modifier-prefix-alist)) - (setq r1 (nconc r1 (list (cdr prefix)))) - (callf + pos1 (1+ (length (car prefix))))) - (setq follow (substring word pos1)) - (if (equal follow "") - (error "%s must precede a string" - (substring word 0 pos1))) - (nconc r1 (list (funcall conv follow))))))) - (force-sym - ;; This must be a symbol - (setq add (list (intern word)))) - (t - ;; Characters - (setq add (mapcar conv-chars word)))) - (let ((new nil)) - (loop repeat times do (setq new (append new add))) - (setq add new)) - (setq res (nconc res add)))) - (edmacro-mapvector 'identity res))) + (if (or (equal word "REM") (string-match "^;;" word)) + ;; Comment (discard to EOL) . + (setq pos (string-match "$" string pos)) + (push (edmacro-parse-word word) res)))) + (mapvector 'identity (apply 'nconc (nreverse res))))) +;; Parse a word. +(defun edmacro-parse-word (word) + (let ((force-sym nil) + (times 1) + abbr) + (when (string-match "\\([0-9]+\\)\\*." word) + (setq times (string-to-int (substring word 0 (match-end 1)))) + (setq word (substring word (1+ (match-end 1))))) + (when (string-match "^<\\([^<>]+\\)>$" word) + (setq word (match-string 1 word)) + (setq force-sym t)) + (let* ((word-to-sym '(("NUL" . ?\0) + ("RET" . return) + ("LFD" . linefeed) + ("TAB" . tab) + ("ESC" . escape) + ("SPC" . space) + ("BS" . backspace) + ("DEL" . delete))) + (conv (lambda (arg) + ;; string-to-symbol-or-char converter + (if (= (length arg) 1) + (aref arg 0) + (if (string-match "^<\\([^>]+\\)>$" arg) + (setq arg (match-string 1 arg))) + (let ((match (assoc arg word-to-sym))) + (if match + (cdr match) + (intern arg)))))) + (conv-chars (lambda (arg) + (let ((match (assoc arg edmacro-char-to-word))) + (if match + (cdr (assoc (cdr match) word-to-sym)) + arg)))) + (add + (cond + ((string-match "^\\\\[0-7]+" word) + ;; Octal value of character. + (list + (edmacro-int-char + (hexl-octal-string-to-integer (substring word 1))))) + ((string-match "^<<.+>>$" word) + ;; Extended command. + (nconc + (list + (if (eq (key-binding [(meta x)]) + 'execute-extended-command) + '(meta x) + (or (car (where-is-internal + 'execute-extended-command)) + '(meta x)))) + (mapcar conv-chars (concat (substring word 2 -2) "\r")))) + ((setq abbr (assoc word word-to-sym)) + ;; Convert to symbol. + (list (cdr abbr))) + ((string-match "^\\^" word) + ;; ^X == C-x + (if (/= (length word) 2) + (error "^ must be followed by one character")) + `((control ,(aref word 1)))) + ((string-match "^\\([MCSsAH]\\|Sh\\)-" word) + ;; Parse C-* and stuff + (list + (let ((pos1 0) + (r1 nil) + follow curpart prefix) + (while (progn (setq curpart (substring word pos1)) + (string-match "^\\([MCSsAH]\\|Sh\\)-" + curpart)) + (setq prefix (assoc (match-string 1 curpart) + edmacro-modifiers)) + (push (cdr prefix) r1) + (incf pos1 (1+ (length (car prefix))))) + (setq follow (substring word pos1)) + (if (equal follow "") + (error "%s must precede a string" + (substring word 0 pos1))) + (nconc (nreverse r1) (list (funcall conv follow)))))) + (force-sym + ;; This must be a symbol + (list (intern word))) + (t + ;; Characters + (mapcar conv-chars word)))) + (new nil)) + (loop repeat times do (setq new (append add new))) + new))) + +;; Convert the keypress events in vector x to keys, and return a +;; vector of keys. If a list element is not a keypress event, ignore +;; it. +(defun edmacro-events-to-keys (x &optional list) + (let (new) + (mapc (lambda (el) + (cond ((key-press-event-p el) + (push (let ((mods (event-modifiers el))) + (if mods + (append mods (list (event-key el))) + (event-key el))) + new)) + ((or (characterp el) + (symbolp el) + (listp el)) + (push el new)))) + x) + (setq new (nreverse new)) + (if list + new + (mapvector 'identity new)))) + +;; Collapse a list of keys into a list of function keys, where +;; applicable. +(defun edmacro-fkeys (keys) + (let (new k lookup) + (while keys + (setq k (nconc k (list (car keys)))) + (setq lookup (lookup-key function-key-map (mapvector 'identity k))) + (cond ((vectorp lookup) + (push (mapcar 'identity lookup) new) + (setq k nil)) + ((keymapp lookup) + nil) + ((null lookup) + (push k new) + (setq k nil)) + (t + (setq k nil))) + (pop keys)) + (when (keymapp lookup) + (push k new)) + (apply 'nconc (nreverse new)))) + +;; Convert a character or symbol to string (defun edmacro-conv (char-or-sym add-<>) (let ((char-to-word '((?\0 . "NUL") (?\r . "RET") @@ -597,7 +653,9 @@ (start keys) el) (while keys - (unless (or (eq start keys) togetherp) + (when (or (eq (car keys) ?-) + (eq (car keys) '-) + (not (or togetherp (eq start keys)))) (callf concat res " ")) (if (> times 1) (setq res (concat (format "%d*" times) res))) @@ -608,185 +666,89 @@ (if (or (let (cnv) (while el - (let ((found (assq (car el) - '((control . "C-") - (meta . "M-") - (shift . "S-") - (alt . "A-") - (hyper . "H-") - (super . "s-"))))) + (let ((found (find (car el) edmacro-modifiers + :key 'cdr))) (callf concat my (if found - (cdr found) + (concat (car found) "-") (setq cnv (edmacro-conv (car el) nil)) (cdr cnv)))) - (setq el (cdr el))) + (pop el)) (car cnv)) (> times 1)) (concat "<" my ">") my))) (t (cdr (edmacro-conv el t))))) - (setq keys (cdr keys))) + (pop keys)) (if command (callf concat res - (concat - (make-string (max (- 3 (/ (length res) tab-width)) 1) ?\t) - ";; " - (symbol-name command) - (if togetherp (format " * %d" (length start)))))) + (make-string (max (- 3 (/ (length res) tab-width)) 1) ?\t) + ";; " + (symbol-name command) + (if togetherp (format " * %d" (length start))))) res)) -;; Convert the keypress events in vector x to keys, and return a -;; vector of keys. If a list element is not a keypress event, ignore -;; it. -(defun edmacro-events-to-keys (x) - (if (or (not (fboundp 'events-to-keys)) - (not (arrayp x))) - x - (let ((cnt 0) - (len (length x)) - new el) - (while (< cnt len) - (setq el (aref x cnt)) - (cond ((eventp el) - (if (mouse-event-p el) - (setq el nil) - (setq el (aref (events-to-keys (vector el)) 0)))) - (t - nil)) ; leave it be. - (if el - (setq new (nconc new (list el)))) - (incf cnt)) - (edmacro-mapvector 'identity new)))) - -;; Collapse a list of keys into a list of function keys, where -;; applicable. -(defun edmacro-fkeys (keys) - (let (new k lookup) - (while keys - (setq k (nconc k (list (car keys)))) - (setq lookup (lookup-key function-key-map (edmacro-mapvector 'identity k))) - (cond ((vectorp lookup) - (setq new (nconc new (mapcar 'identity lookup))) - (setq k nil)) - ((keymapp lookup) - nil) - ((null lookup) - (setq new (nconc new k)) - (setq k nil)) - (t - (setq k nil))) - (setq keys (cdr keys))) - (if (keymapp lookup) - (setq new (nconc new k))) - new)) +(defsubst edmacro-seq-equal (seq1 seq2) + (while (and seq1 seq2 + (equal (car seq1) (car seq2))) + (pop seq1) + (pop seq2)) + (not seq1)) ;;; Formatting a keyboard macro as human-readable text. (defun edmacro-format-keys (macro &optional verbose) ;; XEmacs: - ;; If we're dealing with events, convert them to symbols first. - (setq macro (edmacro-events-to-keys macro)) - (if (zerop (length macro)) - "" - (let ((res "")) - ;; I'm not sure I understand the original code, but this seems to - ;; work. - (and (eq verbose 1) - (setq verbose nil)) - - ;; We prefer a list -- much easier to process... - (setq macro (mapcar 'identity macro)) - (setq macro (edmacro-fkeys macro)) - (while macro - (let (key lookup (times 1) self-insert-p) - (loop do - (setq key (nconc key (list (car macro))) - macro (cdr macro) - lookup (lookup-key global-map (edmacro-mapvector - 'identity key))) - while - (and macro lookup (not (commandp lookup)))) - ;; keyboard macro - (if (vectorp lookup) - (setq lookup nil)) - (if (and (eq lookup 'self-insert-command) - (= (length key) 1) - (not (memq (car key) + ;; If we're dealing with events, convert them to symbols first; + ;; also, deal with Fkeys. + (setq macro (edmacro-fkeys (edmacro-events-to-keys macro t))) + (let ((res "")) + (while macro + (let (key lookup (times 1) self-insert-p) + (loop + do (setq key (nconc key (list (car macro))) + macro (cdr macro) + lookup (lookup-key global-map (mapvector + 'identity key))) + while (and macro lookup (not (commandp lookup)))) + ;; keyboard macro + (if (vectorp lookup) + (setq lookup nil)) + (if (and (eq lookup 'self-insert-command) + (= (length key) 1) + (not (memq (car key) + '(?\ ?\r ?\n space return linefeed tab)))) + (while (and (< (length key) 23) + (eq (lookup-key global-map (car macro)) + 'self-insert-command) + (not (memq + (car macro) '(?\ ?\r ?\n space return linefeed tab)))) - (while (and (< (length key) 23) - (eq (lookup-key global-map (car macro)) - 'self-insert-command) - (not (memq - (car macro) - '(?\ ?\r ?\n space return linefeed tab)))) - (setq key (nconc key (list (car macro))) - macro (cdr macro) - self-insert-p t)) + (setq key (nconc key (list (car macro))) + macro (cdr macro) + self-insert-p t)) + (let ((keysize (length key))) (while (edmacro-seq-equal key macro) - (setq macro (nthcdr (length key) macro)) - (incf times))) - (if (or self-insert-p - (null (cdr key)) - (= times 1)) - (callf concat res (edmacro-format-1 key (if verbose lookup - nil) - times self-insert-p) - (and macro (if verbose "\n" " "))) - (loop repeat times - do - (callf concat res - (edmacro-format-1 key (if verbose lookup - nil) - 1 self-insert-p) - (and macro (if verbose "\n" " "))))))) - res))) - -(defun edmacro-seq-equal (seq1 seq2) - (while (and seq1 seq2 - (equal (car seq1) (car seq2))) - (setq seq1 (cdr seq1) - seq2 (cdr seq2))) - (not seq1)) - -(defsubst edmacro-oct-char-to-integer (character) - "Take a char and return its value as if it was a octal digit." - (if (and (>= character ?0) (<= character ?7)) - (- character ?0) - (error (format "Invalid octal digit `%c'." character)))) - -(defun edmacro-octal-string-to-integer (octal-string) - "Return decimal integer for OCTAL-STRING." - (interactive "sOctal number: ") - (let ((oct-num 0)) - (while (not (equal octal-string "")) - (setq oct-num (+ (* oct-num 8) - (edmacro-oct-char-to-integer - (string-to-char octal-string)))) - (setq octal-string (substring octal-string 1))) - oct-num)) - - -(defun edmacro-fix-menu-commands (macro) - (when (vectorp macro) - (let ((i 0) ev) - (while (< i (length macro)) - (when (and (consp (setq ev (aref macro i))) - (not (memq (car ev) ; ha ha - '(hyper super meta alt control shift)))) - (cond ((equal (cadadr ev) '(menu-bar)) - (setq macro (vconcat (edmacro-subseq macro 0 i) - (vector 'menu-bar (car ev)) - (edmacro-subseq macro (1+ i)))) - (incf i)) - ;; It would be nice to do pop-up menus, too, but not enough - ;; info is recorded in macros to make this possible. - (t - (error "Macros with mouse clicks are not %s" - "supported by this command")))) - (incf i)))) - macro) + (setq macro (nthcdr keysize macro)) + (incf times)))) + (if (or self-insert-p + (null (cdr key)) + (= times 1)) + (callf concat res + (edmacro-format-1 key (if verbose lookup + nil) + times self-insert-p) + (and macro (if verbose "\n" " "))) + (loop + repeat times + do + (callf concat res + (edmacro-format-1 key (if verbose lookup + nil) + 1 self-insert-p) + (and macro (if verbose "\n" " "))))))) + res)) ;;; The following probably ought to go in macros.el: @@ -822,7 +784,7 @@ (let ((keys (where-is-internal macroname))) (while keys (insert (format "(global-set-key %S '%s)\n" (car keys) macroname)) - (setq keys (cdr keys))))))) + (pop keys)))))) (provide 'edmacro)
--- a/lisp/utils/eldoc.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/utils/eldoc.el Mon Aug 13 09:37:19 2007 +0200 @@ -7,7 +7,7 @@ ;; Keywords: extensions ;; Created: 1995-10-06 -;; $Id: eldoc.el,v 1.5 1997/04/19 23:21:17 steve Exp $ +;; $Id: eldoc.el,v 1.6 1997/05/23 01:36:43 steve Exp $ ;; This file is part of GNU Emacs. @@ -106,31 +106,31 @@ ;; No user options below here. -(defvar eldoc-message-commands nil - "Commands after which it is appropriate to print in the echo area. - -Eldoc does not try to print function arglists, etc. after just any command, -because some commands print their own messages in the echo area and these -functions would instantly overwrite them. But self-insert-command as well -as most motion commands are good candidates. - -This variable contains an obarray of symbols; do not manipulate it -directly. Instead, use the functions `eldoc-add-command' and -`eldoc-remove-command'.") +;; Commands after which it is appropriate to print in the echo area. +;; Eldoc does not try to print function arglists, etc. after just any command, +;; because some commands print their own messages in the echo area and these +;; functions would instantly overwrite them. But self-insert-command as well +;; as most motion commands are good candidates. +;; This variable contains an obarray of symbols; do not manipulate it +;; directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'. +(defvar eldoc-message-commands nil) ;; This is used by eldoc-add-command to initialize eldoc-message-commands ;; as an obarray. -;; If you increase the number of buckets, keep it a prime number. -(defconst eldoc-message-commands-table-size 31) +;; It should probably never be necessary to do so, but if you +;; choose to increase the number of buckets, you must do so before loading +;; this file since the obarray is initialized at load time. +;; Remember to keep it a prime number to improve hash performance. +(defvar eldoc-message-commands-table-size 31) ;; Bookkeeping; the car contains the last symbol read from the buffer. ;; The cdr contains the string last displayed in the echo area, so it can ;; be printed again if necessary without reconsing. -(defvar eldoc-last-data '(nil . nil)) +(defvar eldoc-last-data (cons nil nil)) (defvar eldoc-last-message nil) ;; Idle timers are supported in Emacs 19.31 and later. -(defconst eldoc-use-idle-timer-p (fboundp 'run-with-idle-timer)) +(defvar eldoc-use-idle-timer-p (fboundp 'run-with-idle-timer)) ;; eldoc's timer object, if using idle timers (defvar eldoc-timer nil) @@ -394,7 +394,13 @@ (cond ((>= strip len) (format "%s" doc)) (t - (setq name (substring name 0 (- len strip))) + ;;(setq name (substring name 0 (- len strip))) + ;; + ;; Show the end of the partial variable name, + ;; rather than the beginning, since the former + ;; is more likely to be unique given package + ;; namespace conventions. + (setq name (substring name strip)) (format "%s: %s" name doc))))) (t (format "%s: %s" symbol doc)))))))) @@ -417,11 +423,11 @@ ;; The order in this table is significant, since later predicates may be ;; more general than earlier ones. ;; -;; Compiler note for Emacs 19.29 and later: these functions will be -;; compiled to bytecode, but can't be lazy-loaded even if you set -;; byte-compile-dynamic; to do that would require making them named -;; top-level defuns, and that's not particularly desirable either. -(defconst eldoc-function-argstring-from-docstring-method-table +;; Compiler note for Emacs/XEmacs versions which support dynamic loading: +;; these functions will be compiled to bytecode, but can't be lazy-loaded +;; even if you set byte-compile-dynamic; to do that would require making +;; them named top-level defuns, which is not particularly desirable either. +(defvar eldoc-function-argstring-from-docstring-method-table (list ;; Try first searching for args starting with symbol name. ;; This is to avoid matching parenthetical remarks in e.g. sit-for. @@ -437,7 +443,10 @@ ;; Try again not requiring this symbol name in the docstring. ;; This will be the case when looking up aliases. (list (function (lambda (doc fn) - (string-match "^([^\n)]+)$" doc))) + ;; save-restriction has a pathological docstring in + ;; Emacs/XEmacs 19. + (and (not (eq fn 'save-restriction)) + (string-match "^([^\n)]+)$" doc)))) (function (lambda (doc) ;; end does not include trailing ")" sequence. (let ((end (- (match-end 0) 1))) @@ -490,8 +499,7 @@ (function (lambda (doc) (substring doc (match-beginning 1) (match-end 1))))) - ;; These subrs don't have arglists in their docstrings. - ;; This is cheating. + ;; These common subrs don't have arglists in their docstrings. So cheat. (list (function (lambda (doc fn) (memq fn '(and or list + -)))) (function (lambda (doc) @@ -593,8 +601,9 @@ ;; Prime the command list. (eldoc-add-command-completions "backward-" "beginning-of-" "delete-other-windows" "delete-window" - "end-of-" "forward-" "goto-" "mouse-set-point" "next-" "other-window" - "previous-" "recenter" "scroll-" "self-insert-command" "split-window-") + "end-of-" "forward-" "indent-for-tab-command" "goto-" "mouse-set-point" + "next-" "other-window" "previous-" "recenter" "scroll-" + "self-insert-command" "split-window-") (provide 'eldoc)
--- a/lisp/version.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/version.el Mon Aug 13 09:37:19 2007 +0200 @@ -25,7 +25,7 @@ (defconst emacs-version "20.3" "Version numbers of this version of Emacs.") -(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta1)"))) +(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta2)"))) (defconst emacs-major-version (progn (or (string-match "^[0-9]+" emacs-version)
--- a/lisp/x11/x-faces.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/x11/x-faces.el Mon Aug 13 09:37:19 2007 +0200 @@ -3,9 +3,10 @@ ;;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. ;;; Copyright (C) 1995, 1996 Ben Wing. -;; Author: Jamie Zawinski <jwz@netscape.com> -;; Modified by: Chuck Thompson <cthomp@cs.uiuc.edu> -;; Modified by: Ben Wing <wing@spg.amdahl.com> +;; Author: Jamie Zawinski +;; Modified by: Chuck Thompson +;; Modified by: Ben Wing +;; Modified by: Martin Buchholz ;; This file is part of XEmacs.
--- a/lisp/x11/x-menubar.el Mon Aug 13 09:36:20 2007 +0200 +++ b/lisp/x11/x-menubar.el Mon Aug 13 09:37:19 2007 +0200 @@ -536,7 +536,13 @@ (mouse-avoidance-mode 'banish)) (beep) (message "This option requires a window system.")) - :style toggle :selected (and mouse-avoidance-mode window-system)]) + :style toggle :selected (and mouse-avoidance-mode window-system)] + ["strokes-mode" + (if (equal (device-type) 'x) + (strokes-mode) + (beep) + (message "This option requires a window system.")) + :style toggle :selected (and strokes-enabled-p window-system)]) ("Open URLs With" ["Emacs-W3" (setq browse-url-browser-function 'browse-url-w3) :style radio
--- a/lwlib/Makefile.in.in Mon Aug 13 09:36:20 2007 +0200 +++ b/lwlib/Makefile.in.in Mon Aug 13 09:37:19 2007 +0200 @@ -255,7 +255,7 @@ cd energize && $(MAKE) $(MFLAGS) clean #endif distclean: clean - rm -f Makefile Makefile.in .pure + rm -f Makefile Makefile.in config.h .pure realclean: distclean extraclean: distclean -rm -f *~ \#* m/?*~ s/?*~
--- a/man/gnus.texi Mon Aug 13 09:36:20 2007 +0200 +++ b/man/gnus.texi Mon Aug 13 09:37:19 2007 +0200 @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename gnus -@settitle Gnus 5.4.52 Manual +@settitle Gnus 5.4.53 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -287,7 +287,7 @@ @tex @titlepage -@title Gnus 5.4.52 Manual +@title Gnus 5.4.53 Manual @author by Lars Magne Ingebrigtsen @page @@ -323,7 +323,7 @@ spool or your mbox file. All at the same time, if you want to push your luck. -This manual corresponds to Gnus 5.4.52. +This manual corresponds to Gnus 5.4.53. @end ifinfo @@ -1944,7 +1944,8 @@ If the group parameter has an element that looks like @code{(total-expire . t)}, all read articles will be put through the expiry process, even if they are not marked as expirable. Use with -caution. +caution. Unread, ticked and dormant articles are not eligible for +expiry. @item expiry-wait @cindex expiry-wait @@ -2272,10 +2273,10 @@ @item F @kindex F (Group) -@findex gnus-find-new-newsgroups -Find new groups and process them (@code{gnus-find-new-newsgroups}). If -given a prefix, use the @code{ask-server} method to query the server for -new groups. +@findex gnus-group-find-new-groups +Find new groups and process them (@code{gnus-group-find-new-groups}). +If given a prefix, use the @code{ask-server} method to query the server +for new groups. @item C-c C-x @kindex C-c C-x (Group) @@ -2550,6 +2551,12 @@ Copy all groups that match some regular expression to a topic (@code{gnus-topic-copy-matching}). +@item T h +@kindex T h (Topic) +@findex gnus-topic-toggle-display-empty-topics +Toggle hiding empty topics +(@code{gnus-topic-toggle-display-empty-topics}). + @item T # @kindex T # (Topic) @findex gnus-topic-mark-topic @@ -5860,7 +5867,10 @@ @item W W p @kindex W W p (Summary) @findex gnus-article-hide-pgp -Hide @sc{pgp} signatures (@code{gnus-article-hide-pgp}). +@vindex gnus-article-hide-pgp-hook +Hide @sc{pgp} signatures (@code{gnus-article-hide-pgp}). The +@code{gnus-article-hide-pgp-hook} hook will be run after a @sc{pgp} +signature has been hidden. @item W W P @kindex W W P (Summary) @@ -13039,17 +13049,19 @@ @findex gnus-demon-add-handler @lisp -(gnus-demon-add-handler 'gnus-demon-close-connections nil 30) +(gnus-demon-add-handler 'gnus-demon-close-connections 30 t) @end lisp @findex gnus-demon-add-nocem @findex gnus-demon-add-scanmail @findex gnus-demon-add-rescan +@findex gnus-demon-add-scan-timestamps @findex gnus-demon-add-disconnection Some ready-made functions to do this has been created: @code{gnus-demon-add-nocem}, @code{gnus-demon-add-disconnection}, -@code{gnus-demon-add-rescan}, and @code{gnus-demon-add-scanmail}. Just -put those functions in your @file{.gnus} if you want those abilities. +@code{gnus-demon-add-scan-timestamps}, @code{gnus-demon-add-rescan}, and +@code{gnus-demon-add-scanmail}. Just put those functions in your +@file{.gnus} if you want those abilities. @findex gnus-demon-init @findex gnus-demon-cancel @@ -13996,6 +14008,9 @@ Wes Hardaker---@file{gnus-picon.el} and the manual section on @dfn{picons} (@pxref{Picons}). +@item +Kim-Minh Kaplan---further work on the picon code. + @item Brad Miller---@file{gnus-gl.el} and the GroupLens manual section (@pxref{GroupLens}). @@ -14104,7 +14119,6 @@ Rajappa Iyer, Randell Jesup, Fred Johansen, -Kim-Minh Kaplan, Greg Klanderman, Karl Kleinpaste, Peter Skov Knudsen,
--- a/man/message.texi Mon Aug 13 09:36:20 2007 +0200 +++ b/man/message.texi Mon Aug 13 09:37:19 2007 +0200 @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename message -@settitle Message 5.4.52 Manual +@settitle Message 5.4.53 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -39,7 +39,7 @@ @tex @titlepage -@title Message 5.4.52 Manual +@title Message 5.4.53 Manual @author by Lars Magne Ingebrigtsen @page @@ -79,7 +79,7 @@ * Key Index:: List of Message mode keys. @end menu -This manual corresponds to Message 5.4.52. Message is distributed with +This manual corresponds to Message 5.4.53. Message is distributed with the Gnus distribution bearing the same version number as this manual has.
--- a/src/ChangeLog Mon Aug 13 09:36:20 2007 +0200 +++ b/src/ChangeLog Mon Aug 13 09:37:19 2007 +0200 @@ -1,3 +1,39 @@ +1997-05-21 Steven L Baur <steve@altair.xemacs.org> + + * editfns.c (format-time-string): Update DOCstring. Make time + parameter optional. + +Wed May 21 11:58:17 1997 Kyle Jones <kyle@crystal.wonderworks.com> + + * src/insdel.c (signal_first_change): + record the current buffer for the unwind instead of the + buffer that's about to become the current buffer. + +Tue May 20 23:23:39 1997 Steven L Baur <steve@altair.xemacs.org> + + * frame.c: Correct spelling typo in docstring. + +Mon May 19 03:40:46 1997 Kyle Jones <kyle@crystal.WonderWorks.COM> + + * src/redisplay.c: (window_line_number) + don't prefer buffer point value over window point + value unless window, frame, device and console are + all selected. + + * src/redisplay.c: (redisplay_window) + don't prefer buffer point value over window point + value unless window, frame, device and console are + all selected. + + * src/redisplay.c: (create_text_block) + don't prefer buffer point value over window point + value unless window, frame, device and console are + all selected. + +Sun May 18 13:03:50 1997 Steven L Baur <steve@altair.xemacs.org> + + * Makefile.in.in (distclean): remove xemacs-version.h. + Sun May 11 13:38:46 1997 Kyle Jones <kyle@crystal.WonderWorks.COM> * src/frame.c (change_frame_size_1):
--- a/src/Makefile.in.in Mon Aug 13 09:36:20 2007 +0200 +++ b/src/Makefile.in.in Mon Aug 13 09:37:19 2007 +0200 @@ -103,17 +103,6 @@ MAKE = MAKE_COMMAND #endif -/* Some machines do not have the standard C libraries in the usual place. */ -#ifndef ORDINARY_LINK -#ifndef LIB_STANDARD -#define LIB_STANDARD -lc -#endif -#else -#ifndef LIB_STANDARD -#define LIB_STANDARD -#endif -#endif - /* Unless inhibited or changed, use -lg to link for debugging. */ #ifndef LIBS_DEBUG #define LIBS_DEBUG -lg @@ -216,12 +205,11 @@ /* -Demacs is needed to make some files produce the correct version for use in Emacs. */ -src_cppflags=-Demacs -I${srcdir} $(LWLIB_CPPFLAGS) $(CPPFLAGS) -cppflags = -I. $(c_switch_all) $(src_cppflags) +cppflags = $(CPPFLAGS) -Demacs -I. -I${srcdir} $(LWLIB_CPPFLAGS) $(c_switch_all) cflags= $(CFLAGS) $(cppflags) -ldflags = $(ld_switch_all) -L. $(no_gnu_linker) $(LWLIB_LDFLAGS) +ldflags = -L. $(LWLIB_LDFLAGS) $(ld_switch_all) .c.o: $(CC) -c $(cflags) $< @@ -306,14 +294,6 @@ #endif /* ! defined (COFF_ENCAPSULATE) */ #endif /* not ORDINARY_LINK */ -/* Allow config.h to specify a replacement file for unexec.c. */ -#ifndef UNEXEC -#define UNEXEC unexec.o -#endif -#ifndef UNEXEC_SRC -#define UNEXEC_SRC unexec.c -#endif - #ifdef ENERGIZE # ifdef EMACS_BTL BTL_dir=$(srcdir)/../btl @@ -325,15 +305,6 @@ energize_objs = energize.o $(freecheck_objs) #endif /* ENERGIZE */ -#ifdef MOCKLISP_SUPPORT -mocklisp_objs = mocklisp.o -#endif - -#ifdef HAVE_TTY -tty_objs = console-tty.o device-tty.o event-tty.o frame-tty.o \ - objects-tty.o redisplay-tty.o cm.o -#endif - #ifdef HAVE_UNIXOID_EVENT_LOOP event_unixoid_objs = event-unixoid.o #endif @@ -346,57 +317,21 @@ objs = abbrev.o alloc.o blocktype.o buffer.o bytecode.o \ callint.o callproc.o casefiddle.o casetab.o chartab.o \ - cmdloop.o cmds.o console.o console-stream.o data.o \ - device.o dired.o \ - doc.o doprnt.o dynarr.o editfns.o elhash.o emacs.o \ + cmdloop.o cmds.o console.o console-stream.o \ + data.o device.o dired.o doc.o doprnt.o dynarr.o \ + editfns.o elhash.o emacs.o \ $(energize_objs) eval.o events.o $(extra_objs) \ event-stream.o $(event_unixoid_objs) extents.o faces.o \ fileio.o filelock.o filemode.o floatfns.o fns.o font-lock.o \ frame.o general.o getloadavg.o glyphs.o \ $(gui_objs) hash.o indent.o inline.o insdel.o intl.o \ - keymap.o $(RTC_patch_objs) lread.o lstream.o macros.o \ - marker.o md5.o minibuf.o $(mocklisp_objs) \ - objects.o opaque.o \ - print.o process.o profile.o pure.o rangetab.o \ - redisplay.o redisplay-output.o regex.o \ + keymap.o $(RTC_patch_objs) lread.o lstream.o \ + macros.o marker.o md5.o minibuf.o objects.o opaque.o \ + print.o process.o profile.o pure.o \ + rangetab.o redisplay.o redisplay-output.o regex.o \ search.o signal.o sound.o \ - specifier.o strftime.o symbols.o syntax.o \ - sysdep.o $(tty_objs) undo.o \ - UNEXEC $(x_objs) window.o - -/* The following is being done in configure.in now - mrb */ -#undef LIBS_TERMCAP -#define LIBS_TERMCAP -#if 0 -#ifdef HAVE_TTY -# ifdef HAVE_NCURSES -/* If your machine needs -ltermcap, define LIBS_TERMCAP to include - -lncurses -ltermcap in your s or m file (conditionalized on - HAVE_NCURSES). */ -# ifndef LIBS_TERMCAP -# define LIBS_TERMCAP -lncurses -# endif /* LIBS_TERMCAP */ -termcapobjs = terminfo.o -# elif defined (TERMINFO) -/* Used to be -ltermcap here. If your machine needs that, - define LIBS_TERMCAP in the m/<machine>.h file. */ -# ifndef LIBS_TERMCAP -# define LIBS_TERMCAP -lcurses -# endif /* LIBS_TERMCAP */ -termcapobjs = terminfo.o -# else /* ! defined (TERMINFO) */ -# ifndef LIBS_TERMCAP -# define LIBS_TERMCAP -termcapobjs = termcap.o tparam.o -# else /* LIBS_TERMCAP */ -termcapobjs = tparam.o -# endif /* LIBS_TERMCAP */ -# endif /* ! defined (TERMINFO) */ -#else /* !HAVE_TTY */ -# undef LIBS_TERMCAP -# define LIBS_TERMCAP -#endif /* !HAVE_TTY */ -#endif /* 0 */ + specifier.o strftime.o symbols.o syntax.o sysdep.o \ + undo.o $(x_objs) window.o #ifdef REL_ALLOC rallocdocsrc = ralloc.c @@ -476,7 +411,7 @@ /* define otherobjs as list of object files that make-docfile should not be told about. */ -otherobjs = $(termcapobjs) $(BTL_objs) lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs) +otherobjs = $(BTL_objs) lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs) #ifdef LISP_FLOAT_TYPE #define FLOAT_LISP ${lispdir}prim/float-sup.elc @@ -701,9 +636,7 @@ ${lispdir}bytecomp/byte-optimize.elc \ ${lispdir}utils/advice.elc -LIBES = $(LWLIB_LIBS) $(energize_libs) $(quantify_libs) \ - LIBS_DEBUG $(GNULIB_VAR) LIB_STANDARD \ - $(GNULIB_VAR) $(ld_libs_all) +LIBES = $(LWLIB_LIBS) $(quantify_libs) $(ld_libs_all) LIBS_DEBUG $(GNULIB_VAR) /* Enable recompilation of certain other files depending on system type. */ @@ -1040,11 +973,6 @@ @echo "Consult the file \`INSTALL' for instructions for building Emacs." exit 1 -/* Cover your eyes, please */ -xemacs-version.h: ../lisp/version.el - @echo "#define main_1 xemacs_`grep emacs-version ../lisp/version.el | sed -e 's/.*\"\(.*\)\.\(.*\)\"/\1_\2/' -e 1q`_`grep -i xemacs.*lucid.*beta ../lisp/version.el | sed -e 's/.*\(beta[0-9]*\).*/\1/' -e 1q`" > xemacs-version.h - - /* Some machines have alloca built-in. They should define HAVE_ALLOCA, or may just let alloca.s be used but generate no code. @@ -1113,7 +1041,8 @@ /**/# This is used in making a distribution. /**/# Do not use it on development directories! distclean: clean versionclean - rm -f config.h paths.h puresize_adjust.h Emacs.ad.h Makefile Makefile.in .pure version.h + rm -f config.h paths.h puresize_adjust.h Emacs.ad.h \ + rm -f Makefile Makefile.in .pure xemacs-version.h realclean: distclean rm -f TAGS versionclean: @@ -1858,7 +1787,6 @@ emacs.o: sysfile.h emacs.o: systime.h emacs.o: systty.h -emacs.o: xemacs-version.h energize.o: config.h eval.o: backtrace.h eval.o: blocktype.h
--- a/src/callproc.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/callproc.c Mon Aug 13 09:37:19 2007 +0200 @@ -143,12 +143,7 @@ static void report_fork_error (char *string, Lisp_Object data) { - Lisp_Object errstring = build_string (strerror (errno)); - - /* System error messages are capitalized. Downcase the initial. */ - set_string_char (XSTRING (errstring), 0, - DOWNCASE (current_buffer, - string_char (XSTRING (errstring), 0))); + Lisp_Object errstring = lisp_strerror (errno); fork_error = Fcons (build_string (string), Fcons (errstring, data)); @@ -453,7 +448,7 @@ close (fd[0]); if (fd1 >= 0) close (fd1); - report_file_error ("Cannot open", error_file); + report_file_error ("Cannot open", Fcons(error_file, Qnil)); } fork_error = Qnil;
--- a/src/config.h.in Mon Aug 13 09:36:20 2007 +0200 +++ b/src/config.h.in Mon Aug 13 09:37:19 2007 +0200 @@ -228,7 +228,6 @@ #undef NLIST_STRUCT -#undef UNEXEC_SRC #undef AIX_SMT_EXP /* Compile in support for SOCKS? */ @@ -447,6 +446,8 @@ /* The version string from version.el. Used in #pragma ident in emacs.c */ #undef EMACS_VERSION +/* Used to identify the XEmacs version in stack traces. */ +#undef main_1 /* Load in the conversion definitions if this system needs them and the source file being compiled has not
--- a/src/console.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/console.c Mon Aug 13 09:37:19 2007 +0200 @@ -973,6 +973,12 @@ } } init_one_console(c); +#ifdef SIGWINCH + /* The same as in Fsuspend_emacs: it is possible that a size + change occurred while we were suspended. Assume one did just + to be safe. It won't hurt anything if one didn't. */ + asynch_device_change_pending++; +#endif } UNGCPRO;
--- a/src/database.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/database.c Mon Aug 13 09:37:19 2007 +0200 @@ -344,7 +344,7 @@ static Lisp_Object dbm_lasterr (struct database_struct *dbp) { - return Fstrerror (make_int (dbp->dberrno)); + return lisp_strerror (dbp->dberrno); } static void @@ -426,7 +426,7 @@ static Lisp_Object berkdb_lasterr (struct database_struct *dbp) { - return Fstrerror (make_int (dbp->dberrno)); + return lisp_strerror (dbp->dberrno); } static Lisp_Object @@ -539,7 +539,7 @@ struct database_struct *db; if (NILP (obj)) - return Fstrerror (make_int (errno)); + return lisp_strerror (errno); CHECK_DATABASE (obj); db = XDATABASE (obj);
--- a/src/editfns.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/editfns.c Mon Aug 13 09:37:19 2007 +0200 @@ -916,10 +916,11 @@ static long difftm (CONST struct tm *a, CONST struct tm *b); -DEFUN ("format-time-string", Fformat_time_string, 2, 2, 0, /* +DEFUN ("format-time-string", Fformat_time_string, 1, 2, 0, /* Use FORMAT-STRING to format the time TIME. TIME is specified as (HIGH LOW . IGNORED) or (HIGH . LOW), as from -`current-time' and `file-attributes'. +`current-time' and `file-attributes'. If TIME is not specified it +defaults to the current time. FORMAT-STRING may contain %-sequences to substitute parts of the time. %a is replaced by the abbreviated name of the day of week. %A is replaced by the full name of the day of week.
--- a/src/emacs.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/emacs.c Mon Aug 13 09:37:19 2007 +0200 @@ -43,9 +43,6 @@ #include "sysfile.h" #include "systime.h" -/* Hack to get version number in stack backtraces */ -#include "xemacs-version.h" - #if defined (HAVE_LOCALE_H) && \ (defined (I18N2) || defined (I18N3) || defined (I18N4)) #include <locale.h>
--- a/src/emacsfns.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/emacsfns.h Mon Aug 13 09:37:19 2007 +0200 @@ -917,6 +917,7 @@ CONST char *string2, Lisp_Object data1, Lisp_Object data2, Lisp_Object class, Error_behavior errb); +Lisp_Object lisp_strerror (int errnum); Lisp_Object expand_and_dir_to_file (Lisp_Object fn, Lisp_Object def); Lisp_Object Finsert_file_contents_internal (Lisp_Object filename, Lisp_Object visit,
--- a/src/fileio.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/fileio.c Mon Aug 13 09:37:19 2007 +0200 @@ -59,7 +59,7 @@ will create a new file with the same mode as the original */ static int auto_save_mode_bits; -/* Alist of elements (REGEXP . HANDLER) for file names +/* Alist of elements (REGEXP . HANDLER) for file names whose I/O is done with a special handler. */ Lisp_Object Vfile_name_handler_alist; @@ -120,44 +120,22 @@ maybe I'll just always protect current_buffer around all of those calls. */ - /* mrb: #### Needs to be fixed at a lower level; errstring needs to - be MULEized. The following at least prevents a crash... */ - Lisp_Object errstring = build_ext_string (strerror (errno), FORMAT_NATIVE); - - /* System error messages are capitalized. Downcase the initial - unless it is followed by a slash. */ - if (string_char (XSTRING (errstring), 1) != '/') - set_string_char (XSTRING (errstring), 0, - DOWNCASE (current_buffer, - string_char (XSTRING (errstring), 0))); - signal_error (Qfile_error, Fcons (build_translated_string (string), - Fcons (errstring, data))); + Fcons (lisp_strerror (errno), data))); } void maybe_report_file_error (CONST char *string, Lisp_Object data, Lisp_Object class, Error_behavior errb) { - Lisp_Object errstring; - /* Optimization: */ if (ERRB_EQ (errb, ERROR_ME_NOT)) return; - errstring = build_string (strerror (errno)); - - /* System error messages are capitalized. Downcase the initial - unless it is followed by a slash. */ - if (string_char (XSTRING (errstring), 1) != '/') - set_string_char (XSTRING (errstring), 0, - DOWNCASE (current_buffer, - string_char (XSTRING (errstring), 0))); - maybe_signal_error (Qfile_error, Fcons (build_translated_string (string), - Fcons (errstring, data)), + Fcons (lisp_strerror (errno), data)), class, errb); } @@ -212,7 +190,7 @@ Lisp_Object data1, Lisp_Object data2) { signal_error (Qfile_error, - list4 (build_translated_string (string1), + list4 (build_translated_string (string1), build_translated_string (string2), data1, data2)); } @@ -226,12 +204,22 @@ if (ERRB_EQ (errb, ERROR_ME_NOT)) return; maybe_signal_error (Qfile_error, - list4 (build_translated_string (string1), + list4 (build_translated_string (string1), build_translated_string (string2), data1, data2), class, errb); } + +/* Just like strerror(3), except return a lisp string instead of char *. + The string needs to be converted since it may be localized. + Perhaps this should use strerror-coding-system instead? */ +Lisp_Object +lisp_strerror (int errnum) +{ + return build_ext_string (strerror (errnum), FORMAT_NATIVE); +} + static Lisp_Object close_file_unwind (Lisp_Object fd) { @@ -394,7 +382,7 @@ } static Lisp_Object -call3_check_string (Lisp_Object fn, Lisp_Object arg0, +call3_check_string (Lisp_Object fn, Lisp_Object arg0, Lisp_Object arg1, Lisp_Object arg2) { /* This function can call lisp */ @@ -457,7 +445,7 @@ /* On MSDOG we must put the drive letter in by hand. */ res1 = res + 2; #endif /* not WINDOWSNT */ - if (getdefdir (drive + 1, res)) + if (getdefdir (drive + 1, res)) { #ifdef MSDOS res[0] = drive + 'a'; @@ -781,7 +769,7 @@ || (slen > 1 && dst[0] != '/' && dst[slen - 1] == '/')) dst[slen - 1] = 0; #else - if (slen > 1 + if (slen > 1 && IS_DIRECTORY_SEP (dst[slen - 1]) #ifdef DOS_NT && !IS_ANY_SEP (dst[slen - 2]) @@ -861,7 +849,7 @@ Second arg DEFAULT is directory to start with if FILENAME is relative (does not start with slash); if DEFAULT is nil or missing, the current buffer's value of default-directory is used. -Path components that are `.' are removed, and +Path components that are `.' are removed, and path components followed by `..' are removed, along with the `..' itself; note that these simplifications are done without checking the resulting paths in the file system. @@ -873,7 +861,7 @@ { /* This function can GC. GC checked 1997.04.06. */ Bufbyte *nm; - + Bufbyte *newdir, *p, *o; int tlen; Bufbyte *target; @@ -893,7 +881,7 @@ Bufbyte *tmp, *defdir; #endif /* DOS_NT */ Lisp_Object handler; - + CHECK_STRING (name); /* If the file name has special constructs in it, @@ -964,7 +952,7 @@ /* #### dmoore - this is ugly, clean this up. Looks like nm pointing into name should be safe during all of this, though. */ nm = XSTRING_DATA (name); - + #ifdef MSDOS /* First map all backslashes to slashes. */ dostounix_filename (nm = strcpy (alloca (strlen (nm) + 1), nm)); @@ -986,7 +974,7 @@ defdir = alloca (MAXPATHLEN + 1); relpath = getdefdir (tolower (drive) - 'a' + 1, defdir); } - } + } } #endif /* DOS_NT */ @@ -1002,7 +990,7 @@ with the second slash. */ if (IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1]) #if defined (APOLLO) || defined (WINDOWSNT) - /* // at start of filename is meaningful on Apollo + /* // at start of filename is meaningful on Apollo and WindowsNT systems */ && nm != p #endif /* APOLLO || WINDOWSNT */ @@ -1213,7 +1201,7 @@ #ifdef DOS_NT if (newdir == 0 && relpath) - newdir = defdir; + newdir = defdir; #endif /* DOS_NT */ if (newdir != 0) { @@ -1240,7 +1228,7 @@ /* Now concatenate the directory and name to new space in the stack frame */ tlen += strlen ((char *) nm) + 1; #ifdef DOS_NT - /* Add reserved space for drive name. (The Microsoft x86 compiler + /* Add reserved space for drive name. (The Microsoft x86 compiler produces incorrect code if the following two lines are combined.) */ target = (Bufbyte *) alloca (tlen + 2); target += 2; @@ -1320,7 +1308,7 @@ } else if (IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1]) #if defined (APOLLO) || defined (WINDOWSNT) - /* // at start of filename is meaningful in Apollo + /* // at start of filename is meaningful in Apollo and WindowsNT systems */ && o != target #endif /* APOLLO */ @@ -1348,7 +1336,7 @@ while (o != target && (--o) && !IS_DIRECTORY_SEP (*o)) ; #if defined (APOLLO) || defined (WINDOWSNT) - if (o == target + 1 + if (o == target + 1 && IS_DIRECTORY_SEP (o[-1]) && IS_DIRECTORY_SEP (o[0])) ++o; else @@ -1428,10 +1416,10 @@ char path[MAXPATHLEN]; char *p = path; int elen = XSTRING_LENGTH (expanded_name); - + if (elen >= countof (path)) goto toolong; - + memcpy (path, XSTRING_DATA (expanded_name), elen + 1); /* memset (resolved_path, 0, sizeof (resolved_path)); */ @@ -1472,7 +1460,7 @@ if (p) { int plen = elen - (p - path); - + if (rlen > 1 && resolved_path[rlen - 1] == '/') rlen = rlen - 1; @@ -1794,7 +1782,7 @@ ((CONST Bufbyte *) GETTEXT ("File %s already exists; %s anyway? "), Qnil, -1, XSTRING_DATA (absname), GETTEXT (querystring)); - + GCPRO1 (prompt); tem = call1 (Qyes_or_no_p, prompt); UNGCPRO; @@ -1868,9 +1856,9 @@ struct gcpro ngcpro1; int i = 1; - args[0] = newname; + args[0] = newname; args[1] = Qnil; args[2] = Qnil; - NGCPRO1 (*args); + NGCPRO1 (*args); ngcpro1.nvars = 3; if (XSTRING_BYTE (newname, XSTRING_LENGTH (newname) - 1) != '/') args[i++] = build_string ("/"); @@ -2000,7 +1988,7 @@ char dir [MAXPATHLEN]; Lisp_Object handler; struct gcpro gcpro1; - + CHECK_STRING (dirname); dirname = Fexpand_file_name (dirname, Qnil); @@ -2009,7 +1997,7 @@ UNGCPRO; if (!NILP (handler)) return (call2 (handler, Qmake_directory_internal, dirname)); - + if (XSTRING_LENGTH (dirname) > (sizeof (dir) - 1)) { return Fsignal (Qfile_error, @@ -2043,7 +2031,7 @@ /* This function can GC. GC checked 1997.04.06. */ Lisp_Object handler; struct gcpro gcpro1; - + CHECK_STRING (dirname); GCPRO1 (dirname); @@ -2070,7 +2058,7 @@ /* This function can GC. GC checked 1997.04.06. */ Lisp_Object handler; struct gcpro gcpro1; - + CHECK_STRING (filename); filename = Fexpand_file_name (filename, Qnil); @@ -2143,9 +2131,9 @@ struct gcpro ngcpro1; int i = 1; - args[0] = newname; + args[0] = newname; args[1] = Qnil; args[2] = Qnil; - NGCPRO1 (*args); + NGCPRO1 (*args); ngcpro1.nvars = 3; if (XSTRING_BYTE (newname, XSTRING_LENGTH (newname) - 1) != '/') args[i++] = build_string ("/"); @@ -2341,9 +2329,9 @@ (path, login)) { int netresult; - + CHECK_STRING (path); - CHECK_STRING (login); + CHECK_STRING (login); /* netunam, being a strange-o system call only used once, is not encapsulated. */ @@ -2353,7 +2341,7 @@ GET_C_STRING_FILENAME_DATA_ALLOCA (path, path_ext); GET_C_STRING_EXT_DATA_ALLOCA (login, FORMAT_OS, login_ext); - + netresult = netunam (path_ext, login_ext); } @@ -2455,7 +2443,7 @@ Lisp_Object handler; struct stat statbuf; struct gcpro gcpro1; - + CHECK_STRING (filename); abspath = Fexpand_file_name (filename, Qnil); @@ -2484,7 +2472,7 @@ Lisp_Object abspath; Lisp_Object handler; struct gcpro gcpro1; - + CHECK_STRING (filename); abspath = Fexpand_file_name (filename, Qnil); @@ -2511,7 +2499,7 @@ Lisp_Object handler; int desc; struct gcpro gcpro1; - + CHECK_STRING (filename); abspath = Fexpand_file_name (filename, Qnil); @@ -2542,7 +2530,7 @@ Lisp_Object handler; struct stat statbuf; struct gcpro gcpro1; - + CHECK_STRING (filename); abspath = Fexpand_file_name (filename, Qnil); @@ -2590,7 +2578,7 @@ Lisp_Object val; Lisp_Object handler; struct gcpro gcpro1; - + CHECK_STRING (filename); filename = Fexpand_file_name (filename, Qnil); @@ -2639,7 +2627,7 @@ struct stat st; Lisp_Object handler; struct gcpro gcpro1; - + GCPRO1 (current_buffer->directory); abspath = expand_and_dir_to_file (filename, current_buffer->directory); @@ -2723,7 +2711,7 @@ struct stat st; Lisp_Object handler; struct gcpro gcpro1; - + GCPRO1 (current_buffer->directory); abspath = expand_and_dir_to_file (filename, current_buffer->directory); @@ -2757,7 +2745,7 @@ Lisp_Object abspath; Lisp_Object handler; struct gcpro gcpro1; - + GCPRO1 (current_buffer->directory); abspath = Fexpand_file_name (filename, current_buffer->directory); UNGCPRO; @@ -2788,7 +2776,7 @@ (mode)) { CHECK_INT (mode); - + umask ((~ XINT (mode)) & 0777); return Qnil; @@ -2927,7 +2915,7 @@ XSETBUFFER (curbuf, buf); GCPRO5 (filename, val, visit, handler, curbuf); - + mc_count = (NILP (replace)) ? begin_multiple_change (buf, BUF_PT (buf), BUF_PT (buf)) : begin_multiple_change (buf, BUF_BEG (buf), BUF_Z (buf)); @@ -2954,7 +2942,7 @@ if ( (!NILP (beg) || !NILP (end)) && !NILP (visit) ) error ("Attempt to visit less than an entire file"); - + if (!NILP (beg)) CHECK_INT (beg); else @@ -3191,7 +3179,7 @@ QUIT; this_len = Lstream_read (XLSTREAM (stream), read_buf, sizeof (read_buf)); - + if (this_len <= 0) { if (this_len < 0) @@ -3293,7 +3281,7 @@ /* Decode file format */ if (inserted > 0) { - Lisp_Object insval = call3 (Qformat_decode, + Lisp_Object insval = call3 (Qformat_decode, Qnil, make_int (inserted), visit); CHECK_INT (insval); inserted = XINT (insval); @@ -3336,7 +3324,7 @@ /* If build_annotations switched buffers, switch back to BUF. Kill the temporary buffer that was selected in the meantime. */ -static Lisp_Object +static Lisp_Object build_annotations_unwind (Lisp_Object buf) { Lisp_Object tembuf; @@ -3425,7 +3413,7 @@ if (!NILP (handler)) { - Lisp_Object val = call8 (handler, Qwrite_region, start, end, + Lisp_Object val = call8 (handler, Qwrite_region, start, end, filename, append, visit, lockname, codesys); if (visiting) { @@ -3483,8 +3471,8 @@ #ifndef VMS { #ifdef DOS_NT - desc = open ((char *) XSTRING_DATA (fn), - (O_WRONLY | O_TRUNC | O_CREAT | buffer_file_type), + desc = open ((char *) XSTRING_DATA (fn), + (O_WRONLY | O_TRUNC | O_CREAT | buffer_file_type), (S_IREAD | S_IWRITE)); #else /* not DOS_NT */ desc = creat ((char *) XSTRING_DATA (fn), @@ -3672,7 +3660,7 @@ } #endif - /* Spurious "file has changed on disk" warnings have been + /* Spurious "file has changed on disk" warnings have been observed on Suns as well. It seems that `close' can change the modtime, under nfs. @@ -3697,7 +3685,7 @@ XCAR (desc_locative) = Qnil; unbind_to (speccount, Qnil); } - + #ifdef VMS /* If we wrote to a temporary name and had no errors, rename to real name. */ @@ -3705,7 +3693,7 @@ { if (!failure) { - failure = (rename ((char *) XSTRING_DATA (fn), + failure = (rename ((char *) XSTRING_DATA (fn), (char *) XSTRING_DATA (fname)) != 0); save_errno = errno; @@ -3730,8 +3718,8 @@ current_buffer->modtime = st.st_mtime; if (failure) - error ("IO error writing %s: %s", - XSTRING_DATA (fn), + error ("IO error writing %s: %s", + XSTRING_DATA (fn), strerror (save_errno)); if (visiting) @@ -3760,7 +3748,7 @@ if (NILP (fsp)) message ("Wrote %s", XSTRING_DATA (fn)); else - message ("Wrote %s (symlink to %s)", + message ("Wrote %s (symlink to %s)", XSTRING_DATA (fn), XSTRING_DATA (fsp)); UNGCPRO; } @@ -3906,7 +3894,7 @@ { /* Otherwise there is no point to that. Just go in batches. */ int chunk = min (nextpos - pos, A_WRITE_BATCH_SIZE); - + chunk = Lstream_read (instr, largebuf, chunk); if (chunk < 0) return -1; @@ -4092,7 +4080,7 @@ struct stat st; Lisp_Object handler; struct gcpro gcpro1, gcpro2, gcpro3; - + GCPRO3 (filename, time_list, current_buffer->filename); filename = Fexpand_file_name (current_buffer->filename, Qnil); @@ -4111,8 +4099,8 @@ } DEFUN ("set-buffer-modtime", Fset_buffer_modtime, 1, 2, 0, /* -Update BUFFER's recorded modification time from the associated -file's modtime, if there is an associated file. If not, use the +Update BUFFER's recorded modification time from the associated +file's modtime, if there is an associated file. If not, use the current time. In either case, if the optional arg TIME is supplied, it will be used if it is either an integer or a cons of two integers. */ @@ -4133,7 +4121,7 @@ set_time_to_use = 1; } else if ((CONSP (in_time)) && - (INTP (Fcar (in_time))) && + (INTP (Fcar (in_time))) && (INTP (Fcdr (in_time)))) { time_t the_time; @@ -4184,7 +4172,7 @@ } XBUFFER (buf)->modtime = time_to_use; - + return Qnil; } @@ -4356,7 +4344,7 @@ if (!GC_NILP (current_only) && b != current_buffer) continue; - + /* Don't auto-save indirect buffers. The base buffer takes care of it. */ if (b->base_buffer) @@ -4447,7 +4435,7 @@ { Extbyte *auto_save_file_name_ext; Extcount auto_save_file_name_ext_len; - + GET_STRING_FILENAME_DATA_ALLOCA (b->auto_save_file_name, auto_save_file_name_ext, @@ -4456,7 +4444,7 @@ { Extbyte *filename_ext; Extcount filename_ext_len; - + GET_STRING_FILENAME_DATA_ALLOCA (b->filename, filename_ext, filename_ext_len); @@ -4491,7 +4479,7 @@ set_buffer_internal (XBUFFER (old)); auto_saved++; - + /* Handler killed their own buffer! */ if (!BUFFER_LIVE_P(b)) continue;
--- a/src/frame.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/frame.c Mon Aug 13 09:37:19 2007 +0200 @@ -371,7 +371,7 @@ Create a new frame, displaying the current buffer. Optional argument PROPS is a property list (a list of alternating -keyword-value specifcations) of properties for the new frame. +keyword-value specifications) of properties for the new frame. \(An alist is accepted for backward compatibility but should not be passed in.)
--- a/src/getloadavg.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/getloadavg.c Mon Aug 13 09:37:19 2007 +0200 @@ -158,6 +158,9 @@ #if defined (__osf__) && (defined (__alpha) || defined (__alpha__)) #define OSF_ALPHA +#include <netdb.h> +#include <netinet/in.h> /* Needed for Digital UNIX V3 */ +#include <net/proto_net.h> #include <sys/table.h> #endif
--- a/src/insdel.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/insdel.c Mon Aug 13 09:37:19 2007 +0200 @@ -2118,7 +2118,7 @@ { /* This function can GC */ Lisp_Object buffer; - XSETBUFFER (buffer, buf); + XSETBUFFER (buffer, current_buffer); if (!in_first_change) {
--- a/src/m/alpha.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/m/alpha.h Mon Aug 13 09:37:19 2007 +0200 @@ -160,12 +160,6 @@ #ifdef OSF1 #define ORDINARY_LINK -/* Some systems seem to have this, others don't. */ -#ifdef HAVE_LIBDNET -#define LIBS_MACHINE -ldnet -#else -#define LIBS_MACHINE -ldnet_stub -#endif /* HAVE_LIBDNET */ #endif /* OSF1 */ #if 0 /* Rainer Schoepf <schoepf@uni-mainz.de> says this loses with X11R6
--- a/src/m/intel386.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/m/intel386.h Mon Aug 13 09:37:19 2007 +0200 @@ -167,24 +167,6 @@ #endif /* USG */ #endif /* not XENIX */ -#ifdef BSD -#define HAVE_ALLOCA -#endif /* BSD */ - -/* If compiling with GCC, let GCC implement alloca. */ -#if defined(__GNUC__) && !defined(alloca) -#define alloca(n) __builtin_alloca(n) -#define HAVE_ALLOCA -#endif - -/* Solaris defines alloca to __builtin_alloca & doesn't provide a prototype. */ -#ifdef __SUNPRO_C -# ifndef NOT_C_CODE -# include <alloca.h> - void *__builtin_alloca (unsigned int); -# endif /* __SUNPRO_C */ -#endif /* NOT_C_CODE */ - #ifdef USG5_4 #define DATA_SEG_BITS 0x08000000 #endif
--- a/src/m/sparc.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/m/sparc.h Mon Aug 13 09:37:19 2007 +0200 @@ -42,18 +42,6 @@ # endif #endif -#ifdef __GNUC__ -# define C_OPTIMIZE_SWITCH -O -#else -/* XEmacs change */ -# ifdef USE_LCC -# define C_OPTIMIZE_SWITCH -O4 -Oi -# else - /* This level of optimization is reported to work. */ -# define C_OPTIMIZE_SWITCH -O2 -# endif -#endif - /* XINT must explicitly sign-extend */ #define EXPLICIT_SIGN_EXTEND @@ -66,31 +54,10 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Must use the system's termcap, if we use any termcap. - It does special things. */ - -#ifndef LIBS_TERMCAP -#ifndef TERMINFO -#define LIBS_TERMCAP -ltermcap -#endif -#endif - /* Mask for address bits within a memory segment */ #define SEGMENT_MASK (SEGSIZ - 1) -/* Arrange to link with sun windows, if requested. */ -/* For details on emacstool and sunfns, see etc/SUN-SUPPORT */ -/* These programs require Sun UNIX 4.2 Release 3.2 or greater */ - -#ifdef HAVE_SUN_WINDOWS -#define OTHER_FILES ${etcdir}emacstool -#define LIBS_MACHINE -lsuntool -lsunwindow -lpixrect -#define OBJECTS_MACHINE sunfns.o -#define SYMS_MACHINE syms_of_sunfns () -#define SYSTEM_PURESIZE_EXTRA 10000 -#endif - #ifndef __NetBSD__ #ifndef __linux__ /* This really belongs in s/sun.h. */
--- a/src/mule-wnnfns.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/mule-wnnfns.c Mon Aug 13 09:37:19 2007 +0200 @@ -268,11 +268,12 @@ #include "buffer.h" #include "window.h" +#include "sysdep.h" -#include "commonhd.h" +#include "wnn/commonhd.h" #include "mule-charset.h" -#include "jllib.h" -#include "cplib.h" +#include "wnn/jllib.h" +#include "wnn/cplib.h" /* UCHAR $B$,Fs=EDj5A$5$l$k$N$G(B */ #define _UCHAR_T @@ -284,6 +285,7 @@ #define WNNSERVER_T 2 #define WNNSERVER_K 3 +int check_wnn_server_type (void); void w2m (w_char *wp, unsigned char *mp, unsigned char lb); void m2w (unsigned char *mp, w_char *wp); void w2y (w_char *w);
--- a/src/redisplay.c Mon Aug 13 09:36:20 2007 +0200 +++ b/src/redisplay.c Mon Aug 13 09:37:19 2007 +0200 @@ -1910,7 +1910,10 @@ } else if (MINI_WINDOW_P (w) && !active_minibuffer) data.cursor_type = NO_CURSOR; - else if (w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d)))) + else if (w == XWINDOW (FRAME_SELECTED_WINDOW (f)) && + EQ(DEVICE_CONSOLE(d), Vselected_console) && + d == XDEVICE(CONSOLE_SELECTED_DEVICE(XCONSOLE(DEVICE_CONSOLE(d))))&& + f == XFRAME(DEVICE_SELECTED_FRAME(d))) { data.bi_cursor_bufpos = BI_BUF_PT (b); data.cursor_type = CURSOR_ON; @@ -4931,7 +4934,8 @@ int echo_active = 0; int startp = 1; int pointm; - int selected; + int selected_in_its_frame; + int selected_globally; int skip_output = 0; int truncation_changed; int inactive_minibuffer = @@ -4958,9 +4962,13 @@ } /* Is this window the selected window on its frame? */ - selected = - (w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d)))); - if (skip_selected && selected) + selected_in_its_frame = (w == XWINDOW (FRAME_SELECTED_WINDOW (f))); + selected_globally = + selected_in_its_frame && + EQ(DEVICE_CONSOLE(d), Vselected_console) && + XDEVICE(CONSOLE_SELECTED_DEVICE(XCONSOLE(DEVICE_CONSOLE(d)))) == d && + XFRAME(DEVICE_SELECTED_FRAME(d)) == f; + if (skip_selected && selected_in_its_frame) return; /* It is possible that the window is not fully initialized yet. */ @@ -4979,7 +4987,7 @@ pointm = 1; else { - if (selected) + if (selected_globally) { pointm = BUF_PT (b); } @@ -5051,7 +5059,7 @@ { pointm = point_at_center (w, DESIRED_DISP, 0, 0); - if (selected) + if (selected_globally) BUF_SET_PT (b, pointm); Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm), @@ -5079,7 +5087,7 @@ /* Check if the cursor has actually moved. */ if (EQ (Fmarker_buffer (w->last_point[CURRENT_DISP]), w->buffer) && pointm == marker_position (w->last_point[CURRENT_DISP]) - && selected + && selected_globally && !w->windows_changed && !f->clip_changed && !f->extents_changed @@ -5119,7 +5127,7 @@ goto regeneration_done; } } - else if (!selected && !f->point_changed) + else if (!selected_in_its_frame && !f->point_changed) { if (f->modeline_changed) regenerate_modeline (w); @@ -5679,7 +5687,10 @@ struct device *d = XDEVICE (XFRAME (w->frame)->device); struct buffer *b = XBUFFER (w->buffer); Bufpos end = - ((w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d)))) + (((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)) ? BUF_PT (b) : marker_position (w->pointm[type])); int lots = 999999999;
--- a/src/s/aix4.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/aix4.h Mon Aug 13 09:37:19 2007 +0200 @@ -6,6 +6,3 @@ /* AIX 4 does not have HFT any more. */ #undef AIXHFT - -/* realpath is broken */ -#undef HAVE_REALPATH
--- a/src/s/decosf3-1.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/decosf3-1.h Mon Aug 13 09:37:19 2007 +0200 @@ -18,6 +18,8 @@ /* XEmacs: from Stephen Carney <carney@gvc.dec.com> */ /* #### why the hell is configure so broken on this system? */ -#define HAVE_SELECT +#ifndef HAVE_SELECT +#define HAVE_SELECT 1 +#endif #define BROKEN_SIGIO
--- a/src/s/decosf4-0.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/decosf4-0.h Mon Aug 13 09:37:19 2007 +0200 @@ -31,8 +31,4 @@ #define HAVE_RENAME #endif -/* Digital Unix 4.0 has a realpath, but it's buggy. And I - *do* mean buggy. */ -#undef HAVE_REALPATH - #define LIBS_DEBUG
--- a/src/s/freebsd.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/freebsd.h Mon Aug 13 09:37:19 2007 +0200 @@ -10,16 +10,6 @@ #define NO_SHARED_LIBS #endif -#if 0 /* This much, alone, seemed sufficient as of 19.23. - But it seems better to be independent of netbsd.h. */ -#include "netbsd.h" - -#undef LIB_GCC -#define LIB_GCC -lgcc -#undef NEED_ERRNO -#endif /* 0 */ - - /* Get most of the stuff from bsd4.3 */ #include "bsd4-3.h" @@ -42,12 +32,8 @@ #else #define LIBS_SYSTEM -lutil #endif -/* XEmacs change: */ -#ifdef HAVE_NCURSES -#define LIBS_TERMCAP -lncurses -ltermcap -#else + #define LIBS_TERMCAP -ltermcap -#endif #define LIB_GCC -lgcc /* freebsd has POSIX-style pgrp behavior. */
--- a/src/s/hpux10.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/hpux10.h Mon Aug 13 09:37:19 2007 +0200 @@ -13,24 +13,7 @@ #undef srand48 #undef HAVE_RANDOM #define HPUX10 -#define FORCE_ALLOCA_H /* AlainF 20-Jul-1996 -- fixes for 10.10, untested for 10.0x */ /* Fix kernel file name for 10.10 */ #undef KERNEL_FILE #define KERNEL_FILE "/stand/vmunix" -/* The curses library seems to have a badly broken version of select(2) - that makes "poll: interrupted system call" messages to appear and - Emacs suprocesses to hang (e.g. TeX compilation w/ AUCTeX) */ -#undef LIBS_TERMCAP -#define LIBS_TERMCAP -ltermcap -/* 10.10 has Xmu in /usr/contrib/X11R5/lib */ -#ifndef HAVE_LIBXMU -#undef C_SWITCH_X_SYSTEM -#define C_SWITCH_X_SYSTEM -I/usr/include/X11R5 -I/usr/include/Motif1.2 -I/usr/contrib/include/X11R5 -#undef LD_SWITCH_X_DEFAULT -#define LD_SWITCH_X_DEFAULT -L/usr/lib/X11R5 -L/usr/lib/Motif1.2 -L/usr/contrib/lib/X11R5 -#undef LIBXMU -#define LIBXMU -lXmu -#define HAVE_LIBXMU 1 -#undef NO_EDITRES -#endif
--- a/src/s/linux.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/linux.h Mon Aug 13 09:37:19 2007 +0200 @@ -86,13 +86,6 @@ /* #define LINUX_LDAV_FILE "/proc/loadavg" */ -/* XEmacs change: The realpath() in linux's libc (4.6.27) sometimes - * fails with ELOOP erroneously. For example, create a file - * thirty-five or so directories deep and call realpath on it. You - * get ELOOP even if no symlinks at all are involved. - * -dkindred@cs.cmu.edu */ -#undef HAVE_REALPATH - /* This is needed for dispnew.c:update_frame */ #ifdef emacs @@ -146,9 +139,7 @@ /* Best not to include -lg, unless it is last on the command line */ #define LIBS_DEBUG -#ifndef HAVE_NCURSES /* XEmacs change */ #define LIBS_TERMCAP -ltermcap -lcurses /* save some space with shared libs*/ -#endif #ifndef __ELF__ #define LIB_STANDARD -lc /* avoid -lPW */ #else @@ -182,9 +173,6 @@ #define C_SWITCH_SYSTEM -DFUNCPROTO=11 -DNARROWPROTO -D_BSD_SOURCE #endif -/* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */ -#define LIB_MOTIF -lXm -lXpm - /* XEmacs change: configure doesn't find this because math.h aliases rint to __rint so that it's not found. */ #define HAVE_RINT 1
--- a/src/s/netbsd.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/netbsd.h Mon Aug 13 09:37:19 2007 +0200 @@ -29,11 +29,7 @@ /* -lutil is not needed for NetBSD >0.9. */ /* #define LIBS_SYSTEM -lutil */ /* XEmacs change */ -#ifdef HAVE_NCURSES -#define LIBS_TERMCAP -lncurses -ltermcap -#else #define LIBS_TERMCAP -ltermcap -#endif #define NEED_ERRNO
--- a/src/s/sol2-3.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/sol2-3.h Mon Aug 13 09:37:19 2007 +0200 @@ -4,42 +4,3 @@ /* Solaris 2.3 has a bug in XListFontsWithInfo. */ #define BROKEN_XLISTFONTSWITHINFO - -#if 0 /* RMSmacs */ -/* Unless this proves necessary, I'm going to leave it out. --ben - Also see comment in sol2.h about LD_SWITCH_X_SITE_AUX. */ -/* Override LD_SWITCH_SYSTEM: add -L /usr/ccs/lib to the sol2.h value. */ - -#undef LD_SWITCH_SYSTEM - -#ifndef __GNUC__ -#define LD_SWITCH_SYSTEM -L /usr/ccs/lib LD_SWITCH_X_SITE_AUX -#else /* GCC */ -/* We use ./prefix-args because we don't know whether LD_SWITCH_X_SITE_AUX - has anything in it. It can be empty. - This works ok in src. Luckily lib-src does not use LD_SWITCH_SYSTEM. */ -#define LD_SWITCH_SYSTEM -L /usr/ccs/lib \ - `./prefix-args -Xlinker LD_SWITCH_X_SITE_AUX` -#endif /* GCC */ -#endif /* 0 */ - -/* Motif is an optional package for Solaris 2.3. The standard location is - /usr/dt/lib, but it may have been installed in /opt/SUNWspro/lib when - SPARCworks was installed. For Solaris 2.4 and beyond, the default location - is /usr/dt/lib. This "-R" definition allows an XEmacs built on Solaris 2.3 - to run on 2.3 and beyond at the cost of some extra, bound-to-fail searches - in either /usr/dt/lib or /opt/SUNWspro/lib. - - Even though /usr/lib is automatically appended to the -R search path, we - include it at the begining of the search path to speed up the entire - process. "ldd xemacs" shows that there are 9 libraries found in /usr/lib, - 4 in /usr/openwin/lib and only 1 in /usr/dt/lib or /opt/SUNWspro/lib. - -- vladimir@Eng.Sun.COM -*/ - -#ifdef LD_SWITCH_SYSTEM -#undef LD_SWITCH_SYSTEM -#endif -#define LD_SWITCH_SYSTEM -R/usr/lib:/usr/openwin/lib:/usr/dt/lib:/opt/SUNWspro/lib - -/* XEmacs: remove unnecessary signal stuff */
--- a/src/s/sol2-4.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/sol2-4.h Mon Aug 13 09:37:19 2007 +0200 @@ -4,38 +4,6 @@ #include "sol2-3.h" -#define SOLARIS2_4 - -#if 0 /* FSFmacs */ - -/* Get rid of -traditional and let const really do its thing. */ - -#ifdef __GNUC__ -#undef C_SWITCH_SYSTEM -#undef const -#endif /* __GNUC__ */ -#endif /* 0 */ - -#undef LD_SWITCH_SYSTEM -#undef C_SWITCH_SYSTEM - -#if 0 /* mrb */ -#undef LD_SWITCH_SYSTEM -#ifndef __GNUC__ -#define LD_SWITCH_SYSTEM -L /usr/ccs/lib LD_SWITCH_X_SITE_AUX -R /usr/openwin/lib -L /usr/openwin/lib -R /usr/dt/lib -L /usr/dt/lib -#else /* GCC */ -/* We use ./prefix-args because we don't know whether LD_SWITCH_X_SITE_AUX - has anything in it. It can be empty. - This works ok in src. Luckily lib-src does not use LD_SWITCH_SYSTEM. */ -#define LD_SWITCH_SYSTEM -L /usr/ccs/lib \ - `./prefix-args -Xlinker LD_SWITCH_X_SITE_AUX` -R /usr/openwin/lib -L /usr/openwin/lib -R /usr/dt/lib -L /usr/dt/lib -#endif /* GCC */ - -/* Gregory Neil Shapiro <gshapiro@hhmi.org> reports the Motif header files - are in this directory on Solaris 2.4. */ -#define C_SWITCH_X_SYSTEM -I/usr/dt/include -#endif - /* XEmacs addition: Raymond Toy says XEmacs completely misses SIGCHLD when compiled with GCC 2.7.0 (but not, apparently, with SunPro C?), X11R6, and Solaris 2.4.
--- a/src/s/sol2.h Mon Aug 13 09:36:20 2007 +0200 +++ b/src/s/sol2.h Mon Aug 13 09:37:19 2007 +0200 @@ -23,6 +23,8 @@ supposed to only be in the BSD compat stuff. Yuck. Of course, there isn't a prototype for it other than in /usr/ucbinclude. */ int gethostname (char *, size_t); +/* Another missing prototype, added in Solaris 2.5 */ +extern void *__builtin_alloca(size_t); /* Get non-ANSI functions from ANSI header files in cc -Xc mode. Sun has promised to fix setjmp.h */ @@ -43,31 +45,11 @@ #include <limits.h> #endif /* C_CODE */ -/* XEmacs change -- removed flags to force K & R compilation */ - -/* - * XEmacs change -- some Motif packages need -lgen to get regex and regcmp - */ +/* XEmacs change -- some Motif packages need -lgen to get regex and regcmp */ #undef LIBS_SYSTEM #define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen -ldl -/* XEmacs change -- Mark Borges says this is needed. */ -#define LIBS_TERMCAP -ltermlib - -/* #### XEmacs change: until we've gotten the Energize builds converted - over to use configure instead of ymakefile, we still need this. - */ -#if defined (NOT_C_CODE) && defined (ENERGIZE) - -# define LIBS_DEBUG -# undef LIBS_SYSTEM -# define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen -ldl -# define START_FILES -# define LD_CMD $(CC) - -#endif - /* SYSTEM_MALLOC must be defined if dbx/RTC is going to be used. dbx/RTC does not work with a static definition of malloc(). */ /* We want to be able to test out ralloc.c. */ @@ -81,8 +63,8 @@ */ /* XEmacs change from Georg.Nikodym@Canada.Sun.COM. */ -#ifdef UNEXEC -#undef UNEXEC +#ifdef UNEXEC +#undef UNEXEC #endif #define UNEXEC unexsol2.o