cvs server: Diffing . Index: CHANGES-beta =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/CHANGES-beta,v retrieving revision 1.210 retrieving revision 1.211 diff -u -r1.210 -r1.211 --- CHANGES-beta 16 Feb 2003 06:13:17 -0000 1.210 +++ CHANGES-beta 24 Apr 2003 23:41:31 -0000 1.211 @@ -1,3 +1,113 @@ +to 21.5.12 "carrot" + +Lots of updates, fixes, and features from Ben Wing (he never stops). +Also, a lot of work has gone into cleaning up the test suite. Thanks +to Steve Turnbull, Jerry James, Daiki Ueno because now all tests from +'make check' pass 100% (at least on GNU/Linux). + +Here are the highlights: + +Build + +-- Updates to configure.in - Steuck, James, Skyttä, Wing. +-- Major updates to Makefile.in.in - Wing. +-- Allow for separate build and source directories - Wing. +-- Fix some compiler warnings - Wing. +-- Major clean up of xemacs.mak and friends - Wing, Aichner. +-- Fix some Solaris 2.7 CC compiler warnings - Persico. +-- Fix for building on Mac - Palmer. +-- Work around a problem compiling with '--use-union-type' on Intel's + ICC compiler - Buchholz. +-- Fix problems with rel-alloc compilation - Wing. +-- Sequentialize dependencies even more in update-elc-2 - Sperber. +-- Don't fatal() in 'report_sheap_usage' when need to rerun Make - + Wing. +-- Various updates to the test suite - Turnbull. + +Documentation + +-- Updates to + INSTALL - Turnbull, Wing. + PROBLEMS - Turnbull, Wing. +-- Global substition of .Xresources for .Xdefaults - Turnbull. +-- Update packages in ./etc/BETA - Skyttä. +-- Doc string updates - Korytov, Turnbull, Wing. +-- TeXinfo updates - Aichner, Turnbull, Wing, Youngs. + +Internals + +-- Fix stale match data after failed search bug - Turnbull. +-- Reformat function definitions correctly in menubar-gtk.c and + event-gtk.c - Turnbull. +-- Fix bug matching ASCII character classes to Mule characters - + Ueno. +-- Frame updates for MS Win - Alexander. +-- Add .dylib as an acceptable shared library file extension to + support MacOS X - Begel. +-- Fix bug in database.c for Berkdb 4.1 - Turnbull. +-- Regex fixes - Turnbull, Wing. +-- Coding system updates - Wing. +-- Add clear-left-side functionality in print.c - Wing. +-- Seg fault rather than abort on Cygwin in 'assert_failed' - Wing. +-- Delete popup-data object - Wing. +-- Delete menubar_data field from frames - Wing. +-- Clean up handling of lwlib callback data GCPRO'ing - Wing. +-- Use ALLOCA() in regex.c to avoid excessive stack allocation - + Wing. +-- Fix subtle problem with REL_ALLOC() - Wing. +-- Change *run_hook*_trapping_problems to take a warning class, not a + string - Wing. +-- Mule-ize encrypt/decrypt-string code - Wing. +-- Delete all support for bit-rotten CANNOT_DUMP - Wing. +-- Fix crash due to attempt to free objects across dump/undump - + Wing. +-- Don't get in an infinite loop running post-redisplay actions - + Wing. +-- Make gc_currently_forbidden static - Wing. +-- Defer redrawing if already in redisplay - Wing. +-- Add debug code for locking a dynarr to catch invalid mods - Wing. +-- Ensure that various glyph functions that eval within redisplay + protect the evals - Wing. +-- Defer specifier-changed updating till after redisplay - Wing. +-- Require that every place inside of redisplay catch errors itself - + Wing. +-- Introduce separate means of holding frame-size changes - Wing. +-- Introduce "post-redisplay" methods for deferring things till after + redisplay - Wing. +-- Disable all quit checking in redisplay - Wing. +-- Use _wexecve() when under Windows NT for Unicode correctness - + Wing. +-- Update list of possibly valid console types - Wing. +-- Turn on Vstack_trace_on_error 'Frun_emacs_from_temacs' so that + errors are debuggable even when occurring extremely early in + reinitialization - Wing. +-- Define new function `emacs-run-status' - Wing. +-- Fix crash caused by an edge condition in the syntax-cache macros - + Wing. +-- Eliminate HAVE_WIN32_CODING_SYSTEMS, use WIN32_ANY instead - Wing. +-- Don't check_quit() unless we're unbinding a real Lisp + `unwind-protect' - Wing. +-- Make absolutely sure there is no quit checking while we are in a + "critical section" during frame deletion - Wing. + +Lisp API + +-- Fix infloop in font-lock for java files - Choi. +-- Fix split-string - Turnbull. +-- Support '(filename)nodename' as argument to 'info' - Steib. +-- Major clean up of the PUI code - Youngs. +-- Use 'equal' instead of '=' in 'saved-window-equal' - James. +-- Updates to wid-edit.el - Turnbull. +-- Better layout for Tools -> Packages -> Download Site menu - + Aichner. +-- More sites added to packages download sites menu - Aichner. +-- Byte-compiler warning clean up and lots of synching with FSF 21.2 + code - Wing. +-- Move lots of high-level code for computing paths into + setup-paths.el from various places - Wing. +-- Mule and coding system updates - Wing, Turnbull. + + to 21.5.11 "cabbage" Lots of improvements and fixes this time around. One of our key Index: ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/ChangeLog,v retrieving revision 1.349 retrieving revision 1.360 diff -u -r1.349 -r1.360 --- ChangeLog 16 Feb 2003 06:13:17 -0000 1.349 +++ ChangeLog 24 Apr 2003 23:41:31 -0000 1.360 @@ -1,3 +1,91 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-04-24 Steve Youngs + + * configure.in: Fix for building on openbsd. + From Gregory Steuck + + * configure: Regenerate + +2003-03-27 Stephen J. Turnbull + + * PROBLEMS: Global substitution of .Xresources for .Xdefaults. + +2003-03-25 Jerry James + + * configure.in: Add Andrew Begel's shared library support for + MacOS X. + +2003-03-18 Stephen J. Turnbull + + * INSTALL: Give location of Darwin X11 downloads. + +2003-02-09 Ville Skyttä + + * configure: Remove pkgdir and all references to it (unused). + * configure.in: Ditto. + * Makefile.in.in: Ditto. + +2003-03-03 Stephen J. Turnbull + + * INSTALL: Reorganize, synch to configure.usage. + +2003-03-01 Ben Wing + + * PROBLEMS: + * PROBLEMS (Note): + * PROBLEMS (http): + * PROBLEMS (IMPORTANT): + Include nt/PROBLEMS and update. Add note about incremental + linking badness. + +2003-02-28 Ben Wing + + * Makefile.in.in (mostlyclean): + * Makefile.in.in (clean): + * Makefile.in.in (top_distclean): + * Makefile.in.in (distclean): + Move src deletions to src/Makefile.in.in. + +2003-02-20 Ben Wing + + * PROBLEMS: + * PROBLEMS (event-stream.c): Removed. + * PROBLEMS (ABSTRACT): + * PROBLEMS (patch.): + * PROBLEMS (Note): + Add comment about Cygwin, unexec and sysmalloc. + Move some non-general stuff out of general. + Make a section for x86. + + * configure.in (AC_INIT_NOTICE): + * configure.in (XE_COMPUTE_RUNPATH): + Add check for broken alloca in funcalls. + +2003-02-19 Ben Wing + + * Makefile.in.in: + * Makefile.in.in (GENERATED_HEADERS): + * Makefile.in.in (GENERATED_LISP): Removed. + * Makefile.in.in (.NO_PARALLEL): + * Makefile.in.in (beta): + * Makefile.in.in (dist): + * Makefile.in.in (batch): Removed. + * Makefile.in.in (batch_packages): Removed. + * Makefile.in.in (check): New. + * Makefile.in.in (finder): Removed. + * Makefile.in.in (check-features): New. + * Makefile.in.in (.PHONY): + * Makefile.in.in (install-only): + * Makefile.in.in (tagslisp): + * Makefile.in.in (info): + Major surgery. Move all stuff related to building anything in the + src/ directory into src/. Simplify the dependencies -- everything + in src/ is dependent on the single entry `src' in MAKE_SUBDIRS. + Remove weirdo targets like `all-elc[s]', dump-elc[s], etc. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. Index: INSTALL =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/INSTALL,v retrieving revision 1.37 retrieving revision 1.39 diff -u -r1.37 -r1.39 --- INSTALL 10 Feb 2003 14:28:09 -0000 1.37 +++ INSTALL 24 Mar 2003 14:13:40 -0000 1.39 @@ -1,6 +1,7 @@ XEmacs Installation Guide + Copyright (c) 1994, 1995, 1996 Board of Trustees, University of Illinois -Copyright (c) 1994-1999 Free Software Foundation, Inc. +Copyright (c) 1994-1999, 2003 Free Software Foundation, Inc. Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the @@ -15,6 +16,7 @@ and that any new or changed statements about the activities of the Free Software Foundation are approved by the Foundation. +Last modified by Stephen J. Turnbull 2003-02-12 BUILDING AND INSTALLATION FOR UNIX AND CYGWIN @@ -25,8 +27,9 @@ Make sure your system has enough swapping space allocated to handle a program whose pure code is 900k bytes and whose data area is at least -400k and can reach 8Mb or more. Note that a typical XEmacs build is -much bigger. If the swapping space is insufficient, you will get an +400k and can reach 8Mb or more. Note that a typical XEmacs process +can get much bigger: the instance this sentence was written with is +over 100MB! If the swapping space is insufficient, you will get an error in the command `temacs -batch -l loadup dump', found in `./src/Makefile.in.in', or possibly when running the final dumped XEmacs. @@ -36,54 +39,96 @@ MacOS/X (Darwin), it's 512kB. See 'PROBLEMS' for details. Building XEmacs requires about 100 Mb of disk space (including the -XEmacs sources). Once installed, XEmacs occupies between 20 and 100 Mb -in the file system where it is installed; this includes the executable files, -Lisp libraries, miscellaneous data files, and on-line documentation. The -exact amount depends greatly on the number of extra lisp packages that are -installed +XEmacs sources). Once installed, XEmacs occupies between 20 and 100 +MB in the file system where it is installed; this includes the +executable files, Lisp libraries, miscellaneous data files, and +on-line documentation. The exact amount depends greatly on the number +of extra Lisp packages that are installed. XEmacs requires an ANSI C compiler, such as GCC. If you wish to build the documentation yourself, you will need at least version 1.68 of makeinfo (GNU texinfo-3.11). GNU Texinfo 4.2 is recommended; it is -necessary for building packages, and we may move to it for the core. +necessary for building Lisp packages, and we may move to it for the core. + +A note on terminology: unfortunately the terms "library" and "package" +are heavily overloaded. In the following, "library" refers to an +external body of executable code which may be linked with XEmacs at +build time to provide support for system features, such as images, +audio, stream compression, databases, and input methods. A "Lisp +library" is a file of Lisp code which may be loaded into XEmacs at +run-time to provide editor features. A "package" is a specially +prepared Lisp library or set of Lisp libraries, providing for easy +installation, upgrade, and removal of applications written in Lisp. + +PACKAGE SYSTEM +============== + +The file README.packages contain information vital to have a fully +working XEmacs. It includes a description of available packages, and +how to bootstrap XEmacs from a minimal or a complete set of packages. +This information was not included in this file only because it is too +large for this terse INSTALL. Please read README.packages now! ADD-ON LIBRARIES ================ -Decide on what other software packages you would like to use with -XEmacs, but are not yet available on your system. On some systems, -Motif and CDE are optional additions. On Solaris, the SUNWaudmo -package enables native sound support. There are also a number of free -software packages that XEmacs can use. If these are not yet available -on your system, obtain, build and install those external packages -before building XEmacs. The packages XEmacs can use are: +Decide which libraries you would like to use with XEmacs, but are not +yet available on your system. On some systems, X11, Motif and CDE are +optional additions. On MacOS/X systems, you may download X11R6 for +Mac OS X from http://www.apple.com/macosx/x11/download/. You need +both the runtime libraries and the SDK (in a sidebar of that page at +the time of writing). There is also a 3rd-party implementation of +X11R6 for the Mac at http://www.xdarwin.org/. On Solaris, the +SUNWaudmo package enables native sound support. There are also a +number of free software applications that XEmacs can use. If these +are not yet available on your system, obtain, build and install those +external libraries before building XEmacs. The libraries XEmacs can +use are: Xaw3d, XPM, JPEG, compface, PNG, zlib, GNU DBM, Berkeley DB, socks, - term, NAS, Canna, Kinput2, SJ3, Wnn. + term, NAS, Canna, Kinput2, SJ3, Wnn, PostgreSQL, LDAP. -You can get (most of) them from the XEmacs ftp site at -ftp://ftp.xemacs.org/pub/xemacs/aux - -If you want users on other systems to be able to use the XEmacs you -have built, try to build those packages so that the generated -libraries are statically linked. - -Use the --site-includes and --site-libraries options when building -XEmacs to allow configure to find the external software packages. -If you link with dynamic (``.so'') external package libraries, which -is not recommended, you will also need to add the library directories -to the --site-runtime-libraries option. For your convenience these can -be set together by using the --with-site-prefix command. This will set -these variables as needed assuming your libraries are organised as a -typical /usr tree. - -PACKAGE SYSTEM -============== +You can get (most of) them from the XEmacs FTP archive at +. Information about what +each library does is available in the file +. + +Use the `--site-includes' and `--site-libraries' options when building +XEmacs to allow configure to find the external software packages. For +your convenience these can be set together by using the +`--with-site-prefix' option. This will set these variables as needed +assuming your libraries are organised as a typical /usr tree. + +If you link dynamically with external libraries, usually denoted by +".so" (Unix), ".dll" (Windows), or ".dylib" (MacOS) file extensions, +on some systems you may also need to add the library directories to +the `--site-runtime-libraries' option. It is typically necessary only +if you link with dynamic libraries that are installed in non-standard +directories, or if you expect some of the libraries used to build +XEmacs to be in a different directory at run time than at build time. -The file README.packages contain information vital to have a fully -working XEmacs. This information was not included in this file only -because it is too large for this terse INSTALL. Please read -README.packages now! +NOTE: This option has unusual semantics. ONLY libraries found in the +directories specified in this option will be used at runtime. This +means you must specify ALL directories you want searched at runtime in +this option (perhaps excluding a very small number of standard system +library paths). + +Directories specified with `--site-libraries' are NOT automatically +added. The rationale is that most users will not need this option, +and this allows the builder to specify exactly the needed directories. +Specifying unnecessary directories leads to obscure problems +(typically startup delays) if those directories are mounted over a +network, and the automounter configuration changes. Not all systems +need this option; it's best to avoid using it if you can. + +Dynamic linking has pros and cons. Dynamically linking 3rd party +libraries to XEmacs decreases the size of the binary, and means you +don't need to rebuild XEmacs to take advantage of improvements in the +libraries. On the other hand, XEmacs can fail subtly if the semantics +of a library changes, other users may not be able to use your +"private" copies of the libraries, and you may have to relink XEmacs, +or even omit the feature, if the ABI changes when the libraries are +upgraded. CONFIGURATION OPTIONS ===================== @@ -93,6 +138,9 @@ ./configure [CONFIGURATION-NAME] [--OPTION[=VALUE]] ... +Controlling the Host Type +------------------------- + Almost always, you should let `configure' (actually the shell script `config.guess') guess your host type, by omitting the CONFIGURATION-NAME argument. If you like to experiment, specify a @@ -104,67 +152,54 @@ VENDOR, and OPSYS. Also check `./etc/MACHINES' for advice on building on particular machines. -If you don't want X support, specify `--without-x'. If you omit this -option, `configure' will try to autodetect whether your system has X, -and arrange to use it if present. - -The `--x-includes=DIR' and `--x-libraries=DIR' options tell the build -process where the compiler should look for the include files and -object libraries used with the X Window System. Normally, `configure' -is able to find them; these options are necessary if you have your X -Window System files installed in unusual places. +Specifying Location of Headers and Libraries +-------------------------------------------- The `--site-includes=DIR' and `--site-libraries=DIR' options allow you to specify additional places the compiler should look for include files and object libraries. You may specify multiple DIR's by -enclosing the list in quotes. All the external packages you want to +enclosing the list in quotes. All the external libraries you want to use with XEmacs (e.g. xpm, wnn, ...) described later should have their include and library directories defined using these options. The `--site-runtime-libraries=DIR' option specifies directories to -search for shared libraries at run time. This may be necessary if you -link with dynamic libraries that are installed in non-standard -directories, or if you expect some of the libraries used to build -XEmacs to be in a different directory at run time than at build time. -Usually this will add a `-R' to each directory specified and use that -when linking XEmacs. If you use this option, you must specify ALL of -the directories containing shared libraries at run time, including -system directories. - -Rationale: Some people think that directories in --site-libraries -should be automatically used to update --site-runtime-libraries. -Here's a real-life scenario that explains why this is not done: You -build binaries for your company using static libs in -/net/toy/hack/lib. XEmacs adds /net/toy/hack/lib to the runpath of -the executable you've built. Since there are only static libs there, -the system runtime loader will look in this dir, and ignore it, -causing only a .01 second delay in starting XEmacs. You leave the -company for a job at a small Silicon Valley startup. Time passes. -The next guy who inherits your machine objects to working on a machine -named `toy', and gets the sysadmin to rename the machine `godzilla'. -The SA forgets to remove the old entry for `toy' from the hosts file. -Now the system loader will still try to access /net/toy/, and the -automounter will hang trying to access /net/toy. XEmacs suddenly -takes 30 seconds longer to start up, no one can figure out why, and -everyone at your old company curses your name, thinking that you've -put a time bomb into XEmacs. And they're right! - -The `--with-gcc' option specifies that the build process should -compile XEmacs using GCC. The `--compiler' option allows you to -specify some other compiler to be used to compile XEmacs. If neither -option is specified, the environment variable CC is used instead. -Otherwise the compiler will then default to 'cc'. - -The `--cflags' option specifies the CFLAGS the build process should -use when compiling XEmacs. Otherwise the value of the environment -variable CFLAGS is consulted. If that is also undefined, CFLAGS -defaults to "-g -O" for gcc and "-g" for all other compilers. - -The xemacs executable can be built using a C++ compiler. However, -because configure and programs in lib-src require a C compiler, two -compilers must be used at different times during the build process. -Use something like `configure --compiler=gcc --xemacs-compiler=g++'. -This option is intended for use by the maintainers. +search for shared libraries at run time. If you use this option, you +must specify ALL of the directories containing shared libraries at run +time, including system directories. Please read the information about +"ADD-ON LIBRARIES" above very carefully. + +The `--x-includes=DIR' and `--x-libraries=DIR' options tell the build +process where the compiler should look for the include files and +object libraries used with the X Window System. Normally, `configure' +is able to find them; these options are necessary if you have your X +Window System files installed in unusual places. + +Configuring the Build Process +----------------------------- + +The `--with-gcc=PROGRAM' option specifies that the build process +should compile XEmacs using GCC. The `--compiler' option allows you +to specify some other compiler to be used to compile XEmacs. If +neither option is specified, the environment variable CC is used +instead. Otherwise the compiler will then default to 'cc'. + +The `--xemacs-compiler=PROGRAM' option specifies the compiler control +program for the xemacs binary only. Other C code will be compiled +according to the `--with-gcc' and `--compiler' options above. This is +useful if you wish to compile XEmacs with a C++ compiler, because the +utilities in ./lib-src cannot be compiled as C++. This option is +primarily intended for use by the maintainers. + +The `--cflags=FLAGS' option specifies all of the CFLAGS the build process +should use when compiling XEmacs, except for flags controlling warning +generation. Otherwise the value of the environment variable CFLAGS is +consulted. If that is also undefined, CFLAGS defaults to "-g -O" for +gcc and "-g" for all other compilers. + +The `--cflags_warning=FLAGS' option specifies the warnings to be +generated. There is normally no reason to use this flag, as XEmacs +turns on as many warnings as possible, and is still expected to build +with no, or at most a few warnings. The `--dynamic' option specifies that configure should try to link emacs dynamically rather than statically. @@ -174,7 +209,12 @@ supports the `VPATH' variable, such as GNU `make'. Create separate build directories for the different configuration types, and in each one, run the XEmacs `configure' script. `configure' looks for the -Emacs source code in the directory that `configure' is in. +Emacs source code in the directory that `configure' is in. The +`--srcdir' option may not work correctly (traditionally it was +overridden by the directory containing `configure'). + +Configuring the Installation Layout +----------------------------------- The `--prefix=PREFIXDIR' option specifies where the installation process should put XEmacs and its data files. This defaults to `/usr/local'. @@ -197,7 +237,7 @@ If you specify --prefix (or any of the other installation directory options), they will get compiled into the xemacs executable so it will -be able to find its various associated file. However, XEmacs has +be able to find its various associated files. However, XEmacs has quite elaborate logic to find out the locations of these directories dynamically. Sometimes, it is desirable *not* to compile these directories into the executable so you can move the XEmacs @@ -207,6 +247,16 @@ part of the generated executable; everything else will continue to work as usual. +Configuring Feature Support +--------------------------- + +If you don't want X Window System support, specify `--without-x'. If +you omit this option, `configure' will try to autodetect whether your +system has X Window System support, and arrange to use it if present. + +The `--without-xmu' option can be used if your vendor doesn't ship +the Xmu library. + The `--with-menubars=TYPE' option allows you to specify which X toolkit you wish to use for the menubar. The valid options are `lucid', `motif' and `no'. The default is `lucid' which is a @@ -229,8 +279,8 @@ in. The `--with-toolbars' option allows you to enable or disable toolbar -support. The default is `yes' as long as support for a windowing -system is included. +support. The default is `yes' if support for a windowing system is +included. The `--with-xpm' option specifies that XEmacs should support X11 Pixmaps. `configure' will attempt to detect if you have the Xpm @@ -241,14 +291,42 @@ library and define `--with-xface' for you. The `--with-database' option specifies that XEmacs should be built -with additional database support. The valid options are `no' or a +with simple database support. The valid options are `no' or a comma-separated list of one or more of `dbm', `gnudbm' or `berkdb'. `configure' will attempt to detect the necessary libraries and header files and define `--with-database' for you. +The `--with-postgresql' option specifies that XEmacs should be built +with PostgreSQL support, linking with libpq. `configure' will attempt +to detect whether PostgreSQL support is available, and automatically +define `--with-postgresql' for you. + +The `--with-ldap' option specifies that XEmacs should be build with +LDAP support, using the OpenLDAP libraries. `configure' will attempt +to detect whether LDAP support is available, and automatically define +`--with-ldap' for you. + The `--with-socks' option specifies that XEmacs should be built with SOCKS support. This requires the libsocks library. +The `--external-widget' option specifies that XEmacs should be built +with support for being used as a widget by other X11 applications. +This functionality should be considered beta. + +The `--with-sound=TYPE' option specifies that XEmacs should be built +with sound support. Native (`--with-sound=native') sound support is +currently available only on Sun SparcStations, SGI's, HP9000s, and +systems (such as Linux) with soundcard.h. Network Audio Support (NAS) +(`--with-sound=nas' or `--with-sound=both') is an extension to X that +you may or may not have for your system. For NAS, you will probably +need to provide the paths to the nas include and library directories +to configure. If `--with-sound' is not specified, `configure' will +attempt to determine if your configuration supports native sound and +define --with-sound for you. If your native sound library is not in a +standard location you can specify it with the `--native-sound-lib=LIB' +flag. For Linux, `/dev/audio' is required for SunAudio files and +`/dev/dsp' is required for raw data and WAVE format files. + The `--with-tooltalk' option specifies that XEmacs should be built with ToolTalk support for interconnecting with other applications. ToolTalk is not yet supported on all architectures. If you use this @@ -270,66 +348,18 @@ X11 support is available, then this option defaults to `yes'. OffiX support can be explicitly disabled via the `--with-offix=no' option. -The `--external-widget' option specifies that XEmacs should be built -with support for being used as a widget by other X11 applications. -This functionality should be considered beta. - -The `--without-xmu' option can be used if your vendor doesn't ship -the Xmu library. - -The `--with-sound=TYPE' option specifies that XEmacs should be built -with sound support. Native (`--with-sound=native') sound support is -currently available only on Sun SparcStations, SGI's, HP9000s, and -systems (such as Linux) with soundcard.h. Network Audio Support (NAS) -(`--with-sound=nas' or `--with-sound=both') is an extension to X that -you may or may not have for your system. For NAS, you will probably -need to provide the paths to the nas include and library directories -to configure. If `--with-sound' is not specified, `configure' will -attempt to determine if your configuration supports native sound and -define --with-sound for you. If your native sound library is not in a -standard location you can specify it with the `--native-sound-lib=LIB' -flag. For Linux, `/dev/audio' is required for SunAudio files and -`/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. 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' implementation 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 `--with-system-malloc' option can be use to either enable or -disable use of the system malloc. Generally, it's best to go with the -default configuration for your system. Note that on many systems -using the system malloc disables the use of the relocating allocator. +Internationalization Options +---------------------------- -The `--with-debug-malloc' option can be used to link a special debugging -version of malloc. Debug Malloc is not included with XEmacs, is -intended for use only by the developers and may be obtained from -. - -The `--debug' and `--error-checking' options are primarily useful to the -developers. `--debug' incorporates code for performing various tests, -but does not impose a speed penalty. `--error-checking' adds additional -tests to many of the commonly used macros, and imposes a speed penalty. -Neither is especially useful in most common debugging situations. - -The `--verbose' and `--extra-verbose' options are intended for use -only by the developers. `--verbose' causes the results of all -configure tests to be displayed. `--extra-verbose' displays -additional information, useful for debugging. Another help for -determining configure failures is the file `config.log', which -contains the results of the compile and link tests used by configure. - -The `--with-mule' option enables (MUlti-Lingual Emacs) support, needed -to support non-Latin-1 (including Asian) languages. Mule support is -required for Asian language and Unicode (multibyte and wide character) -support. With the advent of the Euro and European Community -expansion, Mule support is also recommended for Western Europeans. -Enabling Mule support requires the mule-base package installed prior -to building XEmacs. The following options require Mule support: +The `--with-mule' option enables MUlti-Lingual Emacs (Mule) support, +needed to support non-Latin-1 (including Asian) languages. Mule +support is required for Asian language and Unicode (multibyte and wide +character) support. With the advent of the Euro and European +Community expansion, Mule support is also recommended for Western +Europeans. Enabling Mule support requires the mule-base package +installed prior to building XEmacs. The `--with-xim', --with-xfs', +`--with-canna', `--with-wnn' and `--with-wnn6' options require +Mule support. 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 @@ -376,6 +406,40 @@ `--with-xim', `--with-canna' and `--with-wnn' as your system supports. +Options for Developers and Special Requirements +----------------------------------------------- + +The `--rel-alloc' option can be used to either enable or disable use +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' implementation 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 `--with-system-malloc' option can be used to either enable or +disable use of the system malloc. Generally, it's best to go with the +default configuration for your system. Note that on many systems +using the system malloc disables the use of the relocating allocator. + +The `--with-debug-malloc' option can be used to link a special +debugging version of malloc. Debug Malloc is not included with XEmacs +and is intended for use only by the developers. It may be obtained +from . + +The `--debug' and `--error-checking' options are primarily useful to +the developers. `--debug' incorporates code for performing various +tests, but does not impose a speed penalty. `--error-checking' adds +additional tests to many of the commonly used macros, and imposes a +speed penalty. Using either or both of these options can make bug +reports more useful to the developers. + +The `--verbose' and `--extra-verbose' options are useful only to the +developers. `--verbose' causes the results of all configure tests to +be displayed. `--extra-verbose' displays additional information, +useful for debugging `configure'. + MAIL LOCKING ============ @@ -383,7 +447,7 @@ method for locking mail spool files preconfigured. Otherwise you must find out for youself. Do not choose a locking protocol "on the objective merits." XEmacs must use the same method as other mail -utilities on your system, or you will lose mail. +utilities on your system, or you WILL lose mail. Presently, XEmacs supports lockf, flock, and dot locking. Specify the locking method via the --mail-locking=METHOD option to configure. @@ -395,12 +459,14 @@ `configure' doesn't do any compilation or installation itself. It just creates the files that influence those things: `./src/config.h', -and all the Makefile's in the build tree. +and all the Makefiles in the build tree. When it is done, `configure' prints a description of what it did and creates a shell script `config.status' which, when run, recreates the same configuration. If `configure' exits with an error after -disturbing the status quo, it removes `config.status'. +disturbing the status quo, it removes `config.status'. If `configure' +doesn't work as expected, the file `config.log' contains details of +the tests run and their results. AUXILIARY PATHS =============== @@ -459,16 +525,14 @@ Run `make' in the top directory of the XEmacs distribution to finish building XEmacs in the standard way. The final executable file is -named `src/emacs'. You can execute this file "in place" without +named `src/xemacs'. You can execute this file in place without copying it, if you wish; then it automatically uses the sibling directories ../lisp, ../lib-src, ../info. -Or you can "install" the executable and the other XEmacs into their -installed locations, with `make install'. By default, XEmacs's files +Or you can install the executable and the other XEmacs into their +permanent locations, with `make install'. By default, XEmacs's files are installed in the following directories: -By default, XEmacs installs its files in the following directories: - `/usr/local/bin' holds the executable programs users normally run - `xemacs', `etags', `ctags', `b2m', `emacsclient', `ellcc', `gnuclient', `gnudoit', `gnuattach', and `rcs-checkin'. @@ -574,7 +638,7 @@ We create the following subdirectories under `libdir': - `xemacs-VERSION/CONFIGURATION-NAME', containing executable programs used by XEmacs that users are not expected to run - themselves and the DOC file. + themselves, and the DOC file. `VERSION' is the number of the XEmacs version you are installing, and `CONFIGURATION-NAME' is the host type of your system. Since these files are specific to the version of XEmacs, @@ -702,8 +766,8 @@ PROBLEMS ======== -The most likely problem is that you forgot to read and follow the -directions in README.packages. You can not have a working XEmacs +The most common problem is that you forgot to read and follow the +directions in README.packages. You can not have a normal XEmacs without downloading some additional packages. See the file PROBLEMS in this directory for a list of various problems Index: Makefile.in.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/Makefile.in.in,v retrieving revision 1.12 retrieving revision 1.15 diff -u -r1.12 -r1.15 --- Makefile.in.in 15 Feb 2003 10:16:14 -0000 1.12 +++ Makefile.in.in 9 Mar 2003 17:23:54 -0000 1.15 @@ -1,3 +1,5 @@ +## Copyright (C) 2003 Ben Wing. + ## DIST: This is the distribution Makefile for XEmacs. configure can ## DIST: make most of the changes to this file you might want, so try ## DIST: that first. @@ -118,9 +120,6 @@ ## ${lispdir} and ${etcdir} are subdirectories of this. datadir=@datadir@ -## Where to find XEmacs packages. -pkgdir=@pkgdir@ - ## Where to install and expect the files that XEmacs modifies as it runs. ## These files are all architecture-independent. Right now, the ## only such data is the locking directory; @@ -240,25 +239,25 @@ COPYDIR = ${srcdir}/etc ${srcdir}/lisp COPYDESTS = ${etcdir} ${lispdir} GENERATED_HEADERS = src/paths.h src/Emacs.ad.h src/config.h lwlib/config.h src/sheap-adjust.h -GENERATED_LISP = lisp/finder-inf.el -all: Makefile ${PROGNAME} all-elc info - -${PROGNAME}: ${GENERATED_HEADERS} ${MAKE_SUBDIR} ${GENERATED_LISP} +## MAKE_SUBDIR will always be of the form lib-src ... src, where +## `...' includes various other directories that may be inserted by +## configure. +all: Makefile ${GENERATED_HEADERS} ${MAKE_SUBDIR} info ## For performance and consistency, no built-in rules .SUFFIXES: -.NO_PARALLEL: ${GENERATED_HEADERS} ${MAKE_SUBDIR} dump-elcs -.PHONY: ${SUBDIR} all beta all-elc all-elcs dump-elc dump-elcs finder +.NO_PARALLEL: ${GENERATED_HEADERS} ${MAKE_SUBDIR} +.PHONY: ${SUBDIR} all beta ## Convenience target for XEmacs beta testers -beta: clean all-elc finder info +beta: clean all ## Convenience target for XEmacs maintainers ## This would run `make-xemacsdist' if I were really confident that everything ## was turnkey. -dist: all-elc info +dist: all ## Convenience target for XEmacs maintainers ## Updates some rarely generated files: @@ -278,34 +277,11 @@ depend ${srcdir}/src/depend: cd ./src && $(RECURSIVE_MAKE) depend -batch = -no-packages -batch -batch_packages = -vanilla -batch +check: + cd ./src && $(RECURSIVE_MAKE) $@ -## Build XEmacs and recompile out-of-date and missing .elc files along -## the way. -all-elc all-elcs: lib-src lwlib dump-elcs src - ${blddir}/src/${PROGNAME} ${batch} \ - -no-autoloads -l update-elc-2.el -f batch-update-elc-2 lisp - -## Sub-target for all-elc. -dump-elc dump-elcs: ${GENERATED_HEADERS} FRC.dump-elcs - cd ./src && $(RECURSIVE_MAKE) dump-elcs - -finder: src - @echo "Building finder database ..." - @(cd ./lisp; \ - ${blddir}/src/${PROGNAME} ${batch} \ - -eval '(setq finder-compile-keywords-quiet t)' \ - -l finder -f finder-compile-keywords ) - @echo "Building finder database ...(done)" - -lisp/finder-inf.el: - @echo "Building finder database ..." - @(cd ./lisp; \ - ${blddir}/src/${PROGNAME} ${batch} \ - -eval '(setq finder-compile-keywords-quiet t)' \ - -l finder -f finder-compile-keywords ) - @echo "Building finder database ...(done)" +check-features: all + cd ./src && $(RECURSIVE_MAKE) $@ ## We have to force the building of Emacs.ad.h as well in order to get it ## updated correctly when VPATH is being used. Since we use move-if-change, @@ -371,7 +347,7 @@ ## On Xenix, use tar xpf. .PHONY: install-only install install-arch-dep install-arch-indep gzip.el mkdir -.PHONY: check-features +.PHONY: check check-features ## We delete each directory in ${COPYDESTS} before we copy into it; ## that way, we can reinstall over directories that have been put in @@ -387,9 +363,6 @@ ## inconsistency in the build process. So we go ahead and depend on ## all. --cet -check-features: all - ${blddir}/src/${PROGNAME} ${batch} -l check-features.el - install-only: ${MAKE_SUBDIR} check-features install-arch-dep install-arch-indep install: all check-features install-arch-dep install-arch-indep @@ -496,7 +469,7 @@ ## make-path instead of mkdir. Not all mkdirs have the `-p' flag. mkdir: FRC.mkdir ${MAKEPATH} ${COPYDESTS} ${docdir} ${infodir} ${archlibdir} \ - ${mandir} ${bindir} ${datadir} ${libdir} ${pkgdir} \ + ${mandir} ${bindir} ${datadir} ${libdir} \ #ifdef HAVE_SHLIB ${moduledir} ${sitemoduledir} \ #endif @@ -546,6 +519,7 @@ ## is rarely necessary and takes a lot of time. mostlyclean: FRC.mostlyclean for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + $(RM) core ## `clean' ## Delete all files from the current directory that are normally @@ -555,16 +529,8 @@ ## with them. ## Delete `.dvi' files here if they are not part of the distribution. - -## Remove the generated load files here; they cause lots of problems -## when they don't work right. (beta can't depend on distclean, which -## removes necessary files generated by configure.) clean: FRC.clean for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done - $(RM) core lisp/auto-autoloads.el* lisp/custom-load.el* - $(RM) lisp/mule/auto-autoloads.el* lisp/mule/custom-load.el* - $(RM) ${srcdir}/modules/auto-autoloads.el* - $(RM) ${srcdir}/modules/custom-load.el* ## `distclean' ## Delete all files from the current directory that are created by @@ -574,7 +540,7 @@ ## distribution. top_distclean=\ $(RM) config.status config.log confdefs.h config-tmp-* build-install Installation ; \ - $(RM) core .sbinit lock/* GNUmakefile Makefile Makefile.in ; \ + $(RM) TAGS .sbinit lock/* GNUmakefile Makefile Makefile.in ; \ $(RM) lisp/finder-inf.el* Installation.el Installation.elc ; \ $(RM) -r site-packages xemacs-packages mule-packages site-lisp @@ -620,7 +586,7 @@ SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in.in PROBLEMS \ README build-install.in configure make-dist move-if-change -.PHONY: unlock relock TAGS tags check dist info dvi mcs +.PHONY: unlock relock TAGS tags dist info dvi mcs unlock: chmod u+w $(SOURCES) cpp/* @@ -650,9 +616,6 @@ xargs etags -a -r '/[ ]*DEF\(VAR\|INE\)_[A-Z_]+[ ]*([ ]*"\([^"]+\)"/\2/'; \ find ${tagslisp} ${PRUNE_VC} -name '*.el' ! -name 'auto-autoloads.el' -print | \ xargs etags -a -l none -r "/^(def\\(var\\|un\\|alias\\|const\\|macro\\|subst\\|struct\\|face\\|group\\|custom\\|ine-\\(function\\|compiler-macro\\|[a-z-]+alias\\)\\)[ ]+'?\\([^ ]+\\)/\\3/" - -check: - cd ./src && $(RECURSIVE_MAKE) $@ info: FRC.info cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ Index: PROBLEMS =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/PROBLEMS,v retrieving revision 1.63 retrieving revision 1.66 diff -u -r1.63 -r1.66 --- PROBLEMS 31 Jan 2003 12:14:00 -0000 1.63 +++ PROBLEMS 27 Mar 2003 12:57:37 -0000 1.66 @@ -2,7 +2,7 @@ This file describes various problems that have been encountered in compiling, installing and running XEmacs. It has been updated for -XEmacs 21.4. +XEmacs 21.5. This file is rather large, but we have tried to sort the entries by their respective relevance for XEmacs, but may have not succeeded @@ -60,55 +60,6 @@ link with it, you need the headers---and distros don't provide them with the libraries. You need the additional "development" package, too. -*** Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures -without also using `-fno-schedule-insns'. - -gcc will generate incorrect code otherwise, typically resulting in -crashes in the function skip-syntax-backward. - -*** egcs-1.1 - -There have been reports of egcs-1.1 not compiling XEmacs correctly on -Alpha Linux. There have also been reports that egcs-1.0.3a is O.K. - -*** Don't use -O2 or -O3 with Cygwin 1.0, CodeFusion-99070 or gcc 2.7.2 on x86 -without also using `-fno-strength-reduce'. - -gcc will generate incorrect code otherwise. This bug is present in at -least 2.6.x and 2.7.[0-2]. This bug has been fixed in GCC 2.7.2.1 and -later. This bug is O/S independent, but is limited to x86 architectures. - -This problem is known to be fixed in egcs (or pgcc) 1.0 or later. - -Unfortunately, later releases of Cygnus-released compilers (not the -Net-released ones) have a bug with the same `problem signature'. - -If you're lucky, you'll get an error while compiling that looks like: - -event-stream.c:3189: internal error--unrecognizable insn: -(insn 256 14 15 (set (reg/v:SI 24) - (minus:SI (reg/v:SI 25) - (const_int 2))) -1 (insn_list 11 (nil)) - (nil)) - 0 0 [main] - -If you're unlucky, your code will simply execute incorrectly. - -*** Don't use gcc-2.95.2 with -mcpu=ultrasparc on Solaris 2.6. - -gcc will assume a 64-bit operating system, even though you've -merely told it to assume a 64-bit instruction set. - -*** Don't use -O2 with gcc 2.7.2 under Intel architectures without also -using `-fno-caller-saves'. - -gcc will generate incorrect code otherwise. This bug is still -present in gcc 2.7.2.3. There have been no reports to indicate the -bug is present in egcs 1.0 (or pgcc 1.0) or later. This bug is O/S -independent, but limited to x86 architectures. - -This problem is known to be fixed in egcs (or pgcc) 1.0 or later. - *** When using gcc, you get the error message "undefined symbol __fixunsdfsi". When using gcc, you get the error message "undefined symbol __main". @@ -163,6 +114,41 @@ This will rebuild all the needed .elc files. +** Intel Architecture General + +*** Don't use -O2 or -O3 with Cygwin 1.0, CodeFusion-99070 or gcc 2.7.2 on x86 +without also using `-fno-strength-reduce'. + +gcc will generate incorrect code otherwise. This bug is present in at +least 2.6.x and 2.7.[0-2]. This bug has been fixed in GCC 2.7.2.1 and +later. This bug is O/S independent, but is limited to x86 architectures. + +This problem is known to be fixed in egcs (or pgcc) 1.0 or later. + +Unfortunately, later releases of Cygnus-released compilers (not the +Net-released ones) have a bug with the same `problem signature'. + +If you're lucky, you'll get an error while compiling that looks like: + +event-stream.c:3189: internal error--unrecognizable insn: +(insn 256 14 15 (set (reg/v:SI 24) + (minus:SI (reg/v:SI 25) + (const_int 2))) -1 (insn_list 11 (nil)) + (nil)) + 0 0 [main] + +If you're unlucky, your code will simply execute incorrectly. + +*** Don't use -O2 with gcc 2.7.2 under Intel architectures without also +using `-fno-caller-saves'. + +gcc will generate incorrect code otherwise. This bug is still +present in gcc 2.7.2.3. There have been no reports to indicate the +bug is present in egcs 1.0 (or pgcc 1.0) or later. This bug is O/S +independent, but limited to x86 architectures. + +This problem is known to be fixed in egcs (or pgcc) 1.0 or later. + *** `compress' and `uncompress' not found and XFree86 XFree86 installs a very old version of libz.a by default ahead of where @@ -360,6 +346,17 @@ ** SunOS/Solaris +*** Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures +without also using `-fno-schedule-insns'. + +gcc will generate incorrect code otherwise, typically resulting in +crashes in the function skip-syntax-backward. + +*** Don't use gcc-2.95.2 with -mcpu=ultrasparc on Solaris 2.6. + +gcc will assume a 64-bit operating system, even though you've +merely told it to assume a 64-bit instruction set. + *** Dumping error when using GNU binutils / GNU ld on a Sun. Errors similar to the following: @@ -480,6 +477,14 @@ broken. Use the ones in /usr/openwin/{include,lib} instead. ** Linux + +See also Intel Architecture General, above. + +*** egcs-1.1 on Alpha Linux + +There have been reports of egcs-1.1 not compiling XEmacs correctly on +Alpha Linux. There have also been reports that egcs-1.0.3a is O.K. + *** Under Linux, you get "too many arguments to function `getpgrp'". You have probably installed LessTiff under `/usr/local' and `libXm.so' @@ -733,8 +738,31 @@ Note: Much of the above entry is probably not valid for XEmacs 21.0 and later. +** Windows + +*** Weird crashes in pdump load or shortly after pdump load. + +This can happen with incremental linking. Check if you have set +SUPPORT_EDIT_AND_CONTINUE to non-zero in config.inc, which must allow +incremental linking to be enabled (otherwise it's disabled). Either turn +this off, execute `nmake -f xemacs.mak clean', or manually remove +`temacs.exe' and `xemacs.exe'. + ** Cygwin +See also Intel Architecture General, above. + +*** Signal 11 when building or running a dumped XEmacs. + +This appears to happen when using the traditional dumping mechanism and +the system malloc. Andy Piper writes: + + Traditional dumping on Cygwin relies on using gmalloc (there are specific + hacks in our version of gmalloc to support this), I suspect using sysmalloc + is the problem. + +Try configuring with pdump or without system malloc. + *** In general use etc/check_cygwin_setup.sh to trap environment problems. The script etc/check_cygwin_setup.sh will attempt to detect whether @@ -744,10 +772,12 @@ *** Syntax errors running configure scripts, make failing with exit code 127 in inexplicable situations, etc. -This may be because you are using the default cygwin shell. The -default cygwin shell (/bin/sh.exe) is ash which appears to work in -most circumstances but has some weird failure modes. You need to -replace the symlink with bash.exe. +[[ This may be because you are using the default Cygwin shell, under old +versions of Cygwin. The default Cygwin shell (/bin/sh.exe) is ash, which +appears to work in most circumstances but has some weird failure modes. +You may need to replace the symlink with bash.exe. ]] This doesn't appear +to affect Cygwin any longer, and /bin/sh.exe is no longer a symlink in +any case. *** Lots of compile errors, esp. on lines containing macro definitions terminated by backslashes. @@ -768,8 +798,8 @@ *** The info files will not build. -makeinfo that ships with Cygwin (all versions) doesn't work. You need to -obtain makeinfo from somewhere or build it yourself. +makeinfo that ships with old versions of Cygwin doesn't work. +Upgrade to the latest Cygwin version. *** XEmacs hangs while attempting to rebuild the .elc files. @@ -780,33 +810,27 @@ *** Trying to build with X, but X11 not detected. This is usually because xmkmf is not in your path or because you are -using the default cygwin shell. (See above.) +using the default Cygwin shell. (See above.) * Problems with running XEmacs ============================== ** General -*** At startup I get a warning on stderr about missing charsets: - - Warning: Missing charsets in String to FontSet conversion - -You need to specify appropriate charsets for your locale (usually the -value of the LANG environment variable) in .Xresources. See -etc/Emacs.ad for the relevant resources (mostly menubar fonts and -fontsets). Do not edit this file, it's purely informative. -If you have no satisfactory fonts for iso-8859-1, XEmacs will crash. +*** Changes made to .el files do not take effect. -It looks like XFree86 4.x (the usual server on Linux and *BSD) has -some braindamage where .UTF-8 locales will always generate this -message, because the XFree86 (font)server doesn't know that UTF-8 will -use the ISO10646-1 font registry (or a Cmap or something). +You may have forgotten to recompile them into .elc files. Then the +old .elc files will be loaded, and your changes will not be seen. To +fix this, do `M-x byte-recompile-directory' and specify the directory +that contains the Lisp files. -If you are not using a .UTF-8 locale and see this warning for a -character set not listed in the default in Emacs.ad, please let -xemacs-beta@xemacs.org know about it, so we can add fonts to the -appropriate fontsets and stifle this warning. (Unfortunately it's -buried in Xlib, so we can't easily get rid of it otherwise.) +Note that you will get a warning when loading a .elc file that is +older than the corresponding .el file. + +*** VM appears to hang in large folders. + +This is normal (trust us) when upgrading to VM-6.22 from earlier +versions. Let VM finish what it is doing and all will be well. *** Starting with 21.4.x, killing text is absurdly slow. @@ -833,11 +857,7 @@ You can defeat the use of TMPDIR by unsetting USE_TMPDIR at the top of gnuserv.h at build time. -*** C-z just refreshes the screen instead of suspending Emacs. - -You are probably using a shell that doesn't support job control, even -though the system itself is capable of it. Try using a different -shell. +** General Unix *** You type Control-H (Backspace) expecting to delete characters. @@ -860,6 +880,28 @@ (global-set-key "\M-?" 'help-command) +*** At startup I get a warning on stderr about missing charsets: + + Warning: Missing charsets in String to FontSet conversion + +You need to specify appropriate charsets for your locale (usually the +value of the LANG environment variable) in .Xresources. See +etc/Emacs.ad for the relevant resources (mostly menubar fonts and +fontsets). Do not edit this file, it's purely informative. + +If you have no satisfactory fonts for iso-8859-1, XEmacs will crash. + +It looks like XFree86 4.x (the usual server on Linux and *BSD) has +some braindamage where .UTF-8 locales will always generate this +message, because the XFree86 (font)server doesn't know that UTF-8 will +use the ISO10646-1 font registry (or a Cmap or something). + +If you are not using a .UTF-8 locale and see this warning for a +character set not listed in the default in Emacs.ad, please let +xemacs-beta@xemacs.org know about it, so we can add fonts to the +appropriate fontsets and stifle this warning. (Unfortunately it's +buried in Xlib, so we can't easily get rid of it otherwise.) + *** Mail agents (VM, Gnus, rmail) cannot get new mail rmail and VM get new mail from /usr/spool/mail/$USER using a program @@ -890,21 +932,6 @@ mode of the installed copy; changing the group and mode of the build directory copy is ineffective. -*** VM appears to hang in large folders. - -This is normal (trust us) when upgrading to VM-6.22 from earlier -versions. Let VM finish what it is doing and all will be well. - -*** Changes made to .el files do not take effect. - -You may have forgotten to recompile them into .elc files. Then the -old .elc files will be loaded, and your changes will not be seen. To -fix this, do `M-x byte-recompile-directory' and specify the directory -that contains the Lisp files. - -Note that you will get a warning when loading a .elc file that is -older than the corresponding .el file. - *** Things which should be bold or italic (such as the initial copyright notice) are not. @@ -948,7 +975,7 @@ Try evaluating the form (setq lock-directory nil) and see if that helps. There is a problem with file-locking on some systems (possibly related to NFS) that I don't understand. Please send mail to the address -xemacs@xemacs.org if you figure this one out. +xemacs-beta@xemacs.org if you figure this one out. *** When emacs starts up, I get lots of warnings about unknown keysyms. @@ -963,7 +990,7 @@ *** My X resources used to work, and now some of them are being ignored. Check the resources in .../etc/Emacs.ad (which is the same as the file -sample.Xdefaults). Perhaps some of the default resources built in to +sample.Xresources). Perhaps some of the default resources built in to emacs are now overriding your existing resources. Copy and edit the resources in Emacs.ad as necessary. @@ -1127,7 +1154,7 @@ slow. If you are interested in fixing this, please let us know at -. +. *** Screen is updated wrong, but only on one kind of terminal. @@ -1174,7 +1201,7 @@ without optimization. If that doesn't work, try recompiling with SYSTEM_MALLOC defined, and/or with REL_ALLOC undefined. -*** A position you specified in .Xdefaults is ignored, using twm. +*** A position you specified in .Xresources is ignored, using twm. twm normally ignores "program-specified" positions. You can tell it to obey them with this command in your `.twmrc' file: @@ -1308,7 +1335,7 @@ *** The popup menu appears at the bottom/right of my screen. -You probably have something like the following in your ~/.Xdefaults +You probably have something like the following in your ~/.Xresources Emacs.geometry: 81x56--9--1 @@ -1332,6 +1359,11 @@ workaround is to recompile the module with optimization turned on. Any optimization level, including -Os, appears to work. +*** C-z just refreshes the screen instead of suspending Emacs. + +You are probably using a shell that doesn't support job control, even +though the system itself is capable of it. Try using a different +shell. ** MacOS/X, Darwin *** XEmacs crashes on MacOS within font-lock, or when dealing @@ -1350,7 +1382,7 @@ ** AIX *** Your Delete key sends a Backspace to the terminal, using an AIXterm. -The solution is to include in your .Xdefaults the lines: +The solution is to include in your .Xresources the lines: *aixterm.Translations: #override BackSpace: string(0x7f) aixterm*ttyModes: erase ^? @@ -1945,14 +1977,126 @@ ** Windows -*** In general, the Windows code is less mature than the Unix code. +*** Conflicts with FSF NTEmacs -The Windows code base is still changing quickly. If you are -experiencing problems, try the latest beta version to see if the -problem still exists. Also ask on xemacs-nt@xemacs.org. +Depending on how it is installed, FSF NTEmacs may setup various EMACS* +variables in your environment. The presence of these variables may +cause XEmacs to fail at startup, cause you to see corrupted +doc-strings, or cause other random problems. + +You should remove these variables from your environment. These +variables are not required to run FSF NTEmacs if you start it by +running emacs.bat. + +*** XEmacs can't find my init file + +XEmacs looks for your init in your "home" directory -- either in +`~/.xemacs/init.el' or `~/.emacs'. XEmacs decides that your "home" +directory is, in order of preference: + +- The value of the HOME environment variable, if the variable exists. +- The value of the registry entry SOFTWARE\XEmacs\XEmacs\HOME, + if it exists. +- The value of the HOMEDRIVE and HOMEPATH environment variables, if + these variables both exist. +- C:\. + +To determine what XEmacs thinks your home directory is, try opening +a file in the `~' directory, and you should see its expansion in the +modeline. If this doesn't work, type ESC : (user-home-directory). + +*** XEmacs can't find any packages + +XEmacs looks for your packages in subdirectories of a directory which +is set at compile-time (see `config.inc'), and whose default is +`C:\Program Files\XEmacs'. XEmacs also looks in `~/.xemacs', where +`~' refers to your home directory (see previous entry). The variable +`configure-package-path' holds the actual path that was compiled into +your copy of XEmacs. + +The compile-time default location can be overridden by the EMACSPACKAGEPATH +environment variable or by the SOFTWARE\XEmacs\XEmacs\EMACSPACKAGEPATH +registry entry. You should check that these variables, if they exist, +point to the actual location of your package tree. + +*** XEmacs doesn't die when shutting down Windows 95 or 98 + +When shutting down Windows 95 or 98 you may see a dialog that says + "xemacs / You must quit this program before you quit Windows". +It is safe to + "Click OK to quit the program and Windows", +but you won't be offered a chance to save any modified XEmacs buffers. + +*** Key bindings + +The C-z, C-x, C-c, and C-v keystrokes have traditional uses in both +emacs and Windows programs. XEmacs binds these keys to their +traditional emacs uses, and provides Windows 3.x style bindings for +the Cut, Copy and Paste functions. + + Function XEmacs binding + -------- -------------- + Undo C-_ + Cut Sh-Del + Copy C-Insert + Paste Sh-Insert + +You can rebind keys to make XEmacs more Windows-compatible; for +example, to bind C-z to undo: + + (global-set-key [(control z)] 'undo) + +Rebindind C-x and C-c is trickier because by default these are prefix +keys in XEmacs. See the "Key Bindings" node in the XEmacs manual. + +*** Behavior of selected regions + +Use the pending-del package to enable the standard Windows behavior of +self-inserting deletes region. + +*** Limitations on the use of the AltGr key. + +In some locale and OS combinations you can't generate M-AltGr-key or +C-M-AltGr-key sequences at all. + +To generate C-AltGr-key or C-M-AltGr-key sequences you must use the +right-hand Control key and you must press it *after* AltGr. + +These limitations arise from fundamental problems in the way that the +win32 API reports AltGr key events. There isn't anything that XEmacs +can do to work round these problems that it isn't already doing. + +You may want to create alternative bindings if any of the standard +XEmacs bindings require you to use some combination of Control or Meta +and AltGr. + +*** Limited support for subprocesses under Windows 9x + +Attempting to use call-process to run a 16bit program gives a +"Spawning child process: Exec format error". For example shell-command +fails under Windows 95 and 98 if you use command.com or any other +16bit program as your shell. + +XEmacs may incorrectly quote your call-process command if it contains +double quotes, backslashes or spaces. + +start-process and functions that rely on it are supported under Windows 95, +98 and NT. However, starting a 16bit program that requires keyboard input +may cause XEmacs to hang or crash under Windows 95 and 98, and will leave +the orphaned 16bit program consuming all available CPU time. + +Sending signals to subprocesses started by call-process or by +start-process fails with a "Cannot send signal to process" error under +Windows 95 and 98. As a side effect of this, quitting XEmacs while it +is still running subprocesses causes it to crash under Windows 95 and +98. ** Cygwin +*** Signal 11 when building or running a dumped XEmacs. + +See the section on Cygwin above, under building. + *** XEmacs fails to start because cygXpm-noX4.dll was not found. Andy Piper sez: Index: configure =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/configure,v retrieving revision 1.190 retrieving revision 1.194 diff -u -r1.190 -r1.194 --- configure 14 Feb 2003 23:31:47 -0000 1.190 +++ configure 24 Apr 2003 05:26:40 -0000 1.194 @@ -6,7 +6,7 @@ #### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois. #### Copyright (C) 1996, 1997 Sun Microsystems, Inc. -#### Copyright (C) 1995, 1996, 2002 Ben Wing. +#### Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. #### Copyright (C) 2000, 2001 Martin Buchholz. #### Copyright (C) 1998, 1999 J. Kean Johnston. @@ -235,7 +235,6 @@ moduledir='${libdir}/${instvardir}/${configuration}/modules' sitelispdir='${datadir}/${inststaticdir}/site-lisp' sitemoduledir='${libdir}/${inststaticdir}/site-modules' -pkgdir='${datadir}/${instvardir}/lisp' package_path='' etcdir='${datadir}/${instvardir}/etc' archlibdir='${libdir}/${instvardir}/${configuration}' @@ -600,7 +599,7 @@ prefix | exec_prefix | bindir | datadir | statedir | libdir | \ - mandir | infodir | infopath | lispdir | etcdir | pkgdir | \ + mandir | infodir | infopath | lispdir | etcdir | \ archlibdir | docdir | package_path | moduledir ) if test "$valomitted" = "yes"; then if test "$#" = 0; then @@ -866,7 +865,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:870: checking whether ln -s works" >&5 +echo "configure:869: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -1152,7 +1151,7 @@ echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:1156: checking "host system type"" >&5 +echo "configure:1155: checking "host system type"" >&5 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'` canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"` configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` @@ -1684,7 +1683,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:1688: checking for $ac_word" >&5 +echo "configure:1687: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1711,7 +1710,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:1715: checking for $ac_word" >&5 +echo "configure:1714: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1759,7 +1758,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1763: checking for $ac_word" >&5 +echo "configure:1762: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1788,7 +1787,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1792: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1791: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -1801,12 +1800,12 @@ cat > conftest.$ac_ext << EOF -#line 1805 "configure" +#line 1804 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1834,19 +1833,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:1838: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1837: 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:1843: checking whether we are using GNU C" >&5 +echo "configure:1842: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1849: \"$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 @@ -1864,7 +1863,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1868: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1867: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1897,7 +1896,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:1901: checking for $ac_word" >&5 +echo "configure:1900: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1924,7 +1923,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:1928: checking for $ac_word" >&5 +echo "configure:1927: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1972,7 +1971,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1976: checking for $ac_word" >&5 +echo "configure:1975: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2001,7 +2000,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2005: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2004: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -2014,12 +2013,12 @@ cat > conftest.$ac_ext << EOF -#line 2018 "configure" +#line 2017 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2047,19 +2046,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:2051: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2050: 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:2056: checking whether we are using GNU C" >&5 +echo "configure:2055: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2062: \"$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 @@ -2077,7 +2076,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2081: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2080: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2110,7 +2109,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:2114: checking for $ac_word" >&5 +echo "configure:2113: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2137,7 +2136,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:2141: checking for $ac_word" >&5 +echo "configure:2140: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2185,7 +2184,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2189: checking for $ac_word" >&5 +echo "configure:2188: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2214,7 +2213,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2218: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2217: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -2227,12 +2226,12 @@ cat > conftest.$ac_ext << EOF -#line 2231 "configure" +#line 2230 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2260,19 +2259,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:2264: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2263: 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:2269: checking whether we are using GNU C" >&5 +echo "configure:2268: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2275: \"$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 @@ -2290,7 +2289,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2294: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2293: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2323,7 +2322,7 @@ if test "$GCC" = "yes"; then cat > conftest.$ac_ext <= 3 @@ -2333,7 +2332,7 @@ #endif } EOF -if { (eval echo configure:2337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2354,7 +2353,7 @@ test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2358: checking how to run the C preprocessor" >&5 +echo "configure:2357: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2367,13 +2366,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2384,13 +2383,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2401,13 +2400,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2433,9 +2432,9 @@ echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2437: checking for AIX" >&5 +echo "configure:2436: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:2466: checking for GNU libc" >&5 +echo "configure:2465: checking for GNU libc" >&5 cat > conftest.$ac_ext < int main() { @@ -2476,7 +2475,7 @@ ; return 0; } EOF -if { (eval echo configure:2480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -2553,7 +2552,7 @@ esac cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2819,17 +2818,17 @@ if test "$__USLC__" = yes; then echo $ac_n "checking for whether the -Kalloca compiler flag is needed""... $ac_c" 1>&6 -echo "configure:2823: checking for whether the -Kalloca compiler flag is needed" >&5 +echo "configure:2822: checking for whether the -Kalloca compiler flag is needed" >&5 need_kalloca=no cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* : else @@ -2840,14 +2839,14 @@ xe_save_c_switch_system="$c_switch_system" c_switch_system="$c_switch_system -Kalloca" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* need_kalloca=yes else @@ -2907,7 +2906,7 @@ if test "$GCC" = "yes"; then echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6 -echo "configure:2911: checking for buggy gcc versions" >&5 +echo "configure:2910: checking for buggy gcc versions" >&5 GCC_VERSION=`$CC --version` case `uname -s`:`uname -m`:$GCC_VERSION in *:sun4*:2.8.1|*:sun4*:egcs-2.90.*) @@ -2965,7 +2964,7 @@ if test "$pdump" != "yes"; then echo $ac_n "checking for \"-z nocombreloc\" linker flag""... $ac_c" 1>&6 -echo "configure:2969: checking for \"-z nocombreloc\" linker flag" >&5 +echo "configure:2968: checking for \"-z nocombreloc\" linker flag" >&5 case "`ld --help 2>&1`" in *-z\ nocombreloc* ) echo "$ac_t""yes" 1>&6 ld_switch_site="-z nocombreloc $ld_switch_site" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-z nocombreloc\" to \$ld_switch_site"; fi ;; @@ -3054,7 +3053,7 @@ fi echo $ac_n "checking for dynodump""... $ac_c" 1>&6 -echo "configure:3058: checking for dynodump" >&5 +echo "configure:3057: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -3092,12 +3091,12 @@ done echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6 -echo "configure:3096: checking for terminateAndUnload in -lC" >&5 +echo "configure:3095: checking for terminateAndUnload in -lC" >&5 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'` xe_check_libs=" -lC " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3216,7 +3215,7 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:3220: checking "for runtime libraries flag"" >&5 +echo "configure:3219: checking "for runtime libraries flag"" >&5 case "$opsys" in sol2 ) dash_r="-R" ;; decosf* | linux* | irix*) dash_r="-rpath " ;; @@ -3238,14 +3237,14 @@ done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* dash_r="$try_dash_r" else @@ -3346,10 +3345,10 @@ fi after_morecore_hook_exists=yes echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:3350: checking for malloc_set_state" >&5 +echo "configure:3349: checking for malloc_set_state" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_malloc_set_state=yes" else @@ -3392,16 +3391,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:3396: checking whether __after_morecore_hook exists" >&5 +echo "configure:3395: checking whether __after_morecore_hook exists" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -3457,7 +3456,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3461: checking for $ac_word" >&5 +echo "configure:3460: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -3512,7 +3511,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:3516: checking for a BSD compatible install" >&5 +echo "configure:3515: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -3566,7 +3565,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:3570: checking for $ac_word" >&5 +echo "configure:3569: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -3598,15 +3597,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3602: checking for $ac_hdr" >&5 +echo "configure:3601: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3636,10 +3635,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3640: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:3639: checking for sys/wait.h that is POSIX.1 compatible" >&5 cat > conftest.$ac_ext < #include @@ -3655,7 +3654,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3679,10 +3678,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3683: checking for ANSI C header files" >&5 +echo "configure:3682: checking for ANSI C header files" >&5 cat > conftest.$ac_ext < #include @@ -3690,7 +3689,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3707,7 +3706,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 @@ -3725,7 +3724,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 @@ -3743,7 +3742,7 @@ if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3754,7 +3753,7 @@ exit (0); } EOF -if { (eval echo configure:3758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -3780,10 +3779,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3784: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3783: checking whether time.h and sys/time.h may both be included" >&5 cat > conftest.$ac_ext < #include @@ -3792,7 +3791,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3816,10 +3815,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3820: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:3819: checking for sys_siglist declaration in signal.h or unistd.h" >&5 cat > conftest.$ac_ext < #include @@ -3831,7 +3830,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3857,9 +3856,9 @@ echo $ac_n "checking for utime""... $ac_c" 1>&6 -echo "configure:3861: checking for utime" >&5 +echo "configure:3860: checking for utime" >&5 cat > conftest.$ac_ext < #include @@ -3867,7 +3866,7 @@ struct utimbuf x; x.actime = x.modtime = 0; utime ("/", &x); ; return 0; } EOF -if { (eval echo configure:3871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3870: \"$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 @@ -3886,10 +3885,10 @@ for ac_func in utimes do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3890: checking for $ac_func" >&5 +echo "configure:3889: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3944,10 +3943,10 @@ echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3948: checking return type of signal handlers" >&5 +echo "configure:3947: checking return type of signal handlers" >&5 cat > conftest.$ac_ext < #include @@ -3964,7 +3963,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3986,10 +3985,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3990: checking for size_t" >&5 +echo "configure:3989: checking for size_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4020,10 +4019,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:4024: checking for pid_t" >&5 +echo "configure:4023: checking for pid_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4054,10 +4053,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4058: checking for uid_t in sys/types.h" >&5 +echo "configure:4057: checking for uid_t in sys/types.h" >&5 cat > conftest.$ac_ext < EOF @@ -4093,10 +4092,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:4097: checking for mode_t" >&5 +echo "configure:4096: checking for mode_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4127,10 +4126,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:4131: checking for off_t" >&5 +echo "configure:4130: checking for off_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4161,10 +4160,10 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:4165: checking for ssize_t" >&5 +echo "configure:4164: checking for ssize_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4196,10 +4195,11 @@ echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:4200: checking for socklen_t" >&5 +echo "configure:4199: checking for socklen_t" >&5 cat > conftest.$ac_ext < #include socklen_t x; @@ -4218,6 +4218,7 @@ cat > conftest.$ac_ext < #include int accept (int, struct sockaddr *, size_t *); @@ -4225,7 +4226,7 @@ ; return 0; } EOF -if { (eval echo configure:4229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""size_t" 1>&6 @@ -4257,9 +4258,9 @@ rm -f conftest* echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:4261: checking for struct timeval" >&5 +echo "configure:4262: checking for struct timeval" >&5 cat > conftest.$ac_ext < @@ -4275,7 +4276,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:4279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -4297,10 +4298,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:4301: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:4302: checking whether struct tm is in sys/time.h or time.h" >&5 cat > conftest.$ac_ext < #include @@ -4308,7 +4309,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:4312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -4332,10 +4333,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:4336: checking for tm_zone in struct tm" >&5 +echo "configure:4337: checking for tm_zone in struct tm" >&5 cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -4343,7 +4344,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:4347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -4366,10 +4367,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:4370: checking for tzname" >&5 +echo "configure:4371: checking for tzname" >&5 cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -4379,7 +4380,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:4383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -4405,10 +4406,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4409: checking for working const" >&5 +echo "configure:4410: checking for working const" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4482,7 +4483,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:4486: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:4487: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -4507,12 +4508,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4511: checking whether byte ordering is bigendian" >&5 +echo "configure:4512: checking whether byte ordering is bigendian" >&5 ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -4523,11 +4524,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:4527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4538,7 +4539,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:4542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4555,7 +4556,7 @@ rm -f conftest* if test $ac_cv_c_bigendian = unknown; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_bigendian=no else @@ -4595,10 +4596,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4599: checking size of short" >&5 +echo "configure:4600: checking size of short" >&5 cat > conftest.$ac_ext < main() @@ -4609,7 +4610,7 @@ exit(0); } EOF -if { (eval echo configure:4613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -4637,10 +4638,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4641: checking size of int" >&5 +echo "configure:4642: checking size of int" >&5 cat > conftest.$ac_ext < main() @@ -4651,7 +4652,7 @@ exit(0); } EOF -if { (eval echo configure:4655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -4673,10 +4674,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4677: checking size of long" >&5 +echo "configure:4678: checking size of long" >&5 cat > conftest.$ac_ext < main() @@ -4687,7 +4688,7 @@ exit(0); } EOF -if { (eval echo configure:4691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -4709,10 +4710,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4713: checking size of long long" >&5 +echo "configure:4714: checking size of long long" >&5 cat > conftest.$ac_ext < main() @@ -4723,7 +4724,7 @@ exit(0); } EOF -if { (eval echo configure:4727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long_long=`cat conftestval` else @@ -4745,10 +4746,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4749: checking size of void *" >&5 +echo "configure:4750: checking size of void *" >&5 cat > conftest.$ac_ext < main() @@ -4759,7 +4760,7 @@ exit(0); } EOF -if { (eval echo configure:4763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_void_p=`cat conftestval` else @@ -4782,7 +4783,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:4786: checking for long file names" >&5 +echo "configure:4787: 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: @@ -4828,10 +4829,10 @@ echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4832: checking for sin" >&5 +echo "configure:4833: checking for sin" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -4872,12 +4873,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:4876: checking for sin in -lm" >&5 +echo "configure:4877: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` xe_check_libs=" -lm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4923,14 +4924,14 @@ cat > conftest.$ac_ext < int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:4934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_INVERSE_HYPERBOLIC @@ -4949,10 +4950,10 @@ for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4953: checking for $ac_func" >&5 +echo "configure:4954: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5004,14 +5005,14 @@ echo "checking type of mail spool file locking" 1>&6 -echo "configure:5008: checking type of mail spool file locking" >&5 +echo "configure:5009: checking type of mail spool file locking" >&5 for ac_func in lockf flock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5012: checking for $ac_func" >&5 +echo "configure:5013: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5116,12 +5117,12 @@ case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:5120: checking for cma_open in -lpthreads" >&5 +echo "configure:5121: checking for cma_open in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lpthreads " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5169,7 +5170,7 @@ echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:5173: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:5174: 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; @@ -5181,7 +5182,7 @@ if test "$opsys" = "sol2"; then if test "$os_release" -ge 56; then echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6 -echo "configure:5185: checking for \"-z ignore\" linker flag" >&5 +echo "configure:5186: checking for \"-z ignore\" linker flag" >&5 case "`ld -h 2>&1`" in *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6 ld_switch_site="-z ignore $ld_switch_site" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-z ignore\" to \$ld_switch_site"; fi ;; @@ -5192,7 +5193,7 @@ echo "checking "for specified window system"" 1>&6 -echo "configure:5196: checking "for specified window system"" >&5 +echo "configure:5197: checking "for specified window system"" >&5 GNOME_CONFIG=no @@ -5200,7 +5201,7 @@ if test "$with_gnome" != "no"; then echo $ac_n "checking for GNOME configuration script""... $ac_c" 1>&6 -echo "configure:5204: checking for GNOME configuration script" >&5 +echo "configure:5205: checking for GNOME configuration script" >&5 for possible in gnome-config do possible_version=`${possible} --version 2> /dev/null` @@ -5231,7 +5232,7 @@ if test "$with_gtk" != "no";then echo $ac_n "checking for GTK configuration script""... $ac_c" 1>&6 -echo "configure:5235: checking for GTK configuration script" >&5 +echo "configure:5236: checking for GTK configuration script" >&5 for possible in gtk12-config gtk14-config gtk-config do possible_version=`${possible} --version 2> /dev/null` @@ -5253,18 +5254,18 @@ if test "${GTK_CONFIG}" != "no"; then echo $ac_n "checking gtk version""... $ac_c" 1>&6 -echo "configure:5257: checking gtk version" >&5 +echo "configure:5258: checking gtk version" >&5 GTK_VERSION=`${GTK_CONFIG} --version` echo "$ac_t""${GTK_VERSION}" 1>&6 echo $ac_n "checking gtk libs""... $ac_c" 1>&6 -echo "configure:5262: checking gtk libs" >&5 +echo "configure:5263: checking gtk libs" >&5 GTK_LIBS=`${GTK_CONFIG} --libs` libs_gtk="$libs_gtk ${GTK_LIBS}" && if test "$extra_verbose" = "yes"; then echo " Appending \"${GTK_LIBS}\" to \$libs_gtk"; fi echo "$ac_t""${GTK_LIBS}" 1>&6 echo $ac_n "checking gtk cflags""... $ac_c" 1>&6 -echo "configure:5268: checking gtk cflags" >&5 +echo "configure:5269: checking gtk cflags" >&5 GTK_CFLAGS=`${GTK_CONFIG} --cflags` if test "$GCC" = "yes"; then GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow" @@ -5274,19 +5275,19 @@ echo $ac_n "checking for main in -lgdk_imlib""... $ac_c" 1>&6 -echo "configure:5278: checking for main in -lgdk_imlib" >&5 +echo "configure:5279: checking for main in -lgdk_imlib" >&5 ac_lib_var=`echo gdk_imlib'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdk_imlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5308,12 +5309,12 @@ echo $ac_n "checking for Imlib_init in -lImlib""... $ac_c" 1>&6 -echo "configure:5312: checking for Imlib_init in -lImlib" >&5 +echo "configure:5313: checking for Imlib_init in -lImlib" >&5 ac_lib_var=`echo Imlib'_'Imlib_init | sed 'y%./+-%__p_%'` xe_check_libs=" -lImlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5347,10 +5348,10 @@ for ac_func in gdk_imlib_init do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5351: checking for $ac_func" >&5 +echo "configure:5352: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5439,15 +5440,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5443: checking for $ac_hdr" >&5 +echo "configure:5444: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5478,19 +5479,19 @@ echo $ac_n "checking for main in -lxml""... $ac_c" 1>&6 -echo "configure:5482: checking for main in -lxml" >&5 +echo "configure:5483: checking for main in -lxml" >&5 ac_lib_var=`echo xml'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lxml " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5512,19 +5513,19 @@ echo $ac_n "checking for main in -lglade""... $ac_c" 1>&6 -echo "configure:5516: checking for main in -lglade" >&5 +echo "configure:5517: checking for main in -lglade" >&5 ac_lib_var=`echo glade'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lglade " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5546,19 +5547,19 @@ echo $ac_n "checking for main in -lglade-gnome""... $ac_c" 1>&6 -echo "configure:5550: checking for main in -lglade-gnome" >&5 +echo "configure:5551: checking for main in -lglade-gnome" >&5 ac_lib_var=`echo glade-gnome'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lglade-gnome " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5579,7 +5580,7 @@ cat > conftest.$ac_ext < EOF @@ -5638,7 +5639,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:5642: checking for X" >&5 +echo "configure:5643: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5698,12 +5699,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5772,14 +5773,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -5888,17 +5889,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:5892: checking whether -R must be followed by a space" >&5 +echo "configure:5893: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -5914,14 +5915,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -5957,12 +5958,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:5961: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:5962: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5997,12 +5998,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:6001: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:6002: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet_stub " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6042,10 +6043,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:6046: checking for gethostbyname" >&5 +echo "configure:6047: checking for gethostbyname" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -6089,12 +6090,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:6093: checking for gethostbyname in -lnsl" >&5 +echo "configure:6094: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` xe_check_libs=" -lnsl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6135,10 +6136,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:6139: checking for connect" >&5 +echo "configure:6140: checking for connect" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -6184,12 +6185,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:6188: checking "$xe_msg_checking"" >&5 +echo "configure:6189: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocket $X_EXTRA_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6224,10 +6225,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:6228: checking for remove" >&5 +echo "configure:6229: checking for remove" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -6271,12 +6272,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:6275: checking for remove in -lposix" >&5 +echo "configure:6276: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` xe_check_libs=" -lposix " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6311,10 +6312,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:6315: checking for shmat" >&5 +echo "configure:6316: checking for shmat" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -6358,12 +6359,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:6362: checking for shmat in -lipc" >&5 +echo "configure:6363: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` xe_check_libs=" -lipc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6410,12 +6411,12 @@ xe_msg_checking="for IceConnectionNumber in -lICE" test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6414: checking "$xe_msg_checking"" >&5 +echo "configure:6415: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` xe_check_libs=" -lICE $X_EXTRA_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6593,7 +6594,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:6597: checking for X defines extracted by xmkmf" >&5 +echo "configure:6598: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -6642,15 +6643,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:6646: checking for X11/Intrinsic.h" >&5 +echo "configure:6647: checking for X11/Intrinsic.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6674,12 +6675,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:6678: checking for XOpenDisplay in -lX11" >&5 +echo "configure:6679: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6715,12 +6716,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:6719: checking "$xe_msg_checking"" >&5 +echo "configure:6720: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 -b i486-linuxaout" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6758,12 +6759,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:6762: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:6763: checking for XShapeSelectInput in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'` xe_check_libs=" -lXext " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6797,12 +6798,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:6801: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:6802: checking for XtOpenDisplay in -lXt" >&5 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lXt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6836,14 +6837,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:6840: checking the version of X11 being used" >&5 +echo "configure:6841: checking the version of X11 being used" >&5 cat > conftest.$ac_ext < int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; } EOF -if { (eval echo configure:6847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:6848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest foobar; x11_release=$? else @@ -6874,10 +6875,10 @@ for ac_func in XConvertCase do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6878: checking for $ac_func" >&5 +echo "configure:6879: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6932,15 +6933,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6936: checking for $ac_hdr" >&5 +echo "configure:6937: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6973,10 +6974,10 @@ for ac_func in XRegisterIMInstantiateCallback do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6977: checking for $ac_func" >&5 +echo "configure:6978: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7027,9 +7028,9 @@ done echo $ac_n "checking for standard XRegisterIMInstantiateCallback prototype""... $ac_c" 1>&6 -echo "configure:7031: checking for standard XRegisterIMInstantiateCallback prototype" >&5 +echo "configure:7032: checking for standard XRegisterIMInstantiateCallback prototype" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -7062,12 +7063,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:7066: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:7067: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` xe_check_libs=" -lXmu " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7117,19 +7118,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:7121: checking for main in -lXbsd" >&5 +echo "configure:7122: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lXbsd " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7166,22 +7167,22 @@ fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:7170: checking for MS-Windows" >&5 +echo "configure:7171: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:7173: checking for main in -lgdi32" >&5 +echo "configure:7174: checking for main in -lgdi32" >&5 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdi32 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7232,12 +7233,12 @@ test "$with_widgets" != "no" && with_widgets=msw fi cat > conftest.$ac_ext < int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } EOF -if { (eval echo configure:7241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MSG_SELECT @@ -7298,15 +7299,15 @@ if test "$with_x11" = "yes"; then ac_safe=`echo "X11/extensions/shape.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6 -echo "configure:7302: checking for X11/extensions/shape.h" >&5 +echo "configure:7303: checking for X11/extensions/shape.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7356,7 +7357,7 @@ esac echo "checking for WM_COMMAND option" 1>&6 -echo "configure:7360: checking for WM_COMMAND option" >&5; +echo "configure:7361: checking for WM_COMMAND option" >&5; if test "$with_wmcommand" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_WMCOMMAND @@ -7371,15 +7372,15 @@ test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6 -echo "configure:7375: checking for X11/Xauth.h" >&5 +echo "configure:7376: checking for X11/Xauth.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7402,12 +7403,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:7406: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:7407: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7465,22 +7466,32 @@ if test "$with_modules" != "no"; then echo "checking for module support" 1>&6 -echo "configure:7469: checking for module support" >&5 +echo "configure:7470: checking for module support" >&5 if test "$with_msw" = "yes"; then have_dl=yes; else - ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` + case "$opsys" in + darwin ) have_dl=yes; { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_DYLD +EOF +cat >> confdefs.h <<\EOF +#define HAVE_DYLD 1 +EOF +} + ;; + * ) + ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:7476: checking for dlfcn.h" >&5 +echo "configure:7487: checking for dlfcn.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7496,17 +7507,17 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:7501: checking for dlopen in -lc" >&5 - cat > conftest.$ac_ext <&6 +echo "configure:7512: checking for dlopen in -lc" >&5 + cat > conftest.$ac_ext < int main() { - dlopen ("", 0); + dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7514,19 +7525,19 @@ cat conftest.$ac_ext >&5 rm -rf conftest* - echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:7519: checking for dlopen in -ldl" >&5 - ac_save_LIBS="$LIBS" - LIBS="-ldl $LIBS" - cat > conftest.$ac_ext <&6 +echo "configure:7530: checking for dlopen in -ldl" >&5 + ac_save_LIBS="$LIBS" + LIBS="-ldl $LIBS" + cat > conftest.$ac_ext < int main() { - dlopen ("", 0); + dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7536,15 +7547,15 @@ LIBS="$ac_save_LIBS" fi rm -f conftest* - ac_save_LIBS= + ac_save_LIBS= fi rm -f conftest* else echo "$ac_t""no" 1>&6 fi - if test -n "$have_dl"; then - { test "$extra_verbose" = "yes" && cat << \EOF + if test -n "$have_dl"; then + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DLOPEN EOF cat >> confdefs.h <<\EOF @@ -7552,15 +7563,15 @@ EOF } - else - + else + echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:7559: checking for shl_load in -ldld" >&5 +echo "configure:7570: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7586,7 +7597,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 libdl=dld have_dl=yes; - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SHL_LOAD EOF cat >> confdefs.h <<\EOF @@ -7598,12 +7609,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:7602: checking for dld_init in -ldld" >&5 +echo "configure:7613: checking for dld_init in -ldld" >&5 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7629,7 +7640,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 libdl=dld have_dl=yes; - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DLD_INIT EOF cat >> confdefs.h <<\EOF @@ -7645,8 +7656,8 @@ fi - fi - fi + fi + esac fi if test -n "$have_dl"; then dll_ld= @@ -7659,7 +7670,7 @@ xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:7663: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:7674: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -7687,9 +7698,9 @@ XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:7691: checking checking whether we are using GNU C" >&5 +echo "configure:7702: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <&6 -echo "configure:7715: checking how to produce PIC code" >&5 +echo "configure:7726: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -7817,18 +7828,18 @@ # Check to make sure the dll_cflags actually works. echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6 -echo "configure:7821: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:7832: checking if PIC flag ${dll_cflags} really works" >&5 save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $dll_cflags -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also @@ -7863,7 +7874,7 @@ xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:7867: checking if C compiler can produce shared libraries" >&5 +echo "configure:7878: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes; then xcldf="-shared" xldf="-shared" @@ -7914,14 +7925,14 @@ xe_libs= ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cc_produces_so=yes else @@ -7946,7 +7957,7 @@ if test "$XEGCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:7950: checking for ld used by GCC" >&5 +echo "configure:7961: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -7972,7 +7983,7 @@ esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:7976: checking for GNU ld" >&5 +echo "configure:7987: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -8010,7 +8021,7 @@ # Check to see if it really is or isn't GNU ld. echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6 -echo "configure:8014: checking if the linker is GNU ld" >&5 +echo "configure:8025: checking if the linker is GNU ld" >&5 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LTLD -v 2>&1 &5; then xe_gnu_ld=yes @@ -8038,7 +8049,7 @@ # OK - only NOW do we futz about with ld. # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6 -echo "configure:8042: checking whether the linker supports shared libraries" >&5 +echo "configure:8053: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -8246,10 +8257,10 @@ for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8250: checking for $ac_func" >&5 +echo "configure:8261: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8334,15 +8345,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:8338: checking for ${dir}tt_c.h" >&5 +echo "configure:8349: checking for ${dir}tt_c.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8378,12 +8389,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:8382: checking "$xe_msg_checking"" >&5 +echo "configure:8393: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` xe_check_libs=" -ltt $extra_libs" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8448,15 +8459,15 @@ test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6 -echo "configure:8452: checking for Dt/Dt.h" >&5 +echo "configure:8463: checking for Dt/Dt.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8479,12 +8490,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:8483: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:8494: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8576,7 +8587,7 @@ if test "$with_dragndrop" != "no" ; then echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 -echo "configure:8580: checking if drag and drop API is needed" >&5 +echo "configure:8591: checking if drag and drop API is needed" >&5 if test -n "$dragndrop_proto" ; then with_dragndrop=yes echo "$ac_t""yes (${dragndrop_proto} )" 1>&6 @@ -8596,19 +8607,19 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:8600: checking for LDAP" >&5 +echo "configure:8611: checking for LDAP" >&5 ldap_libs= test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ldap.h""... $ac_c" 1>&6 -echo "configure:8604: checking for ldap.h" >&5 +echo "configure:8615: checking for ldap.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8631,15 +8642,15 @@ } test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for lber.h""... $ac_c" 1>&6 -echo "configure:8635: checking for lber.h" >&5 +echo "configure:8646: checking for lber.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8663,12 +8674,12 @@ if test "$with_ldap" != "no"; then echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:8667: checking for ldap_search in -lldap" >&5 +echo "configure:8678: checking for ldap_search in -lldap" >&5 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8704,12 +8715,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:8708: checking "$xe_msg_checking"" >&5 +echo "configure:8719: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8745,12 +8756,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:8749: checking "$xe_msg_checking"" >&5 +echo "configure:8760: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber -lkrb" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8786,12 +8797,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:8790: checking "$xe_msg_checking"" >&5 +echo "configure:8801: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber -lkrb -ldes" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8851,10 +8862,10 @@ for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8855: checking for $ac_func" >&5 +echo "configure:8866: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8916,20 +8927,20 @@ postgresql_libs= if test "$with_postgresql" != "no"; then echo "checking for PostgreSQL" 1>&6 -echo "configure:8920: checking for PostgreSQL" >&5 +echo "configure:8931: checking for PostgreSQL" >&5 for header_dir in "" "pgsql/" "postgresql/"; do ac_safe=`echo "${header_dir}libpq-fe.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${header_dir}libpq-fe.h""... $ac_c" 1>&6 -echo "configure:8925: checking for ${header_dir}libpq-fe.h" >&5 +echo "configure:8936: checking for ${header_dir}libpq-fe.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8953,12 +8964,12 @@ test -n "$libpq_fe_h_file" && { echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6 -echo "configure:8957: checking for PQconnectdb in -lpq" >&5 +echo "configure:8968: checking for PQconnectdb in -lpq" >&5 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'` xe_check_libs=" -lpq " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9002,12 +9013,12 @@ echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6 -echo "configure:9006: checking for PQconnectStart in -lpq" >&5 +echo "configure:9017: checking for PQconnectStart in -lpq" >&5 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lpq " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9069,7 +9080,7 @@ if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:9073: checking for graphics libraries" >&5 +echo "configure:9084: checking for graphics libraries" >&5 libpath_xpm= incpath_xpm= @@ -9095,10 +9106,10 @@ CFLAGS=""$incpath_xpm" $CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi LDFLAGS=""$libpath_xpm" $LDFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$libpath_xpm"\" to \$LDFLAGS"; fi echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:9099: checking for Xpm - no older than 3.4f" >&5 +echo "configure:9110: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext < @@ -9107,7 +9118,7 @@ XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:9111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest dummy_arg; xpm_status=$?; if test "$xpm_status" = "0"; then @@ -9151,17 +9162,17 @@ libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi CFLAGS=""$incpath_xpm" $CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6 -echo "configure:9155: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:9166: checking for \"FOR_MSW\" xpm" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xpm_for_msw=no else @@ -9187,15 +9198,15 @@ test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for compface.h""... $ac_c" 1>&6 -echo "configure:9191: checking for compface.h" >&5 +echo "configure:9202: checking for compface.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9218,12 +9229,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:9222: checking for UnGenFace in -lcompface" >&5 +echo "configure:9233: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9283,12 +9294,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:9287: checking for inflate in -lc" >&5 +echo "configure:9298: checking for inflate in -lc" >&5 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9318,12 +9329,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:9322: checking for inflate in -lz" >&5 +echo "configure:9333: checking for inflate in -lz" >&5 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9353,12 +9364,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:9357: checking for inflate in -lgz" >&5 +echo "configure:9368: checking for inflate in -lgz" >&5 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lgz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9399,15 +9410,15 @@ test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6 -echo "configure:9403: checking for jpeglib.h" >&5 +echo "configure:9414: checking for jpeglib.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9430,12 +9441,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:9434: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:9445: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` xe_check_libs=" -ljpeg " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9482,10 +9493,10 @@ png_problem="" test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:9486: checking for pow" >&5 +echo "configure:9497: checking for pow" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -9529,15 +9540,15 @@ } test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:9533: checking for png.h" >&5 +echo "configure:9544: checking for png.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9560,12 +9571,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:9564: checking for png_read_image in -lpng" >&5 +echo "configure:9575: checking for png_read_image in -lpng" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` xe_check_libs=" -lpng " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9599,10 +9610,10 @@ } if test -z "$with_png"; then echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:9603: checking for workable png version information" >&5 +echo "configure:9614: checking for workable png version information" >&5 xe_check_libs="-lpng -lz" cat > conftest.$ac_ext < int main(int c, char **v) { @@ -9610,7 +9621,7 @@ if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1; return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;} EOF -if { (eval echo configure:9614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest dummy_arg; png_status=$?; if test "$png_status" = "0"; then @@ -9653,15 +9664,15 @@ test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6 -echo "configure:9657: checking for tiffio.h" >&5 +echo "configure:9668: checking for tiffio.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9684,12 +9695,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:9688: checking for TIFFClientOpen in -ltiff" >&5 +echo "configure:9699: checking for TIFFClientOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'` xe_check_libs=" -ltiff " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9739,15 +9750,15 @@ if test "$with_gtk" = "yes"; then test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for compface.h""... $ac_c" 1>&6 -echo "configure:9743: checking for compface.h" >&5 +echo "configure:9754: checking for compface.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9770,12 +9781,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:9774: checking for UnGenFace in -lcompface" >&5 +echo "configure:9785: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9825,7 +9836,7 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:9829: checking for X11 graphics libraries" >&5 +echo "configure:9840: checking for X11 graphics libraries" >&5 fi case "$with_widgets" in @@ -9835,7 +9846,7 @@ if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then echo "checking for the Athena widgets" 1>&6 -echo "configure:9839: checking for the Athena widgets" >&5 +echo "configure:9850: checking for the Athena widgets" >&5 case "$with_athena" in "xaw" | "") athena_variant=Xaw athena_3d=no ;; @@ -9849,12 +9860,12 @@ if test "$athena_3d" = "no"; then echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:9853: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 +echo "configure:9864: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9881,12 +9892,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:9885: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:9896: checking for threeDClassRec in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9928,12 +9939,12 @@ else echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:9932: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:9943: checking for threeDClassRec in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9962,12 +9973,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:9966: checking for threeDClassRec in -lXaw" >&5 +echo "configure:9977: checking for threeDClassRec in -lXaw" >&5 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10009,15 +10020,15 @@ if test "$athena_3d" = "no"; then ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10013: checking for X11/Xaw/ThreeD.h" >&5 +echo "configure:10024: checking for X11/Xaw/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10037,15 +10048,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6 -echo "configure:10041: checking for X11/Xaw/XawInit.h" >&5 +echo "configure:10052: checking for X11/Xaw/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10071,15 +10082,15 @@ else ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6 -echo "configure:10075: checking for X11/$athena_variant/XawInit.h" >&5 +echo "configure:10086: checking for X11/$athena_variant/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10096,15 +10107,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10100: checking for X11/$athena_variant/ThreeD.h" >&5 +echo "configure:10111: checking for X11/$athena_variant/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10132,15 +10143,15 @@ if test -z "$athena_h_path"; then ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6 -echo "configure:10136: checking for $athena_variant/XawInit.h" >&5 +echo "configure:10147: checking for $athena_variant/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10157,15 +10168,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10161: checking for $athena_variant/ThreeD.h" >&5 +echo "configure:10172: checking for $athena_variant/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10194,15 +10205,15 @@ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6 -echo "configure:10198: checking for X11/Xaw3d/XawInit.h" >&5 +echo "configure:10209: checking for X11/Xaw3d/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10219,15 +10230,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10223: checking for X11/Xaw3d/ThreeD.h" >&5 +echo "configure:10234: checking for X11/Xaw3d/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10259,15 +10270,15 @@ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6 -echo "configure:10263: checking for Xaw3d/XawInit.h" >&5 +echo "configure:10274: checking for Xaw3d/XawInit.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10284,15 +10295,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10288: checking for Xaw3d/ThreeD.h" >&5 +echo "configure:10299: checking for Xaw3d/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10324,15 +10335,15 @@ if test -z "$athena_h_path"; then ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6 -echo "configure:10328: checking for X11/Xaw/ThreeD.h" >&5 +echo "configure:10339: checking for X11/Xaw/ThreeD.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10371,15 +10382,15 @@ if test "$with_x11" = "yes"; then ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:10375: checking for Xm/Xm.h" >&5 +echo "configure:10386: checking for Xm/Xm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10396,12 +10407,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:10400: checking for XmStringFree in -lXm" >&5 +echo "configure:10411: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10441,9 +10452,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:10445: checking for Lesstif" >&5 +echo "configure:10456: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -10816,7 +10827,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:10820: checking for Mule-related features" >&5 +echo "configure:10831: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -10830,15 +10841,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10834: checking for $ac_hdr" >&5 +echo "configure:10845: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10869,12 +10880,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:10873: checking for strerror in -lintl" >&5 +echo "configure:10884: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10918,18 +10929,18 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:10922: checking for Mule input methods" >&5 +echo "configure:10933: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:10925: checking for XIM" >&5 +echo "configure:10936: checking for XIM" >&5 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6 -echo "configure:10928: checking for XOpenIM in -lX11" >&5 +echo "configure:10939: checking for XOpenIM in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10964,12 +10975,12 @@ if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:10968: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:10979: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11045,15 +11056,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:11049: checking for XFontSet" >&5 +echo "configure:11060: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:11052: checking for XmbDrawString in -lX11" >&5 +echo "configure:11063: checking for XmbDrawString in -lX11" >&5 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11104,15 +11115,15 @@ test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6 -echo "configure:11108: checking for wnn/jllib.h" >&5 +echo "configure:11119: checking for wnn/jllib.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11135,15 +11146,15 @@ } test -z "$with_wnn" && { ac_safe=`echo "wnn/commonhd.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wnn/commonhd.h""... $ac_c" 1>&6 -echo "configure:11139: checking for wnn/commonhd.h" >&5 +echo "configure:11150: checking for wnn/commonhd.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11168,10 +11179,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11172: checking for $ac_func" >&5 +echo "configure:11183: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11223,12 +11234,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:11227: checking for crypt in -lcrypt" >&5 +echo "configure:11238: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` xe_check_libs=" -lcrypt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11274,12 +11285,12 @@ if test -z "$with_wnn" -o "$with_wnn" = "yes"; then echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6 -echo "configure:11278: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:11289: checking for jl_dic_list_e in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11308,12 +11319,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6 -echo "configure:11312: checking for jl_dic_list_e in -lwnn4" >&5 +echo "configure:11323: checking for jl_dic_list_e in -lwnn4" >&5 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn4 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11342,12 +11353,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6 -echo "configure:11346: checking for jl_dic_list_e in -lwnn6" >&5 +echo "configure:11357: checking for jl_dic_list_e in -lwnn6" >&5 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn6 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11376,12 +11387,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6 -echo "configure:11380: checking for dic_list_e in -lwnn6_fromsrc" >&5 +echo "configure:11391: checking for dic_list_e in -lwnn6_fromsrc" >&5 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn6_fromsrc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11437,12 +11448,12 @@ if test "$with_wnn6" != "no"; then echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6 -echo "configure:11441: checking for jl_fi_dic_list in -l$libwnn" >&5 +echo "configure:11452: checking for jl_fi_dic_list in -l$libwnn" >&5 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'` xe_check_libs=" -l$libwnn " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11488,15 +11499,15 @@ if test "$with_canna" != "no"; then ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6 -echo "configure:11492: checking for canna/jrkanji.h" >&5 +echo "configure:11503: checking for canna/jrkanji.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11523,15 +11534,15 @@ c_switch_site="$c_switch_site -I/usr/local/canna/include" ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6 -echo "configure:11527: checking for canna/jrkanji.h" >&5 +echo "configure:11538: checking for canna/jrkanji.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11559,15 +11570,15 @@ test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6 -echo "configure:11563: checking for canna/RK.h" >&5 +echo "configure:11574: checking for canna/RK.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11590,12 +11601,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:11594: checking for RkBgnBun in -lRKC" >&5 +echo "configure:11605: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11629,12 +11640,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:11633: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:11644: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11691,12 +11702,12 @@ libs_x="-lXm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXm\" to \$libs_x"; fi echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6 -echo "configure:11695: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:11706: checking for layout_object_getvalue in -li18n" >&5 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'` xe_check_libs=" -li18n " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11794,10 +11805,10 @@ for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror strlwr strupr symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11798: checking for $ac_func" >&5 +echo "configure:11809: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11861,10 +11872,10 @@ for ac_func in getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11865: checking for $ac_func" >&5 +echo "configure:11876: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11916,10 +11927,10 @@ echo $ac_n "checking for openpty""... $ac_c" 1>&6 -echo "configure:11920: checking for openpty" >&5 +echo "configure:11931: checking for openpty" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_openpty=yes" else @@ -11961,12 +11972,12 @@ echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 -echo "configure:11965: checking for openpty in -lutil" >&5 +echo "configure:11976: checking for openpty in -lutil" >&5 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'` xe_check_libs=" -lutil " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12012,15 +12023,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12016: checking for $ac_hdr" >&5 +echo "configure:12027: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12057,15 +12068,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12061: checking for $ac_hdr" >&5 +echo "configure:12072: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12098,15 +12109,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12102: checking for $ac_hdr" >&5 +echo "configure:12113: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12139,15 +12150,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12143: checking for $ac_hdr" >&5 +echo "configure:12154: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12183,15 +12194,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12187: checking for $ac_hdr" >&5 +echo "configure:12198: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12195: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12224,10 +12235,10 @@ for ac_func in isastream do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12228: checking for $ac_func" >&5 +echo "configure:12239: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12281,15 +12292,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12285: checking for $ac_hdr" >&5 +echo "configure:12296: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12322,10 +12333,10 @@ for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12326: checking for $ac_func" >&5 +echo "configure:12337: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12381,15 +12392,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12385: checking for $ac_hdr" >&5 +echo "configure:12396: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12425,12 +12436,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:12429: checking for kstat_open in -lkstat" >&5 +echo "configure:12440: checking for kstat_open in -lkstat" >&5 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lkstat " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12476,15 +12487,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12480: checking for $ac_hdr" >&5 +echo "configure:12491: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12516,12 +12527,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:12520: checking for kvm_read in -lkvm" >&5 +echo "configure:12531: checking for kvm_read in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` xe_check_libs=" -lkvm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12566,16 +12577,16 @@ fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:12570: checking whether netdb declares h_errno" >&5 +echo "configure:12581: checking whether netdb declares h_errno" >&5 cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:12579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -12595,16 +12606,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:12599: checking for sigsetjmp" >&5 +echo "configure:12610: checking for sigsetjmp" >&5 cat > conftest.$ac_ext < int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:12608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12619: \"$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 @@ -12624,11 +12635,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:12628: checking whether localtime caches TZ" >&5 +echo "configure:12639: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext < #if STDC_HEADERS @@ -12663,7 +12674,7 @@ exit (0); } EOF -if { (eval echo configure:12667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:12678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then emacs_cv_localtime_cache=no else @@ -12693,9 +12704,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:12697: checking whether gettimeofday accepts one or two arguments" >&5 +echo "configure:12708: checking whether gettimeofday accepts one or two arguments" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""two" 1>&6 else @@ -12738,19 +12749,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:12742: checking for inline" >&5 +echo "configure:12753: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -12791,17 +12802,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:12795: checking for working alloca.h" >&5 +echo "configure:12806: checking for working alloca.h" >&5 cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:12805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -12825,10 +12836,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:12829: checking for alloca" >&5 +echo "configure:12840: checking for alloca" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -12895,10 +12906,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:12899: checking whether alloca needs Cray hooks" >&5 +echo "configure:12910: checking whether alloca needs Cray hooks" >&5 cat > conftest.$ac_ext <&6 -echo "configure:12926: checking for $ac_func" >&5 +echo "configure:12937: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12978,10 +12989,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:12982: checking stack direction for C alloca" >&5 +echo "configure:12993: checking stack direction for C alloca" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_stack_direction=1 else @@ -13028,11 +13039,89 @@ fi fi +echo $ac_n "checking for working alloca in function calls""... $ac_c" 1>&6 +echo "configure:13044: checking for working alloca in function calls" >&5 +cat > conftest.$ac_ext < +#elif defined (__GNUC__) +#define alloca __builtin_alloca +#elif defined (__DECC) +#include +#pragma intrinsic(alloca) +#elif defined (HAVE_ALLOCA_H) +#include +#elif defined (_AIX) +#pragma alloca +#elif ! defined (alloca) +#ifdef C_ALLOCA +#define alloca xemacs_c_alloca +#else +void *alloca (); +#endif /* C_ALLOCA */ +#endif /* !defined (alloca) */ + +void +f1 (double a, void *ptr, int b) +{ + unsigned char *ptr2 = (unsigned char *) ptr; + if (ptr2[0] != 0xBF || ptr2[1] != 0xBF || ptr2[3000] != 0xBF) + exit (1); + if (a != 3.1415 || b != -5490) + exit (1); +} + +int +f2 (short c, void *ptr, long e) +{ + unsigned char *ptr2 = (unsigned char *) ptr; + if (ptr2[0] != 0xFB || ptr2[1] != 0xFB || ptr2[1000] != 0xFB) + exit (1); + if (c != 665 || e != 776776776) + exit (1); + f1 (3.1415, memset (alloca (3001), 0xBF, 3001), -5490); + return 42; +} + +int +main (int argc, char *argv[]) +{ + if (f2 (665, memset (alloca (1001), 0xFB, 1001), 776776776) != 42) + return 1; + return 0; +} + +EOF +if { (eval echo configure:13099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +then + working_alloca_in_function_calls=yes +else + conftest_rc="$?" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + working_alloca_in_function_calls=no +fi +rm -fr conftest* +echo "$ac_t""$working_alloca_in_function_calls" 1>&6 +test "$working_alloca_in_function_calls" != "yes" && \ + { test "$extra_verbose" = "yes" && cat << \EOF + Defining BROKEN_ALLOCA_IN_FUNCTION_CALLS +EOF +cat >> confdefs.h <<\EOF +#define BROKEN_ALLOCA_IN_FUNCTION_CALLS 1 +EOF +} + + echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:13033: checking for working strcoll" >&5 +echo "configure:13122: checking for working strcoll" >&5 cat > conftest.$ac_ext < main () @@ -13042,7 +13131,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:13046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -13070,10 +13159,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13074: checking for $ac_func" >&5 +echo "configure:13163: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13124,10 +13213,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:13128: checking whether getpgrp takes no argument" >&5 +echo "configure:13217: checking whether getpgrp takes no argument" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -13209,10 +13298,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:13213: checking for working mmap" >&5 +echo "configure:13302: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext < #include @@ -13245,7 +13334,7 @@ return 1; } EOF -if { (eval echo configure:13249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then have_mmap=yes else @@ -13274,9 +13363,9 @@ if test "$rel_alloc $have_mmap" = "default yes"; then if test "$doug_lea_malloc" = "yes"; then echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6 -echo "configure:13278: checking for M_MMAP_THRESHOLD" >&5 +echo "configure:13367: checking for M_MMAP_THRESHOLD" >&5 cat > conftest.$ac_ext < int main() { @@ -13288,7 +13377,7 @@ ; return 0; } EOF -if { (eval echo configure:13292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rel_alloc=no; echo "$ac_t""yes" 1>&6; else @@ -13313,15 +13402,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:13317: checking for termios.h" >&5 +echo "configure:13406: checking for termios.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13364,15 +13453,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:13368: checking for termio.h" >&5 +echo "configure:13457: checking for termio.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13404,10 +13493,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:13408: checking for socket" >&5 +echo "configure:13497: checking for socket" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -13445,15 +13534,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:13449: checking for netinet/in.h" >&5 +echo "configure:13538: checking for netinet/in.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13470,15 +13559,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:13474: checking for arpa/inet.h" >&5 +echo "configure:13563: checking for arpa/inet.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13503,9 +13592,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:13507: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:13596: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext < @@ -13516,7 +13605,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:13520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SOCKADDR_SUN_LEN @@ -13534,9 +13623,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:13538: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:13627: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext < @@ -13546,7 +13635,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:13550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MULTICAST @@ -13577,10 +13666,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:13581: checking for msgget" >&5 +echo "configure:13670: checking for msgget" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -13618,15 +13707,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:13622: checking for sys/ipc.h" >&5 +echo "configure:13711: checking for sys/ipc.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13719: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13643,15 +13732,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:13647: checking for sys/msg.h" >&5 +echo "configure:13736: checking for sys/msg.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13689,15 +13778,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:13693: checking for dirent.h" >&5 +echo "configure:13782: checking for dirent.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13724,15 +13813,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:13728: checking for sys/dir.h" >&5 +echo "configure:13817: checking for sys/dir.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13765,15 +13854,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:13769: checking for nlist.h" >&5 +echo "configure:13858: checking for nlist.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13803,22 +13892,22 @@ echo "checking "for sound support"" 1>&6 -echo "configure:13807: checking "for sound support"" >&5 +echo "configure:13896: checking "for sound support"" >&5 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes if test "$with_native_sound" != "no"; then if test -n "$native_sound_lib"; then ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6 -echo "configure:13814: checking for multimedia/audio_device.h" >&5 +echo "configure:13903: checking for multimedia/audio_device.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13866,12 +13955,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:13870: checking for ALopenport in -laudio" >&5 +echo "configure:13959: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13913,12 +14002,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:13917: checking for AOpenAudio in -lAlib" >&5 +echo "configure:14006: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13977,15 +14066,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:13981: checking for ${dir}/soundcard.h" >&5 +echo "configure:14070: checking for ${dir}/soundcard.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14039,15 +14128,15 @@ if test "$with_nas_sound" != "no"; then ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6 -echo "configure:14043: checking for audio/audiolib.h" >&5 +echo "configure:14132: checking for audio/audiolib.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14065,12 +14154,12 @@ echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6 -echo "configure:14069: checking for AuOpenServer in -laudio" >&5 +echo "configure:14158: checking for AuOpenServer in -laudio" >&5 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14120,7 +14209,7 @@ fi libs_x="-laudio $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-laudio\" to \$libs_x"; fi cat > conftest.$ac_ext < EOF @@ -14151,7 +14240,7 @@ # Extract the first word of "esd-config", so it can be a program name with args. set dummy esd-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:14155: checking for $ac_word" >&5 +echo "configure:14244: checking for $ac_word" >&5 if test -n "$have_esd_config"; then ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test. @@ -14180,10 +14269,10 @@ c_switch_site="$c_switch_site `esd-config --cflags`" && if test "$extra_verbose" = "yes"; then echo " Appending \"`esd-config --cflags`\" to \$c_switch_site"; fi LIBS="`esd-config --libs` $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"`esd-config --libs`\" to \$LIBS"; fi echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6 -echo "configure:14184: checking for esd_play_stream" >&5 +echo "configure:14273: checking for esd_play_stream" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_esd_play_stream=yes" else @@ -14257,7 +14346,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:14261: checking for TTY-related features" >&5 +echo "configure:14350: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -14270,12 +14359,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:14274: checking for tgetent in -lncurses" >&5 +echo "configure:14363: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14319,15 +14408,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:14323: checking for ncurses/curses.h" >&5 +echo "configure:14412: checking for ncurses/curses.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14349,15 +14438,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:14353: checking for ncurses/term.h" >&5 +echo "configure:14442: checking for ncurses/term.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14387,15 +14476,15 @@ c_switch_site="$c_switch_site -I/usr/include/ncurses" ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:14391: checking for ncurses/curses.h" >&5 +echo "configure:14480: checking for ncurses/curses.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14430,12 +14519,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:14434: checking for tgetent in -l$lib" >&5 +echo "configure:14523: checking for tgetent in -l$lib" >&5 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -l$lib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14477,12 +14566,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:14481: checking for tgetent in -lcurses" >&5 +echo "configure:14570: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lcurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14511,12 +14600,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:14515: checking for tgetent in -ltermcap" >&5 +echo "configure:14604: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -ltermcap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14575,15 +14664,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:14579: checking for gpm.h" >&5 +echo "configure:14668: checking for gpm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14606,12 +14695,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:14610: checking for Gpm_Open in -lgpm" >&5 +echo "configure:14699: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgpm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14665,20 +14754,20 @@ test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ != "no no no" && echo "checking for database support" 1>&6 -echo "configure:14669: checking for database support" >&5 +echo "configure:14758: checking for database support" >&5 if test "$with_database_gdbm $with_database_dbm" != "no no"; then ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6 -echo "configure:14674: checking for ndbm.h" >&5 +echo "configure:14763: checking for ndbm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -14708,12 +14797,12 @@ if test "$with_database_gdbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:14712: checking for dbm_open in -lgdbm" >&5 +echo "configure:14801: checking for dbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdbm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14752,10 +14841,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:14756: checking for dbm_open" >&5 +echo "configure:14845: checking for dbm_open" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -14797,12 +14886,12 @@ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:14801: checking for dbm_open in -ldbm" >&5 +echo "configure:14890: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -ldbm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14854,10 +14943,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:14858: checking for Berkeley db.h" >&5 +echo "configure:14947: checking for Berkeley db.h" >&5 for header in "db/db.h" "db.h"; do cat > conftest.$ac_ext < @@ -14879,7 +14968,7 @@ ; return 0; } EOF -if { (eval echo configure:14883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_file="$header"; break else @@ -14895,9 +14984,9 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6 -echo "configure:14899: checking for Berkeley DB version" >&5 +echo "configure:14988: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 1 @@ -14909,7 +14998,7 @@ egrep "yes" >/dev/null 2>&1; then rm -rf conftest* cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 2 @@ -14936,10 +15025,10 @@ rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:14940: checking for $dbfunc" >&5 +echo "configure:15029: checking for $dbfunc" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$dbfunc=yes" else @@ -14981,12 +15070,12 @@ echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:14985: checking for $dbfunc in -ldb" >&5 +echo "configure:15074: checking for $dbfunc in -ldb" >&5 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -15058,12 +15147,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:15062: checking for SOCKSinit in -lsocks" >&5 +echo "configure:15151: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -15128,11 +15217,11 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:15225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -15330,7 +15419,6 @@ - PREFIX=$prefix while true; do case "$PREFIX" in @@ -16108,7 +16196,6 @@ s%@inststaticdir@%$inststaticdir%g s%@instvardir@%$instvardir%g s%@srcdir@%$srcdir%g -s%@pkgdir@%$pkgdir%g s%@statedir@%$statedir%g s%@extra_includes@%$extra_includes%g s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g Index: configure.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.in,v retrieving revision 1.191 retrieving revision 1.195 diff -u -r1.191 -r1.195 --- configure.in 14 Feb 2003 07:38:22 -0000 1.191 +++ configure.in 24 Apr 2003 05:26:42 -0000 1.195 @@ -6,7 +6,7 @@ #### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois. #### Copyright (C) 1996, 1997 Sun Microsystems, Inc. -#### Copyright (C) 1995, 1996, 2002 Ben Wing. +#### Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. #### Copyright (C) 2000, 2001 Martin Buchholz. #### Copyright (C) 1998, 1999 J. Kean Johnston. @@ -359,7 +359,6 @@ moduledir='${libdir}/${instvardir}/${configuration}/modules' sitelispdir='${datadir}/${inststaticdir}/site-lisp' sitemoduledir='${libdir}/${inststaticdir}/site-modules' -pkgdir='${datadir}/${instvardir}/lisp' package_path='' etcdir='${datadir}/${instvardir}/etc' archlibdir='${libdir}/${instvardir}/${configuration}' @@ -770,7 +769,7 @@ dnl Has the user specified one of the path options? prefix | exec_prefix | bindir | datadir | statedir | libdir | \ - mandir | infodir | infopath | lispdir | etcdir | pkgdir | \ + mandir | infodir | infopath | lispdir | etcdir | \ archlibdir | docdir | package_path | moduledir ) dnl If the value was omitted, get it from the next argument. if test "$valomitted" = "yes"; then @@ -2528,10 +2527,12 @@ dnl check for Unix98 socklen_t AC_MSG_CHECKING(for socklen_t) -AC_TRY_COMPILE([#include +AC_TRY_COMPILE([#include +#include socklen_t x; ],[],[AC_MSG_RESULT(yes)],[ -AC_TRY_COMPILE([#include +AC_TRY_COMPILE([#include +#include int accept (int, struct sockaddr *, size_t *); ],[],[ AC_MSG_RESULT(size_t) @@ -3167,28 +3168,32 @@ if test "$with_msw" = "yes"; then have_dl=yes; else - dnl Find headers and libraries - AC_CHECK_HEADER(dlfcn.h, [ - AC_MSG_CHECKING([for dlopen in -lc]) - AC_TRY_LINK([#include ],dnl - [dlopen ("", 0);], [ have_dl=yes ], [ - AC_MSG_CHECKING([for dlopen in -ldl]) - ac_save_LIBS="$LIBS" - LIBS="-ldl $LIBS" - AC_TRY_LINK([#include ],dnl - [dlopen ("", 0);], [ have_dl=yes ], - [LIBS="$ac_save_LIBS"]) - ac_save_LIBS=])]) - if test -n "$have_dl"; then - AC_DEFINE(HAVE_DLOPEN) - else - AC_CHECK_LIB(dld, shl_load, [ - libdl=dld have_dl=yes; - AC_DEFINE(HAVE_SHL_LOAD)], [ - AC_CHECK_LIB(dld, dld_init, [ - libdl=dld have_dl=yes; - AC_DEFINE(HAVE_DLD_INIT)])]) - fi + case "$opsys" in + darwin ) have_dl=yes; AC_DEFINE(HAVE_DYLD) ;; + * ) + dnl Find headers and libraries + AC_CHECK_HEADER(dlfcn.h, [ + AC_MSG_CHECKING([for dlopen in -lc]) + AC_TRY_LINK([#include ],dnl + [dlopen ("", 0);], [ have_dl=yes ], [ + AC_MSG_CHECKING([for dlopen in -ldl]) + ac_save_LIBS="$LIBS" + LIBS="-ldl $LIBS" + AC_TRY_LINK([#include ],dnl + [dlopen ("", 0);], [ have_dl=yes ], + [LIBS="$ac_save_LIBS"]) + ac_save_LIBS=])]) + if test -n "$have_dl"; then + AC_DEFINE(HAVE_DLOPEN) + else + AC_CHECK_LIB(dld, shl_load, [ + libdl=dld have_dl=yes; + AC_DEFINE(HAVE_SHL_LOAD)], [ + AC_CHECK_LIB(dld, dld_init, [ + libdl=dld have_dl=yes; + AC_DEFINE(HAVE_DLD_INIT)])]) + fi + esac dnl end !darwin fi dnl end !MS-Windows if test -n "$have_dl"; then @@ -4156,6 +4161,61 @@ test -n "$ALLOCA" && XE_ADD_OBJS($ALLOCA) fi +AC_MSG_CHECKING(for working alloca in function calls) +AC_TRY_RUN([ +#if defined (__CYGWIN__) +#include +#elif defined (__GNUC__) +#define alloca __builtin_alloca +#elif defined (__DECC) +#include +#pragma intrinsic(alloca) +#elif defined (HAVE_ALLOCA_H) +#include +#elif defined (_AIX) +#pragma alloca +#elif ! defined (alloca) +#ifdef C_ALLOCA +#define alloca xemacs_c_alloca +#else +void *alloca (); +#endif /* C_ALLOCA */ +#endif /* !defined (alloca) */ + +void +f1 (double a, void *ptr, int b) +{ + unsigned char *ptr2 = (unsigned char *) ptr; + if (ptr2[0] != 0xBF || ptr2[1] != 0xBF || ptr2[3000] != 0xBF) + exit (1); + if (a != 3.1415 || b != -5490) + exit (1); +} + +int +f2 (short c, void *ptr, long e) +{ + unsigned char *ptr2 = (unsigned char *) ptr; + if (ptr2[0] != 0xFB || ptr2[1] != 0xFB || ptr2[1000] != 0xFB) + exit (1); + if (c != 665 || e != 776776776) + exit (1); + f1 (3.1415, memset (alloca (3001), 0xBF, 3001), -5490); + return 42; +} + +int +main (int argc, char *argv[]) +{ + if (f2 (665, memset (alloca (1001), 0xFB, 1001), 776776776) != 42) + return 1; + return 0; +} +], working_alloca_in_function_calls=yes, working_alloca_in_function_calls=no) +AC_MSG_RESULT($working_alloca_in_function_calls) +test "$working_alloca_in_function_calls" != "yes" && \ + AC_DEFINE(BROKEN_ALLOCA_IN_FUNCTION_CALLS) + dnl Check whether strcoll exists and works correctly. (This does more dnl than just check for its existence.) If so, it defines HAVE_STRCOLL. AC_FUNC_STRCOLL @@ -4741,7 +4801,6 @@ AC_SUBST(srcdir) AC_SUBST(bindir) AC_SUBST(datadir) -AC_SUBST(pkgdir) AC_SUBST(statedir) AC_SUBST(libdir) AC_SUBST(mandir) Index: version.sh =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/version.sh,v retrieving revision 1.348 retrieving revision 1.415 diff -u -r1.348 -r1.415 --- version.sh 16 Feb 2003 06:13:18 -0000 1.348 +++ version.sh 24 Apr 2003 23:41:31 -0000 1.415 @@ -2,8 +2,8 @@ emacs_is_beta=t emacs_major_version=21 emacs_minor_version=5 -emacs_beta_version=11 -xemacs_codename="cabbage" +emacs_beta_version=12 +xemacs_codename="carrot" xemacs_extra_name= emacs_kit_version= infodock_major_version=4 cvs server: Diffing dynodump cvs server: Diffing dynodump/i386 cvs server: Diffing dynodump/ppc cvs server: Diffing dynodump/sparc cvs server: Diffing etc Index: etc/BETA =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/BETA,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- etc/BETA 14 Feb 2003 23:33:15 -0000 1.34 +++ etc/BETA 3 Mar 2003 07:18:07 -0000 1.35 @@ -582,7 +582,7 @@ For help in creating new packages, see the (rather sparse) discussions in the XEmacs User's Guide and the Lisp Reference Manual. The XEmacs Package Release Engineer (Ville Skyttä is currently -serving with Peter Brown assisting; Steve +serving with Norbert Koch assisting; Steve Youngs and Stephen Turnbull also can help) are the most likely sources of advice. Index: etc/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/ChangeLog,v retrieving revision 1.19 retrieving revision 1.22 diff -u -r1.19 -r1.22 --- etc/ChangeLog 16 Feb 2003 06:13:21 -0000 1.19 +++ etc/ChangeLog 24 Apr 2003 23:41:34 -0000 1.22 @@ -1,3 +1,20 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-03-27 Stephen J. Turnbull + + * Emacs.ad: Global substition of .Xresources for .Xdefaults. + * sample.Xresources: Replaces sample.Xdefaults. + * sample.Xdefaults: Replace contents with pointer to + sample.Xresources. + * README: Change name of sample.Xdefaults to sample.Xresources. + Substitute 21.4 for 21.2. + +2003-03-03 Ville Skyttä + + * BETA (New packages): Introduce Norbert Koch. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. Index: etc/Emacs.ad =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/Emacs.ad,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- etc/Emacs.ad 11 Nov 2002 16:56:19 -0000 1.14 +++ etc/Emacs.ad 27 Mar 2003 12:57:44 -0000 1.15 @@ -1,6 +1,6 @@ ! This is the app-defaults file for XEmacs. ! -! This used to be identical to sample.Xdefaults, but the resources +! This used to be identical to sample.Xresources, but the resources ! below have been rewritten to be as general as possible to avoid ! overriding user resources. Other than the form rewriting, both ! files should be kept in sync. @@ -12,7 +12,7 @@ ! However, you may copy .../etc/Emacs.ad to /usr/lib/X11/app-defaults/Emacs ! (or whatever the standard app-defaults directory is at your site) to cause ! it to be consulted at run-time. (Do this only for site-wide customizations: -! personal customizations should be put into ~/.Xdefaults instead.) +! personal customizations should be put into ~/.Xresources instead.) ! Note that the file must be named Emacs, not XEmacs. ! ! See the NEWS file (C-h n) or XEmacs manual (C-h i) for a description of Index: etc/README =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/README,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- etc/README 12 Apr 2001 18:20:48 -0000 1.8 +++ etc/README 27 Mar 2003 12:57:44 -0000 1.9 @@ -21,11 +21,11 @@ MACHINES List of known machines configurations (OLD) MAILINGLISTS List of available Mailing lists MORE.STUFF List of useful unbundled packages -NEWS XEmacs 21.2 release information +NEWS XEmacs 21.4 release information ORDERS ORDERS.EUROPE ORDERS.JAPAN Order forms for GNU software -PACKAGES List of packages available for 21.2 release +PACKAGES List of packages available for 21.4 release README This file README.HYPERBOLE README.OO-BROWSER How to obtain Hyperbole and the OO-Browser @@ -60,7 +60,8 @@ recycle2.xpm Two versions of oversized Recycle cursor refcard.ps.gz Postscript version of XEmacs reference card refcard.tex XEmacs reference card -sample.Xdefaults Example ~/.Xdefaults file +sample.Xdefaults (legacy -- to be removed) +sample.Xresources Example ~/.Xresources file sample.init.el Example ~/.xemacs/init.el file sink.xbm A Gnu icon sparcworks/ Support files for Sparcworks Index: etc/sample.Xdefaults =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/sample.Xdefaults,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- etc/sample.Xdefaults 11 Nov 2002 16:56:19 -0000 1.5 +++ etc/sample.Xdefaults 27 Mar 2003 12:57:44 -0000 1.6 @@ -1,300 +1,3 @@ -! This is a sample .Xdefaults file. The resources below are the -! actual resources used as defaults for XEmacs, although the -! form of these resources in the XEmacs app-defaults file is -! slightly different. -! -! You can use the examples below as a basis for your own customizations: -! copy and modify any of the resources below into your own ~/.Xdefaults file. -! .Xdefaults specifies defaults for all applications, not just XEmacs; it is -! normally used to customize fonts, colors, and the like, while ~/.emacs is -! used to change other sorts of (XEmacs-specific) behavior. -! -! In general, changes to your .Xdefaults file will not take effect until the -! next time you restart the window system. To reload your resources -! explicitly, use the shell command -! -! xrdb -load ~/.Xdefaults -! -! The resources will take effect the next time you restart XEmacs. (Simply -! creating a new xemacs frame is not enough - you must restart the editor -! for the changes to take effect.) -! - - -! Colors and backgrounds. -! ====================== -! The contrasts of these colors will cause them to map to the appropriate -! one of "black" or "white" on monochrome systems. -! -! The valid color names on your system can be found by looking in the file -! `rgb.txt', usually found in /usr/lib/X11/ or /usr/openwin/lib/X11/. - -! Set the foreground and background colors of the `default' face. -! The default face colors are the base for most of the other faces' -! colors. The default background is gray80, and the default foreground -! is black. -Emacs.default.attributeBackground: gray80 -Emacs.default.attributeForeground: black - -! Set the modeline colors. -Emacs.modeline*attributeForeground: Black -Emacs.modeline*attributeBackground: Gray75 - -! Set the color of the text cursor. -Emacs.text-cursor*attributeBackground: Red3 - -! If you want to set the color of the mouse pointer, do this: -! Emacs.pointer*attributeForeground: Black -! If you want to set the background of the mouse pointer, do this: -! Emacs.pointer*attributeBackground: White -! Note that by default, the pointer foreground and background are the same -! as the default face. - -! Set the menubar colors. This overrides the default foreground and -! background colors specified above. -Emacs*menubar*Foreground: Gray30 -Emacs*menubar*Background: Gray75 -! This is for buttons in the menubar. -! Yellow would be better, but that would map to white on monochrome. -Emacs*menubar.buttonForeground: Blue -Emacs*XlwMenu.selectColor: ForestGreen -Emacs*XmToggleButton.selectColor: ForestGreen - -! Specify the colors of popup menus. -Emacs*popup*Foreground: Black -Emacs*popup*Background: Gray75 - -! Specify the colors of the various sub-widgets of the dialog boxes. -Emacs*dialog*Foreground: Black -! #A5C0C1 is a shade of blue -Emacs*dialog*Background: #A5C0C1 -! The following three are for Motif dialog boxes ... -Emacs*dialog*XmTextField*Background: WhiteSmoke -Emacs*dialog*XmText*Background: WhiteSmoke -Emacs*dialog*XmList*Background: WhiteSmoke -! While this one is for Athena dialog boxes. -Emacs*dialog*Command*Background: WhiteSmoke - -! Athena dialog boxes are sometimes built with the Xaw3d -! variant of the Athena toolkit. -! XEmacs being nice to 8bit displays, it defaults to: -Emacs*dialog*Command*beNiceToColormap: true -! If you are shocked by the ugliness of the 3d rendition, -! you may want to set (even on 8bit displays) the above to false. - -! Xlw Scrollbar colors -Emacs*XlwScrollBar.Foreground: Gray30 -Emacs*XlwScrollBar.Background: Gray75 -Emacs*XmScrollBar.Foreground: Gray30 -Emacs*XmScrollBar.Background: Gray75 - -! -! The Lucid Scrollbar supports two added resources, SliderStyle is either -! "plain" (default) or "dimple". Dimple puts a small dimple in the middle -! of the slider that depresses when the slider is clicked on. ArrowPosition is -! either "opposite" (default) or "same". Opposite puts the arrows at opposite -! of the scrollbar, same puts both arrows at the same end, like the Amiga. -! -! Emacs*XlwScrollBar.SliderStyle: dimple -! Emacs*XlwScrollBar.ArrowPosition: opposite - - -! -! If you want to turn off a toolbar, set its height or width to 0. -! The correct size value is not really arbitrary. We only control it -! this way in order to avoid excess frame resizing when turning the -! toolbars on and off. -! -! To change the heights and widths of the toolbars: -! -! Emacs.topToolBarHeight: 37 -! Emacs.bottomToolBarHeight: 0 -! Emacs.leftToolBarWidth: 0 -! Emacs.rightToolBarWidth: 0 - -Emacs*topToolBarShadowColor: Gray90 -Emacs*bottomToolBarShadowColor: Gray40 -Emacs*backgroundToolBarColor: Gray75 -Emacs*toolBarShadowThickness: 2 - - -! If you want to turn off vertical scrollbars, or change the default -! pixel width of the vertical scrollbars, do it like this (0 width -! means no vertical scrollbars): -! -! Emacs.scrollBarWidth: 0 -! -! To change it for a particular frame, do this: -! -! Emacs*FRAME-NAME.scrollBarWidth: 0 - - -! If you want to turn off horizontal scrollbars, or change the default -! pixel height of the horizontal scrollbars, do it like this (0 height -! means no horizontal scrollbars): -! -! Emacs.scrollBarHeight: 0 -! -! To change it for a particular frame, do this: -! -! Emacs*FRAME-NAME.scrollBarHeight: 0 - - -! To dynamically change the labels used for menubar buttons... -! -! Emacs*XlwMenu.resourceLabels: True -! Emacs*XlwMenu.newFrame.labelString: Open Another Window - -! To have the Motif scrollbars on the left instead of the right, do this: -! -! Emacs*scrollBarPlacement: BOTTOM_LEFT -! -! To have the Athena scrollbars on the right, use `BOTTOM_RIGHT' instead - -! To have Motif scrollbars act more like Xt scrollbars... -! -! Emacs*XmScrollBar.translations: #override \n\ -! : PageDownOrRight(0) \n\ -! : PageUpOrLeft(0) - -! Fonts. -! ====== -! XEmacs requires the use of XLFD (X Logical Font Description) format font -! names, which look like -! -! *-courier-medium-r-*-*-*-120-*-*-*-*-*-* -! -! if you use any of the other, less strict font name formats, some of which -! look like -! lucidasanstypewriter-12 -! and fixed -! and 9x13 -! -! then XEmacs won't be able to guess the names of the bold and italic versions. -! All X fonts can be referred to via XLFD-style names, so you should use those -! forms. See the man pages for X(1), xlsfonts(1), and xfontsel(1). - - -! The default font for the text area of XEmacs is chosen at run-time -! by lisp code which tries a number of different possibilities in order -! of preference. If you wish to override it, use this: -! -! Emacs.default.attributeFont: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-* - -! If you choose a font which does not have an italic version, you can specify -! some other font to use for it here: -! -! Emacs.italic.attributeFont: -*-courier-medium-o-*-*-*-120-*-*-*-*-iso8859-* -! -! If you choose a font which does not have a bold-italic version, -! you can specify some other font to use for it here: -! -! Emacs.bold-italic.attributeFont: -*-courier-bold-o-*-*-*-120-*-*-*-*-iso8859-* -! -! And here is how you would set the background color of the `highlight' face, -! but only on the screen named `debugger': -! -! Emacs*debugger.highlight.attributeBackground: PaleTurquoise -! -! See the NEWS file (C-h n) for a more complete description of the resource -! syntax of faces. - - -! Font of the modeline, menubar and pop-up menus. -! Note that the menubar resources do not use the `face' syntax, since they -! are X toolkit widgets and thus outside the domain of XEmacs proper. -! -Emacs*menubar*Font: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-* -Emacs*popup*Font: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-* - -! Font in the Motif dialog boxes. -! (Motif uses `fontList' while most other things use `font' - if you don't -! know why you probably don't want to.) -! -Emacs*XmDialogShell*FontList: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-* -Emacs*XmTextField*FontList: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-* -Emacs*XmText*FontList: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-* -Emacs*XmList*FontList: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-* - -! Font in the Athena dialog boxes. -! I think 14-point looks nicer than 12-point. -! Some people use 12-point anyway because you get more text, but -! there's no purpose at all in doing this for dialog boxes. - -Emacs*Dialog*Font: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-* - -! Dialog box translations. -! ======================= - -! This accelerator binds in a dialog box to on button1 -Emacs*dialog*button1.accelerators:#override\ -Return: ArmAndActivate()\n\ -KP_Enter: ArmAndActivate()\n\ -Ctrlm: ArmAndActivate()\n - -! Translations to make the TextField widget behave more like XEmacs -Emacs*XmTextField.translations: #override\n\ - !osfBackSpace: delete-previous-character()\n\ - !osfDelete: delete-previous-character()\n\ - !Ctrlh: delete-previous-character()\n\ - !Ctrld: delete-next-character()\n\ - !MetaosfDelete: delete-previous-word()\n\ - !MetaosfBackSpace: delete-previous-word()\n\ - !Metad: delete-next-word()\n\ - !Ctrlk: delete-to-end-of-line()\n\ - !Ctrlg: process-cancel()\n\ - !Ctrlb: backward-character()\n\ - !osfLeft: backward-character()\n\ - !Ctrlf: forward-character()\n\ - !osfRight: forward-character()\n\ - !Metab: backward-word()\n\ - !MetaosfLeft: backward-word()\n\ - !Metaf: forward-word()\n\ - !MetaosfRight: forward-word()\n\ - !Ctrle: end-of-line()\n\ - !Ctrla: beginning-of-line()\n\ - !Ctrlw: cut-clipboard()\n\ - !Metaw: copy-clipboard()\n\ - : copy-primary()\n - -! With the XEmacs typeahead it's better to not have space be bound to -! ArmAndActivate() for buttons that appear in dialog boxes. This is -! not 100% Motif compliant but the benefits far outweight the -! compliancy problem. -Emacs*dialog*XmPushButton.translations:#override\n\ - : Arm()\n\ - ,: Activate()\ - Disarm()\n\ - (2+): MultiArm()\n\ - (2+): MultiActivate()\n\ - : Activate()\ - Disarm()\n\ - osfSelect: ArmAndActivate()\n\ - osfActivate: ArmAndActivate()\n\ - osfHelp: Help()\n\ - ~Shift ~Meta ~Alt Return: ArmAndActivate()\n\ - : Enter()\n\ - : Leave()\n - -! XIM input method style -! ======================= - -! ximStyles is a (whitespace or comma-separated) list of XIMStyles in -! order of user's preference. -! Choose a subset of the following styles or reorder to taste -Emacs*ximStyles: XIMPreeditPosition|XIMStatusArea\ - XIMPreeditPosition|XIMStatusNothing\ - XIMPreeditPosition|XIMStatusNone\ - XIMPreeditNothing|XIMStatusArea\ - XIMPreeditNothing|XIMStatusNothing\ - XIMPreeditNothing|XIMStatusNone\ - XIMPreeditNone|XIMStatusArea\ - XIMPreeditNone|XIMStatusNothing\ - XIMPreeditNone|XIMStatusNone - -! XIM Preedit and Status foreground and background -Emacs*EmacsFrame.ximForeground: black -Emacs*EmacsFrame.ximBackground: white - -! XIM fontset (defaults to system fontset default) -! Emacs*EmacsFrame.FontSet: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-* +! This is a transitional placeholder file which will be removed for +! the release. See sample.Xresources for information about resource +! specs for XEmacs. cvs server: Diffing etc/custom cvs server: Diffing etc/custom/example-themes cvs server: Diffing etc/eos cvs server: Diffing etc/idd cvs server: Diffing etc/photos cvs server: Diffing etc/sparcworks cvs server: Diffing etc/tests cvs server: Diffing etc/tests/external-widget cvs server: Diffing etc/toolbar cvs server: Diffing etc/unicode cvs server: Diffing etc/unicode/ibm cvs server: Diffing etc/unicode/mule-ucs cvs server: Diffing etc/unicode/other cvs server: Diffing etc/unicode/unicode-consortium cvs server: Diffing info cvs server: Diffing lib-src Index: lib-src/.cvsignore =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/.cvsignore,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- lib-src/.cvsignore 27 Nov 2002 07:15:02 -0000 1.4 +++ lib-src/.cvsignore 16 Mar 2003 21:02:01 -0000 1.5 @@ -26,3 +26,4 @@ *.pdb *.idb *.ilk +make-dump-id Index: lib-src/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/ChangeLog,v retrieving revision 1.155 retrieving revision 1.158 diff -u -r1.155 -r1.158 --- lib-src/ChangeLog 16 Feb 2003 06:13:23 -0000 1.155 +++ lib-src/ChangeLog 24 Apr 2003 23:41:34 -0000 1.158 @@ -1,3 +1,17 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-02-09 Ville Skyttä + + * config.values.in (pkgdir): Remove (unused). + +2003-03-06 Ben Wing + + * i.c: + * i.c (pump): + Sleep between calls to check for I/O, since these calls are non-blocking. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. Index: lib-src/config.values.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/config.values.in,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- lib-src/config.values.in 10 Sep 2002 15:27:03 -0000 1.21 +++ lib-src/config.values.in 9 Mar 2003 17:23:59 -0000 1.22 @@ -132,7 +132,6 @@ oldincludedir "@oldincludedir@" opsysfile "@opsysfile@" package_path "@package_path@" -pkgdir "@pkgdir@" postgresql_libs "@postgresql_libs@" prefix "@prefix@" program_transform_name "@program_transform_name@" Index: lib-src/i.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/i.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- lib-src/i.c 5 May 2002 11:30:16 -0000 1.3 +++ lib-src/i.c 9 Mar 2003 02:27:28 -0000 1.4 @@ -1,6 +1,6 @@ /* I-connector utility Copyright (C) 2000 Kirill M. Katsnelson - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -67,9 +67,18 @@ BYTE buffer [256]; DWORD really_read, unused; + /* The docs for ReadFile claim: + + The ReadFile function returns when one of the following is true: a write + operation completes on the write end of the pipe, the number of bytes + requested has been read, or an error occurs. + + But this is just not true. ReadFile never seems to block, and unless we + Sleep(), we will chew up all the CPU time. --ben + */ while (ReadFile (pi->source, buffer, sizeof (buffer), &really_read, NULL) && WriteFile (pi->drain, buffer, really_read, &unused, NULL)) - ; + Sleep (100); return 0; } cvs server: Diffing lisp Index: lisp/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v retrieving revision 1.478 retrieving revision 1.498 diff -u -r1.478 -r1.498 --- lisp/ChangeLog 16 Feb 2003 06:13:24 -0000 1.478 +++ lisp/ChangeLog 24 Apr 2003 23:41:35 -0000 1.498 @@ -1,3 +1,694 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-04-24 Steve Youngs + + * font-lock.el (font-lock-match-java-declarations): Move + save-restriction, narrow-to-region to beginning of function to + avoid going beyond the limit and causing an infloop. + From Jin Choi . + +2003-04-24 Vasily Korytov + + * lisp-mode.el (emacs-lisp-mode-hook, lisp-mode-hook, + lisp-interaction-mode-hook): Add the docstrings. + +2003-04-23 Stephen J. Turnbull + + * subr.el (split-string): Revert to regular behavior, except when + both separators and omit-nulls are nil. + (split-string-default-separators): New constant. + +2003-04-15 Reiner Steib + + * info.el (info): Support `(filename)nodename' as argument. + +2003-04-14 Steve Youngs + + * package-admin.el (package-admin-find-top-directory): Use + 'directory-sep-char'. + (package-admin-get-install-dir): Ditto. + This is so PUI won't break on platforms that don't use '/' as the + directory separator. + + * package-get.el (package-get-pgp-available-p): New. + (package-get-require-signed-base-updates): Use it. + (package-get-update-base-from-buffer): Move the code that finds + the gpg stuff into `package-get-pgp-available-p'. + Now if you have Mailcrypt and a PGP binary installed and set up on + your system, PUI will automatically default to doing PGP + verification, otherwise it'll default to off. + (package-get-require-base): Use the DATUM arg to `error'. + (package-get-locate-index-file): Ditto. + (package-get-update-base): Ditto. + (package-get-update-base-entries): Ditto. + (package-get-all): Ditto. + (package-get-dependencies): Ditto. + (package-get-info): Ditto. + (package-get): Ditto. + + * package-info.el (batch-update-package-info): Use the DATUM arg + to `error'. + + * package-net.el (package-net-batch-generate-bin-ini): Use the + DATUM arg to `error'. + + * package-ui.el (pui-toggle-package-key): Use the DATUM arg to + `error'. + (pui-toggle-package-delete-key): Ditto. + (pui-install-selected-packages): Ditto. + (pui-add-required-packages): Ditto. + (pui-display-info): Ditto. + (list-packages-mode): Ditto. + + * packages.el (package-require): Use the DATUM arg to `error'. + +2003-03-27 Stephen J. Turnbull + + * menubar-items.el (default-menubar): + * startup.el (in comment): + Global substitution: .Xresources for .Xdefaults. + +2003-03-24 Jerry James + + * window-xemacs.el (saved-window-equal): Use equal instead of = to + compare saved-window-modeline-hscroll values. + +2003-03-25 Steve Youngs + + * package-admin.el: (package-admin-delete-binary-package): Only + delete the lisp directory if it exists. + (package-admin-find-top-directory): New. + (package-admin-get-install-dir): Use it. + + * package-get.el (package-get-install-to-user-init-directory): + New. If non-nil install packages under `user-init-directory'. + (package-get): `package-admin-get-install-dir' only takes 2 args. + + * package-ui.el (pui-install-selected-packages): The 2nd arg to + `package-admin-get-install-dir' is optional, no need to specify nil. + +2003-03-24 Stephen J. Turnbull + + * wid-edit.el (widget-url-link-action): Typo fix. Thx, Adrian! + +2003-03-23 Adrian Aichner + + * menubar-items.el (default-menubar): Reword "Add Download Site" + to the more appropriate "Set Download Site". Categorize download + sites under separate menu entries for "Offical", "Pre-", and + "Site" Releases so that users only need to customize + `package-get-site-release-download-sites'. + * package-get.el (package-get-download-sites): Fix typo. + * package-get.el (package-get-site-release-download-sites): New. + Add support for "Site Releases". + * package-ui.el (package-ui-site-release-download-menu): New. + Ditto. + +2003-03-21 Adrian Aichner + + * package-get.el: Globally remove trailing whitespace. + * package-get.el (package-get-download-sites): Add more sites. + * package-get.el (package-get-pre-release-download-sites): Add + more sites. + +2003-03-20 Steve Youngs + + * menubar-items.el (default-menubar): Add a "Pre-Release Download + Sites" submenu to "Tools -> Packages" menu. + + Filter the package download sites menus through + `menu-split-long-menu'. + + * obsolete.el (pui-add-install-directory): New. + (package-get-download-menu): New. + + * package-admin.el: (package-admin-add-single-file-package): + Removed. + (package-admin-get-install-dir): Don't rely on an installed + xemacs-base package to guess where a package needs to be installed + to. + (package-admin-get-manifest-file): Whitespace clean up. + (package-admin-check-manifest): Use `directory-sep-char' to + compute regexp. + + Only search 'lisp' and 'man' directories to determine package + name. + + Don't error is xemacs-base package isn't installed, just don't + sort the MANIFEST file and issue a warning. + (package-admin-add-binary-package): Whitespace clean up. + (package-admin-get-lispdir): Ditto. + (package-admin-delete-binary-package): Use `with-temp-buffer' + instead of creating a temporary buffer manually. + + * package-get.el: (package-get-remote): Change custom type so that + only either a single directory or remote host:directory can be + selected. + (package-get-download-sites): Put the sites into alphabetical + order of country. + + Make the description element be "Country (site)" instead of the + other way around. + (package-get-pre-release-download-sites): New. + (package-get-require-signed-base-updates): Default to t. + (package-get-download-menu): Removed. + (package-get-locate-file): Change to reflect new format of + 'package-get-remote'. + (package-get-update-base-from-buffer): Whitespace clean up and + remove an unneccessary 'when'. + (package-get-interactive-package-query): Whitespace clean up. + (package-get-update-all): Ditto. + (package-get-all): Ditto. + (package-get-init-package): Ditto. + (package-get-info): New. + (package-get): Bring into line with new format of + 'package-get-remote'. + + Error if non-Mule XEmacsen try to install Mule packages. + + Don't rely on a Mule package having 'mule-base' in its + "REQUIRES" to determine if it is a Mule package or not, + instead we test "CATEGORY". + + Better handling of the situation where a partial package tarball + exists on the local hard drive from a previous interupted + download. + + Clean up after a failed package install. + (package-get-set-version-prop): Removed. + (package-get-installedp): Whitespace clean up. + + * package-ui.el: Whitespace clean up. + (pui-info-buffer): Make it a defcustom. + (pui-directory-exists): Removed. + (pui-package-dir-list): Removed. + (pui-add-install-directory): Removed. + (package-ui-download-menu): New. + (package-ui-pre-release-download-menu): New. + (pui-set-local-package-get-directory): New. + (pui-package-symbol-char): Whitespace clean up. + (pui-update-package-display): Ditto. + (pui-toggle-package): Ditto. + (pui-toggle-package-key): Ditto. + (pui-toggle-package-delete): Ditto. + (pui-toggle-package-delete-key): Ditto. + (pui-toggle-package-event): Ditto. + (pui-toggle-verbosity-redisplay): Ditto. + (pui-install-selected-packages): Ditto. + (pui-help-echo): Ditto. + (pui-display-info): Ditto. + (pui-list-packages): Ditto. + + * packages.el: Whitespace clean up. + +2003-03-18 Stephen J. Turnbull + + * gutter-items.el (buffers-tab-filter-functions): Improve docstring. + Suggested by a Chris Palmer patch. + +2003-03-02 Stephen Turnbull + + * wid-edit.el: Many XEmacs-specific comments added. + (missing-package): New error type. + (link widget): Use it. + (widget-sublist): + Move to section with other generic utilities. + (sexp widget): + (widget-sexp-value-to-internal): + (widget-sexp-validate): + (widget-sexp-prompt-value-history): + (widget-sexp-prompt-value): + Move to top of sexp section. + (finder-commentary): + Redundant autoload removed. + (widget-princ-to-string): + Use `prin1-to-string'. Add docstring. + (widget-prettyprint-to-string): + Use `with-temp-buffer'. Add docstring. + (widget-convert): + Use `keywordp'. Improve comments. + (symbol widget): + Change default value to `t' to distinguish from lists. + (widget-edit-functions): + Add docstring. + (widget-field-new): + (widget-field-list): + Convert comments to docstrings. + (widget-default-prompt-value): + Fix docstring, improve comments. + (widget-field-add-space): + (widget-create): + (widget-create-child-and-convert): + (widget-create-child): + (widget-create-child-value): + (push-button widget): + (checklist widget): + (option widget): + (radio-button-choice widget): + (radio widget): + (list widget): + (vector widget): + Improve docstrings. + +2003-03-06 Ben Wing + + * behavior.el (define-behavior): + Allow other keywords for forward compatibility. + + * cl-macs.el (loop): + Rewrite to eliminate byte-compiler warning when `return' is used + without `finally'. + + * cmdloop.el (file-error): + Avoid truncated error messages for `end-of-file' and the like. + + * cmdloop.el (read-quoted-char): + Avoid char-int error after syncing. + + * files.el (find-file-noselect): + * files.el (recover-file): + * files.el (recover-session-finish): + Eliminate byte-compile warnings. + + * printer.el (generate-header-line): + Fix line-width calculations. + #### This used to work. Someone's changes (perhaps by + Michael Sperber?) seem to have messed something up. + + * simple.el (clear-message): + * simple.el (append-message): + * simple.el (raw-append-message): + Use new clear-left-side functions to avoid messages ending up on + the same line as other output. + +2003-03-03 Stephen J. Turnbull + + * files.el (save-abbrevs): Fixup whitespace. + +2003-02-26 Stephen J. Turnbull + + * subr.el (custom-declare-variable-early): Reference + dumped-lisp.el in comment. + + * custom.el (at end): Remark about `custom-declare-variable-list'. + +2003-03-01 Ben Wing + + * cmdloop.el: + * cmdloop.el (read-quoted-char-radix): New. + * cmdloop.el (read-quoted-char): + * cmdloop.el (momentary-string-display): + * custom.el: + * custom.el (custom-initialize-set): + * custom.el (custom-initialize-reset): + * custom.el (custom-initialize-changed): + * custom.el (custom-declare-variable): + * custom.el (defcustom): + * dumped-lisp.el (preloaded-file-list): + * files.el: + * files.el (delete-auto-save-files): New. + * files.el (directory-abbrev-alist): + * files.el (make-backup-files): + * files.el (backup-by-copying-when-privileged-mismatch): New. + * files.el (normal-backup-enable-predicate): New. + * files.el (buffer-offer-save): + * files.el (small-temporary-file-directory): New. + * files.el (null-device): New. + * files.el (version-control): + * files.el (auto-save-file-name-transforms): New. + * files.el (save-abbrevs): + * files.el (find-directory-functions): New. + * files.el (find-file-not-found-hooks): + * files.el (write-file-hooks): + * files.el (write-contents-hooks): + * files.el (write-file-data-hooks): + * files.el (enable-local-variables): + * files.el ((fboundp 'file-locked-p)): + * files.el (view-read-only): New. + * files.el (cd-absolute): + * files.el (load-file): + * files.el (file-local-copy): + * files.el (file-chase-links): + * files.el (switch-to-buffer-other-window): + * files.el (switch-to-buffer-other-frame): + * files.el (find-file): + * files.el (find-file-other-window): + * files.el (find-file-other-frame): + * files.el (find-file-read-only): + * files.el (find-file-read-only-other-window): + * files.el (find-file-read-only-other-frame): + * files.el (abbreviate-file-name): + * files.el (find-buffer-visiting): + * files.el (find-file-wildcards): New. + * files.el (find-file-suppress-same-file-warnings): New. + * files.el (find-file-noselect): New. + * files.el (find-file-noselect-1): New. + * files.el (insert-file-contents-literally): + * files.el (insert-file-literally): New. + * files.el (after-find-file-from-revert-buffer): + * files.el (after-find-file): + * files.el (normal-mode): + * files.el (find-file-literally): New. + * files.el (dabbrev-case-fold-search): + * files.el (hack-one-local-variable-quotep): New. + * files.el (hack-one-local-variable): + * files.el (set-visited-file-name): + * files.el (write-file): + * files.el (backup-buffer): + * files.el (make-backup-file-name-function): New. + * files.el (backup-directory-alist): New. + * files.el (make-backup-file-name): + * files.el (make-backup-file-name-1): New. + * files.el (backup-extract-version-start): + * files.el (backup-extract-version-start)): New. + * files.el (file-relative-name): + * files.el (save-buffer): + * files.el (delete-auto-save-file-if-necessary): + * files.el (save-buffer-coding-system): New. + * files.el (basic-save-buffer): + * files.el (basic-save-buffer-1): + * files.el (basic-save-buffer-2): New. + * files.el (save-some-buffers): + * files.el (save-some-buffers-1): + * files.el (toggle-read-only): + * files.el (file-newest-backup): + * files.el (rename-uniquely): + * files.el (revert-buffer-insert-file-contents-function): + * files.el (recover-file): + * files.el (recover-session): + * files.el (recover-session-finish): + * files.el (kill-some-buffers): + * files.el (wildcard-to-regexp): + * files.el (file-expand-wildcards): New. + * files.el (list-directory): + * files.el (shell-quote-wildcard-pattern): New. + * files.el (insert-directory-safely): New. + * files.el (confirm-kill-emacs): New. + * files.el (save-buffers-kill-emacs): + * files.el (file-name-non-special): New. + * keydefs.el (global-map): New. + * keymap.el: + * keymap.el (kbd): Removed. + * keymap.el (substitute-key-definition): + * lisp-mode.el (construct-lisp-mode-menu): + * make-docfile.el (custom-declare-variable-list): New. + * replace.el: + * replace.el (match-string): Removed. + * replace.el (save-match-data): Removed. + * simple.el: + * simple.el (comment-column): Removed. + * simple.el (comment-start): Removed. + * simple.el (comment-start-skip): Removed. + * simple.el (comment-end): Removed. + * simple.el (comment-indent-hook): Removed. + * simple.el (comment-indent-function): Removed. + * simple.el (block-comment-start): Removed. + * simple.el (block-comment-end): Removed. + * simple.el (indent-for-comment): Removed. + * simple.el (set-comment-column): Removed. + * simple.el (kill-comment): Removed. + * simple.el (comment-padding): Removed. + * simple.el (comment-region): Removed. + * simple.el (comment-multi-line): Removed. + * simple.el (set-selective-display): + * simple.el (indent-new-comment-line): Removed. + * simple.el (overwrite-mode-textual): + * simple.el (overwrite-mode): + * simple.el (binary-overwrite-mode): + * simple.el (mail-user-agent): + * simple.el (rfc822-goto-eoh): New. + * simple.el (sendmail-user-agent-compose): + * simple.el (mh-e-user-agent): + * simple.el (set-variable-value-history): New. + * simple.el (set-variable): + * simple.el (clone-buffer-hook): New. + * simple.el (clone-process): New. + * simple.el (clone-buffer): New. + * simple.el (clone-indirect-buffer): New. + * simple.el (clone-indirect-buffer-other-window): New. + * subr.el: + * subr.el (custom-declare-variable-list): New. + * subr.el (custom-declare-variable-early): New. + * subr.el (assoc-default): New. + * subr.el (assoc-ignore-case): New. + * subr.el (assoc-ignore-representation): New. + * subr.el (member-ignore-case): New. + * subr.el ('move-marker): New. + * subr.el ('beep): New. + * subr.el ('indent-to-column): New. + * subr.el ('backward-delete-char): New. + * subr.el ('search-forward-regexp): New. + * subr.el ('search-backward-regexp): New. + * subr.el ('remove-directory): New. + * subr.el ('set-match-data): New. + * subr.el ('send-string-to-terminal): New. + * subr.el (make-local-hook): + * subr.el (add-hook): + * subr.el (remove-hook): + * subr.el (add-local-hook): + * subr.el (remove-local-hook): + * subr.el (add-one-shot-hook): + * subr.el (add-local-one-shot-hook): + * subr.el (string-equal-ignore-case): Removed. + * subr.el (with-current-buffer): + * subr.el (with-output-to-string): Removed. + * subr.el (replace-in-string): Removed. + * subr.el (split-string): Removed. + * subr.el (with-temp-message): + * subr.el (with-syntax-table): New. + * subr.el (save-match-data): New. + * subr.el (match-string): New. + * subr.el (match-string-no-properties): New. + * subr.el (subst-char-in-string): New. + * subr.el (replace-regexp-in-string): New. + * subr.el (truncate-string-to-width): + * subr.el (eval-after-load): + * view-less.el: + * wid-edit.el: + * wid-edit.el (widget-url-link-action): + Lots of syncing with FSF 21.2. + Use if-fboundp in wid-edit.el. + New file newcomment.el from FSF. + +2003-02-26 Stephen J. Turnbull + + * dumped-lisp.el (preloaded-file-list): Add markers for use of + defcustom v. custom-declare-variable-early. + + * make-docfile.el (custom-declare-variable-list): Defvar to prevent + custom (required from raw-process) from barfing a void-variable error. + +2003-02-26 Stephen J. Turnbull + + * view-less.el (view-minor-mode): Add autoload cookie. + +2003-02-28 Ben Wing + + * dump-paths.el: + * dump-paths.el (startup-setup-paths): Removed. + * dumped-lisp.el (preloaded-file-list): + Delete. Combine stuff into setup-paths.el. + + * find-paths.el: + * find-paths.el (paths-chase-symlink): + * find-paths.el (paths-emacs-root-p): Removed. + * find-paths.el (paths-construct-path): + * find-paths.el (paths-find-emacs-root): Removed. + * find-paths.el (paths-emacs-data-root-p): Removed. + * find-paths.el (paths-find-emacs-roots): Removed. + Make this file contain generic routines only. Move stuff to + compute Emacs roots to setup-paths.el. + + * startup.el: + * startup.el (emacs-roots): Removed. + * startup.el (emacs-data-roots): Removed. + * startup.el (user-init-directory-base): Removed. + * startup.el (user-init-directory): Removed. + * startup.el (user-init-file-base): Removed. + * startup.el (user-init-file-base-list): Removed. + * startup.el (user-home-init-file-base-list): Removed. + * startup.el (load-home-init-file): Removed. + * startup.el (load-user-init-file-p): Removed. + Move these variables into setup-paths.el. + + * setup-paths.el: + * setup-paths.el (emacs-roots): New. + * setup-paths.el (emacs-data-roots): New. + * setup-paths.el (user-init-directory-base): New. + * setup-paths.el (user-init-directory): New. + * setup-paths.el (user-init-file-base): New. + * setup-paths.el (user-init-file-base-list): New. + * setup-paths.el (user-home-init-file-base-list): New. + * setup-paths.el (load-home-init-file): New. + * setup-paths.el (load-user-init-file-p): New. + * setup-paths.el (paths-emacs-root-p): New. + * setup-paths.el (paths-emacs-data-root-p): New. + * setup-paths.el (paths-find-emacs-root): New. + * setup-paths.el (paths-find-emacs-roots): New. + * setup-paths.el (startup-find-load-path): New. + * setup-paths.el (startup-setup-paths): New. + * setup-paths.el (configure-package-path): New. + * setup-paths.el (startup-find-load-path-for-packages): New. + * startup.el (normal-top-level): + * startup.el (startup-find-roots-warning): Removed. + Combine all high-level code for computing the paths into + setup-paths.el. Create new function startup-find-load-path to + encapsulate all logic for computing `load-path'. Eliminate + invocation-directory and invocation-name parameters since + there is no point (false generality) -- the code references + other globals, which cannot be specified. Eliminate some code + duplicated between setup-paths.el and startup.el. Clean up + the debug-paths code and output load-path in addition. + Add logic to paths-emacs-root-p to support separated source + and build trees. + + * loadup.el: + * loadup.el (build-root): New. + * loadup.el (source-lisp): New. + * loadup.el (source-root): New. + * loadup.el (really-early-error-handler): + * make-docfile.el: + * make-docfile.el (build-root): New. + * make-docfile.el (build-lib-src): New. + * make-docfile.el (source-lisp): New. + * make-docfile.el (source-src): New. + * make-docfile.el (process-args): + * make-docfile.el (load-path): + * make-docfile.el ("raw-process.el"): + * make-docfile.el ((preloaded-file-list)): + * make-docfile.el (docfile-out-of-date): + * update-elc-2.el (batch-update-elc-2): + * update-elc.el: + * update-elc.el (undumped-exe): Removed. + * update-elc.el (dumped-exe-out-of-date-wrt-dump-files): Removed. + * update-elc.el (exe-target): New. + * update-elc.el (dump-target): New. + * update-elc.el (dump-target-out-of-date-wrt-dump-files): New. + * update-elc.el (build-root): New. + * update-elc.el (source-lisp): New. + * update-elc.el (source-lisp-mule): New. + * update-elc.el (source-root): New. + * update-elc.el (aa-lisp): New. + * update-elc.el (aac-lisp): New. + * update-elc.el (aa-lisp-mule): New. + * update-elc.el (aac-lisp-mule): New. + * update-elc.el ((preloaded-file-list site-load-packages files-to-process)): + Rewrite to allow for separated source and build trees, as may occur + in MS Windows. + + NOTE TO BUILD HACKERS: + + loadup.el, make-docfile.el, update-elc.el and update-elc-2.el made two + assumptions that are no longer correct: + + (1) The source and build trees are in the same place. + (2) They can make assumptions about where `.' is. + + These files now compute the locations of the source and build + roots at the top of the file. *ALL* constant file names or path + snippets must now be made absolute using expand-file-name and one + of these roots. + + * dumped-lisp.el: + * dumped-lisp.el (packages-hardcoded-lisp): New. + * packages.el: + * packages.el (packages-hardcoded-lisp): Removed. + * packages.el (packages-useful-lisp): Removed. + * packages.el (packages-unbytecompiled-lisp): Removed. + Remove some unused lists of Lisp files. packages-hardcoded-lisp + (empty, in any case) moved to dumped-lisp.el. + + * startup.el (find-init-file-1): New. + * startup.el (find-user-home-directory-init-file): + When a compiled init file is out-of-date wrt the uncompiled + version, load the uncompiled version and issue a nasty warning. + + * update-elc-2.el (batch-update-elc-2): + Force touching of auto-autoloads files when REBUILD_AUTOLOADS + was set. + + * update-elc.el ((preloaded-file-list site-load-packages files-to-process)): + Fix code that checks whether dumping is necessary to check against + xemacs.dmp, not xemacs.exe, when Unix and pdump. + +2003-02-20 Ben Wing + + * mule/mule-cmds.el: + * mule/mule-cmds.el (get-native-coding-system-from-language-environment): + * mule/mule-cmds.el (set-language-environment-coding-systems): + * mule/mule-cmds.el (init-locale-at-early-startup): + Alias file-name to native not vice-versa. + Do set EOL of native but not of process output to fix various + problems and be consistent with code-init.el. + +2003-02-20 Ben Wing + + * code-cmds.el (coding-system-change-eol-conversion): + Return a name not a coding system. + + * code-init.el: + * code-init.el (coding-system-default-variable-list): + * code-init.el (get-coding-system-variable): + * code-init.el (set-coding-system-variable): + * code-init.el (coding-system-variable-default-value): + Reindent. Remove `file-name' since it should always be the same + as native. + + * unicode.el (load-unicode-tables): + Rename to load-unicode-mapping-table as suggested by the anonymous + (but rather Turnbullian) comment in unicode.c. + +2003-02-19 Ben Wing + + * mule/mule-msw-init.el: + * mule/mule-msw-init.el ('mswindows-multibyte-system-default): Removed. + Delete this file. + + * mule/mule-win32-init.el: + New file, with stuff from mule-msw-init.el -- not just for MS Windows + native, boys and girls! + + * bytecomp.el (byte-compile-insert-header): + Change code inserted to catch trying to load a Mule-only .elc + file in a non-Mule XEmacs. Formerly you got the rather cryptic + "The required feature `mule' cannot be provided". Now you get + "Loading this file requires Mule support". + + * finder.el (finder-compile-keywords): + Remove dependency on which directory this function is invoked + from. + + * update-elc.el: + Don't mess around with ../src/BYTECOMPILE_CHANGE. Now that + Makefile.in.in and xemacs.mak are in sync, both of them use + NEEDTODUMP and the other one isn't used. + + * dumped-lisp.el: + * dumped-lisp.el (preloaded-file-list): + Rewrite in terms of `list' and `nconc' instead of assemble-list, so + we can have arbitrary forms, not just `when-feature'. + + * very-early-lisp.el: Nuke this file. + + * finder-inf.el: + * packages.el: + * update-elc.el: + * update-elc-2.el: + * loadup.el: + * make-docfile.el: + Eliminate references to very-early-lisp. + + * msw-glyphs.el: + Comment clarification. + +2003-02-17 Stephen J. Turnbull + + * mule/mule-charset.el (charsets-in-region): Remove broken + optimization to get slight speed-up. + (charsets-in-string): Use mapc to iterate in C. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. @@ -15920,7 +16611,7 @@ * prim/profile.el (profiling-results): Renamed from `pretty-print-profiling-info'. -1997-10-03 Karl M. Hegbloom > +1997-10-03 Karl M. Hegbloom * custom/cus-edit.el (custom-save-all): Bind `auto-mode-alist' to nil around the init file handling to prevent unnecessary automagic Index: lisp/behavior.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/behavior.el,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- lisp/behavior.el 2 Jul 2002 19:09:31 -0000 1.3 +++ lisp/behavior.el 9 Mar 2003 02:27:32 -0000 1.4 @@ -95,7 +95,7 @@ :require :enable :disable) - () + t (let ((entry (list :short-doc cl-short-doc :require cl-require :enable cl-enable :disable cl-disable))) (puthash name entry behavior-hash-table)))) Index: lisp/bytecomp.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/bytecomp.el,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- lisp/bytecomp.el 13 Mar 2002 08:52:03 -0000 1.15 +++ lisp/bytecomp.el 20 Feb 2003 08:19:29 -0000 1.16 @@ -1847,7 +1847,8 @@ (char-to-string 255))) (eq (point) (point-max)))) (setq buffer-file-coding-system 'raw-text-unix) - (insert "(require 'mule)\n;;;###coding system: escape-quoted\n") + (insert "(or (featurep 'mule) (error \"Loading this file requires Mule support\")) +;;;###coding system: escape-quoted\n") (setq buffer-file-coding-system 'escape-quoted) ;; #### Lazy loading not yet implemented for MULE files ;; mrb - Fix this someday. Index: lisp/cl-macs.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/cl-macs.el,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- lisp/cl-macs.el 27 Nov 2002 07:15:06 -0000 1.13 +++ lisp/cl-macs.el 9 Mar 2003 02:27:32 -0000 1.14 @@ -992,7 +992,16 @@ '--cl-map loop-map-form)) (list* 'while (car ands) while-body))) (if loop-finish-flag - (if (equal epilogue '(nil)) (list loop-result-var) + (if (equal epilogue '(nil)) + ;; XEmacs change: When epilogue is nil and + ;; loop-finish-flag exists, you get a byte-compiler + ;; warning using the original (commented-out) + ;; code below. So instead we create a form that + ;; gives the same result but uses loop-finish-flag. + ;; --ben + ;(list loop-result-var) + (list (list 'if loop-finish-flag + loop-result-var loop-result-var)) (list (list 'if loop-finish-flag (cons 'progn epilogue) loop-result-var))) epilogue)))) Index: lisp/cmdloop.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/cmdloop.el,v retrieving revision 1.13 retrieving revision 1.15 diff -u -r1.13 -r1.15 --- lisp/cmdloop.el 27 Nov 2002 07:15:06 -0000 1.13 +++ lisp/cmdloop.el 9 Mar 2003 02:27:33 -0000 1.15 @@ -1,7 +1,7 @@ ;;; cmdloop.el --- support functions for the top-level command loop. ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. -;; Copyright (C) 2001, 2002 Ben Wing. +;; Copyright (C) 2001, 2002, 2003 Ben Wing. ;; Author: Richard Mlynarik ;; Date: 8-Jul-92 @@ -26,6 +26,7 @@ ;; Boston, MA 02111-1307, USA. ;;; Synched up with: FSF 19.30. (Some of the stuff below is in FSF's subr.el.) +;;; Some parts synched with FSF 21.2. ;;; Commentary: @@ -245,13 +246,20 @@ (put 'file-error 'display-error #'(lambda (error-object stream) - (let ((tail (cdr error-object)) - (first t)) - (princ (car tail) stream) - (while (setq tail (cdr tail)) - (princ (if first ": " ", ") stream) - (princ (car tail) stream) - (setq first nil))))) + (let ((type (car error-object)) + (tail (cdr error-object)) + (first t) + (print-message-label 'error)) + (if (eq type 'file-error) + (progn (princ (car tail) stream) + (setq tail (cdr tail))) + (princ (or (gettext (get type 'error-message)) type) + stream)) + (while tail + (princ (if first ": " ", ") stream) + (prin1 (car tail) stream) + (setq tail (cdr tail) + first nil))))) (put 'undefined-keystroke-sequence 'display-error #'(lambda (error-object stream) @@ -519,21 +527,45 @@ (null ch))) ch)) +;;;; Input and display facilities. + +;; BEGIN SYNCHED WITH FSF 21.2. + +(defvar read-quoted-char-radix 8 + "*Radix for \\[quoted-insert] and other uses of `read-quoted-char'. +Legitimate radix values are 8, 10 and 16.") + +(custom-declare-variable-early + 'read-quoted-char-radix 8 + "*Radix for \\[quoted-insert] and other uses of `read-quoted-char'. +Legitimate radix values are 8, 10 and 16." + :type '(choice (const 8) (const 10) (const 16)) + :group 'editing-basics) + (defun read-quoted-char (&optional prompt) - "Like `read-char', except that if the first character read is an octal -digit, we read up to two more octal digits and return the character -represented by the octal number consisting of those digits. -Optional argument PROMPT specifies a string to use to prompt the user." - (let ((count 0) (code 0) done + "Like `read-char', but do not allow quitting. +Also, if the first character read is an octal digit, +we read any number of octal digits and return the +specified character code. Any nondigit terminates the sequence. +If the terminator is RET, it is discarded; +any other terminator is used itself as input. + +The optional argument PROMPT specifies a string to use to prompt the user. +The variable `read-quoted-char-radix' controls which radix to use +for numeric input." + (let (;(message-log-max nil) + done (first t) (code 0) char event (prompt (and prompt (gettext prompt))) - char event) - (while (and (not done) (< count 3)) - (let ((inhibit-quit (zerop count)) + ) + (while (not done) + (let ((inhibit-quit first) ;; Don't let C-h get the help message--only help function keys. (help-char nil) (help-form "Type the special character you want to use, -or three octal digits representing its character code.")) +or the octal character code. +RET terminates the character code and is discarded; +any other non-digit terminates the character code and is then used as input.")) (and prompt (display-message 'prompt (format "%s-" prompt))) (setq event (next-command-event) char (or (event-to-character event nil nil t) @@ -541,22 +573,93 @@ (list "key read cannot be inserted in a buffer" event)))) (if inhibit-quit (setq quit-flag nil))) - (cond ((<= ?0 char ?7) - (setq code (+ (* code 8) (- char ?0)) - count (1+ count)) - (when prompt - (display-message 'prompt - (setq prompt (format "%s %c" prompt char))))) - ((> count 0) - (setq unread-command-event event + ;; Translate TAB key into control-I ASCII character, and so on. + (and char + (let ((translated (lookup-key function-key-map (vector char)))) + (if (arrayp translated) + (setq char (aref translated 0))))) + (cond ((null char)) + ((not (characterp char)) + (setq unread-command-events (list char) + done t)) +; ((/= (logand char ?\M-\^@) 0) +; ;; Turn a meta-character into a character with the 0200 bit set. +; (setq code (logior (logand char (lognot ?\M-\^@)) 128) +; done t)) + ((and (<= ?0 char) (< char (+ ?0 (min 10 read-quoted-char-radix)))) + (setq code (+ (* code read-quoted-char-radix) (- char ?0))) + (and prompt (setq prompt (display-message 'prompt + (format "%s %c" prompt char))))) + ((and (<= ?a (downcase char)) + (< (downcase char) (+ ?a -10 (min 26 read-quoted-char-radix)))) + (setq code (+ (* code read-quoted-char-radix) + (+ 10 (- (downcase char) ?a)))) + (and prompt (setq prompt (display-message 'prompt + (format "%s %c" prompt char))))) + ((and (not first) (eq char ?\C-m)) + (setq done t)) + ((not first) + (setq unread-command-events (list char) done t)) - (t (setq code (char-int char) - done t)))) - (int-char code) - ;; Turn a meta-character into a character with the 0200 bit set. -; (logior (if (/= (logand code ?\M-\^@) 0) 128 0) -; (logand 255 code)))) - )) + (t (setq code (char-to-int char) + done t))) + (setq first nil)) + (int-to-char code))) + +;; in passwd.el. +; (defun read-passwd (prompt &optional confirm default) +; "Read a password, prompting with PROMPT. Echo `.' for each character typed. +; End with RET, LFD, or ESC. DEL or C-h rubs out. C-u kills line. +; Optional argument CONFIRM, if non-nil, then read it twice to make sure. +; Optional DEFAULT is a default password to use instead of empty input." +; (if confirm +; (let (success) +; (while (not success) +; (let ((first (read-passwd prompt nil default)) +; (second (read-passwd "Confirm password: " nil default))) +; (if (equal first second) +; (progn +; (and (arrayp second) (fillarray second ?\0)) +; (setq success first)) +; (and (arrayp first) (fillarray first ?\0)) +; (and (arrayp second) (fillarray second ?\0)) +; (message "Password not repeated accurately; please start over") +; (sit-for 1)))) +; success) +; (let ((pass nil) +; (c 0) +; (echo-keystrokes 0) +; (cursor-in-echo-area t)) +; (while (progn (message "%s%s" +; prompt +; (make-string (length pass) ?.)) +; (setq c (read-char-exclusive nil t)) +; (and (/= c ?\r) (/= c ?\n) (/= c ?\e))) +; (clear-this-command-keys) +; (if (= c ?\C-u) +; (progn +; (and (arrayp pass) (fillarray pass ?\0)) +; (setq pass "")) +; (if (and (/= c ?\b) (/= c ?\177)) +; (let* ((new-char (char-to-string c)) +; (new-pass (concat pass new-char))) +; (and (arrayp pass) (fillarray pass ?\0)) +; (fillarray new-char ?\0) +; (setq c ?\0) +; (setq pass new-pass)) +; (if (> (length pass) 0) +; (let ((new-pass (substring pass 0 -1))) +; (and (arrayp pass) (fillarray pass ?\0)) +; (setq pass new-pass)))))) +; (message nil) +; (or pass default "")))) + +;; aliased to redraw-modeline, a built-in. +; (defun force-mode-line-update (&optional all) +; "Force the mode-line of the current buffer to be redisplayed. +; With optional non-nil ALL, force redisplay of all mode-lines." +; (if all (save-excursion (set-buffer (other-buffer)))) +; (set-buffer-modified-p (buffer-modified-p))) (defun momentary-string-display (string pos &optional exit-char message) "Momentarily display STRING in the buffer at POS. @@ -566,7 +669,7 @@ Display MESSAGE (optional fourth arg) in the echo area. If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." (or exit-char (setq exit-char ?\ )) - (let ((buffer-read-only nil) + (let ((inhibit-read-only t) ;; Don't modify the undo list at all. (buffer-undo-list t) (modified (buffer-modified-p)) @@ -580,8 +683,8 @@ (setq buffer-file-name nil) (insert-before-markers (gettext string)) (setq insert-end (point)) - ;; If the message end is off frame, recenter now. - (if (> (window-end) insert-end) + ;; If the message end is off screen, recenter now. + (if (< (window-end nil t) insert-end) (recenter (/ (window-height) 2))) ;; If that pushed message start off the frame, ;; scroll to start it at the top of the frame. @@ -594,11 +697,13 @@ (single-key-description exit-char)) (let ((event (save-excursion (next-command-event)))) (or (eq (event-to-character event) exit-char) - (setq unread-command-event event)))) + (setq unread-command-events (list event))))) (if insert-end (save-excursion (delete-region pos insert-end))) (setq buffer-file-name name) (set-buffer-modified-p modified)))) + +;; END SYNCHED WITH FSF 21.2. ;;; cmdloop.el ends here Index: lisp/code-cmds.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/code-cmds.el,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- lisp/code-cmds.el 13 Mar 2002 08:52:03 -0000 1.3 +++ lisp/code-cmds.el 21 Feb 2003 06:56:47 -0000 1.4 @@ -53,7 +53,6 @@ (define-key coding-keymap "x" 'set-selection-coding-system) (define-key coding-keymap "X" 'set-next-selection-coding-system)) - (defun coding-system-change-eol-conversion (coding-system eol-type) "Return a coding system which differs from CODING-SYSTEM in eol conversion. The returned coding system converts end-of-line by EOL-TYPE @@ -75,19 +74,20 @@ (eq eol-type 'cr)) 'eol-cr) (t eol-type)))) - (let ((orig-eol-type (coding-system-eol-type coding-system))) - (if (null orig-eol-type) - (if (not eol-type) - coding-system - (coding-system-property coding-system eol-type)) - (let ((base (coding-system-base coding-system))) - (if (not eol-type) - base - (if (eq eol-type orig-eol-type) - coding-system - (setq orig-eol-type (coding-system-eol-type base)) - (if (null orig-eol-type) - (coding-system-property base eol-type)))))))) + (coding-system-name + (let ((orig-eol-type (coding-system-eol-type coding-system))) + (if (null orig-eol-type) + (if (not eol-type) + coding-system + (coding-system-property coding-system eol-type)) + (let ((base (coding-system-base coding-system))) + (if (not eol-type) + base + (if (eq eol-type orig-eol-type) + coding-system + (setq orig-eol-type (coding-system-eol-type base)) + (if (null orig-eol-type) + (coding-system-property base eol-type))))))))) ;; (defun coding-system-change-text-conversion (coding-system coding) ;; "Return a coding system which differs from CODING-SYSTEM in text conversion. Index: lisp/code-init.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/code-init.el,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- lisp/code-init.el 1 Sep 2002 06:41:41 -0000 1.4 +++ lisp/code-init.el 21 Feb 2003 06:56:47 -0000 1.5 @@ -1,6 +1,6 @@ ;;; code-init.el --- Handle coding system default values -;; Copyright (C) 2001, 2002 Ben Wing. +;; Copyright (C) 2001, 2002, 2003 Ben Wing. ;; This file is part of XEmacs. @@ -69,19 +69,28 @@ (eol-detection-enabled-p 'unix-no-mule-eol-detection) (t 'unix-no-mule-no-eol-detection))) +;; NOTE NOTE NOTE: These values may get overridden when the language +;; environment is initialized (set-language-environment-coding-systems). (defvar coding-system-variable-default-value-table - '((buffer-file-coding-system-for-read binary raw-text undecided raw-text undecided) - (default-buffer-file-coding-system binary binary iso-2022-8 raw-text-dos mswindows-multibyte-dos) - (file-name binary binary binary raw-text-dos mswindows-multibyte-system-default-dos) - (native binary binary binary raw-text-dos mswindows-multibyte-system-default-dos) - (keyboard binary raw-text undecided raw-text undecided) + '((buffer-file-coding-system-for-read + binary raw-text undecided raw-text undecided) + (default-buffer-file-coding-system + binary binary iso-2022-8 raw-text-dos mswindows-multibyte-dos) + (native + binary binary binary raw-text-dos mswindows-multibyte-system-default-dos) + (keyboard + binary raw-text undecided raw-text undecided) ;; the `terminal' coding system is used for output to stderr. such ;; streams do automatic lf->crlf encoding in the C library, so we need ;; to not do the same translations ourselves. - (terminal binary binary binary binary mswindows-multibyte-unix) - (default-process-coding-system-read binary raw-text undecided raw-text undecided) - (default-process-coding-system-write binary binary binary raw-text mswindows-multibyte-system-default) - (no-conversion-coding-system-mapping binary raw-text raw-text raw-text mswindows-multibyte) + (terminal + binary binary binary binary mswindows-multibyte-unix) + (default-process-coding-system-read + binary raw-text undecided raw-text undecided) + (default-process-coding-system-write + binary binary binary raw-text mswindows-multibyte-system-default) + (no-conversion-coding-system-mapping + binary raw-text raw-text raw-text mswindows-multibyte) )) (defvar coding-system-default-configuration-list @@ -94,7 +103,6 @@ (defvar coding-system-default-variable-list '(buffer-file-coding-system-for-read default-buffer-file-coding-system - file-name native keyboard terminal @@ -111,7 +119,6 @@ (buffer-file-coding-system-for-read buffer-file-coding-system-for-read) (default-buffer-file-coding-system (default-value 'buffer-file-coding-system)) - (file-name (coding-system-aliasee 'file-name)) (native (coding-system-aliasee 'native)) (keyboard (coding-system-aliasee 'keyboard)) (terminal (coding-system-aliasee 'terminal)) @@ -130,7 +137,6 @@ (set-buffer-file-coding-system-for-read value)) (default-buffer-file-coding-system (set-default-buffer-file-coding-system value)) - (file-name (define-coding-system-alias 'file-name value)) (native (define-coding-system-alias 'native value)) (keyboard (set-keyboard-coding-system value)) (terminal (set-terminal-coding-system value)) @@ -156,7 +162,6 @@ ------------------------------------------------------------------------------ bfcs-for-read binary raw-text undecided raw-text undecided default bfcs binary binary iso-2022-8 raw-text-dos MSW-MB-dos -file-name binary binary binary raw-text-dos MSW-MB-SD-dos native binary binary binary raw-text-dos MSW-MB-SD-dos keyboard binary raw-text undecided raw-text undecided terminal binary binary binary binary MSW-MB-unix @@ -184,18 +189,11 @@ system used to read the file in; the default value applies to newly created files. -`file-name' (file-name) - - The coding system named `file-name'. Changed using - `define-coding-system-alias'. Used internally when passing file - names to or from system API's, unless the particular API specifies - another coding system. - `native' (native) The coding system named `native'. Changed using `define-coding-system-alias'. Used internally when passing - non-file-name text to or from system API's, unless the particular + text to or from system API's, unless the particular API specifies another coding system. `keyboard' (keyboard) Index: lisp/custom.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/custom.el,v retrieving revision 1.10 retrieving revision 1.12 diff -u -r1.10 -r1.12 --- lisp/custom.el 1 Sep 2002 22:13:53 -0000 1.10 +++ lisp/custom.el 3 Mar 2003 10:17:40 -0000 1.12 @@ -25,6 +25,8 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;;; Synched with: ??? Partially synched to 21.2 by Ben Wing. + ;;; Commentary: ;; This file is dumped with XEmacs. @@ -42,6 +44,8 @@ ;; prevent require/provide loop with custom and cus-face. (provide 'custom) +;; BEGIN SYNC WITH FSF 21.2 + (eval-when-compile (load "cl-macs" nil t) ;; To elude warnings. @@ -73,7 +77,12 @@ (defun custom-initialize-set (symbol value) "Initialize SYMBOL with VALUE. -Like `custom-initialize-default', but use the function specified by +If the symbol doesn't have a default binding already, +then set it using its `:set' function (or `set-default' if it has none). +The value is either the value in the symbol's `saved-value' property, +if any, or VALUE. + +This is like `custom-initialize-default', but uses the function specified by `:set' to initialize SYMBOL." (unless (default-boundp symbol) (funcall (or (get symbol 'custom-set) 'set-default) @@ -84,6 +93,12 @@ (defun custom-initialize-reset (symbol value) "Initialize SYMBOL with VALUE. +Set the symbol, using its `:set' function (or `set-default' if it has none). +The value is either the symbol's current value + \(as obtained using the `:get' function), if any, +or the value in the symbol's `saved-value' property if any, +or (last of all) VALUE. + Like `custom-initialize-set', but use the function specified by `:get' to reinitialize SYMBOL if it is already bound." (funcall (or (get symbol 'custom-set) 'set-default) @@ -99,7 +114,8 @@ (defun custom-initialize-changed (symbol value) "Initialize SYMBOL with VALUE. Like `custom-initialize-reset', but only use the `:set' function if the -not using the standard setting. Otherwise, use the `set-default'." +not using the standard setting. +For the standard setting, use `set-default'." (cond ((default-boundp symbol) (funcall (or (get symbol 'custom-set) 'set-default) symbol @@ -112,10 +128,12 @@ (t (set-default symbol (eval value))))) -(defun custom-declare-variable (symbol value doc &rest args) - "Like `defcustom', but SYMBOL and VALUE are evaluated as normal arguments." +(defun custom-declare-variable (symbol default doc &rest args) + "Like `defcustom', but SYMBOL and DEFAULT are evaluated as normal arguments. +DEFAULT should be an expression to evaluate to compute the default value, +not the default value itself." ;; Remember the standard setting. - (put symbol 'standard-value (list value)) + (put symbol 'standard-value (list default)) ;; Maybe this option was rogue in an earlier version. It no longer is. (when (eq (get symbol 'force-value) 'rogue) ;; It no longer is. @@ -156,7 +174,7 @@ 'custom-variable)))))) (put symbol 'custom-requests requests) ;; Do the actual initialization. - (funcall initialize symbol value)) + (funcall initialize symbol default)) ;; #### This is a rough equivalent of LOADHIST_ATTACH. However, ;; LOADHIST_ATTACH also checks for `initialized'. (push symbol current-load-list) @@ -173,37 +191,44 @@ [KEYWORD VALUE]... -The following KEYWORD's are defined: +The following keywords are meaningful: :type VALUE should be a widget type for editing the symbols value. The default is `sexp'. :options VALUE should be a list of valid members of the widget type. :group VALUE should be a customization group. Add SYMBOL to that group. -:initialize VALUE should be a function used to initialize the +:initialize + VALUE should be a function used to initialize the variable. It takes two arguments, the symbol and value given in the `defcustom' call. The default is - `custom-initialize-set' -:set VALUE should be a function to set the value of the symbol. - It takes two arguments, the symbol to set and the value to - give it. The default is `custom-set-default'. + `custom-initialize-reset' +:set VALUE should be a function to set the value of the symbol. + It takes two arguments, the symbol to set and the value to + give it. The default choice of function is `custom-set-default'. :get VALUE should be a function to extract the value of symbol. - The function takes one argument, a symbol, and should return - the current value for that symbol. The default is - `default-value'. -:require VALUE should be a feature symbol. Each feature will be - required after initialization, of the user have saved this - option. -:version VALUE should be a string specifying that the variable was + The function takes one argument, a symbol, and should return + the current value for that symbol. The default choice of function + is `custom-default-value'. #### XEmacs used to say `default-value'; + is that right? +:require + VALUE should be a feature symbol. If you save a value + for this option, then when your custom init file loads the value, + it does (require VALUE) first. +:version + VALUE should be a string specifying that the variable was first introduced, or its default value was changed, in Emacs version VERSION. -:set-after VARIABLE specifies that SYMBOL should be set after VARIABLE when +:set-after VARIABLE + Specifies that SYMBOL should be set after VARIABLE when both have been customized. Read the section about customization in the Emacs Lisp manual for more information." `(custom-declare-variable (quote ,symbol) (quote ,value) ,doc ,@args)) +;; END SYNC WITH FSF 21.2 + ;;; The `defface' Macro. (defmacro defface (face spec doc &rest args) @@ -712,5 +737,17 @@ (set-default variable value))) ;;; The End. + +;; BEGIN SYNC WITH FSF 21.2 + +;; Process the defcustoms for variables loaded before this file. +;; `custom-declare-variable-list' is defvar'd in subr.el. Utility programs +;; run from temacs that do not load subr.el should defvar it themselves. +;; (As of 21.5.11, make-docfile.el.) +(while custom-declare-variable-list + (apply 'custom-declare-variable (car custom-declare-variable-list)) + (setq custom-declare-variable-list (cdr custom-declare-variable-list))) + +;; END SYNC WITH FSF 21.2 ;; custom.el ends here Index: lisp/dump-paths.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/dump-paths.el,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- lisp/dump-paths.el 22 Jan 2003 20:31:52 -0000 1.9 +++ lisp/dump-paths.el 1 Mar 2003 07:25:27 -0000 1.10 @@ -1,209 +0,0 @@ -;; dump-paths.el --- set up XEmacs paths for dumping - -;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc. -;; Copyright (C) 2002 Ben Wing. - -;; Maintainer: XEmacs Development Team -;; Keywords: internal, dumped - -;; This file is part of XEmacs. - -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; XEmacs is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the Free -;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;; 02111-1307, USA. - -;;; Synched up with: Not in FSF - -;;; Commentary: - -;; This sets up the various paths for continuing loading files for dumping. -;; This is the only file of the basic path/package files (find-paths.el, -;; package.el, setup-paths.el, dump-paths.el) that actually does stuff. - -(defun startup-setup-paths (roots data-roots user-init-directory - &optional - inhibit-packages inhibit-site-lisp - debug-paths called-early) - "Setup all the various paths. -ROOTS is a list of plausible roots of the XEmacs directory hierarchy. -If INHIBIT-PACKAGES is non-NIL, don't do packages. -If INHIBIT-SITE-LISP is non-NIL, don't do site-lisp. -If DEBUG-PATHS is non-NIL, print paths as they are detected. -It's idempotent, so call this as often as you like!" - - (if (eq inhibit-packages t) - (setq inhibit-packages '(early late last))) - (if (not (listp inhibit-packages)) - (setq inhibit-packages (list inhibit-packages))) - - (apply #'(lambda (early late last) - (setq early-packages (and (not (memq 'early inhibit-packages)) - early)) - (setq late-packages (and (not (memq 'late inhibit-packages)) - late)) - (setq last-packages (and (not (memq 'last inhibit-packages)) - last)) - ) - (packages-find-packages - data-roots - (packages-compute-package-locations user-init-directory))) - - (setq early-package-load-path (packages-find-package-load-path early-packages)) - (setq late-package-load-path (packages-find-package-load-path late-packages)) - (setq last-package-load-path (packages-find-package-load-path last-packages)) - - (if debug-paths - (progn - (princ (format "arguments:\nroots: %S\ndata-roots: %S\nuser-init-directory: %S\n" - roots data-roots user-init-directory) - 'external-debugging-output) - (princ (format "inhibit-packages: %S\ninhibit-site-lisp: %S\n" - inhibit-packages inhibit-site-lisp) - 'external-debugging-output) - (princ (format "debug-paths: %S\ncalled-early: %S\n\n" - debug-paths called-early) - 'external-debugging-output) - (princ (format "configure-package-path:\n%S\n" configure-package-path) - 'external-debugging-output) - (princ (format "early-packages and early-package-load-path:\n%S\n%S\n" - early-packages early-package-load-path) - 'external-debugging-output) - (princ (format "late-packages and late-package-load-path:\n%S\n%S\n" - late-packages late-package-load-path) - 'external-debugging-output) - (princ (format "last-packages and last-package-load-path:\n%S\n%S\n" - last-packages last-package-load-path) - 'external-debugging-output))) - - (setq lisp-directory (paths-find-lisp-directory roots)) - - (if debug-paths - (princ (format "lisp-directory:\n%S\n" lisp-directory) - 'external-debugging-output)) - - (if (featurep 'mule) - (progn - (setq mule-lisp-directory - (paths-find-mule-lisp-directory roots - lisp-directory)) - (if debug-paths - (princ (format "mule-lisp-directory:\n%S\n" - mule-lisp-directory) - 'external-debugging-output))) - (setq mule-lisp-directory '())) - - (setq site-directory (and (null inhibit-site-lisp) - (paths-find-site-lisp-directory roots))) - - (if (and debug-paths (null inhibit-site-lisp)) - (princ (format "site-directory:\n%S\n" site-directory) - 'external-debugging-output)) - - (setq load-path (paths-construct-load-path roots - early-package-load-path - late-package-load-path - last-package-load-path - lisp-directory - site-directory - mule-lisp-directory)) - - (setq module-directory (paths-find-module-directory roots)) - (if debug-paths - (princ (format "module-directory:\n%S\n" module-directory) - 'external-debugging-output)) - (setq site-module-directory (and (null inhibit-site-modules) - (paths-find-site-module-directory - roots))) - (if (and debug-paths (null inhibit-site-modules)) - (princ (format "site-module-directory:\n%S\n" - site-module-directory) - 'external-debugging-output)) - - (setq module-load-path (paths-construct-module-load-path - roots - module-directory - site-module-directory)) - - (unless called-early - (setq Info-directory-list - (paths-construct-info-path - roots early-packages late-packages last-packages)) - - (if debug-paths - (princ (format "Info-directory-list:\n%S\n" Info-directory-list) - 'external-debugging-output)) - - (setq exec-directory (paths-find-exec-directory roots)) - - (if debug-paths - (princ (format "exec-directory:\n%s\n" exec-directory) - 'external-debugging-output)) - - (setq exec-path - (paths-construct-exec-path roots exec-directory - early-packages late-packages - last-packages)) - - (if debug-paths - (princ (format "exec-path:\n%S\n" exec-path) - 'external-debugging-output)) - - (setq doc-directory (paths-find-doc-directory roots)) - - (if debug-paths - (princ (format "doc-directory:\n%S\n" doc-directory) - 'external-debugging-output)) - - (setq data-directory (paths-find-data-directory roots)) - - (if debug-paths - (princ (format "data-directory:\n%S\n" data-directory) - 'external-debugging-output)) - - (setq data-directory-list (paths-construct-data-directory-list - data-directory early-packages - late-packages last-packages)) - (if debug-paths - (princ (format "data-directory-list:\n%S\n" data-directory-list) - 'external-debugging-output)))) - -;;; Now actually do something. - -(let ((debug-paths (or debug-paths - (and (getenv "EMACSDEBUGPATHS") - t))) - (roots (paths-find-emacs-roots invocation-directory - invocation-name - #'paths-emacs-root-p)) - (data-roots (paths-find-emacs-roots invocation-directory - invocation-name - #'paths-emacs-data-root-p))) - - (if debug-paths - (progn - (princ (format "XEmacs thinks the roots of its hierarchy are:\n%S\n" - roots) - 'external-debugging-output) - (princ (format "XEmacs thinks the data roots of its hierarchy are:\n%S\n" - data-roots) - 'external-debugging-output))) - (startup-setup-paths roots data-roots - (paths-construct-path '("~" ".xemacs")) - (if inhibit-all-packages t - '(early last)) - inhibit-site-lisp - debug-paths - t)) - -;;; dump-paths.el ends here Index: lisp/dumped-lisp.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/dumped-lisp.el,v retrieving revision 1.45 retrieving revision 1.48 diff -u -r1.45 -r1.48 --- lisp/dumped-lisp.el 2 Dec 2002 12:27:20 -0000 1.45 +++ lisp/dumped-lisp.el 2 Mar 2003 09:38:39 -0000 1.48 @@ -1,55 +1,72 @@ +(defvar packages-hardcoded-lisp + '( + ;; Nothing at this time + ) + "Lisp packages that are always dumped with XEmacs. +This includes every package that is loaded directly by a package listed +in dumped-lisp.el and is not itself listed.") + (setq preloaded-file-list - (assemble-list - "backquote" ; needed for defsubst etc. - "bytecomp-runtime" ; define defsubst - "find-paths" - "packages" ; Bootstrap run-time lisp environment - "setup-paths" - "dump-paths" - "subr" ; load the most basic Lisp functions - "post-gc" - "replace" ; match-string used in version.el. - ; Ignore compiled-by-mistake version.elc - "version.el" - "cl" - "cl-extra" - "cl-seq" - "widget" - "custom" ; Before the world so everything can be - ; customized - "cus-start" ; for customization of builtin variables - "cmdloop" - "keymap" - "syntax" - "device" - "console" - "obsolete" - "specifier" - "frame" ; needed by faces - (when-feature x "x-faces") ; needed by faces - (when-feature gtk "gtk-faces") - (when-feature mswindows "msw-faces") - "faces" ; must be loaded before any make-face call -;;(pureload "facemenu") #### not yet ported - "glyphs" - "objects" - "extents" - "events" - "hash-table" - "text-props" - "process" ;; This is bad. network-streams may not be defined. - (when-feature multicast "multicast") ; #+network-streams implicitly true - "map-ynp" - "undo-stack" - "window" ; simple needs `save-window-excursion' - "window-xemacs" - "simple" - "keydefs" ; Before loaddefs so that keymap vars exist. - "abbrev" - "derived" - "minibuf" - "list-mode" - "modeline" ; needs simple.el to be loaded first + (list + ;; do not defcustom any variables in these files + + "backquote" ; needed for defsubst etc. + "bytecomp-runtime" ; define defsubst + "find-paths" + "packages" ; Bootstrap run-time lisp environment + "setup-paths" + + ;; use custom-declare-variable-early, not defcustom, in these files + + "subr" ; load the most basic Lisp functions + "post-gc" + "replace" ; match-string used in version.el. + + "version.el" ; Ignore compiled-by-mistake version.elc + + "cl" + "cl-extra" + "cl-seq" + "widget" + "custom" ; Before the world so everything can be + ; customized + "cus-start" ; for customization of builtin variables + + ;; OK, you can use defcustom from here on + + "cmdloop" + "keymap" + "syntax" + "device" + "console" + "obsolete" + "specifier" + "frame" ; needed by faces + (when (featurep 'x) "x-faces") ; needed by faces + (when (featurep 'gtk) "gtk-faces") + (when (valid-console-type-p 'mswindows) "msw-faces") + "faces" ; must be loaded before any make-face call + ;;(pureload "facemenu") #### not yet ported + "glyphs" + "objects" + "extents" + "events" + "hash-table" + "text-props" + "process" ;; This is bad. network-streams may not be defined. + (when (featurep 'multicast) "multicast") ; #+network-streams implicitly true + "map-ynp" + "undo-stack" + "window" ; simple needs `save-window-excursion' + "window-xemacs" + "simple" + "newcomment" + "keydefs" ; Before loaddefs so that keymap vars exist. + "abbrev" + "derived" + "minibuf" + "list-mode" + "modeline" ; needs simple.el to be loaded first ;; If SparcWorks support is included some additional packages are ;; dumped which would normally have autoloads. To avoid ;; duplicate doc string warnings, SparcWorks uses a separate @@ -57,90 +74,97 @@ ;; After fixing, eos/loaddefs-eos and loaddefs appear identical?!! ;; So just make loaddefs-eos go away... ;;(pureload (if (featurep 'sparcworks) "eos/loaddefs-eos" "loaddefs")) - "cus-file" - "startup" ; For initialization of + "cus-file" + "startup" ; For initialization of ; `emacs-user-extension-dir' - "misc" - ;; (pureload "profile") - "help" - ;; (pureload "hyper-apropos") Soon... - "files" - "lib-complete" - "format" - "indent" - "isearch-mode" - "buffer" - "buff-menu" - "paths.el" ; don't get confused if paths compiled. - "lisp" - "page" - "register" - "iso8859-1" ; This must be before any modes - ; (sets standard syntax table.) - "paragraphs" - "easymenu" ; Added for 20.3. - "lisp-mode" - "text-mode" - "fill" - "auto-save" ; Added for 20.4 - "movemail" ; Added for 21.2 - (when-feature windows-nt "win32-native") - (when-feature lisp-float-type "float-sup") - "itimer" ; for vars auto-save-timeout and + "misc" + ;; (pureload "profile") + "help" + ;; (pureload "hyper-apropos") Soon... + "files" + "lib-complete" + "format" + "indent" + "isearch-mode" + "buffer" + "buff-menu" + "paths.el" ; don't get confused if paths compiled. + "lisp" + "page" + "register" + "iso8859-1" ; This must be before any modes + ; (sets standard syntax table.) + "paragraphs" + "easymenu" ; Added for 20.3. + "lisp-mode" + "text-mode" + "fill" + "auto-save" ; Added for 20.4 + "movemail" ; Added for 21.2 + (when (eq system-type 'windows-nt) "win32-native") + (when (featurep 'lisp-float-type) "float-sup") + "itimer" ; for vars auto-save-timeout and ; auto-gc-threshold - "itimer-autosave" - "printer" - "behavior" - "behavior-defs" - "diagnose" - + "itimer-autosave" + "printer" + "behavior" + "behavior-defs" + "diagnose" + ;;;;;;;;;;;;;;;;;; GUI support - (when-feature window-system "gui") - (when-feature window-system "mouse") - (when-feature window-system "mode-motion") - (when-feature toolbar "toolbar") - (when-feature scrollbar "scrollbar") - (when-feature menubar "menubar") - (when-feature dialog "dialog") - (when-feature gutter "gutter") - (when-feature dragdrop-api "dragdrop") - "select" - + (when (featurep 'window-system) + '("gui" + "mouse" + "mode-motion" + )) + (when (featurep 'toolbar) "toolbar") + (when (featurep 'scrollbar) "scrollbar") + (when (featurep 'menubar) "menubar") + (when (featurep 'dialog) "dialog") + (when (featurep 'gutter) "gutter") + (when (featurep 'dragdrop-api) "dragdrop") + "select" + ;;;;;;;;;;;;;;;;;; Content for GUI's - ;; There used to be window-system inserted in the when-feature, - ;; but IMHO your configure script should turn off the menubar, - ;; toolbar, etc. features when there is no window system. We - ;; should just be able to assume that, if (featurep 'menubar), - ;; the menubar should work and if items are added, they can be - ;; seen clearly and usefully. - (when-feature (and (not infodock) menubar) "menubar-items") - (when-feature (and gutter) "gutter-items") - (when-feature (and (not infodock) toolbar) "toolbar-items") - (when-feature (and (not infodock) dialog) "dialog-items") + ;; There used to be window-system inserted in the when-feature, + ;; but IMHO your configure script should turn off the menubar, + ;; toolbar, etc. features when there is no window system. We + ;; should just be able to assume that, if (featurep 'menubar), + ;; the menubar should work and if items are added, they can be + ;; seen clearly and usefully. + (when (featurep '(and (not infodock) menubar)) "menubar-items") + (when (featurep '(and gutter)) "gutter-items") + (when (featurep '(and (not infodock) toolbar)) "toolbar-items") + (when (featurep '(and (not infodock) dialog)) "dialog-items") ;;;;;;;;;;;;;;;;;; Coding-system support - "coding" - "code-files" - ;; Handle process with encoding/decoding coding-system. - "code-process" - ;; Provide basic commands to set coding systems to user - "code-cmds" - "unicode" + "coding" + "code-files" + ;; Handle process with encoding/decoding coding-system. + "code-process" + ;; Provide basic commands to set coding systems to user + "code-cmds" + "unicode" ;;;;;;;;;;;;;;;;;; MULE support - (when-feature mule "mule-charset") - (when-feature mule "mule-cmds") ; to sync with Emacs 20.1 - (when-feature mule "mule-coding") - (when-feature mule "mule-composite-stub") - (when-feature mule "mule-composite") - ;; may initialize coding systems - (when-feature (and mule x) "mule-x-init") - (when-feature (and mule tty) "mule-tty-init") - (when-feature (and mule mswindows) "mule-msw-init") - "code-init" ; set up defaults - ;; All files after this can have extended characters in them. - (when-feature mule "mule-category") - (when-feature mule "mule-ccl") - (when-feature mule "kinsoku") + (when (featurep 'mule) + '("mule-charset" + "mule-cmds" ; to sync with Emacs 20.1 + "mule-coding" + "mule-composite-stub" + "mule-composite" + )) + ;; may initialize coding systems + (when (featurep '(and mule x)) "mule-x-init") + (when (featurep '(and mule tty)) "mule-tty-init") + (when (and (featurep 'mule) (memq system-type '(windows-nt cygwin32))) + "mule-win32-init") + "code-init" ; set up defaults + ;; All files after this can have extended characters in them. + (when (featurep 'mule) + '("mule-category" + "mule-ccl" + "kinsoku" + )) ;; after this goes the specific lisp routines for a particular input system ;; 97.2.5 JHod Shouldn't these go into a site-load file to allow site @@ -160,36 +184,36 @@ ;; those of the same name in leim/quail.el, but no longer, since we now ;; compile with -no-packages. - (when-feature mule "arabic") - (when-feature mule "chinese") - (when-feature mule "cyrillic") - (when-feature mule "english") - (when-feature mule "ethiopic") - (when-feature mule "european") - (when-feature mule "greek") - (when-feature mule "hebrew") - (when-feature mule "indian") - (when-feature mule "devanagari") ; must be loaded after indian.el - (when-feature mule "japanese") - (when-feature mule "korean") - (when-feature mule "lao") - (when-feature mule "latin") - (when-feature mule "misc-lang") - ;; #### merge thai and thai-xtis!!! - ;(when-feature mule "thai") - (when-feature mule "thai-xtis") - (when-feature mule "tibetan") - (when-feature mule "vietnamese") - + (when (featurep 'mule) + '("arabic" + "chinese" + "cyrillic" + "english" + "ethiopic" + "european" + "greek" + "hebrew" + "indian" + "devanagari" ; must be loaded after indian.el + "japanese" + "korean" + "lao" + "latin" + "misc-lang" + ;; "thai" #### merge thai and thai-xtis!!! + "thai-xtis" + "tibetan" + "vietnamese" + )) + ;; Specialized language support - (when-feature (and mule CANNA) "canna-leim") + (when (featurep '(and mule CANNA)) "canna-leim") ;; Egg/Its is now a package -; (when-feature (and mule wnn) "egg-leim") -; (when-feature (and mule wnn) "egg-kwnn-leim") -; (when-feature (and mule wnn) "egg-cwnn-leim") -; (when-feature mule "egg-sj3-leim") +; (when (featurep '(and mule wnn)) +; '("egg-leim" "egg-kwnn-leim" "egg-cwnn-leim")) +; (when (featurep 'mule) "egg-sj3-leim") ;; SKK is now a package -; (when-feature mule "skk-leim") +; (when (featurep 'mule) "skk-leim") ;; Enable Mule capability for Gnus, mail, etc... ;; Moved to sunpro-load.el - the default only for Sun. @@ -197,7 +221,8 @@ ;; needs access to the charsets created by the above ;; language-specific files. - (when-feature (and mule mswindows) "mule-msw-init-late") + (when (and (featurep 'mule) (valid-console-type-p 'mswindows)) + "mule-msw-init-late") ;;; mule-load.el ends here @@ -205,67 +230,78 @@ ;; id-menus is not here. infodock needs to figure out a clever way to ;; advise this stuff or we need to export a clean way for infodock or ;; others to control this programmatically. - (when-feature (and infodock (or x mswindows gtk) menubar) "id-menus") + (when (featurep '(and infodock (or x mswindows gtk) menubar)) + "id-menus") ;; preload the X code. - (when-feature x "x-iso8859-1") - (when-feature x "x-mouse") - (when-feature x "x-select") - (when-feature (and x scrollbar) "x-scrollbar") - (when-feature x "x-misc") - (when-feature x "x-init") - (when-feature x "x-win-xfree86") - (when-feature x "x-win-sun") -;; preload the GTK code - (when-feature gtk "gtk-ffi") - (when-feature gtk "gtk-widgets") - (when-feature gtk "gdk") - (when-feature gtk "gtk-init") - (when-feature gtk "gtk-iso8859-1") - (when-feature (and gtk dialog) "dialog-gtk") - (when-feature gtk "gtk-select") - (when-feature gtk "gtk-mouse") - (when-feature gtk "gtk-glyphs") - (when-feature glade "glade") - (when-feature gtk "widgets-gtk") + (when (featurep '(and x scrollbar)) "x-scrollbar") + (when (featurep 'x) + '("x-iso8859-1" + "x-mouse" + "x-select" + "x-misc" + "x-init" + "x-win-xfree86" + "x-win-sun")) + ;; preload the GTK code + (when (featurep 'gtk) + '("gtk-ffi" + "gtk-widgets" + "gdk" + "gtk-init" + "gtk-iso8859-1" + "gtk-select" + "gtk-mouse" + "gtk-glyphs" + "widgets-gtk")) + (when (featurep '(and gtk dialog)) "dialog-gtk") + (when (featurep 'glade) "glade") ;; preload the mswindows code. - (when-feature mswindows "msw-glyphs") - (when-feature mswindows "msw-mouse") - (when-feature mswindows "msw-init") - (when-feature mswindows "msw-select") + (when (valid-console-type-p 'mswindows) + '("msw-glyphs" + "msw-mouse" + "msw-init" + "msw-select")) ;; preload the TTY init code. - (when-feature tty "tty-init") + (when (featurep 'tty) "tty-init") ;;; Formerly in tooltalk/tooltalk-load.el ;; Moved to tooltalk package - ;; (when-feature tooltalk "tooltalk-macros") - ;; (when-feature tooltalk "tooltalk-util") - ;; (when-feature tooltalk "tooltalk-init") + ;; (when (featurep 'tooltalk) + ;; '("tooltalk-macros" "tooltalk-util" "tooltalk-init")) ;; "vc-hooks" ; Packaged. Available in two versions. ;; "ediff-hook" ; Packaged. - "fontl-hooks" - "auto-show" - "resize-minibuffer" - (when-feature ldap "ldap") + "fontl-hooks" + "auto-show" + "resize-minibuffer" + (when (featurep 'ldap) "ldap") -;; (when-feature energize "energize/energize-load.el") +;; (when (featurep 'energize) "energize/energize-load.el") ;;; formerly in sunpro/sunpro-load.el -;; (when-feature (and mule sparcworks) "mime-setup") +;; (when (featurep '(and mule sparcworks)) "mime-setup") ;; Moved to Sun package - ;; (when-feature sparcworks "cc-mode") ; Requires cc-mode package - ;; (when-feature sparcworks "sunpro-init") - ;; (when-feature sparcworks "ring") - ;; (when-feature sparcworks "comint") ; Requires comint package - ;; (when-feature sparcworks "annotations") + ;; (when (featurep 'sparcworks) + ;; '("cc-mode" ; Requires cc-mode package + ;; "sunpro-init" + ;; "ring" + ;; "comint" ; Requires comint package + ;; "annotations")) ;;; formerly in eos/sun-eos-load.el -;; (when-feature sparcworks "sun-eos-init") -;; (when-feature sparcworks "sun-eos-common") -;; (when-feature sparcworks "sun-eos-editor") -;; (when-feature sparcworks "sun-eos-browser") -;; (when-feature sparcworks "sun-eos-debugger") -;; (when-feature sparcworks "sun-eos-debugger-extra") -;; (when-feature sparcworks "sun-eos-menubar") - "loadhist" ; Must be dumped before loaddefs is loaded - "loaddefs" ; <=== autoloads get loaded here -)) + ;; (when (featurep 'sparcworks) + ;; '("sun-eos-init" + ;; "sun-eos-common" + ;; "sun-eos-editor" + ;; "sun-eos-browser" + ;; "sun-eos-debugger" + ;; "sun-eos-debugger-extra" + ;; "sun-eos-menubar")) + "loadhist" ; Must be dumped before loaddefs is loaded + "loaddefs" ; <=== autoloads get loaded here + )) + +(setq preloaded-file-list + (apply #'nconc + (mapcar #'(lambda (x) + (if (listp x) x (list x))) + preloaded-file-list))) Index: lisp/files.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/files.el,v retrieving revision 1.61 retrieving revision 1.64 diff -u -r1.61 -r1.64 --- lisp/files.el 2 Oct 2002 09:29:59 -0000 1.61 +++ lisp/files.el 9 Mar 2003 02:27:33 -0000 1.64 @@ -2,7 +2,7 @@ ;; Copyright (C) 1985-1987, 1992-1995, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Sun Microsystems. -;; Copyright (C) 2001, 2002 Ben Wing. +;; Copyright (C) 2001, 2002, 2003 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, dumped @@ -24,13 +24,26 @@ ;; Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: FSF 20.3 (but diverging) -;;; Warning: Merging this file is tough. Beware. +;;; [[ Synched up with: FSF 20.3 (but diverging) +;;; Warning: Merging this file is tough. Beware.]] + +;;; Beware of sync messages with 20.x or 21.x! (Unless I did them, of +;;; course ... :-) Those who did these synchronizations did not do proper +;;; jobs and often left out lots of changes. In practice you need to do a +;;; line-by-line comparison, and whenever encountering differences, see +;;; what FSF 19.34 looks like to see if the changes are intentional or just +;;; regressions. In at least one case below, our code was unchanged from +;;; FSF 19.30! --ben + +;;; Mostly synched to FSF 21.2 by Ben Wing using a line-by-line comparison, +;;; except some really hard parts that have changed almost completely. ;;; Commentary: ;; This file is dumped with XEmacs. +;; BEGIN SYNC WITH FSF 21.2. + ;; Defines most of XEmacs's file- and directory-handling functions, ;; including basic file visiting, backup generation, link handling, ;; ITS-id version control, load- and write-hook handling, and the like. @@ -53,10 +66,14 @@ "Finding and editing files." :group 'files) +;; XEmacs: In buffer.c (also) +(defcustom delete-auto-save-files t + "*Non-nil means delete auto-save file when a buffer is saved or killed. -;; XEmacs: In buffer.c -;(defconst delete-auto-save-files t -; "*Non-nil means delete auto-save file when a buffer is saved or killed.") +Note that auto-save file will not be deleted if the buffer is killed +when it has unsaved changes." + :type 'boolean + :group 'auto-save) ;; FSF has automount-dir-prefix. Our directory-abbrev-alist is more general. ;; note: tmp_mnt bogosity conversion is established in paths.el. @@ -67,6 +84,9 @@ This replacement is done when setting up the default directory of a newly visited file. *Every* FROM string should start with \\\\` or ^. +Do not use `~' in the TO strings. +They should be ordinary absolute directory names. + Use this feature when you have directories which you normally refer to via absolute symbolic links or to eliminate automounter mount points from the beginning of your filenames. Make TO the name of the link, @@ -93,7 +113,8 @@ The choice of renaming or copying is controlled by the variables `backup-by-copying', `backup-by-copying-when-linked' and -`backup-by-copying-when-mismatch'. See also `backup-inhibited'." +`backup-by-copying-when-mismatch' and +`backup-by-copying-when-privileged-mismatch'. See also `backup-inhibited'." :type 'boolean :group 'backup) @@ -128,20 +149,43 @@ :type 'boolean :group 'backup) -(defvar backup-enable-predicate - #'(lambda (name) - (not (or (null name) - (string-match "^/tmp/" name) - (let ((tmpdir (temp-directory))) - (and tmpdir - (string-match (concat "\\`" (regexp-quote tmpdir) "/") - tmpdir)))))) +(defcustom backup-by-copying-when-privileged-mismatch 200 + "*Non-nil means create backups by copying to preserve a privileged owner. +Renaming may still be used (subject to control of other variables) +when it would not result in changing the owner of the file or if the owner +has a user id greater than the value of this variable. This is useful +when low-numbered uid's are used for special system users (such as root) +that must maintain ownership of certain files. +This variable is relevant only if `backup-by-copying' and +`backup-by-copying-when-mismatch' are nil." + :type '(choice (const nil) integer) + :group 'backup) + +(defun normal-backup-enable-predicate (name) + "Default `backup-enable-predicate' function. +Checks for files in `temporary-file-directory' or +`small-temporary-file-directory'." + (let ((temporary-file-directory (temp-directory))) + (not (or (let ((comp (compare-strings temporary-file-directory 0 nil + name 0 nil))) + ;; Directory is under temporary-file-directory. + (and (not (eq comp t)) + (< comp (- (length temporary-file-directory))))) + (if small-temporary-file-directory + (let ((comp (compare-strings small-temporary-file-directory + 0 nil + name 0 nil))) + ;; Directory is under small-temporary-file-directory. + (and (not (eq comp t)) + (< comp (- (length small-temporary-file-directory)))))))))) + +(defvar backup-enable-predicate 'normal-backup-enable-predicate "Predicate that looks at a file name and decides whether to make backups. Called with an absolute file name as argument, it returns t to enable backup.") (defcustom buffer-offer-save nil - "*Non-nil in a buffer means offer to save the buffer on exit -even if the buffer is not visiting a file. + "*Non-nil in a buffer means always offer to save buffer on exit. +Do so even if the buffer is not visiting a file. Automatically local in all buffers." :type 'boolean :group 'find-file) @@ -171,6 +215,40 @@ (defvar buffer-file-numbers-unique (not (memq system-type '(windows-nt))) "Non-nil means that buffer-file-number uniquely identifies files.") +;; FSF 21.2. We use (temp-directory). +; (defvar temporary-file-directory +; (file-name-as-directory +; (cond ((memq system-type '(ms-dos windows-nt)) +; (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp")) +; ((memq system-type '(vax-vms axp-vms)) +; (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "SYS$SCRATCH:")) +; (t +; (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp")))) +; "The directory for writing temporary files.") + +(defvar small-temporary-file-directory + (if (eq system-type 'ms-dos) (getenv "TMPDIR")) + "The directory for writing small temporary files. +If non-nil, this directory is used instead of `temporary-file-directory' +by programs that create small temporary files. This is for systems that +have fast storage with limited space, such as a RAM disk.") + +;; The system null device. (Should reference NULL_DEVICE from C.) +(defvar null-device "/dev/null" "The system null device.") + +; (defvar file-name-invalid-regexp +; (cond ((and (eq system-type 'ms-dos) (not (msdos-long-file-names))) +; (concat "^\\([^A-Z[-`a-z]\\|..+\\)?:\\|" ; colon except after drive +; "[+, ;=|<>\"?*]\\|\\[\\|\\]\\|" ; invalid characters +; "[\000-\031]\\|" ; control characters +; "\\(/\\.\\.?[^/]\\)\\|" ; leading dots +; "\\(/[^/.]+\\.[^/.]*\\.\\)")) ; more than a single dot +; ((memq system-type '(ms-dos windows-nt)) +; (concat "^\\([^A-Z[-`a-z]\\|..+\\)?:\\|" ; colon except after drive +; "[|<>\"?*\000-\031]")) ; invalid characters +; (t "[\000]")) +; "Regexp recognizing file names which aren't allowed by the filesystem.") + (defcustom file-precious-flag nil "*Non-nil means protect against I/O errors while saving files. Some modes set this non-nil in particular buffers. @@ -191,13 +269,18 @@ t means make numeric backup versions unconditionally. nil means make them for files that have some already. `never' means do not make them." - :type 'boolean + :type '(choice (const :tag "Never" never) + (const :tag "If existing" nil) + (other :tag "Always" t)) :group 'backup :group 'vc) ;; This is now defined in efs. -;(defvar dired-kept-versions 2 -; "*When cleaning directory, number of versions to keep.") +; (defcustom dired-kept-versions 2 +; "*When cleaning directory, number of versions to keep." +; :type 'integer +; :group 'backup +; :group 'dired) (defcustom delete-old-versions nil "*If t, delete excess backup versions silently. @@ -238,15 +321,44 @@ :type 'boolean :group 'auto-save) +(defcustom auto-save-file-name-transforms + `(("\\`/[^/]*:\\(.+/\\)*\\(.*\\)" + ,(expand-file-name "\\2" (temp-directory)))) + "*Transforms to apply to buffer file name before making auto-save file name. +Each transform is a list (REGEXP REPLACEMENT): +REGEXP is a regular expression to match against the file name. +If it matches, `replace-match' is used to replace the +matching part with REPLACEMENT. +All the transforms in the list are tried, in the order they are listed. +When one transform applies, its result is final; +no further transforms are tried. + +The default value is set up to put the auto-save file into the +temporary directory (see the variable `temporary-file-directory') for +editing a remote file." + :group 'auto-save + :type '(repeat (list (string :tag "Regexp") (string :tag "Replacement"))) + ;:version "21.1" + ) + (defcustom save-abbrevs nil - "*Non-nil means save word abbrevs too when files are saved. + "*Non-nil means save word abbrevs too when files are saved. +If `silently', don't ask the user before saving. Loading an abbrev file sets this to t." - :type 'boolean + :type '(choice (const t) (const nil) (const silently)) :group 'abbrev) (defcustom find-file-run-dired t - "*Non-nil says run dired if `find-file' is given the name of a directory." - :type 'boolean + "*Non-nil means allow `find-file' to visit directories. +To visit the directory, `find-file' runs `find-directory-functions'." + :type 'boolean + :group 'find-file) + +(defcustom find-directory-functions '(cvs-dired-noselect dired-noselect) + "*List of functions to try in sequence to visit a directory. +Each function is called with the directory name as the sole argument +and should return either a buffer or nil." + :type '(hook :options (cvs-dired-noselect dired-noselect)) :group 'find-file) ;;;It is not useful to make this a local variable. @@ -254,7 +366,7 @@ (defvar find-file-not-found-hooks nil "List of functions to be called for `find-file' on nonexistent file. These functions are called as soon as the error is detected. -`buffer-file-name' is already set up. +Variable `buffer-file-name' is already set up. The functions are called in the order given until one of them returns non-nil.") ;;;It is not useful to make this a local variable. @@ -269,7 +381,10 @@ If one of them returns non-nil, the file is considered already written and the rest are not called. These hooks are considered to pertain to the visited file. -So this list is cleared if you change the visited file name. +So any buffer-local binding of `write-file-hooks' is +discarded if you change the visited file name with \\[set-visited-file-name]. + +Don't make this variable buffer-local; instead, use `local-write-file-hooks'. See also `write-contents-hooks' and `continue-save-buffer'.") ;;; However, in case someone does make it local... (put 'write-file-hooks 'permanent-local t) @@ -302,10 +417,18 @@ "List of functions to be called before writing out a buffer to a file. If one of them returns non-nil, the file is considered already written and the rest are not called. -These hooks are considered to pertain to the buffer's contents, -not to the particular visited file; thus, `set-visited-file-name' does -not clear this variable, but changing the major mode does clear it. + +This variable is meant to be used for hooks that pertain to the +buffer's contents, not to the particular visited file; thus, +`set-visited-file-name' does not clear this variable; but changing the +major mode does clear it. + +This variable automatically becomes buffer-local whenever it is set. +If you use `add-hook' to add elements to the list, use nil for the +LOCAL argument. + See also `write-file-hooks' and `continue-save-buffer'.") +(make-variable-buffer-local 'write-contents-hooks) ;; XEmacs addition ;; Energize needed this to hook into save-buffer at a lower level; we need @@ -321,22 +444,35 @@ If one of them returns non-nil, the file is considered already written and the rest are not called. These hooks are considered to pertain to the visited file. -So this list is cleared if you change the visited file name. +So any buffer-local binding of `write-file-data-hooks' is +discarded if you change the visited file name with \\[set-visited-file-name]. See also `write-file-hooks'.") (defcustom enable-local-variables t - "*Control use of local-variables lists in files you visit. + "*Control use of local variables in files you visit. The value can be t, nil or something else. -A value of t means local-variables lists are obeyed; +A value of t means file local variables specifications are obeyed; nil means they are ignored; anything else means query. +This variable also controls use of major modes specified in +a -*- line. -The command \\[normal-mode] always obeys local-variables lists +The command \\[normal-mode], when used interactively, +always obeys file local variable specifications and the -*- line, and ignores this variable." :type '(choice (const :tag "Obey" t) (const :tag "Ignore" nil) (sexp :tag "Query" :format "%t\n" other)) :group 'find-file) +; (defvar local-enable-local-variables t +; "Like `enable-local-variables' but meant for buffer-local bindings. +; The meaningful values are nil and non-nil. The default is non-nil. +; If a major mode sets this to nil, buffer-locally, then any local +; variables list in the file will be ignored. + +; This variable does not affect the use of major modes +; specified in a -*- line.") + (defcustom enable-local-eval 'maybe "*Control processing of the \"variable\" `eval' in a file's local variables. The value can be t, nil or something else. @@ -355,13 +491,18 @@ (defalias 'lock-buffer 'ignore)) (or (fboundp 'unlock-buffer) (defalias 'unlock-buffer 'ignore)) +(or (fboundp 'file-locked-p) + (defalias 'file-locked-p 'ignore)) + +(defvar view-read-only nil + "*Non-nil means buffers visiting files read-only, do it in view mode.") ;;FSFmacs bastardized ange-ftp cruft -;; This hook function provides support for ange-ftp host name -;; completion. It runs the usual ange-ftp hook, but only for -;; completion operations. Having this here avoids the need -;; to load ange-ftp when it's not really in use. ;(defun ange-ftp-completion-hook-function (op &rest args) +; "Provides support for ange-ftp host name completion. +;Runs the usual ange-ftp hook, but only for completion operations." +; ;; Having this here avoids the need to load ange-ftp when it's not +; ;; really in use. ; (if (memq op '(file-name-completion file-name-all-completions)) ; (apply 'ange-ftp-hook-function op args) ; (let ((inhibit-file-name-handlers @@ -371,6 +512,11 @@ ; (inhibit-file-name-operation op)) ; (apply op args)) +;; FSF 21.2: +;This function's standard definition is trivial; it just returns the argument. +;However, on some systems, the function is redefined with a definition +;that really does change some file names to canonicalize certain +;patterns and to guarantee valid names." (defun convert-standard-filename (filename) "Convert a standard file's name to something suitable for the current OS." (if (eq system-type 'windows-nt) @@ -432,7 +578,9 @@ (setq dir (file-truename dir))) (setq dir (abbreviate-file-name (expand-file-name dir))) (cond ((not (file-directory-p dir)) - (error "%s is not a directory" dir)) + (if (file-exists-p dir) + (error "%s is not a directory" dir) + (error "%s: no such directory" dir))) ;; this breaks ange-ftp, which doesn't (can't?) overload `file-executable-p'. ;;((not (file-executable-p dir)) ;; (error "Cannot cd to %s: Permission denied" dir)) @@ -474,7 +622,10 @@ (defun load-file (file) "Load the Lisp file named FILE." - (interactive "fLoad file: ") + ;; This is a case where .elc makes a lot of sense. + (interactive (list (let ((completion-ignored-extensions + (remove ".elc" completion-ignored-extensions))) + (read-file-name "Load file: ")))) (load (expand-file-name file) nil nil t)) ; We now dump utils/lib-complete.el which has improved versions of this. @@ -493,10 +644,12 @@ ; (find-file f) ; (error "Couldn't locate library %s" library)))) -(defun file-local-copy (file &optional buffer) +(defun file-local-copy (file) "Copy the file FILE into a temporary file on this machine. Returns the name of the local copy, or nil, if FILE is directly accessible." + ;; This formerly had an optional BUFFER argument that wasn't used by + ;; anything. (let ((handler (find-file-name-handler file 'file-local-copy))) (if handler (funcall handler 'file-local-copy file) @@ -547,8 +700,7 @@ (error "Apparent cycle of symbolic links for %s" filename)) ;; In the context of a link, `//' doesn't mean what XEmacs thinks. (while (string-match "//+" tem) - (setq tem (concat (substring tem 0 (1+ (match-beginning 0))) - (substring tem (match-end 0))))) + (setq tem (replace-match "/" nil nil tem))) ;; Handle `..' by hand, since it needs to work in the ;; target of any directory symlink. ;; This code is not quite complete; it does not handle @@ -578,9 +730,15 @@ (if (<= arg 1) (other-buffer (current-buffer)) (nth (1+ arg) (buffer-list))))) -(defun switch-to-buffer-other-window (buffer) - "Select buffer BUFFER in another window." - (interactive "BSwitch to buffer in other window: ") +;;FSF 21.2 +;Optional second arg NORECORD non-nil means +;do not put this buffer at the front of the list of recently selected ones. +(defun switch-to-buffer-other-window (buffer) ;;FSF 21.2: &optional norecord + "Select buffer BUFFER in another window. + +This uses the function `display-buffer' as a subroutine; see its +documentation for additional customization information." + (interactive "BSwitch to buffer in other window: ") (let ((pop-up-windows t)) ;; XEmacs: this used to have (selected-frame) as the third argument, ;; but this is obnoxious. If the user wants the buffer in a @@ -588,9 +746,26 @@ ;; Change documented above undone --mrb (pop-to-buffer buffer t (selected-frame)))) + ;(pop-to-buffer buffer t norecord))) + +;; FSF 21.2: +; (defun switch-to-buffer-other-frame (buffer &optional norecord) +; "Switch to buffer BUFFER in another frame. +; Optional second arg NORECORD non-nil means +; do not put this buffer at the front of the list of recently selected ones. + +; This uses the function `display-buffer' as a subroutine; see its +; documentation for additional customization information." +; (interactive "BSwitch to buffer in other frame: ") +; (let ((pop-up-frames t)) +; (pop-to-buffer buffer t norecord) +; (raise-frame (window-frame (selected-window))))) (defun switch-to-buffer-other-frame (buffer) - "Switch to buffer BUFFER in a newly-created frame." + "Switch to buffer BUFFER in a newly-created frame. + + This uses the function `display-buffer' as a subroutine; see its + documentation for additional customization information." (interactive "BSwitch to buffer in other frame: ") (let* ((name (get-frame-name-for-buffer buffer)) (frame (make-frame (if name @@ -658,7 +833,7 @@ (not (funcall buffers-tab-selection-function curbuf (car (buffer-list))))))))) -(defun find-file (filename &optional codesys) +(defun find-file (filename &optional codesys wildcards) "Edit file FILENAME. Switch to a buffer visiting file FILENAME, creating one if none already exists. Optional second argument specifies the coding system to use when @@ -682,63 +857,112 @@ 5. The coding system 'raw-text. See `insert-file-contents' for more details about how the process of -determining the coding system works." - (interactive "FFind file: \nZCoding system: ") +determining the coding system works. + +Interactively, or if WILDCARDS is non-nil in a call from Lisp, +expand wildcards (if any) and visit multiple files. Wildcard expansion +can be suppressed by setting `find-file-wildcards'." + (interactive (list (read-file-name "Find file: ") + (and current-prefix-arg + (read-coding-system "Coding system: ")) + t)) (if codesys (let ((coding-system-for-read (get-coding-system codesys))) - (switch-to-buffer (find-file-noselect filename))) - (switch-to-buffer (find-file-noselect filename)))) + (let ((value (find-file-noselect filename nil nil wildcards))) + (if (listp value) + (mapcar 'switch-to-buffer (nreverse value)) + (switch-to-buffer value)))) + (let ((value (find-file-noselect filename nil nil wildcards))) + (if (listp value) + (mapcar 'switch-to-buffer (nreverse value)) + (switch-to-buffer value))))) -(defun find-file-other-window (filename &optional codesys) +(defun find-file-other-window (filename &optional codesys wildcards) "Edit file FILENAME, in another window. May create a new window, or reuse an existing one. See the function `display-buffer'. Optional second argument specifies the coding system to use when decoding the file. Interactively, with a prefix argument, you will be prompted for the coding system." - (interactive "FFind file in other window: \nZCoding system: ") + (interactive (list (read-file-name "Find file in other window: ") + (and current-prefix-arg + (read-coding-system "Coding system: ")) + t)) (if codesys (let ((coding-system-for-read (get-coding-system codesys))) - (switch-to-buffer-other-window (find-file-noselect filename))) - (switch-to-buffer-other-window (find-file-noselect filename)))) + (let ((value (find-file-noselect filename nil nil wildcards))) + (if (listp value) + (progn + (setq value (nreverse value)) + (switch-to-buffer-other-window (car value)) + (mapcar 'switch-to-buffer (cdr value))) + (switch-to-buffer-other-window value)))) + (let ((value (find-file-noselect filename nil nil wildcards))) + (if (listp value) + (progn + (setq value (nreverse value)) + (switch-to-buffer-other-window (car value)) + (mapcar 'switch-to-buffer (cdr value))) + (switch-to-buffer-other-window value))))) -(defun find-file-other-frame (filename &optional codesys) +(defun find-file-other-frame (filename &optional codesys wildcards) "Edit file FILENAME, in a newly-created frame. Optional second argument specifies the coding system to use when decoding the file. Interactively, with a prefix argument, you will be prompted for the coding system." - (interactive "FFind file in other frame: \nZCoding system: ") + (interactive (list (read-file-name "Find file in other frame: ") + (and current-prefix-arg + (read-coding-system "Coding system: ")) + t)) (if codesys (let ((coding-system-for-read (get-coding-system codesys))) - (switch-to-buffer-other-frame (find-file-noselect filename))) - (switch-to-buffer-other-frame (find-file-noselect filename)))) + (let ((value (find-file-noselect filename nil nil wildcards))) + (if (listp value) + (progn + (setq value (nreverse value)) + (switch-to-buffer-other-frame (car value)) + (mapcar 'switch-to-buffer (cdr value))) + (switch-to-buffer-other-frame value)))) + (let ((value (find-file-noselect filename nil nil wildcards))) + (if (listp value) + (progn + (setq value (nreverse value)) + (switch-to-buffer-other-frame (car value)) + (mapcar 'switch-to-buffer (cdr value))) + (switch-to-buffer-other-frame value))))) -(defun find-file-read-only (filename &optional codesys) +(defun find-file-read-only (filename &optional codesys wildcards) "Edit file FILENAME but don't allow changes. Like \\[find-file] but marks buffer as read-only. Use \\[toggle-read-only] to permit editing. Optional second argument specifies the coding system to use when decoding the file. Interactively, with a prefix argument, you will be prompted for the coding system." - (interactive "fFind file read-only: \nZCoding system: ") + (interactive (list (read-file-name "Find file read-only: ") + (and current-prefix-arg + (read-coding-system "Coding system: ")) + t)) (if codesys (let ((coding-system-for-read (get-coding-system codesys))) - (find-file filename)) - (find-file filename)) + (find-file filename nil wildcards)) + (find-file filename nil wildcards)) (setq buffer-read-only t) (current-buffer)) -(defun find-file-read-only-other-window (filename &optional codesys) +(defun find-file-read-only-other-window (filename &optional codesys wildcards) "Edit file FILENAME in another window but don't allow changes. Like \\[find-file-other-window] but marks buffer as read-only. Use \\[toggle-read-only] to permit editing. Optional second argument specifies the coding system to use when decoding the file. Interactively, with a prefix argument, you will be prompted for the coding system." - (interactive "fFind file read-only other window: \nZCoding system: ") + (interactive (list (read-file-name "Find file read-only other window: ") + (and current-prefix-arg + (read-coding-system "Coding system: ")) + t)) (if codesys (let ((coding-system-for-read (get-coding-system codesys))) @@ -747,14 +971,17 @@ (setq buffer-read-only t) (current-buffer)) -(defun find-file-read-only-other-frame (filename &optional codesys) +(defun find-file-read-only-other-frame (filename &optional codesys wildcards) "Edit file FILENAME in another frame but don't allow changes. Like \\[find-file-other-frame] but marks buffer as read-only. Use \\[toggle-read-only] to permit editing. Optional second argument specifies the coding system to use when decoding the file. Interactively, with a prefix argument, you will be prompted for the coding system." - (interactive "fFind file read-only other frame: \nZCoding system: ") + (interactive (list (read-file-name "Find file read-only other frame: ") + (and current-prefix-arg + (read-coding-system "Coding system: ")) + t)) (if codesys (let ((coding-system-for-read (get-coding-system codesys))) @@ -836,7 +1063,7 @@ (rename-buffer oname)))) (or (eq (current-buffer) obuf) (kill-buffer obuf)))) - + (defun create-file-buffer (filename) "Create a suitably named buffer for visiting FILENAME, and return it. FILENAME (sans directory) is used unchanged if that name is free; @@ -859,7 +1086,7 @@ (defun abbreviate-file-name (filename &optional hack-homedir) "Return a version of FILENAME shortened using `directory-abbrev-alist'. -See documentation of variable `directory-abbrev-alist' for more information. +Type \\[describe-variable] directory-abbrev-alist RET for more information. If optional argument HACK-HOMEDIR is non-nil, then this also substitutes \"~\" for the user's home directory." (let ((handler (find-file-name-handler filename 'abbreviate-file-name))) @@ -938,31 +1165,240 @@ (setq found (car list)))) (setq list (cdr list))) found) - (let ((number (nthcdr 10 (file-attributes truename))) - (list (buffer-list)) found) + (let* ((attributes (file-attributes truename)) + (number (nthcdr 10 attributes)) + (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) + (with-current-buffer (car list) + (if (and buffer-file-name + (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)) + (equal (file-attributes buffer-file-name) + attributes)) (setq found (car list)))) (setq list (cdr list)))) found)))) + +(defcustom find-file-wildcards t + "*Non-nil means file-visiting commands should handle wildcards. +For example, if you specify `*.c', that would visit all the files +whose names match the pattern." + :group 'files +; :version "20.4" + :type 'boolean) + +(defcustom find-file-suppress-same-file-warnings nil + "*Non-nil means suppress warning messages for symlinked files. +When nil, Emacs prints a warning when visiting a file that is already +visited, but with a different name. Setting this option to t +suppresses this warning." + :group 'files +; :version "21.1" + :type 'boolean) +(defun find-file-noselect (filename &optional nowarn rawfile wildcards) + "Read file FILENAME into a buffer and return the buffer. +If a buffer exists visiting FILENAME, return that one, but +verify that the file has not changed since visited or saved. +The buffer is not selected, just returned to the caller. +If NOWARN is non-nil, warning messages will be suppressed. +If RAWFILE is non-nil, the file is read literally." + (setq filename + (abbreviate-file-name + (expand-file-name filename))) + (if (file-directory-p filename) + (or (and find-file-run-dired + (loop for fn in find-directory-functions + for x = (and (fboundp fn) + (funcall fn + (if find-file-use-truenames + (abbreviate-file-name + (file-truename filename)) + filename))) + if x + return x)) + (error "%s is a directory" filename)) + (if (and wildcards + find-file-wildcards + (not (string-match "\\`/:" filename)) + (string-match "[[*?]" filename)) + (let ((files (condition-case nil + (file-expand-wildcards filename t) + (error (list filename)))) + (find-file-wildcards nil)) + (if (null files) + (find-file-noselect filename) + (mapcar #'find-file-noselect files))) + (let* ((buf (get-file-buffer filename)) + (truename (abbreviate-file-name (file-truename filename))) + (number (nthcdr 10 (file-attributes truename))) +; ;; Find any buffer for a file which has same truename. +; (other (and (not buf) (find-buffer-visiting filename))) + ) + +; ;; Let user know if there is a buffer with the same truename. +; (if other +; (progn +; (or nowarn +; find-file-suppress-same-file-warnings +; (string-equal filename (buffer-file-name other)) +; (message "%s and %s are the same file" +; filename (buffer-file-name other))) +; ;; Optionally also find that buffer. +; (if (or find-file-existing-other-name find-file-visit-truename) +; (setq buf other)))) + + (when (and buf + (or find-file-compare-truenames find-file-use-truenames) + (not find-file-suppress-same-file-warnings) + (not nowarn)) + (save-excursion + (set-buffer buf) + (if (not (string-equal buffer-file-name filename)) + (message "%s and %s are the same file (%s)" + filename buffer-file-name + buffer-file-truename)))) + + (if buf + (progn + (or nowarn + (verify-visited-file-modtime buf) + (cond ((not (file-exists-p filename)) + (error "File %s no longer exists!" filename)) + ;; Certain files should be reverted automatically + ;; if they have changed on disk and not in the buffer. + ((and (not (buffer-modified-p buf)) + (dolist (rx revert-without-query nil) + (when (string-match rx filename) + (return t)))) + (with-current-buffer buf + (message "Reverting file %s..." filename) + (revert-buffer t t) + (message "Reverting file %s... done" filename))) + ((yes-or-no-p + (if (string= (file-name-nondirectory filename) + (buffer-name buf)) + (format + (if (buffer-modified-p buf) + (gettext "File %s changed on disk. Discard your edits? ") + (gettext "File %s changed on disk. Reread from disk? ")) + (file-name-nondirectory filename)) + (format + (if (buffer-modified-p buf) + (gettext "File %s changed on disk. Discard your edits in %s? ") + (gettext "File %s changed on disk. Reread from disk into %s? ")) + (file-name-nondirectory filename) + (buffer-name buf)))) + (with-current-buffer buf + (revert-buffer t t))))) + (when (not (eq rawfile (not (null find-file-literally)))) + (with-current-buffer buf + (if (buffer-modified-p) + (if (y-or-n-p (if rawfile + "Save file and revisit literally? " + "Save file and revisit non-literally? ")) + (progn + (save-buffer) + (find-file-noselect-1 buf filename nowarn + rawfile truename number)) + (if (y-or-n-p (if rawfile + "Discard your edits and revisit file literally? " + "Discard your edits and revisit file non-literally? ")) + (find-file-noselect-1 buf filename nowarn + rawfile truename number) + (error (if rawfile "File already visited non-literally" + "File already visited literally")))) + (if (y-or-n-p (if rawfile + "Revisit file literally? " + "Revisit file non-literally? ")) + (find-file-noselect-1 buf filename nowarn + rawfile truename number) + (error (if rawfile "File already visited non-literally" + "File already visited literally")))))) + ;; Return the buffer we are using. + buf) + ;; Create a new buffer. + (setq buf (create-file-buffer filename)) + ;; Catch various signals, such as QUIT, and kill the buffer + ;; in that case. + (condition-case data + (progn + (set-buffer-major-mode buf) + ;; find-file-noselect-1 may use a different buffer. + (find-file-noselect-1 buf filename nowarn + rawfile truename number)) + (t + (kill-buffer buf) + (signal (car data) (cdr data))))))))) + +(defun find-file-noselect-1 (buf filename nowarn rawfile truename number) + (let ((inhibit-read-only t) + error) + (with-current-buffer buf + (kill-local-variable 'find-file-literally) + ;; Needed in case we are re-visiting the file with a different + ;; text representation. + (kill-local-variable 'buffer-file-coding-system) + (erase-buffer) +; (and (default-value 'enable-multibyte-characters) +; (not rawfile) +; (set-buffer-multibyte t)) + (condition-case () + (if rawfile + (insert-file-contents-literally filename t) + (insert-file-contents filename t)) + (file-error + (when (and (file-exists-p filename) + (not (file-readable-p filename))) + (signal 'file-error (list "File is not readable" filename))) + (if rawfile + ;; Unconditionally set error + (setq error t) + (or + ;; Run find-file-not-found-hooks until one returns non-nil. + (run-hook-with-args-until-success 'find-file-not-found-hooks) + ;; If they fail too, set error. + (setq error t))))) + ;; Find the file's truename, and maybe use that as visited name. + ;; automatically computed in XEmacs, unless jka-compr was used! + (unless buffer-file-truename + (setq buffer-file-truename truename)) + (setq buffer-file-number number) + (and find-file-use-truenames + ;; This should be in C. Put pathname + ;; abbreviations that have been explicitly + ;; requested back into the pathname. Most + ;; importantly, strip out automounter /tmp_mnt + ;; directories so that auto-save will work + (setq buffer-file-name (abbreviate-file-name buffer-file-name))) + ;; Set buffer's default directory to that of the file. + (setq default-directory (file-name-directory buffer-file-name)) + ;; Turn off backup files for certain file names. Since + ;; this is a permanent local, the major mode won't eliminate it. + (and (not (funcall backup-enable-predicate buffer-file-name)) + (progn + (make-local-variable 'backup-inhibited) + (setq backup-inhibited t))) + (if rawfile + (progn + (setq buffer-file-coding-system 'no-conversion) + (make-local-variable 'find-file-literally) + (setq find-file-literally t)) + (after-find-file error (not nowarn)) + (setq buf (current-buffer))) + (current-buffer)))) + (defun insert-file-contents-literally (filename &optional visit start end replace) - "Like `insert-file-contents', q.v., but only reads in the file. -A buffer may be modified in several ways after reading into the buffer due -to advanced Emacs features, such as format decoding, character code -conversion, find-file-hooks, automatic uncompression, etc. + "Like `insert-file-contents', but only reads in the file literally. +A buffer may be modified in several ways after reading into the buffer, +due to Emacs features such as format decoding, character code +conversion, `find-file-hooks', automatic uncompression, etc. - This function ensures that none of these modifications will take place." +This function ensures that none of these modifications will take place." (let ((wrap-func (find-file-name-handler filename 'insert-file-contents-literally))) (if wrap-func @@ -976,7 +1412,9 @@ (find-buffer-file-type-function (if (fboundp 'find-buffer-file-type) (symbol-function 'find-buffer-file-type) - nil))) + nil)) + (inhibit-file-name-handlers '(jka-compr-handler image-file-handler)) + (inhibit-file-name-operation 'insert-file-contents)) (unwind-protect (progn (fset 'find-buffer-file-type (lambda (filename) t)) @@ -985,150 +1423,44 @@ (fset 'find-buffer-file-type find-buffer-file-type-function) (fmakunbound 'find-buffer-file-type))))))) -(defun find-file-noselect (filename &optional nowarn rawfile) - "Read file FILENAME into a buffer and return the buffer. -If a buffer exists visiting FILENAME, return that one, but -verify that the file has not changed since visited or saved. -The buffer is not selected, just returned to the caller. -If NOWARN is non-nil, warning messages will be suppressed. -If RAWFILE is non-nil, the file is read literally." - (setq filename (abbreviate-file-name (expand-file-name filename))) +(defun insert-file-literally (filename) + "Insert contents of file FILENAME into buffer after point with no conversion. + +This function is meant for the user to run interactively. +Don't call it from programs! Use `insert-file-contents-literally' instead. +\(Its calling sequence is different; see its documentation)." + (interactive "*fInsert file literally: ") (if (file-directory-p filename) - (if (and (fboundp 'dired-noselect) find-file-run-dired) - (declare-fboundp - (dired-noselect (if find-file-use-truenames - (abbreviate-file-name (file-truename filename)) - filename))) - (error "%s is a directory" filename)) - (let* ((buf (get-file-buffer filename)) - (truename (abbreviate-file-name (file-truename filename))) - (number (nthcdr 10 (file-attributes truename))) -; ;; Find any buffer for a file which has same truename. -; (other (and (not buf) (find-buffer-visiting filename))) - (error nil)) + (signal 'file-error (list "Opening input file" "file is a directory" + filename))) + (let ((tem (insert-file-contents-literally filename))) + (push-mark (+ (point) (car (cdr tem)))))) -; ;; Let user know if there is a buffer with the same truename. -; (if (and (not buf) same-truename (not nowarn)) -; (message "%s and %s are the same file (%s)" -; filename (buffer-file-name same-truename) -; truename) -; (if (and (not buf) same-number (not nowarn)) -; (message "%s and %s are the same file" -; filename (buffer-file-name same-number)))) -; ;; Optionally also find that buffer. -; (if (or find-file-existing-other-name find-file-visit-truename) -; (setq buf (or same-truename same-number))) - - (when (and buf - (or find-file-compare-truenames find-file-use-truenames) - (not nowarn)) - (save-excursion - (set-buffer buf) - (if (not (string-equal buffer-file-name filename)) - (message "%s and %s are the same file (%s)" - filename buffer-file-name - buffer-file-truename)))) - - (if buf - (or nowarn - (verify-visited-file-modtime buf) - (cond ((not (file-exists-p filename)) - (error "File %s no longer exists!" filename)) - ;; Certain files should be reverted automatically - ;; if they have changed on disk and not in the buffer. - ((and (not (buffer-modified-p buf)) - (dolist (rx revert-without-query nil) - (when (string-match rx filename) - (return t)))) - (with-current-buffer buf - (message "Reverting file %s..." filename) - (revert-buffer t t) - (message "Reverting file %s... done" filename))) - ((yes-or-no-p - (if (string= (file-name-nondirectory filename) - (buffer-name buf)) - (format - (if (buffer-modified-p buf) - (gettext "File %s changed on disk. Discard your edits? ") - (gettext "File %s changed on disk. Reread from disk? ")) - (file-name-nondirectory filename)) - (format - (if (buffer-modified-p buf) - (gettext "File %s changed on disk. Discard your edits in %s? ") - (gettext "File %s changed on disk. Reread from disk into %s? ")) - (file-name-nondirectory filename) - (buffer-name buf)))) - (with-current-buffer buf - (revert-buffer t t))))) - ;; Else: we must create a new buffer for filename - (save-excursion -;;; The truename stuff makes this obsolete. -;;; (let* ((link-name (car (file-attributes filename))) -;;; (linked-buf (and (stringp link-name) -;;; (get-file-buffer link-name)))) -;;; (if (bufferp linked-buf) -;;; (message "Symbolic link to file in buffer %s" -;;; (buffer-name linked-buf)))) - (setq buf (create-file-buffer filename)) - ;; Catch various signals, such as QUIT, and kill the buffer - ;; in that case. - (condition-case data - (progn - (set-buffer-major-mode buf) - (set-buffer buf) - (erase-buffer) - (condition-case () - (if rawfile - (insert-file-contents-literally filename t) - (insert-file-contents filename t)) - (file-error - (when (and (file-exists-p filename) - (not (file-readable-p filename))) - (signal 'file-error (list "File is not readable" filename))) - (if rawfile - ;; Unconditionally set error - (setq error t) - (or - ;; Run find-file-not-found-hooks until one returns non-nil. - (run-hook-with-args-until-success 'find-file-not-found-hooks) - ;; If they fail too, set error. - (setq error t))))) - ;; Find the file's truename, and maybe use that as visited name. - ;; automatically computed in XEmacs, unless jka-compr was used! - (unless buffer-file-truename - (setq buffer-file-truename truename)) - (setq buffer-file-number number) - (and find-file-use-truenames - ;; This should be in C. Put pathname - ;; abbreviations that have been explicitly - ;; requested back into the pathname. Most - ;; importantly, strip out automounter /tmp_mnt - ;; directories so that auto-save will work - (setq buffer-file-name (abbreviate-file-name buffer-file-name))) - ;; Set buffer's default directory to that of the file. - (setq default-directory (file-name-directory buffer-file-name)) - ;; Turn off backup files for certain file names. Since - ;; this is a permanent local, the major mode won't eliminate it. - (and (not (funcall backup-enable-predicate buffer-file-name)) - (progn - (make-local-variable 'backup-inhibited) - (setq backup-inhibited t))) - (if rawfile - ;; #### FSF 20.3 sets buffer-file-coding-system to - ;; `no-conversion' here. Should we copy? It also - ;; makes `find-file-literally' a local variable - ;; and sets it to t. - nil - (after-find-file error (not nowarn)) - (setq buf (current-buffer)))) - (t - (kill-buffer buf) - (signal (car data) (cdr data)))) - )) - buf))) +(defvar find-file-literally nil + "Non-nil if this buffer was made by `find-file-literally' or equivalent. +This is a permanent local.") +(put 'find-file-literally 'permanent-local t) + +(defun find-file-literally (filename) + "Visit file FILENAME with no conversion of any kind. +Format conversion and character code conversion are both disabled, +and multibyte characters are disabled in the resulting buffer. +The major mode used is Fundamental mode regardless of the file name, +and local variable specifications in the file are ignored. +Automatic uncompression and adding a newline at the end of the +file due to `require-final-newline' is also disabled. + +You cannot absolutely rely on this function to result in +visiting the file literally. If Emacs already has a buffer +which is visiting the file, you get the existing buffer, +regardless of whether it was created literally or not. + +In a Lisp program, if you want to be sure of accessing a file's +contents literally, you should create a temporary buffer and then read +the file contents into it using `insert-file-contents-literally'." + (interactive "FFind file literally: ") + (switch-to-buffer (find-file-noselect filename nil t))) -;; FSF has `insert-file-literally' and `find-file-literally' here. - (defvar after-find-file-from-revert-buffer nil) (defun after-find-file (&optional error warn noauto @@ -1143,59 +1475,73 @@ 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'." +Finishes by calling the functions in `find-file-hooks' +unless NOMODES is non-nil." (setq buffer-read-only (not (file-writable-p buffer-file-name))) (if noninteractive nil (let* (not-serious (msg - (cond ((and error (file-attributes buffer-file-name)) - (setq buffer-read-only t) - (gettext "File exists, but cannot be read.")) - ((not buffer-read-only) - (if (and warn - (file-newer-than-file-p (make-auto-save-file-name) - buffer-file-name)) - (format "%s has auto save data; consider M-x recover-file" - (file-name-nondirectory buffer-file-name)) - (setq not-serious t) - (if error (gettext "(New file)") nil))) - ((not error) - (setq not-serious t) - (gettext "Note: file is write protected")) - ((file-attributes (directory-file-name default-directory)) - (gettext "File not found and directory write-protected")) - ((file-exists-p (file-name-directory buffer-file-name)) - (setq buffer-read-only nil)) - (t - ;; If the directory the buffer is in doesn't exist, - ;; offer to create it. It's better to do this now - ;; than when we save the buffer, because we want - ;; autosaving to work. - (setq buffer-read-only nil) - ;; XEmacs - (or (file-exists-p (file-name-directory buffer-file-name)) - (condition-case nil - (if (yes-or-no-p - (format - "\ + (cond + ((not warn) nil) + ((and error (file-attributes buffer-file-name)) + (setq buffer-read-only t) + (gettext "File exists, but cannot be read.")) + ((not buffer-read-only) + (if (and warn + (file-newer-than-file-p (make-auto-save-file-name) + buffer-file-name)) + (format "%s has auto save data; consider M-x recover-file" + (file-name-nondirectory buffer-file-name)) + (setq not-serious t) + (if error (gettext "(New file)") nil))) + ((not error) + (setq not-serious t) + (gettext "Note: file is write protected")) + ((file-attributes (directory-file-name default-directory)) + (gettext "File not found and directory write-protected")) + ((file-exists-p (file-name-directory buffer-file-name)) + (setq buffer-read-only nil)) + (t + ;; If the directory the buffer is in doesn't exist, + ;; offer to create it. It's better to do this now + ;; than when we save the buffer, because we want + ;; autosaving to work. + (setq buffer-read-only nil) + ;; XEmacs + (or (file-exists-p (file-name-directory buffer-file-name)) + (condition-case nil + (if (yes-or-no-p + (format + "\ The directory containing %s does not exist. Create? " - (abbreviate-file-name buffer-file-name))) - (make-directory (file-name-directory - buffer-file-name) - t)) - (quit - (kill-buffer (current-buffer)) - (signal 'quit nil)))) - nil)))) + (abbreviate-file-name buffer-file-name))) + (make-directory (file-name-directory + buffer-file-name) + t)) + (quit + (kill-buffer (current-buffer)) + (signal 'quit nil)))) + nil)))) (if msg (progn (message "%s" msg) (or not-serious (sit-for 1 t))))) - (if (and auto-save-default (not noauto)) + (when (and auto-save-default (not noauto)) (auto-save-mode t))) + ;; Make people do a little extra work (C-x C-q) + ;; before altering a backup file. + (when (backup-file-name-p buffer-file-name) + (setq buffer-read-only t)) (unless nomodes + ;; #### No view-mode-disable. +; (when view-read-only +; (and-boundp 'view-mode (view-mode-disable))) (normal-mode t) + (when (and buffer-read-only + view-read-only + (not (eq (get major-mode 'mode-class) 'special))) + (view-mode)) (run-hooks 'find-file-hooks))) (defun normal-mode (&optional find-file) @@ -1204,10 +1550,15 @@ Uses the visited file name, the -*- line, and the local variables spec. This function is called automatically from `find-file'. In that case, -we may set up specified local variables depending on the value of -`enable-local-variables': if it is t, we do; if it is nil, we don't; -otherwise, we query. `enable-local-variables' is ignored if you -run `normal-mode' explicitly." +we may set up the file-specified mode and local variables, +depending on the value of `enable-local-variables': if it is t, we do; +if it is nil, we don't; otherwise, we query. +In addition, if `local-enable-local-variables' is nil, we do +not set local variables (though we do notice a mode specified with -*-.) + +`enable-local-variables' is ignored if you run `normal-mode' interactively, +or from Lisp without specifying the optional argument FIND-FILE; +in that case, this function acts as if `enable-local-variables' were t." (interactive) (or find-file (funcall (or default-major-mode 'fundamental-mode))) (and (with-trapping-errors @@ -1220,8 +1571,14 @@ :operation "File local-variables" :class 'local-variables :error-form nil + ;; FSF 21.2: +; (let ((enable-local-variables (or (not find-file) +; enable-local-variables))) +; (hack-local-variables)) (hack-local-variables (not find-file))))) +;; END SYNC WITH FSF 21.2. + ;; `auto-mode-alist' used to contain entries for modes in core and in packages. ;; The applicable entries are now located in the corresponding modes in ;; packages, the ones here are for core modes. Ditto for @@ -1307,6 +1664,19 @@ When checking `inhibit-first-line-modes-regexps', we first discard from the end of the file name anything that matches one of these regexps.") +;; Junk from FSF 21.2. Unnecessary in XEmacs, since `interpreter-mode-alist' +;; can have regexps. +; (defvar auto-mode-interpreter-regexp +; "#![ \t]?\\([^ \t\n]*\ +; /bin/env[ \t]\\)?\\([^ \t\n]+\\)" +; "Regular expression matching interpreters, for file mode determination. +; This regular expression is matched against the first line of a file +; to determine the file's mode in `set-auto-mode' when Emacs can't deduce +; a mode from the file's name. If it matches, the file is assumed to +; be interpreted by the interpreter matched by the second group of the +; regular expression. The mode is then determined as the mode associated +; with that interpreter in `interpreter-mode-alist'.") + (defvar user-init-file nil ; set by command-line "File name including directory of user's initialization file.") @@ -1639,6 +2009,8 @@ (setq result (cdr result))) mode-p))) +;; BEGIN SYNC WITH FSF 21.2. + (defconst ignored-local-variables (list 'enable-local-eval) "Variables to be ignored in a file's local variable spec.") @@ -1658,6 +2030,8 @@ (put 'load-path 'risky-local-variable t) (put 'exec-directory 'risky-local-variable t) (put 'process-environment 'risky-local-variable t) +(put 'dabbrev-case-fold-search 'risky-local-variable t) +(put 'dabbrev-case-replace 'risky-local-variable t) ;; Don't wait for outline.el to be loaded, for the sake of outline-minor-mode. (put 'outline-level 'risky-local-variable t) (put 'rmail-output-file-alist 'risky-local-variable t) @@ -1665,53 +2039,59 @@ ;; This one is safe because the user gets to check it before it is used. (put 'compile-command 'safe-local-variable t) -;(defun hack-one-local-variable-quotep (exp) -; (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp)))) +(defun hack-one-local-variable-quotep (exp) + (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp)))) -;; "Set" one variable in a local variables spec. -;; A few variable names are treated specially. (defun hack-one-local-variable (var val) + "\"Set\" one variable in a local variables spec. +A few variable names are treated specially." (cond ((eq var 'mode) (funcall (intern (concat (downcase (symbol-name val)) "-mode")))) + ((eq var 'coding) + ;; We have already handled coding: tag in set-auto-coding. + nil) ((memq var ignored-local-variables) nil) ;; "Setting" eval means either eval it or do nothing. ;; Likewise for setting hook variables. ((or (get var 'risky-local-variable) (and - (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$" + (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$" (symbol-name var)) (not (get var 'safe-local-variable)))) -; ;; Permit evaling a put of a harmless property -; ;; if the args do nothing tricky. -; (if (or (and (eq var 'eval) -; (consp val) -; (eq (car val) 'put) -; (hack-one-local-variable-quotep (nth 1 val)) -; (hack-one-local-variable-quotep (nth 2 val)) -; ;; Only allow safe values of lisp-indent-hook; -; ;; not functions. -; (or (numberp (nth 3 val)) -; (equal (nth 3 val) ''defun)) -; (memq (nth 1 (nth 2 val)) -; '(lisp-indent-hook))) - (if (and (not (zerop (user-uid))) - (or (eq enable-local-eval t) - (and enable-local-eval - (save-window-excursion - (switch-to-buffer (current-buffer)) - (save-excursion - (beginning-of-line) - (set-window-start (selected-window) (point))) - (setq enable-local-eval - (y-or-n-p (format "Process `eval' or hook local variables in file %s? " - (file-name-nondirectory buffer-file-name)))))))) + ;; Permit evalling a put of a harmless property. + ;; if the args do nothing tricky. + (if (or (and (eq var 'eval) + (consp val) + (eq (car val) 'put) + (hack-one-local-variable-quotep (nth 1 val)) + (hack-one-local-variable-quotep (nth 2 val)) + ;; Only allow safe values of lisp-indent-hook; + ;; not functions. + (or (numberp (nth 3 val)) + (equal (nth 3 val) ''defun)) + (memq (nth 1 (nth 2 val)) + '(lisp-indent-hook))) + ;; Permit eval if not root and user says ok. + (and (not (zerop (user-uid))) + (or (eq enable-local-eval t) + (and enable-local-eval + (save-window-excursion + (switch-to-buffer (current-buffer)) + (save-excursion + (beginning-of-line) + (set-window-start (selected-window) (point))) + (setq enable-local-eval + (y-or-n-p (format "Process `eval' or hook local variables in %s? " + (if buffer-file-name + (concat "file " (file-name-nondirectory buffer-file-name)) + (concat "buffer " (buffer-name))))))))))) (if (eq var 'eval) (save-excursion (eval val)) (make-local-variable var) (set var val)) - (message "Ignoring `eval:' in file's local variables"))) + (message "Ignoring `eval:' in the local variables list"))) ;; Ordinary variable, really set it. (t (make-local-variable var) (set var val)))) @@ -1762,6 +2142,7 @@ ))) )))) + (defcustom change-major-mode-with-file-name t "*Non-nil means \\[write-file] should set the major mode from the file name. However, the mode will not be changed if @@ -1882,17 +2263,23 @@ (hack-local-variables t) (set-auto-mode t)) (error nil)) - ;; #### ?? + ;; #### ?? not in FSF. (run-hooks 'after-set-visited-file-name-hooks)) (defun write-file (filename &optional confirm codesys) "Write current buffer into file FILENAME. -Makes buffer visit that file, and marks it not modified. If the buffer is -already visiting a file, you can specify a directory name as FILENAME, to -write a file of the same old name in that directory. +This makes the buffer visit that file, and marks it as not modified. -If optional second arg CONFIRM is non-nil, ask for confirmation for -overwriting an existing file. +If you specify just a directory name as FILENAME, that means to use +the default file name but in that directory. You can also yank +the default file name into the minibuffer to edit it, using M-n. + +If the buffer is not already visiting a file, the default file name +for the output file is the buffer name. + +If optional second arg CONFIRM is non-nil, this function +asks for confirmation before overwriting an existing file. +Interactively, this is always the case. Optional third argument specifies the coding system to use when encoding the file. Interactively, with a prefix argument, you will be prompted for @@ -1902,10 +2289,11 @@ (list (if buffer-file-name (read-file-name "Write file: " nil nil nil nil) - (read-file-name "Write file: " - (cdr (assq 'default-directory - (buffer-local-variables))) - nil nil (buffer-name))) + (read-file-name "Write file: " default-directory + (expand-file-name + (file-name-nondirectory (buffer-name)) + default-directory) + nil nil)) t (if current-prefix-arg (read-coding-system "Coding system: ")))) (and (eq (current-buffer) mouse-grabbed-buffer) @@ -1913,28 +2301,37 @@ (or (null filename) (string-equal filename "") (progn ;; If arg is just a directory, - ;; use same file name, but in that directory. - (if (and (file-directory-p filename) buffer-file-name) + ;; use the default file name, but in that directory. + (if (file-directory-p filename) (setq filename (concat (file-name-as-directory filename) - (file-name-nondirectory buffer-file-name)))) + (file-name-nondirectory + (or buffer-file-name (buffer-name)))))) (and confirm (file-exists-p filename) (or (y-or-n-p (format "File `%s' exists; overwrite? " filename)) (error "Canceled"))) - (set-visited-file-name filename))) + (set-visited-file-name filename (not confirm)))) (set-buffer-modified-p t) - (setq buffer-read-only nil) + ;; Make buffer writable if file is writable. + (and buffer-file-name + (file-writable-p buffer-file-name) + (setq buffer-read-only nil)) (if codesys (let ((buffer-file-coding-system (get-coding-system codesys))) (save-buffer)) (save-buffer))) + (defun backup-buffer () "Make a backup of the disk file visited by the current buffer, if appropriate. This is normally done before saving the buffer the first time. -If the value is non-nil, it is the result of `file-modes' on the original file; -this means that the caller, after saving the buffer, should change the modes -of the new file to agree with the old modes." +If the value is non-nil, it is the result of `file-modes' on the original +file; this means that the caller, after saving the buffer, should change +the modes of the new file to agree with the old modes. + +A backup may be done by renaming or by copying; see documentation of +variable `make-backup-files'. If it's done by renaming, then the file is +no longer accessible under its old name." (if buffer-file-name (let ((handler (find-file-name-handler buffer-file-name 'backup-buffer))) (if handler @@ -1974,10 +2371,15 @@ backup-by-copying (and backup-by-copying-when-linked (> (file-nlinks real-file-name) 1)) - (and backup-by-copying-when-mismatch + (and (or backup-by-copying-when-mismatch + (integerp backup-by-copying-when-privileged-mismatch)) (let ((attr (file-attributes real-file-name))) - (or (nth 9 attr) - (not (file-ownership-preserved-p real-file-name)))))) + (and (or backup-by-copying-when-mismatch + (and (integerp (nth 2 attr)) + (integerp backup-by-copying-when-privileged-mismatch) + (<= (nth 2 attr) backup-by-copying-when-privileged-mismatch))) + (or (nth 9 attr) + (not (file-ownership-preserved-p real-file-name))))))) (condition-case () (copy-file real-file-name backupname t t) (file-error @@ -1995,7 +2397,8 @@ (setq backupname (expand-file-name (convert-standard-filename "~/%backup%~"))) - (lwarn 'file 'alert "Cannot write backup file; backing up in ~/%%backup%%~") + (lwarn 'file 'alert "Cannot write backup file; backing up in %s" + (file-name-nondirectory backupname)) (sleep-for 1) (condition-case () (copy-file real-file-name backupname t t) @@ -2077,11 +2480,113 @@ (if period ""))))) +(defcustom make-backup-file-name-function nil + "A function to use instead of the default `make-backup-file-name'. +A value of nil gives the default `make-backup-file-name' behaviour. + +This could be buffer-local to do something special for specific +files. If you define it, you may need to change `backup-file-name-p' +and `file-name-sans-versions' too. + +See also `backup-directory-alist'." + :group 'backup + :type '(choice (const :tag "Default" nil) + (function :tag "Your function"))) + +(defcustom backup-directory-alist nil + "Alist of filename patterns and backup directory names. +Each element looks like (REGEXP . DIRECTORY). Backups of files with +names matching REGEXP will be made in DIRECTORY. DIRECTORY may be +relative or absolute. If it is absolute, so that all matching files +are backed up into the same directory, the file names in this +directory will be the full name of the file backed up with all +directory separators changed to `!' to prevent clashes. This will not +work correctly if your filesystem truncates the resulting name. + +For the common case of all backups going into one directory, the alist +should contain a single element pairing \".\" with the appropriate +directory name. + +If this variable is nil, or it fails to match a filename, the backup +is made in the original file's directory. + +On MS-DOS filesystems without long names this variable is always +ignored." + :group 'backup + :type '(repeat (cons (regexp :tag "Regexp matching filename") + (directory :tag "Backup directory name")))) + (defun make-backup-file-name (file) "Create the non-numeric backup file name for FILE. -This is a separate function so you can redefine it for customization." - ;; FSF has code here for MS-DOS short filenames, not supported in XEmacs. - (concat file "~")) +Normally this will just be the file's name with `~' appended. +Customization hooks are provided as follows. + +If the variable `make-backup-file-name-function' is non-nil, its value +should be a function which will be called with FILE as its argument; +the resulting name is used. + +Otherwise a match for FILE is sought in `backup-directory-alist'; see +the documentation of that variable. If the directory for the backup +doesn't exist, it is created." + (if make-backup-file-name-function + (funcall make-backup-file-name-function file) +; (if (and (eq system-type 'ms-dos) +; (not (msdos-long-file-names))) +; (let ((fn (file-name-nondirectory file))) +; (concat (file-name-directory file) +; (or (and (string-match "\\`[^.]+\\'" fn) +; (concat (match-string 0 fn) ".~")) +; (and (string-match "\\`[^.]+\\.\\(..?\\)?" fn) +; (concat (match-string 0 fn) "~"))))) + (concat (make-backup-file-name-1 file) "~"))) + +(defun make-backup-file-name-1 (file) + "Subroutine of `make-backup-file-name' and `find-backup-file-name'." + (let ((alist backup-directory-alist) + elt backup-directory dir-sep-string) + (while alist + (setq elt (pop alist)) + (if (string-match (car elt) file) + (setq backup-directory (cdr elt) + alist nil))) + (if (null backup-directory) + file + (unless (file-exists-p backup-directory) + (condition-case nil + (make-directory backup-directory 'parents) + (file-error file))) + (if (file-name-absolute-p backup-directory) + (progn + (when (memq system-type '(windows-nt ms-dos)) + ;; Normalize DOSish file names: convert all slashes to + ;; directory-sep-char, downcase the drive letter, if any, + ;; and replace the leading "x:" with "/drive_x". + (or (file-name-absolute-p file) + (setq file (expand-file-name file))) ; make defaults explicit + ;; Replace any invalid file-name characters (for the + ;; case of backing up remote files). + (setq file (expand-file-name (convert-standard-filename file))) + (setq dir-sep-string (char-to-string directory-sep-char)) + (if (eq (aref file 1) ?:) + (setq file (concat dir-sep-string + "drive_" + (char-to-string (downcase (aref file 0))) + (if (eq (aref file 2) directory-sep-char) + "" + dir-sep-string) + (substring file 2))))) + ;; Make the name unique by substituting directory + ;; separators. It may not really be worth bothering about + ;; doubling `!'s in the original name... + (expand-file-name + (subst-char-in-string + directory-sep-char ?! + (replace-regexp-in-string "!" "!!" file)) + backup-directory)) + (expand-file-name (file-name-nondirectory file) + (file-name-as-directory + (expand-file-name backup-directory + (file-name-directory file)))))))) (defun backup-file-name-p (file) "Return non-nil if FILE is a backup file name (numeric or not). @@ -2089,64 +2594,72 @@ You may need to redefine `file-name-sans-versions' as well." (string-match "~\\'" file)) +(defvar backup-extract-version-start) + ;; This is used in various files. -;; The usage of bv-length is not very clean, -;; but I can't see a good alternative, -;; so as of now I am leaving it alone. +;; The usage of backup-extract-version-start is not very clean, +;; but I can't see a good alternative, so as of now I am leaving it alone. (defun backup-extract-version (fn) - "Given the name of a numeric backup file, return the backup number. -Uses the free variable `bv-length', whose value should be + "Given the name of a numeric backup file, FN, return the backup number. +Uses the free variable `backup-extract-version-start', whose value should be the index in the name where the version number begins." - (declare (special bv-length)) - (if (and (string-match "[0-9]+~\\'" fn bv-length) - (= (match-beginning 0) bv-length)) - (string-to-int (substring fn bv-length -1)) + (if (and (string-match "[0-9]+~$" fn backup-extract-version-start) + (= (match-beginning 0) backup-extract-version-start)) + (string-to-int (substring fn backup-extract-version-start -1)) 0)) +;; [[ FSF 21.2 says: +;; I believe there is no need to alter this behavior for VMS; +;; since backup files are not made on VMS, it should not get called. ]] (defun find-backup-file-name (fn) - "Find a file name for a backup file, and suggestions for deletions. + "Find a file name for a backup file FN, and suggestions for deletions. Value is a list whose car is the name for the backup file - and whose cdr is a list of old versions to consider deleting now. -If the value is nil, don't make a backup." - (declare (special bv-length)) +and whose cdr is a list of old versions to consider deleting now. +If the value is nil, don't make a backup. +Uses `backup-directory-alist' in the same way as does +`make-backup-file-name'." (let ((handler (find-file-name-handler fn 'find-backup-file-name))) ;; Run a handler for this function so that ange-ftp can refuse to do it. (if handler (funcall handler 'find-backup-file-name fn) - (if (eq version-control 'never) + (if (or (eq version-control 'never) + ;; We don't support numbered backups on plain MS-DOS + ;; when long file names are unavailable. +; (and (eq system-type 'ms-dos) +; (not (msdos-long-file-names))) + ) (list (make-backup-file-name fn)) - (let* ((base-versions (concat (file-name-nondirectory fn) ".~")) - ;; used by backup-extract-version: - (bv-length (length base-versions)) - possibilities - (versions nil) + (let* ((basic-name (make-backup-file-name-1 fn)) + (base-versions (concat (file-name-nondirectory basic-name) + ".~")) + (backup-extract-version-start (length base-versions)) (high-water-mark 0) - (deserve-versions-p nil) - (number-to-delete 0)) + (number-to-delete 0) + possibilities deserve-versions-p versions) (condition-case () (setq possibilities (file-name-all-completions base-versions - (file-name-directory fn)) - versions (sort (mapcar - #'backup-extract-version - possibilities) - '<) - high-water-mark (apply #'max 0 versions) + (file-name-directory basic-name)) + versions (sort (mapcar #'backup-extract-version + possibilities) + #'<) + high-water-mark (apply 'max 0 versions) deserve-versions-p (or version-control (> high-water-mark 0)) number-to-delete (- (length versions) - kept-old-versions kept-new-versions -1)) - (file-error - (setq possibilities nil))) + kept-old-versions + kept-new-versions + -1)) + (file-error (setq possibilities nil))) (if (not deserve-versions-p) (list (make-backup-file-name fn)) - (cons (concat fn ".~" (int-to-string (1+ high-water-mark)) "~") + (cons (format "%s.~%d~" basic-name (1+ high-water-mark)) (if (and (> number-to-delete 0) ;; Delete nothing if there is overflow ;; in the number of versions to keep. (>= (+ kept-new-versions kept-old-versions -1) 0)) - (mapcar #'(lambda (n) - (concat fn ".~" (int-to-string n) "~")) + (mapcar (lambda (n) + (format "%s.~%d~" basic-name n)) (let ((v (nthcdr kept-old-versions versions))) (rplacd (nthcdr (1- number-to-delete) v) ()) v)))))))))) @@ -2156,7 +2669,7 @@ (car (cdr (file-attributes filename)))) (defun file-relative-name (filename &optional directory) - "Convert FILENAME to be relative to DIRECTORY (default: default-directory). + "Convert FILENAME to be relative to DIRECTORY (default: `default-directory'). This function returns a relative file name which is equivalent to FILENAME when used with that default directory as the default. If this is impossible (which can happen on MS Windows when the file name @@ -2195,14 +2708,17 @@ (defun save-buffer (&optional args) "Save current buffer in visited file if modified. Versions described below. - By default, makes the previous version into a backup file if previously requested or if this is the first save. -With 1 or 3 \\[universal-argument]'s, marks this version +With 1 \\[universal-argument], marks this version to become a backup when the next save is done. -With 2 or 3 \\[universal-argument]'s, +With 2 \\[universal-argument]'s, unconditionally makes the previous version into a backup file. -With argument of 0, never makes the previous version into a backup file. +With 3 \\[universal-argument]'s, marks this version + to become a backup when the next save is done, + and unconditionally makes the previous version into a backup file. + +With argument of 0, never make the previous version into a backup file. If a file's name is FOO, the names of its numbered backup versions are FOO.~i~ for various integers i. A non-numbered backup file is called FOO~. @@ -2211,28 +2727,34 @@ numeric versions of the file being backed up, or `version-control' is non-nil. We don't want excessive versions piling up, so there are variables - `kept-old-versions', which tells XEmacs how many oldest versions to keep, + `kept-old-versions', which tells Emacs how many oldest versions to keep, and `kept-new-versions', which tells how many newest versions to keep. Defaults are 2 old versions and 2 new. `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." + before trimming versions. Otherwise it does it silently. + +If `vc-make-backup-files' is nil, which is the default, + no backup files are made for files managed by version control. + (This is because the version control system itself records previous versions.) + +See the subroutine `basic-save-buffer' for more information." (interactive "_p") (let ((modp (buffer-modified-p)) (large (> (buffer-size) 50000)) (make-backup-files (or (and make-backup-files (not (eq args 0))) (memq args '(16 64))))) (and modp (memq args '(16 64)) (setq buffer-backed-up nil)) - (if (and modp large) (display-message - 'progress (format "Saving file %s..." - (buffer-file-name)))) + (if (and modp large (buffer-file-name)) + (display-message 'progress (format "Saving file %s..." + (buffer-file-name)))) (basic-save-buffer) (and modp (memq args '(4 64)) (setq buffer-backed-up nil)))) (defun delete-auto-save-file-if-necessary (&optional force) "Delete auto-save file for current buffer if `delete-auto-save-files' is t. -Normally delete only if the file was written by this XEmacs -since the last real save, but optional arg FORCE non-nil means delete anyway." +Normally delete only if the file was written by this XEmacs since +the last real save, but optional arg FORCE non-nil means delete anyway." (and buffer-auto-save-file-name delete-auto-save-files (not (string= buffer-file-name buffer-auto-save-file-name)) (or force (recent-auto-save-p)) @@ -2256,12 +2778,26 @@ (if (not region-written) (write-region (point-min) (point-max) realname nil t truename)))) +; (defvar auto-save-hook nil +; "Normal hook run just before auto-saving.") + (put 'after-save-hook 'permanent-local t) (defvar after-save-hook nil "Normal hook that is run after a buffer is saved to its file. These hooks are considered to pertain to the visited file. So this list is cleared if you change the visited file name.") +(defvar save-buffer-coding-system nil + "If non-nil, use this coding system for saving the buffer. +More precisely, use this coding system in place of the +value of `buffer-file-coding-system', when saving the buffer. +Calling `write-region' for any purpose other than saving the buffer +will still use `buffer-file-coding-system'; this variable has no effect +in such cases.") + +(make-variable-buffer-local 'save-buffer-coding-system) +(put 'save-buffer-coding-system 'permanent-local t) + (defun files-fetch-hook-value (hook) (let ((localval (symbol-value hook)) (globalval (default-value hook))) @@ -2271,9 +2807,12 @@ (defun basic-save-buffer () "Save the current buffer in its visited file, if it has been modified. -After saving the buffer, run `after-save-hook'." +The hooks `write-contents-hooks', `local-write-file-hooks' and +`write-file-hooks' get a chance to do the job of saving; if they do not, +then the buffer is saved in the visited file file in the usual way. +After saving the buffer, this function runs `after-save-hook'." (interactive) - (save-excursion + (save-current-buffer ;; In an indirect buffer, save its base buffer instead. (if (buffer-base-buffer) (set-buffer (buffer-base-buffer))) @@ -2297,20 +2836,24 @@ (error "Save not confirmed")) (save-restriction (widen) + (save-excursion + (and (> (point-max) 1) + (not find-file-literally) + (not (eq (char-after (1- (point-max))) ?\n)) + (not (and (eq selective-display t) + (eq (char-after (1- (point-max))) ?\r))) + (or (eq require-final-newline t) + (and require-final-newline + (y-or-n-p + (format "Buffer %s does not end in newline. Add one? " + (buffer-name))))) + (save-excursion + (goto-char (point-max)) + (insert ?\n)))) - ;; Add final newline if required. See `require-final-newline'. - (when (and (not (eq (char-before (point-max)) ?\n)) ; common case - (char-before (point-max)) ; empty buffer? - (not (and (eq selective-display t) - (eq (char-before (point-max)) ?\r))) - (or (eq require-final-newline t) - (and require-final-newline - (y-or-n-p - (format "Buffer %s does not end in newline. Add one? " - (buffer-name)))))) - (save-excursion - (goto-char (point-max)) - (insert ?\n))) + ;; Support VC version backups. + (if-fboundp 'vc-before-save + (vc-before-save)) ;; Run the write-file-hooks until one returns non-nil. ;; Bind after-save-hook to nil while running the @@ -2338,7 +2881,8 @@ (if (not done) (basic-save-buffer-1))) ;; XEmacs: next two clauses (buffer-file-number setting and - ;; set-file-modes) moved into basic-save-buffer-1. + ;; set-file-modes) moved into basic-save-buffer-1 for use by + ;; continue-save-buffer. ) ;; If the auto-save file was recent before this command, ;; delete it now. @@ -2354,11 +2898,19 @@ ;; but inhibited if one of write-file-hooks returns non-nil. ;; It returns a value to store in setmodes. (defun basic-save-buffer-1 () + (if save-buffer-coding-system + (let ((coding-system-for-write save-buffer-coding-system)) + (basic-save-buffer-2)) + (basic-save-buffer-2))) + +(defun basic-save-buffer-2 () (let (setmodes tempsetmodes) (if (not (file-writable-p buffer-file-name)) (let ((dir (file-name-directory buffer-file-name))) (if (not (file-directory-p dir)) - (error "%s is not a directory" dir) + (if (file-exists-p dir) + (error "%s is not a directory" dir) + (error "%s: no such directory" buffer-file-name)) (if (not (file-exists-p buffer-file-name)) (error "Directory %s write-protected" dir) (if (yes-or-no-p @@ -2396,7 +2948,8 @@ ;; delete the temp file. (or succeed (progn - (delete-file tempname) + (ignore-file-errors + (delete-file tempname)) (set-visited-file-modtime old-modtime)))) ;; Since we have created an entirely new file ;; and renamed it, make sure it gets the @@ -2412,8 +2965,15 @@ (cond ((and tempsetmodes (not setmodes)) ;; Change the mode back, after writing. (setq setmodes (file-modes buffer-file-name)) - (set-file-modes buffer-file-name 511))) + (set-file-modes buffer-file-name (logior setmodes 128)))) (basic-write-file-data buffer-file-name buffer-file-truename))) + ;; #### FSF 21.2. We don't have last-coding-system-used. +; ;; Now we have saved the current buffer. Let's make sure +; ;; that buffer-file-coding-system is fixed to what +; ;; actually used for saving by binding it locally. +; (if save-buffer-coding-system +; (setq save-buffer-coding-system last-coding-system-used) +; (setq buffer-file-coding-system last-coding-system-used)) (setq buffer-file-number (if buffer-file-name (nth 10 (file-attributes buffer-file-name)) @@ -2454,11 +3014,14 @@ :type 'boolean :group 'editing-basics) -(defun save-some-buffers (&optional arg exiting) +(defun save-some-buffers (&optional arg pred) "Save some modified file-visiting buffers. Asks user about each one. Optional argument (the prefix) non-nil means save all with no questions. -Optional second argument EXITING means ask about certain non-file buffers - as well as about file buffers." +Optional second argument PRED determines which buffers are considered: +If PRED is nil, all the file-visiting buffers are considered. +If PRED is t, then certain non-file buffers will also be considered. +If PRED is a zero-argument function, it indicates for each buffer whether +to consider it or not when called with that buffer current." (interactive "P") (save-excursion ;; `delete-other-windows' can bomb during autoloads generation, so @@ -2468,15 +3031,15 @@ (not save-some-buffers-query-display-buffer)) ;; If playing with windows is unsafe or undesired, just do the ;; usual drill. - (save-some-buffers-1 arg exiting nil) + (save-some-buffers-1 arg pred nil) ;; Else, protect the windows. (when (save-window-excursion - (save-some-buffers-1 arg exiting t)) + (save-some-buffers-1 arg pred t)) ;; Force redisplay. (sit-for 0))))) ;; XEmacs - do not use queried flag -(defun save-some-buffers-1 (arg exiting switch-buffer) +(defun save-some-buffers-1 (arg pred switch-buffer) (let* ((switched nil) (last-buffer nil) (files-done @@ -2489,10 +3052,12 @@ (not (symbol-value-in-buffer 'save-buffers-skip buffer)) (or (buffer-file-name buffer) - (and exiting + (and pred (progn (set-buffer buffer) (and buffer-offer-save (> (buffer-size) 0))))) + (or (not (functionp pred)) + (with-current-buffer buffer (funcall pred))) (if arg t ;; #### We should provide a per-buffer means to @@ -2535,7 +3100,11 @@ (list (list ?\C-r (lambda (buf) ;; #### FSF has an EXIT-ACTION argument ;; to `view-buffer'. - (view-buffer buf) + (view-buffer buf +; (function +; (lambda (ignore) +; (exit-recursive-edit)))) + ) (with-boundp 'view-exit-action (setq view-exit-action (lambda (ignore) @@ -2548,6 +3117,7 @@ (and save-abbrevs abbrevs-changed (progn (if (or arg + (eq save-abbrevs 'silently) (y-or-n-p (format "Save abbrevs in %s? " abbrev-file-name))) (write-abbrev-file nil)) ;; Don't keep bothering user if he says no. @@ -2558,6 +3128,7 @@ switched)) + (defun not-modified (&optional arg) "Mark current buffer as unmodified, not needing to be saved. With prefix arg, mark buffer as modified, so \\[save-buffer] will save. @@ -2571,15 +3142,26 @@ (set-buffer-modified-p arg)) (defun toggle-read-only (&optional arg) - "Toggle the current buffer's read-only status. -With arg, set read-only iff arg is positive." - (interactive "_P") - (setq buffer-read-only - (if (null arg) - (not buffer-read-only) - (> (prefix-numeric-value arg) 0))) - ;; Force modeline redisplay - (redraw-modeline)) + "Change whether this buffer is visiting its file read-only. +With arg, set read-only iff arg is positive. +If visiting file read-only and `view-read-only' is non-nil, enter view mode." + (interactive "P") + (cond + ((and arg (if (> (prefix-numeric-value arg) 0) buffer-read-only + (not buffer-read-only))) ; If buffer-read-only is set correctly, + nil) ; do nothing. + ;; Toggle. + ((and buffer-read-only view-minor-mode) + ;(View-exit-and-edit) + (view-mode) + (make-local-variable 'view-read-only) + (setq view-read-only t)) ; Must leave view mode. + ((and (not buffer-read-only) view-read-only + (not (eq (get major-mode 'mode-class) 'special))) + ;(view-mode-enter) + (view-mode)) + (t (setq buffer-read-only (not buffer-read-only)) + (force-mode-line-update)))) (defun insert-file (filename &optional codesys) "Insert contents of file FILENAME into buffer after point. @@ -2619,17 +3201,24 @@ (defun file-newest-backup (filename) "Return most recent backup file for FILENAME or nil if no backups exist." - (let* ((filename (expand-file-name filename)) + ;; `make-backup-file-name' will get us the right directory for + ;; ordinary or numeric backups. It might create a directory for + ;; backups as a side-effect, according to `backup-directory-alist'. + (let* ((filename (file-name-sans-versions + (make-backup-file-name filename))) (file (file-name-nondirectory filename)) (dir (file-name-directory filename)) (comp (file-name-all-completions file dir)) - newest) + (newest nil) + tem) (while comp - (setq file (concat dir (car comp)) - comp (cdr comp)) - (if (and (backup-file-name-p file) - (or (null newest) (file-newer-than-file-p file newest))) - (setq newest file))) + (setq tem (pop comp)) + (cond ((and (backup-file-name-p tem) + (string= (file-name-sans-versions tem) file)) + (setq tem (concat dir tem)) + (if (or (null newest) + (file-newer-than-file-p tem newest)) + (setq newest tem))))) newest)) (defun rename-uniquely () @@ -2638,21 +3227,17 @@ or multiple mail buffers, etc." (interactive) (save-match-data - (let* ((base-name (if (and (string-match "<[0-9]+>\\'" (buffer-name)) - (not (and buffer-file-name - (string= (buffer-name) - (file-name-nondirectory - buffer-file-name))))) - ;; If the existing buffer name has a , - ;; which isn't part of the file name (if any), - ;; then get rid of that. - (substring (buffer-name) 0 (match-beginning 0)) - (buffer-name))) - (new-buf (generate-new-buffer base-name)) - (name (buffer-name new-buf))) - (kill-buffer new-buf) - (rename-buffer name) - (redraw-modeline)))) + (let ((base-name (buffer-name))) + (and (string-match "<[0-9]+>\\'" base-name) + (not (and buffer-file-name + (string= base-name + (file-name-nondirectory buffer-file-name)))) + ;; If the existing buffer name has a , + ;; which isn't part of the file name (if any), + ;; then get rid of that. + (setq base-name (substring base-name 0 (match-beginning 0)))) + (rename-buffer (generate-new-buffer-name base-name)) + (force-mode-line-update)))) (defun make-directory-path (path) "Create all the directories along path that don't exist yet." @@ -2696,7 +3281,9 @@ Gets two args, first the nominal file name to use, and second, t if reading the auto-save file. If the current buffer contents are to be discarded, the function must do -so itself.") +so itself. + +The function you specify is responsible for updating (or preserving) point.") (defvar before-revert-hook nil "Normal hook for `revert-buffer' to run before reverting. @@ -2715,6 +3302,8 @@ (defvar revert-buffer-internal-hook nil "Don't use this.") +;; END SYNC WITH FSF 21.2. + (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. @@ -2929,6 +3518,8 @@ newbuf (and (kill-buffer newbuf) nil)))) +;; BEGIN SYNC WITH FSF 21.2. + (defvar recover-file-diff-program "diff" "Absolute or relative name of the `diff' program used by `recover-file'.") (defvar recover-file-diff-arguments '("-c") @@ -2963,12 +3554,21 @@ (with-output-to-temp-buffer "*Directory*" (buffer-disable-undo standard-output) (save-excursion - (set-buffer "*Directory*") - (setq default-directory (file-name-directory file)) - (insert-directory file - (if (file-symlink-p file) "-lL" "-l")) - (setq default-directory (file-name-directory file-name)) - (insert-directory file-name "-l"))) + (let ((switches + (declare-boundp dired-listing-switches))) + (if (file-symlink-p file) + (setq switches (concat switches "L"))) + (set-buffer standard-output) + ;; XEmacs had the following line, not in FSF. + (setq default-directory (file-name-directory file)) + ;; Use insert-directory-safely, not insert-directory, + ;; because these files might not exist. In particular, + ;; FILE might not exist if the auto-save file was for + ;; a buffer that didn't visit a file, such as "*mail*". + ;; The code in v20.x called `ls' directly, so we need + ;; to emulate what `ls' did in that case. + (insert-directory-safely file switches) + (insert-directory-safely file-name switches)))) (block nil (while t (case (get-user-response @@ -2984,10 +3584,14 @@ (no (error "Recover-file cancelled.")) (yes (switch-to-buffer (find-file-noselect file t)) - (let ((buffer-read-only nil)) + (let ((buffer-read-only nil) + ;; Keep the current buffer-file-coding-system. + (coding-system buffer-file-coding-system) + ;; Auto-saved file shoule be read without any code conversion. + (coding-system-for-read 'escape-quoted)) (erase-buffer) - (let ((coding-system-for-read 'escape-quoted)) - (insert-file-contents file-name nil))) + (insert-file-contents file-name nil) + (set-buffer-file-coding-system coding-system)) (after-find-file nil nil t) (return nil)) (diff @@ -3031,16 +3635,27 @@ (list temp file-name))) (io-error (save-excursion - (set-buffer standard-output) - (setq default-directory - (file-name-directory file)) - (insert-directory - file - (if (file-symlink-p file) "-lL" - "-l")) - (setq default-directory - (file-name-directory file-name)) - (insert-directory file-name "-l") + (let ((switches + (declare-boundp + dired-listing-switches))) + (if (file-symlink-p file) + (setq switches (concat switches "L"))) + (set-buffer standard-output) + ;; XEmacs had the following line, not in FSF. + (setq default-directory (file-name-directory file)) + ;; Use insert-directory-safely, + ;; not insert-directory, because + ;; these files might not exist. + ;; In particular, FILE might not + ;; exist if the auto-save file + ;; was for a buffer that didn't + ;; visit a file, such as + ;; "*mail*". The code in v20.x + ;; called `ls' directly, so we + ;; need to emulate what `ls' did + ;; in that case. + (insert-directory-safely file switches) + (insert-directory-safely file-name switches)) (terpri) (princ "Error during diff: ") (display-error ferr @@ -3061,6 +3676,9 @@ (if (null auto-save-list-file-prefix) (error "You set `auto-save-list-file-prefix' to disable making session files")) + (let ((dir (file-name-directory auto-save-list-file-prefix))) + (unless (file-directory-p dir) + (make-directory dir t))) (let* ((auto-save-list-dir (file-name-directory auto-save-list-file-prefix)) (files (directory-files @@ -3073,14 +3691,15 @@ (unless files (error "No sessions can be recovered now")) (declare-fboundp (dired (cons auto-save-list-dir files))) - (goto-char (point-min)) - (or (looking-at "Move to the session you want to recover,") - (let ((inhibit-read-only t)) - (delete-matching-lines "^[ \t]*total.*$") - (insert "Move to the session you want to recover,\n" - "then type C-c C-c to select it.\n\n" - "You can also delete some of these files;\n" - "type d on a line to mark that file for deletion.\n\n"))) + (save-excursion + (goto-char (point-min)) + (or (looking-at "Move to the session you want to recover,") + (let ((inhibit-read-only t)) + (delete-matching-lines "^[ \t]*total.*$") + (insert "Move to the session you want to recover,\n" + "then type C-c C-c to select it.\n\n" + "You can also delete some of these files;\n" + "type d on a line to mark that file for deletion.\n\n")))) (use-local-map (let ((map (make-sparse-keymap))) (set-keymap-parents map (list (current-local-map))) map)) @@ -3144,9 +3763,10 @@ (interactive) ;; Get the name of the session file to recover from. (let ((file (declare-fboundp (dired-get-filename)))) + (declare-fboundp (dired-unmark 1)) ;; #### dired-do-flagged-delete in FSF. ;; This version is for ange-ftp - ;;(dired-do-deletions t) + ;;(declare-fboundp (dired-do-deletions t)) ;; This version is for efs (declare-fboundp (dired-expunge-deletions)) (let ((files (Recover-session-files-from-auto-save-list-file file))) @@ -3176,7 +3796,7 @@ (let* ((buffer (car list)) (name (buffer-name buffer))) (and (not (string-equal name "")) - (/= (aref name 0) ?\ ) + (not (eq (aref name 0) ?\ )) (yes-or-no-p (format (if (buffer-modified-p buffer) @@ -3224,10 +3844,14 @@ (recent-auto-save-p)) (rename-file osave buffer-auto-save-file-name t)))) +;; END SYNC WITH FSF 21.2. + ;; make-auto-save-file-name and auto-save-file-name-p are now only in ;; auto-save.el. +;; BEGIN SYNC WITH FSF 21.2. + (defun wildcard-to-regexp (wildcard) "Given a shell file name pattern WILDCARD, return an equivalent regexp. The generated regexp will match a filename iff the filename @@ -3246,6 +3870,10 @@ result (concat result (cond + ((and (eq ch ?\[) + (< (1+ i) len) + (eq (aref wildcard (1+ i)) ?\])) + "\\[") ((eq ch ?\[) ; [...] maps to regexp char class (progn (setq i (1+ i)) @@ -3305,6 +3933,49 @@ :type 'string :group 'dired) +(defun file-expand-wildcards (pattern &optional full) + "Expand wildcard pattern PATTERN. +This returns a list of file names which match the pattern. + +If PATTERN is written as an absolute relative file name, +the values are absolute also. + +If PATTERN is written as a relative file name, it is interpreted +relative to the current default directory, `default-directory'. +The file names returned are normally also relative to the current +default directory. However, if FULL is non-nil, they are absolute." + (let* ((nondir (file-name-nondirectory pattern)) + (dirpart (file-name-directory pattern)) + ;; A list of all dirs that DIRPART specifies. + ;; This can be more than one dir + ;; if DIRPART contains wildcards. + (dirs (if (and dirpart (string-match "[[*?]" dirpart)) + (mapcar 'file-name-as-directory + (file-expand-wildcards (directory-file-name dirpart))) + (list dirpart))) + contents) + (while dirs + (when (or (null (car dirs)) ; Possible if DIRPART is not wild. + (file-directory-p (directory-file-name (car dirs)))) + (let ((this-dir-contents + ;; Filter out "." and ".." + (delq nil + (mapcar #'(lambda (name) + (unless (string-match "\\`\\.\\.?\\'" + (file-name-nondirectory name)) + name)) + (directory-files (or (car dirs) ".") full + (wildcard-to-regexp nondir)))))) + (setq contents + (nconc + (if (and (car dirs) (not full)) + (mapcar (function (lambda (name) (concat (car dirs) name))) + this-dir-contents) + this-dir-contents) + contents)))) + (setq dirs (cdr dirs))) + contents)) + (defun list-directory (dirname &optional verbose) "Display a list of files in or matching DIRNAME, a la `ls'. DIRNAME is globbed by the shell if necessary. @@ -3327,10 +3998,59 @@ (terpri) (save-excursion (set-buffer "*Directory*") - (setq default-directory (file-name-directory dirname)) + (setq default-directory + (if (file-directory-p dirname) + (file-name-as-directory dirname) + (file-name-directory dirname))) (let ((wildcard (not (file-directory-p dirname)))) (insert-directory dirname switches wildcard (not wildcard))))))) +(defun shell-quote-wildcard-pattern (pattern) + "Quote characters special to the shell in PATTERN, leave wildcards alone. + +PATTERN is assumed to represent a file-name wildcard suitable for the +underlying filesystem. For Unix and GNU/Linux, the characters from the +set [ \\t\\n;<>&|()#$] are quoted with a backslash; for DOS/Windows, all +the parts of the pattern which don't include wildcard characters are +quoted with double quotes. +Existing quote characters in PATTERN are left alone, so you can pass +PATTERN that already quotes some of the special characters." + (save-match-data + (cond + ((memq system-type '(ms-dos windows-nt)) + ;; DOS/Windows don't allow `"' in file names. So if the + ;; argument has quotes, we can safely assume it is already + ;; quoted by the caller. + (if (or (string-match "[\"]" pattern) + ;; We quote [&()#$'] in case their shell is a port of a + ;; Unixy shell. We quote [,=+] because stock DOS and + ;; Windows shells require that in some cases, such as + ;; passing arguments to batch files that use positional + ;; arguments like %1. + (not (string-match "[ \t;&()#$',=+]" pattern))) + pattern + (let ((result "\"") + (beg 0) + end) + (while (string-match "[*?]+" pattern beg) + (setq end (match-beginning 0) + result (concat result (substring pattern beg end) + "\"" + (substring pattern end (match-end 0)) + "\"") + beg (match-end 0))) + (concat result (substring pattern beg) "\"")))) + (t + (let ((beg 0)) + (while (string-match "[ \t\n;<>&|()#$]" pattern beg) + (setq pattern + (concat (substring pattern 0 (match-beginning 0)) + "\\" + (substring pattern (match-beginning 0))) + beg (1+ (match-end 0))))) + pattern)))) + + (defvar insert-directory-program "ls" "Absolute or relative name of the `ls' program used by `insert-directory'.") @@ -3352,6 +4072,9 @@ ;; dired-insert-headerline ;; dired-after-subdir-garbage (defines what a "total" line is) ;; - variable dired-subdir-regexp + +;; END SYNC WITH FSF 21.2. + (defun insert-directory (file switches &optional wildcard full-directory-p) "Insert directory listing for FILE, formatted according to SWITCHES. Leaves point after the inserted text. @@ -3431,6 +4154,19 @@ ".") file))))))))))) +;; BEGIN SYNC WITH FSF 21.2. + +(defun insert-directory-safely (file switches + &optional wildcard full-directory-p) + "Insert directory listing for FILE, formatted according to SWITCHES. + +Like `insert-directory', but if FILE does not exist, it inserts a +message to that effect instead of signaling an error." + (if (file-exists-p file) + (insert-directory file switches wildcard full-directory-p) + ;; Simulate the message printed by `ls'. + (insert (format "%s: No such file or directory\n" file)))) + (defvar kill-emacs-query-functions nil "Functions to call with no arguments to query about killing XEmacs. If any of these functions returns nil, killing Emacs is cancelled. @@ -3438,6 +4174,17 @@ but `kill-emacs', the low level primitive, does not. See also `kill-emacs-hook'.") +(defcustom confirm-kill-emacs nil + "How to ask for confirmation when leaving Emacs. +If nil, the default, don't ask at all. If the value is non-nil, it should +be a predicate function such as `yes-or-no-p'." + :type '(choice (const :tag "Ask with yes-or-no-p" yes-or-no-p) + (const :tag "Ask with y-or-n-p" y-or-n-p) + (const :tag "Don't confirm" nil)) + :group 'emacs + ;:version "21.1" + ) + (defun save-buffers-kill-emacs (&optional arg) "Offer to save each buffer, then kill this XEmacs process. With prefix arg, silently save all file-visiting buffers, then kill." @@ -3468,6 +4215,8 @@ "Active processes exist; kill them and exit anyway? ")))))) ;; Query the user for other things, perhaps. (run-hook-with-args-until-failure 'kill-emacs-query-functions) + (or (null confirm-kill-emacs) + (funcall confirm-kill-emacs "Really exit Emacs? ")) (kill-emacs))) (defun symlink-expand-file-name (filename) @@ -3493,6 +4242,67 @@ (declare-fboundp (efs-ftp-path file-name))) (t nil))) -;; #### FSF has file-name-non-special here. + +;; We use /: as a prefix to "quote" a file name +;; so that magic file name handlers will not apply to it. + +(setq file-name-handler-alist + (cons '("\\`/:" . file-name-non-special) + file-name-handler-alist)) + +;; We depend on being the last handler on the list, +;; so that anything else which does need handling +;; has been handled already. +;; So it is safe for us to inhibit *all* magic file name handlers. + +(defun file-name-non-special (operation &rest arguments) + (let ((file-name-handler-alist nil) + (default-directory + (if (eq operation 'insert-directory) + (directory-file-name + (expand-file-name + (unhandled-file-name-directory default-directory))) + default-directory)) + ;; Get a list of the indices of the args which are file names. + (file-arg-indices + (cdr (or (assq operation + ;; The first four are special because they + ;; return a file name. We want to include the /: + ;; in the return value. + ;; So just avoid stripping it in the first place. + '((expand-file-name . nil) + ;; `identity' means just return the first arg + ;; as stripped of its quoting. + (substitute-in-file-name . identity) + (file-name-directory . nil) + (file-name-as-directory . nil) + (directory-file-name . nil) + (file-name-completion 0 1) + (file-name-all-completions 0 1) + (rename-file 0 1) + (copy-file 0 1) + (make-symbolic-link 0 1) + (add-name-to-file 0 1))) + ;; For all other operations, treat the first argument only + ;; as the file name. + '(nil 0)))) + ;; Copy ARGUMENTS so we can replace elements in it. + (arguments (copy-sequence arguments))) + ;; Strip off the /: from the file names that have this handler. + (save-match-data + (while (consp file-arg-indices) + (let ((pair (nthcdr (car file-arg-indices) arguments))) + (and (car pair) + (string-match "\\`/:" (car pair)) + (setcar pair + (if (= (length (car pair)) 2) + "/" + (substring (car pair) 2))))) + (setq file-arg-indices (cdr file-arg-indices)))) + (if (eq file-arg-indices 'identity) + (car arguments) + (apply operation arguments)))) + +;; END SYNC WITH FSF 21.2. ;;; files.el ends here Index: lisp/find-paths.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/find-paths.el,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- lisp/find-paths.el 22 Jan 2003 20:31:52 -0000 1.25 +++ lisp/find-paths.el 1 Mar 2003 07:25:27 -0000 1.26 @@ -3,6 +3,7 @@ ;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc. ;; Copyright (c) 1993, 1994 Sun Microsystems, Inc. ;; Copyright (C) 1995 Board of Trustees, University of Illinois +;; Copyright (C) 2003 Ben Wing. ;; Author: Mike Sperber ;; Maintainer: XEmacs Development Team @@ -99,35 +100,6 @@ (paths-find-recursive-path directories max-depth paths-no-lisp-directory-regexp)) -(defun paths-emacs-root-p (directory) - "Check if DIRECTORY is a plausible installation root." - (or - ;; installed - (paths-file-readable-directory-p (paths-construct-path (list directory - "lib" - (construct-emacs-version-name)))) - ;; in-place or windows-nt - (and - (paths-file-readable-directory-p (paths-construct-path (list directory "lisp"))) - (paths-file-readable-directory-p (paths-construct-path (list directory "etc")))))) - -(defun paths-emacs-data-root-p (directory) - "Check if DIRECTORY is a plausible data installation root. -A data installation root is one containing data files that may be shared -among multiple different versions of XEmacs, the packages in particular." - (or - ;; installed - (paths-file-readable-directory-p (paths-construct-path (list directory - "lib" - emacs-program-name))) - (paths-file-readable-directory-p (paths-construct-path (list directory - "lib" - (construct-emacs-version-name)))) - ;; in-place or windows-nt - (and - (paths-file-readable-directory-p (paths-construct-path (list directory "lisp"))) - (paths-file-readable-directory-p (paths-construct-path (list directory "etc")))))) - (defun paths-chase-symlink (file-name) "Chase a symlink until the bitter end." (let ((maybe-symlink (file-symlink-p file-name))) @@ -137,22 +109,6 @@ (paths-chase-symlink destination)) file-name))) -(defun paths-find-emacs-root - (invocation-directory invocation-name) - "Find the run-time root of XEmacs." - (let* ((executable-file-name (paths-chase-symlink - (concat invocation-directory - invocation-name))) - (executable-directory (file-name-directory executable-file-name)) - (maybe-root-1 (file-name-as-directory - (paths-construct-path '("..") executable-directory))) - (maybe-root-2 (file-name-as-directory - (paths-construct-path '(".." "..") executable-directory)))) - (or (and (paths-emacs-root-p maybe-root-1) - maybe-root-1) - (and (paths-emacs-root-p maybe-root-2) - maybe-root-2)))) - (defun paths-construct-path (components &optional expand-directory) "Convert list of path components COMPONENTS into a path. If EXPAND-DIRECTORY is non-NIL, use it as a directory to feed @@ -297,31 +253,5 @@ (null (string-equal "" component))) directories) directories))) - -(defun paths-find-emacs-roots (invocation-directory - invocation-name - root-p) - "Find all plausible installation roots for XEmacs. -INVOCATION-DIRECTORY is the directory from which XEmacs was started. -INVOCATION-NAME is the name of the XEmacs executable that was originally -started. -ROOT-P is a function that tests whether a root is plausible." - (let* ((potential-invocation-root - (paths-find-emacs-root invocation-directory invocation-name)) - (invocation-roots - (and potential-invocation-root - (list potential-invocation-root))) - (potential-installation-roots - (paths-uniq-append - (and configure-exec-prefix-directory - (list (file-name-as-directory - configure-exec-prefix-directory))) - (and configure-prefix-directory - (list (file-name-as-directory - configure-prefix-directory))))) - (installation-roots - (paths-filter root-p potential-installation-roots))) - (paths-uniq-append invocation-roots - installation-roots))) ;;; find-paths.el ends here Index: lisp/finder.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/finder.el,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- lisp/finder.el 29 Mar 2002 04:46:29 -0000 1.6 +++ lisp/finder.el 20 Feb 2003 08:19:29 -0000 1.7 @@ -153,7 +153,7 @@ arguments compiles from `load-path'." (save-excursion ;; XEmacs change - (find-file "finder-inf.el") + (find-file (expand-file-name "finder-inf.el" lisp-directory)) (let ((processed nil) (directory-abbrev-alist (append Index: lisp/font-lock.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font-lock.el,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- lisp/font-lock.el 3 Oct 2002 14:40:29 -0000 1.25 +++ lisp/font-lock.el 24 Apr 2003 05:29:12 -0000 1.26 @@ -2719,32 +2719,34 @@ ;; the cursor to fontify more identifiers. (defun font-lock-match-java-declarations (limit) "Match and skip over variable definitions." - (if (looking-at "\\s *\\(\\[\\s *\\]\\s *\\)*") - (goto-char (match-end 0))) - (and - (looking-at java-font-lock-identifier-regexp) - (save-match-data - (not (string-match java-font-lock-type-regexp - (buffer-substring (match-beginning 1) - (match-end 1))))) - (save-match-data - (save-excursion - (goto-char (match-beginning 1)) - (not (looking-at - (concat java-font-lock-class-name-regexp - "\\s *\\(\\[\\s *\\]\\s *\\)*\\<"))))) - (save-match-data - (condition-case nil - (save-restriction - (narrow-to-region (point-min) limit) - (goto-char (match-end 0)) - ;; Note: Both `scan-sexps' and the second goto-char can - ;; generate an error which is caught by the - ;; `condition-case' expression. - (while (not (looking-at "\\s *\\(\\(,\\)\\|;\\|$\\)")) - (goto-char (or (scan-sexps (point) 1) (point-max)))) - (goto-char (match-end 2))) ; non-nil - (error t))))) + (save-restriction + (narrow-to-region (point-min) limit) + + (if (looking-at "\\s *\\(\\[\\s *\\]\\s *\\)*") + (goto-char (match-end 0))) + (and + (looking-at java-font-lock-identifier-regexp) + (save-match-data + (not (string-match java-font-lock-type-regexp + (buffer-substring (match-beginning 1) + (match-end 1))))) + (save-match-data + (save-excursion + (goto-char (match-beginning 1)) + (not (looking-at + (concat java-font-lock-class-name-regexp + "\\s *\\(\\[\\s *\\]\\s *\\)*\\<"))))) + (save-match-data + (condition-case nil + (progn + (goto-char (match-end 0)) + ;; Note: Both `scan-sexps' and the second goto-char can + ;; generate an error which is caught by the + ;; `condition-case' expression. + (while (not (looking-at "\\s *\\(\\(,\\)\\|;\\|$\\)")) + (goto-char (or (scan-sexps (point) 1) (point-max)))) + (goto-char (match-end 2))) ; non-nil + (error t)))))) (defvar tex-font-lock-keywords Index: lisp/font.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font.el,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- lisp/font.el 20 Jun 2002 21:18:03 -0000 1.14 +++ lisp/font.el 9 Mar 2003 02:27:33 -0000 1.15 @@ -42,7 +42,8 @@ (globally-declare-boundp '(global-face-data - x-font-regexp x-font-regexp-foundry-and-family)) + x-font-regexp x-font-regexp-foundry-and-family + mswindows-font-regexp)) (require 'cl) Index: lisp/gutter-items.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/gutter-items.el,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- lisp/gutter-items.el 24 Jul 2002 04:46:29 -0000 1.7 +++ lisp/gutter-items.el 18 Mar 2003 06:58:20 -0000 1.8 @@ -110,12 +110,16 @@ "Set `buffers-tab-filter-functions' instead.") (defcustom buffers-tab-filter-functions (list 'select-buffers-tab-buffers-by-mode) - "*If non-nil, a list of functions specifying the buffers to include -in the buffers tab, depending on the context. -Each function in the list is passed two buffers, the buffer to -potentially select and the context buffer, and should return non-nil -if the first buffer should be selected. The default value groups -buffers by major mode and by `buffers-tab-grouping-regexp'." + "*A list of functions specifying buffers to display in the buffers tab. + +If nil, all buffers are kept, up to `buffers-tab-max-size', in usual order. +Otherwise, each function in the list must take arguments (BUF1 BUF2). +BUF1 is the candidate, and BUF2 is the current buffer (first in the buffers +list). The function should return non-nil if BUF1 should be added to the +buffers tab. BUF1 will be omitted if any of the functions returns nil. + +Defaults to `select-buffers-tab-buffers-by-mode', which adds BUF1 if BUF1 and +BUF2 have the same major mode, or both match `buffers-tab-grouping-regexp'." :type '(repeat function) :group 'buffers-tab) Index: lisp/info.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/info.el,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- lisp/info.el 23 Jan 2003 11:39:01 -0000 1.31 +++ lisp/info.el 23 Apr 2003 15:42:49 -0000 1.32 @@ -574,6 +574,9 @@ Optional argument FILE specifies the file to examine; the default is the top-level directory of Info. +Called from a program, FILE may specify an Info node of the form +`(FILENAME)NODENAME'. + In interactive use, a prefix argument directs this command to read a file name from the minibuffer." (interactive (if current-prefix-arg @@ -592,7 +595,15 @@ ; (Info-setup-x) ??? What was this going to be? Can anyone tell karlheg? (if file (unwind-protect - (Info-goto-node (concat "(" file ")")) + (progn + (pop-to-buffer "*info*") + ;; If argument already contains parentheses, don't add another set + ;; since the argument will then be parsed improperly. This also + ;; has the added benefit of allowing node names to be included + ;; following the parenthesized filename. + (if (and (stringp file) (string-match "(.*)" file)) + (Info-goto-node file) + (Info-goto-node (concat "(" file ")")))) (and Info-standalone (info))) (if (get-buffer "*info*") (switch-to-buffer "*info*") Index: lisp/keydefs.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/keydefs.el,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- lisp/keydefs.el 7 Oct 2002 10:27:18 -0000 1.16 +++ lisp/keydefs.el 2 Mar 2003 09:38:39 -0000 1.17 @@ -122,6 +122,7 @@ (define-key global-map "\C-x\C-d" 'list-directory) (define-key global-map "\C-x\C-c" 'save-buffers-kill-emacs) +(define-key global-map "\C-x4c" 'clone-indirect-buffer-other-window) (define-key global-map "\C-x4f" 'find-file-other-window) (define-key global-map "\C-x4r" 'find-file-read-only-other-window) (define-key global-map "\C-x4\C-f" 'find-file-other-window) Index: lisp/keymap.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/keymap.el,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- lisp/keymap.el 15 Mar 2002 07:43:20 -0000 1.10 +++ lisp/keymap.el 2 Mar 2003 09:38:39 -0000 1.11 @@ -2,6 +2,7 @@ ;; Copyright (C) 1993-4, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. +;; Copyright (C) 2003 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: internals, dumped @@ -37,21 +38,15 @@ ;;; Code: -(put 'undefined 'suppress-keymap t) +;; BEGIN SYNCHED WITH FSF 21.2. (defun undefined () (interactive) (ding)) -(defmacro kbd (keys) - "Convert KEYS to the internal Emacs key representation. -KEYS should be a string in the format used for saving keyboard macros -\(see `insert-kbd-macro')." - (if (or (stringp keys) - (vectorp keys)) - ;; #### need to move xemacs-base into the core!!!!!! - (declare-fboundp (read-kbd-macro keys)) - `(declare-fboundp (read-kbd-macro ,keys)))) +;Prevent the \{...} documentation construct +;from mentioning keys that run this command. +(put 'undefined 'suppress-keymap t) (defun suppress-keymap (map &optional nodigits) "Make MAP override all normally self-inserting keys to be undefined. @@ -66,6 +61,8 @@ (define-key map string 'digit-argument) (incf (aref string 0)))))) +;Unneeded in XEmacs (defvar key-substitution-in-progress nil + (defun substitute-key-definition (olddef newdef keymap &optional oldmap prefix) "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF. In other words, OLDDEF is replaced with NEWDEF wherever it appears. @@ -84,7 +81,12 @@ maps (cdr maps)) ;; Substitute in this keymap (map-keymap #'(lambda (key binding) - (if (eq binding olddef) + (if (or (eq binding olddef) + ;; Compare with equal if definition is a key + ;; sequence. That is useful for operating on + ;; function-key-map. + (and (or (stringp binding) (vectorp binding)) + (equal binding olddef))) ;; The new bindings always go in KEYMAP even if we ;; found them in OLDMAP or one of its children. ;; If KEYMAP will be shadowing OLDMAP, then do not @@ -103,6 +105,38 @@ map) ))) +;; FSF garbage. They misguidedly tried to put menu entries into keymaps, +;; and needed stuff like the following. Eventually they admitted defeat +;; and switched to our method. + +; (defun define-key-after (keymap key definition &optional after) +; "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding. +; This is like `define-key' except that the binding for KEY is placed +; just after the binding for the event AFTER, instead of at the beginning +; of the map. Note that AFTER must be an event type (like KEY), NOT a command +; \(like DEFINITION). +; +; If AFTER is t or omitted, the new binding goes at the end of the keymap. +; +; KEY must contain just one event type--that is to say, it must be a +; string or vector of length 1, but AFTER should be a single event +; type--a symbol or a character, not a sequence. +; +; Bindings are always added before any inherited map. +; +; The order of bindings in a keymap matters when it is used as a menu." + +(defmacro kbd (keys) + "Convert KEYS to the internal Emacs key representation. +KEYS should be a string constant in the format used for +saving keyboard macros (see `insert-kbd-macro')." + (if (or (stringp keys) + (vectorp keys)) + ;; #### need to move xemacs-base into the core!!!!!! + (declare-fboundp (read-kbd-macro keys)) + `(declare-fboundp (read-kbd-macro ,keys)))) + +;; END SYNCHED WITH FSF 21.2. ;; This used to wrap forms into an interactive lambda. It is unclear ;; to me why this is needed in this function. Anyway, Index: lisp/lisp-mode.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/lisp-mode.el,v retrieving revision 1.20 retrieving revision 1.22 diff -u -r1.20 -r1.22 --- lisp/lisp-mode.el 20 Jun 2002 21:18:03 -0000 1.20 +++ lisp/lisp-mode.el 24 Apr 2003 05:29:12 -0000 1.22 @@ -72,9 +72,7 @@ (indent-sexp)))] "---" ["%_Comment Out Region" comment-region :active (region-exists-p)] - ["Unc%_omment Region" (comment-region (region-beginning) - (region-end) '(4)) - :active (region-exists-p)] + ["Unc%_omment Region" uncomment-region :active (region-exists-p)] "---" ,@(if popup-p '(["%_Find Function" @@ -268,6 +266,16 @@ ;; XEmacs: Not sure what the FSF menu bindings are. I hope XEmacs ;; doesn't need them. ) + +;; XEmacs: add docstrings to the hooks +(defvar emacs-lisp-mode-hook nil + "Hook to run when entering emacs-lisp-mode.") + +(defvar lisp-mode-hook nil + "Hook to run when entering lisp-mode.") + +(defvar lisp-interaction-mode-hook nil + "Hook to run when entering lisp-interaction-mode.") (defun emacs-lisp-byte-compile () "Byte compile the file containing the current buffer." Index: lisp/loadup.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/loadup.el,v retrieving revision 1.27 retrieving revision 1.29 diff -u -r1.27 -r1.29 --- lisp/loadup.el 6 Feb 2003 06:35:47 -0000 1.27 +++ lisp/loadup.el 1 Mar 2003 07:25:27 -0000 1.29 @@ -39,6 +39,11 @@ (setq stack-trace-on-error t load-always-display-messages t) +;(princ (format "command-line-args: %s\n" command-line-args)) +;(princ (format "configure-lisp-directory: %S\n" configure-lisp-directory)) +;(princ (format "configure-data-directory: %S\n" configure-data-directory)) +;(princ (format "lisp-directory: %S\n" lisp-directory)) + (when (fboundp 'error) (error "loadup.el already loaded!")) @@ -50,6 +55,12 @@ (defvar Installation-string nil "Description of XEmacs installation.") +(defvar build-root (expand-file-name ".." invocation-directory)) +(defvar source-lisp (file-name-directory (expand-file-name + (nth 2 command-line-args)))) +(defvar source-root (expand-file-name ".." source-lisp)) +;(defvar build-lib-src (expand-file-name "lib-src" build-root)) + ;(start-profiling) (let ((gc-cons-threshold @@ -76,14 +87,14 @@ ;; insert-file-contents-internal bogusly calls ;; format-decode without checking if it's defined. (fset 'format-decode #'(lambda (f l &optional v) l)) - (insert-file-contents-internal "../Installation") + (insert-file-contents-internal + (expand-file-name "Installation" build-root)) (fmakunbound 'format-decode) (prog1 (buffer-substring) (kill-buffer (current-buffer))))) - (let ((build-root (expand-file-name ".." invocation-directory))) - (setq load-path (list (expand-file-name "lisp" build-root))) - (setq module-load-path (list (expand-file-name "modules" build-root)))) + (setq load-path (list source-lisp)) + (setq module-load-path (list (expand-file-name "modules" build-root))) ;; message not defined yet ... (external-debugging-output (format "\nUsing load-path %s" load-path)) @@ -93,9 +104,6 @@ ;; We don't want to have any undo records in the dumped XEmacs. (buffer-disable-undo (get-buffer "*scratch*")) - ;; Load our first bootstrap support - (load "very-early-lisp.el") - ;; lread.c (or src/Makefile.in.in) has prepended ;; "${srcdir}/../lisp/" to load-path, which is how this file ;; has been found. At this point, enough of XEmacs has been @@ -136,7 +144,7 @@ ;;(print (format "guessed-data-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-data-root-p))) nil))) - (load (expand-file-name "../lisp/dumped-lisp.el")) + (load (expand-file-name "dumped-lisp.el" source-lisp)) (let ((files preloaded-file-list) file) @@ -214,69 +222,6 @@ ) ;; (let ((gc-cons-threshold [frequent garbage collection when dumping]))) ;(stop-profiling) - -;; yuck! need to insert the function def here, and rewrite the dolist -;; loop below. - -;(defun loadup-profile-results (&optional info stream) -; "Print profiling info INFO to STREAM in a pretty format. -;If INFO is omitted, the current profiling info is retrieved using -; `get-profiling-info'. -;If STREAM is omitted, either a *Profiling Results* buffer or standard -; output are used, depending on whether the function was called -; interactively or not." -; (interactive) -; (setq info (if info -; (copy-alist info) -; (get-profiling-info))) -; (when (and (not stream) -; (interactive-p)) -; (pop-to-buffer (get-buffer-create "*Profiling Results*")) -; (erase-buffer)) -; (let ((standard-output (or stream (if (interactive-p) -; (current-buffer) -; standard-output))) -; ;; Calculate the longest function -; (maxfunlen (apply #'max -; (length "Function Name") -; (mapcar -; (lambda (el) -; ;; Functions longer than 50 characters (usually -; ;; anonymous functions) don't qualify -; (let ((l (length (format "%s" (car el))))) -; (if (< l 50) -; l 0))) -; info)))) -; (princ (format "%-*s Ticks %%/Total Call Count\n" -; maxfunlen "Function Name")) -; (princ (make-string maxfunlen ?=)) -; (princ " ===== ======= ==========\n") -; (let ((sum (float (apply #'+ (mapcar #'cdr info))))) -; (let (entry -; (entry-list (nreverse (sort info #'cdr-less-than-cdr)))) -; (while entry-list -; (setq entry (car entry-list)) -; (princ (format "%-*s %-5d %-6.3f %s\n" -; maxfunlen (car entry) (cdr entry) -; (* 100 (/ (cdr entry) sum)) -; (or (gethash (car entry) call-count-profile-table) -; ""))) -; (setq entry-list (cdr entry-list)))) -; (princ (make-string maxfunlen ?-)) -; (princ "---------------------------------\n") -; (princ (format "%-*s %-5d %-6.2f\n" maxfunlen "Total" sum 100.0)) -; (princ (format "\n\nOne tick = %g ms\n" -; (/ default-profiling-interval 1000.0))) -; (and (boundp 'internal-error-checking) -; internal-error-checking -; (princ " -;WARNING: Error checking is turned on in this XEmacs. This might make -; the measurements very unreliable.\n")))) -; (when (and (not stream) -; (interactive-p)) -; (goto-char (point-min)))) - -;(loadup-profile-results nil 'external-debugging-output) ;; Dump into the name `xemacs' (only) (when (member "dump" command-line-args) Index: lisp/make-docfile.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/make-docfile.el,v retrieving revision 1.24 retrieving revision 1.27 diff -u -r1.24 -r1.27 --- lisp/make-docfile.el 15 Feb 2003 10:15:55 -0000 1.24 +++ lisp/make-docfile.el 2 Mar 2003 09:38:39 -0000 1.27 @@ -4,7 +4,7 @@ ;; Copyright (C) 2002, 2003 Ben Wing. ;; Author: Unknown -;; Maintainer: Steven L Baur +;; Maintainer: XEmacs Development Team ;; Keywords: internal ;; This file is part of XEmacs. @@ -45,6 +45,12 @@ (defvar site-file-list nil) (defvar docfile-out-of-date nil) +(defvar build-root (expand-file-name ".." invocation-directory)) +(defvar build-lib-src (expand-file-name "lib-src" build-root)) +(defvar source-lisp (file-name-directory (expand-file-name + (nth 2 command-line-args)))) +(defvar source-src (expand-file-name "../src" source-lisp)) + (defun message (fmt &rest args) (princ (apply #'format fmt args)) (terpri)) @@ -73,7 +79,7 @@ ;; (message (concat "Options: " (prin1-to-string options))) ;; insert-file-contents-internal calls out to `format-decode' afterwards, -;; so it must be defined. if non-zero, it tries to be a bunch more stuff +;; so it must be defined. if non-zero, it tries to do a bunch more stuff ;; so say, "NOOOOOOOOOOOOO! Basta! Ca soufit! Enough, already, OK?" (defun format-decode (fuck me harder) 0) @@ -118,34 +124,35 @@ (when (and (not (string-match "\\(NEEDTODUMP\\|\\.exe$\\)" arg)) (not (member arg processed))) (when (string-match "\\(.*\\)\\.obj$" arg) - (setq arg (concat (file-name-nondirectory - ;; no match-string so use its implementation. - (substring arg (match-beginning 1) - (match-end 1))) - ".c"))) + (setq arg (expand-file-name + (concat + (file-name-nondirectory + ;; no match-string so use its implementation. + (substring arg (match-beginning 1) + (match-end 1))) + ".c") + source-src))) (if (and (null docfile-out-of-date) (file-newer-than-file-p arg docfile)) (setq docfile-out-of-date t)) (setq processed (cons arg processed)))) (setq args (cdr args))))) +;; Then process the list of Lisp files. (process-args command-line-args) -;; Then process the list of Lisp files. -(let ((build-root (expand-file-name ".." invocation-directory))) - (setq load-path (list (expand-file-name "lisp" build-root)))) +(setq load-path (list source-lisp)) ;; Then process the autoloads (setq autoload-file-name "auto-autoloads.elc") -(load "very-early-lisp.el") +(defvar custom-declare-variable-list nil) ; unclean (load "find-paths.el") (load "packages.el") (load "setup-paths.el") -(load "dump-paths.el") (load "raw-process.el") (let (preloaded-file-list) - (load (expand-file-name "../lisp/dumped-lisp.el")) + (load (expand-file-name "dumped-lisp.el" source-lisp)) (let ((package-preloaded-file-list (packages-collect-package-dumped-lisps late-package-load-path))) @@ -217,7 +224,7 @@ (message "Spawning make-docfile ...") ;; (message (prin1-to-string (append options processed))) - (setq exec-path (list (concat default-directory "../lib-src"))) + (setq exec-path (list build-lib-src)) ;; (locate-file-clear-hashing nil) (if (memq system-type '(berkeley-unix next-mach)) @@ -233,12 +240,13 @@ (mapconcat #'identity (append - (list (concat default-directory "../lib-src/make-docfile")) + (list (expand-file-name "make-docfile" build-lib-src)) options processed) " ")) ;; (message (prin1-to-string (append options processed))) (apply 'call-process-internal - ;; (concat default-directory "../lib-src/make-docfile") + ;; exec-path is set. + ;; (expand-file-name "make-docfile" build-lib-src) "make-docfile" nil t @@ -248,7 +256,6 @@ (message "Spawning make-docfile ...done") ;; (write-region-internal (point-min) (point-max) "/tmp/DOC") ) -(message "DOC file is up to date") (kill-emacs) Index: lisp/menubar-items.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/menubar-items.el,v retrieving revision 1.38 retrieving revision 1.41 diff -u -r1.38 -r1.41 --- lisp/menubar-items.el 8 Feb 2003 02:29:53 -0000 1.38 +++ lisp/menubar-items.el 27 Mar 2003 12:57:42 -0000 1.41 @@ -567,10 +567,23 @@ ("%_Tools" ("%_Packages" - ("%_Add Download Site" - :filter (lambda (&rest junk) - (submenu-generate-accelerator-spec - (package-get-download-menu)))) + ("%_Set Download Site" + ("%_Official Releases" + :filter (lambda (&rest junk) + (menu-split-long-menu + (submenu-generate-accelerator-spec + (package-ui-download-menu))))) + ("%_Pre-Releases" + :filter (lambda (&rest junk) + (menu-split-long-menu + (submenu-generate-accelerator-spec + (package-ui-pre-release-download-menu))))) + ("%_Site Releases" + :filter (lambda (&rest junk) + (menu-split-long-menu + (submenu-generate-accelerator-spec + (package-ui-site-release-download-menu)))))) + "--:shadowEtchedIn" ["%_Update Package Index" package-get-update-base] ["%_List and Install" pui-list-packages] ["U%_pdate Installed Packages" package-get-update-all] @@ -1641,10 +1654,10 @@ (Help-find-file (locate-data-file "sample.gtkrc")) :included (featurep 'gtk) :active (locate-data-file "sample.gtkrc")] - ["View Sample .%_Xdefaults" - (Help-find-file (locate-data-file "sample.Xdefaults")) + ["View Sample .%_Xresources" + (Help-find-file (locate-data-file "sample.Xresources")) :included (featurep 'x) - :active (locate-data-file "sample.Xdefaults")] + :active (locate-data-file "sample.Xresources")] ["View Sample %_enriched.doc" (Help-find-file (locate-data-file "enriched.doc")) :active (locate-data-file "enriched.doc")]) Index: lisp/msw-faces.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/msw-faces.el,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- lisp/msw-faces.el 20 Jun 2002 21:18:04 -0000 1.16 +++ lisp/msw-faces.el 9 Mar 2003 02:27:33 -0000 1.17 @@ -29,6 +29,11 @@ ;; This file does the magic to parse mswindows font names, and make sure that ;; the default and modeline attributes of new frames are specified enough. +(globally-declare-boundp + '(mswindows-font-regexp mswindows-font-regexp-missing-1 + mswindows-font-regexp-missing-2 mswindows-font-regexp-missing-3 + mswindows-font-regexp-missing-4)) + (defun mswindows-init-global-faces () (set-face-font 'gui-element "MS Sans Serif:Regular:8" nil 'mswindows)) Index: lisp/msw-glyphs.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/msw-glyphs.el,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- lisp/msw-glyphs.el 29 Mar 2002 04:46:34 -0000 1.11 +++ lisp/msw-glyphs.el 20 Feb 2003 08:19:29 -0000 1.12 @@ -30,7 +30,7 @@ ;; Initialization code for MS Windows glyphs. -;; This file is dumped with XEmacs (when MS Windows support is +;; This file is dumped with XEmacs (when MS Windows display support is ;; compiled in). Make sure this is the first of msw-*.el files ;; dumped. Index: lisp/newcomment.el =================================================================== RCS file: lisp/newcomment.el diff -N lisp/newcomment.el --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lisp/newcomment.el 2 Mar 2003 09:38:40 -0000 1.1 @@ -0,0 +1,1071 @@ +;;; newcomment.el --- (un)comment regions of buffers + +;; Copyright (C) 1999, 2000 Free Software Foundation Inc. + +;; Author: code extracted from Emacs-20's simple.el +;; Maintainer: Stefan Monnier +;; Keywords: comment uncomment +;; Revision: $Id: newcomment.el,v 1.1 2003/03/02 09:38:40 ben Exp $ + +;; This file is part of GNU Emacs. + +;; 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. + +;; 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 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: + +;; A replacement for simple.el's comment-related functions. + +;;; Bugs: + +;; - single-char nestable comment-start can only do the "\\s<+" stuff +;; if the corresponding closing marker happens to be right. +;; - comment-box in TeXinfo generate bogus comments @ccccc@ +;; - uncomment-region with a numeric argument can render multichar +;; comment markers invalid. +;; - comment-indent or comment-region when called inside a comment +;; will happily break the surrounding comment. +;; - comment-quote-nested will not (un)quote properly all nested comment +;; markers if there are more than just comment-start and comment-end. +;; For example, in Pascal where {...*) and (*...} are possible. + +;;; Todo: + +;; - quantized steps in comment-alignment +;; - try to align tail comments +;; - check what c-comment-line-break-function has to say +;; - spill auto-fill of comments onto the end of the next line +;; - uncomment-region with a consp (for blocks) or somehow make the +;; deletion of continuation markers less dangerous +;; - drop block-comment- unless it's really used +;; - uncomment-region on a subpart of a comment +;; - support gnu-style "multi-line with space in continue" +;; - somehow allow comment-dwim to use the region even if transient-mark-mode +;; is not turned on. + +;; - when auto-filling a comment, try to move the comment to the left +;; rather than break it (if possible). +;; - sometimes default the comment-column to the same +;; one used on the preceding line(s). + +;;; Code: + +;;;###autoload +(defalias 'indent-for-comment 'comment-indent) +;;;###autoload +(defalias 'set-comment-column 'comment-set-column) +;;;###autoload +(defalias 'kill-comment 'comment-kill) +;;;###autoload +(defalias 'indent-new-comment-line 'comment-indent-new-line) + +;;;###autoload +(defgroup comment nil + "Indenting and filling of comments." + :prefix "comment-" + :version "21.1" + :group 'fill) + +(defvar comment-use-syntax 'undecided + "Non-nil if syntax-tables can be used instead of regexps. +Can also be `undecided' which means that a somewhat expensive test will +be used to try to determine whether syntax-tables should be trusted +to understand comments or not in the given buffer. +Major modes should set this variable.") + +;;;###autoload +(defcustom comment-column 32 + "*Column to indent right-margin comments to. +Setting this variable automatically makes it local to the current buffer. +Each mode establishes a different default value for this variable; you +can set the value for a particular mode using that mode's hook." + :type 'integer + :group 'comment) +(make-variable-buffer-local 'comment-column) + +;;;###autoload +(defvar comment-start nil + "*String to insert to start a new comment, or nil if no comment syntax.") + +;;;###autoload +(defvar comment-start-skip nil + "*Regexp to match the start of a comment plus everything up to its body. +If there are any \\(...\\) pairs, the comment delimiter text is held to begin +at the place matched by the close of the first pair.") + +;;;###autoload +(defvar comment-end-skip nil + "Regexp to match the end of a comment plus everything up to its body.") + +;;;###autoload +(defvar comment-end "" + "*String to insert to end a new comment. +Should be an empty string if comments are terminated by end-of-line.") + +;;;###autoload +(defvar comment-indent-function 'comment-indent-default + "Function to compute desired indentation for a comment. +This function is called with no args with point at the beginning of +the comment's starting delimiter and should return either the desired +column indentation or nil. +If nil is returned, indentation is delegated to `indent-according-to-mode'.") + +(defvar block-comment-start nil) +(defvar block-comment-end nil) + +(defvar comment-quote-nested t + "Non-nil if nested comments should be quoted. +This should be locally set by each major mode if needed.") + +(defvar comment-continue nil + "Continuation string to insert for multiline comments. +This string will be added at the beginning of each line except the very +first one when commenting a region with a commenting style that allows +comments to span several lines. +It should generally have the same length as `comment-start' in order to +preserve indentation. +If it is nil a value will be automatically derived from `comment-start' +by replacing its first character with a space.") + +(defvar comment-add 0 + "How many more comment chars should be inserted by `comment-region'. +This determines the default value of the numeric argument of `comment-region'. +This should generally stay 0, except for a few modes like Lisp where +it can be convenient to set it to 1 so that regions are commented with +two semi-colons.") + +(defconst comment-styles + '((plain . (nil nil nil nil)) + (indent . (nil nil nil t)) + (aligned . (nil t nil t)) + (multi-line . (t nil nil t)) + (extra-line . (t nil t t)) + (box . (nil t t t)) + (box-multi . (t t t t))) + "Possible comment styles of the form (STYLE . (MULTI ALIGN EXTRA INDENT)). +STYLE should be a mnemonic symbol. +MULTI specifies that comments are allowed to span multiple lines. +ALIGN specifies that the `comment-end' markers should be aligned. +EXTRA specifies that an extra line should be used before and after the + region to comment (to put the `comment-end' and `comment-start'). +INDENT specifies that the `comment-start' markers should not be put at the + left margin but at the current indentation of the region to comment.") + +;;;###autoload +(defcustom comment-style 'plain + "*Style to be used for `comment-region'. +See `comment-styles' for a list of available styles." + :group 'comment + :type (if (boundp 'comment-styles) + `(choice ,@(mapcar (lambda (s) `(const ,(car s))) comment-styles)) + 'symbol)) + +;;;###autoload +(defcustom comment-padding " " + "Padding string that `comment-region' puts between comment chars and text. +Can also be an integer which will be automatically turned into a string +of the corresponding number of spaces. + +Extra spacing between the comment characters and the comment text +makes the comment easier to read. Default is \" \". nil means 0." + :group 'comment + :type '(choice string integer (const nil))) + +;;;###autoload +(defcustom comment-multi-line t ; XEmacs - this works well with adaptive fill + "*Non-nil means \\[indent-new-comment-line] should continue same comment +on new line, with no new terminator or starter. +This is obsolete because you might as well use \\[newline-and-indent]." + :type 'boolean + :group 'comment) + +;;;; +;;;; Helpers +;;;; + +(defun comment-string-strip (str beforep afterp) + "Strip STR of any leading (if BEFOREP) and/or trailing (if AFTERP) space." + (string-match (concat "\\`" (if beforep "\\s-*") + "\\(.*?\\)" (if afterp "\\s-*\n?") + "\\'") str) + (match-string 1 str)) + +(defun comment-string-reverse (s) + "Return the mirror image of string S, without any trailing space." + (comment-string-strip (concat (nreverse (string-to-list s))) nil t)) + +(defun comment-normalize-vars (&optional noerror) + (if (not comment-start) (or noerror (error "No comment syntax is defined")) + ;; comment-use-syntax + (when (eq comment-use-syntax 'undecided) + (set (make-local-variable 'comment-use-syntax) + (let ((st (syntax-table)) + (cs comment-start) + (ce (if (string= "" comment-end) "\n" comment-end))) + ;; Try to skip over a comment using forward-comment + ;; to see if the syntax tables properly recognize it. + (with-temp-buffer + (set-syntax-table st) + (insert cs " hello " ce) + (goto-char (point-min)) + (and (forward-comment 1) (eobp)))))) + ;; comment-padding + (unless comment-padding (setq comment-padding 0)) + (when (integerp comment-padding) + (setq comment-padding (make-string comment-padding ? ))) + ;; comment markers + ;;(setq comment-start (comment-string-strip comment-start t nil)) + ;;(setq comment-end (comment-string-strip comment-end nil t)) + ;; comment-continue + (unless (or comment-continue (string= comment-end "")) + (set (make-local-variable 'comment-continue) + (concat (if (string-match "\\S-\\S-" comment-start) " " "|") + (substring comment-start 1)))) + ;; comment-skip regexps + (unless comment-start-skip + (set (make-local-variable 'comment-start-skip) + (concat "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(\\s<+\\|" + (regexp-quote (comment-string-strip comment-start t t)) + ;; Let's not allow any \s- but only [ \t] since \n + ;; might be both a comment-end marker and \s-. + "+\\)[ \t]*"))) + (unless comment-end-skip + (let ((ce (if (string= "" comment-end) "\n" + (comment-string-strip comment-end t t)))) + (set (make-local-variable 'comment-end-skip) + ;; We use [ \t] rather than \s- because we don't want to + ;; remove ^L in C mode when uncommenting. + (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+") + "\\|" (regexp-quote (substring ce 0 1)) + (if (and comment-quote-nested (<= (length ce) 1)) "" "+") + (regexp-quote (substring ce 1)) + "\\)")))))) + +(defun comment-quote-re (str unp) + (concat (regexp-quote (substring str 0 1)) + "\\\\" (if unp "+" "*") + (regexp-quote (substring str 1)))) + +(defun comment-quote-nested (cs ce unp) + "Quote or unquote nested comments. +If UNP is non-nil, unquote nested comment markers." + (setq cs (comment-string-strip cs t t)) + (setq ce (comment-string-strip ce t t)) + (when (and comment-quote-nested (> (length ce) 0)) + (let ((re (concat (comment-quote-re ce unp) + "\\|" (comment-quote-re cs unp)))) + (goto-char (point-min)) + (while (re-search-forward re nil t) + (goto-char (match-beginning 0)) + (forward-char 1) + (if unp (delete-char 1) (insert "\\")) + (when (= (length ce) 1) + ;; If the comment-end is a single char, adding a \ after that + ;; "first" char won't deactivate it, so we turn such a CE + ;; into !CS. I.e. for pascal, we turn } into !{ + (if (not unp) + (when (string= (match-string 0) ce) + (replace-match (concat "!" cs) t t)) + (when (and (< (point-min) (match-beginning 0)) + (string= (buffer-substring (1- (match-beginning 0)) + (1- (match-end 0))) + (concat "!" cs))) + (backward-char 2) + (delete-char (- (match-end 0) (match-beginning 0))) + (insert ce)))))))) + +;;;; +;;;; Navigation +;;;; + +(defun comment-search-forward (limit &optional noerror) + "Find a comment start between point and LIMIT. +Moves point to inside the comment and returns the position of the +comment-starter. If no comment is found, moves point to LIMIT +and raises an error or returns nil of NOERROR is non-nil." + (if (not comment-use-syntax) + (if (re-search-forward comment-start-skip limit noerror) + (or (match-end 1) (match-beginning 0)) + (goto-char limit) + (unless noerror (error "No comment"))) + (let* ((pt (point)) + ;; Assume (at first) that pt is outside of any string. + (s (parse-partial-sexp pt (or limit (point-max)) nil nil nil t))) + (when (and (nth 8 s) (nth 3 s)) + ;; The search ended inside a string. Try to see if it + ;; works better when we assume that pt is inside a string. + (setq s (parse-partial-sexp + pt (or limit (point-max)) nil nil + (list nil nil nil (nth 3 s) nil nil nil nil) + t))) + (if (not (and (nth 8 s) (not (nth 3 s)))) + (unless noerror (error "No comment")) + ;; We found the comment. + (let ((pos (point)) + (start (nth 8 s)) + (bol (line-beginning-position)) + (end nil)) + (while (and (null end) (>= (point) bol)) + (if (looking-at comment-start-skip) + (setq end (min (or limit (point-max)) (match-end 0))) + (backward-char))) + (goto-char (or end pos)) + start))))) + +(defun comment-search-backward (&optional limit noerror) + "Find a comment start between LIMIT and point. +Moves point to inside the comment and returns the position of the +comment-starter. If no comment is found, moves point to LIMIT +and raises an error or returns nil of NOERROR is non-nil." + ;; FIXME: If a comment-start appears inside a comment, we may erroneously + ;; stop there. This can be rather bad in general, but since + ;; comment-search-backward is only used to find the comment-column (in + ;; comment-set-column) and to find the comment-start string (via + ;; comment-beginning) in indent-new-comment-line, it should be harmless. + (if (not (re-search-backward comment-start-skip limit t)) + (unless noerror (error "No comment")) + (beginning-of-line) + (let* ((end (match-end 0)) + (cs (comment-search-forward end t)) + (pt (point))) + (if (not cs) + (progn (beginning-of-line) + (comment-search-backward limit noerror)) + (while (progn (goto-char cs) + (comment-forward) + (and (< (point) end) + (setq cs (comment-search-forward end t)))) + (setq pt (point))) + (goto-char pt) + cs)))) + +(defun comment-beginning () + "Find the beginning of the enclosing comment. +Returns nil if not inside a comment, else moves point and returns +the same as `comment-search-forward'." + ;; HACK ATTACK! + ;; We should really test `in-string-p' but that can be expensive. + (unless (eq (get-text-property (point) 'face) 'font-lock-string-face) + (let ((pt (point)) + (cs (comment-search-backward nil t))) + (when cs + (if (save-excursion + (goto-char cs) + (and + ;; For modes where comment-start and comment-end are the same, + ;; the search above may have found a `ce' rather than a `cs'. + (or (not (looking-at comment-end-skip)) + ;; Maybe font-lock knows that it's a `cs'? + (eq (get-text-property (match-end 0) 'face) + 'font-lock-comment-face) + (unless (eq (get-text-property (point) 'face) + 'font-lock-comment-face) + ;; Let's assume it's a `cs' if we're on the same line. + (>= (line-end-position) pt))) + ;; Make sure that PT is not past the end of the comment. + (if (comment-forward 1) (> (point) pt) (eobp)))) + cs + (goto-char pt) + nil))))) + +(defun comment-forward (&optional n) + "Skip forward over N comments. +Just like `forward-comment' but only for positive N +and can use regexps instead of syntax." + (setq n (or n 1)) + (if (< n 0) (error "No comment-backward") + (if comment-use-syntax (forward-comment n) + (while (> n 0) + (setq n + (if (or (forward-comment 1) + (and (looking-at comment-start-skip) + (goto-char (match-end 0)) + (re-search-forward comment-end-skip nil 'move))) + (1- n) -1))) + (= n 0)))) + +(defun comment-enter-backward () + "Move from the end of a comment to the end of its content. +Point is assumed to be just at the end of a comment." + (if (bolp) + ;; comment-end = "" + (progn (backward-char) (skip-syntax-backward " ")) + (let ((end (point))) + (beginning-of-line) + (save-restriction + (narrow-to-region (point) end) + (if (re-search-forward (concat comment-end-skip "\\'") nil t) + (goto-char (match-beginning 0)) + ;; comment-end-skip not found probably because it was not set right. + ;; Since \\s> should catch the single-char case, we'll blindly + ;; assume we're at the end of a two-char comment-end. + (goto-char (point-max)) + (backward-char 2) + (skip-chars-backward (string (char-after))) + (skip-syntax-backward " ")))))) + +;;;; +;;;; Commands +;;;; + +;;;###autoload + +;; #### XEmacs had this: in place of just (current-column) +; (defconst comment-indent-function +; ;; XEmacs - add at least one space after the end of the text on the +; ;; current line... +; (lambda () +; (save-excursion +; (beginning-of-line) +; (let ((eol (save-excursion (end-of-line) (point)))) +; (and comment-start-skip +; (re-search-forward comment-start-skip eol t) +; (setq eol (match-beginning 0))) +; (goto-char eol) +; (skip-chars-backward " \t") +; (max comment-column (1+ (current-column)))))) +; "Function to compute desired indentation for a comment. +; This function is called with no args with point at the beginning of +; the comment's starting delimiter.") + +(defun comment-indent-default () + "Default for `comment-indent-function'." + (if (and (looking-at "\\s<\\s<\\(\\s<\\)?") + (or (match-end 1) (/= (current-column) (current-indentation)))) + 0 + (when (or (/= (current-column) (current-indentation)) + (and (> comment-add 0) (looking-at "\\s<\\S<"))) + comment-column))) + +;;;###autoload +(defun comment-indent (&optional continue) + "Indent this line's comment to comment column, or insert an empty comment. +If CONTINUE is non-nil, use the `comment-continue' markers if any. +Comments starting in column 0 are not moved." + (interactive "*") + (comment-normalize-vars) + (let* ((empty (save-excursion (beginning-of-line) + (looking-at "[ \t]*$"))) + (starter (or (and continue comment-continue) + (and empty block-comment-start) comment-start)) + (ender (or (and continue comment-continue "") + (and empty block-comment-end) comment-end))) + (unless starter (error "No comment syntax defined")) + (beginning-of-line) + (let* ((eolpos (line-end-position)) + (begpos (comment-search-forward eolpos t)) + cpos indent) + ;; An existing comment? + (if begpos (setq cpos (point-marker)) + ;; If none, insert one. + (save-excursion + ;; Some comment-indent-function insist on not moving comments that + ;; are in column 0, so we first go to the likely target column. + (indent-to comment-column) + (setq begpos (point)) + (insert starter) + (setq cpos (point-marker)) + (insert ender))) + (goto-char begpos) + ;; Compute desired indent. + (setq indent (save-excursion (funcall comment-indent-function))) + (if (not indent) + ;; comment-indent-function refuses delegates to indent. + (indent-according-to-mode) + ;; Avoid moving comments past the fill-column. + (unless (save-excursion (skip-chars-backward " \t") (bolp)) + (setq indent + (min indent + (+ (current-column) + (- fill-column + (save-excursion (end-of-line) (current-column))))))) + ;; XEmacs change: Preserve indentation of comments starting in + ;; column 0, as documented. + (if (or (= (current-column) 0) (= (current-column) indent)) + (goto-char begpos) + ;; If that's different from current, change it. + (skip-chars-backward " \t") + (delete-region (point) begpos) + (indent-to (if (bolp) indent + (max indent (1+ (current-column))))))) + (goto-char cpos) + (set-marker cpos nil)))) + +;;;###autoload +(defun comment-set-column (arg) + "Set the comment column based on point. +With no ARG, set the comment column to the current column. +With just minus as arg, kill any comment on this line. +With any other arg, set comment column to indentation of the previous comment + and then align or create a comment on this line at that column." + (interactive "P") + (cond + ((eq arg '-) (comment-kill nil)) + (arg + (save-excursion + (beginning-of-line) + (comment-search-backward) + (beginning-of-line) + (goto-char (comment-search-forward (line-end-position))) + (setq comment-column (current-column)) + (lmessage 'command "Comment column set to %d" comment-column)) + (comment-indent)) + (t (setq comment-column (current-column)) + (lmessage 'command "Comment column set to %d" comment-column)))) + +;;;###autoload +(defun comment-kill (arg) + "Kill the comment on this line, if any. +With prefix ARG, kill comments on that many lines starting with this one." + ;; XEmacs change: add * + (interactive "*P") + (dotimes (_ (prefix-numeric-value arg)) + (save-excursion + (beginning-of-line) + (let ((cs (comment-search-forward (line-end-position) t))) + (when cs + (goto-char cs) + (skip-syntax-backward " ") + (setq cs (point)) + (comment-forward) + (kill-region cs (if (bolp) (1- (point)) (point))) + (indent-according-to-mode)))) + (if arg (forward-line 1)))) + +(defun comment-padright (str &optional n) + "Construct a string composed of STR plus `comment-padding'. +It also adds N copies of the last non-whitespace chars of STR. +If STR already contains padding, the corresponding amount is +ignored from `comment-padding'. +N defaults to 0. +If N is `re', a regexp is returned instead, that would match +the string for any N." + (setq n (or n 0)) + (when (and (stringp str) (not (string= "" str))) + ;; Separate the actual string from any leading/trailing padding + (string-match "\\`\\s-*\\(.*?\\)\\s-*\\'" str) + (let ((s (match-string 1 str)) ;actual string + (lpad (substring str 0 (match-beginning 1))) ;left padding + (rpad (concat (substring str (match-end 1)) ;original right padding + (substring comment-padding ;additional right padding + (min (- (match-end 0) (match-end 1)) + (length comment-padding))))) + ;; We can only duplicate C if the comment-end has multiple chars + ;; or if comments can be nested, else the comment-end `}' would + ;; be turned into `}}}' where only the first ends the comment + ;; and the rest becomes bogus junk. + (multi (not (and comment-quote-nested + ;; comment-end is a single char + (string-match "\\`\\s-*\\S-\\s-*\\'" comment-end))))) + (if (not (symbolp n)) + (concat lpad s (when multi (make-string n (aref str (1- (match-end 1))))) rpad) + ;; construct a regexp that would match anything from just S + ;; to any possible output of this function for any N. + (concat (mapconcat (lambda (c) (concat (regexp-quote (string c)) "?")) + lpad "") ;padding is not required + (regexp-quote s) + (when multi "+") ;the last char of S might be repeated + (mapconcat (lambda (c) (concat (regexp-quote (string c)) "?")) + rpad "")))))) ;padding is not required + +(defun comment-padleft (str &optional n) + "Construct a string composed of `comment-padding' plus STR. +It also adds N copies of the first non-whitespace chars of STR. +If STR already contains padding, the corresponding amount is +ignored from `comment-padding'. +N defaults to 0. +If N is `re', a regexp is returned instead, that would match + the string for any N." + (setq n (or n 0)) + (when (and (stringp str) (not (string= "" str))) + ;; Only separate the left pad because we assume there is no right pad. + (string-match "\\`\\s-*" str) + (let ((s (substring str (match-end 0))) + (pad (concat (substring comment-padding + (min (- (match-end 0) (match-beginning 0)) + (length comment-padding))) + (match-string 0 str))) + (c (aref str (match-end 0))) ;the first non-space char of STR + ;; We can only duplicate C if the comment-end has multiple chars + ;; or if comments can be nested, else the comment-end `}' would + ;; be turned into `}}}' where only the first ends the comment + ;; and the rest becomes bogus junk. + (multi (not (and comment-quote-nested + ;; comment-end is a single char + (string-match "\\`\\s-*\\S-\\s-*\\'" comment-end))))) + (if (not (symbolp n)) + (concat pad (when multi (make-string n c)) s) + ;; Construct a regexp that would match anything from just S + ;; to any possible output of this function for any N. + ;; We match any number of leading spaces because this regexp will + ;; be used for uncommenting where we might want to remove + ;; uncomment markers with arbitrary leading space (because + ;; they were aligned). + (concat "\\s-*" + (if multi (concat (regexp-quote (string c)) "*")) + (regexp-quote s)))))) + +;;;###autoload +(defun uncomment-region (beg end &optional arg) + "Uncomment each line in the BEG..END region. +The numeric prefix ARG can specify a number of chars to remove from the +comment markers." + (interactive "*r\nP") + (comment-normalize-vars) + (if (> beg end) (let (mid) (setq mid beg beg end end mid))) + (save-excursion + (goto-char beg) + (setq end (copy-marker end)) + + ;; XEmacs: Add the following clause + + ;; if user didn't specify how many comments to remove, be smart + ;; and remove the minimal number that all lines have. that way, + ;; comments in a region of Elisp code that gets commented out will + ;; get put back correctly. + (if (null arg) + (let ((min-comments 999999)) + (while (not (eobp)) + (let ((this-comments 0)) + (while (looking-at (regexp-quote comment-start)) + (incf this-comments) + (forward-char (length comment-start))) + (if (and (> this-comments 0) (< this-comments min-comments)) + (setq min-comments this-comments)) + (forward-line 1))) + (if (< min-comments 999999) + (setq arg (list min-comments))) + (goto-char beg))) + + (let ((numarg (prefix-numeric-value arg)) + spt) + (while (and (< (point) end) + (setq spt (comment-search-forward end t))) + (let* ((ipt (point)) + ;; Find the end of the comment. + (ept (progn + (goto-char spt) + (unless (comment-forward) + (error "Can't find the comment end")) + (point))) + (box nil) + (ccs comment-continue) + (srei (comment-padright ccs 're)) + (sre (and srei (concat "^\\s-*?\\(" srei "\\)")))) + (save-restriction + (narrow-to-region spt ept) + ;; Remove the comment-start. + (goto-char ipt) + (skip-syntax-backward " ") + ;; Check for special `=' used sometimes in comment-box. + (when (and (= (- (point) (point-min)) 1) (looking-at "=\\{7\\}")) + (skip-chars-forward "=")) + ;; A box-comment starts with a looong comment-start marker. + (when (> (- (point) (point-min) (length comment-start)) 7) + (setq box t)) + (when (looking-at (regexp-quote comment-padding)) + (goto-char (match-end 0))) + (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei))) + (goto-char (match-end 0))) + (if (null arg) (delete-region (point-min) (point)) + (skip-syntax-backward " ") + (delete-char (- numarg))) + + ;; Remove the end-comment (and leading padding and such). + (goto-char (point-max)) (comment-enter-backward) + ;; Check for special `=' used sometimes in comment-box. + (when (= (- (point-max) (point)) 1) + (let ((pos (point))) + ;; skip `=' but only if there are at least 7. + (when (> (skip-chars-backward "=") -7) (goto-char pos)))) + (unless (looking-at "\\(\n\\|\\s-\\)*\\'") + (when (and (bolp) (not (bobp))) (backward-char)) + (if (null arg) (delete-region (point) (point-max)) + (skip-syntax-forward " ") + (delete-char numarg))) + + ;; Unquote any nested end-comment. + (comment-quote-nested comment-start comment-end t) + + ;; Eliminate continuation markers as well. + (when sre + (let* ((cce (comment-string-reverse (or comment-continue + comment-start))) + (erei (and box (comment-padleft cce 're))) + (ere (and erei (concat "\\(" erei "\\)\\s-*$")))) + (goto-char (point-min)) + (while (progn + (if (and ere (re-search-forward + ere (line-end-position) t)) + (replace-match "" t t nil (if (match-end 2) 2 1)) + (setq ere nil)) + (forward-line 1) + (re-search-forward sre (line-end-position) t)) + (replace-match "" t t nil (if (match-end 2) 2 1))))) + ;; Go the the end for the next comment. + (goto-char (point-max))))) + (set-marker end nil)))) + +(defun comment-make-extra-lines (cs ce ccs cce min-indent max-indent &optional block) + "Make the leading and trailing extra lines. +This is used for `extra-line' style (or `box' style if BLOCK is specified)." + (let ((eindent 0)) + (if (not block) + ;; Try to match CS and CE's content so they align aesthetically. + (progn + (setq ce (comment-string-strip ce t t)) + (when (string-match "\\(.+\\).*\n\\(.*?\\)\\1" (concat ce "\n" cs)) + (setq eindent + (max (- (match-end 2) (match-beginning 2) (match-beginning 0)) + 0)))) + ;; box comment + (let* ((width (- max-indent min-indent)) + (s (concat cs "a=m" cce)) + (e (concat ccs "a=m" ce)) + (c (if (string-match ".*\\S-\\S-" cs) + (aref cs (1- (match-end 0))) ?=)) + ; Huh? (_ (string-match "\\s-*a=m\\s-*" s)) + (fill + (make-string (+ width (- (match-end 0) + (match-beginning 0) (length cs) 3)) c))) + (setq cs (replace-match fill t t s)) + (string-match "\\s-*a=m\\s-*" e) + (setq ce (replace-match fill t t e)))) + (cons (concat cs "\n" (make-string min-indent ? ) ccs) + (concat cce "\n" (make-string (+ min-indent eindent) ? ) ce)))) + +;(def-edebug-spec comment-with-narrowing t) +(put 'comment-with-narrowing 'lisp-indent-function 2) +(defmacro comment-with-narrowing (beg end &rest body) + "Execute BODY with BEG..END narrowing. +Space is added (and then removed) at the beginning for the text's +indentation to be kept as it was before narrowing." + (let ((bindent (make-symbol "bindent"))) + `(let ((,bindent (save-excursion (goto-char beg) (current-column)))) + (save-restriction + (narrow-to-region beg end) + (goto-char (point-min)) + (insert (make-string ,bindent ? )) + (prog1 + (progn ,@body) + ;; remove the bindent + (save-excursion + (goto-char (point-min)) + (when (looking-at " *") + (let ((n (min (- (match-end 0) (match-beginning 0)) ,bindent))) + (delete-char n) + (setq ,bindent (- ,bindent n)))) + (end-of-line) + (let ((e (point))) + (beginning-of-line) + (while (and (> ,bindent 0) (re-search-forward " *" e t)) + (let ((n (min ,bindent (- (match-end 0) (match-beginning 0) 1)))) + (goto-char (match-beginning 0)) + (delete-char n) + (setq ,bindent (- ,bindent n))))))))))) + +(defun comment-region-internal (beg end cs ce + &optional ccs cce block lines indent) + "Comment region BEG..END. +CS and CE are the comment start resp end string. +CCS and CCE are the comment continuation strings for the start resp end +of lines (default to CS and CE). +BLOCK indicates that end of lines should be marked with either CCE, CE or CS +\(if CE is empty) and that those markers should be aligned. +LINES indicates that an extra lines will be used at the beginning and end +of the region for CE and CS. +INDENT indicates to put CS and CCS at the current indentation of the region +rather than at left margin." + ;;(assert (< beg end)) + (let ((no-empty t)) + ;; Sanitize CE and CCE. + (if (and (stringp ce) (string= "" ce)) (setq ce nil)) + (if (and (stringp cce) (string= "" cce)) (setq cce nil)) + ;; If CE is empty, multiline cannot be used. + (unless ce (setq ccs nil cce nil)) + ;; Should we mark empty lines as well ? + (if (or ccs block lines) (setq no-empty nil)) + ;; Make sure we have end-markers for BLOCK mode. + (when block (unless ce (setq ce (comment-string-reverse cs)))) + ;; If BLOCK is not requested, we don't need CCE. + (unless block (setq cce nil)) + ;; Continuation defaults to the same as CS and CE. + (unless ccs (setq ccs cs cce ce)) + + (save-excursion + (goto-char end) + ;; If the end is not at the end of a line and the comment-end + ;; is implicit (i.e. a newline), explicitly insert a newline. + (unless (or ce (eolp)) (insert "\n") (indent-according-to-mode)) + (comment-with-narrowing beg end + (let ((min-indent (point-max)) + (max-indent 0)) + (goto-char (point-min)) + ;; Quote any nested comment marker + (comment-quote-nested comment-start comment-end nil) + + ;; Loop over all lines to find the needed indentations. + (goto-char (point-min)) + (while + (progn + (unless (looking-at "[ \t]*$") + (setq min-indent (min min-indent (current-indentation)))) + (end-of-line) + (setq max-indent (max max-indent (current-column))) + (not (or (eobp) (progn (forward-line) nil))))) + + ;; Inserting ccs can change max-indent by (1- tab-width). + (setq max-indent + (+ max-indent (max (length cs) (length ccs)) tab-width -1)) + (unless indent (setq min-indent 0)) + + ;; make the leading and trailing lines if requested + (when lines + (let ((csce + (comment-make-extra-lines + cs ce ccs cce min-indent max-indent block))) + (setq cs (car csce)) + (setq ce (cdr csce)))) + + (goto-char (point-min)) + ;; Loop over all lines from BEG to END. + (while + (progn + (unless (and no-empty (looking-at "[ \t]*$")) + (move-to-column min-indent t) + (insert cs) (setq cs ccs) ;switch to CCS after the first line + (end-of-line) + (if (eobp) (setq cce ce)) + (when cce + (when block (move-to-column max-indent t)) + (insert cce))) + (end-of-line) + (not (or (eobp) (progn (forward-line) nil)))))))))) + +;;;###autoload +(defun comment-region (beg end &optional arg) + "Comment or uncomment each line in the region. +With just \\[universal-argument] prefix arg, uncomment each line in region BEG..END. +Numeric prefix arg ARG means use ARG comment characters. +If ARG is negative, delete that many comment characters instead. +By default, comments start at the left margin, are terminated on each line, +even for syntax in which newline does not end the comment and blank lines +do not get comments. This can be changed with `comment-style'. + +The strings used as comment starts are built from +`comment-start' without trailing spaces and `comment-padding'." + (interactive "*r\nP") + (comment-normalize-vars) + (if (> beg end) (let (mid) (setq mid beg beg end end mid))) + (let* ((numarg (prefix-numeric-value arg)) + (add comment-add) + (style (cdr (assoc comment-style comment-styles))) + (lines (nth 2 style)) + (block (nth 1 style)) + (multi (nth 0 style))) + (save-excursion + ;; we use `chars' instead of `syntax' because `\n' might be + ;; of end-comment syntax rather than of whitespace syntax. + ;; sanitize BEG and END + (goto-char beg) (skip-chars-forward " \t\n\r") (beginning-of-line) + (setq beg (max beg (point))) + (goto-char end) (skip-chars-backward " \t\n\r") (end-of-line) + (setq end (min end (point))) + (if (>= beg end) (error "Nothing to comment")) + + ;; sanitize LINES + (setq lines + (and + lines ;; multi + (progn (goto-char beg) (beginning-of-line) + (skip-syntax-forward " ") + (>= (point) beg)) + (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") + (<= (point) end)) + (or (not (string= "" comment-end)) block) + (progn (goto-char beg) (search-forward "\n" end t))))) + + ;; don't add end-markers just because the user asked for `block' + (unless (or lines (string= "" comment-end)) (setq block nil)) + + (cond + ((consp arg) (uncomment-region beg end)) + ((< numarg 0) (uncomment-region beg end (- numarg))) + (t + (setq numarg (if (and (null arg) (= (length comment-start) 1)) + add (1- numarg))) + (comment-region-internal + beg end + (let ((s (comment-padright comment-start numarg))) + (if (string-match comment-start-skip s) s + (comment-padright comment-start))) + (let ((s (comment-padleft comment-end numarg))) + (and s (if (string-match comment-end-skip s) s + (comment-padright comment-end)))) + (if multi (comment-padright comment-continue numarg)) + (if multi (comment-padleft (comment-string-reverse comment-continue) numarg)) + block + lines + (nth 3 style)))))) + +(defun comment-box (beg end &optional arg) + "Comment out the BEG..END region, putting it inside a box. +The numeric prefix ARG specifies how many characters to add to begin- and +end- comment markers additionally to what `comment-add' already specifies." + (interactive "*r\np") + (let ((comment-style (if (cadr (assoc comment-style comment-styles)) + 'box-multi 'box))) + (comment-region beg end (+ comment-add arg)))) + +;;;###autoload +(defun comment-dwim (arg) + "Call the comment command you want (Do What I Mean). +If the region is active and `transient-mark-mode' is on, call + `comment-region' (unless it only consists of comments, in which + case it calls `uncomment-region'). +Else, if the current line is empty, insert a comment and indent it. +Else if a prefix ARG is specified, call `comment-kill'. +Else, call `comment-indent'." + (interactive "*P") + (comment-normalize-vars) + (if (region-active-p) ;mark-active transient-mark-mode) + (let ((beg (min (point) (mark))) + (end (max (point) (mark)))) + (if (save-excursion ;; check for already commented region + (goto-char beg) + (comment-forward (point-max)) + (<= end (point))) + (uncomment-region beg end arg) + (comment-region beg end arg))) + (if (save-excursion (beginning-of-line) (not (looking-at "\\s-*$"))) + ;; FIXME: If there's no comment to kill on this line and ARG is + ;; specified, calling comment-kill is not very clever. + (if arg (comment-kill (and (integerp arg) arg)) (comment-indent)) + (let ((add (if arg (prefix-numeric-value arg) + (if (= (length comment-start) 1) comment-add 0)))) + ;; Some modes insist on keeping column 0 comment in column 0 + ;; so we need to move away from it before inserting the comment. + (indent-according-to-mode) + (insert (comment-padright comment-start add)) + (save-excursion + (unless (string= "" comment-end) + (insert (comment-padleft comment-end add))) + (indent-according-to-mode)))))) + +(defcustom comment-auto-fill-only-comments nil + "Non-nil means to only auto-fill inside comments. +This has no effect in modes that do not define a comment syntax." + :type 'boolean + :group 'comment) + +;;;###autoload +(defun comment-indent-new-line (&optional soft) + "Break line at point and indent, continuing comment if within one. +This indents the body of the continued comment +under the previous comment line. + +This command is intended for styles where you write a comment per line, +starting a new comment (and terminating it if necessary) on each line. +If you want to continue one comment across several lines, use \\[newline-and-indent]. + +If a fill column is specified, it overrides the use of the comment column +or comment indentation. + +The inserted newline is marked hard if variable `use-hard-newlines' is true, +unless optional argument SOFT is non-nil." + (interactive) + (comment-normalize-vars t) + (let (compos comin) + ;; If we are not inside a comment and we only auto-fill comments, + ;; don't do anything (unless no comment syntax is defined). + (unless (and comment-start + comment-auto-fill-only-comments + (not (save-excursion + (prog1 (setq compos (comment-beginning)) + (setq comin (point)))))) + + ;; Now we know we should auto-fill. + ;; XEmacs: next 3 lines from old version. + (skip-chars-backward " \t") + (if (featurep 'mule) + (declare-fboundp (kinsoku-process))) + (delete-horizontal-space) + (if soft (insert-and-inherit ?\n) (newline 1)) + (if fill-prefix + (progn + (indent-to-left-margin) + (insert-and-inherit fill-prefix)) + + ;;#### jhod: probably need to fix this for kinsoku processing + ;; If necessary check whether we're inside a comment. + (unless (or comment-multi-line compos (null comment-start)) + (save-excursion + (backward-char) + (setq compos (comment-beginning)) + (setq comin (point)))) + + ;; If we're not inside a comment, just try to indent. + ;; #### XEmacs: the line `(if comcol' was changed as follows. + ;; I'm leaving it out since who knows if it's applicable any more. + ;; --ben + ;; (if (and comcol (not fill-prefix)) ; XEmacs - (ENE) from fa-extras. + (if (not compos) (indent-according-to-mode) + (let* ((comment-column + ;; The continuation indentation should be somewhere between + ;; the current line's indentation (plus 2 for good measure) + ;; and the current comment's indentation, with a preference + ;; for comment-column. + (save-excursion + (goto-char compos) + (min (current-column) (max comment-column + (+ 2 (current-indentation)))))) + (comstart (buffer-substring compos comin)) + (normalp + (string-match (regexp-quote (comment-string-strip + comment-start t t)) + comstart)) + (comment-end + (if normalp comment-end + ;; The comment starter is not the normal comment-start + ;; so we can't just use comment-end. + (save-excursion + (goto-char compos) + (if (not (comment-forward)) comment-end + (comment-string-strip + (buffer-substring + (save-excursion (comment-enter-backward) (point)) + (point)) + nil t))))) + (comment-start comstart) + ;; Force comment-continue to be recreated from comment-start. + ;; FIXME: wrong if comment-continue was set explicitly! + (comment-continue nil)) + (insert-and-inherit ?\n) + (forward-char -1) + (comment-indent (cadr (assoc comment-style comment-styles))) + (save-excursion + (let ((pt (point))) + (end-of-line) + (let ((comend (buffer-substring pt (point)))) + ;; The 1+ is to make sure we delete the \n inserted above. + (delete-region pt (1+ (point))) + (beginning-of-line) + (backward-char) + (insert comend) + (forward-char)))))))))) + +(provide 'newcomment) + +;;; newcomment.el ends here Index: lisp/obsolete.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/obsolete.el,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- lisp/obsolete.el 2 Oct 2002 09:30:05 -0000 1.16 +++ lisp/obsolete.el 20 Mar 2003 13:19:59 -0000 1.17 @@ -184,6 +184,8 @@ "This used to be the name of the user whose init file was read at startup.") (make-obsolete-variable 'init-file-user 'load-user-init-file-p) +(define-obsolete-function-alias 'pui-add-install-directory + 'pui-set-local-package-get-directory) ; misleading name ;;;;;;;;;;;;;;;;;;;;;;;;;;;; hooks (make-compatible-variable 'lisp-indent-hook 'lisp-indent-function) @@ -233,6 +235,9 @@ (add-submenu menu-path (cons menu-name menu-items) before)) ;; Can't make this obsolete. easymenu depends on it. (make-compatible 'add-menu 'add-submenu) + +(define-obsolete-function-alias 'package-get-download-menu + 'package-ui-download-menu) ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer Index: lisp/package-admin.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/package-admin.el,v retrieving revision 1.19 retrieving revision 1.22 diff -u -r1.19 -r1.22 --- lisp/package-admin.el 15 Mar 2002 07:43:20 -0000 1.19 +++ lisp/package-admin.el 14 Apr 2003 03:40:27 -0000 1.22 @@ -1,6 +1,7 @@ ;;; package-admin.el --- Installation and Maintenance of XEmacs packages ;; Copyright (C) 1997 by Free Software Foundation, Inc. +;; Copyright (C) 2003, Steve Youngs. ;; Author: SL Baur ;; Keywords: internal @@ -114,25 +115,6 @@ hook is called *before* the package is deleted. The hook function is passed two arguments: the package name, and the install directory.") -;;;###autoload -(defun package-admin-add-single-file-package (file destdir &optional pkg-dir) - "Install a single file Lisp package into XEmacs package hierarchy. -`file' should be the full path to the lisp file to install. -`destdir' should be a simple directory name. -The optional `pkg-dir' can be used to override the default package hierarchy -\(car \(last late-packages))." - (interactive "fLisp File: \nsDestination: ") - (when (null pkg-dir) - (setq pkg-dir (car (last late-packages)))) - (let ((destination (concat pkg-dir "/lisp/" destdir)) - (buf (get-buffer-create package-admin-temp-buffer))) - (call-process "add-little-package.sh" - nil - buf - t - ;; rest of command line follows - package-admin-xemacs file destination))) - (defun package-admin-install-function-mswindows (file pkg-dir buffer) "Install function for mswindows." (let ((default-directory (file-name-as-directory pkg-dir))) @@ -152,80 +134,193 @@ ;; Don't assume GNU tar. (if (shell-command (concat "gunzip -c " filename " | tar xvf -") buffer) 0 - 1) - )) + 1))) -; (call-process "add-big-package.sh" -; nil -; buffer -; t -; ;; rest of command line follows -; package-admin-xemacs file pkg-dir)) - -(defun package-admin-get-install-dir (package pkg-dir &optional mule-related) - "If PKG-DIR is non-nil return that, -else return the current location of the package if it is already installed -or return a location appropriate for the package otherwise." - (if pkg-dir +;; A few things needed by the following 2 functions. +(eval-when-compile + (require 'packages) + (autoload 'package-get-info "package-get") + (autoload 'paths-decode-directory-path "find-paths") + (defvar package-get-install-to-user-init-directory)) + +(defun package-admin-find-top-directory (type &optional user-dir) + "Return the top level directory for a package. + +Argument TYPE is a symbol that determines the type of package we're +trying to find a directory for. + +Optional Argument USER-DIR if non-nil use directories off +`user-init-directory'. This overrides everything except +\"EMACSPACKAGEPATH\". + +This function honours the environment variable \"EMACSPACKAGEPATH\" +and returns directories found there as a priority. If that variable +doesn't exist and USER-DIR is nil, check in the normal places. + +If we still can't find a suitable directory, return nil. + +Possible values for TYPE are: + + std == For \"standard\" packages that go in '/xemacs-packages/' + mule == For \"mule\" packages that go in '/mule-packages/' + site == For \"unsupported\" packages that go in '/site-packages/' + +Note: Type \"site\" is not yet fully supported." + (let* ((env-value (getenv "EMACSPACKAGEPATH")) + top-dir) + ;; First, check the environment var. + (if env-value + (let ((path-list (paths-decode-directory-path env-value 'drop-empties))) + (cond ((eq type 'std) + (while path-list + (if (equal (substring (car path-list) -16) + (concat "xemacs-packages" directory-sep-char)) + (setq top-dir (car path-list))) + (setq path-list (cdr path-list)))) + ((eq type 'mule) + (while path-list + (if (equal (substring (car path-list) -14) + (concat "mule-packages" directory-sep-char)) + (setq top-dir (car path-list))) + (setq path-list (cdr path-list))))))) + ;; Wasn't in the environment, try `user-init-directory' if + ;; USER-DIR is non-nil. + (if (and user-dir + (not top-dir)) + (cond ((eq type 'std) + (setq top-dir (file-name-as-directory + (expand-file-name "xemacs-packages" user-init-directory)))) + ((eq type 'mule) + (setq top-dir (file-name-as-directory + (expand-file-name "mule-packages" user-init-directory)))))) + ;; Finally check the normal places + (if (not top-dir) + (let ((path-list (nth 1 (packages-find-packages + emacs-data-roots + (packages-compute-package-locations user-init-directory))))) + (cond ((eq type 'std) + (while path-list + (if (equal (substring (car path-list) -16) + (concat "xemacs-packages" directory-sep-char)) + (setq top-dir (car path-list))) + (setq path-list (cdr path-list)))) + ((eq type 'mule) + (while path-list + (if (equal (substring (car path-list) -14) + (concat "mule-packages" directory-sep-char)) + (setq top-dir (car path-list))) + (setq path-list (cdr path-list))))))) + ;; Now return either the directory or nil. + top-dir)) + +(defun package-admin-get-install-dir (package &optional pkg-dir) + "Find a suitable installation directory for a package. + +Argument PACKAGE is the package to find a installation directory for. +Optional Argument PKG-DIR, if non-nil is a directory to use for +installation. + +If PKG-DIR is non-nil and writable, return that. Otherwise check to +see if the PACKAGE is already installed and return that location, if +it is writable. Finally, fall back to the `user-init-directory' if +all else fails. As a side effect of installing packages under +`user-init-directory' these packages become part of `early-packages'." + ;; If pkg-dir specified, return that if writable. + (if (and pkg-dir + (file-writable-p (directory-file-name pkg-dir))) pkg-dir - (let ((package-feature (intern-soft (concat - (symbol-name package) "-autoloads"))) - autoload-dir) - (when (and (not (eq package 'unknown)) - (featurep package-feature) - (setq autoload-dir (feature-file package-feature)) - (setq autoload-dir (file-name-directory autoload-dir)) - (member autoload-dir (append early-package-load-path late-package-load-path))) - ;; Find the corresponding entry in late-package - (setq pkg-dir - (car-safe (member-if (lambda (h) - (string-match (concat "^" (regexp-quote h)) - autoload-dir)) - (append (cdr early-packages) late-packages))))) - (if pkg-dir - pkg-dir - ;; Ok we need to guess - (if mule-related - (package-admin-get-install-dir 'mule-base nil nil) - (if (eq package 'xemacs-base) - (car (last late-packages)) - (package-admin-get-install-dir 'xemacs-base nil nil))))))) - - + ;; If the user want her packages under ~/.xemacs/, do so. + (let ((type (package-get-info package 'category))) + (if package-get-install-to-user-init-directory + (progn + (cond ((equal type "standard") + (setq pkg-dir (package-admin-find-top-directory 'std 'user-dir))) + ((equal type "mule") + (setq pkg-dir (package-admin-find-top-directory 'mule 'user-dir)))) + pkg-dir) + ;; Maybe the package has been installed before, if so, return + ;; that directory. + (let ((package-feature (intern-soft (concat + (symbol-name package) "-autoloads"))) + autoload-dir) + (when (and (not (eq package 'unknown)) + (featurep package-feature) + (setq autoload-dir (feature-file package-feature)) + (setq autoload-dir (file-name-directory autoload-dir)) + (member autoload-dir (append early-package-load-path late-package-load-path))) + ;; Find the corresponding entry in late-package + (setq pkg-dir + (car-safe (member-if (lambda (h) + (string-match (concat "^" (regexp-quote h)) + autoload-dir)) + (append (cdr early-packages) late-packages))))) + (if (and pkg-dir + (file-writable-p (directory-file-name pkg-dir))) + pkg-dir + ;; OK, the package hasn't been previously installed so we need + ;; to guess where it should go. + (cond ((equal type "standard") + (setq pkg-dir (package-admin-find-top-directory 'std))) + ((equal type "mule") + (setq pkg-dir (package-admin-find-top-directory 'mule))) + (t + (error 'invalid-operation + "Invalid package type"))) + (if (and pkg-dir + (file-writable-p (directory-file-name pkg-dir))) + pkg-dir + ;; Oh no! Either we still haven't found a suitable + ;; directory, or we can't write to the one we did find. + ;; Drop back to the `user-init-directory'. + (if (y-or-n-p (format "Directory isn't writable, use %s instead? " + user-init-directory)) + (progn + (cond ((equal type "standard") + (setq pkg-dir (package-admin-find-top-directory 'std 'user-dir))) + ((equal type "mule") + (setq pkg-dir (package-admin-find-top-directory 'mule 'user-dir))) + (t + (error 'invalid-operation + "Invalid package type"))) + ;; Turn on `package-get-install-to-user-init-directory' + ;; so we don't get asked for each package we try to + ;; install in this session. + (setq package-get-install-to-user-init-directory t) + pkg-dir) + ;; If we get to here XEmacs can't make up its mind and + ;; neither can the user, nothing left to do except barf. :-( + (error 'search-failed + (format + "Can't find suitable installation directory for package: %s" + package)))))))))) (defun package-admin-get-manifest-file (pkg-topdir package) "Return the name of the MANIFEST file for package PACKAGE. Note that PACKAGE is a symbol, and not a string." - (let (dir) - (setq dir (expand-file-name "pkginfo" pkg-topdir)) - (expand-file-name (concat "MANIFEST." (symbol-name package)) dir) - )) + (let ((dir (file-name-as-directory + (expand-file-name "pkginfo" pkg-topdir)))) + (expand-file-name (concat "MANIFEST." (symbol-name package)) dir))) (defun package-admin-check-manifest (pkg-outbuf pkg-topdir) "Check for a MANIFEST. file in the package distribution. If it doesn't exist, create and write one. PKG-OUTBUF is the buffer that holds the output from `tar', and PKG-TOPDIR is the top-level directory under which the package was installed." - (let ( (manifest-buf " *pkg-manifest*") - old-case-fold-search regexp package-name pathname regexps) - ;; Save and restore the case-fold-search status. - ;; We do this in case we have to screw with it (as it the case of - ;; case-insensitive filesystems such as MS Windows). - (setq old-case-fold-search case-fold-search) + (let ((manifest-buf " *pkg-manifest*") + (old-case-fold-search case-fold-search) + regexp package-name pathname regexps) (unwind-protect (save-excursion ;; Probably redundant. - (set-buffer (get-buffer pkg-outbuf)) ;; Probably already the - ;; current buffer. + (set-buffer (get-buffer pkg-outbuf)) ;; Probably already the current buffer. (goto-char (point-min)) ;; Make filenames case-insensitive, if necessary (if (eq system-type 'windows-nt) (setq case-fold-search t)) - ;; We really should compute the regexp. - ;; However, directory-sep-char is currently broken, but we need - ;; functional code *NOW*. - (setq regexp "\\bpkginfo[\\/]MANIFEST\\...*") + (setq regexp (concat "\\bpkginfo" + (char-to-string directory-sep-char) + "MANIFEST\\...*")) ;; Look for the manifest. (if (not (re-search-forward regexp nil t)) @@ -234,22 +329,18 @@ ;; Yuk. We weren't passed the package name, and so we have ;; to dig for it. Look for it as the subdirectory name below - ;; "lisp", "man", "info", or "etc". + ;; "lisp", or "man". ;; Here, we don't use a single regexp because we want to search ;; the directories for a package name in a particular order. - ;; The problem is that packages could have directories like - ;; "etc/sounds/" or "etc/photos/" and we don't want to get - ;; these confused with the actual package name (although, in - ;; the case of "etc/sounds/", it's probably correct). (if (catch 'done - (let ( (dirs '("lisp" "info" "man" "etc")) rexp) + (let ((dirs '("lisp" "man")) + rexp) (while dirs (setq rexp (concat "\\b" (car dirs) "[\\/]\\([^\\/]+\\)[\//]")) (if (re-search-forward rexp nil t) (throw 'done t)) - (setq dirs (cdr dirs)) - ))) + (setq dirs (cdr dirs))))) (progn (setq package-name (buffer-substring (match-beginning 1) (match-end 1))) @@ -277,22 +368,16 @@ (buffer-substring (match-beginning 1) (match-end 1))) - (throw 'found-path t) - )) - (setq regexps (cdr regexps)) - ) - ) + (throw 'found-path t))) + (setq regexps (cdr regexps)))) (progn ;; found a pathname -- add it to the manifest ;; buffer (save-excursion (set-buffer manifest-buf) (goto-char (point-max)) - (insert pathname "\n") - ) - )) - (forward-line 1) - ) + (insert pathname "\n")))) + (forward-line 1)) ;; Processed all lines. ;; Now, create the file, pkginfo/MANIFEST. @@ -312,25 +397,16 @@ ;; Put the files in sorted order (if-fboundp 'sort-lines (sort-lines nil (point-min) (point-max)) - (error 'unimplemented - "`xemacs-base' not installed?")) + (warn "`xemacs-base' not installed, MANIFEST.%s not sorted" + package-name)) ;; Write the file. ;; Note that using `write-region' *BYPASSES* any check ;; to see if XEmacs is currently editing/visiting the ;; file. - (write-region (point-min) (point-max) pathname) - ) - (kill-buffer manifest-buf) - ) - (progn - ;; We can't determine the package name from an extracted - ;; file in the tar output buffer. - )) - )) - ) + (write-region (point-min) (point-max) pathname)) + (kill-buffer manifest-buf)))))) ;; Restore old case-fold-search status - (setq case-fold-search old-case-fold-search)) - )) + (setq case-fold-search old-case-fold-search)))) ;;;###autoload (defun package-admin-add-binary-package (file &optional pkg-dir) @@ -338,8 +414,7 @@ (interactive "fPackage tarball: ") (let ((buf (get-buffer-create package-admin-temp-buffer)) (status 1) - start err-list - ) + start err-list) (setq pkg-dir (package-admin-get-install-dir 'unknown pkg-dir)) ;; Ensure that the current directory doesn't change (save-excursion @@ -361,17 +436,11 @@ (if (re-search-forward (car err-list) nil t) (progn (setq status 1) - (throw 'done nil) - )) - (setq err-list (cdr err-list)) - ) - ) + (throw 'done nil))) + (setq err-list (cdr err-list)))) ;; Make sure that the MANIFEST file exists - (package-admin-check-manifest buf pkg-dir) - )) - ) - status - )) + (package-admin-check-manifest buf pkg-dir)))) + status)) (defun package-admin-rmtree (directory) "Delete a directory and all of its contents, recursively. @@ -406,13 +475,12 @@ (setq package-lispdir (expand-file-name (symbol-name package) package-lispdir)) (file-accessible-directory-p package-lispdir)) - package-lispdir) - )) + package-lispdir))) (defun package-admin-delete-binary-package (package pkg-topdir) "Delete a binary installation of PACKAGE below directory PKG-TOPDIR. PACKAGE is a symbol, not a string." - (let ( (tmpbuf " *pkg-manifest*") manifest-file package-lispdir dirs file) + (let (manifest-file package-lispdir dirs file) (setq pkg-topdir (package-admin-get-install-dir package pkg-topdir)) (setq manifest-file (package-admin-get-manifest-file pkg-topdir package)) (run-hook-with-args 'package-delete-hook package pkg-topdir) @@ -421,8 +489,7 @@ ;; The manifest file exists! Use it to delete the old distribution. (message "Removing old files for package \"%s\" ..." package) (sit-for 0) - (setq tmpbuf (get-buffer-create tmpbuf)) - (with-current-buffer tmpbuf + (with-temp-buffer (buffer-disable-undo) (erase-buffer) (insert-file-contents manifest-file) @@ -454,66 +521,31 @@ ;; Delete empty directories. (if dirs - (let ( (orig-default-directory default-directory) - ;; directory files file - ) - ;; Make sure we preserve the existing `default-directory'. - ;; JV, why does this change the default directory? Does it indeed? - (unwind-protect - (progn - ;; Warning: destructive sort! - (setq dirs (nreverse (sort dirs 'string<))) -; ;; For each directory ... -; (while dirs -; (setq directory (file-name-as-directory (car dirs))) -; (setq files (directory-files directory)) -; ;; Delete the directory if it's empty. -; (if (catch 'done -; (while files -; (setq file (car files)) -; (if (and (not (string= file ".")) -; (not (string= file ".."))) -; (throw 'done nil)) -; (setq files (cdr files)) -; ) -; t) -; ( -; (delete-directory directory)) -; (setq dirs (cdr dirs)) -; ) - ;; JV, On all OS's that I know of delete-directory fails on - ;; on non-empty dirs anyway - (mapc - (lambda (dir) - (condition-case () - (delete-directory dir))) - dirs)) - (setq default-directory orig-default-directory) - ))) - ) - (kill-buffer tmpbuf) + (progn + (mapc + (lambda (dir) + (condition-case () + (delete-directory dir))) + dirs))) ;; Delete the MANIFEST file ;; (set-file-modes manifest-file 438) ;; 438 -> #o666 ;; Note. Packages can have MANIFEST in MANIFEST. (condition-case () (delete-file manifest-file) (error nil)) ;; Do warning? - (message "Removing old files for package \"%s\" ... done" package)) - ;; The manifest file doesn't exist. Fallback to just deleting the - ;; package-specific lisp directory, if it exists. - ;; - ;; Delete old lisp directory, if any - ;; Gads, this is ugly. However, we're not supposed to use `concat' - ;; in the name of portability. - (when (setq package-lispdir (package-admin-get-lispdir pkg-topdir - package)) - (message "Removing old lisp directory \"%s\" ..." - package-lispdir) - (sit-for 0) - (package-admin-rmtree package-lispdir) - (message "Removing old lisp directory \"%s\" ... done" - package-lispdir) - )) + (message "Removing old files for package \"%s\" ... done" package))) + ;; The manifest file doesn't exist. Fallback to just deleting the + ;; package-specific lisp directory, if it exists. + ;; + ;; Delete old lisp directory, if any + ;; Gads, this is ugly. However, we're not supposed to use `concat' + ;; in the name of portability. + (setq package-lispdir (package-admin-get-lispdir pkg-topdir package)) + (when package-lispdir + (message "Removing old lisp directory \"%s\" ..." package-lispdir) + (sit-for 0) + (package-admin-rmtree package-lispdir) + (message "Removing old lisp directory \"%s\" ... done" package-lispdir))) ;; Delete the package from the database of installed packages. (package-delete-name package))) Index: lisp/package-get.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/package-get.el,v retrieving revision 1.55 retrieving revision 1.60 diff -u -r1.55 -r1.60 --- lisp/package-get.el 18 Nov 2002 06:52:28 -0000 1.55 +++ lisp/package-get.el 14 Apr 2003 03:40:27 -0000 1.60 @@ -2,10 +2,12 @@ ;; Copyright (C) 1998 by Pete Ware ;; Copyright (C) 2002 Ben Wing. +;; Copyright (C) 2003, Steve Youngs ;; Author: Pete Ware ;; Heavy-Modifications: Greg Klanderman ;; Jan Vroonhof +;; Steve Youngs ;; Keywords: internal ;; This file is part of XEmacs. @@ -167,80 +169,74 @@ :type 'directory :group 'package-get) +;;;###autoload +(defcustom package-get-install-to-user-init-directory nil + "*If non-nil install packages under `user-init-directory'." + :type 'boolean + :group 'package-get) + (define-widget 'host-name 'string "A Host name." :tag "Host") (defcustom package-get-remote nil - "*List of remote sites to contact for downloading packages. -List format is '(site-name directory-on-site). Each site is tried in -order until the package is found. As a special case, `site-name' can be -`nil', in which case `directory-on-site' is treated as a local directory." + "*The remote site to contact for downloading packages. +Format is '(site-name directory-on-site). As a special case, `site-name' +can be `nil', in which case `directory-on-site' is treated as a local +directory." :tag "Package repository" - :type '(repeat (choice (list :tag "Local" (const :tag "Local" nil) directory ) - (list :tag "Remote" host-name directory) )) + :type '(set (choice (const :tag "None" nil) + (list :tag "Local" (const :tag "Local" nil) directory) + (list :tag "Remote" host-name directory))) :group 'package-get) ;;;###autoload (defcustom package-get-download-sites '( - ;; North America - ("Pre-Releases" "ftp.xemacs.org" "pub/xemacs/beta/experimental/packages") - ("xemacs.org" "ftp.xemacs.org" "pub/xemacs/packages") - ("ca.xemacs.org (Canada)" "ftp.ca.xemacs.org" "pub/Mirror/xemacs/packages") - ("crc.ca (Canada)" "ftp.crc.ca" "pub/packages/editors/xemacs/packages") - ("us.xemacs.org (United States)" "ftp.us.xemacs.org" "pub/xemacs/packages") - ("ibiblio.org (United States)" "ibiblio.org" "pub/packages/editors/xemacs/packages") - ("stealth.net (United States)" "ftp.stealth.net" "pub/mirrors/ftp.xemacs.org/pub/xemacs/packages") - ;("uiuc.edu (United States)" "uiarchive.uiuc.edu" "pub/packages/xemacs/packages") - - ;; South America - ("br.xemacs.org (Brazil)" "ftp.br.xemacs.org" "pub/xemacs/packages") - - ;; Europe - ("at.xemacs.org (Austria)" "ftp.at.xemacs.org" "editors/xemacs/packages") - ("be.xemacs.org (Belgium)" "ftp.be.xemacs.org" "xemacs/packages") - ("cz.xemacs.org (Czech Republic)" "ftp.cz.xemacs.org" "MIRRORS/ftp.xemacs.org/pub/xemacs/packages") - ("dk.xemacs.org (Denmark)" "ftp.dk.xemacs.org" "pub/emacs/xemacs/packages") - ("fi.xemacs.org (Finland)" "ftp.fi.xemacs.org" "pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/packages") - ("fr.xemacs.org (France)" "ftp.fr.xemacs.org" "pub/xemacs/packages") - ("pasteur.fr (France)" "ftp.pasteur.fr" "pub/computing/xemacs/packages") - ("de.xemacs.org (Germany)" "ftp.de.xemacs.org" "pub/ftp.xemacs.org/tux/xemacs/packages") - ("tu-darmstadt.de (Germany)" "ftp.tu-darmstadt.de" "pub/editors/xemacs/packages") - ;("hu.xemacs.org (Hungary)" "ftp.hu.xemacs.org" "pub/packages/xemacs/packages") - ("ie.xemacs.org (Ireland)" "ftp.ie.xemacs.org" "mirrors/ftp.xemacs.org/pub/xemacs/packages") - ("it.xemacs.org (Italy)" "ftp.it.xemacs.org" "unix/packages/XEMACS/packages") - ("no.xemacs.org (Norway)" "ftp.no.xemacs.org" "pub/xemacs/packages") - ("pl.xemacs.org (Poland)" "ftp.pl.xemacs.org" "pub/unix/editors/xemacs/packages") - ("ru.xemacs.org (Russia)" "ftp.ru.xemacs.org" "pub/xemacs/packages") - ("sk.xemacs.org (Slovakia)" "ftp.sk.xemacs.org" "pub/mirrors/xemacs/packages") - ("se.xemacs.org (Sweden)" "ftp.se.xemacs.org" "pub/gnu/xemacs/packages") - ("ch.xemacs.org (Switzerland)" "ftp.ch.xemacs.org" "mirror/xemacs/packages") - ("uk.xemacs.org (United Kingdom)" "ftp.uk.xemacs.org" "sites/ftp.xemacs.org/pub/xemacs/packages") - - ;; Asia - ("jp.xemacs.org (Japan)" "ftp.jp.xemacs.org" "pub/GNU/xemacs/packages") - ("aist.go.jp (Japan)" "ring.aist.go.jp" "pub/text/xemacs/packages") - ("asahi-net.or.jp (Japan)" "ring.asahi-net.or.jp" "pub/text/xemacs/packages") - ("dti.ad.jp (Japan)" "ftp.dti.ad.jp" "pub/unix/editor/xemacs/packages") - ("jaist.ac.jp (Japan)" "ftp.jaist.ac.jp" "pub/GNU/xemacs/packages") - ("nucba.ac.jp (Japan)" "mirror.nucba.ac.jp" "mirror/xemacs/packages") - ("sut.ac.jp (Japan)" "sunsite.sut.ac.jp" "pub/archives/packages/xemacs/packages") - ("kr.xemacs.org (Korea)" "ftp.kr.xemacs.org" "pub/tools/emacs/xemacs/packages") - ;("tw.xemacs.org (Taiwan)" "ftp.tw.xemacs.org" "Editors/xemacs/packages") - - ;; Africa - ("za.xemacs.org (South Africa)" "ftp.za.xemacs.org" "mirrorsites/ftp.xemacs.org/packages") - - ;; Middle East - ("sa.xemacs.org (Saudi Arabia)" "ftp.sa.xemacs.org" "pub/mirrors/ftp.xemacs.org/xemacs/packages") - - ;; Australia - ("au.xemacs.org (Australia)" "ftp.au.xemacs.org" "pub/xemacs/packages") - ("aarnet.edu.au (Australia)" "mirror.aarnet.edu.au" "pub/xemacs/packages") - - ;; Oceania - ("nz.xemacs.org (New Zealand)" "ftp.nz.xemacs.org" "mirror/ftp.xemacs.org/packages") + ;; Main XEmacs Site (ftp.xemacs.org) + ("US (Main XEmacs Site)" + "ftp.xemacs.org" "pub/xemacs/packages") + ;; In alphabetical order of Country, our mirrors... + ("Australia (aarnet.edu.au)" "mirror.aarnet.edu.au" "pub/xemacs/packages") + ("Australia (au.xemacs.org)" "ftp.au.xemacs.org" "pub/xemacs/packages") + ("Austria (at.xemacs.org)" "ftp.at.xemacs.org" "editors/xemacs/packages") + ("Belgium (be.xemacs.org)" "ftp.be.xemacs.org" "xemacs/packages") + ("Brazil (br.xemacs.org)" "ftp.br.xemacs.org" "pub/xemacs/packages") + ("Canada (ca.xemacs.org)" "ftp.ca.xemacs.org" "pub/Mirror/xemacs/packages") + ("Canada (crc.ca)" "ftp.crc.ca" "pub/packages/editors/xemacs/packages") + ("Canada (ualberta.ca)" "sunsite.ualberta.ca" "pub/Mirror/xemacs/packages") + ("Czech Republic (cz.xemacs.org)" "ftp.cz.xemacs.org" "MIRRORS/ftp.xemacs.org/pub/xemacs/packages") + ("Denmark (dk.xemacs.org)" "ftp.dk.xemacs.org" "pub/emacs/xemacs/packages") + ("Finland (fi.xemacs.org)" "ftp.fi.xemacs.org" "pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/packages") + ("France (fr.xemacs.org)" "ftp.fr.xemacs.org" "pub/xemacs/packages") + ("France (mirror.cict.fr)" "mirror.cict.fr" "xemacs/packages") + ("France (pasteur.fr)" "ftp.pasteur.fr" "pub/computing/xemacs/packages") + ("Germany (de.xemacs.org)" "ftp.de.xemacs.org" "pub/ftp.xemacs.org/tux/xemacs/packages") + ("Germany (tu-darmstadt.de)" "ftp.tu-darmstadt.de" "pub/editors/xemacs/packages") + ("Ireland (ie.xemacs.org)" "ftp.ie.xemacs.org" "mirrors/ftp.xemacs.org/pub/xemacs/packages") + ("Italy (it.xemacs.org)" "ftp.it.xemacs.org" "unix/packages/XEMACS/packages") + ("Japan (aist.go.jp)" "ring.aist.go.jp" "pub/text/xemacs/packages") + ("Japan (asahi-net.or.jp)" "ring.asahi-net.or.jp" "pub/text/xemacs/packages") + ("Japan (dti.ad.jp)" "ftp.dti.ad.jp" "pub/unix/editor/xemacs/packages") + ("Japan (jaist.ac.jp)" "ftp.jaist.ac.jp" "pub/GNU/xemacs/packages") + ("Japan (jp.xemacs.org)" "ftp.jp.xemacs.org" "pub/GNU/xemacs/packages") + ("Japan (nucba.ac.jp)" "mirror.nucba.ac.jp" "mirror/xemacs/packages") + ("Japan (sut.ac.jp)" "sunsite.sut.ac.jp" "pub/archives/packages/xemacs/packages") + ("Korea (kr.xemacs.org)" "ftp.kr.xemacs.org" "pub/tools/emacs/xemacs/packages") + ("New Zealand (nz.xemacs.org)" "ftp.nz.xemacs.org" "mirror/ftp.xemacs.org/packages") + ("Norway (no.xemacs.org)" "ftp.no.xemacs.org" "pub/xemacs/packages") + ("Poland (pl.xemacs.org)" "ftp.pl.xemacs.org" "pub/unix/editors/xemacs/packages") + ("Russia (ru.xemacs.org)" "ftp.ru.xemacs.org" "pub/xemacs/packages") + ("Slovakia (sk.xemacs.org)" "ftp.sk.xemacs.org" "pub/mirrors/xemacs/packages") + ("South Africa (za.xemacs.org)" "ftp.za.xemacs.org" "mirrorsites/ftp.xemacs.org/packages") + ("Sweden (se.xemacs.org)" "ftp.se.xemacs.org" "pub/gnu/xemacs/packages") + ("Switzerland (ch.xemacs.org)" "ftp.ch.xemacs.org" "mirror/xemacs/packages") + ("UK (uk.xemacs.org)" "ftp.uk.xemacs.org" "sites/ftp.xemacs.org/pub/xemacs/packages") + ("US (ibiblio.org)" "ibiblio.org" "pub/packages/editors/xemacs/packages") + ("US (stealth.net)" "ftp.stealth.net" "pub/mirrors/ftp.xemacs.org/pub/xemacs/packages") + ("US (unc.edu)" "metalab.unc.edu" "pub/packages/editors/xemacs/packages") + ("US (us.xemacs.org)" "ftp.us.xemacs.org" "pub/xemacs/packages") + ("US (utk.edu)" "ftp.sunsite.utk.edu" "pub/xemacs/packages") ) "*List of remote sites available for downloading packages. List format is '(site-description site-name directory-on-site). @@ -253,6 +249,113 @@ :type '(repeat (list (string :tag "Name") host-name directory)) :group 'package-get) +;;;###autoload +(defcustom package-get-pre-release-download-sites + '( + ;; Main XEmacs Site (ftp.xemacs.org) + ("Pre-Releases (Main XEmacs Site)" "ftp.xemacs.org" + "pub/xemacs/beta/experimental/packages") + ;; In alphabetical order of Country, our mirrors... + ("Australia Pre-Releases (aarnet.edu.au)" "mirror.aarnet.edu.au" + "pub/xemacs/beta/experimental/packages") + ("Australia Pre-Releases (au.xemacs.org)" "ftp.au.xemacs.org" + "pub/xemacs/beta/experimental/packages") + ("Austria Pre-Releases (at.xemacs.org)" "ftp.at.xemacs.org" + "editors/xemacs/beta/experimentsl/packages") + ("Brazil Pre-Releases (br.xemacs.org)" "ftp.br.xemacs.org" + "pub/xemacs/xemacs-21.5/experimental/packages") + ("Canada Pre-Releases (ca.xemacs.org)" "ftp.ca.xemacs.org" + "pub/Mirror/xemacs/beta/experimental/packages") + ("Canada Pre-Releases (crc.ca)" "ftp.crc.ca" + "pub/packages/editors/xemacs/beta/experimental/packages") + ("Canada Pre-Releases (ualberta.ca)" "sunsite.ualberta.ca" + "pub/Mirror/xemacs/beta/experimental/packages") + ("Czech Republic Pre-Releases (cz.xemacs.org)" "ftp.cz.xemacs.org" + "MIRRORS/ftp.xemacs.org/pub/xemacs/xemacs-21.5/experimental/packages") + ("Denmark Pre-Releases (dk.xemacs.org)" "ftp.dk.xemacs.org" + "pub/emacs/xemacs/beta/experimental/packages") + ("Finland Pre-Releases (fi.xemacs.org)" "ftp.fi.xemacs.org" + "pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/beta/experimental/packages") + ("France Pre-Releases (fr.xemacs.org)" "ftp.fr.xemacs.org" + "pub/xemacs/beta/experimental/packages") + ("France Pre-Releases (mirror.cict.fr)" "mirror.cict.fr" + "xemacs/beta/experimental/packages") + ("France Pre-Releases (pasteur.fr)" "ftp.pasteur.fr" + "pub/computing/xemacs/beta/experimental/packages") + ("Germany Pre-Releases (de.xemacs.org)" "ftp.de.xemacs.org" + "pub/ftp.xemacs.org/tux/xemacs/beta/experimental/packages") + ("Germany Pre-Releases (tu-darmstadt.de)" "ftp.tu-darmstadt.de" + "pub/editors/xemacs/beta/experimental/packages") + ("Ireland Pre-Releases (ie.xemacs.org)" "ftp.ie.xemacs.org" + "mirrors/ftp.xemacs.org/pub/xemacs/beta/experimental/packages") + ("Italy Pre-Releases (it.xemacs.org)" "ftp.it.xemacs.org" + "unix/packages/XEMACS/beta/experimental/packages") + ("Japan Pre-Releases (aist.go.jp)" "ring.aist.go.jp" + "pub/text/xemacs/beta/experimental/packages") + ("Japan Pre-Releases (asahi-net.or.jp)" "ring.asahi-net.or.jp" + "pub/text/xemacs/beta/experimental/packages") + ("Japan Pre-Releases (dti.ad.jp)" "ftp.dti.ad.jp" + "pub/unix/editor/xemacs/beta/experimental/packages") + ("Japan Pre-Releases (jaist.ac.jp)" "ftp.jaist.ac.jp" + "pub/GNU/xemacs/beta/experimental/packages") + ("Japan Pre-Releases (jp.xemacs.org)" "ftp.jp.xemacs.org" + "pub/GNU/xemacs/beta/experimental/packages") + ("Japan Pre-Releases (sut.ac.jp)" "sunsite.sut.ac.jp" + "pub/archives/packages/xemacs/xemacs-21.5/experimental/packages") + ("New Zealand Pre-Releases (nz.xemacs.org)" "ftp.nz.xemacs.org" "mirror/ftp.xemacs.org/packages") + ("Norway Pre-Releases (no.xemacs.org)" "ftp.no.xemacs.org" + "pub/xemacs/beta/experimental/packages") + ("Poland Pre-Releases (pl.xemacs.org)" "ftp.pl.xemacs.org" + "pub/unix/editors/xemacs/beta/experimental/packages") + ("Russia Pre-Releases (ru.xemacs.org)" "ftp.ru.xemacs.org" + "pub/xemacs/beta/experimental/packages") + ("Saudi Arabia Pre-Releases (sa.xemacs.org)" "ftp.sa.xemacs.org" + "pub/mirrors/ftp.xemacs.org/xemacs/xemacs-21.5/experimental/packages") + ("Slovakia Pre-Releases (sk.xemacs.org)" "ftp.sk.xemacs.org" + "pub/mirrors/xemacs/beta/experimental/packages") + ("South Africa Pre-Releases (za.xemacs.org)" "ftp.za.xemacs.org" + "mirrorsites/ftp.xemacs.org/beta/experimental/packages") + ("Sweden Pre-Releases (se.xemacs.org)" "ftp.se.xemacs.org" + "pub/gnu/xemacs/beta/experimental/packages") + ("Switzerland Pre-Releases (ch.xemacs.org)" "ftp.ch.xemacs.org" + "mirror/xemacs/beta/experimental/packages") + ("UK Pre-Releases (uk.xemacs.org)" "ftp.uk.xemacs.org" + "sites/ftp.xemacs.org/pub/xemacs/beta/experimental/packages") + ("US Pre-Releases (ibiblio.org)" "ibiblio.org" + "pub/packages/editors/xemacs/beta/experimental/packages") + ("US Pre-Releases (stealth.net)" "ftp.stealth.net" + "pub/mirrors/ftp.xemacs.org/pub/xemacs/beta/experimental/packages") + ("US Pre-Releases (unc.edu)" "metalab.unc.edu" + "pub/packages/editors/xemacs/beta/experimental/packages") + ("US Pre-Releases (us.xemacs.org)" "ftp.us.xemacs.org" + "pub/xemacs/beta/experimental/packages") + ("US Pre-Releases (utk.edu)" "ftp.sunsite.utk.edu" + "pub/xemacs/beta/experimental/packages")) + "*List of remote sites available for downloading \"Pre-Release\" packages. +List format is '(site-description site-name directory-on-site). +SITE-DESCRIPTION is a textual description of the site. SITE-NAME +is the internet address of the download site. DIRECTORY-ON-SITE +is the directory on the site in which packages may be found. +This variable is used to initialize `package-get-remote', the +variable actually used to specify package download sites." + :tag "Pre-Release Package download sites" + :type '(repeat (list (string :tag "Name") host-name directory)) + :group 'package-get) + +;;;###autoload +(defcustom package-get-site-release-download-sites + nil + "*List of remote sites available for downloading \"Site Release\" packages. +List format is '(site-description site-name directory-on-site). +SITE-DESCRIPTION is a textual description of the site. SITE-NAME +is the internet address of the download site. DIRECTORY-ON-SITE +is the directory on the site in which packages may be found. +This variable is used to initialize `package-get-remote', the +variable actually used to specify package download sites." + :tag "Site Release Package download sites" + :type '(repeat (list (string :tag "Name") host-name directory)) + :group 'package-get) + (defcustom package-get-remove-copy t "*After copying and installing a package, if this is t, then remove the copy. Otherwise, keep it around." @@ -279,10 +382,44 @@ :type 'boolean :group 'package-get) -(defcustom package-get-require-signed-base-updates nil - "*If set to a non-nil value, require explicit user confirmation for updates -to the package-get database which cannot have their signature verified via PGP. -When nil, no PGP verification will be done." +(defun package-get-pgp-available-p () + "Checks the availability of Mailcrypt and PGP executable. + +Returns t if both are found, nil otherwise. As a side effect, set +`mc-default-scheme' dependent on the PGP executable found." + (let (result) + (when (featurep 'mailcrypt-autoloads) + (autoload 'mc-setversion "mc-setversion")) + (when-fboundp 'mc-setversion + (cond ((locate-file "gpg" exec-path + '("" ".btm" ".bat" ".cmd" ".exe" ".com") + 'executable) + (mc-setversion "gpg") + (setq result t)) + ((locate-file "pgpe" exec-path + '("" ".btm" ".bat" ".cmd" ".exe" ".com") + 'executable) + (mc-setversion "5.0") + (setq result t)) + ((locate-file "pgp" exec-path + '("" ".btm" ".bat" ".cmd" ".exe" ".com") + 'executable) + (mc-setversion "2.6") + (setq result t)))) + (if result + result + nil))) + +(defcustom package-get-require-signed-base-updates (package-get-pgp-available-p) + "*If non-nil, try to verify the package index database via PGP. + +If nil, no PGP verification is done. If the package index database +entries are not PGP signed and this variable is non-nil, require user +confirmation to continue with the package-get procedure. + +The default for this variable is the return value of +`package-get-pgp-available-p', non-nil if both the \"Mailcrypt\" +package and a suitable PGP executable are available, nil otherwise." :type 'boolean :group 'package-get) @@ -295,24 +432,6 @@ (defvar package-get-was-current nil "Non-nil we did our best to fetch a current database.") - -;Shouldn't this be in package-ui? -;;;###autoload -(defun package-get-download-menu () - "Build the `Add Download Site' menu." - (mapcar (lambda (site) - (vector (car site) - `(if (member (quote ,(cdr site)) - package-get-remote) - (setq package-get-remote - (delete (quote ,(cdr site)) - package-get-remote)) - (package-ui-add-site (quote ,(cdr site)))) - :style 'toggle - :selected `(member (quote ,(cdr site)) - package-get-remote))) - package-get-download-sites)) - ;;;###autoload (defun package-get-require-base (&optional force-current) "Require that a package-get database has been loaded. @@ -330,7 +449,8 @@ (package-get-update-base nil force-current)) (if (or (not (boundp 'package-get-base)) (not package-get-base)) - (error "Package-get database not loaded") + (error 'void-variable + "Package-get database not loaded") (setq package-get-was-current force-current))) (defconst package-get-pgp-signed-begin-line "^-----BEGIN PGP SIGNED MESSAGE-----" @@ -356,15 +476,14 @@ If NO-REMOTE is non-nil never search remote locations." (if (file-name-absolute-p file) file - (let ((entries package-get-remote) + (let ((site package-get-remote) (expanded nil)) - (while entries - (unless (and no-remote (caar entries)) - (let ((expn (package-get-remote-filename (car entries) file))) + (when site + (unless (and no-remote (caar (list site))) + (let ((expn (package-get-remote-filename (car (list site)) file))) (if (and expn (file-exists-p expn)) - (setq entries nil - expanded expn)))) - (setq entries (cdr entries))) + (setq site nil + expanded expn))))) (or expanded (and (not nil-if-not-found) file))))) @@ -376,7 +495,8 @@ (if (file-exists-p package-get-user-index-filename) package-get-user-index-filename) (locate-data-file package-get-base-filename) - (error "Can't locate a package index file."))) + (error 'search-failed + "Can't locate a package index file."))) (defun package-get-maybe-save-index (filename) "Offer to save the current buffer as the local package index file, @@ -394,7 +514,6 @@ (let ((coding-system-for-write 'binary)) (write-file location))))))) - ;;;###autoload (defun package-get-update-base (&optional db-file force-current) "Update the package-get database file with entries from DB-FILE. @@ -410,9 +529,11 @@ (package-get-locate-index-file (not force-current))))) (if (not (file-exists-p db-file)) - (error "Package-get database file `%s' does not exist" db-file)) + (error 'file-error + (format "Package-get database file `%s' does not exist" db-file))) (if (not (file-readable-p db-file)) - (error "Package-get database file `%s' not readable" db-file)) + (error 'file-error + (format "Package-get database file `%s' not readable" db-file))) (let ((buf (get-buffer-create "*package database*"))) (unwind-protect (save-excursion @@ -431,59 +552,45 @@ used interactively, for example from a mail or news buffer." (interactive) (setq buf (or buf (current-buffer))) - (let (content-beg content-end ;beg end - ) + (let (content-beg content-end) (save-excursion (set-buffer buf) (goto-char (point-min)) (setq content-beg (point)) (setq content-end (save-excursion (goto-char (point-max)) (point))) (when (re-search-forward package-get-pgp-signed-begin-line nil t) - ;(setq beg (match-beginning 0)) (setq content-beg (match-end 0))) (when (re-search-forward package-get-pgp-signature-begin-line nil t) (setq content-end (match-beginning 0)) (setq package-entries-are-signed t)) - (when (re-search-forward package-get-pgp-signature-end-line nil t) - ;(setq end (point)) - ) + (re-search-forward package-get-pgp-signature-end-line nil t) (setq package-get-continue-update-base t) - (if package-get-require-signed-base-updates - (if package-entries-are-signed - (if (featurep 'mailcrypt-autoloads) - (progn - (setq package-get-continue-update-base nil) - (autoload 'mc-setversion "mc-setversion") - (with-fboundp 'mc-setversion - (cond ((locate-file "gpg" exec-path - '("" ".btm" ".bat" ".cmd" ".exe" - ".com") 'executable) - (mc-setversion "gpg")) - ((locate-file "pgpe" exec-path - '("" ".btm" ".bat" ".cmd" ".exe" - ".com") 'executable) - (mc-setversion "5.0")) - ((locate-file "pgp" exec-path - '("" ".btm" ".bat" ".cmd" ".exe" - ".com") 'executable) - (mc-setversion "2.6")) - (t - (error 'search-failed - "Can't find a suitable PGP executable")))) - (autoload 'mc-verify "mc-toplev") - (declare-fboundp (mc-verify)) - (setq package-get-continue-update-base t)) - (error 'unimplemented "`mailcrypt' package unavailable")) - (if (yes-or-no-p - "Package Index is not PGP signed. Continue anyway? ") - (setq package-get-continue-update-base t) - (error "Package database not updated") - (setq package-get-continue-update-base nil)))) + ;; This is a little overkill because the default value of + ;; `package-get-require-signed-base-updates' is the return of + ;; `package-get-pgp-available-p', but we have to allow for + ;; someone explicitly setting + ;; `package-get-require-signed-base-updates' to t. --SY + (when (and package-get-require-signed-base-updates + (package-get-pgp-available-p)) + (if package-entries-are-signed + (let (good-sig) + (setq package-get-continue-update-base nil) + (autoload 'mc-verify "mc-toplev") + (when (declare-fboundp (mc-verify)) + (setq good-sig t)) + (if good-sig + (setq package-get-continue-update-base t) + (error 'process-error + "GnuPG error. Package database not updated"))) + (if (yes-or-no-p + "Package Index is not PGP signed. Continue anyway? ") + (setq package-get-continue-update-base t) + (setq package-get-continue-update-base nil) + (warn "Package database not updated")))) ;; ToDo: We should call package-get-maybe-save-index on the region - (if package-get-continue-update-base - (progn - (package-get-update-base-entries content-beg content-end) - (message "Updated package-get database")))))) + (when package-get-continue-update-base + (package-get-update-base-entries content-beg content-end) + (message "Updated package database"))))) (defun package-get-update-base-entries (start end) "Update the package-get database with the entries found between @@ -491,7 +598,8 @@ (save-excursion (goto-char start) (if (not (re-search-forward "^(package-get-update-base-entry" nil t)) - (error "Buffer does not contain package-get database entries")) + (error 'search-failed + "Buffer does not contain package-get database entries")) (beginning-of-line) (let ((count 0)) (while (and (< (point) end) @@ -500,7 +608,8 @@ (let ((entry (read (current-buffer)))) (if (or (not (consp entry)) (not (eq (car entry) 'package-get-update-base-entry))) - (error "Invalid package-get database entry found")) + (error 'syntax-error + "Invalid package-get database entry found")) (package-get-update-base-entry (car (cdr (car (cdr entry))))) (setq count (1+ count)))) @@ -563,12 +672,10 @@ 'version)) (while (string= (setq version (read-string "Version: " default-version)) - "") - ) + "")) (if package-symbol (list package-symbol version) - (list package version)) - ) + (list package version))) (if package-symbol (list package-symbol) (list package)))))) @@ -590,8 +697,7 @@ (catch 'exit (mapcar (lambda (pkg) (if (not (package-get (car pkg) nil 'never)) - (throw 'exit nil) ;; Bail out if error detected - )) + (throw 'exit nil))) ;; Bail out if error detected packages-package-list)) (package-net-update-installed-db)) @@ -611,8 +717,7 @@ package)) (this-package (package-get-info-version the-package version)) - (this-requires (package-get-info-prop this-package 'requires)) - ) + (this-requires (package-get-info-prop this-package 'requires))) (catch 'exit (setq version (package-get-info-prop this-package 'version)) (unless (package-get-installedp package version) @@ -635,18 +740,16 @@ (reqd-version (cadr reqd-package)) (reqd-name (car reqd-package))) (if (null reqd-name) - (error "Unable to find a provider for %s" - (car this-requires))) + (error 'search-failed + (format "Unable to find a provider for %s" + (car this-requires)))) (if (not (setq fetched-packages (package-get-all reqd-name reqd-version fetched-packages install-dir))) - (throw 'exit nil))) - ) - (setq this-requires (cdr this-requires))) - ) - fetched-packages - )) + (throw 'exit nil)))) + (setq this-requires (cdr this-requires)))) + fetched-packages)) ;;;###autoload (defun package-get-dependencies (packages) @@ -670,7 +773,8 @@ (let* ((reqd-package (package-get-package-provider reqd)) (reqd-name (car reqd-package))) (if (null reqd-name) - (error "Unable to find a provider for %s" reqd)) + (error 'search-failed + (format "Unable to find a provider for %s" reqd))) reqd-name)) this-requires) dependencies)) @@ -705,20 +809,79 @@ (progn ;; Add lispdir to load-path if it doesn't already exist. ;; NOTE: this does not take symlinks, etc., into account. - (if (let ( (dirs load-path) ) + (if (let ((dirs load-path)) (catch 'done (while dirs (if (string-equal (car dirs) lispdir) (throw 'done nil)) - (setq dirs (cdr dirs)) - ) + (setq dirs (cdr dirs))) t)) (setq load-path (cons lispdir load-path))) (if (not (package-get-load-package-file lispdir "auto-autoloads")) (package-get-load-package-file lispdir "_pkg")) t) - nil) - )) + nil))) + +;;;###autoload +(defun package-get-info (package information &optional arg remote) + "Get information about a package. + +Quite similar to `package-get-info-prop', but can retrieve a lot more +information. + +Argument PACKAGE is the name of an XEmacs package (a symbol). It must +be a valid package, ie, a member of `package-get-base'. + +Argument INFORMATION is a symbol that can be any one of: + + standards-version Package system version (not used). + version Version of the XEmacs package. + author-version The upstream version of the package. + date The date the package was last modified. + build-date The date the package was last built. + maintainer The maintainer of the package. + distribution Will always be \"xemacs\" (not used). + priority \"low\", \"medium\", or \"high\" (not used). + category Either \"standard\", \"mule\", or \"unsupported\".. + dump Is the package dumped (not used). + description A description of the package. + filename The filename of the binary tarball of the package. + md5sum The md5sum of filename. + size The size in bytes of filename. + provides A list of symbols that this package provides. + requires A list of packages that this package requires. + type Can be either \"regular\" or \"single-file\". + +If optional argument ARG is non-nil insert INFORMATION into current +buffer at point. This is very useful for doing things like inserting +a maintainer's email address into a mail buffer. + +If optional argument REMOTE is non-nil use a package list from a +remote site. For this to work `package-get-remote' must be non-nil. + +If this function is called interactively it will display INFORMATION +in the minibuffer." + (interactive "SPackage: \nSInfo: \nP") + (if remote + (package-get-require-base t) + (package-get-require-base nil)) + (let ((all-pkgs package-get-base) + info) + (loop until (equal package (caar all-pkgs)) + do (setq all-pkgs (cdr all-pkgs)) + do (if (not all-pkgs) + (error 'invalid-argument + (format "%s is not a valid package" package)))) + (setq info (plist-get (cadar all-pkgs) information)) + (if (interactive-p) + (if arg + (insert (format "%s" info)) + (if (package-get-key package :version) + (message "%s" info) + (message "%s (Package: %s is not installed)" info package))) + (if arg + (insert (format "%s" info)) + info)))) ;;;###autoload (defun package-get (package &optional version conflict install-dir) @@ -733,8 +896,7 @@ The value of `package-get-base' is used to determine what files should be retrieved. The value of `package-get-remote' is used to determine -where a package should be retrieved from. The sites are tried in -order so one is better off listing easily reached sites first. +where a package should be retrieved from. Once the package is retrieved, its md5 checksum is computed. If that sum does not match that stored in `package-get-base' for this version @@ -751,23 +913,27 @@ package) version)) (latest (package-get-info-prop this-package 'version)) (installed (package-get-key package :version)) - (this-requires (package-get-info-prop this-package 'requires)) (found nil) - (search-dirs package-get-remote) + (search-dir package-get-remote) (base-filename (package-get-info-prop this-package 'filename)) (package-status t) filenames full-package-filename) + (if (and (equal (package-get-info package 'category) "mule") + (not (featurep 'mule))) + (error 'invalid-state + "Mule packages can't be installed with a non-Mule XEmacs")) (if (null this-package) (if package-get-remote - (error "Couldn't find package %s with version %s" - package version) - (error "No download sites or local package locations specified."))) + (error 'search-failed + (format "Couldn't find package %s with version %s" + package version)) + (error 'syntax-error + "No download site or local package location specified."))) (if (null base-filename) - (error "No filename associated with package %s, version %s" - package version)) - (setq install-dir - (package-admin-get-install-dir package install-dir - (or (eq package 'mule-base) (memq 'mule-base this-requires)))) + (error 'syntax-error + (format "No filename associated with package %s, version %s" + package version))) + (setq install-dir (package-admin-get-install-dir package install-dir)) ;; If they asked for the latest using version=nil, don't get an older ;; version than we already have. @@ -800,15 +966,12 @@ ;; and copy it into the staging directory. Then validate ;; the checksum. Finally, install the package. (catch 'done - (let (search-filenames current-dir-entry host dir current-filename - dest-filename) + (let (search-filenames host dir current-filename dest-filename) ;; In each search directory ... - (while search-dirs - (setq current-dir-entry (car search-dirs) - host (car current-dir-entry) - dir (car (cdr current-dir-entry)) - search-filenames filenames - ) + (when search-dir + (setq host (car search-dir) + dir (car (cdr search-dir)) + search-filenames filenames) ;; Look for one of the possible package filenames ... (while search-filenames @@ -816,56 +979,45 @@ dest-filename (package-get-staging-dir current-filename)) (cond ;; No host means look on the current system. - ( (null host) - (setq full-package-filename - (substitute-in-file-name - (expand-file-name current-filename - (file-name-as-directory dir)))) - ) + ((null host) + (setq full-package-filename + (substitute-in-file-name + (expand-file-name current-filename + (file-name-as-directory dir))))) ;; If it's already on the disk locally, and the size is - ;; greater than zero ... - ( (and (file-exists-p dest-filename) - (let (attrs) - ;; file-attributes could return -1 for LARGE files, - ;; but, hopefully, packages won't be that large. - (and (setq attrs (file-attributes dest-filename)) - (> (nth 7 attrs) 0)))) - (setq full-package-filename dest-filename) - ) + ;; correct + ((and (file-exists-p dest-filename) + (eq (nth 7 (file-attributes dest-filename)) + (package-get-info package 'size))) + (setq full-package-filename dest-filename)) ;; If the file exists on the remote system ... - ( (file-exists-p (package-get-remote-filename - current-dir-entry current-filename)) - ;; Get it - (setq full-package-filename dest-filename) - (message "Retrieving package `%s' ..." - current-filename) - (sit-for 0) - (copy-file (package-get-remote-filename current-dir-entry - current-filename) - full-package-filename t) - ) - ) + ((file-exists-p (package-get-remote-filename + search-dir current-filename)) + ;; Get it + (setq full-package-filename dest-filename) + (message "Retrieving package `%s' ..." + current-filename) + (sit-for 0) + (copy-file (package-get-remote-filename search-dir + current-filename) + full-package-filename t))) ;; If we found it, we're done. (if (and full-package-filename (file-exists-p full-package-filename)) (throw 'done nil)) ;; Didn't find it. Try the next possible filename. - (setq search-filenames (cdr search-filenames)) - ) - ;; Try looking in the next possible directory ... - (setq search-dirs (cdr search-dirs)) - ) - )) + (setq search-filenames (cdr search-filenames)))))) (if (or (not full-package-filename) (not (file-exists-p full-package-filename))) (if package-get-remote - (error "Unable to find file %s" base-filename) - (error - "No download sites or local package locations specified."))) + (error 'search-failed + (format "Unable to find file %s" base-filename)) + (error 'syntax-error + "No download sites or local package locations specified."))) ;; Validate the md5 checksum ;; Doing it with XEmacs removes the need for an external md5 program (message "Validating checksum for `%s'..." package) (sit-for 0) @@ -874,7 +1026,11 @@ (if (not (string= (md5 (current-buffer)) (package-get-info-prop this-package 'md5sum))) - (error "Package %s does not match md5 checksum" base-filename))) + (progn + (delete-file full-package-filename) + (error 'process-error + (format "Package %s does not match md5 checksum %s has been deleted" + base-filename full-package-filename))))) (package-admin-delete-binary-package package install-dir) @@ -892,30 +1048,25 @@ (progn (run-hook-with-args 'package-install-hook package install-dir) (message "Added package `%s'" package) - (sit-for 0) - ) + (sit-for 0)) (progn ;; display message only if there isn't already one. (if (not (current-message)) (progn (message "Added package `%s' (errors occurred)" package) - (sit-for 0) - )) + (sit-for 0))) (if package-status - (setq package-status 'errors)) - )) - ) + (setq package-status 'errors))))) (message "Installation of package %s failed." base-filename) (sit-for 0) (switch-to-buffer package-admin-temp-buffer) - (setq package-status nil) - )) + (delete-file full-package-filename) + (setq package-status nil))) (setq found t)) (if (and found package-get-remove-copy) (delete-file full-package-filename)) - package-status - ))) + package-status))) (defun package-get-info-find-package (which name) "Look in WHICH for the package called NAME and return all the info @@ -966,13 +1117,6 @@ (package-get-info-version (package-get-info-find-package package-list package) version) property)) -(defun package-get-set-version-prop (package-list package version - property value) - "A utility to make it easier to add a VALUE for a specific PROPERTY - in this VERSION of a specific PACKAGE kept in the PACKAGE-LIST. -Returns the modified PACKAGE-LIST. Any missing fields are created." - ) - (defun package-get-staging-dir (filename) "Return a good place to stash FILENAME when it is retrieved. Use `package-get-dir' for directory to store stuff. @@ -1010,7 +1154,6 @@ (concat dir "/")) filename)))) - (defun package-get-installedp (package version) "Determine if PACKAGE with VERSION has already been installed. I'm not sure if I want to do this by searching directories or checking @@ -1019,7 +1162,9 @@ (equal (plist-get (package-get-info-find-package packages-package-list package) ':version) - (if (floatp version) version (string-to-number version)))) + (if (floatp version) + version + (string-to-number version)))) ;;;###autoload (defun package-get-package-provider (sym &optional force-current) @@ -1065,7 +1210,6 @@ packages-package-list (intern (substring (symbol-name pkg) 0 (match-beginning 0)))) t))) - (provide 'package-get) ;;; package-get.el ends here Index: lisp/package-info.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/package-info.el,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- lisp/package-info.el 12 Apr 2001 18:21:33 -0000 1.8 +++ lisp/package-info.el 14 Apr 2003 03:40:27 -0000 1.9 @@ -94,7 +94,8 @@ maintainer -- The package maintainer. category -- The build category." (unless noninteractive - (error "`batch-update-package-info' is to be used only with -batch")) + (error 'invalid-operation + "`batch-update-package-info' is to be used only with -batch")) (let ((version (nth 0 command-line-args-left)) (filename (nth 1 command-line-args-left)) (requires (nth 2 command-line-args-left)) Index: lisp/package-net.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/package-net.el,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- lisp/package-net.el 20 Dec 2001 05:49:31 -0000 1.4 +++ lisp/package-net.el 14 Apr 2003 03:40:27 -0000 1.5 @@ -136,7 +136,8 @@ (defun package-net-batch-generate-bin-ini () "Convert the package index to ini file format." (unless noninteractive - (error "`package-net-batch-generate-bin-ini' is to be used only with -batch")) + (error 'invalid-operation + "`package-net-batch-generate-bin-ini' is to be used only with -batch")) (package-net-generate-bin-ini package-net-setup-version)) ;;;###autoload Index: lisp/package-ui.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/package-ui.el,v retrieving revision 1.15 retrieving revision 1.19 diff -u -r1.15 -r1.19 --- lisp/package-ui.el 25 May 2002 01:55:30 -0000 1.15 +++ lisp/package-ui.el 14 Apr 2003 03:40:27 -0000 1.19 @@ -80,11 +80,10 @@ :group 'pui :type 'face) - - - -(defvar pui-info-buffer "*Packages*" - "Buffer to use for displaying package information.") +(defcustom pui-info-buffer "*Packages*" + "*Buffer to use for displaying package information." + :group 'pui + :type 'string) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of user-changeable variables. @@ -137,46 +136,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Configuration routines -(defun pui-directory-exists (dir) - "Check to see if DIR exists in `package-get-remote'." - (let (found) - (mapcar #'(lambda (item) - (if (and (null (car item)) - (string-equal (file-name-as-directory (car (cdr item))) - (file-name-as-directory dir))) - (setq found t))) - package-get-remote) - found - )) - -(defun pui-package-dir-list (buffer) - "In BUFFER, format the list of package binary paths." - (let ( (count 1) paths sys dir) - (set-buffer buffer) - (buffer-disable-undo buffer) - (erase-buffer buffer) - (insert "Existing package binary paths:\n\n") - (setq paths package-get-remote) - (while paths - (setq sys (car (car paths)) - dir (car (cdr (car paths)))) - (insert (format "%2s. " count)) - (if (null sys) - (insert dir) - (insert sys ":" dir)) - (insert "\n") - (setq count (1+ count)) - (setq paths (cdr paths)) - ) - (insert "\nThese are the places that will be searched for package binaries.\n") - (goto-char (point-min)) - )) - ;;;###autoload (defun package-ui-add-site (site) "Add site to package-get-remote and possibly offer to update package list." (let ((had-none (null package-get-remote))) - (push site package-get-remote) + (setq package-get-remote site) (when (and had-none package-get-was-current (y-or-n-p "Update Package list?")) (setq package-get-was-current nil) @@ -185,39 +149,64 @@ (save-window-excursion (pui-list-packages)))) (set-menubar-dirty-flag))) - ;;;###autoload -(defun pui-add-install-directory (dir) - "Add a new package binary directory to the head of `package-get-remote'. +(defun package-ui-download-menu () + "Build the `Add Download Site' menu." + (mapcar (lambda (site) + (vector (car site) + `(if (equal package-get-remote (quote ,(cdr site))) + (setq package-get-remote nil) + (package-ui-add-site (quote ,(cdr site)))) + ;; I've used radio buttons so that only a single + ;; site can be selected, but they are in fact + ;; toggles. SY. + :style 'radio + :selected `(equal package-get-remote (quote ,(cdr site))))) + package-get-download-sites)) + +;;;###autoload +(defun package-ui-pre-release-download-menu () + "Build the 'Pre-Release Download Sites' menu." + (mapcar (lambda (site) + (vector (car site) + `(if (equal package-get-remote (quote ,(cdr site))) + (setq package-get-remote nil) + (package-ui-add-site (quote ,(cdr site)))) + ;; I've used radio buttons so that only a single + ;; site can be selected, but they are in fact + ;; toggles. SY. + :style 'radio + :selected `(equal package-get-remote (quote ,(cdr site))))) + package-get-pre-release-download-sites)) + +;;;###autoload +(defun package-ui-site-release-download-menu () + "Build the 'Site Release Download Sites' menu." + (mapcar (lambda (site) + (vector (car site) + `(if (equal package-get-remote (quote ,(cdr site))) + (setq package-get-remote nil) + (package-ui-add-site (quote ,(cdr site)))) + ;; I've used radio buttons so that only a single + ;; site can be selected, but they are in fact + ;; toggles. SY. + :style 'radio + :selected `(equal package-get-remote (quote ,(cdr site))))) + package-get-site-release-download-sites)) + +;;;###autoload +(defun pui-set-local-package-get-directory (dir) + "Set a new package binary directory in `package-get-remote'. Note that no provision is made for saving any changes made by this function. It exists mainly as a convenience for one-time package installations from disk." - (interactive (let ( (tmpbuf (get-buffer-create - "*Existing Package Binary Paths*")) - dir) - (save-window-excursion - (save-excursion - (unwind-protect - (progn - (pui-package-dir-list tmpbuf) - (display-buffer tmpbuf) - (setq dir (read-directory-name - "New package binary directory to add? " - nil nil t)) - ) - (kill-buffer tmpbuf) - ))) - (list dir) - )) - (progn - (if (not (pui-directory-exists dir)) - (progn - (setq package-get-remote (cons (list nil dir) package-get-remote)) - (message "Package directory \"%s\" added." dir) - ) - (message "Directory \"%s\" already exists in `package-get-remote'." dir)) - )) + (interactive) + (let ((dir (read-directory-name + "New package binary directory to add? " + nil nil t))) + (setq package-get-remote (list nil dir)) + (message "Package directory \"%s\" added." dir))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Package list/installer routines @@ -238,8 +227,7 @@ version)) (list " " pui-up-to-date-package-face) (list "*" pui-outdated-package-face))) - (list "-" pui-uninstalled-package-face)) - )) + (list "-" pui-uninstalled-package-face)))) (defun pui-update-package-display (extent &optional pkg-sym version) "Update the package status for EXTENT. @@ -272,9 +260,7 @@ (goto-char (extent-start-position extent)) (delete-char 1) (insert sym-char) - (set-buffer-modified-p nil) - ) - )) + (set-buffer-modified-p nil)))) (defun pui-toggle-package (extent) (let (pkg-sym) @@ -286,8 +272,7 @@ (cons pkg-sym pui-selected-packages)) (setq pui-deleted-packages (delete pkg-sym pui-deleted-packages))) - (pui-update-package-display extent pkg-sym) - )) + (pui-update-package-display extent pkg-sym))) (defun pui-toggle-package-key () "Select/unselect package for installation, using the keyboard." @@ -296,10 +281,9 @@ (if (setq extent (extent-at (point) (current-buffer) 'pui)) (progn (pui-toggle-package extent) - (forward-line 1) - ) - (error "No package under cursor!")) - )) + (forward-line 1)) + (error 'invalid-operation + "No package under cursor!")))) (defun pui-toggle-package-delete (extent) (let (pkg-sym) @@ -311,8 +295,7 @@ (cons pkg-sym pui-deleted-packages)) (setq pui-selected-packages (delete pkg-sym pui-selected-packages))) - (pui-update-package-display extent pkg-sym) - )) + (pui-update-package-display extent pkg-sym))) (defun pui-toggle-package-delete-key () @@ -322,10 +305,9 @@ (if (setq extent (extent-at (point) (current-buffer) 'pui)) (progn (pui-toggle-package-delete extent) - (forward-line 1) - ) - (error "No package under cursor!")) - )) + (forward-line 1)) + (error 'invalid-operation + "No package under cursor!")))) (defun pui-current-package () (let ((extent (extent-at (point) (current-buffer) 'pui))) @@ -335,25 +317,23 @@ (defun pui-toggle-package-event (event) "Select/unselect package for installation, using the mouse." (interactive "e") - (let* ( (ep (event-point event)) - (buffer (window-buffer (event-window event))) - (extent (extent-at ep buffer 'pui-package)) - ) - (pui-toggle-package extent) - )) + (let* ((ep (event-point event)) + (buffer (window-buffer (event-window event))) + (extent (extent-at ep buffer 'pui-package))) + (pui-toggle-package extent))) (defun pui-toggle-verbosity-redisplay () "Toggle verbose package info." (interactive) (progn (setq pui-list-verbose (not pui-list-verbose)) - (pui-list-packages) - )) + (pui-list-packages))) (defun pui-install-selected-packages () "Install selected packages." (interactive) - (let ( (tmpbuf "*Packages-To-Remove*") do-delete) + (let ((tmpbuf "*Packages-To-Remove*") + do-delete) (when pui-deleted-packages (save-window-excursion (with-output-to-temp-buffer tmpbuf @@ -362,8 +342,7 @@ #'string<) :activate-callback nil :help-string "Packages selected for removal:\n" - :completion-string t - )) + :completion-string t)) (setq tmpbuf (get-buffer-create tmpbuf)) (display-buffer tmpbuf) (setq do-delete (yes-or-no-p "Remove these packages? ")) @@ -372,11 +351,12 @@ (message "Deleting selected packages ...") (sit-for 0) (mapcar (lambda (pkg) (package-admin-delete-binary-package - pkg (package-admin-get-install-dir pkg nil))) + pkg (package-admin-get-install-dir pkg))) (nreverse pui-deleted-packages)) (message "Packages deleted")))) - (let ( (tmpbuf "*Packages-To-Install*") do-install) + (let ((tmpbuf "*Packages-To-Install*") + do-install) (if pui-selected-packages (progn ;; Don't change window config when asking the user if he really @@ -390,21 +370,18 @@ (sort (mapcar #'symbol-name pui-selected-packages) #'string<) :activate-callback nil :help-string "Packages selected for installation:\n" - :completion-string t - )) + :completion-string t)) (setq tmpbuf (get-buffer-create tmpbuf)) (display-buffer tmpbuf) (setq do-install (y-or-n-p "Install these packages? ")) - (kill-buffer tmpbuf) - ) + (kill-buffer tmpbuf)) (if do-install (progn (save-excursion ;; Clear old temp buffer history (set-buffer (get-buffer-create package-admin-temp-buffer)) (buffer-disable-undo package-admin-temp-buffer) - (erase-buffer package-admin-temp-buffer) - ) + (erase-buffer package-admin-temp-buffer)) (message "Installing selected packages ...") (sit-for 0) (if (catch 'done (mapcar (lambda (pkg) @@ -415,18 +392,14 @@ t) (progn (pui-list-packages) - (message "Packages installed") - )) - ) - (clear-message) - ) - ) + (message "Packages installed")))) + (clear-message))) (if pui-deleted-packages (pui-list-packages) - (error "No packages have been selected!"))) + (error 'invalid-operation + "No packages have been selected!"))) ;; sync with windows type systems - (package-net-update-installed-db) - )) + (package-net-update-installed-db))) (defun pui-add-required-packages () "Select packages required by those already selected for installation." @@ -482,7 +455,8 @@ nil nil nil nil nil 'pui) (message "added dependencies")) (clear-message))) - (error "No packages have been selected!")))) + (error 'invalid-operation + "No packages have been selected!")))) (defun pui-help-echo (extent &optional force-update) "Display additional package info in the modeline. @@ -490,8 +464,7 @@ attached to the extent as properties)." (let (pkg-sym info inst-ver auth-ver date maintainer balloon req) (if (or force-update (not (current-message)) - (string-match ".*: .*: " (current-message)) - ) + (string-match ".*: .*: " (current-message))) (progn (setq pkg-sym (extent-property extent 'pui-package) info (extent-property extent 'pui-info) @@ -520,9 +493,7 @@ "Inst V: %.2f Auth V: %s Maint: %s" inst-ver auth-ver maintainer) (format "%.2f : %s : %s" - inst-ver auth-ver maintainer)) - )) - )) + inst-ver auth-ver maintainer)))))) (defun pui-display-info (&optional no-error event) "Display additional package info in the modeline. @@ -535,8 +506,8 @@ (message (pui-help-echo extent t)) (if no-error (clear-message nil) - (error "No package under cursor!"))) - ))) + (error 'invalid-operation + "No package under cursor!")))))) (defvar pui-menu '("Packages" @@ -584,7 +555,8 @@ `\\[pui-toggle-verbosity-redisplay]' to toggle between a verbose and non-verbose display. `\\[pui-quit]' to kill this buffer. " - (error "You cannot enter this mode directly. Use `pui-list-packages'")) + (error 'invalid-operation + "You cannot enter this mode directly. Use `pui-list-packages'")) (put 'list-packages-mode 'mode-class 'special) @@ -597,9 +569,9 @@ select packages for installation via the keyboard or mouse." (interactive) (package-get-require-base t) - (let ( (outbuf (get-buffer-create pui-info-buffer)) - (sep-string "===============================================================================\n") - start ) + (let ((outbuf (get-buffer-create pui-info-buffer)) + (sep-string "===============================================================================\n") + start) (message "Creating package list ...") (sit-for 0) (set-buffer outbuf) (setq buffer-read-only nil) @@ -643,27 +615,21 @@ (progn (setq current-vers (package-get-key pkg-sym :version)) (cond - ( (not current-vers) - (setq current-vers "-----") ) - ( (stringp current-vers) - (setq current-vers - (format "%.2f" - (string-to-number current-vers))) ) - ( (numberp current-vers) - (setq current-vers (format "%.2f" current-vers)) ) - ) + ((not current-vers) + (setq current-vers "-----")) + ((stringp current-vers) + (setq current-vers + (format "%.2f" + (string-to-number current-vers)))) + ((numberp current-vers) + (setq current-vers (format "%.2f" current-vers)))) (insert (format "%s %-15s %-5.2f %-5s %s\n" (car disp) pkg-sym (if (stringp version) (string-to-number version) version) - current-vers desc)) - ;; (insert - ;; (format "\t\t %-12s %s\n" - ;; (package-get-info-prop info 'author-version) - ;; (package-get-info-prop info 'date))) - ) + current-vers desc))) (insert (format "%s %-15s %-5s %s\n" (car disp) pkg-sym version desc))) @@ -681,8 +647,7 @@ (set-extent-property extent 'pui-package pkg-sym) (set-extent-property extent 'pui-info info) (set-extent-property extent 'help-echo 'pui-help-echo) - (set-extent-property extent 'keymap pui-package-keymap) - )) + (set-extent-property extent 'keymap pui-package-keymap))) (sort (copy-sequence package-get-base) #'(lambda (a b) (string< (symbol-name (car a)) @@ -700,9 +665,7 @@ (set-buffer-menubar current-menubar) (add-submenu '() pui-menu) (setq mode-popup-menu pui-menu)) - (clear-message) - ;; (message (substitute-command-keys "Press `\\[pui-help]' for help.")) - )) + (clear-message))) ;;;###autoload (defalias 'list-packages 'pui-list-packages) Index: lisp/packages.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/packages.el,v retrieving revision 1.45 retrieving revision 1.49 diff -u -r1.45 -r1.49 --- lisp/packages.el 16 Jan 2003 08:59:47 -0000 1.45 +++ lisp/packages.el 14 Apr 2003 03:40:27 -0000 1.49 @@ -1,7 +1,7 @@ ;;; packages.el --- Low level support for XEmacs packages ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 2002 Ben Wing. +;; Copyright (C) 2002, 2003 Ben Wing. ;; Author: Steven L Baur ;; Maintainer: Steven L Baur @@ -134,11 +134,13 @@ (defun package-require (name version) (let ((pkg (assq name packages-package-list))) (cond ((null pkg) - (error "Package %s has not been loaded into this XEmacsen" - name)) + (error 'invalid-state + (format "Package %s has not been loaded into this XEmacsen" + name))) ((< (package-get-key name :version) version) - (error "Need version %g of package %s, got version %g" - version name (cdr pkg))) + (error 'search-failed + (format "Need version %g of package %s, got version %g" + version name (cdr pkg)))) (t t)))) (defun package-delete-name (name) @@ -149,41 +151,14 @@ ;; one. (while (setq pkg (assq name packages-package-list)) (setq packages-package-list (delete pkg (copy-alist - packages-package-list))) - ) - )) + packages-package-list)))))) ;;; Build time stuff (defvar autoload-file-name "auto-autoloads.el" "Filename that autoloads are expected to be found in.") -(defvar packages-hardcoded-lisp - '( - ;; Nothing at this time - ) - "Lisp packages that are always dumped with XEmacs. -This includes every package that is loaded directly by a package listed -in dumped-lisp.el and is not itself listed.") - -(defvar packages-useful-lisp - '("bytecomp" - "byte-optimize" - "autoload" - "shadow" - "cl-macs") - "Lisp packages that need early byte compilation.") - -(defvar packages-unbytecompiled-lisp - '("paths.el" - "dumped-lisp.el" - "dumped-pkg-lisp.el" - "version.el" - "very-early-lisp.el") - "Lisp packages that should not be byte compiled.") - - -;; Copied from help.el, could possibly move it to here permanently. +;; Moved from help.el. ;; Unlike the FSF version, our `locate-library' uses the `locate-file' ;; primitive, which should make it lightning-fast. Index: lisp/printer.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/printer.el,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- lisp/printer.el 6 Jul 2002 05:48:15 -0000 1.16 +++ lisp/printer.el 9 Mar 2003 02:27:33 -0000 1.17 @@ -166,7 +166,7 @@ (left-width (- middle-start left-start)) (middle-width (- right-start middle-start)) (right-width (- right-end right-start)) - (winwidth (- (window-width (Print-context-window context)) 1)) + (winwidth (- (window-width (Print-context-window context)) 2)) (spaces1 (max (- (/ (- winwidth middle-width) 2) left-width) 0)) (spaces2 (max (- (- winwidth right-width) (+ left-width spaces1 middle-width)) Index: lisp/replace.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/replace.el,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- lisp/replace.el 24 Oct 2002 14:59:27 -0000 1.8 +++ lisp/replace.el 2 Mar 2003 09:38:40 -0000 1.9 @@ -1024,23 +1024,4 @@ ; 'query-replace 'region)))) ; (move-overlay replace-overlay start end (current-buffer))))) -(defun match-string (num &optional string) - "Return string of text matched by last search. -NUM specifies which parenthesized expression in the last regexp. - Value is nil if NUMth pair didn't match, or there were less than NUM pairs. -Zero means the entire text matched by the whole regexp or whole string. -STRING should be given if the last search was by `string-match' on STRING." - (if (match-beginning num) - (if string - (substring string (match-beginning num) (match-end num)) - (buffer-substring (match-beginning num) (match-end num))))) - -(defmacro save-match-data (&rest body) - "Execute BODY forms, restoring the global value of the match data." - (let ((original (make-symbol "match-data"))) - (list 'let (list (list original '(match-data))) - (list 'unwind-protect - (cons 'progn body) - (list 'store-match-data original))))) - ;;; replace.el ends here Index: lisp/setup-paths.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/setup-paths.el,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- lisp/setup-paths.el 15 Mar 2002 07:43:21 -0000 1.18 +++ lisp/setup-paths.el 1 Mar 2003 07:25:27 -0000 1.19 @@ -3,6 +3,7 @@ ;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc. ;; Copyright (c) 1993, 1994 Sun Microsystems, Inc. ;; Copyright (C) 1995 Board of Trustees, University of Illinois +;; Copyright (C) 2003 Ben Wing. ;; Author: Mike Sperber ;; Maintainer: XEmacs Development Team @@ -36,9 +37,57 @@ ;; This file doesn't actually do anything. ;; It requires find-paths.el and packages.el. - + ;;; Code: +;(setq debug-paths t) + + +;;; Path-related variables. +;;; NOTE: Many of them (`lisp-directory', `data-directory', etc.) are +;;; built-in. + +(defvar emacs-roots nil + "List of plausible roots of the XEmacs hierarchy. +This is a list of plausible directories in which to search for the important +directories used by XEmacs at run-time, for example `exec-directory', +`data-directory' and `lisp-directory'. + +Normally set at startup by calling `paths-find-emacs-roots'.") + +(defvar emacs-data-roots nil + "List of plausible data roots of the XEmacs hierarchy.") + +(defvar user-init-directory-base ".xemacs" + "Base of directory where user-installed init files may go.") + +(defvar user-init-directory + (file-name-as-directory + (paths-construct-path (list "~" user-init-directory-base))) + "Directory where user-installed init files may go.") + +(defvar user-init-file-base "init.el" + "Default name of the user init file if uncompiled. +This should be used for migration purposes only.") + +(defvar user-init-file-base-list '("init.el") + "List of allowed init files in the user's init directory. +The first one found takes precedence. .elc files do not need to be listed.") + +(defvar user-home-init-file-base-list + (append '(".emacs.el" ".emacs") + (and (eq system-type 'windows-nt) + '("_emacs.el" "_emacs"))) + "List of allowed init files in the user's home directory. +The first one found takes precedence. .elc files do not need to be listed.") + +(defvar load-home-init-file nil + "Non-nil if XEmacs should load the init file from the home directory. +Otherwise, XEmacs will offer migration to the init directory.") + +(defvar load-user-init-file-p t + "Non-nil if XEmacs should load the user's init file.") + (defvar paths-core-load-path-depth 0 "Depth of load-path searches in core Lisp paths.") @@ -59,6 +108,81 @@ ("usr" "share" "info"))) "Directories appended to the end of the info path by default.") + +;;; Basic utility functions. + +(defun paths-emacs-root-p (directory) + "Check if DIRECTORY is a plausible installation root." + (or + ;; installed + (paths-file-readable-directory-p (paths-construct-path (list directory + "lib" + (construct-emacs-version-name)))) + ;; in-place or windows-nt. windows-nt equivalent of --srcdir is + ;; BUILD_DIR in config.inc, and has no lisp/ or etc/ since symlinks + ;; don't exist. instead, xemacs.mak points configure-lisp-directory and + ;; configure-data-directory at the right places. + (and + (or configure-exec-directory (paths-file-readable-directory-p (paths-construct-path (list directory "lib-src")))) + (or configure-lisp-directory (paths-file-readable-directory-p (paths-construct-path (list directory "lisp")))) + (or configure-data-directory (paths-file-readable-directory-p (paths-construct-path (list directory "etc"))))))) + +(defun paths-emacs-data-root-p (directory) + "Check if DIRECTORY is a plausible data installation root. +A data installation root is one containing data files that may be shared +among multiple different versions of XEmacs, the packages in particular." + (or + ;; installed + (paths-file-readable-directory-p (paths-construct-path (list directory + "lib" + emacs-program-name))) + (paths-file-readable-directory-p (paths-construct-path (list directory + "lib" + (construct-emacs-version-name)))) + ;; in-place or windows-nt + (and + (paths-file-readable-directory-p (paths-construct-path (list directory "lisp"))) + (paths-file-readable-directory-p (paths-construct-path (list directory "etc")))))) + +(defun paths-find-emacs-root (invocation-directory invocation-name) + "Find the run-time root of XEmacs." + (let* ((executable-file-name (paths-chase-symlink + (concat invocation-directory + invocation-name))) + (executable-directory (file-name-directory executable-file-name)) + (maybe-root-1 (file-name-as-directory + (paths-construct-path '("..") executable-directory))) + (maybe-root-2 (file-name-as-directory + (paths-construct-path '(".." "..") executable-directory)))) + (or (and (paths-emacs-root-p maybe-root-1) + maybe-root-1) + (and (paths-emacs-root-p maybe-root-2) + maybe-root-2)))) + +(defun paths-find-emacs-roots (root-p) + "Find all plausible installation roots for XEmacs. +This is a list of plausible directories in which to search for the important +directories used by XEmacs at run-time, for example `exec-directory', +`data-directory' and `lisp-directory'. +ROOT-P is a function that tests whether a root is plausible." + (let* ((potential-invocation-root + (paths-find-emacs-root invocation-directory invocation-name)) + (invocation-roots + (and potential-invocation-root + (list potential-invocation-root))) + (potential-installation-roots + (paths-uniq-append + (and configure-exec-prefix-directory + (list (file-name-as-directory + configure-exec-prefix-directory))) + (and configure-prefix-directory + (list (file-name-as-directory + configure-prefix-directory))))) + (installation-roots + (paths-filter root-p potential-installation-roots))) + (paths-uniq-append invocation-roots + installation-roots))) + (defun paths-find-site-lisp-directory (roots) "Find the site Lisp directory of the XEmacs hierarchy." (paths-find-site-directory roots "site-lisp" @@ -201,5 +325,223 @@ (packages-find-package-data-path late-packages) (list data-directory) (packages-find-package-data-path last-packages))) + + +;;; High-level functions to set up the paths. + +(defun startup-find-load-path (&optional inhibit-packages + set-global-package-paths) + "Determine the value for `load-path'. +INHIBIT-PACKAGES says which types of packages, if any, to omit from the +returned value. It can be `t' (omit all), one of the symbols `early', +`late', or `last', or a list of one or more of the symbols. + +If SET-GLOBAL-PACKAGE-PATHS is non-nil, initialize the global package path +variables referring to the particular types of packages (`early-packages', +`early-package-load-path', `late-packages', `late-package-load-path', +`last-packages', `last-package-load-path')." + (let (earlyp latep lastp earlyp-lp latep-lp lastp-lp) + (apply #'(lambda (early late last) + (setq earlyp (and (not (memq 'early inhibit-packages)) early)) + (setq latep (and (not (memq 'late inhibit-packages)) late)) + (setq lastp (and (not (memq 'last inhibit-packages)) last))) + (packages-find-packages + emacs-data-roots + (packages-compute-package-locations user-init-directory))) + + (setq earlyp-lp (packages-find-package-load-path earlyp)) + (setq latep-lp (packages-find-package-load-path latep)) + (setq lastp-lp (packages-find-package-load-path lastp)) + + (when set-global-package-paths + (setq early-packages earlyp + late-packages latep + last-packages lastp + early-package-load-path earlyp-lp + late-package-load-path latep-lp + last-package-load-path lastp-lp)) + + (paths-construct-load-path emacs-roots earlyp-lp latep-lp lastp-lp + lisp-directory site-directory + mule-lisp-directory))) + +(defun startup-setup-paths (&optional inhibit-packages called-early) + "Setup all the various paths. +INHIBIT-PACKAGES says which types of packages, if any, to omit from the +returned value. It can be `t' (omit all), one of the symbols `early', +`late', or `last', or a list of one or more of the symbols. + +This function is idempotent, so call this as often as you like!" + + (setq debug-paths (or debug-paths + (and (getenv "EMACSDEBUGPATHS") + t))) + + (setq emacs-roots (paths-find-emacs-roots #'paths-emacs-data-root-p)) + + (setq emacs-data-roots (paths-find-emacs-roots #'paths-emacs-data-root-p)) + + (if (null emacs-roots) + (save-excursion + (set-buffer (get-buffer-create " *warning-tmp*")) + (erase-buffer) + (buffer-disable-undo (current-buffer)) + + (insert "Couldn't find an obvious default for the root of the\n" + "XEmacs hierarchy.") + + (princ "\nWARNING:\n" 'external-debugging-output) + (princ (buffer-string) 'external-debugging-output))) + + (if (eq inhibit-packages t) + (setq inhibit-packages '(early late last))) + (if (not (listp inhibit-packages)) + (setq inhibit-packages (list inhibit-packages))) + + (when debug-paths + (princ (format +"startup-setup-paths arguments: + inhibit-packages: %S + inhibit-site-lisp: %S + called-early: %S +" inhibit-packages inhibit-site-lisp called-early) + 'external-debugging-output) + (princ (format +"emacs-roots: +%S +emacs-data-roots: +%S +user-init-directory: %S +configure-package-path: %S +" emacs-roots emacs-data-roots user-init-directory configure-package-path) + 'external-debugging-output) + ) + + (setq lisp-directory (paths-find-lisp-directory emacs-roots)) + + (if debug-paths + (princ (format "lisp-directory:\n%S\n" lisp-directory) + 'external-debugging-output)) + + (if (featurep 'mule) + (progn + (setq mule-lisp-directory + (paths-find-mule-lisp-directory emacs-roots + lisp-directory)) + (if debug-paths + (princ (format "mule-lisp-directory:\n%S\n" + mule-lisp-directory) + 'external-debugging-output))) + (setq mule-lisp-directory '())) + + (setq site-directory (and (null inhibit-site-lisp) + (paths-find-site-lisp-directory emacs-roots))) + + (if (and debug-paths (null inhibit-site-lisp)) + (princ (format "site-directory:\n%S\n" site-directory) + 'external-debugging-output)) + + (setq load-path (startup-find-load-path inhibit-packages t)) + + (when debug-paths + (princ (format "early-packages and early-package-load-path:\n%S\n%S\n" + early-packages early-package-load-path) + 'external-debugging-output) + (princ (format "late-packages and late-package-load-path:\n%S\n%S\n" + late-packages late-package-load-path) + 'external-debugging-output) + (princ (format "last-packages and last-package-load-path:\n%S\n%S\n" + last-packages last-package-load-path) + 'external-debugging-output)) + + (if debug-paths + (princ (format "load-path:\n%S\n" load-path) + 'external-debugging-output)) + (setq module-directory (paths-find-module-directory emacs-roots)) + (if debug-paths + (princ (format "module-directory:\n%S\n" module-directory) + 'external-debugging-output)) + (setq site-module-directory (and (null inhibit-site-modules) + (paths-find-site-module-directory + emacs-roots))) + (if (and debug-paths (null inhibit-site-modules)) + (princ (format "site-module-directory:\n%S\n" + site-module-directory) + 'external-debugging-output)) + + (setq module-load-path (paths-construct-module-load-path + emacs-roots + module-directory + site-module-directory)) + + (unless called-early + (setq Info-directory-list + (paths-construct-info-path + emacs-roots early-packages late-packages last-packages)) + + (if debug-paths + (princ (format "Info-directory-list:\n%S\n" Info-directory-list) + 'external-debugging-output)) + + (setq exec-directory (paths-find-exec-directory emacs-roots)) + + (if debug-paths + (princ (format "exec-directory:\n%s\n" exec-directory) + 'external-debugging-output)) + + (setq exec-path + (paths-construct-exec-path emacs-roots exec-directory + early-packages late-packages + last-packages)) + + (if debug-paths + (princ (format "exec-path:\n%S\n" exec-path) + 'external-debugging-output)) + + (setq doc-directory (paths-find-doc-directory emacs-roots)) + + (if debug-paths + (princ (format "doc-directory:\n%S\n" doc-directory) + 'external-debugging-output)) + + (setq data-directory (paths-find-data-directory emacs-roots)) + + (if debug-paths + (princ (format "data-directory:\n%S\n" data-directory) + 'external-debugging-output)) + + (setq data-directory-list (paths-construct-data-directory-list + data-directory early-packages + late-packages last-packages)) + (if debug-paths + (princ (format "data-directory-list:\n%S\n" data-directory-list) + 'external-debugging-output)))) + +(defun startup-find-load-path-for-packages (packages) + "Return a suitable load-path for PACKAGES. +PACKAGES is a list of package names (strings). This looks for package +directories in the load path whose last component is one of the members of +PACKAGES." + (mapcan + #'(lambda (package) + (and (member (file-name-nondirectory (directory-file-name package)) + packages) + (list package))) + (startup-find-load-path))) + +; (defun startup-set-basic-packages-load-path () +; "#### This is a hack. When recompiling .el files, we use -no-packages +; to avoid problems with packages shadowing standard Lisp files +; (e.g. unicode.el), but we really still need the stuff in xemacs-base and +; xemacs-devel, which SHOULD NOT be in the packages." +; (setq load-path (startup-find-load-path-for-packages +; '("xemacs-base" "xemacs-devel")))) + + +;;; Now actually set the paths up, for bootstrapping purposes. This is run +;;; at early dump time and in certain cases where we use a minimal temacs +;;; to do useful things, like rebuild DOC. + +(startup-setup-paths (if inhibit-all-packages t '(early last)) t) ;;; setup-paths.el ends here Index: lisp/simple.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/simple.el,v retrieving revision 1.44 retrieving revision 1.46 diff -u -r1.44 -r1.46 --- lisp/simple.el 6 Feb 2003 06:35:47 -0000 1.44 +++ lisp/simple.el 9 Mar 2003 02:27:33 -0000 1.46 @@ -25,6 +25,8 @@ ;; 02111-1307, USA. ;;; Synched up with: FSF 19.34 [But not very closely]. +;;; Occasional synching to FSF 21.2, as marked. Comment stuff also +;;; synched, and in newcomment.el. ;;; Commentary: @@ -2681,295 +2683,6 @@ (setq arg (1+ arg))))))) -(defcustom comment-column 32 - "*Column to indent right-margin comments to. -Setting this variable automatically makes it local to the current buffer. -Each mode establishes a different default value for this variable; you -can set the value for a particular mode using that mode's hook." - :type 'integer - :group 'fill-comments) -(make-variable-buffer-local 'comment-column) - -(defcustom comment-start nil - "*String to insert to start a new comment, or nil if no comment syntax." - :type '(choice (const :tag "None" nil) - string) - :group 'fill-comments) - -(defcustom comment-start-skip nil - "*Regexp to match the start of a comment plus everything up to its body. -If there are any \\(...\\) pairs, the comment delimiter text is held to begin -at the place matched by the close of the first pair." - :type '(choice (const :tag "None" nil) - regexp) - :group 'fill-comments) - -(defcustom comment-end "" - "*String to insert to end a new comment. -Should be an empty string if comments are terminated by end-of-line." - :type 'string - :group 'fill-comments) - -(defconst comment-indent-hook nil - "Obsolete variable for function to compute desired indentation for a comment. -Use `comment-indent-function' instead. -This function is called with no args with point at the beginning of -the comment's starting delimiter.") - -(defconst comment-indent-function - ;; XEmacs - add at least one space after the end of the text on the - ;; current line... - (lambda () - (save-excursion - (beginning-of-line) - (let ((eol (save-excursion (end-of-line) (point)))) - (and comment-start-skip - (re-search-forward comment-start-skip eol t) - (setq eol (match-beginning 0))) - (goto-char eol) - (skip-chars-backward " \t") - (max comment-column (1+ (current-column)))))) - "Function to compute desired indentation for a comment. -This function is called with no args with point at the beginning of -the comment's starting delimiter.") - -(defcustom block-comment-start nil - "*String to insert to start a new comment on a line by itself. -If nil, use `comment-start' instead. -Note that the regular expression `comment-start-skip' should skip this string -as well as the `comment-start' string." - :type '(choice (const :tag "Use `comment-start'" nil) - string) - :group 'fill-comments) - -(defcustom block-comment-end nil - "*String to insert to end a new comment on a line by itself. -Should be an empty string if comments are terminated by end-of-line. -If nil, use `comment-end' instead." - :type '(choice (const :tag "Use `comment-end'" nil) - string) - :group 'fill-comments) - -(defun indent-for-comment () - "Indent this line's comment to comment column, or insert an empty -comment. Comments starting in column 0 are not moved." - (interactive "*") - (let* ((empty (save-excursion (beginning-of-line) - (looking-at "[ \t]*$"))) - (starter (or (and empty block-comment-start) comment-start)) - (ender (or (and empty block-comment-end) comment-end))) - (if (null starter) - (error "No comment syntax defined") - (let* ((eolpos (save-excursion (end-of-line) (point))) - cpos indent begpos) - (beginning-of-line) - (if (re-search-forward comment-start-skip eolpos 'move) - (progn (setq cpos (point-marker)) - ;; Find the start of the comment delimiter. - ;; If there were paren-pairs in comment-start-skip, - ;; position at the end of the first pair. - (if (match-end 1) - (goto-char (match-end 1)) - ;; If comment-start-skip matched a string with - ;; internal whitespace (not final whitespace) then - ;; the delimiter start at the end of that - ;; whitespace. Otherwise, it starts at the - ;; beginning of what was matched. - (skip-syntax-backward " " (match-beginning 0)) - (skip-syntax-backward "^ " (match-beginning 0))))) - (setq begpos (point)) - ;; Compute desired indent. - ;; XEmacs change: Preserve indentation of comments starting in - ;; column 0, as documented. - (cond - ((= (current-column) 0) - (goto-char begpos)) - ((= (current-column) - (setq indent (funcall comment-indent-function))) - (goto-char begpos)) - (t - ;; If that's different from current, change it. - (skip-chars-backward " \t") - (delete-region (point) begpos) - (indent-to indent))) - ;; An existing comment? - (if cpos - (progn (goto-char cpos) - (set-marker cpos nil)) - ;; No, insert one. - (insert starter) - (save-excursion - (insert ender))))))) - -(defun set-comment-column (arg) - "Set the comment column based on point. -With no arg, set the comment column to the current column. -With just minus as arg, kill any comment on this line. -With any other arg, set comment column to indentation of the previous comment - and then align or create a comment on this line at that column." - (interactive "P") - (if (eq arg '-) - (kill-comment nil) - (if arg - (progn - (save-excursion - (beginning-of-line) - (re-search-backward comment-start-skip) - (beginning-of-line) - (re-search-forward comment-start-skip) - (goto-char (match-beginning 0)) - (setq comment-column (current-column)) - (lmessage 'command "Comment column set to %d" comment-column)) - (indent-for-comment)) - (setq comment-column (current-column)) - (lmessage 'command "Comment column set to %d" comment-column)))) - -(defun kill-comment (arg) - "Kill the comment on this line, if any. -With argument, kill comments on that many lines starting with this one." - ;; this function loses in a lot of situations. it incorrectly recognizes - ;; comment delimiters sometimes (ergo, inside a string), doesn't work - ;; with multi-line comments, can kill extra whitespace if comment wasn't - ;; through end-of-line, et cetera. - (interactive "*P") - (or comment-start-skip (error "No comment syntax defined")) - (let ((count (prefix-numeric-value arg)) endc) - (while (> count 0) - (save-excursion - (end-of-line) - (setq endc (point)) - (beginning-of-line) - (and (string< "" comment-end) - (setq endc - (progn - (re-search-forward (regexp-quote comment-end) endc 'move) - (skip-chars-forward " \t") - (point)))) - (beginning-of-line) - (if (re-search-forward comment-start-skip endc t) - (progn - (goto-char (match-beginning 0)) - (skip-chars-backward " \t") - (kill-region (point) endc) - ;; to catch comments a line beginnings - (indent-according-to-mode)))) - (if arg (forward-line 1)) - (setq count (1- count))))) - -;; This variable: Synched up with 20.7. -(defvar comment-padding 1 - "Number of spaces `comment-region' puts between comment chars and text. - -Extra spacing between the comment characters and the comment text -makes the comment easier to read. Default is 1. Nil means 0 and is -more efficient.") - -;; This function: Synched up with 20.7. -(defun comment-region (start end &optional arg) - "Comment or uncomment each line in the region. -With just C-u prefix arg, uncomment each line in region. -Numeric prefix arg ARG means use ARG comment characters. -If ARG is negative, delete that many comment characters instead. -Comments are terminated on each line, even for syntax in which newline does -not end the comment. Blank lines do not get comments." - ;; if someone wants it to only put a comment-start at the beginning and - ;; comment-end at the end then typing it, C-x C-x, closing it, C-x C-x - ;; is easy enough. No option is made here for other than commenting - ;; every line. - (interactive "r\nP") - (or comment-start (error "No comment syntax is defined")) - (if (> start end) (let (mid) (setq mid start start end end mid))) - (save-excursion - (save-restriction - (let ((cs comment-start) (ce comment-end) - (cp (when comment-padding - (make-string comment-padding ? ))) - numarg) - (if (consp arg) (setq numarg t) - (setq numarg (prefix-numeric-value arg)) - ;; For positive arg > 1, replicate the comment delims now, - ;; then insert the replicated strings just once. - (while (> numarg 1) - (setq cs (concat cs comment-start) - ce (concat ce comment-end)) - (setq numarg (1- numarg)))) - ;; Loop over all lines from START to END. - (narrow-to-region start end) - (goto-char start) - ;; if user didn't specify how many comments to remove, be smart - ;; and remove the minimal number that all lines have. that way, - ;; comments in a region of Elisp code that gets commented out will - ;; get put back correctly. - (if (eq numarg t) - (let ((min-comments 999999)) - (while (not (eobp)) - (let ((this-comments 0)) - (while (looking-at (regexp-quote cs)) - (incf this-comments) - (forward-char (length cs))) - (if (and (> this-comments 0) (< this-comments min-comments)) - (setq min-comments this-comments)) - (forward-line 1))) - (if (< min-comments 999999) - (setq numarg (- min-comments))) - (goto-char start))) - (if (or (eq numarg t) (< numarg 0)) - (while (not (eobp)) - (let (found-comment) - ;; Delete comment start from beginning of line. - (if (eq numarg t) - (while (looking-at (regexp-quote cs)) - (setq found-comment t) - (delete-char (length cs))) - (let ((count numarg)) - (while (and (> 1 (setq count (1+ count))) - (looking-at (regexp-quote cs))) - (setq found-comment t) - (delete-char (length cs))))) - ;; Delete comment padding from beginning of line - (when (and found-comment comment-padding - (looking-at (regexp-quote cp))) - (delete-char comment-padding)) - ;; Delete comment end from end of line. - (if (string= "" ce) - nil - (if (eq numarg t) - (progn - (end-of-line) - ;; This is questionable if comment-end ends in - ;; whitespace. That is pretty brain-damaged, - ;; though. - (while (progn (skip-chars-backward " \t") - (and (>= (- (point) (point-min)) - (length ce)) - (save-excursion - (backward-char (length ce)) - (looking-at (regexp-quote ce))))) - (delete-char (- (length ce))))) - (let ((count numarg)) - (while (> 1 (setq count (1+ count))) - (end-of-line) - ;; This is questionable if comment-end ends in - ;; whitespace. That is pretty brain-damaged though - (skip-chars-backward " \t") - (if (>= (- (point) (point-min)) (length ce)) - (save-excursion - (backward-char (length ce)) - (if (looking-at (regexp-quote ce)) - (delete-char (length ce))))))))) - (forward-line 1))) - - (when comment-padding - (setq cs (concat cs cp))) - (while (not (eobp)) - ;; Insert at beginning and at end. - (if (looking-at "[ \t]*$") () - (insert cs) - (if (string= "" ce) () - (end-of-line) - (insert ce))) - (search-forward "\n" nil 'move))))))) - ;; XEmacs (defun prefix-region (prefix) "Add a prefix string to each line between mark and point." @@ -3334,98 +3047,9 @@ (error "set-fill-column requires an explicit argument"))) (lmessage 'command "fill-column set to %d" fill-column)) -(defcustom comment-multi-line t ; XEmacs - this works well with adaptive fill - "*Non-nil means \\[indent-new-comment-line] should continue same comment -on new line, with no new terminator or starter. -This is obsolete because you might as well use \\[newline-and-indent]." - :type 'boolean - :group 'fill-comments) - -(defun indent-new-comment-line (&optional soft) - "Break line at point and indent, continuing comment if within one. -This indents the body of the continued comment -under the previous comment line. - -This command is intended for styles where you write a comment per line, -starting a new comment (and terminating it if necessary) on each line. -If you want to continue one comment across several lines, use \\[newline-and-indent]. -If a fill column is specified, it overrides the use of the comment column -or comment indentation. +;; BEGIN SYNCHED WITH FSF 21.2. -The inserted newline is marked hard if `use-hard-newlines' is true, -unless optional argument SOFT is non-nil." - (interactive) - (let (comcol comstart) - (skip-chars-backward " \t") - (if (featurep 'mule) - (declare-fboundp (kinsoku-process))) - (delete-region (point) - (progn (skip-chars-forward " \t") - (point))) - (if soft (insert ?\n) (newline 1)) - (if fill-prefix - (progn - (indent-to-left-margin) - (insert fill-prefix)) - ;; #### - Eric Eide reverts to v18 semantics for this function in - ;; fa-extras, which I'm not gonna do. His changes are to (1) execute - ;; the save-excursion below unconditionally, and (2) uncomment the check - ;; for (not comment-multi-line) further below. --Stig - ;;#### jhod: probably need to fix this for kinsoku processing - (if (not comment-multi-line) - (save-excursion - (if (and comment-start-skip - (let ((opoint (point))) - (forward-line -1) - (re-search-forward comment-start-skip opoint t))) - ;; The old line is a comment. - ;; Set WIN to the pos of the comment-start. - ;; But if the comment is empty, look at preceding lines - ;; to find one that has a nonempty comment. - - ;; If comment-start-skip contains a \(...\) pair, - ;; the real comment delimiter starts at the end of that pair. - (let ((win (or (match-end 1) (match-beginning 0)))) - (while (and (eolp) (not (bobp)) - (let (opoint) - (beginning-of-line) - (setq opoint (point)) - (forward-line -1) - (re-search-forward comment-start-skip opoint t))) - (setq win (or (match-end 1) (match-beginning 0)))) - ;; Indent this line like what we found. - (goto-char win) - (setq comcol (current-column)) - (setq comstart - (buffer-substring (point) (match-end 0))))))) - (if (and comcol (not fill-prefix)) ; XEmacs - (ENE) from fa-extras. - (let ((comment-column comcol) - (comment-start comstart) - (block-comment-start comstart) - (comment-end comment-end)) - (and comment-end (not (equal comment-end "")) - ; (if (not comment-multi-line) - (progn - (backward-char 1) - (insert comment-end) - (forward-char 1)) - ; (setq comment-column (+ comment-column (length comment-start)) - ; comment-start "") - ; ) - ) - (if (not (eolp)) - (setq comment-end "")) - (insert ?\n) - (backward-char 1) - (indent-for-comment) - (save-excursion - ;; Make sure we delete the newline inserted above. - (end-of-line) - (delete-char 1))) - (indent-according-to-mode))))) - - (defun set-selective-display (arg) "Set `selective-display' to ARG; clear it if no arg. When the value of `selective-display' is a number > 0, @@ -3471,14 +3095,14 @@ (add-hook 'change-major-mode-hook 'nuke-selective-display) -(defconst overwrite-mode-textual " Ovwrt" +(defvar overwrite-mode-textual " Ovwrt" "The string displayed in the mode line when in overwrite mode.") -(defconst overwrite-mode-binary " Bin Ovwrt" +(defvar overwrite-mode-binary " Bin Ovwrt" "The string displayed in the mode line when in binary overwrite mode.") (defun overwrite-mode (arg) "Toggle overwrite mode. -With arg, enable overwrite mode if arg is positive, else disable. +With arg, turn overwrite mode on iff arg is positive. In overwrite mode, printing characters typed in replace existing text on a one-for-one basis, rather than pushing it to the right. At the end of a line, such characters extend the line. Before a tab, @@ -3494,7 +3118,7 @@ (defun binary-overwrite-mode (arg) "Toggle binary overwrite mode. -With arg, enable binary overwrite mode if arg is positive, else disable. +With arg, turn binary overwrite mode on iff arg is positive. In binary overwrite mode, printing characters typed in replace existing text. Newlines are not treated specially, so typing at the end of a line joins the line to the next, with the typed character @@ -3513,6 +3137,9 @@ (> (prefix-numeric-value arg) 0)) 'overwrite-mode-binary)) (redraw-modeline)) + +;; END SYNCHED WITH FSF 21.2. + (defcustom line-number-mode t "*Non-nil means display line number in modeline." @@ -3672,26 +3299,43 @@ ;; mail composition code ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; BEGIN SYNCHED WITH FSF 21.2. + (defcustom mail-user-agent 'sendmail-user-agent "*Your preference for a mail composition package. -Various Emacs Lisp packages (e.g. reporter) require you to compose an +Various Emacs Lisp packages (e.g. Reporter) require you to compose an outgoing email message. This variable lets you specify which mail-sending package you prefer. Valid values include: - sendmail-user-agent -- use the default Emacs Mail package - mh-e-user-agent -- use the Emacs interface to the MH mail system - message-user-agent -- use the GNUS mail sending package + `sendmail-user-agent' -- use the default Emacs Mail package. + See Info node `(emacs)Sending Mail'. + `mh-e-user-agent' -- use the Emacs interface to the MH mail system. + See Info node `(mh-e)'. + `message-user-agent' -- use the Gnus Message package. + See Info node `(message)'. + `gnus-user-agent' -- like `message-user-agent', but with Gnus + paraphernalia, particularly the Gcc: header for + archiving. Additional valid symbols may be available; check with the author of -your package for details." +your package for details. The function should return non-nil if it +succeeds. + +See also `read-mail-command' concerning reading mail." :type '(radio (function-item :tag "Default Emacs mail" :format "%t\n" sendmail-user-agent) - (function-item :tag "Gnus mail sending package" + (function-item :tag "Emacs interface to MH" + :format "%t\n" + mh-e-user-agent) + (function-item :tag "Gnus Message package" :format "%t\n" message-user-agent) + (function-item :tag "Gnus Message with full Gnus features" + :format "%t\n" + gnus-user-agent) (function :tag "Other")) :group 'mail) @@ -3737,6 +3381,13 @@ 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook) +(defun rfc822-goto-eoh () + ;; Go to header delimiter line in a mail message, following RFC822 rules + (goto-char (point-min)) + (while (looking-at "^[^: \n]+:\\|^[ \t]") + (forward-line 1)) + (point)) + (defun sendmail-user-agent-compose (&optional to subject other-headers continue switch-function yank-action send-actions) @@ -3747,24 +3398,28 @@ (same-window-regexps nil)) (funcall switch-function "*mail*"))) (let ((cc (cdr (assoc-ignore-case "cc" other-headers))) - (in-reply-to (cdr (assoc-ignore-case "in-reply-to" other-headers)))) + (in-reply-to (cdr (assoc-ignore-case "in-reply-to" other-headers))) + (body (cdr (assoc-ignore-case "body" other-headers)))) (or (declare-fboundp (mail continue to subject in-reply-to cc yank-action send-actions)) continue (error "Message aborted")) (save-excursion - (goto-char (point-min)) - (search-forward (declare-boundp mail-header-separator)) - (beginning-of-line) + (rfc822-goto-eoh) (while other-headers - (if (not (member (car (car other-headers)) '("in-reply-to" "cc"))) + (unless (member* (car (car other-headers)) + '("in-reply-to" "cc" "body") + :test 'equalp) (insert (car (car other-headers)) ": " (cdr (car other-headers)) "\n")) (setq other-headers (cdr other-headers))) + (when body + (forward-line 1) + (insert body)) t))) (define-mail-user-agent 'mh-e-user-agent - 'mh-user-agent-compose 'mh-send-letter 'mh-fully-kill-draft + 'mh-smail-batch 'mh-send-letter 'mh-fully-kill-draft 'mh-before-send-letter-hook) (defun compose-mail (&optional to subject other-headers continue @@ -3822,48 +3477,199 @@ ;; set variable ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defvar set-variable-value-history nil + "History of values entered with `set-variable'.") + (defun set-variable (var val) "Set VARIABLE to VALUE. VALUE is a Lisp object. -When using this interactively, supply a Lisp expression for VALUE. +When using this interactively, enter a Lisp object for VALUE. If you want VALUE to be a string, you must surround it with doublequotes. +VALUE is used literally, not evaluated. + If VARIABLE is a specifier, VALUE is added to it as an instantiator in the 'global locale with nil tag set (see `set-specifier'). If VARIABLE has a `variable-interactive' property, that is used as if -it were the arg to `interactive' (which see) to interactively read the value." +it were the arg to `interactive' (which see) to interactively read VALUE. + +If VARIABLE has been defined with `defcustom', then the type information +in the definition is used to check that VALUE is valid." (interactive - (let* ((var (read-variable "Set variable: ")) - ;; #### - yucky code replication here. This should use something - ;; from help.el or hyper-apropos.el - (myhelp - #'(lambda () - (with-output-to-temp-buffer "*Help*" - (prin1 var) - (princ "\nDocumentation:\n") - (princ (substring (documentation-property var 'variable-documentation) - 1)) - (if (boundp var) - (let ((print-length 20)) - (princ "\n\nCurrent value: ") - (prin1 (symbol-value var)))) - (save-excursion - (set-buffer standard-output) - (help-mode)) - nil))) - (minibuffer-help-form - '(funcall myhelp))) - (list var - (let ((prop (get var 'variable-interactive))) - (if prop - ;; Use VAR's `variable-interactive' property - ;; as an interactive spec for prompting. - (call-interactively (list 'lambda '(arg) - (list 'interactive prop) - 'arg)) - (eval-minibuffer (format "Set %s to value: " var))))))) + (let* ((default-var (variable-at-point)) + (var (if (symbolp default-var) + (read-variable (format "Set variable (default %s): " default-var) + default-var) + (read-variable "Set variable: "))) + (minibuffer-help-form '(describe-variable var)) + (prop (get var 'variable-interactive)) + (prompt (format "Set %s to value: " var)) + (val (if prop + ;; Use VAR's `variable-interactive' property + ;; as an interactive spec for prompting. + (call-interactively `(lambda (arg) + (interactive ,prop) + arg)) + (read + (read-string prompt nil + 'set-variable-value-history))))) + (list var val))) + + (let ((type (get var 'custom-type))) + (when type + ;; Match with custom type. + (require 'cus-edit) + (setq type (widget-convert type)) + (unless (widget-apply type :match val) + (error "Value `%S' does not match type %S of %S" + val (car type) var)))) (if (and (boundp var) (specifierp (symbol-value var))) (set-specifier (symbol-value var) val) - (set var val))) + (set var val)) + + ;; Force a thorough redisplay for the case that the variable + ;; has an effect on the display, like `tab-width' has. + (force-mode-line-update)) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; forking a twin copy of a buffer ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defvar clone-buffer-hook nil + "Normal hook to run in the new buffer at the end of `clone-buffer'.") + +(defun clone-process (process &optional newname) + "Create a twin copy of PROCESS. +If NEWNAME is nil, it defaults to PROCESS' name; +NEWNAME is modified by adding or incrementing at the end as necessary. +If PROCESS is associated with a buffer, the new process will be associated + with the current buffer instead. +Returns nil if PROCESS has already terminated." + (setq newname (or newname (process-name process))) + (if (string-match "<[0-9]+>\\'" newname) + (setq newname (substring newname 0 (match-beginning 0)))) + (when (memq (process-status process) '(run stop open)) + (let* ((process-connection-type (process-tty-name process)) + (old-kwoq (process-kill-without-query process nil)) + (new-process + (if (memq (process-status process) '(open)) + (apply 'open-network-stream newname + (if (process-buffer process) (current-buffer)) + ;; FSF: (process-contact process) + (process-command process)) + (apply 'start-process newname + (if (process-buffer process) (current-buffer)) + (process-command process))))) + (process-kill-without-query new-process old-kwoq) + (process-kill-without-query process old-kwoq) + ;; FSF 21.2: +; (set-process-inherit-coding-system-flag +; new-process (process-inherit-coding-system-flag process)) + (set-process-filter new-process (process-filter process)) + (set-process-sentinel new-process (process-sentinel process)) + new-process))) + +;; things to maybe add (currently partly covered by `funcall mode': +;; - syntax-table +;; - overlays +(defun clone-buffer (&optional newname display-flag) + "Create a twin copy of the current buffer. +If NEWNAME is nil, it defaults to the current buffer's name; +NEWNAME is modified by adding or incrementing at the end as necessary. + +If DISPLAY-FLAG is non-nil, the new buffer is shown with `pop-to-buffer'. +This runs the normal hook `clone-buffer-hook' in the new buffer +after it has been set up properly in other respects." + (interactive (list (if current-prefix-arg (read-string "Name: ")) + t)) + (if buffer-file-name + (error "Cannot clone a file-visiting buffer")) + (if (get major-mode 'no-clone) + (error "Cannot clone a buffer in %s mode" mode-name)) + (setq newname (or newname (buffer-name))) + (if (string-match "<[0-9]+>\\'" newname) + (setq newname (substring newname 0 (match-beginning 0)))) + (let ((buf (current-buffer)) + (ptmin (point-min)) + (ptmax (point-max)) + (pt (point)) + (mk (mark t)) ;(if mark-active (mark t))) + (modified (buffer-modified-p)) + (mode major-mode) + (lvars (buffer-local-variables)) + (process (get-buffer-process (current-buffer))) + (new (generate-new-buffer (or newname (buffer-name))))) + (save-restriction + (widen) + (with-current-buffer new + (insert-buffer-substring buf))) + (with-current-buffer new + (narrow-to-region ptmin ptmax) + (goto-char pt) + (if mk (set-mark mk)) + (set-buffer-modified-p modified) + + ;; Clone the old buffer's process, if any. + (when process (clone-process process)) + + ;; Now set up the major mode. + (funcall mode) + + ;; Set up other local variables. + (mapcar (lambda (v) + (condition-case () ;in case var is read-only + (if (symbolp v) + (makunbound v) + (set (make-local-variable (car v)) (cdr v))) + (error nil))) + lvars) + + ;; Run any hooks (typically set up by the major mode + ;; for cloning to work properly). + (run-hooks 'clone-buffer-hook)) + (if display-flag (pop-to-buffer new)) + new)) + + +(defun clone-indirect-buffer (newname display-flag &optional norecord) + "Create an indirect buffer that is a twin copy of the current buffer. + +Give the indirect buffer name NEWNAME. Interactively, read NEW-NAME +from the minibuffer when invoked with a prefix arg. If NEWNAME is nil +or if not called with a prefix arg, NEWNAME defaults to the current +buffer's name. The name is modified by adding a `' suffix to it +or by incrementing the N in an existing suffix. + +DISPLAY-FLAG non-nil means show the new buffer with `pop-to-buffer'. +This is always done when called interactively. + +Optional last arg NORECORD non-nil means do not put this buffer at the +front of the list of recently selected ones." + (interactive (list (if current-prefix-arg + (read-string "BName of indirect buffer: ")) + t)) + (setq newname (or newname (buffer-name))) + (if (string-match "<[0-9]+>\\'" newname) + (setq newname (substring newname 0 (match-beginning 0)))) + (let* ((name (generate-new-buffer-name newname)) + (buffer (make-indirect-buffer (current-buffer) name t))) + (when display-flag + (pop-to-buffer buffer norecord)) + buffer)) + + +(defun clone-indirect-buffer-other-window (buffer &optional norecord) + "Create an indirect buffer that is a twin copy of BUFFER. +Select the new buffer in another window. +Optional second arg NORECORD non-nil means do not put this buffer at +the front of the list of recently selected ones." + (interactive "bClone buffer in other window: ") + (let ((pop-up-windows t)) + (set-buffer buffer) + (clone-indirect-buffer nil t norecord))) + +;; END SYNCHED WITH FSF 21.2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -4171,6 +3977,7 @@ (when (and (not (fboundp 'display-message)) (not (featurep 'debug))) + (set-device-clear-left-side nil nil) (send-string-to-terminal "\n")) (defvar message-stack nil @@ -4338,8 +4145,12 @@ (remove-message label frame) (let ((inhibit-read-only t)) (erase-buffer " *Echo Area*")) - (if clear-stream - (send-string-to-terminal ?\n stdout-p)) + ;; If outputting to the terminal, make sure we clear the left side. + (when (or clear-stream + (and (eq 'stream (frame-type frame)) + (not (device-left-side-clear-p (frame-device frame))))) + (set-device-clear-left-side (frame-device frame) nil) + (send-string-to-terminal ?\n stdout-p)) (if no-restore nil ; just preparing to put another msg up (if message-stack @@ -4383,12 +4194,19 @@ (defun append-message (label message &optional frame stdout-p) (or frame (setq frame (selected-frame))) + ;; If outputting to the terminal, make sure output from anyone else clears + ;; the left side first, but don't do it ourselves, otherwise we won't be + ;; able to append to an existing message. + (if (eq 'stream (frame-type frame)) + (set-device-clear-left-side (frame-device frame) nil)) ;; Add a new entry to the message-stack, or modify an existing one (let ((top (car message-stack))) (if (eq label (car top)) (setcdr top (concat (cdr top) message)) (push (cons label message) message-stack))) - (raw-append-message message frame stdout-p)) + (raw-append-message message frame stdout-p) + (if (eq 'stream (frame-type frame)) + (set-device-clear-left-side (frame-device frame) t))) ;; Really append the message to the echo area. no fiddling with ;; message-stack. Index: lisp/startup.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/startup.el,v retrieving revision 1.47 retrieving revision 1.49 diff -u -r1.47 -r1.49 --- lisp/startup.el 23 Jan 2003 11:39:01 -0000 1.47 +++ lisp/startup.el 27 Mar 2003 12:57:42 -0000 1.49 @@ -3,7 +3,7 @@ ;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc. ;; Copyright (c) 1993, 1994 Sun Microsystems, Inc. ;; Copyright (C) 1995 Board of Trustees, University of Illinois -;; Copyright (C) 2001, 2002 Ben Wing. +;; Copyright (C) 2001, 2002, 2003 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: internal, dumped @@ -130,42 +130,6 @@ (defconst initial-major-mode 'lisp-interaction-mode "Major mode command symbol to use for the initial *scratch* buffer.") -(defvar emacs-roots nil - "List of plausible roots of the XEmacs hierarchy.") - -(defvar emacs-data-roots nil - "List of plausible data roots of the XEmacs hierarchy.") - -(defvar user-init-directory-base ".xemacs" - "Base of directory where user-installed init files may go.") - -(defvar user-init-directory - (file-name-as-directory - (paths-construct-path (list "~" user-init-directory-base))) - "Directory where user-installed init files may go.") - -(defvar user-init-file-base "init.el" - "Default name of the user init file if uncompiled. -This should be used for migration purposes only.") - -(defvar user-init-file-base-list '("init.elc" "init.el") - "List of allowed init files in the user's init directory. -The first one found takes precedence.") - -(defvar user-home-init-file-base-list - (append '(".emacs.elc" ".emacs.el" ".emacs") - (and (eq system-type 'windows-nt) - '("_emacs.elc" "_emacs.el" "_emacs"))) - "List of allowed init files in the user's home directory. -The first one found takes precedence.") - -(defvar load-home-init-file nil - "Non-nil if XEmacs should load the init file from the home directory. -Otherwise, XEmacs will offer migration to the init directory.") - -(defvar load-user-init-file-p t - "Non-nil if XEmacs should load the user's init file.") - ;; #### called `site-run-file' in FSFmacs (defvar site-start-file "site-start" @@ -514,33 +478,11 @@ (initialize-xemacs-paths) (startup-set-invocation-environment) - - (let ((debug-paths (or debug-paths - (and (getenv "EMACSDEBUGPATHS") - t)))) - - (setq emacs-roots (paths-find-emacs-roots invocation-directory - invocation-name - #'paths-emacs-root-p)) - (setq emacs-data-roots (paths-find-emacs-roots invocation-directory - invocation-name - #'paths-emacs-data-root-p)) - - (if debug-paths - (princ (format "emacs-roots:\n%S\n" emacs-roots) - 'external-debugging-output)) - - (if (null emacs-roots) - (startup-find-roots-warning)) - (startup-setup-paths emacs-roots emacs-data-roots - user-init-directory - (cond (inhibit-all-packages t) - (inhibit-early-packages '(early)) - (t nil)) - inhibit-site-lisp - debug-paths - nil) - (startup-setup-paths-warning)) + (startup-setup-paths (cond (inhibit-all-packages t) + (inhibit-early-packages '(early)) + (t nil)) + nil) + (startup-setup-paths-warning) ;; Either we need to inhibit messages from do_autoloads, or this ;; should go into (command-line) after the initialization of the @@ -798,24 +740,42 @@ (setq term (substring term 0 hyphend)) (setq term nil)))))) +(defun find-init-file-1 (dir base-list) + (catch 'found + (dolist (file base-list) + (let ((expanded (expand-file-name file dir))) + (if (string-match "el$" expanded) + (let* ((elc (concat expanded "c")) + (el-ok (file-readable-p expanded)) + (elc-ok (file-readable-p elc))) + (cond + ((and el-ok elc-ok (file-newer-than-file-p expanded elc)) + (lwarn 'initialization 'warning + "\ +The compiled initialization file `%s' exists +but is out-of-date with respect to the uncompiled initialization +file `%s'. XEmacs will load the uncompiled +version. You should correct the problem as soon as possible by +loading the uncompiled version and compiling it using +`M-x byte-compile-file' (or `Lisp->Byte-Compile This File' on +the menubar)." + elc expanded) + (throw 'found expanded)) + (elc-ok (throw 'found elc)) + (el-ok (throw 'found expanded)))) + (when (file-readable-p + (when (file-readable-p expanded) + (throw 'found expanded))))))))) + (defun find-user-init-directory-init-file (&optional init-directory) "Determine the user's init file if in the init directory." - (let ((init-directory (or init-directory user-init-directory))) - (catch 'found - (dolist (file user-init-file-base-list) - (let ((expanded (expand-file-name file init-directory))) - (when (file-readable-p expanded) - (throw 'found expanded))))))) + (find-init-file-1 (or init-directory user-init-directory) + user-init-file-base-list)) (defun find-user-home-directory-init-file (&optional home-directory) "Determine the user's init file if in the home directory." - (let ((home-directory (or home-directory "~"))) - (catch 'found - (dolist (file user-home-init-file-base-list) - (let ((expanded (expand-file-name file home-directory))) - (when (file-readable-p expanded) - (throw 'found expanded)))) - nil))) + (find-init-file-1 (or home-directory "~") + user-home-init-file-base-list)) (defun find-user-init-file (&optional init-directory home-directory) "Determine the user's init file." @@ -1377,7 +1337,7 @@ ;; (insert "For customization examples, see the files ") ;; (funcall present-file "sample.emacs") ;; (insert " and ") -;; (funcall present-file "sample.Xdefaults") +;; (funcall present-file "sample.Xresources") ;; (insert (format "\nin the directory %s." data-directory))) (defun startup-set-invocation-environment () @@ -1387,18 +1347,6 @@ (setq invocation-directory ;; don't let /tmp_mnt/... get into the load-path or exec-path. (abbreviate-file-name invocation-directory))) - -(defun startup-find-roots-warning () - (save-excursion - (set-buffer (get-buffer-create " *warning-tmp*")) - (erase-buffer) - (buffer-disable-undo (current-buffer)) - - (insert "Couldn't find an obvious default for the root of the\n" - "XEmacs hierarchy.") - - (princ "\nWARNING:\n" 'external-debugging-output) - (princ (buffer-string) 'external-debugging-output))) (defun startup-setup-paths-warning () (let ((warnings '())) Index: lisp/subr.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/subr.el,v retrieving revision 1.28 retrieving revision 1.31 diff -u -r1.28 -r1.31 --- lisp/subr.el 8 Oct 2002 03:24:22 -0000 1.28 +++ lisp/subr.el 23 Apr 2003 15:42:50 -0000 1.31 @@ -3,7 +3,7 @@ ;; Copyright (C) 1985, 1986, 1992, 1994-5, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1995 Sun Microsystems. -;; Copyright (C) 2000, 2001, 2002 Ben Wing. +;; Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, dumped @@ -25,7 +25,7 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: FSF 19.34. Some things synched up with later versions. ;;; Commentary: @@ -36,8 +36,18 @@ ;; of commentary just to give diff(1) something to synch itself with to ;; provide useful context diffs. -sb -;;; Code: +;; BEGIN SYNCHED WITH FSF 21.2 +;;; Code: +(defvar custom-declare-variable-list nil + "Record `defcustom' calls made before `custom.el' is loaded to handle them. +Each element of this list holds the arguments to one call to `defcustom'.") + +;; Use this, rather than defcustom, in subr.el and other files loaded +;; before custom.el. See dumped-lisp.el. +(defun custom-declare-variable-early (&rest arguments) + (setq custom-declare-variable-list + (cons arguments custom-declare-variable-list))) ;;;; Lisp language features. @@ -58,6 +68,36 @@ BODY should be a list of lisp expressions." `(function (lambda ,@cdr))) +;; FSF 21.2 has various basic macros here. We don't because they're either +;; in cl*.el (which we dump and hence is always available) or built-in. + +;; More powerful versions in cl.el. +;(defmacro push (newelt listname) +;(defmacro pop (listname) + +;; Built-in. +;(defmacro when (cond &rest body) +;(defmacro unless (cond &rest body) + +;; More powerful versions in cl-macs.el. +;(defmacro dolist (spec &rest body) +;(defmacro dotimes (spec &rest body) + +;; In cl.el. Ours are defun, but cl arranges for them to be inlined anyway. +;(defsubst caar (x) +;(defsubst cadr (x) +;(defsubst cdar (x) +;(defsubst cddr (x) + +;; Built-in. Our `last' is more powerful in that it handles circularity. +;(defun last (x &optional n) +;(defun butlast (x &optional n) +;(defun nbutlast (x &optional n) + +;; In cl-seq.el. +;(defun remove (elt seq) +;(defun remq (elt list) + (defmacro defun-when-void (&rest args) "Define a function, just like `defun', unless it's already defined. Used for compatibility among different emacs variants." @@ -73,6 +113,52 @@ (define-function ,@args))) +(defun assoc-default (key alist &optional test default) + "Find object KEY in a pseudo-alist ALIST. +ALIST is a list of conses or objects. Each element (or the element's car, +if it is a cons) is compared with KEY by evaluating (TEST (car elt) KEY). +If that is non-nil, the element matches; +then `assoc-default' returns the element's cdr, if it is a cons, +or DEFAULT if the element is not a cons. + +If no element matches, the value is nil. +If TEST is omitted or nil, `equal' is used." + (let (found (tail alist) value) + (while (and tail (not found)) + (let ((elt (car tail))) + (when (funcall (or test 'equal) (if (consp elt) (car elt) elt) key) + (setq found t value (if (consp elt) (cdr elt) default)))) + (setq tail (cdr tail))) + value)) + +(defun assoc-ignore-case (key alist) + "Like `assoc', but ignores differences in case and text representation. +KEY must be a string. Upper-case and lower-case letters are treated as equal." + (let (element) + (while (and alist (not element)) + (if (eq t (compare-strings key 0 nil (car (car alist)) 0 nil t)) + (setq element (car alist))) + (setq alist (cdr alist))) + element)) + +(defun assoc-ignore-representation (key alist) + "Like `assoc', but ignores differences in text representation. +KEY must be a string." + (let (element) + (while (and alist (not element)) + (if (eq t (compare-strings key 0 nil (car (car alist)) 0 nil)) + (setq element (car alist))) + (setq alist (cdr alist))) + element)) + +(defun member-ignore-case (elt list) + "Like `member', but ignores differences in case and text representation. +ELT must be a string. Upper-case and lower-case letters are treated as equal." + (while (and list (not (eq t (compare-strings elt 0 nil (car list) 0 nil t)))) + (setq list (cdr list))) + list) + + ;;;; Keymap support. ;; XEmacs: removed to keymap.el @@ -85,8 +171,22 @@ ;; XEmacs: This stuff is done in C Code. -;;;; Obsolescent names for functions. -;; XEmacs: not used. +;;;; Obsolescent names for functions generally appear elsewhere, in +;;;; obsolete.el or in the files they are related do. Many very old +;;;; obsolete stuff has been removed entirely (e.g. anything with `dot' in +;;;; place of `point'). + +; alternate names (not obsolete) +(if (not (fboundp 'mod)) (define-function 'mod '%)) +(define-function 'move-marker 'set-marker) +(define-function 'beep 'ding) ; preserve lingual purity +(define-function 'indent-to-column 'indent-to) +(define-function 'backward-delete-char 'delete-backward-char) +(define-function 'search-forward-regexp (symbol-function 're-search-forward)) +(define-function 'search-backward-regexp (symbol-function 're-search-backward)) +(define-function 'remove-directory 'delete-directory) +(define-function 'set-match-data 'store-match-data) +(define-function 'send-string-to-terminal 'external-debugging-output) ;; XEmacs: (defun local-variable-if-set-p (sym buffer) @@ -103,6 +203,11 @@ (defun make-local-hook (hook) "Make the hook HOOK local to the current buffer. +The return value is HOOK. + +You never need to call this function now that `add-hook' does it for you +if its LOCAL argument is non-nil. + When a hook is local, its local and global values work in concert: running the hook actually runs all the hook functions listed in *either* the local value *or* the global value @@ -118,14 +223,13 @@ This function does nothing if HOOK is already local in the current buffer. -Do not use `make-local-variable' to make a hook variable buffer-local. - -See also `add-local-hook' and `remove-local-hook'." +Do not use `make-local-variable' to make a hook variable buffer-local." (if (local-variable-p hook (current-buffer)) ; XEmacs nil (or (boundp hook) (set hook nil)) (make-local-variable hook) - (set hook (list t)))) + (set hook (list t))) + hook) (defun add-hook (hook function &optional append local) "Add to the value of HOOK the function FUNCTION. @@ -136,7 +240,7 @@ The optional fourth argument, LOCAL, if non-nil, says to modify the hook's buffer-local value rather than its default value. -This makes no difference if the hook is not buffer-local. +This makes the hook buffer-local if needed. To make a hook variable buffer-local, always use `make-local-hook', not `make-local-variable'. @@ -146,35 +250,27 @@ You can remove this hook yourself using `remove-hook'. -See also `add-local-hook' and `add-one-shot-hook'." +See also `add-one-shot-hook'." (or (boundp hook) (set hook nil)) (or (default-boundp hook) (set-default hook nil)) - ;; If the hook value is a single function, turn it into a list. - (let ((old (symbol-value hook))) - (if (or (not (listp old)) (eq (car old) 'lambda)) - (set hook (list old)))) - (if (or local - ;; Detect the case where make-local-variable was used on a hook - ;; and do what we used to do. - (and (local-variable-if-set-p hook (current-buffer)) ; XEmacs - (not (memq t (symbol-value hook))))) - ;; Alter the local value only. - (or (if (consp function) - (member function (symbol-value hook)) - (memq function (symbol-value hook))) - (set hook - (if append - (append (symbol-value hook) (list function)) - (cons function (symbol-value hook))))) - ;; Alter the global value (which is also the only value, - ;; if the hook doesn't have a local value). - (or (if (consp function) - (member function (default-value hook)) - (memq function (default-value hook))) - (set-default hook - (if append - (append (default-value hook) (list function)) - (cons function (default-value hook))))))) + (if local (unless (local-variable-if-set-p hook (current-buffer)) ; XEmacs + (make-local-hook hook)) + ;; Detect the case where make-local-variable was used on a hook + ;; and do what we used to do. + (unless (and (consp (symbol-value hook)) (memq t (symbol-value hook))) + (setq local t))) + (let ((hook-value (if local (symbol-value hook) (default-value hook)))) + ;; If the hook value is a single function, turn it into a list. + (when (or (not (listp hook-value)) (eq (car hook-value) 'lambda)) + (setq hook-value (list hook-value))) + ;; Do the actual addition if necessary + (unless (member function hook-value) + (setq hook-value + (if append + (append hook-value (list function)) + (cons function hook-value)))) + ;; Set the actual variable + (if local (set hook hook-value) (set-default hook hook-value)))) (defun remove-hook (hook function &optional local) "Remove from the value of HOOK the function FUNCTION. @@ -184,73 +280,54 @@ The optional third argument, LOCAL, if non-nil, says to modify the hook's buffer-local value rather than its default value. -This makes no difference if the hook is not buffer-local. +This makes the hook buffer-local if needed. To make a hook variable buffer-local, always use `make-local-hook', not `make-local-variable'." - (if (or (not (boundp hook)) ;unbound symbol, or - (not (default-boundp 'hook)) - (null (symbol-value hook)) ;value is nil, or - (null function)) ;function is nil, then - nil ;Do nothing. - (flet ((hook-remove - (function hook-value) - (flet ((hook-test - (fn hel) - (or (equal fn hel) - (and (symbolp hel) - (equal fn - (get hel 'one-shot-hook-fun)))))) - (if (and (consp hook-value) - (not (functionp hook-value))) - (if (member* function hook-value :test 'hook-test) - (setq hook-value - (delete* function (copy-sequence hook-value) - :test 'hook-test))) - (if (equal hook-value function) - (setq hook-value nil))) - hook-value))) - (if (or local - ;; Detect the case where make-local-variable was used on a hook - ;; and do what we used to do. - (and (local-variable-p hook (current-buffer)) - (not (memq t (symbol-value hook))))) - (set hook (hook-remove function (symbol-value hook))) - (set-default hook (hook-remove function (default-value hook))))))) + (or (boundp hook) (set hook nil)) + (or (default-boundp hook) (set-default hook nil)) + (if local (unless (local-variable-if-set-p hook (current-buffer)) ; XEmacs + (make-local-hook hook)) + ;; Detect the case where make-local-variable was used on a hook + ;; and do what we used to do. + (unless (and (consp (symbol-value hook)) (memq t (symbol-value hook))) + (setq local t))) + (let ((hook-value (if local (symbol-value hook) (default-value hook)))) + ;; Remove the function, for both the list and the non-list cases. + ;; XEmacs: add hook-test, for handling one-shot hooks. + (flet ((hook-test + (fn hel) + (or (equal fn hel) + (and (symbolp hel) + (equal fn + (get hel 'one-shot-hook-fun)))))) + (if (or (not (listp hook-value)) (eq (car hook-value) 'lambda)) + (if (equal hook-value function) (setq hook-value nil)) + (setq hook-value (delete* function (copy-sequence hook-value) + :test 'hook-test))) + ;; If the function is on the global hook, we need to shadow it locally + ;;(when (and local (member* function (default-value hook) + ;; :test 'hook-test) + ;; (not (member* (cons 'not function) hook-value + ;; :test 'hook-test))) + ;; (push (cons 'not function) hook-value)) + ;; Set the actual variable + (if local (set hook hook-value) (set-default hook hook-value))))) ;; XEmacs addition ;; #### we need a coherent scheme for indicating compatibility info, ;; so that it can be programmatically retrieved. (defun add-local-hook (hook function &optional append) "Add to the local value of HOOK the function FUNCTION. -This modifies only the buffer-local value for the hook (which is -automatically make buffer-local, if necessary), not its default value. -FUNCTION is not added if already present. -FUNCTION is added (if necessary) at the beginning of the hook list -unless the optional argument APPEND is non-nil, in which case -FUNCTION is added at the end. - -HOOK should be a symbol, and FUNCTION may be any valid function. If -HOOK is void, it is first set to nil. If HOOK's value is a single -function, it is changed to a list of functions. - -You can remove this hook yourself using `remove-local-hook'. - -See also `add-hook' and `make-local-hook'." - (make-local-hook hook) +You don't need this any more. It's equivalent to specifying the LOCAL +argument to `add-hook'." (add-hook hook function append t)) ;; XEmacs addition (defun remove-local-hook (hook function) "Remove from the local value of HOOK the function FUNCTION. -This modifies only the buffer-local value for the hook, not its default -value. (Nothing happens if the hook is not buffer-local.) -HOOK should be a symbol, and FUNCTION may be any valid function. If -FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the -list of hooks to run in HOOK, then nothing is done. See `add-hook'. - -See also `add-local-hook' and `make-local-hook'." - (if (local-variable-p hook (current-buffer)) - (remove-hook hook function t))) +You don't need this any more. It's equivalent to specifying the LOCAL +argument to `remove-hook'." + (remove-hook hook function t)) (defun add-one-shot-hook (hook function &optional append local) "Add to the value of HOOK the one-shot function FUNCTION. @@ -267,7 +344,7 @@ You can remove this hook yourself using `remove-hook'. -See also `add-hook', `add-local-hook', and `add-local-one-shot-hook'." +See also `add-hook'." (let ((sym (gensym))) (fset sym `(lambda (&rest args) (unwind-protect @@ -278,27 +355,8 @@ (defun add-local-one-shot-hook (hook function &optional append) "Add to the local value of HOOK the one-shot function FUNCTION. -FUNCTION will automatically be removed from the hook the first time -after it runs (whether to completion or to an error). -FUNCTION is not added if already present. -FUNCTION is added (if necessary) at the beginning of the hook list -unless the optional argument APPEND is non-nil, in which case -FUNCTION is added at the end. - -The optional fourth argument, LOCAL, if non-nil, says to modify -the hook's buffer-local value rather than its default value. -This makes no difference if the hook is not buffer-local. -To make a hook variable buffer-local, always use -`make-local-hook', not `make-local-variable'. - -HOOK should be a symbol, and FUNCTION may be any valid function. If -HOOK is void, it is first set to nil. If HOOK's value is a single -function, it is changed to a list of functions. - -You can remove this hook yourself using `remove-local-hook'. - -See also `add-hook', `add-local-hook', and `add-local-one-shot-hook'." - (make-local-hook hook) +You don't need this any more. It's equivalent to specifying the LOCAL +argument to `add-one-shot-hook'." (add-one-shot-hook hook function append t)) (defun add-to-list (list-var element &optional append) @@ -320,6 +378,8 @@ (append (symbol-value list-var) (list element)) (cons element (symbol-value list-var)))))) +;; END SYNCHED WITH FSF 21.2 + ;; XEmacs additions ;; called by Fkill_buffer() (defvar kill-buffer-hook nil @@ -368,70 +428,8 @@ (with-current-buffer buffer (set sym val))) -;;;; String functions. - -;; XEmacs -(defun string-equal-ignore-case (str1 str2) - "Return t if two strings have identical contents, ignoring case differences. -Case is not significant. Text properties and extents are ignored. -Symbols are also allowed; their print names are used instead. - -See also `equalp'." - (if (symbolp str1) - (setq str1 (symbol-name str1))) - (if (symbolp str2) - (setq str2 (symbol-name str2))) - (eq t (compare-strings str1 nil nil str2 nil nil t))) - -;; XEmacs -(defun replace-in-string (str regexp newtext &optional literal) - "Replace all matches in STR for REGEXP with NEWTEXT string, - and returns the new string. -Optional LITERAL non-nil means do a literal replacement. -Otherwise treat `\\' in NEWTEXT as special: - `\\&' in NEWTEXT means substitute original matched text. - `\\N' means substitute what matched the Nth `\\(...\\)'. - If Nth parens didn't match, substitute nothing. - `\\\\' means insert one `\\'. - `\\u' means upcase the next character. - `\\l' means downcase the next character. - `\\U' means begin upcasing all following characters. - `\\L' means begin downcasing all following characters. - `\\E' means terminate the effect of any `\\U' or `\\L'." - (check-argument-type 'stringp str) - (check-argument-type 'stringp newtext) - (if (> (length str) 50) - (let ((cfs case-fold-search)) - (with-temp-buffer - (setq case-fold-search cfs) - (insert str) - (goto-char 1) - (while (re-search-forward regexp nil t) - (replace-match newtext t literal)) - (buffer-string))) - (let ((start 0) newstr) - (while (string-match regexp str start) - (setq newstr (replace-match newtext t literal str) - start (+ (match-end 0) (- (length newstr) (length str))) - str newstr)) - str))) - -(defun split-string (string &optional pattern) - "Return a list of substrings of STRING which are separated by PATTERN. -If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." - (or pattern - (setq pattern "[ \f\t\n\r\v]+")) - (let (parts (start 0) (len (length string))) - (if (string-match pattern string) - (setq parts (cons (substring string 0 (match-beginning 0)) parts) - start (match-end 0))) - (while (and (< start len) - (string-match pattern string (if (> start (match-beginning 0)) - start - (1+ start)))) - (setq parts (cons (substring string start (match-beginning 0)) parts) - start (match-end 0))) - (nreverse (cons (substring string start) parts)))) + +;; BEGIN SYNCHED WITH FSF 21.2 ;; #### #### #### AAaargh! Must be in C, because it is used insanely ;; early in the bootstrap process. @@ -446,17 +444,6 @@ ; path-separator)))) ; (split-string-by-char path (aref separator 0))) -(defmacro with-output-to-string (&rest body) - "Execute BODY, return the text it sent to `standard-output', as a string." - `(let ((standard-output - (get-buffer-create (generate-new-buffer-name " *string-output*")))) - (let ((standard-output standard-output)) - ,@body) - (with-current-buffer standard-output - (prog1 - (buffer-string) - (kill-buffer nil))))) - (defmacro with-current-buffer (buffer &rest body) "Temporarily make BUFFER the current buffer and execute the forms in BODY. The value returned is the value of the last form in BODY. @@ -484,10 +471,20 @@ (and (buffer-name ,temp-buffer) (kill-buffer ,temp-buffer)))))) +;; FSF compatibility (defmacro with-temp-message (message &rest body) "Display MESSAGE temporarily while BODY is evaluated. The original message is restored to the echo area after BODY has finished. -The value returned is the value of the last form in BODY." +The value returned is the value of the last form in BODY. +If MESSAGE is nil, the echo area and message log buffer are unchanged. +Use a MESSAGE of \"\" to temporarily clear the echo area. + +Note that this function exists for FSF compatibility purposes. A better way +under XEmacs is to give the message a particular label (see `display-message'); +then, the old message is automatically restored when you clear your message +with `clear-message'." +;; FSF additional doc string from 21.2: +;; MESSAGE is written to the message log buffer if `message-log-max' is non-nil. (let ((current-message (make-symbol "current-message")) (temp-message (make-symbol "with-temp-message"))) `(let ((,temp-message ,message) @@ -513,6 +510,57 @@ (and (buffer-name ,temp-buffer) (kill-buffer ,temp-buffer)))))) +(defmacro with-output-to-string (&rest body) + "Execute BODY, return the text it sent to `standard-output', as a string." + `(let ((standard-output + (get-buffer-create (generate-new-buffer-name " *string-output*")))) + (let ((standard-output standard-output)) + ,@body) + (with-current-buffer standard-output + (prog1 + (buffer-string) + (kill-buffer nil))))) + +;; FSF 21.2. + +; (defmacro combine-after-change-calls (&rest body) +; "Execute BODY, but don't call the after-change functions till the end. +; If BODY makes changes in the buffer, they are recorded +; and the functions on `after-change-functions' are called several times +; when BODY is finished. +; The return value is the value of the last form in BODY. + +; If `before-change-functions' is non-nil, then calls to the after-change +; functions can't be deferred, so in that case this macro has no effect. + +; Do not alter `after-change-functions' or `before-change-functions' +; in BODY." +; `(unwind-protect +; (let ((combine-after-change-calls t)) +; . ,body) +; (combine-after-change-execute))) + +(defmacro with-syntax-table (table &rest body) + "Evaluate BODY with syntax table of current buffer set to a copy of TABLE. +The syntax table of the current buffer is saved, BODY is evaluated, and the +saved table is restored, even in case of an abnormal exit. +Value is what BODY returns." + (let ((old-table (make-symbol "table")) + (old-buffer (make-symbol "buffer"))) + `(let ((,old-table (syntax-table)) + (,old-buffer (current-buffer))) + (unwind-protect + (progn + (set-syntax-table (copy-syntax-table ,table)) + ,@body) + (save-current-buffer + (set-buffer ,old-buffer) + (set-syntax-table ,old-table)))))) + +(put 'with-syntax-table 'lisp-indent-function 1) +(put 'with-syntax-table 'edebug-form-spec '(form body)) + + ;; Moved from mule-coding.el. (defmacro with-string-as-buffer-contents (str &rest body) "With the contents of the current buffer being STR, run BODY. @@ -523,6 +571,222 @@ ,@body (buffer-string))) + +(defmacro save-match-data (&rest body) + "Execute BODY forms, restoring the global value of the match data." + (let ((original (make-symbol "match-data"))) + (list 'let (list (list original '(match-data))) + (list 'unwind-protect + (cons 'progn body) + (list 'store-match-data original))))) + + +(defun match-string (num &optional string) + "Return string of text matched by last search. +NUM specifies which parenthesized expression in the last regexp. + Value is nil if NUMth pair didn't match, or there were less than NUM pairs. +Zero means the entire text matched by the whole regexp or whole string. +STRING should be given if the last search was by `string-match' on STRING." + (if (match-beginning num) + (if string + (substring string (match-beginning num) (match-end num)) + (buffer-substring (match-beginning num) (match-end num))))) + +(defun match-string-no-properties (num &optional string) + "Return string of text matched by last search, without text properties. +NUM specifies which parenthesized expression in the last regexp. + Value is nil if NUMth pair didn't match, or there were less than NUM pairs. +Zero means the entire text matched by the whole regexp or whole string. +STRING should be given if the last search was by `string-match' on STRING." + (if (match-beginning num) + (if string + (let ((result + (substring string (match-beginning num) (match-end num)))) + (set-text-properties 0 (length result) nil result) + result) + (buffer-substring-no-properties (match-beginning num) + (match-end num))))) + +(defconst split-string-default-separators "[ \f\t\n\r\v]+" + "The default value of separators for `split-string'. + +A regexp matching strings of whitespace. May be locale-dependent +\(as yet unimplemented). Should not match non-breaking spaces. + +Warning: binding this to a different value and using it as default is +likely to have undesired semantics.") + +;; specification for `split-string' agreed with rms 2003-04-23 +;; xemacs design <87vfx5vor0.fsf@tleepslib.sk.tsukuba.ac.jp> + +(defun split-string (string &optional separators omit-nulls) + "Splits STRING into substrings bounded by matches for SEPARATORS. + +The beginning and end of STRING, and each match for SEPARATORS, are +splitting points. The substrings matching SEPARATORS are removed, and +the substrings between the splitting points are collected as a list, +which is returned. + +If SEPARATORS is nil, it defaults to the value of +`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\". + +If OMIT-NULLs is t, zero-length substrings are omitted from the list \(so +that for the default value of SEPARATORS leading and trailing whitespace +are effectively trimmed). If nil, all zero-length substrings are retained, +which correctly parses CSV format, for example. + +As a special case, if both SEPARATORS and OMIT-NULLS are nil, white-space +will be trimmed (ie, the effect of `(split-string STRING)' is the same as +`(split-string STRING split-string-default-separators t)'). In the very +rare case that you need to retain zero-length substrings when splitting on +the default separators, use +`(split-string STRING split-string-default-separators)'. + +Modifies the match data; use `save-match-data' if necessary." + + (let ((keep-nulls (if separators (not omit-nulls) nil)) + (rexp (or separators split-string-default-separators)) + (start 0) + notfirst + (list nil)) + (while (and (string-match rexp string + (if (and notfirst + (= start (match-beginning 0)) + (< start (length string))) + (1+ start) start)) + (< start (length string))) + (setq notfirst t) + (if (or keep-nulls (< start (match-beginning 0))) + (setq list + (cons (substring string start (match-beginning 0)) + list))) + (setq start (match-end 0))) + (if (or keep-nulls (< start (length string))) + (setq list + (cons (substring string start) + list))) + (nreverse list))) + +(defun subst-char-in-string (fromchar tochar string &optional inplace) + "Replace FROMCHAR with TOCHAR in STRING each time it occurs. +Unless optional argument INPLACE is non-nil, return a new string." + (let ((i (length string)) + (newstr (if inplace string (copy-sequence string)))) + (while (> i 0) + (setq i (1- i)) + (if (eq (aref newstr i) fromchar) + (aset newstr i tochar))) + newstr)) + + +;; XEmacs addition: +(defun replace-in-string (str regexp newtext &optional literal) + "Replace all matches in STR for REGEXP with NEWTEXT string, + and returns the new string. +Optional LITERAL non-nil means do a literal replacement. +Otherwise treat `\\' in NEWTEXT as special: + `\\&' in NEWTEXT means substitute original matched text. + `\\N' means substitute what matched the Nth `\\(...\\)'. + If Nth parens didn't match, substitute nothing. + `\\\\' means insert one `\\'. + `\\u' means upcase the next character. + `\\l' means downcase the next character. + `\\U' means begin upcasing all following characters. + `\\L' means begin downcasing all following characters. + `\\E' means terminate the effect of any `\\U' or `\\L'." + (check-argument-type 'stringp str) + (check-argument-type 'stringp newtext) + (if (> (length str) 50) + (let ((cfs case-fold-search)) + (with-temp-buffer + (setq case-fold-search cfs) + (insert str) + (goto-char 1) + (while (re-search-forward regexp nil t) + (replace-match newtext t literal)) + (buffer-string))) + (let ((start 0) newstr) + (while (string-match regexp str start) + (setq newstr (replace-match newtext t literal str) + start (+ (match-end 0) (- (length newstr) (length str))) + str newstr)) + str))) + +(defun replace-regexp-in-string (regexp rep string &optional + fixedcase literal subexp start) + "Replace all matches for REGEXP with REP in STRING. + +Return a new string containing the replacements. + +Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the +arguments with the same names of function `replace-match'. If START +is non-nil, start replacements at that index in STRING. + +REP is either a string used as the NEWTEXT arg of `replace-match' or a +function. If it is a function it is applied to each match to generate +the replacement passed to `replace-match'; the match-data at this +point are such that match 0 is the function's argument. + +To replace only the first match (if any), make REGEXP match up to \\' +and replace a sub-expression, e.g. + (replace-regexp-in-string \"\\(foo\\).*\\'\" \"bar\" \" foo foo\" nil nil 1) + => \" bar foo\" +" + + ;; To avoid excessive consing from multiple matches in long strings, + ;; don't just call `replace-match' continually. Walk down the + ;; string looking for matches of REGEXP and building up a (reversed) + ;; list MATCHES. This comprises segments of STRING which weren't + ;; matched interspersed with replacements for segments that were. + ;; [For a `large' number of replacments it's more efficient to + ;; operate in a temporary buffer; we can't tell from the function's + ;; args whether to choose the buffer-based implementation, though it + ;; might be reasonable to do so for long enough STRING.] + (let ((l (length string)) + (start (or start 0)) + matches str mb me) + (save-match-data + (while (and (< start l) (string-match regexp string start)) + (setq mb (match-beginning 0) + me (match-end 0)) + ;; If we matched the empty string, make sure we advance by one char + (when (= me mb) (setq me (min l (1+ mb)))) + ;; Generate a replacement for the matched substring. + ;; Operate only on the substring to minimize string consing. + ;; Set up match data for the substring for replacement; + ;; presumably this is likely to be faster than munging the + ;; match data directly in Lisp. + (string-match regexp (setq str (substring string mb me))) + (setq matches + (cons (replace-match (if (stringp rep) + rep + (funcall rep (match-string 0 str))) + fixedcase literal str subexp) + (cons (substring string start mb) ; unmatched prefix + matches))) + (setq start me)) + ;; Reconstruct a string from the pieces. + (setq matches (cons (substring string start l) matches)) ; leftover + (apply #'concat (nreverse matches))))) + +;; END SYNCHED WITH FSF 21.2 + + +;;; Basic string functions + +;; XEmacs +(defun string-equal-ignore-case (str1 str2) + "Return t if two strings have identical contents, ignoring case differences. +Case is not significant. Text properties and extents are ignored. +Symbols are also allowed; their print names are used instead. + +See also `equalp'." + (if (symbolp str1) + (setq str1 (symbol-name str1))) + (if (symbolp str2) + (setq str2 (symbol-name str2))) + (eq t (compare-strings str1 nil nil str2 nil nil t))) + (defun insert-face (string face) "Insert STRING and highlight with FACE. Return the extent created." (let ((p (point)) ext) @@ -606,7 +870,7 @@ ;; From FSF 21.1; ELLIPSES is XEmacs addition. (defun truncate-string-to-width (str end-column &optional start-column padding - ellipses) + ellipses) "Truncate string STR to end at column END-COLUMN. The optional 3rd arg START-COLUMN, if non-nil, specifies the starting column; that means to return the characters occupying @@ -1224,6 +1488,8 @@ ;; Probably the old way. (buffer-substring buffer old-end old-buffer)))) +;; BEGIN SYNC WITH FSF 21.2 + ;; This was not present before. I think Jamie had some objections ;; to this, so I'm leaving this undefined for now. --ben @@ -1244,7 +1510,13 @@ This makes or adds to an entry on `after-load-alist'. If FILE is already loaded, evaluate FORM right now. It does nothing if FORM is already on the list for FILE. -FILE should be the name of a library, with no directory name." +FILE must match exactly. Normally FILE is the name of a library, +with no directory or extension specified, since that is how `load' +is normally called." + ;; Make sure `load-history' contains the files dumped with Emacs + ;; for the case that FILE is one of the files dumped with Emacs. + (if-fboundp 'load-symbol-file-load-history + (load-symbol-file-load-history)) ;; Make sure there is an element for FILE. (or (assoc file after-load-alist) (setq after-load-alist (cons (list file) after-load-alist))) @@ -1266,16 +1538,6 @@ (eval-after-load file (read))) (make-compatible 'eval-next-after-load "") -; alternate names (not obsolete) -(if (not (fboundp 'mod)) (define-function 'mod '%)) -(define-function 'move-marker 'set-marker) -(define-function 'beep 'ding) ; preserve lingual purity -(define-function 'indent-to-column 'indent-to) -(define-function 'backward-delete-char 'delete-backward-char) -(define-function 'search-forward-regexp (symbol-function 're-search-forward)) -(define-function 'search-backward-regexp (symbol-function 're-search-backward)) -(define-function 'remove-directory 'delete-directory) -(define-function 'set-match-data 'store-match-data) -(define-function 'send-string-to-terminal 'external-debugging-output) +;; END SYNC WITH FSF 21.2 ;;; subr.el ends here Index: lisp/unicode.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/unicode.el,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- lisp/unicode.el 1 Sep 2002 06:41:41 -0000 1.6 +++ lisp/unicode.el 21 Feb 2003 06:56:47 -0000 1.7 @@ -164,7 +164,7 @@ (let ((undir (expand-file-name (car tables) data-directory))) (mapcar #'(lambda (args) - (apply 'parse-unicode-translation-table + (apply 'load-unicode-mapping-table (expand-file-name (car args) undir) (cdr args))) (cdr tables)))) Index: lisp/update-elc-2.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/update-elc-2.el,v retrieving revision 1.9 retrieving revision 1.11 diff -u -r1.9 -r1.11 --- lisp/update-elc-2.el 15 Feb 2003 10:15:55 -0000 1.9 +++ lisp/update-elc-2.el 1 Mar 2003 07:25:27 -0000 1.11 @@ -66,8 +66,7 @@ "^site-start\\.el$" "^site-load\\.el$" "^site-init\\.el$" - "^version\\.el$" - "^very-early-lisp\\.el$")) + "^version\\.el$")) (defvar dirfiles-table (make-hash-table :test 'equal)) @@ -148,17 +147,22 @@ ;; update-elc.el signals us to rebuild the autoloads when necessary. ;; in some cases it will rebuild the autoloads itself, but doing it this ;; way is slow, so we avoid it when possible. - (when (file-exists-p "../src/REBUILD_AUTOLOADS") + (when (file-exists-p (expand-file-name "REBUILD_AUTOLOADS" + invocation-directory)) (let ((generated-autoload-file (expand-file-name "auto-autoloads.el" dir)) (autoload-package-name "auto")) ; feature prefix - (update-autoload-files (list dir)) + ;; if we were instructed to rebuild the autoloads, force the file + ;; to be touched even w/o changes; otherwise, we won't ever stop + ;; being told to rebuild them. + (update-autoload-files (list dir) nil t) (byte-recompile-file generated-autoload-file 0)) (when (featurep 'mule) (let* ((muledir (expand-file-name "../lisp/mule" (file-truename dir))) (generated-autoload-file (expand-file-name "auto-autoloads.el" muledir)) (autoload-package-name "mule")) ; feature prefix - (update-autoload-files (list muledir)) + ;; force here just like above. + (update-autoload-files (list muledir) nil t) (byte-recompile-file generated-autoload-file 0)))) (when (featurep 'modules) (let* ((moddir (expand-file-name "../modules" (file-truename dir))) @@ -173,9 +177,9 @@ (byte-recompile-file generated-autoload-file 0))) ;; now load the (perhaps newly rebuilt) autoloads; we were called with ;; -no-autoloads so they're not already loaded. - (load "../lisp/auto-autoloads") + (load (expand-file-name "auto-autoloads" lisp-directory)) (when (featurep 'mule) - (load "../lisp/mule/auto-autoloads")) + (load (expand-file-name "mule/auto-autoloads" lisp-directory))) ;; We remove all the bad .elcs before any byte-compilation, because ;; there may be dependencies between one .el and another (even across ;; directories), and we don't want to load an out-of-date .elc while Index: lisp/update-elc.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/update-elc.el,v retrieving revision 1.30 retrieving revision 1.32 diff -u -r1.30 -r1.32 --- lisp/update-elc.el 15 Feb 2003 10:15:55 -0000 1.30 +++ lisp/update-elc.el 1 Mar 2003 07:25:27 -0000 1.32 @@ -58,10 +58,10 @@ (defvar need-to-rebuild-mule-autoloads nil) (defvar need-to-recompile-autoloads nil) (defvar need-to-recompile-mule-autoloads nil) -(defvar undumped-exe nil) -;(defvar dumped-exe nil) -(defvar dumped-exe-out-of-date-wrt-dump-files nil) -;(defvar dumped-exe-out-of-date-wrt-undumped-exe nil) +(defvar exe-target nil) +(defvar dump-target nil) +(defvar dump-target-out-of-date-wrt-dump-files nil) +;(defvar dump-target-out-of-date-wrt-exe-target nil) ;(setq update-elc-files-to-compile ; (delq nil @@ -78,14 +78,22 @@ ; ;; -batch gets filtered out. ; (nthcdr 3 command-line-args)))) -(let ((build-root (expand-file-name ".." invocation-directory))) - (setq load-path (list (expand-file-name "lisp" build-root)))) -(load "very-early-lisp.el") +(defvar build-root (expand-file-name ".." invocation-directory)) +(defvar source-lisp (file-name-directory (expand-file-name + (nth 2 command-line-args)))) +(defvar source-lisp-mule (expand-file-name "mule" source-lisp)) +(defvar source-root (expand-file-name ".." source-lisp)) +(defvar aa-lisp (expand-file-name "auto-autoloads.el" source-lisp)) +(defvar aac-lisp (expand-file-name "auto-autoloads.elc" source-lisp)) +(defvar aa-lisp-mule (expand-file-name "auto-autoloads.el" source-lisp-mule)) +(defvar aac-lisp-mule (expand-file-name "auto-autoloads.elc" source-lisp-mule)) + +(setq load-path (list source-lisp)) + (load "find-paths.el") (load "packages.el") (load "setup-paths.el") -(load "dump-paths.el") ;; #### take out in my fixup ws ;; Lisp files loaded in order to byte compile anything. If any are out of ;; date, we need to load them as .el's, byte compile them, and reload as @@ -108,8 +116,7 @@ "dumped-lisp.el" "dumped-pkg-lisp.el" "raw-process.el" - "version.el" - "very-early-lisp.el") + "version.el") "Lisp files that should not be byte compiled.") (defvar lisp-files-ignored-when-checking-for-autoload-updating @@ -128,38 +135,39 @@ (let (preloaded-file-list site-load-packages files-to-process) - (load (expand-file-name "../lisp/dumped-lisp.el")) + (load (expand-file-name "dumped-lisp.el" source-lisp)) - (setq dumped-exe - (cond ((file-exists-p "../src/xemacs.exe") "../src/xemacs.exe") - ((file-exists-p "../src/xemacs") "../src/xemacs") - (t nil))) - - ;; Not currently used but might be at some point. -; (let ((temacs-exe -; (cond ((file-exists-p "../src/temacs.exe") "../src/temacs.exe") -; ((file-exists-p "../src/temacs") "../src/temacs") -; (t nil))) -; (data-file -; (cond ((file-exists-p "../src/xemacs.dmp") "../src/xemacs.dmp") -; (t nil)))) - -; ;; two setups here: -; ;; (1) temacs.exe is undumped, dumped into xemacs.exe. Happens with -; ;; unexec, but also with pdump under MS Windows native, since -; ;; the dumped data is stored as a resource in the xemacs.exe -; ;; executable. -; ;; (2) xemacs.exe is dumped or undumped. Running `xemacs -nd' gets -; ;; you the equivalent of `temacs'. Dumping creates a file -; ;; `xemacs.dmp'. - -; (setq dumped-exe-out-of-date-wrt-undumped-exe -; (cond ((not dumped-exe) t) -; (temacs-exe (file-newer-than-file-p temacs-exe dumped-exe)) -; ((not data-file) t) -; (t (file-newer-than-file-p dumped-exe data-file)))) -; (setq dumped-exe-exists (or (and temacs-exe dumped-exe) -; (and data-file dumped-exe)))) + ;; two setups here: + ;; (1) temacs.exe is undumped, dumped into xemacs.exe. Happens with + ;; unexec, but also with pdump under MS Windows native, since + ;; the dumped data is stored as a resource in the xemacs.exe + ;; executable. + ;; (2) xemacs.exe is dumped or undumped. Running `xemacs -nd' gets + ;; you the equivalent of `temacs'. Dumping creates a file + ;; `xemacs.dmp'. + + (cond ((eq system-type 'windows-nt) + (setq exe-target "src/temacs.exe" + dump-target "src/xemacs.exe")) + ;; #### need better ways of getting config params + ((not (memq 'pdump (emacs-run-status))) + (setq exe-target "src/temacs" + dump-target "src/xemacs")) + (t + (setq exe-target "src/xemacs" + dump-target "src/xemacs.dmp"))) + + (setq exe-target (expand-file-name exe-target build-root)) + (setq dump-target (expand-file-name dump-target build-root)) + + ;; Not currently used. +; (setq dump-target-out-of-date-wrt-exe-target +; (cond ((not dump-target) t) +; (temacs-exe (file-newer-than-file-p temacs-exe dump-target)) +; ((not data-file) t) +; (t (file-newer-than-file-p dump-target data-file)))) +; (setq dump-target-exists (or (and temacs-exe dump-target) +; (and data-file dump-target)))) ;; Path setup (let ((package-preloaded-file-list @@ -170,7 +178,7 @@ preloaded-file-list packages-hardcoded-lisp))) - (load (concat default-directory "../site-packages") t t) + (load (expand-file-name "site-packages" source-root) t t) (setq preloaded-file-list (append packages-hardcoded-lisp preloaded-file-list @@ -205,12 +213,12 @@ ;; now check if .el or .elc is newer than the dumped exe. ;; if so, need to redump. - (when (and dumped-exe arg-is-preloaded + (when (and dump-target arg-is-preloaded ;; no need to check for existence of either of the files ;; because of the definition of file-newer-than-file-p. - (or (file-newer-than-file-p full-arg-el dumped-exe) - (file-newer-than-file-p full-arg-elc dumped-exe))) - (setq dumped-exe-out-of-date-wrt-dump-files t)) + (or (file-newer-than-file-p full-arg-el dump-target) + (file-newer-than-file-p full-arg-elc dump-target))) + (setq dump-target-out-of-date-wrt-dump-files t)) (if (and (not (member (file-name-nondirectory arg) unbytecompiled-lisp-files)) @@ -224,14 +232,14 @@ ;; Check if we need to rebuild the auto-autoloads.el files -- that is, ;; if ANY .el files have changed. - (let ((dirs-to-check '("../lisp" "../lisp/mule"))) + (let ((dirs-to-check (list source-lisp source-lisp-mule))) (while dirs-to-check (let* ((dir (car dirs-to-check)) (full-dir (expand-file-name dir)) (all-files-in-dir (directory-files full-dir t "\\.el$" nil t)) (autoload-file (expand-file-name "auto-autoloads.el" full-dir)) - (autoload-is-mule (equal dir "../lisp/mule"))) + (autoload-is-mule (equal dir source-lisp-mule))) (while all-files-in-dir (let* ((full-arg (car all-files-in-dir))) ;; custom-load.el always gets regenerated so don't let that @@ -248,9 +256,10 @@ (setq all-files-in-dir (cdr all-files-in-dir)))) (setq dirs-to-check (cdr dirs-to-check)))) - (if dumped-exe-out-of-date-wrt-dump-files + (if dump-target-out-of-date-wrt-dump-files (condition-case nil - (write-region-internal "foo" nil "../src/NEEDTODUMP") + (write-region-internal + "foo" nil (expand-file-name "src/NEEDTODUMP" build-root)) (file-error nil))) ) @@ -260,20 +269,18 @@ ;; doesn't exist, need-to-rebuild-autoloads gets set above. but ;; it's only one call, so it won't slow things down much and it keeps ;; the logic cleaner. - (not (file-exists-p "../lisp/auto-autoloads.el")) + (not (file-exists-p aa-lisp)) ;; no need to check for file-exists of .elc due to definition ;; of file-newer-than-file-p - (file-newer-than-file-p "../lisp/auto-autoloads.el" - "../lisp/auto-autoloads.elc")) + (file-newer-than-file-p aa-lisp aac-lisp)) (setq need-to-recompile-autoloads t)) (when (or need-to-rebuild-mule-autoloads ;; not necessary but ... see comment above. - (not (file-exists-p "../lisp/mule/auto-autoloads.el")) + (not (file-exists-p aa-lisp-mule)) ;; no need to check for file-exists of .elc due to definition ;; of file-newer-than-file-p - (file-newer-than-file-p "../lisp/mule/auto-autoloads.el" - "../lisp/mule/auto-autoloads.elc")) + (file-newer-than-file-p aa-lisp-mule aac-lisp-mule)) (setq need-to-recompile-mule-autoloads t)) (when (not (featurep 'mule)) @@ -290,34 +297,29 @@ (append (if (or need-to-rebuild-autoloads need-to-rebuild-mule-autoloads) - '("-l" "autoload")) + (list "-l" "autoload")) (if need-to-rebuild-autoloads - '("-f" "autoload-update-directory-autoloads" - "auto" "../lisp")) + (list "-f" "autoload-update-directory-autoloads" + "auto" source-lisp)) (if need-to-rebuild-mule-autoloads - '("-f" "autoload-update-directory-autoloads" - "mule" "../lisp/mule")) + (list "-f" "autoload-update-directory-autoloads" + "mule" source-lisp-mule)) (if need-to-recompile-autoloads - '("-f" "batch-byte-compile-one-file" - "../lisp/auto-autoloads.el")) + (list "-f" "batch-byte-compile-one-file" + aa-lisp)) (if need-to-recompile-mule-autoloads - '("-f" "batch-byte-compile-one-file" - "../lisp/mule/auto-autoloads.el"))))) + (list "-f" "batch-byte-compile-one-file" + aa-lisp-mule))))) (condition-case nil - (delete-file "../src/REBUILD_AUTOLOADS") + (delete-file (expand-file-name "src/REBUILD_AUTOLOADS" build-root)) (file-error nil)) (cond ((and (not update-elc-files-to-compile) (not need-to-rebuild-autoloads) (not need-to-rebuild-mule-autoloads) (not need-to-recompile-autoloads) (not need-to-recompile-mule-autoloads)) - ;; (1) Nothing to do at all. BYTECOMPILE_CHANGE is used (only by - ;; the Unix makefile) to indicate whether some files needed - ;; for dump got recompiled, and hence the executable must be - ;; redumped. We remove it if there were no files to compile. - (condition-case nil - (delete-file "../src/BYTECOMPILE_CHANGE") - (file-error nil))) + ;; (1) Nothing to do at all. + ) ((not update-elc-files-to-compile) ;; (2) We have no files to byte-compile, but we do need to ;; regenerate and compile the auto-autoloads file, so signal @@ -326,11 +328,10 @@ ;; the autoloads here when we have files to compile, since ;; they may depend on the updated autoloads.) (condition-case nil - (write-region-internal "foo" nil "../src/REBUILD_AUTOLOADS") + (write-region-internal + "foo" nil (expand-file-name "src/REBUILD_AUTOLOADS" build-root)) (file-error nil)) - (condition-case nil - (delete-file "../src/BYTECOMPILE_CHANGE") - (file-error nil))) + ) (t (let ((bc-bootstrap (mapcar #'(lambda (arg) Index: lisp/very-early-lisp.el =================================================================== RCS file: lisp/very-early-lisp.el diff -N lisp/very-early-lisp.el --- lisp/very-early-lisp.el 15 Mar 2002 07:43:22 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,76 +0,0 @@ -;;; very-early-lisp.el --- Lisp support always needed by temacs - -;; Copyright (C) 1998 by Free Software Foundation, Inc. - -;; Author: SL Baur -;; Michael Sperber [Mr. Preprocessor] -;; Keywords: internal, dumped - -;; This file is part of XEmacs. - -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; XEmacs is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the Free -;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;; 02111-1307, USA. - -;;; Synched up with: Not in FSF - -;;; Commentary: - -;; This file must be loaded by temacs if temacs is to process bytecode or -;; dumped-lisp.el files. The functions in here are used by dumped-lisp.el, -;; and by files called dumped-lisp.el in packages when they need to have -;; stuff dumped into XEmacs. (???? I thought we got rid of this entirely. -;; The only thing left is egg-its/dumped-lisp.el. We should fix it, then -;; combine this file into our own dumped-lisp.el. --ben - -;;; Code: - -;;; Intended replacement for read-time Lisp reader macros #-, #+ - -(defmacro assemble-list (&rest components) - "Assemble a list from COMPONENTS. -This is a poor man's backquote: -COMPONENTS is a list, each element of which is macro-expanded. -Each macro-expanded element either has the form (SPLICE stuff), -in which case stuff must be a list which is spliced into the result. -Otherwise, the component becomes an element of the list." - (cons - 'append - (mapcar #'(lambda (component) - (let ((component (macroexpand-internal component))) - (if (and (consp component) - (eq 'splice (car component))) - (car (cdr component)) - (list 'list component)))) - components))) - -(defmacro when-feature (feature stuff) - "Insert STUFF as a list element if FEATURE is a loaded feature. -This is intended for use as a component of ASSEMBLE-LIST." - (list 'splice - (list 'if (list 'featurep (list 'quote feature)) - (list 'list stuff) - '()))) - -(defmacro unless-feature (feature stuff) - "Insert STUFF as a list element if FEATURE is NOT a loaded feature. -This is intended for use as a component of ASSEMBLE-LIST." - (list 'splice - (list 'if (list 'featurep (list 'quote feature)) - '() - (list 'list stuff)))) - -(provide 'very-early-lisp) - -;;; very-early-lisp.el ends here Index: lisp/view-less.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/view-less.el,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- lisp/view-less.el 15 Dec 2001 11:46:34 -0000 1.5 +++ lisp/view-less.el 2 Mar 2003 09:38:40 -0000 1.6 @@ -48,6 +48,7 @@ (defvar view-default-lines 10 "Default value for the \"d\" and \"u\" commands in view-mode") +;;;###autoload (defvar view-minor-mode nil "Non-nil when view-mode is active. Call `view-mode' to toggle.") (make-variable-buffer-local 'view-minor-mode) Index: lisp/wid-edit.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/wid-edit.el,v retrieving revision 1.22 retrieving revision 1.26 diff -u -r1.22 -r1.26 --- lisp/wid-edit.el 26 Dec 2002 15:52:43 -0000 1.22 +++ lisp/wid-edit.el 24 Mar 2003 14:51:46 -0000 1.26 @@ -1,6 +1,6 @@ ;;; wid-edit.el --- Functions for creating and using widgets. ;; -;; Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. +;; Copyright (C) 1996-1997, 1999-2002 Free Software Foundation, Inc. ;; ;; Author: Per Abrahamsen ;; Maintainer: Hrvoje Niksic @@ -27,14 +27,14 @@ ;;; Commentary: ;; -;; See `widget.el'. +;; See `widget.el' and the wishlist in `../man/widget.texi'. ;;; Code: (require 'widget) -(autoload 'finder-commentary "finder" nil t) +;; XEmacs: autoload of `finder-commentary' is redundant. ;;; Customization. @@ -85,7 +85,21 @@ :type 'face :group 'widget-faces) -(defface widget-field-face '((((class grayscale color) +;; #### comment from GNU Emacs 21.3.50, test the first spec. +;; TTY gets special definitions here and in the next defface, because +;; the gray colors defined for other displays cause black text on a black +;; background, at least on light-background TTYs. +(defface widget-field-face '( + ;; #### sjt sez: XEmacs doesn't like this. + ;; The Custom face editor widget shows a Lisp + ;; form, not a face structure. Does it produce + ;; the right face on TTYs? + ;; One hypothesis is that the editor doesn't + ;; grok non-default display types in the value. + (((type tty)) + (:background "yellow3") + (:foreground "black")) + (((class grayscale color) (background light)) (:background "gray85")) (((class grayscale color) @@ -144,38 +158,64 @@ (setq plist (cddr plist))) plist)) -(defun widget-princ-to-string (object) - ;; Return string representation of OBJECT, any Lisp object. - ;; No quoting characters are used; no delimiters are printed around - ;; the contents of strings. - (with-current-buffer (get-buffer-create " *widget-tmp*") - (erase-buffer) - (princ object (current-buffer)) - (buffer-string))) +(defsubst widget-princ-to-string (object) + "Return string representation of OBJECT, any Lisp object. + +No quoting characters or string delimiters are used." + ;(with-current-buffer (get-buffer-create " *widget-tmp*") + ; (erase-buffer) + ; (princ object (current-buffer)) + ; (buffer-string)) + (prin1-to-string object t) + ) (defun widget-prettyprint-to-string (object) - ;; Like pp-to-string, but uses `cl-prettyprint' - (with-current-buffer (get-buffer-create " *widget-tmp*") - (erase-buffer) + "Use `cl-prettyprint' to generate a string representation of OBJECT. + +Cleans up `cl-prettyprint''s gratuitous surrounding newlines." + (with-temp-buffer (cl-prettyprint object) ;; `cl-prettyprint' always surrounds the text with newlines. - (when (eq (char-after (point-min)) ?\n) - (delete-region (point-min) (1+ (point-min)))) - (when (eq (char-before (point-max)) ?\n) - (delete-region (1- (point-max)) (point-max))) - (buffer-string))) + (buffer-string (if (eq (char-after (point-min)) ?\n) + (1+ (point-min)) + (point-min)) + (if (eq (char-before (point-max)) ?\n) + (1- (point-max)) + (point-max))))) (defun widget-clear-undo () "Clear all undo information." (buffer-disable-undo) (buffer-enable-undo)) +(defun widget-sublist (list start &optional end) + "Return the sublist of LIST from START to END. +If END is omitted, it defaults to the length of LIST." + (if (> start 0) (setq list (nthcdr start list))) + (if end + (if (<= end start) + nil + (setq list (copy-sequence list)) + (setcdr (nthcdr (- end start 1) list) nil) + list) + (copy-sequence list))) + +;; Is unimplemented the right superclass? +(define-error 'missing-package "Package not installed" 'unimplemented) + (defcustom widget-menu-max-size 40 "Largest number of items allowed in a popup-menu. Larger menus are read through the minibuffer." :group 'widgets :type 'integer) +(defcustom widget-menu-max-shortcuts 40 + "Largest number of items for which it works to choose one with a character. +For a larger number of items, the minibuffer is used. +#### Not yet implemented in XEmacs." + :group 'widgets + :type 'integer) + (defcustom widget-menu-minibuffer-flag nil "*Control how to ask for a choice from the keyboard. Non-nil means use the minibuffer; @@ -192,11 +232,10 @@ indicate unselectable items. Optional third argument EVENT is an input event. -The user is asked to choose between each NAME from the items alist, -and the VALUE of the chosen element will be returned. If EVENT is a -mouse event, and the number of elements in items is less than -`widget-menu-max-size', a popup menu will be used, otherwise the -minibuffer." +The user is asked to choose a NAME from the items alist, and the VALUE of +the chosen element will be returned. If EVENT is a mouse event, and the +number of elements in items is less than `widget-menu-max-size', a popup +menu will be used, otherwise the minibuffer is used." (cond ((and (< (length items) widget-menu-max-size) event (console-on-window-system-p)) @@ -276,20 +315,32 @@ (cdr (assoc val items))) nil))))) +;; GNU Emacs 21.3.50 uses this in `widget-choose' +(defun widget-remove-if (predicate list) + (let (result (tail list)) + (while tail + (or (funcall predicate (car tail)) + (setq result (cons (car tail) result))) + (setq tail (cdr tail))) + (nreverse result))) + ;;; Widget text specifications. ;; ;; These functions are for specifying text properties. +;; XEmacs: This probably should be unnecessary with end-closed extents. +;; If it doesn't work, it should be made to work. (defcustom widget-field-add-space t ;; Setting this to nil might be available, once some problems are resolved. "Non-nil means add extra space at the end of editable text fields. -This is needed on all versions of Emacs. If you don't add the space, -it will become impossible to edit a zero size field." +Currently should be left set to `t', because without the space it becomes +impossible to edit a zero size field." :type 'boolean :group 'widgets) +;; #### Why aren't these used in XEmacs? (defcustom widget-field-use-before-change (and (or (> emacs-minor-version 34) (> emacs-major-version 19)) @@ -325,7 +376,7 @@ (goto-char to) (cond ((null (widget-get widget :size)) (forward-char 1)) - ;; #### This comment goes outside of the save-excursion in GNU + ;; XEmacs: This comment goes outside of the save-excursion in GNU. ;; Terminating space is not part of the field, but necessary in ;; order for local-map to work. Remove next sexp if local-map works ;; at the end of the extent. @@ -351,8 +402,9 @@ (widget-specify-secret widget)) (defun widget-specify-secret (field) - "Replace text in FIELD with value of `:secret', if non-nil. + "Replace text in FIELD with value of the `:secret' property, if non-nil. +The value of the `:secret' property, if non-nil, must be a character. It is an error to use this function after creating the widget but before invoking `widget-setup'." (let ((secret (widget-get field :secret)) @@ -401,7 +453,7 @@ (format "(widget %S :help-echo %S)" widget help-echo))))) (defun widget-specify-sample (widget from to) - ;; Specify sample for WIDGET between FROM and TO. + "Specify sample for WIDGET between FROM and TO." (let ((face (widget-apply widget :sample-face-get)) (extent (make-extent from to nil))) (set-extent-property extent 'start-open t) @@ -409,7 +461,7 @@ (widget-put widget :sample-extent extent))) (defun widget-specify-doc (widget from to) - ;; Specify documentation for WIDGET between FROM and TO. + "Specify documentation for WIDGET between FROM and TO." (let ((extent (make-extent from to))) (set-extent-property extent 'start-open t) (set-extent-property extent 'widget-doc widget) @@ -551,6 +603,15 @@ "Return the type of WIDGET, a symbol." (car widget)) +;;;###autoload +(defun widgetp (widget) + "Return non-nil iff WIDGET is a widget." + (if (symbolp widget) + (get widget 'widget-type) + (and (consp widget) + (symbolp (car widget)) + (get (car widget) 'widget-type)))) + (when (or (not (fboundp 'widget-put)) widget-shadow-subrs) (defun widget-put (widget property value) @@ -655,8 +716,7 @@ (defun widget-get-sibling (widget) "Get the item WIDGET is assumed to toggle. This is only meaningful for radio buttons or checkboxes in a list." - (let* ((parent (widget-get widget :parent)) - (children (widget-get parent :children)) + (let* ((children (widget-get (widget-get widget :parent) :children)) child) (catch 'child (while children @@ -684,17 +744,21 @@ ;;; Glyphs. (defcustom widget-glyph-directory (locate-data-directory "custom") - "Where widget glyphs are located. + "Where widget button glyphs are located. If this variable is nil, widget will try to locate the directory automatically." :group 'widgets :type 'directory) (defcustom widget-glyph-enable t - "If non nil, use glyphs in images when available." + "If non nil, use glyph buttons in widgets when available." :group 'widgets :type 'boolean) +;; #### What happens if you try to customize this? +(define-compatible-variable-alias 'widget-image-conversion + 'widget-image-file-name-suffixes) + (defcustom widget-image-file-name-suffixes '((xpm ".xpm") (gif ".gif") (png ".png") (jpeg ".jpg" ".jpeg") (xbm ".xbm")) @@ -857,14 +921,16 @@ ;;;###autoload (defun widget-create (type &rest args) "Create a widget of type TYPE. -The optional ARGS are additional keyword arguments." + +TYPE is copied, then converted to a widget using the keyword arguments ARGS." (let ((widget (apply 'widget-convert type args))) (widget-apply widget :create) widget)) (defun widget-create-child-and-convert (parent type &rest args) "As a child of widget PARENT, create a widget of type TYPE. -The child is converted, using the keyword arguments ARGS." + +TYPE is copied, then converted to a widget using the keyword arguments ARGS." (let ((widget (apply 'widget-convert type args))) (widget-put widget :parent parent) (unless (widget-get widget :indent) @@ -876,7 +942,8 @@ (defun widget-create-child (parent type) "As a child of widget PARENT, create a widget of type TYPE. -The child is not converted." + +TYPE is copied, then used as a widget as-is." (let ((widget (copy-sequence type))) (widget-put widget :parent parent) (unless (widget-get widget :indent) @@ -887,7 +954,9 @@ widget)) (defun widget-create-child-value (parent type value) - "Create widget of TYPE with value VALUE." + "As a child of widget PARENT, create a widget with type TYPE and value VALUE. + +TYPE is copied, then used as a widget as-is." (let ((widget (copy-sequence type))) (widget-put widget :value (widget-apply widget :value-to-internal value)) (widget-put widget :parent parent) @@ -903,25 +972,35 @@ "Delete WIDGET." (widget-apply widget :delete)) +(defun widget-copy (widget) + "Make a deep copy of WIDGET." + (widget-apply (copy-sequence widget) :copy)) + +;;;###autoload (defun widget-convert (type &rest args) "Convert TYPE to a widget without inserting it in the buffer. -The optional ARGS are additional keyword arguments." +The optional ARGS are additional keyword arguments. + +The widget's :args property is set from the longest tail of ARGS whose cdr +is not a keyword, or from the longest tail of TYPE's :args property whose +cdr is not a keyword. Keyword arguments from ARGS are set, and the :value +property (if any) is converted from external to internal format." ;; Don't touch the type. (let* ((widget (if (symbolp type) (list type) (copy-sequence type))) (current widget) (keys args)) - ;; First set the :args keyword. - (while (cdr current) ;Look in the type. + ;; First set the :args. + (while (cdr current) ; Use first non-keyword element of type. (let ((next (car (cdr current)))) - (if (and (symbolp next) (eq (aref (symbol-name next) 0) ?:)) + (if (keywordp next) (setq current (cdr (cdr current))) (setcdr current (list :args (cdr current))) (setq current nil)))) - (while args ;Look in the args. + (while args ; Use first non-keyword element in ARGS. (let ((next (nth 0 args))) - (if (and (symbolp next) (eq (aref (symbol-name next) 0) ?:)) + (if (keywordp next) (setq args (nthcdr 2 args)) (widget-put widget :args args) (setq args nil)))) @@ -935,19 +1014,21 @@ ;; Finally set the keyword args. (while keys (let ((next (nth 0 keys))) - (if (and (symbolp next) (eq (aref (symbol-name next) 0) ?:)) + (if (keywordp next) (progn (widget-put widget next (nth 1 keys)) (setq keys (nthcdr 2 keys))) (setq keys nil)))) ;; Convert the :value to internal format. (if (widget-member widget :value) - (let ((value (widget-get widget :value))) - (widget-put widget - :value (widget-apply widget :value-to-internal value)))) + (widget-put widget + :value (widget-apply widget + :value-to-internal + (widget-get widget :value)))) ;; Return the newly created widget. widget)) +;;;###autoload (defun widget-insert (&rest args) "Call `insert' with ARGS even if surrounding text is read only." (let ((inhibit-read-only t) @@ -991,13 +1072,12 @@ (button (widget-get widget :button-extent)) (sample (widget-get widget :sample-extent)) (doc (widget-get widget :doc-extent)) - (field (widget-get widget :field-extent)) - (children (widget-get widget :children))) + (field (widget-get widget :field-extent))) (set-marker from nil) (set-marker to nil) ;; Maybe we should delete the extents here? As this code doesn't ;; remove them from widget structures, maybe it's safer to just - ;; detach them. That's what `delete-overlay' did. + ;; detach them. That's what GNU-compatible `delete-overlay' does. (when button (detach-extent button)) (when sample @@ -1006,7 +1086,7 @@ (detach-extent doc)) (when field (detach-extent field)) - (mapc 'widget-leave-text children))) + (mapc 'widget-leave-text (widget-get widget :children)))) ;;; Keymap and Commands. @@ -1406,14 +1486,21 @@ ;;; Setting up the buffer. -(defvar widget-field-new nil) -;; List of all newly created editable fields in the buffer. +(defvar widget-field-new nil + "List of all newly created editable fields in the buffer.") (make-variable-buffer-local 'widget-field-new) -(defvar widget-field-list nil) -;; List of all editable fields in the buffer. +(defvar widget-field-list nil + "List of all editable fields in the buffer.") (make-variable-buffer-local 'widget-field-list) +;; Is this a misnomer? +(defun widget-at (pos) + "The button or field at POS." + (or (get-char-property pos 'button) + (get-char-property pos 'field))) + +;;;###autoload (defun widget-setup () "Setup current buffer so editing string widgets works." (let ((inhibit-read-only t) @@ -1446,6 +1533,13 @@ ;; The widget data before the change. (make-variable-buffer-local 'widget-field-was) +(defun widget-field-at (pos) + "Return the widget field at POS, or nil if none." + (let ((field (get-char-property (or pos (point)) 'field))) + (if (eq field 'boundary) + nil + field))) + (defun widget-field-buffer (widget) "Return the buffer containing WIDGET. @@ -1480,27 +1574,13 @@ Warning: using this function after creating the widget but before invoking `widget-setup' will always fail." + ;; XEmacs: use `map-extents' instead of a while loop (let ((field-extent (map-extents (lambda (extent ignore) extent) nil pos pos nil nil 'field))) (and field-extent (extent-property field-extent 'field)))) -;; Old version, without `map-extents'. -;(defun widget-field-find (pos) -; (let ((fields widget-field-list) -; field found) -; (while fields -; (setq field (car fields) -; fields (cdr fields)) -; (let ((start (widget-field-start field)) -; (end (widget-field-end field))) -; (when (and (<= start pos) (<= pos end)) -; (when found -; (debug "Overlapping fields")) -; (setq found field)))) -; found)) - ;; Warning: using this function after creating the widget but before ;; invoking `widget-setup' will always fail. (defun widget-before-change (from to) @@ -1541,10 +1621,10 @@ (add-hook 'after-change-functions 'widget-after-change nil t)) (defun widget-after-change (from to old) - ;; Adjust field size and text properties. + "Adjust field size and text properties. - ;; Also, notify the widgets (so, for example, a variable changes its - ;; state to `modified'. when it is being edited.) +Also, notify the widgets (so, for example, a variable changes its +state to `modified'. when it is being edited)." (condition-case nil (let ((field (widget-field-find from)) (other (widget-field-find to))) @@ -1604,13 +1684,19 @@ found (widget-apply child :validate))) found)) -(defun widget-types-convert-widget (widget) - "Convert :args as widget types in WIDGET." +(defun widget-types-copy (widget) + "Copy :args as widget types in WIDGET." + (widget-put widget :args (mapcar 'widget-copy (widget-get widget :args))) + widget) + +;; Made defsubst to speed up face editor creation. +(defsubst widget-types-convert-widget (widget) + "Convert each member of :args in WIDGET from a widget type to a widget." (widget-put widget :args (mapcar 'widget-convert (widget-get widget :args))) widget) (defun widget-value-convert-widget (widget) - "Initialize :value from :args in WIDGET." + "Initialize :value from `(car :args)' in WIDGET, and reset :args." (let ((args (widget-get widget :args))) (when args (widget-put widget :value (car args)) @@ -1645,11 +1731,11 @@ :value-inline 'widget-default-value-inline :default-get 'widget-default-default-get :menu-tag-get 'widget-default-menu-tag-get - :validate (lambda (widget) nil) + :validate #'ignore :active 'widget-default-active :activate 'widget-specify-active :deactivate 'widget-default-deactivate - :mouse-down-action (lambda (widget event) nil) + :mouse-down-action #'ignore :action 'widget-default-action :notify 'widget-default-notify :prompt-value 'widget-default-prompt-value) @@ -1657,8 +1743,8 @@ (defun widget-default-complete (widget) "Call the value of the :complete-function property of WIDGET. If that does not exists, call the value of `widget-complete-field'." - (let ((fun (widget-get widget :complete-function))) - (call-interactively (or fun widget-complete-field)))) + (call-interactively (or (widget-get widget :complete-function) + widget-complete-field))) (defun widget-default-create (widget) "Create WIDGET at point in the current buffer." @@ -1670,13 +1756,19 @@ value-pos) (insert (widget-get widget :format)) (goto-char from) - ;; Parse escapes in format. Coding this in C would speed up - ;; things *a lot*. + ;; Parse escapes in format. + ;; Coding this in C would speed up things *a lot*. + ;; sjt sez: + ;; There are other things to try: + ;; 1. Use skip-chars-forward. + ;; 2. Use a LIMIT (or narrow buffer?) in the search/skip expression. + ;; 3. Search/skip backward to allow LIMIT to be constant. + ;; 4. Use a char-table to dispatch to code, instead of a cond. (while (re-search-forward "%\\(.\\)" nil t) (let ((escape (aref (match-string 1) 0))) (replace-match "" t t) (cond ((eq escape ?%) - (insert "%")) + (insert ?%)) ((eq escape ?\[) (setq button-begin (point-marker)) (set-marker-insertion-type button-begin nil)) @@ -1689,7 +1781,7 @@ (setq sample-end (point))) ((eq escape ?n) (when (widget-get widget :indent) - (insert "\n") + (insert ?\n) (insert-char ?\ (widget-get widget :indent)))) ((eq escape ?t) (let* ((tag (widget-get widget :tag)) @@ -1701,8 +1793,8 @@ (tag (insert tag)) (t - (let ((standard-output (current-buffer))) - (princ (widget-get widget :value))))))) + (princ (widget-get widget :value) + (current-buffer)))))) ((eq escape ?d) (let ((doc (widget-get widget :doc))) (when doc @@ -1710,7 +1802,7 @@ (insert doc) (while (eq (preceding-char) ?\n) (delete-backward-char 1)) - (insert "\n") + (insert ?\n) (setq doc-end (point))))) ((eq escape ?v) (if (and button-begin (not button-end)) @@ -1751,13 +1843,13 @@ (cond ((eq escape ?h) (let* ((doc-property (widget-get widget :documentation-property)) (doc-try (cond ((widget-get widget :doc)) + ((functionp doc-property) + (funcall doc-property + (widget-get widget :value))) ((symbolp doc-property) (documentation-property (widget-get widget :value) - doc-property)) - (t - (funcall doc-property - (widget-get widget :value))))) + doc-property)))) (doc-text (and (stringp doc-try) (> (length doc-try) 1) doc-try)) @@ -1793,6 +1885,8 @@ (widget-apply parent :button-face-get) widget-button-face)))) +;; Shouldn't this be like `widget-default-button-face-get', and recurse, and +;; have a fallback? (defun widget-default-sample-face-get (widget) ;; Use :sample-face. (widget-get widget :sample-face)) @@ -1809,6 +1903,9 @@ after-change-functions (inhibit-read-only t)) (widget-apply widget :value-delete) + ;; #### In current code, these are never reinserted, but recreated. + ;; So they should either be destroyed, or we should think about how to + ;; reuse them. (when inactive-extent (detach-extent inactive-extent)) (when button-extent @@ -1841,10 +1938,10 @@ (widget-apply widget :delete) (widget-put widget :value value) (widget-apply widget :create)) - (when offset - (if (< offset 0) - (goto-char (+ (widget-get widget :to) offset 1)) - (goto-char (min (+ from offset) (1- (widget-get widget :to)))))))) + (if offset + (if (< offset 0) + (goto-char (+ (widget-get widget :to) offset 1)) + (goto-char (min (+ from offset) (1- (widget-get widget :to)))))))) (defun widget-default-value-inline (widget) "Wrap value in a list unless it is inline." @@ -1863,7 +1960,7 @@ (widget-princ-to-string (widget-get widget :value)))) (defun widget-default-active (widget) - "Return t iff this widget active (user modifiable)." + "Return non-nil iff WIDGET is user-modifiable." (and (not (widget-get widget :inactive)) (let ((parent (widget-get widget :parent))) (or (null parent) @@ -1886,11 +1983,14 @@ (widget-default-action widget event)) (defun widget-default-prompt-value (widget prompt value unbound) - "Read an arbitrary value. Stolen from `set-variable'." + "Read an arbitrary value." +;; #### XEmacs: What does this mean? +;; Stolen from `set-variable'. ;; (let ((initial (if unbound ;; nil ;; It would be nice if we could do a `(cons val 1)' here. ;; (prin1-to-string (custom-quote value)))))) + ;; XEmacs: make this use default VALUE. Need to check callers. (eval-minibuffer prompt)) ;;; The `item' Widget. @@ -1908,8 +2008,7 @@ (defun widget-item-value-create (widget) "Insert the printed representation of the value." - (let ((standard-output (current-buffer))) - (princ (widget-get widget :value)))) + (princ (widget-get widget :value) (current-buffer))) (defun widget-item-match (widget value) ;; Match if the value is the same. @@ -1924,24 +2023,13 @@ (and (equal head value) (cons head (widget-sublist values (length value)))))))) -(defun widget-sublist (list start &optional end) - "Return the sublist of LIST from START to END. -If END is omitted, it defaults to the length of LIST." - (if (> start 0) (setq list (nthcdr start list))) - (if end - (if (<= end start) - nil - (setq list (copy-sequence list)) - (setcdr (nthcdr (- end start 1) list) nil) - list) - (copy-sequence list))) - (defun widget-item-action (widget &optional event) ;; Just notify itself. (widget-apply widget :notify widget event)) ;;; The `push-button' Widget. +;; XEmacs: this seems to refer to button images. How about native widgets? (defcustom widget-push-button-gui widget-glyph-enable "If non nil, use GUI push buttons when available." :group 'widgets @@ -1958,7 +2046,9 @@ :group 'widget-button) (define-widget 'push-button 'item - "A pushable button." + "A button which invokes an action. + +Creators should usually specify `:action' and `:help-echo' members." :button-prefix "" :button-suffix "" :value-create 'widget-push-button-value-create @@ -2003,7 +2093,10 @@ :group 'widget-button) (define-widget 'link 'item - "An embedded link." + "An embedded link. + +This is an abstract widget. Subclasses should usually specify `:action' +and `:help-echo' members." :button-prefix 'widget-link-prefix :button-suffix 'widget-link-suffix :help-echo "Follow the link." @@ -2037,8 +2130,7 @@ "Open the url specified by WIDGET." (if-fboundp 'browse-url (browse-url (widget-value widget)) - ;; #### Should subclass a 'missing-package error. - (error 'unimplemented "No `browse-url' package; cannot follow URLs in this XEmacs"))) + (error 'missing-package "Cannot browse URLs in this XEmacs" 'browse-url))) ;;; The `function-link' Widget. @@ -2101,6 +2193,7 @@ :convert-widget 'widget-value-convert-widget :keymap widget-field-keymap :format "%v" + :help-echo "M-TAB: complete field; RET: enter value" :value "" :prompt-internal 'widget-field-prompt-internal :prompt-history 'widget-field-history @@ -2108,7 +2201,7 @@ :action 'widget-field-action :validate 'widget-field-validate :valid-regexp "" - :error "No match" + :error "Field's value doesn't match allowed forms" :value-create 'widget-field-value-create :value-delete 'widget-field-value-delete :value-get 'widget-field-value-get @@ -2125,16 +2218,23 @@ (defun widget-field-prompt-value (widget prompt value unbound) "Prompt for a string." - (let ((initial (if unbound - nil - (cons (widget-apply widget :value-to-internal - value) 0))) - (history (widget-get widget :prompt-history))) - (let ((answer (widget-apply widget - :prompt-internal prompt initial history))) - (widget-apply widget :value-to-external answer)))) - -(defvar widget-edit-functions nil) + (widget-apply widget + :value-to-external + (widget-apply widget + :prompt-internal prompt + (unless unbound + (cons (widget-apply widget + :value-to-internal value) + 0)) + (widget-get widget :prompt-history)))) + +;; #### Should be named `widget-action-hooks'. +(defvar widget-edit-functions nil + "Functions run on certain actions. + +Not a regular hook; each function should take a widget as an argument. +The standard widget functions `widget-field-action', `widget-choice-action', +and `widget-toggle-action' use `run-hook-with-args' to run these functions.") (defun widget-field-action (widget &optional event) ;; Edit the value in the minibuffer. @@ -2167,12 +2267,10 @@ (defun widget-field-validate (widget) "Valid if the content matches `:valid-regexp'." - (save-excursion - (let ((value (widget-apply widget :value-get)) - (regexp (widget-get widget :valid-regexp))) - (if (string-match regexp value) - nil - widget)))) + (save-excursion ; XEmacs + (unless (string-match (widget-get widget :valid-regexp) + (widget-apply widget :value-get)) + widget))) (defun widget-field-value-create (widget) "Create an editable text field." @@ -2241,8 +2339,8 @@ ;;; The `text' Widget. (define-widget 'text 'editable-field - :keymap widget-text-keymap - "A multiline text area.") + "A multiline text area." + :keymap widget-text-keymap) ;;; The `menu-choice' Widget. @@ -2381,12 +2479,9 @@ (defun widget-choice-validate (widget) ;; Valid if we have made a valid choice. - (let ((void (widget-get widget :void)) - (choice (widget-get widget :choice)) - (child (car (widget-get widget :children)))) - (if (eq void choice) - widget - (widget-apply child :validate)))) + (if (eq (widget-get widget :void) (widget-get widget :choice)) + widget + (widget-apply (car (widget-get widget :children)) :validate))) (defun widget-choice-match (widget value) ;; Matches if one of the choices matches. @@ -2460,7 +2555,9 @@ ;;; The `checklist' Widget. (define-widget 'checklist 'default - "A multiple choice widget." + "A set widget, selecting zero or more of many. + +The parent of several `checkbox' widgets, one for each option." :convert-widget 'widget-types-convert-widget :format "%v" :offset 4 @@ -2503,7 +2600,7 @@ (let ((escape (aref (match-string 1) 0))) (replace-match "" t t) (cond ((eq escape ?%) - (insert "%")) + (insert ?%)) ((eq escape ?b) (setq button (apply 'widget-create-child-and-convert widget 'checkbox @@ -2609,7 +2706,7 @@ ;;; The `option' Widget (define-widget 'option 'checklist - "An widget with an optional item." + "A widget presenting optional items for inline inclusion in a parent widget." :inline t) ;;; The `choice-item' Widget. @@ -2639,7 +2736,9 @@ ;;; The `radio-button-choice' Widget. (define-widget 'radio-button-choice 'default - "Select one of multiple options." + "A set widget, selecting exactly one of many options. + +The parent of several `radio-button' widgets, one for each option." :convert-widget 'widget-types-convert-widget :offset 4 :format "%v" @@ -2688,7 +2787,7 @@ (let ((escape (aref (match-string 1) 0))) (replace-match "" t t) (cond ((eq escape ?%) - (insert "%")) + (insert ?%)) ((eq escape ?b) (setq button (apply 'widget-create-child-and-convert widget 'radio-button @@ -2725,11 +2824,9 @@ (while children (setq current (car children) children (cdr children)) - (let* ((button (widget-get current :button)) - (value (widget-apply button :value-get))) - (when value - (setq found current - children nil)))) + (when (widget-apply (widget-get current :button) :value-get) + (setq found current + children nil))) found)) (defun widget-radio-value-inline (widget) @@ -2739,11 +2836,9 @@ (while children (setq current (car children) children (cdr children)) - (let* ((button (widget-get current :button)) - (value (widget-apply button :value-get))) - (when value - (setq found (widget-apply current :value-inline) - children nil)))) + (when (widget-apply (widget-get current :button) :value-get) + (setq found (widget-apply current :value-inline) + children nil))) found)) (defun widget-radio-value-set (widget value) @@ -2864,7 +2959,6 @@ ;; Insert all values (let* ((value (widget-get widget :value)) (type (nth 0 (widget-get widget :args))) - (inlinep (widget-get type :inline)) children) (widget-put widget :value-pos (copy-marker (point))) (set-marker-insertion-type (widget-get widget :value-pos) t) @@ -2873,7 +2967,7 @@ (if answer (setq children (cons (widget-editable-list-entry-create widget - (if inlinep + (if (widget-get type :inline) (car answer) (car (car answer))) t) @@ -2971,7 +3065,7 @@ (let ((escape (aref (match-string 1) 0))) (replace-match "" t t) (cond ((eq escape ?%) - (insert "%")) + (insert ?%)) ((eq escape ?i) (setq insert (apply 'widget-create-child-and-convert widget 'insert-button @@ -3191,7 +3285,7 @@ (let ((before (substring doc 0 (match-beginning 0))) (after (substring doc (match-beginning 0))) buttons) - (insert before " ") + (insert before ?\ ) (widget-documentation-link-add widget start (point)) (push (widget-create-child-and-convert widget 'visibility @@ -3213,7 +3307,7 @@ (widget-put widget :buttons buttons)) (insert doc) (widget-documentation-link-add widget start (point)))) - (insert "\n")) + (insert ?\n)) (defun widget-documentation-string-action (widget &rest ignore) ;; Toggle documentation. @@ -3223,8 +3317,74 @@ ;; Redraw. (widget-value-set widget (widget-value widget))) + ;;; The Sexp Widgets. +(define-widget 'sexp 'editable-field + "An arbitrary Lisp expression." + :tag "Lisp expression" + :format "%{%t%}: %v" + :value nil + :validate 'widget-sexp-validate + :match (lambda (widget value) t) + :value-to-internal 'widget-sexp-value-to-internal + :value-to-external (lambda (widget value) (read value)) + :prompt-history 'widget-sexp-prompt-value-history + :prompt-value 'widget-sexp-prompt-value) + +(defun widget-sexp-value-to-internal (widget value) + ;; Use cl-prettyprint for printer representation. + (let ((pp (if (symbolp value) + (prin1-to-string value) + (widget-prettyprint-to-string value)))) + (if (> (length pp) 40) + (concat "\n" pp) + pp))) + +(defun widget-sexp-validate (widget) + ;; Valid if we can read the string and there is no junk left after it. + (save-excursion + (let ((buffer (set-buffer (get-buffer-create " *Widget Scratch*")))) + (erase-buffer) + (insert (widget-apply widget :value-get)) + (goto-char (point-min)) + (condition-case data + (let ((value (read buffer))) + (if (eobp) + (if (widget-apply widget :match value) + nil + (widget-put widget :error (widget-get widget :type-error)) + widget) + (widget-put widget + :error (format "Junk at end of expression: %s" + (buffer-substring (point) + (point-max)))) + widget)) + (error (widget-put widget :error (error-message-string data)) + widget))))) + +(defvar widget-sexp-prompt-value-history nil + "History of input to `widget-sexp-prompt-value'.") + +(defun widget-sexp-prompt-value (widget prompt value unbound) + ;; Read an arbitrary sexp. + (let ((found (read-string prompt + (if unbound nil (cons (prin1-to-string value) 0)) + (widget-get widget :prompt-history)))) + (save-excursion + (let ((buffer (set-buffer (get-buffer-create " *Widget Scratch*")))) + (erase-buffer) + (insert found) + (goto-char (point-min)) + (let ((answer (read buffer))) + (unless (eobp) + (signal 'error + (list "Junk at end of expression" + (buffer-substring (point) (point-max))))) + answer))))) + +;; Various constant sexps. + (define-widget 'const 'item "An immutable sexp." :prompt-value 'widget-const-prompt-value @@ -3247,6 +3407,17 @@ :format "%v\n%h" :documentation-property 'variable-documentation) +(define-widget 'other 'sexp + "Matches any value, but doesn't let the user edit the value. +This is useful as last item in a `choice' widget. +You should use this widget type with a default value, +as in (other DEFAULT) or (other :tag \"NAME\" DEFAULT). +If the user selects this alternative, that specifies DEFAULT +as the value." + :tag "Other" + :format "%t%n" + :value 'other) + (defvar widget-string-prompt-value-history nil "History of input to `widget-string-prompt-value'.") @@ -3275,12 +3446,11 @@ (defun widget-regexp-validate (widget) "Check that the value of WIDGET is a valid regexp." - (let ((value (widget-value widget))) - (condition-case data - (prog1 nil - (string-match value "")) - (error (widget-put widget :error (error-message-string data)) - widget)))) + (condition-case data + (prog1 nil + (string-match (widget-value widget) "")) + (error (widget-put widget :error (error-message-string data)) + widget))) (define-widget 'file 'string "A file widget. @@ -3312,10 +3482,10 @@ (insert (expand-file-name completion directory))) (t (message "Making completion list...") - (let ((list (file-name-all-completions name-part directory))) - (setq list (sort list 'string<)) - (with-output-to-temp-buffer "*Completions*" - (display-completion-list list))) + (with-output-to-temp-buffer "*Completions*" + (display-completion-list + (sort (file-name-all-completions name-part directory) + 'string<))) (message "Making completion list...%s" "done"))))) (defun widget-file-prompt-value (widget prompt value unbound) @@ -3353,7 +3523,7 @@ (define-widget 'symbol 'editable-field "A Lisp symbol." - :value nil + :value t :tag "Symbol" :format "%{%t%}: %v" :match (lambda (widget value) (symbolp value)) @@ -3408,36 +3578,40 @@ ;; ;; OK, I'll simply comment the whole thing out, until someone decides ;; to do something with it. -;(defvar widget-coding-system-prompt-value-history nil -; "History of input to `widget-coding-system-prompt-value'.") -;(define-widget 'coding-system 'symbol -; "A MULE coding-system." -; :format "%{%t%}: %v" -; :tag "Coding system" -; :prompt-history 'widget-coding-system-prompt-value-history -; :prompt-value 'widget-coding-system-prompt-value -; :action 'widget-coding-system-action) - -;(defun widget-coding-system-prompt-value (widget prompt value unbound) -; ;; Read coding-system from minibuffer. -; (intern -; (completing-read (format "%s (default %s) " prompt value) -; (mapcar (lambda (sym) -; (list (symbol-name sym))) -; (coding-system-list))))) - -;(defun widget-coding-system-action (widget &optional event) -; ;; Read a file name from the minibuffer. -; (let ((answer -; (widget-coding-system-prompt-value -; widget -; (widget-apply widget :menu-tag-get) -; (widget-value widget) -; t))) -; (widget-value-set widget answer) -; (widget-apply widget :notify widget event) -; (widget-setup))) +;; OK, _I_'ll simply comment it back in, so somebody will get irritated and +;; do something about it. + +(defvar widget-coding-system-prompt-value-history nil + "History of input to `widget-coding-system-prompt-value'.") + +(define-widget 'coding-system 'symbol + "A MULE coding-system." + :format "%{%t%}: %v" + :tag "Coding system" + :prompt-history 'widget-coding-system-prompt-value-history + :prompt-value 'widget-coding-system-prompt-value + :action 'widget-coding-system-action) + +(defun widget-coding-system-prompt-value (widget prompt value unbound) + ;; Read coding-system from minibuffer. + (intern + (completing-read (format "%s (default %s) " prompt value) + (mapcar (lambda (sym) + (list (symbol-name sym))) + (coding-system-list))))) + +(defun widget-coding-system-action (widget &optional event) + ;; Read a file name from the minibuffer. + (let ((answer + (widget-coding-system-prompt-value + widget + (widget-apply widget :menu-tag-get) + (widget-value widget) + t))) + (widget-value-set widget answer) + (widget-apply widget :notify widget event) + (widget-setup))) (define-widget 'sexp 'editable-field "An arbitrary Lisp expression." @@ -3504,7 +3678,8 @@ (define-widget 'restricted-sexp 'sexp "A Lisp expression restricted to values that match. -To use this type, you must define :match or :match-alternatives." + +Either the `:match' or the `:match-alternatives' property must be defined." :type-error "The specified value is not valid" :match 'widget-restricted-sexp-match :value-to-internal (lambda (widget value) @@ -3539,11 +3714,20 @@ :type-error "This field should contain a number (floating point or integer)" :match-alternatives '(numberp)) +(define-widget 'float 'restricted-sexp + "A floating point number." + :tag "Floating point number" + :value 0.0 + :type-error "This field should contain a floating point number" + :match-alternatives '(floatp)) + (define-widget 'character 'editable-field "A character." :tag "Character" :value ?\0 + :size 1 :format "%{%t%}: %v" + ;; #### This is incorrect for Mule. :valid-regexp "\\`[\0-\377]\\'" :error "This field should contain a single character" :value-to-internal (lambda (widget value) @@ -3558,12 +3742,12 @@ (characterp value))) (define-widget 'list 'group - "A Lisp list." + "A Lisp list of fixed length with fixed type for each element." :tag "List" :format "%{%t%}:\n%v") (define-widget 'vector 'group - "A Lisp vector." + "A Lisp vector of fixed length with fixed type for each element." :tag "Vector" :format "%{%t%}:\n%v" :match 'widget-vector-match @@ -3583,13 +3767,103 @@ :value-to-internal (lambda (widget value) (list (car value) (cdr value))) :value-to-external (lambda (widget value) - (cons (car value) (cadr value)))) + (cons (nth 0 value) (nth 1 value)))) (defun widget-cons-match (widget value) (and (consp value) (widget-group-match widget (widget-apply widget :value-to-internal value)))) + +;;; The `plist' Widget. +;; +;; Property lists. + +(define-widget 'plist 'list + "A property list." + :key-type '(symbol :tag "Key") + :value-type '(sexp :tag "Value") + :convert-widget 'widget-plist-convert-widget + :tag "Plist") + +(defvar widget-plist-value-type) ;Dynamic variable + +(defun widget-plist-convert-widget (widget) + ;; Handle `:options'. + (let* ((options (widget-get widget :options)) + (widget-plist-value-type (widget-get widget :value-type)) + (other `(editable-list :inline t + (group :inline t + ,(widget-get widget :key-type) + ,widget-plist-value-type))) + (args (if options + (list `(checklist :inline t + :greedy t + ,@(mapcar 'widget-plist-convert-option + options)) + other) + (list other)))) + (widget-put widget :args args) + widget)) +(defun widget-plist-convert-option (option) + ;; Convert a single plist option. + (let (key-type value-type) + (if (listp option) + (let ((key (nth 0 option))) + (setq value-type (nth 1 option)) + (if (listp key) + (setq key-type key) + (setq key-type `(const ,key)))) + (setq key-type `(const ,option) + value-type widget-plist-value-type)) + `(group :format "Key: %v" :inline t ,key-type ,value-type))) + + +;;; The `alist' Widget. +;; +;; Association lists. + +(define-widget 'alist 'list + "An association list." + :key-type '(sexp :tag "Key") + :value-type '(sexp :tag "Value") + :convert-widget 'widget-alist-convert-widget + :tag "Alist") + +(defvar widget-alist-value-type) ;Dynamic variable + +(defun widget-alist-convert-widget (widget) + ;; Handle `:options'. + (let* ((options (widget-get widget :options)) + (widget-alist-value-type (widget-get widget :value-type)) + (other `(editable-list :inline t + (cons :format "%v" + ,(widget-get widget :key-type) + ,widget-alist-value-type))) + (args (if options + (list `(checklist :inline t + :greedy t + ,@(mapcar 'widget-alist-convert-option + options)) + other) + (list other)))) + (widget-put widget :args args) + widget)) + +(defun widget-alist-convert-option (option) + ;; Convert a single alist option. + (let (key-type value-type) + (if (listp option) + (let ((key (nth 0 option))) + (setq value-type (nth 1 option)) + (if (listp key) + (setq key-type key) + (setq key-type `(const ,key)))) + (setq key-type `(const ,option) + value-type widget-alist-value-type)) + `(cons :format "Key: %v" ,key-type ,value-type))) + + (define-widget 'choice 'menu-choice "A union of several sexp types." :tag "Choice" @@ -3641,7 +3915,9 @@ value))) (define-widget 'radio 'radio-button-choice - "A union of several sexp types." + "A set widget, selecting exactly one from many. + +The parent of several `radio-button' widgets, one for each option." :tag "Choice" :format "%{%t%}:\n%v" :prompt-value 'widget-choice-prompt-value) @@ -3698,9 +3974,8 @@ (insert (substring completion (length prefix)))) (t (message "Making completion list...") - (let ((list (all-completions prefix list nil))) - (with-output-to-temp-buffer "*Completions*" - (display-completion-list list))) + (with-output-to-temp-buffer "*Completions*" + (display-completion-list (all-completions prefix list nil))) (message "Making completion list...done"))))) (defun widget-color-sample-face-get (widget) @@ -3737,22 +4012,16 @@ (remove-face-property face 'foreground))) (widget-default-notify widget child event)) -;; Is this a misnomer? -(defun widget-at (pos) - "The button or field at POS." - (or (get-char-property pos 'button) - (get-char-property pos 'field))) - ;;; The Help Echo (defun widget-echo-help (pos) "Display the help-echo text for widget at POS." (let* ((widget (widget-at pos)) (help-echo (and widget (widget-get widget :help-echo)))) - (and (functionp help-echo) - (setq help-echo (funcall help-echo widget))) - (when (stringp help-echo) - (display-message 'help-echo help-echo)))) + (if (functionp help-echo) + (setq help-echo (funcall help-echo widget))) + (if (stringp help-echo) + (display-message 'help-echo help-echo)))) ;;; The End: Index: lisp/window-xemacs.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/window-xemacs.el,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- lisp/window-xemacs.el 6 Feb 2003 06:35:48 -0000 1.16 +++ lisp/window-xemacs.el 26 Mar 2003 15:09:51 -0000 1.17 @@ -170,8 +170,8 @@ (saved-window-pixel-bottom saved-2)) (= (saved-window-hscroll saved-1) (saved-window-hscroll saved-2)) - (= (saved-window-modeline-hscroll saved-1) - (saved-window-modeline-hscroll saved-2)) + (equal (saved-window-modeline-hscroll saved-1) + (saved-window-modeline-hscroll saved-2)) (eq (saved-window-dedicatedp saved-1) (saved-window-dedicatedp saved-2)) (maybe-saved-window-equal (saved-window-first-hchild saved-1) cvs server: Diffing lisp/mule Index: lisp/mule/mule-charset.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/mule-charset.el,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- lisp/mule/mule-charset.el 28 Apr 2002 06:40:33 -0000 1.12 +++ lisp/mule/mule-charset.el 17 Feb 2003 14:51:02 -0000 1.13 @@ -38,6 +38,12 @@ ;;;; Classifying text according to charsets +;; the old version was broken in a couple of ways +;; this is one of several versions, I tried a hash as well as the +;; `prev-charset' cache used in the old version, but this was definitely +;; faster than the hash version and marginally faster than the prev-charset +;; version +;; #### this really needs to be moved into C (defun charsets-in-region (start end &optional buffer) "Return a list of the charsets in the region between START and END. BUFFER defaults to the current buffer if omitted." @@ -49,30 +55,22 @@ (narrow-to-region start end) (goto-char (point-min)) (while (not (eobp)) - (let* (prev-charset - (ch (char-after (point))) - (charset (char-charset ch))) - (if (not (eq prev-charset charset)) - (progn - (setq prev-charset charset) - (or (memq charset list) - (setq list (cons charset list)))))) + ;; the first test will usually succeed on testing the + ;; car of the list; don't waste time let-binding. + (or (memq (char-charset (char-after (point))) list) + (setq list (cons (char-charset (char-after (point))) list))) (forward-char)))) list)) (defun charsets-in-string (string) "Return a list of the charsets in STRING." - (let ((i 0) - (len (length string)) - prev-charset charset list) - (while (< i len) - (setq charset (char-charset (aref string i))) - (if (not (eq prev-charset charset)) - (progn - (setq prev-charset charset) - (or (memq charset list) - (setq list (cons charset list))))) - (setq i (1+ i))) + (let (list) + (mapc (lambda (ch) + ;; the first test will usually succeed on testing the + ;; car of the list; don't waste time let-binding. + (or (memq (char-charset ch) list) + (setq list (cons (char-charset ch) list)))) + string) list)) (defalias 'find-charset-string 'charsets-in-string) Index: lisp/mule/mule-cmds.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/mule-cmds.el,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- lisp/mule/mule-cmds.el 10 Feb 2003 17:47:44 -0000 1.22 +++ lisp/mule/mule-cmds.el 21 Feb 2003 06:56:50 -0000 1.23 @@ -3,7 +3,7 @@ ;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. ;; Copyright (C) 1997 MORIOKA Tomohiko -;; Copyright (C) 2000, 2001, 2002 Ben Wing. +;; Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. ;; Keywords: mule, multilingual @@ -1078,7 +1078,7 @@ system locale and is not influenced by LOCALE. (In other words, a program can't set the text encoding used to communicate with the OS. To get around this, we use Unicode whenever available, i.e. on Windows NT always and on -Windows 9x for a few system calls.)" +Windows 9x whenever a Unicode version of a system call is available.)" (if (eq system-type 'windows-nt) ;; should not apply to Cygwin, I don't think 'mswindows-multibyte-system-default @@ -1263,19 +1263,22 @@ (maybe-change-coding-system-with-eol default-coding eol-type)))) ;; (setq default-sendmail-coding-system default-coding) - ;; set the native and file-name aliases (currently always the same), - ;; and the terminal-write system. + ;; set the native coding system and the default process-output system. (let ((native (get-native-coding-system-from-language-environment language-name (current-locale)))) + (condition-case nil - (define-coding-system-alias 'file-name native) + (define-coding-system-alias 'native + (maybe-change-coding-system-with-eol native eol-type)) (error (warn "Invalid native-coding-system %s in language environment %s" native language-name))) - (define-coding-system-alias 'native 'file-name) + (define-coding-system-alias 'file-name 'native) + ;; process output should not have EOL conversion. under MS Windows + ;; and Cygwin, this screws things up (`cmd' is fine with just LF and + ;; `bash' chokes on CR-LF). (setq default-process-coding-system - (cons (car default-process-coding-system) - (maybe-change-coding-system-with-eol native eol-type)))))) + (cons (car default-process-coding-system) native))))) (defun init-locale-at-early-startup () "Don't call this." Index: lisp/mule/mule-msw-init.el =================================================================== RCS file: lisp/mule/mule-msw-init.el diff -N lisp/mule/mule-msw-init.el --- lisp/mule/mule-msw-init.el 18 Mar 2002 10:07:37 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,183 +0,0 @@ -;;; mule-msw-init.el --- initialization code for MS Windows under MULE -;;; Copyright (C) 2001, 2002 Ben Wing. - -;; 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. - -(make-coding-system - 'mswindows-multibyte 'mswindows-multibyte - "MS Windows Multibyte (current code page)" - '(mnemonic "MSW-MB" - documentation - "MS Windows multibyte -- current code page. - -This implements the encoding specified by the current code page -- -i.e. the ANSI code page corresponding to the current locale, as -returned by - - (mswindows-locale-code-page (mswindows-current-locale)) -" - locale current - code-page ansi)) - -;; we temporarily aliased this to raw-text in intl-win32.c. -(define-coding-system-alias 'mswindows-multibyte-system-default nil) -(make-coding-system - 'mswindows-multibyte-system-default 'mswindows-multibyte - "MS Windows Multibyte (system default code page)" - '(mnemonic "MSW-MB-SysDef" - documentation - "MS Windows multibyte -- system default code page. - -This implements the encoding specified by the system default code page --- i.e. the ANSI code page corresponding to the system default locale, -as returned by - - (mswindows-locale-code-page (mswindows-system-default-locale)) -" - locale system-default - code-page ansi)) - -(make-coding-system - 'mswindows-multibyte-user-default 'mswindows-multibyte - "MS Windows Multibyte (user default code page)" - '(mnemonic "MSW-MB-UserDef" - documentation - "MS Windows multibyte -- user default code page. - -This implements the encoding specified by the user default code page --- i.e. the ANSI code page corresponding to the user default locale, -as returned by - - (mswindows-locale-code-page (mswindows-user-default-locale)) -" - locale user-default - code-page ansi)) - -(make-coding-system - 'mswindows-multibyte-oem 'mswindows-multibyte - "MS Windows Multibyte (current OEM code page)" - '(mnemonic "MSW-MB-OEM" - documentation - "MS Windows multibyte -- current OEM code page. - -This implements the encoding specified by the current OEM code page --- i.e. the OEM code page corresponding to the current locale, -as returned by - - (mswindows-locale-oem-code-page (mswindows-current-locale)) -" - locale current - code-page oem)) - -(make-coding-system - 'mswindows-multibyte-oem-system-default 'mswindows-multibyte - "MS Windows Multibyte (system default OEM code page)" - '(mnemonic "MSW-MB-OEM-SysDef" - documentation - "MS Windows multibyte -- system default OEM code page. - -This implements the encoding specified by the system default OEM code page --- i.e. the OEM code page corresponding to the system default locale, -as returned by - - (mswindows-locale-oem-code-page (mswindows-system-default-locale)) -" - locale system-default - code-page oem)) - -(make-coding-system - 'mswindows-multibyte-oem-user-default 'mswindows-multibyte - "MS Windows Multibyte (user default OEM code page)" - '(mnemonic "MSW-MB-OEM-UserDef" - documentation - "MS Windows multibyte -- user default OEM code page. - -This implements the encoding specified by the user default OEM code page --- i.e. the OEM code page corresponding to the user default locale, -as returned by - - (mswindows-locale-oem-code-page (mswindows-user-default-locale)) -" - locale user-default - code-page oem)) - -(let ((cplist - '(("EBCDIC" 037 "EBCDIC") - ("OEM" 437 "MS-DOS United States") - ("EBCDIC" 500 "EBCDIC \"500V1\"") - ("OEM" 708 "Arabic (ASMO 708)") - ("OEM" 709 "Arabic (ASMO 449+, BCON V4)") - ("OEM" 710 "Arabic (Transparent Arabic)") - ("OEM" 720 "Arabic (Transparent ASMO)") - ("OEM" 737 "Greek (formerly 437G)") - ("OEM" 775 "Baltic") - ("OEM" 850 "MS-DOS Multilingual (Latin I)") - ("OEM" 852 "MS-DOS Slavic (Latin II)") - ("OEM" 855 "IBM Cyrillic (primarily Russian)") - ("OEM" 857 "IBM Turkish") - ("OEM" 860 "MS-DOS Portuguese") - ("OEM" 861 "MS-DOS Icelandic") - ("OEM" 862 "Hebrew") - ("OEM" 863 "MS-DOS Canadian-French") - ("OEM" 864 "Arabic") - ("OEM" 865 "MS-DOS Nordic") - ("OEM" 866 "MS-DOS Russian") - ("OEM" 869 "IBM Modern Greek") - ("Ansi/OEM" 874 "Thai") - ("EBCDIC" 875 "EBCDIC") - ("Ansi/OEM" 932 "Japanese") - ("Ansi/OEM" 936 "Chinese (PRC, Singapore)") - ("Ansi/OEM" 949 "Korean") - ("Ansi/OEM" 950 "Chinese (Taiwan; Hong Kong SAR, PRC)") - ("EBCDIC" 1026 "EBCDIC") - ("ANSI" 1200 "Unicode (BMP of ISO 10646)") - ("ANSI" 1250 "Windows 3.1 Eastern European") - ("ANSI" 1251 "Windows 3.1 Cyrillic") - ("ANSI" 1252 "Windows 3.1 US (ANSI)") - ("ANSI" 1253 "Windows 3.1 Greek") - ("ANSI" 1254 "Windows 3.1 Turkish") - ("ANSI" 1255 "Hebrew") - ("ANSI" 1256 "Arabic") - ("ANSI" 1257 "Baltic") - ("ANSI" 1258 "VietNam") - ("Ansi/OEM" 1361 "Korean (Johab)") - ("Mac" 10000 "Macintosh Roman") - ("Mac" 10001 "Macintosh Japanese") - ("Mac" 10006 "Macintosh Greek I") - ("Mac" 10007 "Macintosh Cyrillic") - ("Mac" 10029 "Macintosh Latin 2") - ("Mac" 10079 "Macintosh Icelandic") - ("Mac" 10081 "Macintosh Turkish")))) - (dolist (cpprops cplist) - (let ((ansioem (first cpprops)) - (cp (second cpprops)) - (name (third cpprops))) - (make-coding-system - (intern (format "windows-%s" cp)) - 'mswindows-multibyte - (format "MS Windows code page %s (%s, %s)" cp ansioem name) - `(mnemonic - ,(format "MSW-%s" cp) - code-page ,cp - documentation - ,(format - "MS Windows Multibyte -- code page %s (%s, %s). - -This implements the encoding specified by code page %s. -For more information on code pages, see `mswindows-charset-code-page'." - cp ansioem name cp)))))) Index: lisp/mule/mule-win32-init.el =================================================================== RCS file: lisp/mule/mule-win32-init.el diff -N lisp/mule/mule-win32-init.el --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lisp/mule/mule-win32-init.el 20 Feb 2003 08:19:35 -0000 1.1 @@ -0,0 +1,183 @@ +;;; mule-win32-init.el --- initialization code for MS Windows/Cygwin under MULE +;;; Copyright (C) 2001, 2002 Ben Wing. + +;; 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. + +(make-coding-system + 'mswindows-multibyte 'mswindows-multibyte + "MS Windows Multibyte (current code page)" + '(mnemonic "MSW-MB" + documentation + "MS Windows multibyte -- current code page. + +This implements the encoding specified by the current code page -- +i.e. the ANSI code page corresponding to the current locale, as +returned by + + (mswindows-locale-code-page (mswindows-current-locale)) +" + locale current + code-page ansi)) + +;; we temporarily aliased this to raw-text in intl-win32.c. +(define-coding-system-alias 'mswindows-multibyte-system-default nil) +(make-coding-system + 'mswindows-multibyte-system-default 'mswindows-multibyte + "MS Windows Multibyte (system default code page)" + '(mnemonic "MSW-MB-SysDef" + documentation + "MS Windows multibyte -- system default code page. + +This implements the encoding specified by the system default code page +-- i.e. the ANSI code page corresponding to the system default locale, +as returned by + + (mswindows-locale-code-page (mswindows-system-default-locale)) +" + locale system-default + code-page ansi)) + +(make-coding-system + 'mswindows-multibyte-user-default 'mswindows-multibyte + "MS Windows Multibyte (user default code page)" + '(mnemonic "MSW-MB-UserDef" + documentation + "MS Windows multibyte -- user default code page. + +This implements the encoding specified by the user default code page +-- i.e. the ANSI code page corresponding to the user default locale, +as returned by + + (mswindows-locale-code-page (mswindows-user-default-locale)) +" + locale user-default + code-page ansi)) + +(make-coding-system + 'mswindows-multibyte-oem 'mswindows-multibyte + "MS Windows Multibyte (current OEM code page)" + '(mnemonic "MSW-MB-OEM" + documentation + "MS Windows multibyte -- current OEM code page. + +This implements the encoding specified by the current OEM code page +-- i.e. the OEM code page corresponding to the current locale, +as returned by + + (mswindows-locale-oem-code-page (mswindows-current-locale)) +" + locale current + code-page oem)) + +(make-coding-system + 'mswindows-multibyte-oem-system-default 'mswindows-multibyte + "MS Windows Multibyte (system default OEM code page)" + '(mnemonic "MSW-MB-OEM-SysDef" + documentation + "MS Windows multibyte -- system default OEM code page. + +This implements the encoding specified by the system default OEM code page +-- i.e. the OEM code page corresponding to the system default locale, +as returned by + + (mswindows-locale-oem-code-page (mswindows-system-default-locale)) +" + locale system-default + code-page oem)) + +(make-coding-system + 'mswindows-multibyte-oem-user-default 'mswindows-multibyte + "MS Windows Multibyte (user default OEM code page)" + '(mnemonic "MSW-MB-OEM-UserDef" + documentation + "MS Windows multibyte -- user default OEM code page. + +This implements the encoding specified by the user default OEM code page +-- i.e. the OEM code page corresponding to the user default locale, +as returned by + + (mswindows-locale-oem-code-page (mswindows-user-default-locale)) +" + locale user-default + code-page oem)) + +(let ((cplist + '(("EBCDIC" 037 "EBCDIC") + ("OEM" 437 "MS-DOS United States") + ("EBCDIC" 500 "EBCDIC \"500V1\"") + ("OEM" 708 "Arabic (ASMO 708)") + ("OEM" 709 "Arabic (ASMO 449+, BCON V4)") + ("OEM" 710 "Arabic (Transparent Arabic)") + ("OEM" 720 "Arabic (Transparent ASMO)") + ("OEM" 737 "Greek (formerly 437G)") + ("OEM" 775 "Baltic") + ("OEM" 850 "MS-DOS Multilingual (Latin I)") + ("OEM" 852 "MS-DOS Slavic (Latin II)") + ("OEM" 855 "IBM Cyrillic (primarily Russian)") + ("OEM" 857 "IBM Turkish") + ("OEM" 860 "MS-DOS Portuguese") + ("OEM" 861 "MS-DOS Icelandic") + ("OEM" 862 "Hebrew") + ("OEM" 863 "MS-DOS Canadian-French") + ("OEM" 864 "Arabic") + ("OEM" 865 "MS-DOS Nordic") + ("OEM" 866 "MS-DOS Russian") + ("OEM" 869 "IBM Modern Greek") + ("Ansi/OEM" 874 "Thai") + ("EBCDIC" 875 "EBCDIC") + ("Ansi/OEM" 932 "Japanese") + ("Ansi/OEM" 936 "Chinese (PRC, Singapore)") + ("Ansi/OEM" 949 "Korean") + ("Ansi/OEM" 950 "Chinese (Taiwan; Hong Kong SAR, PRC)") + ("EBCDIC" 1026 "EBCDIC") + ("ANSI" 1200 "Unicode (BMP of ISO 10646)") + ("ANSI" 1250 "Windows 3.1 Eastern European") + ("ANSI" 1251 "Windows 3.1 Cyrillic") + ("ANSI" 1252 "Windows 3.1 US (ANSI)") + ("ANSI" 1253 "Windows 3.1 Greek") + ("ANSI" 1254 "Windows 3.1 Turkish") + ("ANSI" 1255 "Hebrew") + ("ANSI" 1256 "Arabic") + ("ANSI" 1257 "Baltic") + ("ANSI" 1258 "VietNam") + ("Ansi/OEM" 1361 "Korean (Johab)") + ("Mac" 10000 "Macintosh Roman") + ("Mac" 10001 "Macintosh Japanese") + ("Mac" 10006 "Macintosh Greek I") + ("Mac" 10007 "Macintosh Cyrillic") + ("Mac" 10029 "Macintosh Latin 2") + ("Mac" 10079 "Macintosh Icelandic") + ("Mac" 10081 "Macintosh Turkish")))) + (dolist (cpprops cplist) + (let ((ansioem (first cpprops)) + (cp (second cpprops)) + (name (third cpprops))) + (make-coding-system + (intern (format "windows-%s" cp)) + 'mswindows-multibyte + (format "MS Windows code page %s (%s, %s)" cp ansioem name) + `(mnemonic + ,(format "MSW-%s" cp) + code-page ,cp + documentation + ,(format + "MS Windows Multibyte -- code page %s (%s, %s). + +This implements the encoding specified by code page %s. +For more information on code pages, see `mswindows-charset-code-page'." + cp ansioem name cp)))))) cvs server: Diffing lisp/term cvs server: Diffing lock cvs server: Diffing lwlib Index: lwlib/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/ChangeLog,v retrieving revision 1.48 retrieving revision 1.51 diff -u -r1.48 -r1.51 --- lwlib/ChangeLog 16 Feb 2003 06:13:27 -0000 1.48 +++ lwlib/ChangeLog 24 Apr 2003 23:41:37 -0000 1.51 @@ -1,3 +1,16 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-03-27 Stephen J. Turnbull + + * xlwscrollbar.c: Global substitution of .Xresources for .Xdefaults. + +2003-02-28 Ben Wing + + * lwlib-Xm.c: + Fix compile warning. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. Index: lwlib/lwlib-Xm.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib-Xm.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- lwlib/lwlib-Xm.c 9 Feb 2003 15:30:44 -0000 1.19 +++ lwlib/lwlib-Xm.c 1 Mar 2003 07:25:31 -0000 1.20 @@ -131,6 +131,8 @@ return instance; } +#ifdef LWLIB_DIALOGS_MOTIF + static void free_destroyed_instance (destroyed_instance* instance) { @@ -139,6 +141,8 @@ free (instance); } +#endif /* LWLIB_DIALOGS_MOTIF */ + /* motif utility functions */ Widget first_child (Widget widget) @@ -1019,6 +1023,8 @@ } +#ifdef LWLIB_DIALOGS_MOTIF + /* This function is for activating a button from a program. It's wrong because we pass a NULL argument in the call_data which is not Motif compatible. This is used from the XmNdefaultAction callback of the List widgets to @@ -1033,8 +1039,6 @@ } /* creation functions */ - -#ifdef LWLIB_DIALOGS_MOTIF /* dialogs */ Index: lwlib/xlwscrollbar.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwscrollbar.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- lwlib/xlwscrollbar.c 5 Mar 2002 13:39:26 -0000 1.15 +++ lwlib/xlwscrollbar.c 27 Mar 2003 12:57:46 -0000 1.16 @@ -26,7 +26,7 @@ * Athena-style scrollbar button bindings added on Sun Dec 24 22:03:57 1995 * by Jonathan Stigelman ... Ho ho ho! * - * To use them, put this resource in your .Xdefaults + * To use them, put this resource in your .Xresources * * Emacs*XlwScrollBar.translations: #override \n\ * : PageDownOrRight() \n\ cvs server: Diffing man Index: man/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/ChangeLog,v retrieving revision 1.208 retrieving revision 1.217 diff -u -r1.208 -r1.217 --- man/ChangeLog 16 Feb 2003 06:13:29 -0000 1.208 +++ man/ChangeLog 24 Apr 2003 23:41:38 -0000 1.217 @@ -1,3 +1,55 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-03-27 Stephen J. Turnbull + + * xemacs/frame.texi (XEmacs under X): + * xemacs-faq.texi: + Global substitute .Xresources for .Xdefaults. + + * xemacs-faq.texi (Q3.2.2): `default' is also a face. + (Q3.2.2, Q3.8.4): Describe appropriate use of `fontSet' in Mule. + Suggested by Janis Dzerins . + +2003-03-20 Steve Youngs + + * xemacs/packages.texi (Automatically): Refer to + 'pui-set-local-package-get-directory' instead of + 'pui-add-install-directory'. + Remove comment about PGP not being intergrated into PUI. + Document balloon-help in PUI. + Add heading "Keeping Packages Up To Date". + (Building Packages): makeinfo 4.2 is required. + +2003-03-18 Stephen J. Turnbull + + * xemacs/frame.texi (Gutter Basics): Describe common options for + buffers tab control. + +2003-03-11 Adrian Aichner + + * cl.texi: Change incorrect references to GNU where XEmacs is + appropriate. + +2003-03-09 Ben Wing + + * widget.texi (Defining New Widgets): + Fix Turnbull typos. + +2003-03-02 Stephen Turnbull + + * widget.texi (Defining New Widgets): + Document `widget-create-child', `widget-create-child-and-convert', + and `widget-create-child-value'. Document the `:copy' method. + Improve discussion of the `:convert-widget' method. + +2003-02-26 Stephen J. Turnbull + + * internals/internals.texi (XEmacs From the Perspective of Building): + Fix typo. + (Build-Time Dependencies): New node. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. Index: man/cl.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/cl.texi,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- man/cl.texi 16 Mar 2002 10:39:11 -0000 1.10 +++ man/cl.texi 12 Mar 2003 17:35:06 -0000 1.11 @@ -9,10 +9,10 @@ @ifinfo @dircategory XEmacs Editor @direntry -* Common Lisp: (cl). GNU Emacs Common Lisp emulation package. +* Common Lisp: (cl). XEmacs Common Lisp emulation package. @end direntry -This file documents the GNU Emacs Common Lisp emulation package. +This file documents the XEmacs Common Lisp emulation package. Copyright (C) 1993 Free Software Foundation, Inc. Index: man/widget.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/widget.texi,v retrieving revision 1.38 retrieving revision 1.40 diff -u -r1.38 -r1.40 --- man/widget.texi 3 Jan 2003 12:12:30 -0000 1.38 +++ man/widget.texi 9 Mar 2003 12:59:36 -0000 1.40 @@ -1390,27 +1390,44 @@ @code{widget-create} uses. If you just want to specify defaults for keywords with no complex -conversions, you can use @code{identity} as your conversion function. +conversions, you can use @code{identity} as your @code{:convert-widget} +function. The following additional keyword arguments are useful when defining new widgets: @table @code @item :convert-widget -Function to convert a widget type before creating a widget of that -type. It takes a widget type as an argument, and returns the converted -widget type. When a widget is created, this function is called for the -widget type and all the widget's parent types, most derived first. +Method to convert type-specific components of a widget type before +instantiating a widget of that type. Not normally called from user +code, it is invoked by @code{widget-convert}. Typical operations +include converting types of child widgets to widget instances and +converting values from external format (@emph{i.e.}, as expected by the +calling code) to internal format (which is often different for the +convenience of widget manipulation). It takes a widget type as an +argument, and returns the converted widget type. When a widget is +created, the value of this property is called for the widget type, then +for all the widget's parent types, most derived first. (The property is +reevaluated for each parent type.) The following predefined functions can be used here: @defun widget-types-convert-widget widget -Convert @code{:args} as widget types in @var{widget}. +Convert each member of @code{:args} in @var{widget} from a widget type +to a widget. @end defun @defun widget-value-convert-widget widget -Initialize @code{:value} from @code{:args} in @var{widget}. +Initialize @code{:value} from @code{(car :args)} in @var{widget}, and +reset @code{:args}. @end defun +@item :copy +A method to implement deep copying of the type. Any member of the +widget which might be changed in place (rather than replaced) should be +copied by this method. (@code{widget-copy} uses @code{copy-sequence} to +ensure that the top-level list is a copy.) This particularly applies to +child widgets. + @item :value-to-internal Function to convert the value to the internal format. The function takes two arguments, a widget and an external value. It returns the @@ -1427,8 +1444,14 @@ @item :create Function to create a widget from scratch. The function takes one -argument, a widget type, and creates a widget of that type, inserts it -in the buffer, and returns a widget object. +argument, a widget, and inserts it in the buffer. Not normally called +from user code. Instead, call @code{widget-create} or related +functions, which take a type argument, (usually) convert it to a widget, +call the @code{:create} function to insert it in the buffer, and then +return the (possibly converted) widget. + +The default, @code{widget-default-create}, is invariably appropriate. +(None of the standard widgets specify @code{:create}.) @item :delete Function to delete a widget. The function takes one argument, a widget, @@ -1502,6 +1525,43 @@ It provides most of the functionality that is referred to as ``by default'' in this text. @end deffn + +In implementing complex hierarchical widgets (@emph{e.g.}, using the +@samp{group} widget), the following functions may be useful. +The syntax for the @var{type} arguments to these functions is described +in @ref{Basic Types}. + +@defun widget-create-child-and-convert parent type &rest args +As a child of @var{parent}, create a widget with type @var{type} and +value @var{value}. @var{type} is copied, and the @code{:widget-contvert} +method is applied to the optional keyword arguments from @var{args}. +@end defun + +@defun widget-create-child parent type +As a child of @var{parent}, create a widget with type @var{type}. +@var{type} is copied, but no conversion method is applied. +@end defun + +@defun widget-create-child-value parent type value +As a child of @var{parent}, create a widget with type @var{type} and +value @var{value}. @var{type} is copied, but no conversion method is +applied. +@end defun + +@defun widget-convert type &rest args +Convert @var{type} to a widget without inserting it in the buffer. +The optional @var{args} are additional keyword arguments. + +The widget's @code{:args} property is set from the longest tail of +@var{args} whose @samp{cdr} is not a keyword, or if that is null, from +the longest tail of @var{type}'s @code{:args} property whose cdr is not +a keyword. Keyword arguments from @var{args} are set, and the +@code{:value} property (if any) is converted from external to internal +format. +@end defun + +@code{widget-convert} is typically not called from user code; rather it +is called implicitly through the @samp{widget-create*} functions. @node Widget Browser, Widget Minor Mode, Defining New Widgets, Top @comment node-name, next, previous, up Index: man/xemacs-faq.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs-faq.texi,v retrieving revision 1.67 retrieving revision 1.69 diff -u -r1.67 -r1.69 --- man/xemacs-faq.texi 5 Feb 2003 08:18:55 -0000 1.67 +++ man/xemacs-faq.texi 27 Mar 2003 12:57:48 -0000 1.69 @@ -7,7 +7,7 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2003/02/05 08:18:55 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2003/03/27 12:57:48 $ @sp 1 @author Tony Rossini @author Ben Wing @@ -2827,13 +2827,13 @@ Search through the @file{NEWS} file for @samp{X Resources}. A fairly comprehensive list is given after it. -In addition, an @file{app-defaults} file is supplied, -@file{etc/Emacs.ad} listing the defaults. The file -@file{etc/sample.Xdefaults} gives a set of defaults that you might -consider. It is essentially the same as @file{etc/Emacs.ad} but some -entries are slightly altered. Be careful about installing the contents -of this file into your @file{.Xdefaults} or @file{.Xresources} file if -you use GNU Emacs under X11 as well. +In addition, an @file{app-defaults} file @file{etc/Emacs.ad} is +supplied, listing the defaults. The file @file{etc/sample.Xresources} +gives a different set of defaults that you might consider for +installation in your @file{~/.Xresources} file. It is nearly the same +as @file{etc/Emacs.ad}, but a few entries are altered. Be careful about +installing the contents of this file into your @file{.Xresources} (or +legacy @file{.Xdefaults}) file if you use GNU Emacs under X11 as well. @node Q3.1.2, Q3.1.3, Q3.1.1, Customization @unnumberedsubsec Q3.1.2: How can I detect a color display? @@ -2960,7 +2960,7 @@ @unnumberedsubsec Q3.2.1: How can I set color options from @file{init.el}/@file{.emacs}? How can I set the most commonly used color options from my -@file{init.el}/@file{.emacs} instead of from my @file{.Xdefaults}? +@file{init.el}/@file{.emacs} instead of from my @file{.Xresources}? Like this: @@ -2994,7 +2994,7 @@ Note that you should use @samp{Emacs.} and not @samp{Emacs*} when setting face values. -In @file{.Xdefaults}: +In @file{.Xresources}: @example Emacs.default.attributeFont: -*-*-medium-r-*-*-*-120-*-*-m-*-*-* @@ -3002,12 +3002,16 @@ Emacs.modeline.attributeFont: fixed @end example -This is confusing because modeline is a face, and can be found listed -with all faces in the current mode by using @kbd{M-x set-face-font -(enter) ?}. It uses the face specification of @code{attributeFont}, -while menubar is a normal X thing that uses the specification -@code{font}. With Motif it may be necessary to use @code{fontList} -instead of @code{font}. +This is confusing because @samp{default} and @samp{modeline} are face +names, and can be found listed with all faces in the current mode by +using @kbd{M-x set-face-font (enter) ?}. They use the face-specific +resource @samp{attributeFont} + +On the other hand, @samp{menubar} is a normal X thing that uses the +resource @samp{font}. With Motif it @emph{may be} necessary to use +@samp{fontList} @emph{instead of} @samp{font}. In @emph{non-Motif} +configurations with Mule it @emph{is} necessary to use @samp{fontSet} +instead of @samp{font}. (Sorry, there just is no simple recipe here.) @node Q3.2.3, Q3.2.4, Q3.2.2, Customization @unnumberedsubsec Q3.2.3: How can I set the colors when highlighting a region? @@ -3016,7 +3020,7 @@ region? You can change the face @code{zmacs-region} either in your -@file{.Xdefaults}: +@file{.Xresources}: @example Emacs.zmacs-region.attributeForeground: firebrick @@ -3770,16 +3774,19 @@ I am trying to use a resource like @code{Emacs*menubar*font} to set the font of the menubar but it's not working. -If you are using the real Motif menubar, this resource is not -recognized; you have to say: +In Motif, the use of @samp{font} resources is obsoleted in order to +support internationalization. If you are using the real Motif menubar, +this resource is not recognized at all; you have to say: @example Emacs*menubar*fontList: FONT @end example -If you are using the Lucid menubar, the former resource will be -recognized only if the latter resource is unset. This means that the -resource +If you are using the Lucid menubar, for backward compatibility with +existing user configurations, the @samp{font} resource is recognized. +Since this is not supported by Motif itself, the code is a kludge and +the @samp{font} resource will be recognized only if the @samp{fontList} +resource resource is unset. This means that the resource @example *fontList: FONT @@ -3793,6 +3800,16 @@ even though the latter is more specific. +In non-Motif configurations using @samp{--with-mule} and +@samp{--with-xfs} it @emph{is} necessary to use the @code{fontSet} +resource @emph{instead of} the @code{font} resource. The backward +compatibility kludge was never implemented for non-Motif builds. +Example: + +@example +*fontSet: FONT +@end example + @node Q3.8.5, Q3.9.1, Q3.8.4, Customization @unnumberedsubsec Q3.8.5: How can I bind a key to a function to toggle the toolbar? @@ -3819,7 +3836,7 @@ @unnumberedsubsec Q3.9.1: How can I disable the scrollbar? To disable them for all frames, add the following line to -your @file{.Xdefaults}: +your @file{.Xresources}: @example Emacs.scrollBarWidth: 0 cvs server: Diffing man/internals Index: man/internals/internals.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/internals/internals.texi,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- man/internals/internals.texi 6 Feb 2003 14:37:56 -0000 1.40 +++ man/internals/internals.texi 2 Mar 2003 09:38:47 -0000 1.41 @@ -113,6 +113,7 @@ * XEmacs From the Outside:: A broad conceptual overview. * The Lisp Language:: An overview. * XEmacs From the Perspective of Building:: +* Build-Time Dependencies:: * XEmacs From the Inside:: * The XEmacs Object System (Abstractly Speaking):: * How Lisp Objects Are Represented in C:: @@ -1131,7 +1132,7 @@ that makes it a full-fledged application platform, very much like an OS inside the real OS. -@node XEmacs From the Perspective of Building, XEmacs From the Inside, The Lisp Language, Top +@node XEmacs From the Perspective of Building, Build-Time Dependencies, The Lisp Language, Top @chapter XEmacs From the Perspective of Building @cindex XEmacs from the perspective of building @cindex building, XEmacs from the perspective of @@ -1240,9 +1241,73 @@ This is useful when the dumping procedure described above is broken, or when using certain program debugging tools such as Purify. These tools get mighty confused by the tricks played by the XEmacs build process, -such as allocation memory in one process, and freeing it in the next. +such as allocating memory in one process, and freeing it in the next. -@node XEmacs From the Inside, The XEmacs Object System (Abstractly Speaking), XEmacs From the Perspective of Building, Top +@node Build-Time Dependencies, XEmacs From the Inside, XEmacs From the Perspective of Building, Top +@chapter Build-Time Dependencies +@cindex build-time dependencies +@cindex dependencies, build-time + +This is a collection of random notes on build-time dependencies as of +about XEmacs 21.5.11. Of course we use @file{make} to manage most +dependencies, especially for the C code. The main thing here is for the +Release Engineer to run the @file{src/make-src-depend} script every so +often, at least at every release. + +However, since most of XEmacs is written in Lisp, and we compile and +preload the Lisp for efficiency, managing Lisp compilation using +@file{make} would imply running XEmacs hundreds of times. This would +make the build process unbearably long. Thus those processes that +require running the same Lisp programs on many files are managed using +Lisp driver functions rather than @file{make}. The situation is further +complicated by the fact that documentation strings are kept in an +external database, and referenced in the dumped XEmacs by file offset. +Finally, the Lisp files are processed to collect autoloaded function +information and customize dependencies, which are then written into +generated Lisp files. + +About this, Ben sez: + +@quotation +@enumerate 1 +@item +Redumping depends on up-to-date dumped @file{.elc} files and @file{DOC} +but not directly on auto-autoloads. + +@item +Rebuilding dumped @file{.elc} files depends on auto-autoloads being +up-to-date. + +@item +Building the @file{DOC} file depends on up-to-date dumped @file{.elc} +files but not directly on auto-autoloads. + +@item +Recompiling anything depends on @file{bytecomp.elc} and +@file{byte-optimize.elc} being up-to-date. +@end enumerate + +Put these together and you'll see it's perfectly acceptable to build +auto-autoloads *after* dumping if no @file{.elc} files are out-of-date. +@end quotation + +These Lisp driver programs typically run from temacs, not a dumped +XEmacs. The simplest (but time-consuming) way to achieve a sane +environment for running Lisp is to load @file{loadup.el} or +@file{loadup-el.el}. (The latter is used to avoid loading possibly +out-of-date compiled Lisp files.) If this is not done, you have to +construct the environment yourself. See @file{dumped-lisp.el} to see +how it is done in the dumped XEmacs. + +One potential gotcha is that very early customizations are now handled +by adding the definitions to the special variable +@code{custom-declare-variable-list}, defined in @file{subr.el}. If you +use any higher-level functionality that might load @file{custom.el}, but +you do not need @file{subr.el}, you should @samp{defvar} +@code{custom-declare-variable-list} to prevent the @samp{void-variable} +error. (Currently this is only needed for @file{make-docfile.el}.) + +@node XEmacs From the Inside, The XEmacs Object System (Abstractly Speaking), Build-Time Dependencies, Top @chapter XEmacs From the Inside @cindex XEmacs from the inside @cindex inside, XEmacs from the cvs server: Diffing man/lispref cvs server: Diffing man/new-users-guide cvs server: Diffing man/xemacs Index: man/xemacs/frame.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs/frame.texi,v retrieving revision 1.4 retrieving revision 1.6 diff -u -r1.4 -r1.6 --- man/xemacs/frame.texi 26 Apr 2001 20:03:58 -0000 1.4 +++ man/xemacs/frame.texi 27 Mar 2003 12:57:50 -0000 1.6 @@ -310,7 +310,7 @@ extreme right is the @samp{Help} menu, which should always be available. It provides access to all the XEmacs help facilities available through @kbd{C-h}, as well as samples of various configuration -files like @samp{~/.Xdefaults} and @samp{~/.emacs}. At the extreme left +files like @samp{~/.Xresources} and @samp{~/.emacs}. At the extreme left is the @samp{Files} menu, which provides the usual file reading, writing, and printing operations, as well as operations like revert buffer from most recent save. The next menu from the left is the @@ -425,6 +425,13 @@ from the list. By default up to 6 most recently used buffers with the same mode are displayed on tabs in the gutter. +This behavior can be altered by customizing +@code{buffers-tab-filter-functions}. Setting this variable to +@code{nil} forces display of all buffers, up to +@code{buffers-tab-max-size} (also customizable). More complex behavior +may be available in 3rd party libraries. These, and some more +rarely customized options, are in the @code{buffers-tab} Customize group. + @node Inhibiting, Customizing, Gutter Basics, GUI Components @comment node-name, next, previous, up @section Inhibiting Display of GUI Components @@ -524,7 +531,7 @@ For values specific to the first XEmacs frame, you must use X resources. The variable @code{x-frame-defaults} takes an alist of default frame creation parameters for X window frames. These override what is -specified in @file{~/.Xdefaults} but are overridden by the arguments to +specified in @file{~/.Xresources} but are overridden by the arguments to the particular call to @code{x-create-frame}. @vindex create-frame-hook Index: man/xemacs/packages.texi =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs/packages.texi,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- man/xemacs/packages.texi 3 Feb 2003 02:42:56 -0000 1.20 +++ man/xemacs/packages.texi 20 Mar 2003 13:21:30 -0000 1.21 @@ -243,7 +243,7 @@ (put in the details of remote host and directory) If the package tarballs _AND_ the package-index file are in a -local directory, you can: @code{M-x pui-add-install-directory RET} +local directory, you can: @code{M-x pui-set-local-package-get-directory RET} @item Obtain a list of packages and display the list in a buffer named @@ -252,10 +252,7 @@ keyb: @code{M-x pui-list-packages RET} XEmacs will now connect to the remote site and download the -latest package-index file. If you see an error about the -package-index entries not being PGP signed, you can safely -ignore this because PGP has not been integrated into the XEmacs -package tools yet. +latest package-index file. The visual package browser will then display a list of all packages. Help information will be displayed at the very bottom of the buffer; you @@ -278,7 +275,7 @@ From here, you can select or unselect packages for installation using the @key{RET} key, the @kbd{Mouse-2} button or selecting "Select" from -the (Popup) Menu. +the Popup @kbd{Mouse-3} Menu. Once you've finished selecting the packages, you can press the @kbd{x} key (or use the menu) to actually install the packages. Note that you will have to restart XEmacs for XEmacs to @@ -307,7 +304,9 @@ @end table Moving the mouse over a package will also cause additional information -about the package to be displayed in the minibuffer. +about the package to be displayed in the minibuffer. If you have +balloon-help enabled a balloon-help frame will pop up and display +additional package information also. @item @@ -343,6 +342,17 @@ will search for the latest version and install it and any packages that it depends upon. +@heading Keeping Packages Up To Date: +Once you have the packages you want installed (using any of the above +methods) you'll want to keep them up to date. You can do this easily +from the menubar: + +@example +Tools -> Packages -> Add Download Site +Tools -> Packages -> Update Installed Packages +@end example + + @node Which Packages, Removing Packages, Automatically, Installing Packages @comment node-name, next, previous, up @cindex which packages @@ -402,7 +412,7 @@ @item GNU make (3.75 or later preferred). @item makeinfo -(1.68 from texinfo-3.11 or later required). +(4.2 from GNU texinfo 4.2 or later required). @item GNU tar (or equivalent). @item GNU gzip cvs server: Diffing modules Index: modules/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/modules/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- modules/ChangeLog 16 Feb 2003 06:13:30 -0000 1.16 +++ modules/ChangeLog 24 Apr 2003 23:41:39 -0000 1.17 @@ -1,3 +1,7 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. cvs server: Diffing modules/base64 cvs server: Diffing modules/common cvs server: Diffing modules/ldap cvs server: Diffing modules/postgresql Index: modules/postgresql/.cvsignore =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/modules/postgresql/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- modules/postgresql/.cvsignore 10 Sep 2002 15:27:17 -0000 1.1 +++ modules/postgresql/.cvsignore 16 Mar 2003 21:02:06 -0000 1.2 @@ -1,2 +1,5 @@ *.ell *_i.c +GNUmakefile +Makefile +Makefile.in cvs server: Diffing modules/sample cvs server: Diffing modules/sample/external cvs server: Diffing modules/sample/internal cvs server: Diffing modules/zlib cvs server: Diffing netinstall Index: netinstall/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/netinstall/ChangeLog,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- netinstall/ChangeLog 16 Feb 2003 06:13:32 -0000 1.24 +++ netinstall/ChangeLog 24 Apr 2003 23:41:40 -0000 1.25 @@ -1,3 +1,7 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. @@ -471,6 +475,6 @@ * all: port from cygwin setup. -%%% $Id: ChangeLog,v 1.24 2003/02/16 06:13:32 youngs Exp $ -$Revision: 1.24 $ +%%% $Id: ChangeLog,v 1.25 2003/04/24 23:41:40 youngs Exp $ +$Revision: 1.25 $ cvs server: Diffing nt Index: nt/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/ChangeLog,v retrieving revision 1.149 retrieving revision 1.160 diff -u -r1.149 -r1.160 --- nt/ChangeLog 16 Feb 2003 06:13:33 -0000 1.149 +++ nt/ChangeLog 24 Apr 2003 23:41:41 -0000 1.160 @@ -1,3 +1,251 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-03-30 Adrian Aichner + + * xemacs.mak (install): PROBLEMS is actually in $(SRCROOT). + +2003-03-26 Adrian Aichner + + * xemacs.mak (install): Copy $(BLDLIB_SRC)\PROBLEMS, now that + nt\PROBLEMS is gone (part of ..\PROBLEMS now). + +2003-03-22 Adrian Aichner + + * xemacs.mak (installation): Restore version convention in + generated Installation file. + +2003-03-09 Ben Wing + + * config.inc.samp (COMPFACE_DIR): + Note that relative directories are a no-no in BUILD_DIR and + SOURCE_DIR. Use paths relative to $(MAKEROOT) instead. + +2003-03-06 Ben Wing + + * xemacs.mak (INFO): New. + * xemacs.mak (PATH_DEFINES): + Add override for info/ as well when separate source/build dirs. + + * xemacs.mak (dump_temacs): + * xemacs.mak (all): + * xemacs.mak (TEMACS_DUMP_DEP): + * xemacs.mak (update-elc): New. + * xemacs.mak (docfile): + * xemacs.mak (update-elc-2): + * xemacs.mak (load-shadows): + Order sections in main build process and add comments. Add + additional dependencies to try and prevent later steps from + happening when failures in earlier steps have occurred. + +2003-03-01 Ben Wing + + * PROBLEMS: Delete. + + * config.inc.samp (USE_FASTCALL): + * config.inc.samp (HAVE_VC6): Removed. + * config.inc.samp (DEBUG_XEMACS): + * config.inc.samp (SUPPORT_EDIT_AND_CONTINUE): New. + * xemacs.mak (DEBUG_XEMACS): + * xemacs.mak (HAVE_VC6): Removed. + * xemacs.mak (SUPPORT_EDIT_AND_CONTINUE): New. + * xemacs.mak (CCV): + * xemacs.mak (LIB_SRC_CFLAGS): New. + * xemacs.mak (ETAGS_DEPS): + * xemacs.mak (OS): + * xemacs.mak (TEMACS_LFLAGS): + Eliminate HAVE_VC6, use SUPPORT_EDIT_AND_CONTINUE in its place. + No incremental linking unless SUPPORT_EDIT_AND_CONTINUE, since it + can cause nasty crashes in pdump. Put warnings about this in + config.inc.samp. Report the full compile flags used for src + and lib-src in the Installation output. + +2003-02-28 Ben Wing + + * README: + * README (NOTE): Removed. + * config.inc.samp (HAVE_MS_WINDOWS): + * config.inc.samp (HAVE_X_WINDOWS): Removed. + * config.inc.samp (X11_DIR): Removed. + * config.inc.samp (COMPFACE_DIR): + * xemacs.mak (XEMACS): Removed. + * xemacs.mak (LISP): Removed. + * xemacs.mak (LIB_SRC): Removed. + * xemacs.mak (MODULES): Removed. + * xemacs.mak (NT): Removed. + * xemacs.mak (OUTDIR): Removed. + * xemacs.mak (SRC): Removed. + * xemacs.mak (LWLIB_SRCDIR): Removed. + * xemacs.mak (MAKEDIRSTRING): Removed. + * xemacs.mak (XEMACSDIRSTRING): Removed. + * xemacs.mak (MAKEROOT): New. + * xemacs.mak (COPYDIR): + * xemacs.mak (INFODOCK_VERSION_STRING): Removed. + * xemacs.mak (XEMACS_VERSION_STRING): Removed. + * xemacs.mak (SEPARATE_BUILD): New. + * xemacs.mak (SRCROOT): New. + * xemacs.mak (BLDROOT): New. + * xemacs.mak (PROGRAM_DEFINES): Removed. + * xemacs.mak (INSTALL_DIR): Removed. + * xemacs.mak (ETC): New. + * xemacs.mak (BLDLIB_SRC): New. + * xemacs.mak (BLDNT): New. + * xemacs.mak (BLDSRC): New. + * xemacs.mak (PACKAGE_PREFIX): Removed. + * xemacs.mak (PACKAGE_PATH): Removed. + * xemacs.mak (PATH_PACKAGEPATH): Removed. + * xemacs.mak (HAVE_X_WINDOWS): Removed. + * xemacs.mak (USE_CRTDLL): + * xemacs.mak (CONFIG_ERROR): + * xemacs.mak (OS): Removed. + * xemacs.mak (EMACS_CONFIGURATION): Removed. + * xemacs.mak (STACK_TRACE_EYE_CATCHER): Removed. + * xemacs.mak (CCV): Removed. + * xemacs.mak (DEBUG_FLAGS_COMPILE): Removed. + * xemacs.mak (DEBUG_FLAGS_LINK): Removed. + * xemacs.mak (DEBUG_DEFINES): Removed. + * xemacs.mak (BROWSERFLAGS): Removed. + * xemacs.mak (C_LIBFLAG): Removed. + * xemacs.mak (LIBC_LIB): Removed. + * xemacs.mak (OPTFLAGS_FASTCALL): Removed. + * xemacs.mak (OPTFLAGS_CDECL): Removed. + * xemacs.mak (PATH_PREFIX): New. + * xemacs.mak (OPTFLAGS): Removed. + * xemacs.mak (PROFILE_FLAGS): Removed. + * xemacs.mak (PATH_DEFINES): New. + * xemacs.mak (MSW_DEFINES): + * xemacs.mak (TEMACS_MSW_OBJS): New. + * xemacs.mak (CPLUSPLUS_COMPILE_FLAGS): Removed. + * xemacs.mak (CFLAGS_NO_OPT): Removed. + * xemacs.mak (CFLAGS_NO_LIB): Removed. + * xemacs.mak (CFLAGS): Removed. + * xemacs.mak (CFLAGS_CDECL_NO_LIB): Removed. + * xemacs.mak (CFLAGS_CDECL): Removed. + * xemacs.mak (X_DEFINES): Removed. + * xemacs.mak (TEMACS_MULE_OBJS): New. + * xemacs.mak (X_INCLUDES): Removed. + * xemacs.mak (X_LIBS): Removed. + * xemacs.mak (TEMACS_DEBUG_OBJS): New. + * xemacs.mak (TEMACS_DUMP_OBJS): New. + * xemacs.mak (TEMACS_ALLOC_OBJS): New. + * xemacs.mak (XEMACS_INCLUDES): Removed. + * xemacs.mak (LIB_SRC_DEFINES): Removed. + * xemacs.mak (INCLUDES): + * xemacs.mak (DEFINES): + * xemacs.mak (CONFIG_VALUES): Removed. + * xemacs.mak (TEMACS_CPP_FLAGS_NO_CFLAGS): + * xemacs.mak (TEMACS_ENTRYPOINT): Removed. + * xemacs.mak (TEMACS_DIR): Removed. + * xemacs.mak (TEMACS): Removed. + * xemacs.mak (TEMACS_BROWSE): Removed. + * xemacs.mak (TEMACS_SRC): Removed. + * xemacs.mak (TEMACS_CPP_CDECL_FLAGS): + * xemacs.mak (TEMACS_LIBS): Removed. + * xemacs.mak (TEMACS_OBJS): + * xemacs.mak (TEMACS_LFLAGS): Removed. + * xemacs.mak (LINK_DEPENDENCY_ARGS): Removed. + * xemacs.mak (LINK_STANDARD_LIBRARY_ARGS): Removed. + * xemacs.mak (ETAGS_DEPS): Removed. + * xemacs.mak (TEMACS_X_OBJS): Removed. + * xemacs.mak (LIB_SRC_TOOLS): Removed. + * xemacs.mak (LASTFILE): Removed. + * xemacs.mak (LASTFILE_SRC): Removed. + * xemacs.mak (LASTFILE_FLAGS): Removed. + * xemacs.mak (LASTFILE_OBJS): Removed. + * xemacs.mak (LWLIB): Removed. + * xemacs.mak (LWLIB_FLAGS): Removed. + * xemacs.mak (LWLIB_OBJS): Removed. + * xemacs.mak (.SUFFIXES): + * xemacs.mak (create-list-file): Removed. + * xemacs.mak (compile-list-file): Removed. + * xemacs.mak (TEMACS_DUMP_ID_OBJ): Removed. + * xemacs.mak (PROGNAME): Removed. + * xemacs.mak (DO_TEMACS): Removed. + * xemacs.mak (DO_XEMACS): Removed. + * xemacs.mak (BATCH): Removed. + * xemacs.mak (BATCH_PACKAGES): Removed. + * xemacs.mak (TEMACS_BATCH): Removed. + * xemacs.mak (XEMACS_BATCH): Removed. + * xemacs.mak (XEMACS_BATCH_PACKAGES): Removed. + * xemacs.mak (temacs_loadup_args): Removed. + * xemacs.mak (dump_temacs_args): Removed. + * xemacs.mak (run_temacs_args): Removed. + * xemacs.mak (dump_temacs): Removed. + * xemacs.mak (testdir): Removed. + * xemacs.mak (batch_test_emacs): Removed. + * xemacs.mak (check): Removed. + * xemacs.mak (check-temacs): Removed. + * xemacs.mak (MANDIR): + * xemacs.mak (check-features): Removed. + * xemacs.mak (tagslisp): Removed. + * xemacs.mak (tags): Removed. + * xemacs.mak (NEW_USERS_GUIDE_SRCS): + * xemacs.mak (makeinfo-test): + * xemacs.mak (installation): New. + * xemacs.mak (RAW_EXE): New. + * xemacs.mak (DUMP_TARGET): New. + * xemacs.mak (all): New. + * xemacs.mak (TEMACS_DUMP_DEP): New. + * xemacs.mak (DOC): + * xemacs.mak (docfile): + * xemacs.mak (update-elc): + * xemacs.mak (update-elc-2): + * xemacs.mak (load-shadows): + * xemacs.mak (temacs): Removed. + * xemacs.mak (install): + * xemacs.mak (versionclean): New. + * xemacs.mak (distclean): + * xemacs.mak (realclean): + * xemacs.mak (extraclean): + * xemacs.mak (depend): + * xemacs.mak (unicode-encapsulate): + -- Major reorganization and cleanup. + -- Add support for separated build tree and source tree. + -- Delete all support for X Windows building, since it's + totally bit-rotten and will never be fixed up. Instruct + people to use Cygwin if they want such support. + + * make-build-dir: + New script to create a skeleton build tree for use with + separated build and source tree compilation. + +2003-02-20 Ben Wing + + * xemacs.dsp (CFG): + Add /k to default build. + +2003-02-19 Ben Wing + + * xemacs.mak (DO_TEMACS): New. + * xemacs.mak (DO_XEMACS): New. + * xemacs.mak (TEMACS_BATCH): + * xemacs.mak (temacs_loadup_args): New. + * xemacs.mak (dump_temacs_args): New. + * xemacs.mak (run_temacs_args): New. + * xemacs.mak (dump_temacs): + * xemacs.mak (blddir): Removed. + * xemacs.mak (temacs_loadup): Removed. + * xemacs.mak (run_temacs): Removed. + * xemacs.mak (check): + * xemacs.mak (check-temacs): + * xemacs.mak (check-features): New. + * xemacs.mak (makeinfo-test): + * xemacs.mak (LOADPATH): Removed. + * xemacs.mak (update-elc): + * xemacs.mak (update-elc-2): + * xemacs.mak (load-shadows): New. + * xemacs.mak (all): + * xemacs.mak (OS): + Add macros DO_TEMACS, DO_XEMACS, and a few others; this macro + section is now completely in sync with src/Makefile.in.in. Copy + check-features, load-shadows, and rebuilding finder-inf.el from + src/Makefile.in.in. The main build/dump/recompile process is now + synchronized with src/Makefile.in.in. Change `WARNING' to `NOTE' + and `error checking' to `error-checking' TO avoid tripping + faux warnings and errors in the VC++ IDE. + + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. Index: nt/PROBLEMS =================================================================== RCS file: nt/PROBLEMS diff -N nt/PROBLEMS --- nt/PROBLEMS 12 Apr 2001 18:22:58 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,177 +0,0 @@ - -*- mode:outline -*- - -This file describes various problems that have been encountered in -running XEmacs on Windows 95, 98 and NT. It has been updated for -XEmacs 21.0. - -This is the first release of XEmacs on Windows. In testing it has -proved to be extremely stable in general use (but see the gnus and -subprocess problems below), but not all features or packages work -correctly yet. - -Use `C-c C-f' to move to the next equal level of outline, and -`C-c C-b' to move to previous equal level. `C-h m' will give more -info about the Outline mode. - -Also, Try finding the things you need using one of the search commands -XEmacs provides (e.g. `C-s'). - -General advice: - Remember your .emacs file! ~\.emacs is your Emacs init file. If - you observe strange problems, invoke XEmacs with the `-q' option - and see if you can repeat the problem. - - -* Problems with running XEmacs -============================== -** Conflicts with FSF NTEmacs - -Depending on how it is installed, FSF NTEmacs may setup various EMACS* -variables in your environment. The presence of these variables may -cause XEmacs to fail at startup, cause you to see corrupted -doc-strings, or cause other random problems. - -You should remove these variables from your environment. These -variables are not required to run FSF NTEmacs if you start it by -running emacs.bat. - -** XEmacs can't find my .emacs file - -XEmacs looks for your .emacs in your "home" directory. XEmacs decides -that your "home" directory is, in order of preference: - -- The value of the HOME environment variable, if the variable exists. -- The value of the HOMEDRIVE and HOMEPATH environment variables, if - these variables both exist. -- The directory that XEmacs was started from. - -** XEmacs can't find any packages - -XEmacs looks for your packages in subdirectories of a directory which -is set at compile-time, and defaults to C:\Program Files\XEmacs. The -variable configure-package-path holds the actual path that was -compiled into your copy of XEmacs. - -The compile-time default location can be overridden by the -EMACSPACKAGEPATH environment variable or by the -SOFTWARE\GNU\XEmacs\EMACSPACKAGEPATH registry entry. You should check -that these variables, if they exist, point to the actual location of -your package tree. - -** XEmacs sometimes crashes when using gnus - -This is a known bug in this release of XEmacs on Windows. - -If you want to use gnus anyway, you should minimize any possible data -loss by saving any modified buffers before you start and ensuring that -you haven't set gnus-use-dribble-file to nil or disabled the normal -XEmacs auto-save mechanism. - -** XEmacs doesn't die when shutting down Windows 95 or 98 - -When shutting down Windows 95 or 98 you may see a dialog that says - "xemacs / You must quit this program before you quit Windows". -It is safe to - "Click OK to quit the program and Windows", -but you won't be offered a chance to save any modified XEmacs buffers. - -* Look and feel -=============== -** Key bindings - -The C-z, C-x, C-c, and C-v keystrokes have traditional uses in both -emacs and Windows programs. XEmacs binds these keys to their -traditional emacs uses, and provides Windows 3.x style bindings for -the Cut, Copy and Paste functions. - - Function XEmacs binding - -------- -------------- - Undo C-_ - Cut Sh-Del - Copy C-Insert - Paste Sh-Insert - -You can rebind keys to make XEmacs more Windows-compatible; for -example, to bind C-z to undo: - - (global-set-key [(control z)] 'undo) - -Rebindind C-x and C-c is trickier because by default these are prefix -keys in XEmacs. See the "Key Bindings" node in the XEmacs manual. - -** Behavior of selected regions - -Selected regions behave differently in XEmacs from typical Windows -programs. The pc-select package provides various functions to enable -the standard Windows behavior for selected regions (eg mark via -shift-arrow, self-inserting deletes region, etc). - -** Limitations on the use of the AltGr key. - -In some locale and OS combinations you can't generate M-AltGr-key or -C-M-AltGr-key sequences at all. - -To generate C-AltGr-key or C-M-AltGr-key sequences you must use the -right-hand Control key and you must press it *after* AltGr. - -These limitations arise from fundamental problems in the way that the -win32 API reports AltGr key events. There isn't anything that XEmacs -can do to work round these problems that it isn't already doing. - -You may want to create alternative bindings if any of the standard -XEmacs bindings require you to use some combination of Control or Meta -and AltGr. - - -* Features not fully supported in this release -============================================== -** Limited support for subprocesses - -Attempting to use call-process to run a 16bit program gives a -"Spawning child process: Exec format error". For example shell-command -fails under Windows 95 and 98 if you use command.com or any other -16bit program as your shell. - -XEmacs may incorrectly quote your call-process command if it contains -double quotes, backslashes or spaces. - -start-process and functions that rely on it are supported under Windows 95, -98 and NT. However, starting a 16bit program that requires keyboard input -may cause XEmacs to hang or crash under Windows 95 and 98, and will leave -the orphaned 16bit program consuming all available CPU time. - -Sending signals to subprocesses started by call-process or by -start-process fails with a "Cannot send signal to process" error under -Windows 95 and 98. As a side effect of this, quitting XEmacs while it -is still running subprocesses causes it to crash under Windows 95 and -98. - -** Changing fonts from the Options menu - -The "Font" and "Size" entries on the Options menu don't work yet. This -will be fixed in a future release. In the meantime, you can either -change face fonts with customize or manually; for example: - - (set-face-font 'default "Lucida Console:Regular:10::Western") - (set-face-font 'modeline "MS Sans Serif:Regular:10::Western") - -Font weight and style and character set must be supplied in English as -above. Common weights and styles are "Regular", "Regular Italic", -"Bold" and "Bold Italic". Common character sets are "Western", -"Central European" and "OEM/DOS". - -Windows 95 only comes with one fixed-width font that is suitable for -use by XEmacs, namely "Courier New". - -** No MULE support - -This release of XEmacs on Windows does not contain MULE support. MULE -support has not been a priority for the XEmacs on Windows developers. - -** Printing - -This release of XEmacs on Windows does not support printing natively. - -You can use the lpr-command and lpr-switches variables to specify an -external print program. - Index: nt/README =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/README,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- nt/README 12 Jan 2003 11:04:30 -0000 1.24 +++ nt/README 1 Mar 2003 07:25:32 -0000 1.25 @@ -68,51 +68,9 @@ Unpack the packages into "x:\your\choice\XEmacs\xemacs-packages", for example "c:\Program Files\XEmacs\xemacs-packages". -3. At this point you can choose to build for X and/or for Win32 native GUI. - If you only want to build for the Win32 native GUI then skip the next - section. - - -** Extra tools and sources required for X - -NOTE: XEmacs has not been tested with X support under the native -Windows build for a long, long time! It may not even compile any -more. If you are interested in X support, you're better off compiling -the Cygwin version of XEmacs, which can handle both Win32 native and X -frames (in the same binary, in fact, but not at the same time), and is -actively tested with X support. - -If you want support for X you will also need: - -1. An X server. XEmacs has been tested and runs well under MI/X, - available from: http://www.microimages.com/mix/. (International aka - "Mule" support even works under this X server!) Unfortunately, this is - not free, but is trialware; you have to pay $25 if you want to use it - for more than 15 days. XEmacs also runs (barely) under the free XWin - server that comes as part of the Cygwin XFree86 package, available at - - ftp://sources.redhat.com/pub/cygwin/xfree/ - - or numerous mirrors, such as - - ftp://ftp.freesoftware.com/pub/sourceware/cygwin/xfree/ - - There are numerous other X servers available in the same package or at - the same location, but unfortunately most of them behave even worse - than XWin. If you have any luck with any of these, *PLEASE* email - the maintainers at xemacs-nt@xemacs.org, and we'll add the info here. - -2. Source for the MIT X11R6.3 libraries, available from ftp.x.org. - -3. You'll need to compile the MIT libraries without multi-thread support. - To do this, there is an example Win32.cf and site.def provided which set - the relevant flags. You will also need to apply the patch in nt/X11.patch - in the xc/lib/X11 directory which will fix the DLL definition file. - - Once compiled and installed, you will need to apply the patch in - nt/Xmd.patch. This is messy and better solutions would be appreciated. - -4. Goto step 2 under 'Optional libraries' below. +3. The native build no longer supports X Windows. There is no point, + since the Cygwin build is actively maintained and supports X Windows + very well. See the FAQ if you want to build with Cygwin. * Optional libraries @@ -192,12 +150,6 @@ HAVE_XFACE=1 COMPFACE_DIR="x:\location\of\your\compface\sources" - -- If you're building for X, modify the appropriate lines in config.inc - as follows: - - HAVE_X_WINDOWS=1 - X11_DIR=x:\root\directory\of\your\X11\installation - -- By default, XEmacs will expect to find its packages in the subdirectories "site-packages", "mule-packages" and "xemacs-packages" under the directory "c:\Program Files\XEmacs". If you want it to look @@ -227,7 +179,15 @@ (By default, XEmacs will be installed in directories under the directory "c:\Program Files\XEmacs\XEmacs-21.5".) -3. If you want to build xemacs on the command line, use +3. If you want the built files to go into a different tree than the source + tree (e.g. this allows you to build multiple versions of XEmacs, with + different configuration settings, from the same source tree), use the + script `make-build-dir' to create a skeleton build tree, create a + config.inc in that tree, and then run nmake from that tree. This is + similar to running `configure --srcdir=PATH' under Unix. See the + comments in `config.inc.samp' for more information. + +4. If you want to build xemacs on the command line, use `nmake install -f xemacs.mak', or just `nmake -f xemacs.mak' if you want to run XEmacs from its build directory. nmake will build temacs, the DOC file, update the elc's, dump xemacs and (optionally) install the relevant @@ -243,7 +203,7 @@ You may want to create a shortcut to the file from your Desktop or Start Menu. -4. To build using MS Visual Studio, you can use the workspace file +5. To build using MS Visual Studio, you can use the workspace file `nt/xemacs.dsw'. This was prepared for Visual C++ 6.0. If you have a different version and neither file works, just open up `nt/xemacs.mak' from within Visual Studio and it will offer to wrap this Makefile in a Index: nt/config.inc.samp =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/config.inc.samp,v retrieving revision 1.12 retrieving revision 1.15 diff -u -r1.12 -r1.15 --- nt/config.inc.samp 6 Feb 2003 06:36:00 -0000 1.12 +++ nt/config.inc.samp 9 Mar 2003 12:59:40 -0000 1.15 @@ -18,15 +18,7 @@ # Native MS Windows support. HAVE_MS_WINDOWS=1 -# X Windows support. Not working at all and probably never will. If you -# want X support under MS Windows, compile with Cygwin instead. -HAVE_X_WINDOWS=0 -X11_DIR= - -# GTK support. Do NOT set this to 1; as of xemacs-21.5-b6 -# gtk-xemacs is not supported on MSWindows (mingw or msvc). -# Yes, we know that gtk has been ported to native MSWindows -# but XEmacs is not yet ready to use that port. +# GTK support. Do NOT set this to 1; this does not currently work. HAVE_GTK=0 GTK_DIR= @@ -74,6 +66,40 @@ # Build settings # ############################################################################ +# If you want to the built files to be placed outside of the source tree +# (e.g. this allows you to build multiple versions of XEmacs, with +# different configuration settings, from the same source tree), run +# `make-build-dir' to create a skeleton build tree, giving it the name of a +# path. This creates the specified directory and the `nt' directory below +# it, copies config.inc (if it exists), config.inc.samp and xemacs.mak into +# the `nt' directory, and modifies the config files to contain the path of +# the source tree in SOURCE_DIR. This will not overwrite files that +# already exist, so it can safely be run more than once on the same tree. +# +# Running nmake in the skeleton build tree will then build XEmacs in that +# directory tree, using the source files as specified. The paths of the +# `lisp' and `etc' directories in the source tree will be compiled into the +# executable as "last-resort" values -- i.e. they will be used if you +# simply run the executable as-is, but will not override any local copy of +# the `lisp' and/or `etc' directories that you may have made. +# +# Alternatively, you can just uncomment the line below for BUILD_DIR and +# specify a (possibly non-existent) path. Running nmake will then put its +# build files into a parallel directory structure underneath the specified +# path, creating the directories as necessary. The problem with this is +# that the first method above allows you to have a different copy of +# `config.inc' for each build directory, but doing it this way means you +# have only one version of config.inc, and have to manually change it for +# each different build. + +# NOTE: These cannot be relative paths. If you want the source and build to +# be relatives of each other, use $(MAKEROOT) to refer to the root of the +# current tree -- that's one level up from where xemacs.mak is located. + +# SOURCE_DIR=c:\src\xemacs\working + +# BUILD_DIR=c:\src\xemacs\msbuilds\working + # Set this to specify the location of makeinfo. (If not set, XEmacs will # attempt to use its built-in, much slower texinfo support when building # info files.) If you are building XEmacs yourself, you probably have @@ -90,9 +116,6 @@ # #### Change to 1 when I check in the ws with support for fastcall USE_FASTCALL=0 -# True if running VC++ 6 or later. -HAVE_VC6=1 - ############################################################################ # Development options # ############################################################################ @@ -109,6 +132,12 @@ # variable, below.) DEBUG_XEMACS=1 +# Set this to enable support for edit-and-continue under VC++. +# WARNING: This turns on incremental linking, which is known to lead to +# occasional weird crashes in pdump loading. If that happens, do a +# nmake -f xemacs.mak clean so that temacs.exe and xemacs.exe get removed. +SUPPORT_EDIT_AND_CONTINUE=0 + # Uncomment this to turn off or on the error-checking code, which adds # abundant internal error checking (and slows things down a lot). Normally, # leave this alone -- it will be on for beta builds and off for release @@ -121,6 +150,10 @@ # CPLUSPLUS_COMPILE=0 # Set this to speed up building, for development purposes. +# WARNING: This may not completely rebuild all targets. In particular, +# DOC is not rebuilt, and changes to lisp.h and config.h do not trigger +# mass rebuilding. Other things may also be enabled that are not safe +# for release builds. QUICK_BUILD=0 # Set this to see exactly which compilation commands are being run (not Index: nt/make-build-dir =================================================================== RCS file: nt/make-build-dir diff -N nt/make-build-dir --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ nt/make-build-dir 1 Mar 2003 07:25:32 -0000 1.1 @@ -0,0 +1,85 @@ +: #-*- Perl -*- + +# Create skeleton build tree +# +# Copyright (C) 2003 Ben Wing. +# +# This file is part of XEmacs. +# +# XEmacs is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any +# later version. +# +# XEmacs is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with XEmacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# +# Author: Ben Wing +# +# Synched up with: Not in FSF. + +eval 'exec perl -w -S $0 ${1+"$@"}' + if 0; + +use File::Copy; +use File::Basename; +use Cwd; + +die "Creates a skeleton build tree for use with SOURCE_DIR in config.inc. + +Usage: $0 PATH +" if ($#ARGV); + +my $path = $ARGV[0]; +# Sometimes perl sucks, too. To get the equivalent of expand-file-name +# in a reliable way, you have to do really weird shit, it seems. +my $cwd = cwd (); +$0 =~ s|\\|/|g; +chdir (dirname ($0)); +my $srcroot = dirname (cwd ()); + +# Convert the path to MS Windows format if we're running Cygwin Perl. +chomp ($srcroot = `cygpath -w $srcroot`) if ($^O eq "cygwin"); +$srcroot =~ s|/|\\|g; + +chdir ($cwd); + +print "Creating skeleton build tree in $path\n"; +mkdir $path if ! -e $path; +mkdir "$path/nt" if ! -e "$path/nt"; +copy("$srcroot/nt/xemacs.mak", "$path/nt/xemacs.mak") if ! -e "$path/nt/xemacs.mak"; + +&HackFile ("config.inc.samp"); +&HackFile ("config.inc") if -e "$srcroot/nt/config.inc"; + +sub HackFile +{ + my $file = $_[0]; + if (! -e "$path/nt/$file") + { + open IN, "<$srcroot/nt/$file"; + open OUT, ">$path/nt/$file"; + + while () + { + # Must hack away CRLF junk. Perl sucks again. Wouldn't it be + # nice if perl handled this right?? Really can't be that hard!!! + s/\r\n/\n/g; + + # hack the SOURCE_DIR line to point back to the source. + s!^# SOURCE_DIR=.*!SOURCE_DIR=$srcroot!; + + print OUT; + } + + close IN; + close OUT; + } +} Index: nt/make-nt-depend =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/make-nt-depend,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- nt/make-nt-depend 18 Nov 2002 06:52:34 -0000 1.2 +++ nt/make-nt-depend 1 Mar 2003 07:25:32 -0000 1.3 @@ -65,8 +65,9 @@ # add obj path to object filenames # rewrite .o to .obj - # add dependency on config.inc to all objects (this might be too broad) - s/^(.+)\.o:(.+)/$obj\\$1.obj:$2 $config\\config.inc/; + s/^(.+)\.o:(.+)/$obj\\$1.obj:$2/; + # add dependency on config.inc wherever config.h is. + s/\\config.h/\\config.h $config\\config.inc/; print; } Index: nt/xemacs.dsp =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/xemacs.dsp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- nt/xemacs.dsp 12 Jan 2003 11:04:30 -0000 1.4 +++ nt/xemacs.dsp 21 Feb 2003 06:56:52 -0000 1.5 @@ -58,7 +58,7 @@ # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\src" # PROP Intermediate_Dir "obj" -# PROP Cmd_Line "NMAKE /f xemacs.mak" +# PROP Cmd_Line "NMAKE /k /f xemacs.mak" # PROP Rebuild_Opt "/a" # PROP Target_File "..\src\xemacs.exe" # PROP Bsc_Name "..\src\temacs.bsc" Index: nt/xemacs.mak =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/xemacs.mak,v retrieving revision 1.97 retrieving revision 1.104 diff -u -r1.97 -r1.104 --- nt/xemacs.mak 15 Feb 2003 10:15:58 -0000 1.97 +++ nt/xemacs.mak 30 Mar 2003 21:43:01 -0000 1.104 @@ -35,20 +35,11 @@ !error Please run nmake from the directory of this makefile (xemacs\nt). !endif -XEMACS=$(MAKEDIR)\.. -LISP=$(XEMACS)\lisp -LIB_SRC=$(XEMACS)\lib-src -MODULES=$(XEMACS)\modules -NT=$(MAKEDIR) -OUTDIR=$(NT)\obj -SRC=$(XEMACS)\src -LWLIB_SRCDIR=$(XEMACS)\lwlib -MAKEDIRSTRING=$(MAKEDIR:\=\\) -XEMACSDIRSTRING=$(MAKEDIRSTRING:\\nt=) +MAKEROOT=$(MAKEDIR:\nt=) +########################### Common commands. -# Common operations - +# Put these before including config.inc so they can be overridden there. # Note that some versions of some commands are deficient. # Define the 'del' command to use @@ -64,72 +55,58 @@ COPY=xcopy /q /r COPYDIR=xcopy /q /r /e -# Program name and version - -!include "$(XEMACS)\version.sh" +########################### Includes, and source and build tree determination. !include "config.inc" -!if !defined(INFODOCK) -INFODOCK=0 -!endif - -!if $(INFODOCK) -INFODOCK_VERSION_STRING=$(infodock_major_version).$(infodock_minor_version).$(infodock_build_version) -PROGRAM_DEFINES=-DINFODOCK \ - -DPATH_VERSION=\"$(INFODOCK_VERSION_STRING)\" \ - -DPATH_PROGNAME=\"infodock\" \ - -DEMACS_PROGNAME=\"infodock\" \ - -DEMACS_VERSION=\"$(INFODOCK_VERSION_STRING)\" \ - -DINFODOCK_MAJOR_VERSION=$(infodock_major_version) \ - -DINFODOCK_MINOR_VERSION=$(infodock_minor_version) \ - -DINFODOCK_BUILD_VERSION=$(infodock_build_version) -!else -XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version) -!if "$(emacs_beta_version)" != "" -!if "$(emacs_is_beta)" != "" -XEMACS_VERSION_STRING=$(XEMACS_VERSION_STRING)-b$(emacs_beta_version) -!else -XEMACS_VERSION_STRING=$(XEMACS_VERSION_STRING).$(emacs_beta_version) +!if defined(BUILD_DIR) +SEPARATE_BUILD=1 +SRCROOT=$(MAKEROOT) +BLDROOT=$(BUILD_DIR) +!else +!if defined(SOURCE_DIR) +SEPARATE_BUILD=1 +SRCROOT=$(SOURCE_DIR) +BLDROOT=$(MAKEROOT) +!else +SEPARATE_BUILD=0 +SRCROOT=$(MAKEROOT) +BLDROOT=$(MAKEROOT) !endif !endif -PROGRAM_DEFINES= \ - -DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\" \ - -DPATH_PROGNAME=\"xemacs\" \ - -DEMACS_VERSION=\"$(XEMACS_VERSION_STRING)\" \ - -DEMACS_PROGNAME=\"xemacs\" -!endif -# -# Command line options defaults -# -!if !defined(INSTALL_DIR) -! if $(INFODOCK) -INSTALL_DIR=c:\Program Files\Infodock\Infodock-$(INFODOCK_VERSION_STRING) -! else -INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING) -! endif +# Program name and version +!include "$(SRCROOT)\version.sh" + +########################### Basic vars referring to directories, both in +########################### the source and build trees. + +LISP=$(SRCROOT)\lisp +LIB_SRC=$(SRCROOT)\lib-src +NT=$(SRCROOT)\nt +SRC=$(SRCROOT)\src +ETC=$(SRCROOT)\etc +INFO=$(SRCROOT)\info + +BLDLIB_SRC=$(BLDROOT)\lib-src +BLDNT=$(BLDROOT)\nt +OUTDIR=$(BLDNT)\obj +BLDSRC=$(BLDROOT)\src + +# This appears in the dependency file +LWLIB_SRCDIR=$(SRCROOT)\lwlib + +########################### Process the config.inc options. + +!if !defined(INFODOCK) +INFODOCK=0 !endif !if !defined(MULE) MULE=0 !endif -!if !defined(PACKAGE_PATH) -! if !defined(PACKAGE_PREFIX) -PACKAGE_PREFIX=c:\Program Files\XEmacs -! endif -! if $(MULE) -PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\mule-packages;$(PACKAGE_PREFIX)\xemacs-packages -! else -PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\xemacs-packages -! endif -!endif -PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)" !if !defined(HAVE_MS_WINDOWS) HAVE_MS_WINDOWS=1 !endif -!if !defined(HAVE_X_WINDOWS) -HAVE_X_WINDOWS=0 -!endif !if !defined(HAVE_XPM) HAVE_XPM=0 !endif @@ -185,8 +162,8 @@ !if !defined(DEBUG_XEMACS) DEBUG_XEMACS=0 !endif -!if !defined(HAVE_VC6) -HAVE_VC6=1 +!if !defined(SUPPORT_EDIT_AND_CONTINUE) +SUPPORT_EDIT_AND_CONTINUE=0 !endif !if !defined(ERROR_CHECK_ALL) @@ -237,30 +214,8 @@ USE_CRTDLL=$(USE_PORTABLE_DUMPER) !endif -# -# System configuration -# -!if !defined(OS) -OS=Windows_95/98 -EMACS_CONFIGURATION=i586-pc-win32 -!else if "$(PROCESSOR_ARCHITECTURE)" == "x86" -EMACS_CONFIGURATION=i586-pc-win32 -!else if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" -EMACS_CONFIGURATION=mips-pc-win32 -!else if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" -EMACS_CONFIGURATION=alpha-pc-win32 -!else if "$(PROCESSOR_ARCHITECTURE)" == "PPC" -EMACS_CONFIGURATION=ppc-pc-win32 -!else -! error Unknown processor architecture type $(PROCESSOR_ARCHITECTURE) -!endif -STACK_TRACE_EYE_CATCHER=$(XEMACS_VERSION_STRING:.=_) -STACK_TRACE_EYE_CATCHER=xemacs_$(STACK_TRACE_EYE_CATCHER:-=_)_$(EMACS_CONFIGURATION:-=_) -PROGRAM_DEFINES=$(PROGRAM_DEFINES) -DSTACK_TRACE_EYE_CATCHER=$(STACK_TRACE_EYE_CATCHER) +########################### Check for incompatible options. -# -# Conf error checks -# CONFIG_ERROR=0 !if $(INFODOCK) && !exist("..\..\Infodock.rules") !message Cannot build InfoDock without InfoDock sources @@ -279,16 +234,8 @@ !message [[[Developer note: If you want to fix it, read Q112297 first]]] #### CONFIG_ERROR=1 !endif -!if !$(HAVE_MS_WINDOWS) && !$(HAVE_X_WINDOWS) -!message Please specify at least one HAVE_MS_WINDOWS=1 and/or HAVE_X_WINDOWS=1 -CONFIG_ERROR=1 -!endif -!if $(HAVE_X_WINDOWS) && !defined(X11_DIR) -!message Please specify root directory for your X11 installation: X11_DIR=path -CONFIG_ERROR=1 -!endif -!if $(HAVE_X_WINDOWS) && defined(X11_DIR) && !exist("$(X11_DIR)\LIB\X11.LIB") -!message Specified X11 directory does not contain "$(X11_DIR)\LIB\X11.LIB" +!if !$(HAVE_MS_WINDOWS) && !$(HAVE_GTK) +!message Please specify at least one HAVE_MS_WINDOWS=1 and/or HAVE_GTK=1 CONFIG_ERROR=1 !endif !if $(HAVE_MS_WINDOWS) && $(HAVE_GTK) && !defined(GTK_DIR) @@ -351,117 +298,89 @@ !error Configuration error(s) found !endif -# -# Whether to use dependency information generated by make-src-depend -# -!if $(DEPEND) && exist("$(SRC)\depend") -! if [if not exist $(OUTDIR)\nul mkdir "$(OUTDIR)"] -! endif -# This perl script used to be inline but that caused too many quoting problems -! if [perl .\make-nt-depend -s=$(SRC) -c=$(NT) -o=$(OUTDIR) < $(SRC)\depend > $(OUTDIR)\depend.tmp] -! endif -! include "$(OUTDIR)\depend.tmp" -!else -! if [echo WARNING: Compiling without dependency information.] -! endif -!endif +########################### Set version strings. -# -# Compiler command echo control. Define VERBOSECC=1 to get verbose compilation. -# -!if $(VERBOSECC) -CCV=$(CC) +!if $(INFODOCK) +INFODOCK_VERSION_STRING=$(infodock_major_version).$(infodock_minor_version).$(infodock_build_version) +PROGRAM_DEFINES=-DINFODOCK \ + -DPATH_VERSION=\"$(INFODOCK_VERSION_STRING)\" \ + -DPATH_PROGNAME=\"infodock\" \ + -DEMACS_PROGNAME=\"infodock\" \ + -DEMACS_VERSION=\"$(INFODOCK_VERSION_STRING)\" \ + -DINFODOCK_MAJOR_VERSION=$(infodock_major_version) \ + -DINFODOCK_MINOR_VERSION=$(infodock_minor_version) \ + -DINFODOCK_BUILD_VERSION=$(infodock_build_version) !else -CCV=@$(CC) +XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version) +!if "$(emacs_beta_version)" != "" +!if "$(emacs_is_beta)" != "" +XEMACS_VERSION_STRING=$(XEMACS_VERSION_STRING)-b$(emacs_beta_version) +!else +XEMACS_VERSION_STRING=$(XEMACS_VERSION_STRING).$(emacs_beta_version) +!endif +!endif +PROGRAM_DEFINES= \ + -DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\" \ + -DPATH_PROGNAME=\"xemacs\" \ + -DEMACS_VERSION=\"$(XEMACS_VERSION_STRING)\" \ + -DEMACS_PROGNAME=\"xemacs\" !endif -!if $(DEBUG_XEMACS) +########################### Set up installation and package directories. -# ---- Debugging support ---- -! if $(HAVE_VC6) -# support edit-and-continue -DEBUG_FLAGS_COMPILE=-ZI +!if !defined(INSTALL_DIR) +! if $(INFODOCK) +INSTALL_DIR=c:\Program Files\Infodock\Infodock-$(INFODOCK_VERSION_STRING) ! else -DEBUG_FLAGS_COMPILE=-Zi +INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING) ! endif -DEBUG_FLAGS_LINK=-debug:full -DEBUG_DEFINES=-DDEBUG_XEMACS -D_DEBUG -#BROWSERFLAGS=-Fr -Fd$(OUTDIR)\temacs.pdb -BROWSERFLAGS=-Fr$*.sbr -Fd$(OUTDIR)\temacs.pdb - -!else - -# ---- No debugging support ---- -DEBUG_FLAGS_COMPILE= -DEBUG_FLAGS_LINK=-incremental:no -DEBUG_DEFINES= -BROWSERFLAGS= - !endif - -!if $(USE_CRTDLL) -! if $(DEBUG_XEMACS) -C_LIBFLAG=-MDd -LIBC_LIB=msvcrtd.lib +!if !defined(PACKAGE_PATH) +! if !defined(PACKAGE_PREFIX) +PACKAGE_PREFIX=c:\Program Files\XEmacs +! endif +! if $(MULE) +PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\mule-packages;$(PACKAGE_PREFIX)\xemacs-packages ! else -C_LIBFLAG=-MD -LIBC_LIB=msvcrt.lib +PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\xemacs-packages ! endif -!else -C_LIBFLAG=-ML -LIBC_LIB=libc.lib !endif +PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)" -!if $(OPTIMIZED_BUILD) -# -G5 means optimize for Pentium. (According to the code-optimization -# article, -GB is the same as -G5, and -G6, i.e. optimze for Pentium Pro, -# gains you little over -G5 for PPro's but causes big slowdowns for -# Pentiums.) -GF means put strings in read-only memory; -Gr means use -# fastcall convention. Another possible addition: -Ob2 -- allows inlining -# of any function, not just those declared inline. Potential code size -# increase, though. -# -# #### Note: fastcall doesn't actually seem to make any difference, at least -# not using the (admittedly unscientific) test of (hanoi 6). The -# optimization article claims 1-2% improvement in both speed and size. -OPTFLAGS_FASTCALL =-O2 -G5 -Gr -Ob2 -OPTFLAGS_CDECL =-O2 -G5 -Ob2 +!if $(INFODOCK) +PATH_PREFIX=../.. !else -OPTFLAGS_FASTCALL =-Od -OPTFLAGS_CDECL =-Od +PATH_PREFIX=.. !endif -!if $(USE_FASTCALL) -OPTFLAGS = $(OPTFLAGS_FASTCALL) -!else -OPTFLAGS = $(OPTFLAGS_CDECL) -!endif +PATH_DEFINES=-DPATH_PREFIX=\"$(PATH_PREFIX)\" -!if $(PROFILE_SUPPORT) -PROFILE_FLAGS=-profile -!else -PROFILE_FLAGS= +!if $(SEPARATE_BUILD) +PATH_DEFINES=$(PATH_DEFINES) -DPATH_LOADSEARCH=\"$(LISP:\=\\)\" -DPATH_DATA=\"$(ETC:\=\\)\" -DPATH_INFO=\"$(INFO:\=\\)\" !endif -!if $(CPLUSPLUS_COMPILE) -CPLUSPLUS_COMPILE_FLAGS=-TP +########################### Determine system configuration. + +!if !defined(OS) +OS=Windows_95/98 +EMACS_CONFIGURATION=i586-pc-win32 +!else if "$(PROCESSOR_ARCHITECTURE)" == "x86" +EMACS_CONFIGURATION=i586-pc-win32 +!else if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" +EMACS_CONFIGURATION=mips-pc-win32 +!else if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" +EMACS_CONFIGURATION=alpha-pc-win32 +!else if "$(PROCESSOR_ARCHITECTURE)" == "PPC" +EMACS_CONFIGURATION=ppc-pc-win32 !else -CPLUSPLUS_COMPILE_FLAGS= +! error Unknown processor architecture type $(PROCESSOR_ARCHITECTURE) !endif +STACK_TRACE_EYE_CATCHER=$(XEMACS_VERSION_STRING:.=_) +STACK_TRACE_EYE_CATCHER=xemacs_$(STACK_TRACE_EYE_CATCHER:-=_)_$(EMACS_CONFIGURATION:-=_) +PROGRAM_DEFINES=$(PROGRAM_DEFINES) -DSTACK_TRACE_EYE_CATCHER=$(STACK_TRACE_EYE_CATCHER) -CFLAGS_NO_OPT=-nologo -W3 -DSTRICT $(DEBUG_FLAGS_COMPILE) - -CFLAGS_NO_LIB=$(CFLAGS_NO_OPT) $(OPTFLAGS) -CFLAGS=$(CFLAGS_NO_LIB) $(C_LIBFLAG) - -CFLAGS_CDECL_NO_LIB=$(CFLAGS_NO_OPT) $(OPTFLAGS_CDECL) -CFLAGS_CDECL=$(CFLAGS_CDECL_NO_LIB) $(C_LIBFLAG) - -!if $(HAVE_X_WINDOWS) -X_DEFINES=-DHAVE_X_WINDOWS -X_INCLUDES=-I$(X11_DIR)\include -X_LIBS=-libpath:$(X11_DIR)\lib Xaw.lib Xmu.lib Xt.lib SM.lib ICE.lib Xext.lib X11.lib -!endif +########################### Determine includes/defines/object file for +########################### various options. !if $(HAVE_MS_WINDOWS) MSW_DEFINES=-DHAVE_MS_WINDOWS @@ -524,10 +443,37 @@ !if $(HAVE_NATIVE_SOUND) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_NATIVE_SOUND !endif + +TEMACS_MSW_OBJS=\ + $(OUTDIR)\console-msw.obj \ + $(OUTDIR)\device-msw.obj \ + $(OUTDIR)\event-msw.obj \ + $(OUTDIR)\frame-msw.obj \ + $(OUTDIR)\glyphs-msw.obj \ + $(OUTDIR)\gui-msw.obj \ + $(OUTDIR)\objects-msw.obj \ + $(OUTDIR)\redisplay-msw.obj \ + $(OUTDIR)\select-msw.obj \ + $(OUTDIR)\dired-msw.obj \ + $(MSW_MENUBAR_OBJ) \ + $(MSW_SCROLLBAR_OBJ) \ + $(MSW_TOOLBAR_OBJ) \ + $(MSW_DIALOG_OBJ) \ + $(MSW_GIF_OBJ) + +# end !if $(HAVE_MS_WINDOWS) !endif !if $(MULE) MULE_DEFINES=-DMULE +TEMACS_MULE_OBJS=\ + $(OUTDIR)\mule-ccl.obj \ + $(OUTDIR)\mule-charset.obj \ + $(OUTDIR)\mule-coding.obj +!endif + +!if $(DEBUG_XEMACS) +TEMACS_DEBUG_OBJS=$(OUTDIR)\debug.obj $(OUTDIR)\tests.obj !endif !if $(QUICK_BUILD) @@ -544,6 +490,9 @@ !if $(USE_PORTABLE_DUMPER) DUMPER_DEFINES=-DPDUMP +TEMACS_DUMP_OBJS=$(OUTDIR)\dumper.obj +!else +TEMACS_DUMP_OBJS=$(OUTDIR)\unexnt.obj !endif !if $(USE_KKCC) @@ -554,196 +503,118 @@ MALLOC_DEFINES=-DSYSTEM_MALLOC !else MALLOC_DEFINES=-DGNU_MALLOC +TEMACS_ALLOC_OBJS=$(OUTDIR)\free-hook.obj $(OUTDIR)\gmalloc.obj \ + $(OUTDIR)\ntheap.obj $(OUTDIR)\vm-limit.obj !endif -# Hard-coded paths +########################### Process options related to compilation. -!if $(INFODOCK) -PATH_PREFIX=../.. +# +# Compiler command echo control. Define VERBOSECC=1 to get verbose compilation. +# +!if $(VERBOSECC) +CCV=$(CC) !else -PATH_PREFIX=.. +CCV=@$(CC) !endif -PATH_DEFINES=-DPATH_PREFIX=\"$(PATH_PREFIX)\" - -# Generic variables - -INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -I$(LWLIB_SRCDIR) - -DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) $(UNION_DEFINES) \ - $(DUMPER_DEFINES) $(KKCC_DEFINES) $(MALLOC_DEFINES) \ - $(QUICK_DEFINES) $(ERROR_CHECK_DEFINES) \ - -DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs \ - -DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES) - -#------------------------------------------------------------------------------ - -$(OUTDIR)\nul: - -@mkdir $(OUTDIR) - -XEMACS_INCLUDES=\ - $(SRC)\config.h \ - $(SRC)\Emacs.ad.h \ - $(SRC)\paths.h - -# #### Copying is cheap, we should just force these -$(SRC)\config.h: $(SRC)\config.h.in -# #### ms must have hired monkeys to design their shell commands. if -# #### you use xcopy to copy a file from one name to another, it -# #### PROMPTS you to see if you meant the second as a directory! and -# #### no switch to mean "no of course, you idiots, it's a file!" - @copy $(SRC)\config.h.in $(SRC)\config.h +!if $(DEBUG_XEMACS) -$(SRC)\Emacs.ad.h: Emacs.ad.h - set COPYCMD=/y - @$(COPY) Emacs.ad.h $(SRC) +# ---- Debugging support ---- +! if $(SUPPORT_EDIT_AND_CONTINUE) +# support edit-and-continue +DEBUG_FLAGS_COMPILE=-ZI +# WARNING: There is a very good reason for -incremental:no, as it can cause +# all sorts of weird crashes in or after a pdump load. We must allow +# incremental linking for edit-and-continue to work, however. +DEBUG_FLAGS_LINK=-debug:full +! else +DEBUG_FLAGS_COMPILE=-Zi +DEBUG_FLAGS_LINK=-debug:full -incremental:no +! endif +DEBUG_DEFINES=-DDEBUG_XEMACS -D_DEBUG +#BROWSERFLAGS=-Fr -Fd$(OUTDIR)\temacs.pdb +BROWSERFLAGS=-Fr$*.sbr -Fd$(OUTDIR)\temacs.pdb -$(SRC)\paths.h: paths.h - set COPYCMD=/y - @$(COPY) paths.h $(SRC) +!else -#------------------------------------------------------------------------------ +# ---- No debugging support ---- +DEBUG_FLAGS_COMPILE= +DEBUG_FLAGS_LINK=-incremental:no +DEBUG_DEFINES= +BROWSERFLAGS= -# lib-src programs +!endif -LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32_NATIVE +!if $(USE_CRTDLL) +! if $(DEBUG_XEMACS) +C_LIBFLAG=-MDd +LIBC_LIB=msvcrtd.lib +! else +C_LIBFLAG=-MD +LIBC_LIB=msvcrt.lib +! endif +!else +C_LIBFLAG=-ML +LIBC_LIB=libc.lib +!endif +!if $(OPTIMIZED_BUILD) +# -G5 means optimize for Pentium. (According to the code-optimization +# article, -GB is the same as -G5, and -G6, i.e. optimze for Pentium Pro, +# gains you little over -G5 for PPro's but causes big slowdowns for +# Pentiums.) -GF means put strings in read-only memory; -Gr means use +# fastcall convention. Another possible addition: -Ob2 -- allows inlining +# of any function, not just those declared inline. Potential code size +# increase, though. # -# Creating config.values to be used by config.el -# -CONFIG_VALUES = $(LIB_SRC)\config.values -!if [echo Creating $(CONFIG_VALUES) && echo ;;; Do not edit this file!>$(CONFIG_VALUES)] -!endif -# MAKEDIR has to be made into a string. -#!if [echo blddir>>$(CONFIG_VALUES) && echo $(ESC)"$(MAKEDIR:\=\\)\\..$(ESC)">>$(CONFIG_VALUES)] -!if [echo blddir>>$(CONFIG_VALUES) && echo "$(MAKEDIR:\=\\)\\..">>$(CONFIG_VALUES)] -!endif -!if [echo CC>>$(CONFIG_VALUES) && echo "$(CC:\=\\)">>$(CONFIG_VALUES)] -!endif -!if [echo CFLAGS>>$(CONFIG_VALUES) && echo "$(CFLAGS:\=\\)">>$(CONFIG_VALUES)] -!endif -!if [echo CPP>>$(CONFIG_VALUES) && echo "$(CPP:\=\\)">>$(CONFIG_VALUES)] -!endif -!if [echo CPPFLAGS>>$(CONFIG_VALUES) && echo "$(CPPFLAGS:\=\\)">>$(CONFIG_VALUES)] -!endif -!if [echo LISPDIR>>$(CONFIG_VALUES) && echo "$(MAKEDIR:\=\\)\\$(LISP:\=\\)">>$(CONFIG_VALUES)] -!endif -# PATH_PACKAGEPATH is already a quoted string. -!if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)] +# #### Note: fastcall doesn't actually seem to make any difference, at least +# not using the (admittedly unscientific) test of (hanoi 6). The +# optimization article claims 1-2% improvement in both speed and size. +OPTFLAGS_FASTCALL =-O2 -G5 -Gr -Ob2 +OPTFLAGS_CDECL =-O2 -G5 -Ob2 +!else +OPTFLAGS_FASTCALL =-Od +OPTFLAGS_CDECL =-Od !endif - -LINK_DEPENDENCY_ARGS = -Fe$@ -Fd$* $** -link $(DEBUG_FLAGS_LINK) -LINK_STANDARD_LIBRARY_ARGS = setargv.obj user32.lib wsock32.lib - -# Inferred rule -{$(LIB_SRC)}.c{$(LIB_SRC)}.exe : - cd $(LIB_SRC) - $(CCV) -I$(LIB_SRC) -I$(SRC) $(LIB_SRC_DEFINES) $(CFLAGS) $(LINK_DEPENDENCY_ARGS) $(LINK_STANDARD_LIBRARY_ARGS) - cd $(NT) - -# Individual dependencies -ETAGS_DEPS = $(LIB_SRC)/getopt.c $(LIB_SRC)/getopt1.c $(SRC)/regex.c -$(LIB_SRC)/etags.exe : $(LIB_SRC)/etags.c $(ETAGS_DEPS) - cd $(LIB_SRC) - $(CCV) -I$(LIB_SRC) -I$(SRC) $(LIB_SRC_DEFINES) $(CFLAGS) $(LINK_DEPENDENCY_ARGS) -stack:0x800000 $(LINK_STANDARD_LIBRARY_ARGS) - cd $(NT) - -$(LIB_SRC)/movemail.exe : $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS) - -# Minitar uses zlib so just use cdecl to simplify things -$(LIB_SRC)/minitar.exe : $(NT)/minitar.c - cd $(LIB_SRC) - $(CCV) -I"$(ZLIB_DIR)" $(LIB_SRC_DEFINES) $(CFLAGS_CDECL_NO_LIB) $(LINK_DEPENDENCY_ARGS) "$(ZLIB_DIR)\zlib.lib" - cd $(NT) - -LIB_SRC_TOOLS = \ - $(LIB_SRC)/etags.exe \ - $(LIB_SRC)/hexl.exe \ - $(LIB_SRC)/i.exe \ - $(LIB_SRC)/winclient.exe \ - $(LIB_SRC)/make-docfile.exe \ - $(LIB_SRC)/mmencode.exe \ - $(LIB_SRC)/movemail.exe \ - $(LIB_SRC)/sorted-doc.exe \ - $(LIB_SRC)/wakeup.exe -!if $(USE_MINITAR) -LIB_SRC_TOOLS = \ - $(LIB_SRC_TOOLS) \ - $(LIB_SRC)/minitar.exe -!endif -!if $(USE_PORTABLE_DUMPER) -LIB_SRC_TOOLS = \ - $(XEMACS_INCLUDES) \ - $(LIB_SRC)/make-dump-id.exe \ - $(LIB_SRC_TOOLS) +!if $(USE_FASTCALL) +OPTFLAGS = $(OPTFLAGS_FASTCALL) +!else +OPTFLAGS = $(OPTFLAGS_CDECL) !endif -#------------------------------------------------------------------------------ - -# LASTFILE Library - -!if !$(USE_SYSTEM_MALLOC) || !$(USE_PORTABLE_DUMPER) - -LASTFILE=$(OUTDIR)\lastfile.lib -LASTFILE_SRC=$(SRC) -LASTFILE_FLAGS=$(CFLAGS) $(CPLUSPLUS_COMPILE_FLAGS) $(INCLUDES) -Fo$@ -Fd$* -c -LASTFILE_OBJS= \ - $(OUTDIR)\lastfile.obj - -$(LASTFILE): $(XEMACS_INCLUDES) $(LASTFILE_OBJS) - link.exe -lib -nologo -out:$@ $(LASTFILE_OBJS) - -$(OUTDIR)\lastfile.obj: $(LASTFILE_SRC)\lastfile.c - $(CCV) $(LASTFILE_FLAGS) $(LASTFILE_SRC)\$(@B).c - +!if $(PROFILE_SUPPORT) +PROFILE_FLAGS=-profile +!else +PROFILE_FLAGS= !endif -#------------------------------------------------------------------------------ - -!if $(HAVE_X_WINDOWS) - -# LWLIB Library - -LWLIB=$(OUTDIR)\lwlib.lib -LWLIB_FLAGS=$(CFLAGS) $(INCLUDES) $(DEFINES) \ - -DNEED_ATHENA -DNEED_LUCID \ - -D_WINDOWS -DMENUBARS_LUCID -DSCROLLBARS_LUCID -DDIALOGS_ATHENA \ - -Fo$@ -c -LWLIB_OBJS= \ - $(OUTDIR)\lwlib-utils.obj \ - $(OUTDIR)\lwlib-Xaw.obj \ - $(OUTDIR)\lwlib-Xlw.obj \ - $(OUTDIR)\lwlib.obj \ - $(OUTDIR)\xlwmenu.obj \ - $(OUTDIR)\xlwscrollbar.obj - -$(LWLIB): $(LWLIB_OBJS) - link.exe -lib -nologo -out:$@ $(LWLIB_OBJS) - -$(OUTDIR)\lwlib-utils.obj: $(LWLIB_SRCDIR)\lwlib-utils.c - $(CCV) $(LWLIB_FLAGS) $(LWLIB_SRCDIR)\$(@B).c - -$(OUTDIR)\lwlib-Xaw.obj: $(LWLIB_SRCDIR)\lwlib-Xaw.c - $(CCV) $(LWLIB_FLAGS) $(LWLIB_SRCDIR)\$(@B).c +!if $(CPLUSPLUS_COMPILE) +CPLUSPLUS_COMPILE_FLAGS=-TP +!else +CPLUSPLUS_COMPILE_FLAGS= +!endif -$(OUTDIR)\lwlib-Xlw.obj: $(LWLIB_SRCDIR)\lwlib-Xlw.c - $(CCV) $(LWLIB_FLAGS) $(LWLIB_SRCDIR)\$(@B).c +########################### Determine generic includes/defines/flags. -$(OUTDIR)\lwlib.obj: $(LWLIB_SRCDIR)\lwlib.c - $(CCV) $(LWLIB_FLAGS) $(LWLIB_SRCDIR)\$(@B).c +INCLUDES=$(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -$(OUTDIR)\xlwmenu.obj: $(LWLIB_SRCDIR)\xlwmenu.c - $(CCV) $(LWLIB_FLAGS) $(LWLIB_SRCDIR)\$(@B).c +DEFINES=$(MSW_DEFINES) $(MULE_DEFINES) $(UNION_DEFINES) \ + $(DUMPER_DEFINES) $(KKCC_DEFINES) $(MALLOC_DEFINES) \ + $(QUICK_DEFINES) $(ERROR_CHECK_DEFINES) $(DEBUG_DEFINES) \ + -DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs \ + -DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES) -$(OUTDIR)\xlwscrollbar.obj: $(LWLIB_SRCDIR)\xlwscrollbar.c - $(CCV) $(LWLIB_FLAGS) $(LWLIB_SRCDIR)\$(@B).c +CFLAGS_NO_OPT=-nologo -W3 -DSTRICT $(DEBUG_FLAGS_COMPILE) -!endif +CFLAGS_NO_LIB=$(CFLAGS_NO_OPT) $(OPTFLAGS) +CFLAGS=$(CFLAGS_NO_LIB) $(C_LIBFLAG) -#------------------------------------------------------------------------------ +CFLAGS_CDECL_NO_LIB=$(CFLAGS_NO_OPT) $(OPTFLAGS_CDECL) +CFLAGS_CDECL=$(CFLAGS_CDECL_NO_LIB) $(C_LIBFLAG) -# TEMACS Executable +########################### Determine flags for XEmacs object files. # This may not exist !if "$(emacs_beta_version)" != "" @@ -754,118 +625,21 @@ !endif !endif -!if !$(USE_PORTABLE_DUMPER) -TEMACS_ENTRYPOINT=-entry:_start -!else -TEMACS_ENTRYPOINT=-entry:mainCRTStartup -!endif - -TEMACS_DIR=$(SRC) -TEMACS=$(TEMACS_DIR)\temacs.exe -TEMACS_BROWSE=$(TEMACS_DIR)\temacs.bsc -TEMACS_SRC=$(SRC) -TEMACS_LIBS=$(LASTFILE) $(LWLIB) $(X_LIBS) $(MSW_LIBS) \ - oldnames.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib \ - shell32.lib wsock32.lib netapi32.lib winmm.lib winspool.lib ole32.lib \ - mpr.lib uuid.lib imm32.lib $(LIBC_LIB) -TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS_LINK) -base:0x1000000\ - -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:windows\ - -pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \ - -heap:0x00100000 -nodefaultlib $(PROFILE_FLAGS) setargv.obj TEMACS_CPP_FLAGS_NO_CFLAGS=-c $(CPLUSPLUS_COMPILE_FLAGS) \ - $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \ + $(INCLUDES) $(DEFINES) \ -DEMACS_MAJOR_VERSION=$(emacs_major_version) \ -DEMACS_MINOR_VERSION=$(emacs_minor_version) \ - $(EMACS_BETA_VERSION) \ - $(EMACS_PATCH_LEVEL) \ + $(EMACS_BETA_VERSION) $(EMACS_PATCH_LEVEL) \ -DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \ -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\" TEMACS_CPP_FLAGS=$(CFLAGS) $(TEMACS_CPP_FLAGS_NO_CFLAGS) TEMACS_CPP_CDECL_FLAGS=$(CFLAGS_CDECL) $(TEMACS_CPP_FLAGS_NO_CFLAGS) -!if $(HAVE_X_WINDOWS) -TEMACS_X_OBJS=\ - $(OUTDIR)\balloon-x.obj \ - $(OUTDIR)\balloon_help.obj \ - $(OUTDIR)\console-x.obj \ - $(OUTDIR)\device-x.obj \ - $(OUTDIR)\dialog-x.obj \ - $(OUTDIR)\EmacsFrame.obj \ - $(OUTDIR)\EmacsManager.obj \ - $(OUTDIR)\EmacsShell.obj \ - $(OUTDIR)\TopLevelEmacsShell.obj\ - $(OUTDIR)\TransientEmacsShell.obj\ - $(OUTDIR)\event-Xt.obj \ - $(OUTDIR)\frame-x.obj \ - $(OUTDIR)\glyphs-x.obj \ - $(OUTDIR)\gui-x.obj \ - $(OUTDIR)\menubar-x.obj \ - $(OUTDIR)\objects-x.obj \ - $(OUTDIR)\redisplay-x.obj \ - $(OUTDIR)\scrollbar-x.obj \ - $(OUTDIR)\xgccache.obj \ - $(OUTDIR)\xmu.obj \ - $(OUTDIR)\select-x.obj -!endif - -!if $(HAVE_MS_WINDOWS) -TEMACS_MSW_OBJS=\ - $(OUTDIR)\console-msw.obj \ - $(OUTDIR)\device-msw.obj \ - $(OUTDIR)\event-msw.obj \ - $(OUTDIR)\frame-msw.obj \ - $(OUTDIR)\glyphs-msw.obj \ - $(OUTDIR)\gui-msw.obj \ - $(OUTDIR)\objects-msw.obj \ - $(OUTDIR)\redisplay-msw.obj \ - $(OUTDIR)\select-msw.obj \ - $(OUTDIR)\dired-msw.obj \ - $(MSW_MENUBAR_OBJ) \ - $(MSW_SCROLLBAR_OBJ) \ - $(MSW_TOOLBAR_OBJ) \ - $(MSW_DIALOG_OBJ) \ - $(MSW_GIF_OBJ) -!endif - -!if $(MULE) -TEMACS_MULE_OBJS=\ - $(OUTDIR)\mule-ccl.obj \ - $(OUTDIR)\mule-charset.obj \ - $(OUTDIR)\mule-coding.obj - -! if $(HAVE_X_WINDOWS) -TEMACS_MULE_OBJS=\ - $(TEMACS_MULE_OBJS) $(OUTDIR)\input-method-xlib.obj -! endif -!endif - -!if $(DEBUG_XEMACS) -TEMACS_DEBUG_OBJS=\ - $(OUTDIR)\debug.obj \ - $(OUTDIR)\tests.obj -!endif - -!if !$(USE_SYSTEM_MALLOC) -TEMACS_ALLOC_OBJS=\ - $(OUTDIR)\free-hook.obj \ - $(OUTDIR)\gmalloc.obj \ - $(OUTDIR)\ntheap.obj \ - $(OUTDIR)\vm-limit.obj -!endif - -!if !$(USE_PORTABLE_DUMPER) -TEMACS_DUMP_OBJS=\ - $(OUTDIR)\unexnt.obj -!else -TEMACS_DUMP_OBJS=\ - $(OUTDIR)\dumper.obj -!endif +########################### Determine XEmacs object files. TEMACS_OBJS= \ - $(TEMACS_X_OBJS)\ $(TEMACS_MSW_OBJS)\ - $(TEMACS_CODING_OBJS)\ $(TEMACS_MULE_OBJS)\ $(TEMACS_DEBUG_OBJS)\ $(TEMACS_ALLOC_OBJS)\ @@ -962,148 +736,204 @@ $(OUTDIR)\window.obj \ $(OUTDIR)\win32.obj +######################################################################### +## Implicit rules ## +######################################################################### + # Rules .SUFFIXES: .SUFFIXES: .c .obj .texi .info # nmake rule with batching: -#{$(TEMACS_SRC)}.c{$(OUTDIR)}.obj: +#{$(SRC)}.c{$(OUTDIR)}.obj: # echo $< >> $(OUTDIR)\listfile.tmp -{$(TEMACS_SRC)}.c{$(OUTDIR)}.obj: +{$(SRC)}.c{$(OUTDIR)}.obj: $(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@ $(BROWSERFLAGS) -# An explicit rule looks like this ($< works only in implicit rules): -# $(OUTDIR)\foo.obj: $(TEMACS_SRC)\foo.c -# $(CCV) $(TEMACS_CPP_FLAGS) $(TEMACS_SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) +######################################################################### +## Subsidiary dependency rules ## +######################################################################### -$(OUTDIR)\emacs.obj: $(XEMACS)\version.sh +###################### Include auto-generated dependencies. -$(OUTDIR)\TopLevelEmacsShell.obj: $(TEMACS_SRC)\EmacsShell-sub.c - $(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(TEMACS_SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) +# +# Whether to use dependency information generated by make-src-depend +# +!if $(DEPEND) && exist("$(SRC)\depend") +! if [if not exist $(OUTDIR)\nul mkdir "$(OUTDIR)"] +! endif +# This perl script used to be inline but that caused too many quoting problems +! if [perl $(NT)\make-nt-depend -s=$(SRC) -c=$(NT) -o=$(OUTDIR) < $(SRC)\depend > $(OUTDIR)\depend.tmp] +! endif +! include "$(OUTDIR)\depend.tmp" +!else +! if [echo WARNING: Compiling without dependency information.] +! endif +!endif -$(OUTDIR)\TransientEmacsShell.obj: $(TEMACS_SRC)\EmacsShell-sub.c - $(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TRANSIENT_EMACS_SHELL $(TEMACS_SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) +###################### Build the output directory structure if not same as +###################### source. -$(OUTDIR)\libinterface.obj: $(TEMACS_SRC)\libinterface.c - $(CCV) $(TEMACS_CPP_CDECL_FLAGS) $(TEMACS_SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) +!if $(SEPARATE_BUILD) +# #### `if not exist' does not like the quotes around file names. +# But what if one of them has spaces? Fucking Microsoft! +! if [if not exist $(BLDROOT)\nul mkdir "$(BLDROOT)"] +! endif +! if [if not exist $(BLDLIB_SRC)\nul mkdir "$(BLDLIB_SRC)"] +! endif +! if [if not exist $(BLDNT)\nul mkdir "$(BLDNT)"] +! endif +! if [if not exist $(OUTDIR)\nul mkdir "$(OUTDIR)"] +! endif +! if [if not exist $(BLDSRC)\nul mkdir "$(BLDSRC)"] +! endif +# No point. +# ! if [if not exist "$(BLDROOT)\nul" mkdir "$(BLDROOT)"] +# ! endif +!endif -#$(TEMACS_SRC)\Emacs.ad.h: $(XEMACS)\etc\Emacs.ad -# !"sed -f ad2c.sed < $(XEMACS)\etc\Emacs.ad > $(TEMACS_SRC)\Emacs.ad.h" +###################### Random .obj dependencies -#$(TEMACS_SRC)\paths.h: $(TEMACS_SRC)\paths.h.in -# !"cd $(TEMACS_SRC); cp paths.h.in paths.h" +# An explicit rule looks like this ($< works only in implicit rules): +# $(OUTDIR)\foo.obj: $(SRC)\foo.c +# $(CCV) $(TEMACS_CPP_FLAGS) $(SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) -create-list-file: - @if exist $(OUTDIR)\listfile.tmp del $(OUTDIR)\listfile.tmp +$(OUTDIR)\emacs.obj: $(SRCROOT)\version.sh -compile-list-file: - cd $(OUTDIR) - @if exist listfile.tmp $(CC) $(TEMACS_CPP_FLAGS) @listfile.tmp $(BROWSERFLAGS) +$(OUTDIR)\libinterface.obj: $(SRC)\libinterface.c + $(CCV) $(TEMACS_CPP_CDECL_FLAGS) $(SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) -$(TEMACS_BROWSE): $(TEMACS_OBJS) - @dir /b/s $(OUTDIR)\*.sbr > $(OUTDIR)\bscmake.tmp - bscmake -nologo -o$(TEMACS_BROWSE) @$(OUTDIR)\bscmake.tmp - -$(DEL) $(OUTDIR)\bscmake.tmp +###################### Generated source files -# dump-id.c file that contains the dump id +$(OUTDIR)\nul: + -@mkdir $(OUTDIR) -$(OUTDIR)\dump-id.obj : $(SRC)\dump-id.c - cd $(OUTDIR) - $(CCV) $(TEMACS_CPP_FLAGS) $(TEMACS_SRC)\$(@B).c $(BROWSERFLAGS) +XEMACS_INCLUDES=\ + $(SRC)\config.h \ + $(SRC)\Emacs.ad.h \ + $(SRC)\paths.h -$(SRC)\dump-id.c : $(LIB_SRC)/make-dump-id.exe $(TEMACS_OBJS) - cd $(SRC) - $(LIB_SRC)\make-dump-id.exe - cd $(NT) +# #### Copying is cheap, we should just force these +$(SRC)\config.h: $(SRC)\config.h.in +# #### ms must have hired monkeys to design their shell commands. if +# #### you use xcopy to copy a file from one name to another, it +# #### PROMPTS you to see if you meant the second as a directory! and +# #### no switch to mean "no of course, you idiots, it's a file!" + @copy $(SRC)\config.h.in $(SRC)\config.h -!if $(USE_PORTABLE_DUMPER) -TEMACS_DUMP_ID_OBJ = $(OUTDIR)\dump-id.obj -!else -TEMACS_DUMP_ID_OBJ = -!endif +#$(SRC)\Emacs.ad.h: $(SRCROOT)\etc\Emacs.ad +# !"sed -f ad2c.sed < $(SRCROOT)\etc\Emacs.ad > $(SRC)\Emacs.ad.h" -!if $(DEBUG_XEMACS) -$(TEMACS): $(TEMACS_OBJS) $(OUTDIR)\temacs.res $(TEMACS_BROWSE) $(TEMACS_DUMP_ID_OBJ) -!else -$(TEMACS): $(TEMACS_OBJS) $(OUTDIR)\temacs.res $(TEMACS_DUMP_ID_OBJ) -!endif -!if $(USE_PORTABLE_DUMPER) - cd $(NT) - link.exe @<< - $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(TEMACS_LIBS) $(TEMACS_DUMP_ID_OBJ) -<< -!else - link.exe @<< - $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(OUTDIR)\temacs.res $(TEMACS_LIBS) -<< -!endif +#$(SRC)\paths.h: $(SRC)\paths.h.in +# !"cd $(SRC); cp paths.h.in paths.h" -$(OUTDIR)\temacs.res: $(NT)\xemacs.rc - cd $(NT) - rc -Fo$@ xemacs.rc +$(SRC)\Emacs.ad.h: $(NT)\Emacs.ad.h + set COPYCMD=/y + @$(COPY) $(NT)\Emacs.ad.h $(SRC) +$(SRC)\paths.h: $(NT)\paths.h + set COPYCMD=/y + @$(COPY) $(NT)\paths.h $(SRC) -PROGNAME = $(TEMACS_DIR)\xemacs.exe -BATCH = -no-packages -batch -BATCH_PACKAGES = -vanilla -batch -TEMACS_BATCH = "$(LIB_SRC)\i" "$(TEMACS)" $(BATCH) -XEMACS_BATCH = "$(LIB_SRC)\i" "$(PROGNAME)" $(BATCH) -XEMACS_BATCH_PACKAGES = "$(LIB_SRC)\i" "$(PROGNAME)" $(BATCH_PACKAGES) - - -# Section handling automated tests starts here - -blddir=$(MAKEDIR:\=\\)\\.. -temacs_loadup= -dump_temacs = $(temacs_loadup) dump -run_temacs = $(temacs_loadup) run-temacs -## We have automated tests!! -testdir=../tests/automated -batch_test_emacs=$(BATCH_PACKAGES) -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir) -# .PHONY: check check-temacs +###################### lastfile.lib -check: - cd $(TEMACS_DIR) - $(PROGNAME) $(batch_test_emacs) +!if !$(USE_SYSTEM_MALLOC) || !$(USE_PORTABLE_DUMPER) -check-temacs: - cd $(TEMACS_DIR) - $(TEMACS_BATCH) -l $(LISP)/loadup.el run-temacs $(batch_test_emacs) +LASTFILE=$(OUTDIR)\lastfile.lib +LASTFILE_SRC=$(SRC) +LASTFILE_FLAGS=$(CFLAGS) $(CPLUSPLUS_COMPILE_FLAGS) $(INCLUDES) -Fo$@ -Fd$* -c +LASTFILE_OBJS= \ + $(OUTDIR)\lastfile.obj -# Section handling automated tests ends here +$(LASTFILE): $(XEMACS_INCLUDES) $(LASTFILE_OBJS) + link.exe -lib -nologo -out:$@ $(LASTFILE_OBJS) -# Section handling tags starts here +$(OUTDIR)\lastfile.obj: $(LASTFILE_SRC)\lastfile.c + $(CCV) $(LASTFILE_FLAGS) $(LASTFILE_SRC)\$(@B).c -tagslisp=lisp +!endif -tags: - @echo If you don't have a copy of etags around, then do 'make lib-src' first. - @echo To make use of the tags file, put the following in your .emacs: - @echo (setq tag-table-alist - @echo '(("$(XEMACSDIRSTRING)\\" . "$(XEMACSDIRSTRING)\\"))) - cd $(XEMACS) - -$(DEL) TAGS - set PATH=lib-src;%PATH% -# we need to double ^, but only in one place, because (according to the -# nmake manual), a ^ is used to quote certain special characters such as -# backslash, but is treated literally within double quotes -- and notice -# carefully the occurrences of double quotes in the first line below! - etags -a -r "/[ ]*DEF\(VAR\|INE\)_[A-Z_]+[ ]*([ ]*\"\([^^\"]+\)\"/\2/" src\*.c src\*.h lwlib\*.c lwlib\*.h lib-src\*.c lib-src\*.h - etags -a -l none -r "/^(def\(var\|un\|alias\|const\|macro\|subst\|struct\|face\|group\|custom\|ine-\(function\|compiler-macro\|[a-z-]+alias\)\)[ ]+'?\([^ ]+\)/\3/" $(tagslisp)\*.el $(tagslisp)\mule\*.el +###################### lib-src programs + +LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32_NATIVE + +# +# Creating config.values to be used by config.el +# +CONFIG_VALUES = $(BLDLIB_SRC)\config.values +!if [echo Creating $(CONFIG_VALUES) && echo ;;; Do not edit this file!>$(CONFIG_VALUES)] +!endif +!if [echo blddir>>$(CONFIG_VALUES) && echo "$(BLDROOT:\=\\)">>$(CONFIG_VALUES)] +!endif +!if [echo srcdir>>$(CONFIG_VALUES) && echo "$(SRCROOT:\=\\)">>$(CONFIG_VALUES)] +!endif +!if [echo CC>>$(CONFIG_VALUES) && echo "$(CC:\=\\)">>$(CONFIG_VALUES)] +!endif +!if [echo CFLAGS>>$(CONFIG_VALUES) && echo "$(CFLAGS:\=\\)">>$(CONFIG_VALUES)] +!endif +!if [echo CPP>>$(CONFIG_VALUES) && echo "$(CPP:\=\\)">>$(CONFIG_VALUES)] +!endif +!if [echo CPPFLAGS>>$(CONFIG_VALUES) && echo "$(CPPFLAGS:\=\\)">>$(CONFIG_VALUES)] +!endif +!if [echo LISPDIR>>$(CONFIG_VALUES) && echo "\\$(LISP:\=\\)">>$(CONFIG_VALUES)] +!endif +# PATH_PACKAGEPATH is already a quoted string. +!if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)] +!endif + +LINK_DEPENDENCY_ARGS = -Fe$@ -Fd$* $** -link $(DEBUG_FLAGS_LINK) +LINK_STANDARD_LIBRARY_ARGS = setargv.obj user32.lib wsock32.lib + +LIB_SRC_CFLAGS = $(CFLAGS) -I$(LIB_SRC) -I$(SRC) $(LIB_SRC_DEFINES) + +# Inferred rule +{$(LIB_SRC)}.c{$(BLDLIB_SRC)}.exe : + $(CCV) $(LIB_SRC_CFLAGS) $(LINK_DEPENDENCY_ARGS) $(LINK_STANDARD_LIBRARY_ARGS) + +# Individual dependencies +ETAGS_DEPS = $(LIB_SRC)/getopt.c $(LIB_SRC)/getopt1.c $(SRC)/regex.c +$(BLDLIB_SRC)/etags.exe : $(LIB_SRC)/etags.c $(ETAGS_DEPS) + $(CCV) $(LIB_SRC_CFLAGS) $(LINK_DEPENDENCY_ARGS) -stack:0x800000 $(LINK_STANDARD_LIBRARY_ARGS) -# Section handling tags ends here +$(BLDLIB_SRC)/movemail.exe : $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS) -# Section handling info starts here +# Minitar uses zlib so just use cdecl to simplify things +$(BLDLIB_SRC)/minitar.exe : $(NT)/minitar.c + $(CCV) -I"$(ZLIB_DIR)" $(LIB_SRC_DEFINES) $(CFLAGS_CDECL_NO_LIB) $(LINK_DEPENDENCY_ARGS) "$(ZLIB_DIR)\zlib.lib" + +LIB_SRC_TOOLS = \ + $(BLDLIB_SRC)/etags.exe \ + $(BLDLIB_SRC)/hexl.exe \ + $(BLDLIB_SRC)/i.exe \ + $(BLDLIB_SRC)/winclient.exe \ + $(BLDLIB_SRC)/make-docfile.exe \ + $(BLDLIB_SRC)/mmencode.exe \ + $(BLDLIB_SRC)/movemail.exe \ + $(BLDLIB_SRC)/sorted-doc.exe \ + $(BLDLIB_SRC)/wakeup.exe +!if $(USE_MINITAR) +LIB_SRC_TOOLS = \ + $(LIB_SRC_TOOLS) \ + $(BLDLIB_SRC)/minitar.exe +!endif +!if $(USE_PORTABLE_DUMPER) +LIB_SRC_TOOLS = \ + $(XEMACS_INCLUDES) \ + $(BLDLIB_SRC)/make-dump-id.exe \ + $(LIB_SRC_TOOLS) +!endif + +###################### Building the info files !if !defined(MAKEINFO) MAKEINFO=$(XEMACS_BATCH_PACKAGES) -l texinfmt -f batch-texinfo-format !endif -MANDIR = $(XEMACS)\man -INFODIR = $(XEMACS)\info +MANDIR = $(SRCROOT)\man +INFODIR = $(SRCROOT)\info INFO_FILES= \ $(INFODIR)\cl.info \ $(INFODIR)\custom.info \ @@ -1256,23 +1086,19 @@ $(INFODIR)\xemacs.info: $(XEMACS_SRCS) cd $(MANDIR)\xemacs $(MAKEINFO) xemacs.texi - cd .. $(INFODIR)\lispref.info: $(LISPREF_SRCS) cd $(MANDIR)\lispref $(MAKEINFO) lispref.texi - cd .. $(INFODIR)\internals.info: $(INTERNALS_SRCS) cd $(MANDIR)\internals $(MAKEINFO) internals.texi - cd .. $(INFODIR)\new-users-guide.info: $(NEW_USERS_GUIDE_SRCS) cd $(MANDIR)\new-users-guide $(MAKEINFO) new-users-guide.texi - cd .. info: makeinfo-test $(INFO_FILES) @@ -1285,75 +1111,348 @@ @echo XEmacs 'info' cannot be built! @echo Install XEmacs package 'texinfo' (see README.packages). :suggest_makeinfo -@echo Consider specifying path to makeinfo program: MAKEINFO=path -@echo as this will build info docs faster than XEmacs using 'texinfo'. +@echo Consider specifying path to 'makeinfo' in config.inc. +@echo as this will build the info docs much faster than XEmacs using 'texinfo'. @if errorlevel 1 exit 1 :test_done <$(BLDROOT)\Installation + @ver >> $(BLDROOT)\Installation + @type >> $(BLDROOT)\Installation << +!if defined(OS) +OS: $(OS) +!endif + +XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename) $(xemacs_extra_name:"=) configured for `$(EMACS_CONFIGURATION)'. + + Building XEmacs using "$(MAKE:\=\\)". + Building XEmacs using make flags "$(MAKEFLAGS)". + Building XEmacs in source tree "$(SRCROOT:\=\\)". +!if $(SEPARATE_BUILD) + Building XEmacs into compiled tree "$(BLDROOT:\=\\)". +!endif +!if defined(CCV) + For src, using compiler "$(CC) $(TEMACS_CPP_FLAGS)". + For lib-src, using compiler "$(CC) $(LIB_SRC_CFLAGS)". +!endif +!if $(CPLUSPLUS_COMPILE) + Compiling as C++. +!endif + Installing XEmacs in "$(INSTALL_DIR:\=\\)". + Package path is $(PATH_PACKAGEPATH). +!if $(INFODOCK) + Building InfoDock. +!endif +!if $(HAVE_MS_WINDOWS) + Compiling in support for Microsoft Windows native GUI. +!endif +!if $(MULE) + Compiling in international (MULE) support. +!endif +!if $(HAVE_GTK) + -------------------------------------------------------------------- + NOTE: You specified HAVE_GTK=1, but we are compiling WITHOUT GTK support. + NOTE: gtk-xemacs is not currently supported on MS Windows (mingw or msvc). + NOTE: Yes, we know that gtk has been ported to native MS Windows, but + NOTE: XEmacs is not yet ready to use that port. + -------------------------------------------------------------------- +!endif +!if $(HAVE_XPM) + Compiling in support for XPM images. +!else + -------------------------------------------------------------------- + NOTE: Compiling without XPM support. + NOTE: You should strongly consider installing XPM. + NOTE: Otherwise toolbars and other graphics will look suboptimal. + NOTE: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux) + -------------------------------------------------------------------- +!endif +!if $(HAVE_GIF) + Compiling in support for GIF images. +!endif +!if $(HAVE_PNG) + Compiling in support for PNG images. +!else + -------------------------------------------------------------------- + NOTE: Compiling without PNG image support. + NOTE: You should strongly consider installing the PNG libraries. + NOTE: Otherwise certain images and glyphs may not display. + NOTE: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux + -------------------------------------------------------------------- +!endif +!if $(HAVE_TIFF) + Compiling in support for TIFF images. +!endif +!if $(HAVE_JPEG) + Compiling in support for JPEG images. +!endif +!if $(HAVE_XFACE) + Compiling in support for X-Face message headers. +!endif +!if $(HAVE_ZLIB) + Compiling in support for GZIP compression/decompression. +!endif +!if $(HAVE_TOOLBARS) + Compiling in support for toolbars. +!endif +!if $(HAVE_DIALOGS) + Compiling in support for dialogs. +!endif +!if $(HAVE_WIDGETS) + Compiling in support for widgets. +!endif +!if $(HAVE_NATIVE_SOUND) + Compiling in support for native sounds. +!endif +!if $(USE_UNION_TYPE) + Using union type for Lisp object storage. + NOTE: --------------------------------------------------------- + NOTE: This tends to trigger compiler bugs, especially when combined + NOTE: with MULE and ERROR_CHECKING. Crashes in pdump have recently + NOTE: been observed using Visual C++ in combination with union type, + NOTE: MULE, and ERROR_CHECKING. + NOTE: --------------------------------------------------------- +!endif +!if $(USE_PORTABLE_DUMPER) + Using portable dumper. +!endif +!if $(USE_SYSTEM_MALLOC) + Using system malloc. +!endif +!if $(USE_CRTDLL) + Using DLL version of C runtime library. +!endif +!if $(ERROR_CHECK_ALL) + Compiling in extra internal error-checking. + NOTE: --------------------------------------------------------- + NOTE: Compiling in support for runtime error-checking. + NOTE: XEmacs will run noticeably more slowly as a result. + NOTE: Error-checking is on by default for XEmacs beta releases. + NOTE: --------------------------------------------------------- +!endif +!if $(DEBUG_XEMACS) + Compiling in debugging support (no slowdown). +!endif +!if $(OPTIMIZED_BUILD) + Compiling with optimization. +!endif +!if $(QUICK_BUILD) + Disabling non-essential build actions. Use with care! +!endif +!if $(USE_KKCC) + Using new experimental GC algorithms. +!endif +< $(OUTDIR)\bscmake.tmp + bscmake -nologo -o$(TEMACS_BROWSE) @$(OUTDIR)\bscmake.tmp + -$(DEL) $(OUTDIR)\bscmake.tmp + +## (1) Compile all dependencies of the XEmacs executable + +$(OUTDIR)\dump-id.obj : $(BLDSRC)\dump-id.c + $(CCV) $(TEMACS_CPP_FLAGS) $(BLDSRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) -#------------------------------------------------------------------------------ +$(BLDSRC)\dump-id.c : $(BLDLIB_SRC)/make-dump-id.exe $(TEMACS_OBJS) + cd $(BLDSRC) + $(BLDLIB_SRC)\make-dump-id.exe -# LISP bits 'n bobs +$(OUTDIR)\temacs.res: $(NT)\xemacs.rc + cd $(NT) + rc -Fo$@ xemacs.rc -LOADPATH=$(LISP) +## (2) Link the XEmacs executable -# Rebuild docfile target +!if $(USE_PORTABLE_DUMPER) +TEMACS_DUMP_DEP = $(OUTDIR)\dump-id.obj +!else +TEMACS_DUMP_DEP = $(OUTDIR)\temacs.res +!endif -DOC=$(LIB_SRC)\DOC +$(RAW_EXE): $(TEMACS_OBJS) $(LASTFILE) $(TEMACS_DUMP_DEP) + link.exe @<< + $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(TEMACS_DUMP_DEP) $(TEMACS_LIBS) +<< + +!if $(DEBUG_XEMACS) +$(RAW_EXE): $(TEMACS_BROWSE) +!endif + +## (3) Update the .elc's needed for dumping + +update-elc: $(RAW_EXE) + $(TEMACS_BATCH) -l $(LISP)\update-elc.el + +## This file is touched by update-elc.el when redumping is necessary. +$(BLDSRC)\NEEDTODUMP: + @echo >$(BLDSRC)\NEEDTODUMP + +## (4) Build the DOC file + +DOC=$(BLDLIB_SRC)\DOC docfile :: if exist $(DOC) $(DEL) $(DOC) docfile :: $(DOC) -$(DOC): $(LIB_SRC)\make-docfile.exe $(TEMACS_DIR)\NEEDTODUMP $(TEMACS_OBJS) - cd $(TEMACS_DIR) +# We need to write the QUICK_BUILD stuff as-is (and not just have no +# dependencies for DOC) because DOC needs TEMACS_OBJS as dependencies to +# get $(**) right. The `touch' is needed because of the way nmake +# calculates dependencies; see comments in src/Makefile.in.in. +$(DOC): $(BLDLIB_SRC)\make-docfile.exe $(BLDSRC)\NEEDTODUMP $(TEMACS_OBJS) !if $(QUICK_BUILD) - if not exist $(DOC) $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages @<< + if not exist $(DOC) $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(SRCROOT)\site-packages @<< $(**) << + -touch $(DOC) !else - $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages @<< + $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(SRCROOT)\site-packages @<< $(**) << !endif -update-elc: - cd $(TEMACS_DIR) - $(TEMACS_BATCH) -l $(LISP)\update-elc.el +## (5) Dump -# Update out-of-date .elcs, other than needed for dumping. -update-elc-2: - $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP) - -# This file is touched by update-elc.el when redumping is necessary. -$(TEMACS_DIR)\NEEDTODUMP : - @echo >$(TEMACS_DIR)\NEEDTODUMP +!if $(USE_PORTABLE_DUMPER) +$(DUMP_TARGET): $(NT)\xemacs.rc +!endif # This rule dumps xemacs and then possibly spawns sub-make if PURESPACE # requirements have changed. -$(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP - cd $(TEMACS_DIR) +$(DUMP_TARGET): $(DOC) $(RAW_EXE) $(BLDSRC)\NEEDTODUMP $(TEMACS_BATCH) -l $(LISP)\loadup.el dump !if $(USE_PORTABLE_DUMPER) + cd $(BLDSRC) rc -d INCLUDE_DUMP -Fo $(OUTDIR)\xemacs.res $(NT)\xemacs.rc # Make the resource section read/write since almost all of it is the dump # data which needs to be writable. This avoids having to copy it. link.exe @<< - $(TEMACS_LFLAGS) -section:.rsrc,rw -out:xemacs.exe $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj + $(TEMACS_LFLAGS) -section:.rsrc,rw -out:$(BLDSRC)\xemacs.exe $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj << - -$(DEL) $(TEMACS_DIR)\xemacs.dmp + -$(DEL) $(BLDSRC)\xemacs.dmp +!endif + +## (6) Update the remaining .elc's, post-dumping + +update-elc-2: $(DUMP_TARGET) + $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP) + +## (7) Other random stuff + +$(LISP)/finder-inf.el: update-elc-2 +!if !$(QUICK_BUILD) + @echo Building finder database ... + $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \ + -l finder -f finder-compile-keywords + @echo Building finder database ...(done) +!endif + +load-shadows: update-elc-2 +!if !$(QUICK_BUILD) + @echo Testing for Lisp shadows ... + @$(XEMACS_BATCH) -f list-load-path-shadows !endif -#------------------------------------------------------------------------------ -# use this rule to build the complete system -all: installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \ - $(LIB_SRC_TOOLS) $(TEMACS) update-elc $(DOC) $(PROGNAME) \ - update-elc-2 info +######################################################################### +## Other random crap ## +######################################################################### + +########################### Automated tests + +testdir = ../tests/automated +batch_test_emacs = $(BATCH_PACKAGES) -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir) + +check: + cd $(BLDSRC) + $(DO_XEMACS) $(batch_test_emacs) + +check-temacs: + cd $(BLDSRC) + $(TEMACS_BATCH) $(run_temacs_args) $(batch_test_emacs) + +check-features: all + cd $(BLDSRC) + $(XEMACS_BATCH) -l check-features.el + + +########################### Rebuilding TAGS + +tags: + @echo If you do not have a copy of etags around, then do 'make lib-src' first. + @echo To make use of the tags file, put the following in your .emacs: + @echo (setq tag-table-alist + @echo '(("$(SRCROOT:\=\\)\\" . "$(SRCROOT:\=\\)\\"))) + cd $(SRCROOT) + -$(DEL) TAGS + set PATH=lib-src;%PATH% +# we need to double ^, but only in one place, because (according to the +# nmake manual), a ^ is used to quote certain special characters such as +# backslash, but is treated literally within double quotes -- and notice +# carefully the occurrences of double quotes in the first line below! + etags -a -r "/[ ]*DEF\(VAR\|INE\)_[A-Z_]+[ ]*([ ]*\"\([^^\"]+\)\"/\2/" src\*.c src\*.h lwlib\*.c lwlib\*.h lib-src\*.c lib-src\*.h + etags -a -l none -r "/^(def\(var\|un\|alias\|const\|macro\|subst\|struct\|face\|group\|custom\|ine-\(function\|compiler-macro\|[a-z-]+alias\)\)[ ]+'?\([^ ]+\)/\3/" $(LISP)\*.el $(LISP)\mule\*.el -temacs: $(LASTFILE) $(TEMACS) +########################### Install the system # use this rule to install the system install: all @@ -1361,16 +1460,16 @@ set COPYCMD=/y @echo Installing in $(INSTALL_DIR) ... @echo PlaceHolder > PlaceHolder - @$(COPY) PROBLEMS "$(INSTALL_DIR)\" + @$(COPY) $(SRCROOT)\PROBLEMS "$(INSTALL_DIR)\" @$(COPY) PlaceHolder "$(INSTALL_DIR)\lock\" -$(DEL) "$(INSTALL_DIR)\lock\PlaceHolder" - @$(COPY) $(LIB_SRC)\*.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)\" - @$(COPY) $(LIB_SRC)\DOC "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" + @$(COPY) $(BLDLIB_SRC)\*.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)\" + @$(COPY) $(BLDLIB_SRC)\DOC "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" @$(COPY) $(CONFIG_VALUES) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" - @$(COPY) $(TEMACS_DIR)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" - @$(COPYDIR) $(XEMACS)\etc "$(INSTALL_DIR)\etc\" - @$(COPYDIR) $(XEMACS)\info "$(INSTALL_DIR)\info\" - @$(COPYDIR) $(XEMACS)\lisp "$(INSTALL_DIR)\lisp\" + @$(COPY) $(BLDSRC)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" + @$(COPYDIR) $(SRCROOT)\etc "$(INSTALL_DIR)\etc\" + @$(COPYDIR) $(SRCROOT)\info "$(INSTALL_DIR)\info\" + @$(COPYDIR) $(SRCROOT)\lisp "$(INSTALL_DIR)\lisp\" @echo Making skeleton package tree in $(PACKAGE_PREFIX) ... @$(COPY) PlaceHolder "$(PACKAGE_PREFIX)\site-packages\" -$(DEL) "$(PACKAGE_PREFIX)\site-packages\PlaceHolder" @@ -1380,24 +1479,37 @@ -$(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder" -$(DEL) PlaceHolder +########################### clean + mostlyclean: - -$(DEL) $(XEMACS)\Installation + -$(DEL) $(BLDROOT)\Installation -$(DEL) $(OUTDIR)\*.lib -$(DEL) $(OUTDIR)\*.obj -$(DEL) $(OUTDIR)\*.pdb -$(DEL) $(OUTDIR)\*.res -$(DEL) $(OUTDIR)\*.sbr - -$(DEL) $(TEMACS_DIR)\*.exe - -$(DEL) $(TEMACS_DIR)\*.map + -$(DEL) $(BLDSRC)\*.exe + -$(DEL) $(BLDSRC)\*.dmp + -$(DEL) $(BLDSRC)\*.map + -$(DEL) $(BLDSRC)\*.pdb + -$(DEL) $(BLDSRC)\NEEDTODUMP + -$(DEL) $(BLDSRC)\dump-id.c -$(DEL) $(SRC)\*.bsc - -$(DEL) $(TEMACS_DIR)\*.pdb - -$(DEL) $(LIB_SRC)\*.exe - -$(DEL) $(LIB_SRC)\*.obj - -$(DEL) $(LIB_SRC)\*.pdb - -$(DEL) $(LIB_SRC)\*.res + -$(DEL) $(BLDLIB_SRC)\*.exe + -$(DEL) $(BLDLIB_SRC)\*.obj + -$(DEL) $(BLDLIB_SRC)\*.pdb + -$(DEL) $(BLDLIB_SRC)\*.res + +versionclean: + -$(DEL) $(BLDSRC)\xemacs.exe + -$(DEL) $(BLDLIB_SRC)\DOC clean: mostlyclean versionclean - -$(DEL) $(XEMACS)\TAGS + -$(DEL) $(SRCROOT)\TAGS + -$(DEL) $(LISP)\auto-autoloads.el* + -$(DEL) $(LISP)\mule\auto-autoloads.el* + -$(DEL) $(LISP)\custom-load.el* + -$(DEL) $(LISP)\mule\custom-load.el* nicenclean: clean -$(DEL) $(NT)\*.bak @@ -1429,7 +1541,7 @@ ## This is used in making a distribution. ## Do not use it on development directories! distclean: nicenclean configclean - -$(DEL) $(LIB_SRC)\$(CONFIG_VALUES) + -$(DEL) $(BLDLIB_SRC)\$(CONFIG_VALUES) -$(DEL) $(INFODIR)\*.info* -$(DEL) $(LISP)\*.elc -$(DEL) $(LISP)\mule\*.elc @@ -1437,10 +1549,6 @@ realclean: distclean -versionclean: - -$(DEL) $(TEMACS_DIR)\xemacs.exe - -$(DEL) $(LIB_SRC)\DOC - #not sure about those wildcards. DOS wildcards are stupid compared to Unix, #and could end up deleting *everything* instead of just backup files or #whatever. So just leave it at "realclean" @@ -1453,147 +1561,16 @@ # -$(DEL) s\*~ # -$(DEL) s\#* +########################### Rebuild source dependency file + depend: cd $(SRC) perl ./make-src-depend > depend.tmp perl -MFile::Compare -e "compare('depend.tmp', 'depend') && rename('depend.tmp', 'depend') or unlink('depend.tmp')" +########################### Redo Unicode-Encapsulation + unicode-encapsulate: cd $(SRC) perl ../lib-src/make-mswin-unicode.pl --c-output intl-auto-encap-win32.c --h-output intl-auto-encap-win32.h intl-encap-win32.c - -$(XEMACS)\Installation:: installation - -installation:: - @echo OS version:>$(XEMACS)\Installation - @ver >> $(XEMACS)\Installation - @type >> $(XEMACS)\Installation << -!if defined(OS) -OS: $(OS) -!endif - -XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename) $(xemacs_extra_name:"=) configured for `$(EMACS_CONFIGURATION)'. - - Building XEmacs using "$(MAKE:\=\\)". - Building XEmacs using make flags "$(MAKEFLAGS)". - Building XEmacs in "$(MAKEDIR:\=\\)". -!if defined(CCV) - Using compiler "$(CC) $(CFLAGS)". -!endif -!if $(CPLUSPLUS_COMPILE) - Compiling as C++. -!endif - Installing XEmacs in "$(INSTALL_DIR:\=\\)". - Package path is $(PATH_PACKAGEPATH). -!if $(INFODOCK) - Building InfoDock. -!endif -!if $(HAVE_MS_WINDOWS) - Compiling in support for Microsoft Windows native GUI. -!endif -!if $(HAVE_X_WINDOWS) - Compiling in support for X Windows. -!endif -!if $(MULE) - Compiling in international (MULE) support. -!endif -!if $(HAVE_GTK) - -------------------------------------------------------------------- - WARNING: You specified HAVE_GTK=1, but we are compiling WITHOUT GTK support. - WARNING: gtk-xemacs is not currently supported on MS Windows (mingw or msvc). - WARNING: Yes, we know that gtk has been ported to native MS Windows, but - WARNING: XEmacs is not yet ready to use that port. - -------------------------------------------------------------------- -!endif -!if $(HAVE_XPM) - Compiling in support for XPM images. -!else - -------------------------------------------------------------------- - WARNING: Compiling without XPM support. - WARNING: You should strongly consider installing XPM. - WARNING: Otherwise toolbars and other graphics will look suboptimal. - WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux) - -------------------------------------------------------------------- -!endif -!if $(HAVE_GIF) - Compiling in support for GIF images. -!endif -!if $(HAVE_PNG) - Compiling in support for PNG images. -!else - -------------------------------------------------------------------- - WARNING: Compiling without PNG image support. - WARNING: You should strongly consider installing the PNG libraries. - WARNING: Otherwise certain images and glyphs may not display. - WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux - -------------------------------------------------------------------- -!endif -!if $(HAVE_TIFF) - Compiling in support for TIFF images. -!endif -!if $(HAVE_JPEG) - Compiling in support for JPEG images. -!endif -!if $(HAVE_XFACE) - Compiling in support for X-Face message headers. -!endif -!if $(HAVE_ZLIB) - Compiling in support for GZIP compression/decompression. -!endif -!if $(HAVE_TOOLBARS) - Compiling in support for toolbars. -!endif -!if $(HAVE_DIALOGS) - Compiling in support for dialogs. -!endif -!if $(HAVE_WIDGETS) - Compiling in support for widgets. -!endif -!if $(HAVE_NATIVE_SOUND) - Compiling in support for native sounds. -!endif -!if $(USE_UNION_TYPE) - Using union type for Lisp object storage. - WARNING: --------------------------------------------------------- - WARNING: This tends to trigger compiler bugs, especially when combined - WARNING: with MULE and ERROR_CHECKING. Crashes in pdump have recently - WARNING: been observed using Visual C++ in combination with union type, - WARNING: MULE, and ERROR_CHECKING. - WARNING: --------------------------------------------------------- -!endif -!if $(USE_PORTABLE_DUMPER) - Using portable dumper. -!endif -!if $(USE_SYSTEM_MALLOC) - Using system malloc. -!endif -!if $(USE_CRTDLL) - Using DLL version of C runtime library. -!endif -!if $(ERROR_CHECK_ALL) - Compiling in extra internal error-checking. - WARNING: --------------------------------------------------------- - WARNING: Compiling in support for runtime error checking. - WARNING: XEmacs will run noticeably more slowly as a result. - WARNING: Error checking is on by default for XEmacs beta releases. - WARNING: --------------------------------------------------------- -!endif -!if $(DEBUG_XEMACS) - Compiling in debugging support (no slowdown). -!endif -!if $(OPTIMIZED_BUILD) - Compiling with optimization. -!endif -!if $(QUICK_BUILD) - Disabling non-essential build actions. Use with care! -!endif -!if $(USE_KKCC) - Using new experimental GC algorithms. -!endif -< + + * XEmacs 21.5.12 "carrot" is released. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. cvs server: Diffing src Index: src/.cvsignore =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/.cvsignore,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/.cvsignore 27 Nov 2002 07:15:10 -0000 1.8 +++ src/.cvsignore 18 Mar 2003 00:54:00 -0000 1.9 @@ -26,3 +26,4 @@ xemacs.opt *.tmp makeinfo_test.bat +REBUILD_AUTOLOADS Index: src/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v retrieving revision 1.560 retrieving revision 1.584 diff -u -r1.560 -r1.584 --- src/ChangeLog 16 Feb 2003 06:13:37 -0000 1.560 +++ src/ChangeLog 24 Apr 2003 23:41:43 -0000 1.584 @@ -1,3 +1,1035 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-04-24 Matthew O. Persico + + * unicode.c: Removed trailing commas in some enums; older + (Solaris 2.7 cc) compiler produced volumous warnings. + + * text.c: Replaced char initialization of static Ibyte + strcasecmp_charmap[] with octal numeric init. Apparently older + (Solaris 2.7 cc) compiler treats quoted octals as signed, + causing 256 signed-assigned-to-unsigned warnings. + + * lrecord.h: Removed trailing commas in some enums; older + (Solaris 2.7 cc) compiler produced volumous warnings. + + * lisp.h: Removed trailing commas in some enums; older + (Solaris 2.7 cc) compiler produced volumous warnings. + + * frame.c: Removed trailing commas in some enums; older + (Solaris 2.7 cc) compiler produced volumous warnings. + + * file-coding.h: Removed trailing commas in some enums; older + (Solaris 2.7 cc) compiler produced volumous warnings. + +2003-04-17 Stephen J. Turnbull + + Fix stale match data after failed search bug. + + * search.c (search_buffer): + Don't find null string if repetition count is 0. + (string_match_1): + (looking_at_1): + (search_buffer): + (simple_search): + (boyer_moore): + Clear all search regs as start, not unused ones on success. + * regex.c (re_match_2_internal): Fix comment about clearing regs. + + * search.c (Freplace_match): Document error conditions in docstring. + (These actually error now after a failed match.) + +2003-04-16 Chris Palmer + + * sysdll.c (dll_open): Removed Objective C-ism to fix Mac build. + +2003-04-16 Stephen J. Turnbull + + * menubar-gtk.c (gtk_xemacs_menubar_class_init): + (gtk_xemacs_menubar_init): + (gtk_xemacs_menubar_size_request): + (menu_descriptor_to_widget_1): + (menu_descriptor_to_widget): + (popdown_menu_cb): + (reinit_vars_of_menubar_gtk): + * event-gtk.c (emacs_gtk_key_event_handler): + (emacs_gtk_button_event_handler): + (emacs_gtk_motion_event_handler): + (reinit_vars_of_event_gtk): + (event_name): + Reformat function definitions correctly. + +2003-04-16 Stephen J. Turnbull + + * symsinit.h (reinit_console_type_create_gtk): + (reinit_vars_of_menubar_gtk): + (reinit_vars_of_event_gtk): + Declare. + +2003-04-12 Malcolm Purvis + + * event-gtk.c: Added missing declaration of + non_fake_input_wait_mask. + +2003-04-04 Daiki Ueno + + * regex.c (re_match_2_internal): Fix charset/charset_not matching + for extended characters. Fixes KNOWN BUG matching ASCII character + classes to mule characters. + +2003-04-14 Steve Youngs + + * glyphs.c: + * glyphs.c (nothing_instantiate): + * glyphs.c (Fmake_glyph_internal): + * glyphs.c (Fglyphp): + * glyphs.c (glyph_image_instance): + * glyphs.c (glyph_image_instance_maybe): + * glyphs.c (glyph_width): + Work around a problem compiling with --use-union-type using + Intel's ICC compiler. From Martin Buchholz + See + + +2003-04-08 Mike Sperber + + * Makefile.in.in ($(BLDSRC)/NEEDTODUMP): Depends on $(RAW_EXE). + +2003-03-31 Mike Alexander + + * frame-msw.c (mswindows_set_frame_size): Call change_frame_size. + +2003-03-25 Jerry James + + * config.h.in: Add HAVE_DYLD to indicate Darwin/MacOSX dynamic + linking (from Andrew Begel). + * sysdll.c: Factor common code into MAYBE_PREPEND_UNDERSCORE. + Try DL_LAZY and DL_NOW if RTLD_LAZY and RTLD_NOW are undefined. + Add Andrew Begel's support for loading bundles using the + Darwin/MacOSX native API. + * sysdll.c (dll_function): Use MAYBE_PREPEND_UNDERSCORE. + * sysdll.c (dll_variable): Ditto. + * sysdll.c (dll_open): Minor whitespace fix. + +2003-03-25 Andrew Begel + + * emodules.c (vars_of_module): Add .dylib as an acceptable shared + library file extension to support MacOS X. + +2003-03-22 Stephen J. Turnbull + + * database.c (Fopen_database): DB_AUTO_COMMIT is invalid in + Berkeley db 4.1 unless you have a transaction environment. + +2003-03-21 Stephen J. Turnbull + + * regex.c (re_match_2_internal): Fix matching degenerate word + boundaries. + +2003-03-09 Ben Wing + + * file-coding.c: + * file-coding.c (look_for_coding_system_magic_cookie): + Disable new check for the moment since it's all wrong and + causes crashes. + +2003-03-09 Ben Wing + + * file-coding.c: + * file-coding.c (snarf_coding_system): + * file-coding.c (look_for_coding_system_magic_cookie): + * file-coding.c (vars_of_file_coding): + Fix up internal magic-cookie code to also check for + `;;;###coding system', already handled by the (redundant) + code in files.el. + + * regex.c (re_match_2_internal): + Fix problem with ordering of initializations and statements -- OK in + C++, not in C. + + * search.c (fast_string_match): + Indentation. + +2003-03-06 Ben Wing + + * Makefile.in.in (build-the-mofo): + * Makefile.in.in (.NO_PARALLEL): Removed. + * Makefile.in.in (release): Removed. + * Makefile.in.in (update-elc-2): Removed. + * Makefile.in.in (link_deps): + * Makefile.in.in (dump-id.c): New. + * Makefile.in.in (load-shadows): Removed. + * Makefile.in.in (.PHONY): Removed. + * Makefile.in.in (FRC.needtodump): Removed. + * Makefile.in.in (temacs_link_args): + * Makefile.in.in (obj_src): + Order sections in main build process and add comments. Add + additional dependencies to try and prevent later steps from + happening when failures in earlier steps have occurred. + + * alloc.c (disksave_object_finalization): + Don't arbitrarily clear Vconfigure_info_directory since it + messes up separate build/source dirs. + + * console.c (get_console_variant): + * console.c (Fvalid_console_type_p): + * console.c (Fconsole_type): + * console.h (console_variant): + * device-msw.c: + * device.c: + Add accidentally omitted msprinter console and data descriptions. + + * print.c: + * print.c (write_string_to_stdio_stream_1): + * print.c (write_string_to_stdio_stream): + * print.c (write_string_to_external_output_va): + * print.c (stderr_out): + * print.c (stdout_out): + * print.c (debug_out): + * print.c (fatal): + * print.c (write_string_to_alternate_debugging_output): + * print.c (debug_prin1): + * print.c (ext_print_begin): + * print.c (debug_print): + * print.c (dpa): + * print.c (debug_short_backtrace): + * print.c (syms_of_print): + * console-msw.c (write_string_to_mswindows_debugging_output): + Add clear-left-side functionality to help keep stdio/stderr + output from separate sources on separate lines. Generalize + the different kinds of debugging output. Add dpa(). + + * profile.c: + * profile.c (vars_of_profile): + Add better docs on Unix/Windows differences. + + * regex.c: + * regex.c (RE_TRANSLATE_1): + * regex.c (REGEX_ALLOCATE_STACK): + * regex.c (RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS): + * regex.c (RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS): + * regex.c (re_search_2): + * regex.c (re_match_2_internal): + Fix problems with rel-alloc compilation caused by previous patch. + + * emacs.c (assert_failed): + Seg fault rather than abort on Cygwin, since gdb doesn't trap + aborts properly. + + * console-gtk-impl.h: + * console-gtk-impl.h (struct gtk_frame): + * console-gtk.h: + * console-msw.h: + * console-x-impl.h: + * console-x-impl.h (struct x_frame): + * console-x.h: + * dialog-gtk.c: + * dialog-x.c: + * event-msw.c: + * frame-gtk.c: + * frame-gtk.c (allocate_gtk_frame_struct): + * frame-gtk.c (gtk_mark_frame): + * frame-x.c: + * frame-x.c (allocate_x_frame_struct): + * frame-x.c (x_mark_frame): + * frameslots.h: + * glyphs-gtk.c: + * glyphs-x.c: + * glyphs-x.c (x_redisplay_widget): + * glyphs-x.c (x_button_redisplay): + * glyphs-x.c (x_tab_control_redisplay): + * gui-gtk.c: + * gui-x.c: + * gui-x.c (new_lwlib_id): + * gui-x.c (struct widget_value_mapper): + * gui-x.c (snarf_widget_value_mapper): + * gui-x.c (snarf_widget_values_for_gcpro): + * gui-x.c (gcpro_popup_callbacks): + * gui-x.c (ungcpro_popup_callbacks): + * gui-x.c (syms_of_gui_x): + * gui-x.c (reinit_vars_of_gui_x): + * inline.c: + * menubar-gtk.c: + * menubar-gtk.c (FRAME_GTK_MENUBAR_DATA): + * menubar-gtk.c (set_frame_menubar): + * menubar-gtk.c (gtk_update_frame_menubar_internal): + * menubar-msw.c: + * menubar-x.c: + * menubar-x.c (MENUBAR_TYPE): + * menubar-x.c (pre_activate_callback): + * menubar-x.c (set_frame_menubar): + * menubar-x.c (x_update_frame_menubar_internal): + * menubar-x.c (x_free_frame_menubars): + * menubar-x.c (command_builder_find_menu_accelerator): + * menubar-x.c (Faccelerate_menu): + * scrollbar-gtk.c: + * scrollbar-x.c: + * ui-gtk.c: + Delete popup-data object. Delete menubar_data field from frames, + since its usage is frame-specific. Delete menubar-msw.h, + gui-x.h, gui-gtk.h. Clean up handling of lwlib callback data + GCPRO'ing and add missing GCPRO recomputation in widget code. + +2003-03-01 Ben Wing + + * alloc.c: + * alloc.c (xmalloc): + * alloc.c (xcalloc): + * alloc.c (xrealloc): + * alloc.c (endif): + * lisp.h (ALLOCA): + * lisp.h (MALLOC_OR_ALLOCA): + * lisp.h (DO_REALLOC): + * ralloc.c: + * ralloc.c (REGEX_MALLOC_CHECK): + * ralloc.c (r_alloc): + * ralloc.c (r_alloc_free): + * ralloc.c (r_re_alloc): + * regex.c: + * regex.c (REGEX_ALLOCATE): + * regex.c (REGEX_REALLOCATE): + * regex.c (REGEX_ALLOCATE_STACK): + * regex.c (TALLOC): + * regex.c (INIT_FAIL_STACK): + * regex.c (PUSH_FAILURE_POINT): + * regex.c (EXTEND_BUFFER): + * regex.c (FREE_STACK_RETURN): + * regex.c (regex_compile): + * regex.c (re_compile_fastmap): + * regex.c (re_search_2): + * regex.c (FREE_VARIABLES): + * regex.c (re_match): + * regex.c (re_match_2): + * regex.c (re_match_2_internal): + * regex.c (re_comp): + * regex.c (regcomp): + * regex.c (regexec): + * regex.c (regfree): + Use ALLOCA() in regex.c to avoid excessive stack allocation. + Also fix subtle problem with REL_ALLOC() -- any call to malloc() + (direct or indirect) may relocate rel-alloced data, causing + buffer text to shift. After any such call, regex must update + all its pointers to such data. Add a system, when + ERROR_CHECK_MALLOC, whereby regex.c indicates all the places + it is prepared to handle malloc()/realloc()/free(), and any + calls anywhere in XEmacs outside of this will trigger an abort. + + * alloc.c (garbage_collect_1): + * dialog-msw.c: + * dialog-msw.c (dialog_proc): + * eval.c: + * eval.c (run_post_gc_hook): + * eval.c (flagged_a_squirmer): + * eval.c (issue_call_trapping_problems_warning): + * eval.c (call_trapping_problems): + * eval.c (run_hook_trapping_problems): + * eval.c (safe_run_hook_trapping_problems): + * eval.c (run_hook_with_args_in_buffer_trapping_problems): + * eval.c (run_hook_with_args_trapping_problems): + * eval.c (va_run_hook_with_args_trapping_problems): + * eval.c (va_run_hook_with_args_in_buffer_trapping_problems): + * eval.c (record_unwind_protect_restoring_int): + * event-stream.c (run_pre_idle_hook): + * event-stream.c (pre_command_hook): + * event-stream.c (post_command_hook): + * general-slots.h: + * insdel.c: + * insdel.c (signal_first_change): + * insdel.c (signal_before_change): + * insdel.c (signal_after_change): + * lisp.h (POSTPONE_WARNING_ISSUE): + * lisp.h: + * menubar-msw.c: + * menubar-msw.c (unsafe_handle_wm_initmenu_1): + * menubar-x.c (pre_activate_callback): + Change *run_hook*_trapping_problems to take a warning class, not + a string. Factor out code to issue warnings, add flag to + call_trapping_problems() to postpone warning issue, and make + *run_hook*_trapping_problems issue their own warnings tailored + to the hook, postponed in the case of safe_run_hook_trapping_problems() + so that the appropriate message can be issued about resetting to + nil only when not `quit'. Make record_unwind_protect_restoring_int() + non-static. + + * dumper.c: + * dumper.c (pdump_unsupported_dump_type): + * dumper.c (pdump_register_sub): + * dumper.c (pdump_store_new_pointer_offsets): + * dumper.c (pdump_reloc_one): + * dumper.c (pdump_dump_root_struct_ptrs): + Issue notes about incremental linking problems under Windows. + + * fileio.c: + * fileio.c (barf_or_query_if_file_exists): + * fileio.c (Fsysnetunam): + * fileio.c (Fencrypt_string): + * fileio.c (Fdecrypt_string): + * fileio.c (Fdo_auto_save): + Mule-ize encrypt/decrypt-string code. + + * text.h (DEC_IBYTEPTR): + * text.h (EI_ALLOC): + * text.h (eicpy_lstr): + * text.h (eicpy_raw_fmt): + * text.h (eicpy_ch): + * text.h (eicat_ch): + * text.h (eisub_ei): + * text.h (eisub_ch): + * text.h (eito_external): + * text.h (EI_CASECHANGE): + Spacing changes. + +2003-02-28 Ben Wing + + * m/acorn.h: + * m/alliant-2800.h (UNEXEC): + * m/alliant.h: + * m/altos.h (TERMCAP): + * m/amdahl.h: + * m/arm.h: + * m/att3b.h: + * m/aviion.h: + * m/clipper.h: + * m/cnvrgnt.h: + * m/convex.h: + * m/cydra5.h: + * m/delta.h: + * m/delta88k.h: + * m/dpx2.h: + * m/elxsi.h: + * m/ews4800r.h: + * m/gould.h: + * m/hp800.h: + * m/hp9000s300.h: + * m/i860.h: + * m/ibmps2-aix.h: + * m/ibmrs6000.h: + * m/ibmrt-aix.h: + * m/ibmrt.h: + * m/intel386.h: + * m/iris4d.h: + * m/iris5d.h: + * m/iris6d.h: + * m/irist.h: + * m/m68k.h: + * m/masscomp.h: + * m/mg1.h: + * m/mips-nec.h: + * m/mips-siemens.h: + * m/mips.h: + * m/nh3000.h: + * m/nh4000.h: + * m/ns32000.h: + * m/plexus.h: + * m/powerpc.h (N_BADMAG): + * m/sequent-ptx.h: + * m/sequent.h: + * m/sgi-challenge.h: + * m/stride.h: + * m/tad68k.h: + * m/targon31.h: + * m/tekxd88.h: + * m/template.h: + * m/tower32.h: + * m/tower32v3.h: + * m/ustation.h: + * m/wicat.h: + * m/xps100.h: + * data.c: + * data.c (init_data_very_early): + * doc.c (get_doc_string): + * doc.c (Fsnarf_documentation): + * editfns.c (init_editfns): + * emacs.c: + * emacs.c (main_1): + * emacs.c (syms_of_emacs): + * lrecord.h (DUMPEDP): + * ntheap.c: + * process-unix.c: + * process-unix.c (unix_init_process): + * sysdep.c: + * sysdep.c (init_system_name): + * unexec.c: + Delete all support for bit-rotten CANNOT_DUMP. Just use pdump. + +2003-02-28 Ben Wing + + * Makefile.in.in (all): + * Makefile.in.in (PROGNAME): Removed. + * Makefile.in.in (DUMP_ID): Removed. + * Makefile.in.in (DUMP_TARGET): Removed. + * Makefile.in.in (RECURSIVE_MAKE): + * Makefile.in.in (EXE_TARGET): Removed. + * Makefile.in.in (SHELL): Removed. + * Makefile.in.in (RM): Removed. + * Makefile.in.in (lispdir): Removed. + * Makefile.in.in (moduledir): Removed. + * Makefile.in.in (.SUFFIXES): Removed. + * Makefile.in.in (libsrc): Removed. + * Makefile.in.in (etcdir): Removed. + * Makefile.in.in (srcdir): Removed. + * Makefile.in.in (SRC): New. + * Makefile.in.in (lwlib_libs): Removed. + * Makefile.in.in (lwlib_deps): Removed. + * Makefile.in.in (LWLIB_SRCDIR): + * Makefile.in.in (LIBI18N): Removed. + * Makefile.in.in (X11_libs): Removed. + * Makefile.in.in (LISP): New. + * Makefile.in.in (ETC): New. + * Makefile.in.in (SRCMODULES): New. + * Makefile.in.in (LIB_SRC): New. + * Makefile.in.in (BLDSRC): New. + * Makefile.in.in (BLDMODULES): New. + * Makefile.in.in (ldap_objs): + * Makefile.in.in (postgresql_objs): + * Makefile.in.in (win32_objs): + * Makefile.in.in (cppflags): Removed. + * Makefile.in.in (cflags): Removed. + * Makefile.in.in (ldflags): Removed. + * Makefile.in.in (.c.o): Removed. + * Makefile.in.in (.c.i): Removed. + * Makefile.in.in (.c.s): Removed. + * Makefile.in.in (lwlib_lib): New. + * Makefile.in.in (other_files): + * Makefile.in.in (LIBES): + * Makefile.in.in (mo_file): + * Makefile.in.in (mo_dir): Removed. + * Makefile.in.in (DO_TEMACS): + * Makefile.in.in (RAW_EXE): New. + * Makefile.in.in (dump_temacs): + * Makefile.in.in (debug_temacs): Removed. + * Makefile.in.in (.NO_PARALLEL): + * Makefile.in.in (release): + * Makefile.in.in (update-elc-2): + * Makefile.in.in (.PHONY): + * Makefile.in.in (update-elc): Removed. + * Makefile.in.in (FRC.needtodump): New. + * Makefile.in.in (NEEDTODUMP): Removed. + * Makefile.in.in (link_deps): + * Makefile.in.in (temacs_deps): + * Makefile.in.in (temacs_link_args): + * Makefile.in.in (dump-id.c): + * Makefile.in.in (obj_src): + * Makefile.in.in (fastdump): + * Makefile.in.in (all-elc): + * Makefile.in.in (TopLevelEmacsShell.o): + * Makefile.in.in (TopLevelEmacsShell.c.rtl): + * Makefile.in.in (TransientEmacsShell.o): + * Makefile.in.in (TransientEmacsShell.c.rtl): + * Makefile.in.in (ExternalClient-Xm-shared.o): + * Makefile.in.in (ExternalClient-Xt-shared.o): + * Makefile.in.in (ExternalClient-Xlib-shared.o): + * Makefile.in.in (ExternalClient-Xm-nonshared.o): + * Makefile.in.in (ExternalClient-Xt-nonshared.o): + * Makefile.in.in (ExternalClient-Xlib-nonshared.o): + * Makefile.in.in (extw-Xt-shared.o): + * Makefile.in.in (extw-Xlib-shared.o): + * Makefile.in.in (extw-Xt-nonshared.o): + * Makefile.in.in (extw-Xlib-nonshared.o): + * Makefile.in.in (libextcli_Xm.a): + * Makefile.in.in (libextcli_Xt.a): + * Makefile.in.in (libextcli_Xlib.a): + * Makefile.in.in (extw_link_end): + * Makefile.in.in (libextcli_Xm.so.1): + * Makefile.in.in (libextcli_Xt.so.1): + * Makefile.in.in (libextcli_Xlib.so.1): + * Makefile.in.in (config.h): + * Makefile.in.in (allocax.o): + * Makefile.in.in (sunplay.o): + * Makefile.in.in (xemacs_res.o): + * Makefile.in.in (dortl): + * Makefile.in.in (lint): + * Makefile.in.in (check-features): + * Makefile.in.in (rtcmacs): + * Makefile.in.in (run-rtcmacs): + * Makefile.in.in (debug-temacs): + * Makefile.in.in (PURIFY_FLAGS): + * Makefile.in.in (puremacs): + * Makefile.in.in (quantmacs): + * Makefile.in.in (covmacs): + * Makefile.in.in (extraclean): + * Makefile.in.in (relock): + * Makefile.in.in (install): + * Makefile.in.in (depend): + * Makefile.in.in (FRC.unicode-encapsulate): New. + * Makefile.in.in (unicode-encapsulate): New. + Lots o' cleanup. Use names like LISP, SRC instead of + lispdir, srcdir, for consistency with xemacs.mak and the + conventions in the rest of the file. Eliminate use of ${...} + in favor of $(...), to make it easier to move code between + this file and xemacs.mak. Fix dependency handling wrt + NEEDTODUMP to eliminate problems some people (e.g. Vin) have + been seeing with non-GNU makes. Write a long section about + the subtle but oh-so-important differences in dependency + processing between nmake, make, and GNU make. Add + unicode-encapsulate target, from xemacs.mak. + + * chartab.c (fill_char_table): + * chartab.c (put_char_table): + * lrecord.h: + Fix crash due to attempt to free objects across dump/undump. + +2003-02-20 Mike Sperber + + * Makefile.in.in (update-elc-2): Sequentialize dependencies even + more. + +2003-02-23 Ben Wing + + * eval.c (unbind_to_hairy): + damn those off-by-one errors. + +2003-02-21 Ben Wing + + * redisplay.c: + * redisplay.c (run_post_redisplay_actions): + Don't get in an infinite loop running post-redisplay actions. + +2003-02-20 Ben Wing + + * alloc.c: + * alloc.c (garbage_collect_1): + Make gc_currently_forbidden static. + + * config.h.in: + * lisp.h: + Move some stuff to lisp.h. + + * console-gtk.h: + * console-impl.h: + * console-impl.h (struct console_methods): + * console-msw.h: + * console-x.h: + * event-Xt.c (emacs_Xt_handle_magic_event): + * event-msw.c (emacs_mswindows_drain_queue): + * event-msw.c (mswindows_handle_paint): + * event-msw.c (emacs_mswindows_event_pending_p): + * redisplay-gtk.c: + * redisplay-gtk.c (gtk_clear_to_window_end): + * redisplay-msw.c: + * redisplay-msw.c (mswindows_redisplay_deadbox): + * redisplay-msw.c (mswindows_clear_region): + * redisplay-msw.c (mswindows_clear_frame): + * redisplay-msw.c (console_type_create_redisplay_mswindows): + * redisplay-output.c: + * redisplay-output.c (redisplay_output_window): + * redisplay-output.c (redisplay_redraw_exposed_window): + * redisplay-output.c (redisplay_redraw_exposed_area): + * redisplay-x.c: + * redisplay-x.c (x_generate_shadow_pixels): + * gtk-xemacs.c (gtk_xemacs_paint): + * gtk-xemacs.c (gtk_xemacs_expose): + Remove duplicated code to redraw exposed area. Add deadbox + method needed by the generalized redraw code. Defer redrawing + if already in redisplay. + + * frame-msw.c (mswindows_set_frame_size): + * event-stream.c (event_stream_drain_queue): + * event-stream.c (detect_input_pending): + * event-stream.c (Finput_pending_p): + * event-stream.c (event_stream_quit_p): + * event-stream.c (run_pre_idle_hook): + * event-stream.c (Fdiscard_input): + * frame.c: + Add comments about calling Lisp. + + * debug.c: + * debug.c (FROB): + * debug.c (syms_of_debug): + * general-slots.h: + Move generalish symbols to general-slots.h. + + * doprnt.c (get_doprnt_args): + * doprnt.c (emacs_doprnt_1): + reindent. + + * lisp.h (Dynarr_reset): + * lisp.h (Dynarr_add): + * lisp.h (Dynarr_increment): + * lisp.h (Dynarr_pop): + * lisp.h (Dynarr_delete_object): + * dynarr.c: + * dynarr.c (Dynarr_resize): + * dynarr.c (Dynarr_insert_many): + * dynarr.c (Dynarr_delete_many): + * dynarr.c (Dynarr_memory_usage): + Add debug code for locking a dynarr to catch invalid mods. + Use in redisplay.c. + + * eval.c: + * eval.c (throw_or_bomb_out): + * eval.c (Fsignal): + * eval.c (Feval): + * eval.c (Ffuncall): + * eval.c (set_trapping_problems_flags): + * eval.c (call_trapping_problems): + + * file-coding.c: + * file-coding.c (complex_vars_of_file_coding): + Define file-name as alias for native not vice-versa. + + * frame-gtk.c: + * frame-gtk.c (syms_of_frame_gtk): + * frame-x.c: + * frame-x.c (syms_of_frame_x): + Move Qwindow_id to general-slots. + + * dialog-msw.c (handle_question_dialog_box): + * glyphs-gtk.c (gtk_tab_control_redisplay): + * glyphs-msw.c: + * glyphs-msw.c (mswindows_redisplay_widget): + * glyphs-msw.c (mswindows_widget_instantiate): + * glyphs-msw.c (mswindows_button_instantiate): + * glyphs-msw.c (mswindows_button_redisplay): + * glyphs-msw.c (mswindows_tab_control_instantiate): + * glyphs-msw.c (mswindows_tab_control_redisplay): + * glyphs-widget.c: + * glyphs-widget.c (widget_normalize): + * glyphs-widget.c (tab_control_order_only_changed): + * glyphs-widget.c (layout_query_geometry): + * glyphs-x.c: + * glyphs-x.c (x_widget_instantiate): + * glyphs-x.c (x_button_instantiate): + * glyphs-x.c (x_progress_gauge_instantiate): + * glyphs-x.c (x_tab_control_instantiate): + * glyphs-x.c (x_tab_control_redisplay): + * gui.c: + * gui.c (gui_item_value): + * gui.c (gui_item_active_p): + * gui.c (gui_item_selected_p): + * gui.c (gui_item_list_find_selected): + * gui.c (gui_item_included_p): + * gui.c (gui_value_equal): + * gui.c (gui_item_equal_sans_selected): + * gui.c (gui_item_equal): + * gui.h: + * menubar-msw.c (populate_menu_add_item): + * menubar.c (Fmenu_find_real_submenu): + Ensure that various glyph functions that eval within redisplay + protect the evals. Same for calls to internal_equal(). + Modify various functions, e.g. gui_item_*(), to protect evals + within redisplay, taking an in_redisplay parameter if it's + possible for them to be called both inside and outside of + redisplay. + + * gutter.c: + * gutter.c (calculate_gutter_size): + * gutter.c (redraw_exposed_gutters): + * gutter.c (Fset_default_gutter_position): + * gutter.c (gutter_specs_changed): + * gutter.c (gutter_geometry_changed_in_window): + Defer specifier-changed updating till after redisplay, if + necessary, since we need to enter redisplay to do it. + + * gutter.c (Fredisplay_gutter_area): + Do nothing if in redisplay. + + * lisp.h: + Add version of alloca() for use in function calls. + + * lisp.h (XCADR): + Add XCAD[D+]R up to 6 D's, and aliases X1ST, X2ND, etc. + + * frame.c (invalidate_vertical_divider_cache_in_frame): + * frame.c (adjust_frame_size): + * frame.c (store_minibuf_frame_prop): + * frame.c (Fset_frame_properties): + * frame.c (internal_set_frame_size): + * frame.c (Fset_frame_height): + * frame.c (Fset_frame_pixel_height): + * frame.c (Fset_frame_displayable_pixel_height): + * frame.c (Fset_frame_width): + * frame.c (Fset_frame_pixel_width): + * frame.c (Fset_frame_displayable_pixel_width): + * frame.c (Fset_frame_size): + * frame.c (Fset_frame_pixel_size): + * frame.c (Fset_frame_displayable_pixel_size): + * frame.c (change_frame_size_1): + * frame.c (change_frame_size): + * frame.h: + * redisplay.c: + * redisplay.c (REDISPLAY_PREEMPTION_CHECK \): + * redisplay.c (generate_displayable_area): + * redisplay.c (regenerate_window): + * redisplay.c (enter_redisplay_critical_section): + * redisplay.c (exit_redisplay_critical_section): + * redisplay.c (redisplay_frame): + * redisplay.c (eval_within_redisplay): + * redisplay.c (free_display_line): + * redisplay.c (Fredisplay_echo_area): + * redisplay.c (vars_of_redisplay): + * redisplay.h: + * signal.c (check_what_happened): + * toolbar.c: + * toolbar.c (Fset_default_toolbar_position): + Redo critical-section code and move from frame.c to redisplay.c. + Require that every place inside of redisplay catch errors itself, + not at the edge of the critical section (thereby bypassing the + rest of redisplay and leaving things in an inconsistent state). + Introduce separate means of holding frame-size changes without + entering a complete critical section. Introduce "post-redisplay" + methods for deferring things till after redisplay. Abort if + we enter redisplay reentrantly. Disable all quit checking in + redisplay since it's too dangerous. Ensure that all calls to + QUIT trigger an abort if unprotected. + + * redisplay.c: + * scrollbar-gtk.c (gtk_update_frame_scrollbars): + * scrollbar-x.c (x_update_frame_scrollbars): + * scrollbar.c: + * scrollbar.c (update_window_scrollbars): + Create enter/exit_redisplay_critical_section_maybe() for code + that needs to ensure it's in a critical section but doesn't + interfere with an existing critical section. + + * sysdep.c: + * sysdep.c (qxe_execve): + Use _wexecve() when under Windows NT for Unicode correctness. + + * text.c: + * text.c (new_dfc_convert_now_damn_it): + * text.c (new_dfc_convert_malloc): + * text.c (find_pos_of_existing_active_dfc_e2c): + * text.c (new_dfc_convert_alloca): + * text.c (new_dfc_convert_size): + * text.c (reinit_vars_of_text): + * text.h: + * text.h (eicpy_ext_len): + * text.h (eicpy_ext): + * text.h (eito_external): + * text.h (Qx_atom_name_encoding): + Add new_dfc() functions, which return an alloca()ed value rather + than requiring an lvalue. (Not really used yet; used in another + workspace, to come.) Add some macros for SIZED_EXTERNAL. + + Update the encoding aliases after involved scrutinization of the + X manual. + + * unicode.c: + * unicode.c (init_blank_unicode_tables): + * unicode.c (init_charset_unicode_tables): + * unicode.c (syms_of_unicode): + Answer the anonymous but suspiciously Turnbullian questions. + Rename parse-unicode-translation-table to + load-unicode-mapping-table, as suggested. + +2003-02-19 Ben Wing + + * Makefile.in.in (all): New. + * Makefile.in.in (EXE_TARGET): + * Makefile.in.in (X11_libs): + * Makefile.in.in (external_widget_objs): + * Makefile.in.in (other_files): + * Makefile.in.in (extw_link_beg): Removed. + * Makefile.in.in (mo_file): + * Makefile.in.in (extw_link_mid): Removed. + * Makefile.in.in (extw_link_end): Removed. + * Makefile.in.in (temacs_loadup): Removed. + * Makefile.in.in (run_temacs): Removed. + * Makefile.in.in (dump_temacs): + * Makefile.in.in (DO_TEMACS): New. + * Makefile.in.in (DO_XEMACS): New. + * Makefile.in.in (debug_temacs): + * Makefile.in.in (LISP): New. + * Makefile.in.in (BATCH): New. + * Makefile.in.in (BATCH_PACKAGES): New. + * Makefile.in.in (TEMACS_BATCH): New. + * Makefile.in.in (XEMACS_BATCH): New. + * Makefile.in.in (XEMACS_BATCH_PACKAGES): New. + * Makefile.in.in (temacs_loadup_args): New. + * Makefile.in.in (dump_temacs_args): New. + * Makefile.in.in (run_temacs_args): New. + * Makefile.in.in (release): + * Makefile.in.in (build-the-mofo): New. + * Makefile.in.in (update-elc): New. + * Makefile.in.in (update-elc-2): New. + * Makefile.in.in (load-shadows): New. + * Makefile.in.in (NEEDTODUMP): New. + * Makefile.in.in (obj_src): + * Makefile.in.in (FRC.update-elc.stamp): Removed. + * Makefile.in.in (update-elc.stamp): Removed. + * Makefile.in.in (dortl): Removed. + * Makefile.in.in (link_deps): New. + * Makefile.in.in (temacs_deps): New. + * Makefile.in.in (temacs_link_args): New. + * Makefile.in.in (dump-id.c): New. + * Makefile.in.in (TopLevelEmacsShell.o): + * Makefile.in.in (LINT.c): Removed. + * Makefile.in.in (LINTFILES): Removed. + * Makefile.in.in (LINTINCLUDES): Removed. + * Makefile.in.in (LINTFLAGS): Removed. + * Makefile.in.in (lint): Removed. + * Makefile.in.in (dump_elcs): Removed. + * Makefile.in.in (all-elc): New. + * Makefile.in.in (dump-elcs): Removed. + * Makefile.in.in (run-temacs): Removed. + * Makefile.in.in (testdir): Removed. + * Makefile.in.in (batch_test_emacs): Removed. + * Makefile.in.in (check-temacs): Removed. + * Makefile.in.in (rtc_patch.o): Removed. + * Makefile.in.in (rtcmacs): Removed. + * Makefile.in.in (run-rtcmacs): Removed. + * Makefile.in.in (debug-temacs): Removed. + * Makefile.in.in (PURIFY_PROG): Removed. + * Makefile.in.in (PURIFY_LIBS): Removed. + * Makefile.in.in (PURIFY_FLAGS): Removed. + * Makefile.in.in (puremacs): Removed. + * Makefile.in.in (libextcli_Xlib.a): + * Makefile.in.in (QUANTIFY_PROG): Removed. + * Makefile.in.in (QUANTIFY_HOME): Removed. + * Makefile.in.in (QUANTIFY_FLAGS): Removed. + * Makefile.in.in (quantmacs): Removed. + * Makefile.in.in (PURECOV_PROG): Removed. + * Makefile.in.in (covmacs): Removed. + * Makefile.in.in (xemacs_res.o): + * Makefile.in.in (clean): + + Major surgery. Move all stuff related to building anything in the + src/ directory from top-level Makefile.in.in to here. Simplify + the dependencies. Rearrange into logical subsections. + Synchronize the main compile/dump/build-elcs section with + xemacs.mak, which is already clean and in good working order. + Remove weirdo targets like `all-elc[s]', dump-elc[s], etc. Add + additional levels of macros \(e.g. DO_TEMACS, DO_XEMACS, + TEMACS_BATCH, XEMACS_BATCH, XEMACS_BATCH_PACKAGES) to factor out + duplicated stuff. Clean up handling of "HEAP_IN_DATA" (Cygwin) so + it doesn't need to ignore the return value from dumping. Add + .NO_PARALLEL since various aspects of building and dumping must be + serialized but do not always have dependencies between them + (this is impossible in some cases). Everything related to src/ + now gets built in one pass in this directory by just running + `make' (except the Makefiles themselves and config.h, paths.h, + Emacs.ad.h, and other generated .h files). + + * console.c (Fvalid_console_type_p): + Update list of possibly valid console types. + + * emacs.c: + * emacs.c (check_compatible_window_system): + * emacs.c (main_1): + * emacs.c (standard_args): + * emacs.c (sort_args): + * emacs.c (main): + Rationalize the specifying and handling of the type of the first + frame. This was originally prompted by a workspace in which I got + GTK to compile under C++ and in the process fixed it so it could + coexist with X in the same build -- hence, a combined + TTY/X/MS-Windows/GTK build is now possible under Cygwin. (However, + you can't simultaneously *display* more than one kind of device + connection -- but getting that to work is not that difficult. + Perhaps a project for a bored grad student. I (ben) would do it + but don't see the use.) To make sense of this, I added new + switches that can be used to specifically indicate the window + system: -x [aka --use-x], -tty \[aka --use-tty], -msw [aka + --use-ms-windows], -gtk [aka --use-gtk], and -gnome [aka + --use-gnome, same as --use-gtk]. -nw continues as an alias for + -tty. When none have been given, XEmacs checks for other + parameters implying particular device types (-t -> tty, -display + -> x [or should it have same treatment as DISPLAY below?]), and + has ad-hoc logic afterwards: if env var DISPLAY is set, use x (or + gtk? perhaps should check whether gnome is running), else MS + Windows if it exsits, else TTY if it exists, else stream, and you + must be running in batch mode. This also fixes an existing bug + whereby compiling with no x, no mswin, no tty, when running non- + interactively (e.g. to dump) I get "sorry, must have TTY support". + + * emacs.c (Frun_emacs_from_temacs): + Turn on Vstack_trace_on_error so that errors are debuggable even + when occurring extremely early in reinitialization. + * emacs.c (pause_so_user_can_read_messages): + Try to make sure that the user can see message output under + Windows (i.e. it doesn't just disappear right away) regardless of + when it occurs, e.g. in the middle of creating the first frame. + * emacs.c (Femacs_run_status): + * emacs.c (syms_of_emacs): + Define new function `emacs-run-status', indicating whether XEmacs + is noninteractive or interactive, whether raw, + post-dump/pdump-load or run-temacs, whether we are dumping, + whether pdump is in effect. + + * event-stream.c: + It's "mommas are fat", not "momas are fat". + Fix other typo. + * event-stream.c (Fnext_event): + Conditionalize in_menu_callback check on HAVE_MENUBARS, + because it won't exist on w/o menubar support, + + * lisp.h: + More hackery on RETURN_NOT_REACHED. Cygwin v3.2 DOES complain here + if RETURN_NOT_REACHED() is blank, as it is for GCC 2.5+. So make it + blank only for GCC 2.5 through 2.999999999999999. + + Declare Vstack_trace_on_error. + + * profile.c: + Need to include "profile.h" to fix warnings. + + * sheap.c (report_sheap_usage): + Don't fatal() when need to rerun Make, just stderr_out() and exit(0). + That way we can distinguish between a dumping failing expectedly + (due to lack of stack space, triggering another dump) and unexpectedly, + in which case, we want to stop building. (or go on, if -K is given) + * syntax.c (Fmatching_paren): + * syntax.c (find_start_of_comment): + * syntax.h: + Use ints where they belong, and enum syntaxcode's where they belong, + and fix warnings thereby. + + * syntax.h: + Fix crash caused by an edge condition in the syntax-cache macros. + + * text.h: + * text.h (LISP_STRING_TO_ALLOCA): + * text.h (alloca_ibytes): + Spacing fixes. + + * xmotif.h: + New file, to get around shadowing warnings. + + * EmacsManager.c: + * event-Xt.c: + * glyphs-x.c: + * gui-x.c: + * input-method-motif.c: + * xmmanagerp.h: + * xmprimitivep.h: + Include xmotif.h. + + * alloc.c: + Conditionalize in_malloc on ERROR_CHECK_MALLOC. + + * config.h.in: + * file-coding.h: + * fileio.c: + * getloadavg.c (getloadavg): + * select-x.c: + * signal.c (qxe_setitimer): + * sysdep.c (total_data_usage): + * sysfile.h: + * systime.h: + * text.c (dfc_convert_to_external_format): + * text.c (dfc_convert_to_internal_format): + * unicode.c (dfc_coding_system_is_unicode): + Eliminate HAVE_WIN32_CODING_SYSTEMS, use WIN32_ANY instead. + Replace defined (WIN32_NATIVE) || defined (CYGWIN) with WIN32_ANY. + + * lisp.h: + More futile attempts to walk and chew gum at the same time when + dealing with subr's that don't return. + +2003-02-19 Ben Wing + + * eval.c (unbind_to_hairy): + Don't check_quit() unless we're unbinding a real Lisp + `unwind-protect' since check_quit() does lots of weird things and + not all callers are prepared for it. + * frame.c: + * frame.c (delete_frame_internal): + Make absolutely sure there is no quit checking while we are in a + "critical section" during frame deletion. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. Index: src/EmacsManager.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/EmacsManager.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/EmacsManager.c 14 Feb 2003 07:38:30 -0000 1.4 +++ src/EmacsManager.c 20 Feb 2003 08:19:40 -0000 1.5 @@ -28,6 +28,7 @@ #include #include "EmacsManagerP.h" #ifdef LWLIB_MENUBARS_MOTIF +#include "xmotif.h" #include #endif /* LWLIB_MENUBARS_MOTIF */ Index: src/Makefile.in.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Makefile.in.in,v retrieving revision 1.98 retrieving revision 1.103 diff -u -r1.98 -r1.103 --- src/Makefile.in.in 15 Feb 2003 10:16:03 -0000 1.98 +++ src/Makefile.in.in 10 Apr 2003 08:46:24 -0000 1.103 @@ -3,7 +3,7 @@ ## Copyright (C) 1994, 1995 Board of Trustees, University of Illinois ## Copyright (C) 1996, 1997 Sun Microsystems, Inc. ## Copyright (C) 1998, 1999 J. Kean Johnston. -## Copyright (C) 2001, 2002 Ben Wing. +## Copyright (C) 2001, 2002, 2003 Ben Wing. ## This file is part of XEmacs. @@ -24,26 +24,13 @@ ## Synched up with: Not synched with FSF. -PROGNAME=@PROGNAME@ +.PHONY: all +all: build-the-mofo #define NOT_C_CODE #include "config.h" -#ifdef PDUMP -DUMP_TARGET = ${PROGNAME}.dmp -EXE_TARGET = ${PROGNAME} -DUMP_ID = dump-id.o -#else -DUMP_TARGET = ${PROGNAME} -EXE_TARGET = temacs -#endif - -all: ${DUMP_TARGET} -.PHONY : all release dump-elc dump-elcs all-elc all-elcs lint - -## For performance and consistency, no built-in rules. -.SUFFIXES: -.SUFFIXES: .c .h .o .i .s .dep +## Here are the things that we expect ../configure to edit. #ifdef USE_GNU_MAKE RECURSIVE_MAKE=$(MAKE) @@ -52,17 +39,9 @@ RECURSIVE_MAKE=@RECURSIVE_MAKE@ #endif -SHELL=/bin/sh -RM = rm -f - -lispdir = ${srcdir}/../lisp/ -moduledir = ${srcdir}/../modules/ -libsrc = ../lib-src/ -etcdir = ../etc/ - -## Here are the things that we expect ../configure to edit. +PROGNAME=@PROGNAME@ prefix=@prefix@ -srcdir=@srcdir@ +SRC=@srcdir@ blddir=@blddir@ version=@version@ CC=@XEMACS_CC@ @@ -114,34 +93,28 @@ VPATH=@srcdir@ #endif +SHELL=/bin/sh RM = rm -f -LWLIB_SRCDIR = ${srcdir}/../lwlib - -#ifdef HAVE_X_WINDOWS -lwlib_libs = ../lwlib/liblw.a -lwlib_deps = $(lwlib_libs) -$(lwlib_libs) : - cd ../lwlib && $(RECURSIVE_MAKE) - -# ifdef AIX4 -LIBI18N = -li18n -# endif - -X11_libs = $(LIBI18N) -#endif /* HAVE_X_WINDOWS */ +LISP = $(SRC)/../lisp +ETC = $(SRC)/../etc +SRCMODULES = $(SRC)/../modules +LIB_SRC = ../lib-src +BLDSRC = . +BLDMODULES = ../modules +LWLIB_SRCDIR = $(SRC)/../lwlib ######################################################################### +## Definitions of object files and other dependencies ## +######################################################################### -## Object files needed for compilation. - -## NOTE: Some of the object files are specified in this file, and -## others in configure.in. The general rule is that they be specified -## here whenever they have clear dependencies on configure defines. -## They should be in configure.in when there is no configure define or -## when there is extremely hairy code to determine which files are -## needed (e.g. native sound support) and it would be pointless to -## duplicate that code. +## NOTE: Some of the object files are specified in this file, and others in +## configure.in. The general rule is that they be specified here whenever +## possible -- in practice, that means that they have clear dependencies on +## configure defines. They should be in configure.in when there is no +## configure define or when there is extremely hairy code to determine +## which files are needed (e.g. native sound support) and it would be +## pointless to duplicate that code. gui_objs= gui.o #ifdef HAVE_MENUBARS @@ -216,7 +189,7 @@ #endif #if defined(HAVE_LDAP) && !defined(HAVE_SHLIB) -ldap_objs=../modules/ldap/eldap.o +ldap_objs=$(BLDMODULES)/ldap/eldap.o #endif #ifdef MULE @@ -232,7 +205,7 @@ #endif #if defined(HAVE_POSTGRESQL) && !defined(HAVE_SHLIB) -postgresql_objs=../modules/postgresql/postgresql.o +postgresql_objs=$(BLDMODULES)/postgresql/postgresql.o #endif #ifdef HAVE_WIN32_PROCESSES @@ -266,43 +239,6 @@ xemacs_res.o #endif -## -Demacs is needed to make some files produce the correct version -## for use in Emacs. - -cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all) -cflags = $(CFLAGS) $(cppflags) -#if defined (WIN32_NATIVE) || defined (CYGWIN) -ldflags = $(LDFLAGS) -mwindows -e _mainCRTStartup $(ld_switch_all) $(ld_dynamic_link_flags) -# if defined (CYGWIN) -ldflags += -Wl,--script=s/cygwin.sc -# endif -#else -ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags) -#endif - -#ifdef SOLARIS2 -%.o : %.c -#else -.c.o: -#endif - $(CC) -c $(cflags) $< - -## Create preprocessor output (debugging purposes only) -.c.i: -#ifdef __GNUC__ - $(CC) -E $(cppflags) -o $@ $< -#else /* works on Solaris; what about other systems? */ - $(CC) -P $(cppflags) $< -#endif /* compiler */ - -## Create assembler output (debugging purposes only) -.c.s: - $(CC) -S -c $(cflags) $< - -## Create RTL files -%.c.rtl : %.c - $(CC) -dr -c $(cflags) $< - ## lastfile must follow all files whose initialized data areas should ## be dumped as pure by dump-emacs. @@ -374,52 +310,11 @@ #ifdef HAVE_X_WINDOWS +lwlib_lib = ../lwlib/liblw.a + # ifdef EXTERNAL_WIDGET external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o -## Now we try to figure out how to link a shared library. -## If we cannot figure it out, leave EXTW_LINK undefined and a shared -## library will not be created. - -# ifdef USE_GCC -# ifdef USG5 -# define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output -extw_link_beg = $(CC) -shared -extw_link_mid = -Xlinker -z -Xlinker text -o -extw_link_end = -## I cannot figure out how to do shared a.out libraries, so just punt. -# elif !defined (LINUX) || defined (__ELF__) -# define EXTW_LINK(objs, output) $(CC) -shared objs -o output -extw_link_beg = $(CC) -shared -extw_link_mid = -o -extw_link_end = -# endif -# elif defined (USG5) -# if defined (IRIX) -# define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations objs -o output -extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations -extw_link_mid = -o -extw_link_end = -# else /* not IRIX */ -# define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output -extw_link_beg = $(CC) -G -extw_link_mid = -z text -o -extw_link_end = -# endif /* not IRIX */ -# else /* not USG5 */ -# if defined (DEC_ALPHA) && defined (OSF1) -# define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES) -extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d -extw_link_mid = -o -extw_link_end = $(LIBES) -# else /* !(DEC_ALPHA && OSF1) */ -# define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output -extw_link_beg = $(LD) -dc -extw_link_mid = -assert pure-text -o -extw_link_end = -# endif /* !(DEC_ALPHA && OSF1) */ -# endif /* not USG5 */ - # ifdef LWLIB_USES_MOTIF # ifdef EXTW_LINK motif_other_files = libextcli_Xm.a libextcli_Xm.so.1 @@ -432,11 +327,10 @@ shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1 # endif other_files=\ - ${motif_other_files}\ + $(motif_other_files)\ libextcli_Xt.a libextcli_Xlib.a\ - ${shared_other_files} + $(shared_other_files) -all: ${other_files} # endif /* EXTERNAL_WIDGET */ # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE) @@ -452,70 +346,167 @@ otherrtls = $(otherobjs:.o=.c.rtl) othersrcs = $(otherobjs:.o=.c) -LIBES = $(lwlib_libs) $(malloclib) $(ld_libs_all) $(lib_gcc) +LIBES = $(lwlib_lib) $(malloclib) $(ld_libs_all) $(lib_gcc) #ifdef I18N3 -mo_dir = ${etcdir} -mo_file = ${mo_dir}emacs.mo +mo_file = $(LIB_SRC)/emacs.mo #endif -batch = -no-packages -batch -batch_packages = -vanilla -batch -temacs_loadup = ./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/loadup.el -dump_temacs = ${temacs_loadup} dump -run_temacs = ${temacs_loadup} run-temacs -debug_temacs = gdb ${EXE_TARGET} - -release: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} -#ifdef CANNOT_DUMP - ln ${EXE_TARGET} ${PROGNAME} +######################################################################### +## Implicit rules ## +######################################################################### + +## For performance and consistency, no built-in rules. +.SUFFIXES: +.SUFFIXES: .c .h .o .i .s .dep + +## -Demacs is needed to make some files produce the correct version +## for use in Emacs. + +cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all) +cflags = $(CFLAGS) $(cppflags) +#if defined (WIN32_NATIVE) || defined (CYGWIN) +ldflags = $(LDFLAGS) -mwindows -e _mainCRTStartup $(ld_switch_all) $(ld_dynamic_link_flags) +# if defined (CYGWIN) +ldflags += -Wl,--script=s/cygwin.sc +# endif #else - -if [ -w ${srcdir}/../lisp ]; then \ - w=`pwd`; cd ${srcdir} && $${w}/${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/inc-vers; \ - else true; fi - -./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/loadup.el dump - touch release -#endif /* ! defined (CANNOT_DUMP) */ +ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags) +#endif -${DUMP_TARGET}: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp -#ifdef HEAP_IN_DATA - @$(RM) $@ && touch SATISFIED - -${dump_temacs} - @if test -f $@; then if test -f SATISFIED; then \ - echo "Testing for Lisp shadows ..."; \ - ./${PROGNAME} ${batch} -f list-load-path-shadows; fi; \ - $(RM) SATISFIED; exit 0; fi; \ - if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \ - $(RM) $@; \ - $(RECURSIVE_MAKE) $@; +#ifdef SOLARIS2 +%.o : %.c #else - @$(RM) $@ - ${dump_temacs} - @echo "Testing for Lisp shadows ..." - @./${PROGNAME} ${batch} -f list-load-path-shadows +.c.o: #endif + $(CC) -c $(cflags) $< -fastdump: ${EXE_TARGET} - @$(RM) ${DUMP_TARGET} && touch SATISFIED - -${dump_temacs} - @./${PROGNAME} ${batch} -f list-load-path-shadows +## Create preprocessor output (debugging purposes only) +.c.i: +#ifdef __GNUC__ + $(CC) -E $(cppflags) -o $@ $< +#else /* works on Solaris; what about other systems? */ + $(CC) -P $(cppflags) $< +#endif /* compiler */ -FRC.update-elc.stamp : +## Create assembler output (debugging purposes only) +.c.s: + $(CC) -S -c $(cflags) $< -update-elc.stamp : ${EXE_TARGET} FRC.update-elc.stamp - @touch BYTECOMPILE_CHANGE - ./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/update-elc.el - @if test ! -f $@ -o -f BYTECOMPILE_CHANGE; then touch $@; fi; \ - $(RM) BYTECOMPILE_CHANGE +## Create RTL files +%.c.rtl : %.c + $(CC) -dr -c $(cflags) $< -obj_src = $(objs:.o=.c) +######################################################################### +## Primary rebuilding process ## +######################################################################### -dortl : $(obj_rtl) $(otherrtls) - echo "(defvar source-files '(" > ${srcdir}/../lisp/source-files.el - (for a in $(obj_src) $(othersrcs);do \ - echo -n "\""$$a"\"" >> ${srcdir}/../lisp/source-files.el ;\ - done) - echo "))" >> ${srcdir}/../lisp/source-files.el +#ifdef PDUMP +DUMP_TARGET = $(PROGNAME).dmp +RAW_EXE = $(PROGNAME) +DUMP_ID = dump-id.o +#else +DUMP_TARGET = $(PROGNAME) +RAW_EXE = temacs +#endif + +DO_TEMACS = $(DUMPENV) ./$(RAW_EXE) +DO_XEMACS = ./$(PROGNAME) + +BATCH = -no-packages -batch +BATCH_PACKAGES = -vanilla -batch +TEMACS_BATCH = $(DO_TEMACS) -nd $(BATCH) +XEMACS_BATCH = $(DO_XEMACS) $(BATCH) +XEMACS_BATCH_PACKAGES = $(DO_XEMACS) $(BATCH_PACKAGES) +temacs_loadup_args = -l $(LISP)/loadup.el +dump_temacs_args = $(temacs_loadup_args) dump +run_temacs_args = $(temacs_loadup_args) run-temacs +dump_temacs = $(TEMACS_BATCH) $(dump_temacs_args) + +## Compile, dump, and make sure all .elc files are up-to-date. + +## NOTE NOTE NOTE: There appears to be a fundamental but non-obvious +## difference between the way that standard `make', GNU Make, and `nmake' +## handle dependencies, and this means we have to write the dependencies in +## Makefile.in.in and xemacs.mak differently. To illustrate this, consider +## the following first: + +##.PHONY: all (`make' only) +## all: test.exe +## +##.PHONY: FRC.test.c (`make' only) +##FRC.test.c: +## +##test.c: FRC.test.c +## if test ! -f foo ; then touch test.c; fi (`make' only) +## if not exist foo touch test.c (`nmake' only) +## +##test.obj: test.c +## touch test.obj +## +##test.exe: test.obj +## touch test.exe + +## (GNU Make doesn't need the .PHONY declarations, but evidently some versions +## of `make' do. nmake doesn't need them and doesn't allow them, either.) + +## Running `make' rebuilds test.exe only if `foo' doesn't exist. +## Running `nmake -f Makefile' rebuilds it regardless. + +## Both conclude that test.c needs to be rebuilt since its dependent is +## non-existent. But `make' recalculates its dependencies after running +## the commands for test.c, and notices that test.c hasn't changed, and +## thus test.obj and test.exe are up-to-date. `nmake' doesn't. + +## On the other hand, consider the following: + +##.PHONY: all (`make' only) +##all: check-foo test.exe +## +##.PHONY: check-foo (`make' only) +##check-foo: +## if test ! -f foo; then touch test.c; fi (`make' only) +## if not exist foo touch test.c (`nmake' only) +## +##test.c: +## touch test.c +## +##test.obj: test.c +## touch test.obj +## +##test.exe: test.c test.obj +## touch test.exe +## + +## Running `nmake -f Makefile' (and `GNU make') rebuilds test.exe only if +## `foo' doesn't exist. +## Running some versions of non-GNU `make' does nothing at all once test.c, +## test.obj and test.exe all exist. + +## It appears that `nmake' doesn't check dependencies for test.exe until it +## actually needs to be rebuilt, so this "sideways" dependency script +## works. GNU make evidently recalculates *all* dependencies after each +## command so has no problem, either. But some makes apparently calculate +## all dependencies at startup and then, after executing a command to build +## a dependency, only recheck relationships involving that particular +## dependency. + +## In XEmacs-land, the above situation exists wrt the `NEEDTODUMP' +## dependency, recalculated by `update-elc.el'. Thus, Makefile.in.in must +## use the method #1 above, and nmake must use method #2. + +## -ben + +.PHONY: build-the-mofo +build-the-mofo: update-elc-2 $(mo_file) $(other_files) $(LISP)/finder-inf.el load-shadows + +## (1) Compile all dependencies of the XEmacs executable + +#ifdef HAVE_X_WINDOWS +lwlib_deps = $(lwlib_lib) +$(lwlib_lib): + cd ../lwlib && $(RECURSIVE_MAKE) +#endif /* HAVE_X_WINDOWS */ #ifdef DYNODUMP dynodump_deps = ../dynodump/dynodump.so @@ -523,180 +514,154 @@ cd ../dynodump && $(RECURSIVE_MAKE) #endif /* DYNODUMP */ -${libsrc}DOC: ${EXE_TARGET} update-elc.stamp -#ifdef QUICK_BUILD - if test ! -f $@ ; then \ -#else - if true ; then \ -#endif - ${DUMPENV} ./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/make-docfile.el -- \ - -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \ - ${obj_src} ${mallocdocsrc} ${rallocdocsrc} \ - ${extra_doc_files} ; fi +link_deps = $(start_files) $(objs) $(otherobjs) $(lwlib_deps) $(dynodump_deps) -dump_elcs: dump-elcs +$(LIB_SRC)/make-dump-id: + cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-dump-id -dump-elcs: ${EXE_TARGET} - -${DUMPENV} ./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/update-elc.el +dump-id.c: $(LIB_SRC)/make-dump-id $(link_deps) + $(LIB_SRC)/make-dump-id -all-elc all-elcs: - cd .. && $(RECURSIVE_MAKE) all-elc +## (2) Link the XEmacs executable -#ifdef I18N3 +temacs_deps = $(link_deps) $(DUMP_ID) -# if defined(SPARC) && !defined(USG) - xgettext= /usr/openwin/bin/xgettext - xgettext_args= -o emacs -m_X messages - msgfmt= /usr/openwin/bin/msgfmt -# else - xgettext= xgettext - xgettext_args= -s -d emacs -M_X messages - msgfmt= msgfmt -#endif - -${mo_dir}emacs.po: ${libsrc}make-msgfile ${libsrc}make-po ${objs} - ${libsrc}make-msgfile -o ${libsrc}messages ${objs} - cd ${libsrc} && ${xgettext} ${xgettext_args} - $(RM) ${mo_dir}emacs.po - cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po DOC +temacs_link_args = \ + $(start_flags) $(ldflags) \ + -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) $(LIBES) -${mo_dir}emacs.mo: ${mo_dir}emacs.po - cd ${mo_dir} && ${msgfmt} -o emacs.mo emacs.po - -${libsrc}make-msgfile: - cd ${libsrc} && $(RECURSIVE_MAKE) make-msgfile +$(RAW_EXE): $(temacs_deps) + $(LD) $(temacs_link_args) -${libsrc}make-po: - cd ${libsrc} && $(RECURSIVE_MAKE) make-po +## (3) Update the .elc's needed for dumping -#endif /* I18N3 */ +.PHONY: FRC.needtodump +FRC.needtodump: -${libsrc}make-dump-id: - cd ${libsrc} && $(RECURSIVE_MAKE) make-dump-id +## This file is touched by update-elc.el when redumping is necessary. +## We use $(BLDSRC) == `.' here to help keep sync with nt/xemacs.mak, +## where $(BLDSRC) is not `.'. +$(BLDSRC)/NEEDTODUMP: $(RAW_EXE) FRC.needtodump + $(TEMACS_BATCH) -l $(LISP)/update-elc.el -${libsrc}make-docfile: - cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile +## (4) Build the DOC file -## Lint Section -LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES) -LINTFILES= $(objs:.o=.ln) -LINTINCLUDES = $(cppflags) -## LINTFLAGS= -fd -m -p -s -u -v -x -LINTFLAGS= -fd -m -s -u -v -x -lint: $(LINTFILES) - $(LINT.c) $(LINTFILES) -## end of Lint Section +obj_src = $(objs:.o=.c) -link_deps=\ - $(start_files) ${objs} ${otherobjs}\ - $(lwlib_deps) $(dynodump_deps) +$(LIB_SRC)/make-docfile: + cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-docfile -temacs_deps = $(link_deps) ${DUMP_ID} +$(LIB_SRC)/DOC: $(LIB_SRC)/make-docfile $(BLDSRC)/NEEDTODUMP $(temacs_deps) +#ifdef QUICK_BUILD + if test ! -f $@ ; then \ +#else + if true ; then \ +#endif + $(TEMACS_BATCH) -l $(LISP)/make-docfile.el -- \ + -o $(LIB_SRC)/DOC -d $(SRC) -i $(LIB_SRC)/../site-packages \ + $(obj_src) $(mallocdocsrc) $(rallocdocsrc) \ + $(extra_doc_files) ; fi -temacs_link_args=\ - ${start_flags} ${ldflags}\ - -o $@ ${start_files} ${objs} ${otherobjs} ${DUMP_ID} ${LIBES} +## (5) Dump -${EXE_TARGET}: $(temacs_deps) - $(LD) $(temacs_link_args) +$(DUMP_TARGET): $(RAW_EXE) $(BLDSRC)/NEEDTODUMP $(LIB_SRC)/DOC +#ifdef HEAP_IN_DATA + @$(RM) $@ && touch SATISFIED + $(dump_temacs) + @if test -f SATISFIED; then $(RM) SATISFIED; else $(RM) $@; \ + $(RECURSIVE_MAKE) $@; fi +#else + @$(RM) $@ + $(dump_temacs) +#endif -dump-id.c: ${libsrc}make-dump-id ${link_deps} - ${libsrc}make-dump-id +## (6) Update the remaining .elc's, post-dumping -.PHONY : run-temacs +.PHONY: update-elc-2 +update-elc-2: $(DUMP_TARGET) + $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP) -run-temacs: ${EXE_TARGET} - -${run_temacs} +## (7) Other random stuff -## We have automated tests!! -testdir = ${srcdir}/../tests/automated -batch_test_emacs = ${batch_packages} -l ${testdir}/test-harness.el -f batch-test-emacs ${testdir} +$(LISP)/finder-inf.el: update-elc-2 + @echo "Building finder database ..." + $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \ + -l finder -f finder-compile-keywords + @echo "Building finder database ...(done)" -.PHONY: check check-temacs -check: - ./${PROGNAME} ${batch_test_emacs} -check-temacs: - ${run_temacs} ${batch_test_emacs} +.PHONY: load-shadows +load-shadows: update-elc-2 +#ifndef QUICK_BUILD + @echo "Testing for Lisp shadows ..." + @$(XEMACS_BATCH) -f list-load-path-shadows +#endif -## Debugging targets: -## -## None of the debugging products work with a dumped xemacs binary, -## because it does unexpected things like free memory that has been -## malloc'ed in a *different* process!! So we need to run these on -## temacs. +###################### Misc targets -## RTC is Sun WorkShop's Run Time Checking, integrated with dbx -rtc_patch.o: - rtc_patch_area -o $@ +release: all + -if [ -w $(LISP) ]; then \ + w=`pwd`; cd $(SRC) && $$w/$(RAW_EXE) -nd $(BATCH) -l $(LISP)/inc-vers; \ + else true; fi + -$(dump_temacs) + touch release -rtcmacs: $(temacs_deps) rtc_patch.o - $(RM) ${EXE_TARGET}; $(RECURSIVE_MAKE) ${EXE_TARGET} RTC_patch_objs=rtc_patch.o - mv ${EXE_TARGET} rtcmacs +.PHONY: fastdump +fastdump: $(RAW_EXE) + @$(RM) $(DUMP_TARGET) && touch SATISFIED + -$(dump_temacs) + @$(XEMACS_BATCH) -f list-load-path-shadows + +.PHONY: all-elc +all-elc: + cd .. && $(RECURSIVE_MAKE) -.PHONY: run-rtcmacs -run-rtcmacs: rtcmacs - dbx -q -C -c \ - 'dbxenv rtc_error_log_file_name /dev/fd/1; \ - dbxenv suppress_startup_message 5.0; \ - ignore POLL; \ - check -access; \ - suppress rui; \ - runargs ${batch} -l ${srcdir}/../lisp/loadup.el run-temacs -vanilla; \ - run' rtcmacs +######################################################################### +## Subsidiary dependency rules ## +######################################################################### -debug-temacs: ${EXE_TARGET} - -${debug_temacs} +#ifdef I18N3 -## Purify, Quantify, PureCoverage are software quality products from -## Rational, formerly Pure Atria, formerly Pure Software. -## -## Purify -PURIFY_PROG = purify -PURIFY_LIBS = -PURIFY_FLAGS =\ -#ifdef PDUMP - -search-mmaps=yes\ +# if defined(SPARC) && !defined(USG) + xgettext= /usr/openwin/bin/xgettext + xgettext_args= -o emacs -m_X messages + msgfmt= /usr/openwin/bin/msgfmt +# else + xgettext= xgettext + xgettext_args= -s -d emacs -M_X messages + msgfmt= msgfmt #endif - -chain-length=32 -ignore-signals=SIGPOLL\ - -cache-dir=${blddir}/purecache -always-use-cache-dir=yes -puremacs: $(temacs_deps) - $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS) - cp $@ ${EXE_TARGET} - -## Quantify -#ifdef QUANTIFY -QUANTIFY_PROG = quantify -QUANTIFY_HOME = `$(QUANTIFY_PROG) -print-home-dir` -QUANTIFY_FLAGS = -cache-dir=./purecache -always-use-cache-dir=yes -cppflags += -I$(QUANTIFY_HOME) -temacs_link_args += $(QUANTIFY_HOME)/quantify_stubs.a +$(LIB_SRC)/emacs.po: $(LIB_SRC)/make-msgfile $(LIB_SRC)/make-po $(objs) + $(LIB_SRC)/make-msgfile -o $(LIB_SRC)/messages $(objs) + cd $(LIB_SRC) && $(xgettext) $(xgettext_args) + $(RM) $(LIB_SRC)/emacs.po + cd $(LIB_SRC) && $(LIB_SRC)/make-po -a $(LIB_SRC)/emacs.po DOC -quantmacs: $(temacs_deps) - $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args) - cp $@ ${EXE_TARGET} -#endif /* QUANTIFY */ +$(LIB_SRC)/emacs.mo: $(LIB_SRC)/emacs.po + cd $(LIB_SRC)/ && $(msgfmt) -o emacs.mo emacs.po +$(LIB_SRC)/make-msgfile: + cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-msgfile -PURECOV_PROG=purecov -covmacs: $(temacs_deps) - $(PURECOV_PROG) $(LD) $(temacs_link_args) +$(LIB_SRC)/make-po: + cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-po +#endif /* I18N3 */ -TopLevelEmacsShell.o : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h - $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c +TopLevelEmacsShell.o : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h + $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c mv EmacsShell-sub.o TopLevelEmacsShell.o -TopLevelEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h - $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c +TopLevelEmacsShell.c.rtl : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h + $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl -TransientEmacsShell.o : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h - $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c +TransientEmacsShell.o : $(SRC)/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h + $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL $(SRC)/EmacsShell-sub.c mv EmacsShell-sub.o TransientEmacsShell.o -TransientEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h - $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c +TransientEmacsShell.c.rtl : $(SRC)/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h + $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL $(SRC)/EmacsShell-sub.c mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl ## The above rules are subject to a race condition if using a parallel make. @@ -722,76 +687,119 @@ external_client_xlib_objs_nonshared = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o ## Add dependencies so things work right with a parallel make -ExternalClient-Xm-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o - $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c +ExternalClient-Xm-shared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o + $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF $(SRC)/ExternalClient.c mv ExternalClient.o ExternalClient-Xm-shared.o -ExternalClient-Xt-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o - $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient.c +ExternalClient-Xt-shared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-nonshared.o + $(CC) -c $(pic_arg) $(cflags) $(SRC)/ExternalClient.c mv ExternalClient.o ExternalClient-Xt-shared.o -ExternalClient-Xlib-shared.o: ${srcdir}/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o - $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient-Xlib.c +ExternalClient-Xlib-shared.o: $(SRC)/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o + $(CC) -c $(pic_arg) $(cflags) $(SRC)/ExternalClient-Xlib.c mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o -ExternalClient-Xm-nonshared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o - $(CC) -c $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c +ExternalClient-Xm-nonshared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-nonshared.o + $(CC) -c $(cflags) -DEXTW_USES_MOTIF $(SRC)/ExternalClient.c mv ExternalClient.o ExternalClient-Xm-nonshared.o -ExternalClient-Xt-nonshared.o: ${srcdir}/ExternalClient.c - $(CC) -c $(cflags) ${srcdir}/ExternalClient.c +ExternalClient-Xt-nonshared.o: $(SRC)/ExternalClient.c + $(CC) -c $(cflags) $(SRC)/ExternalClient.c mv ExternalClient.o ExternalClient-Xt-nonshared.o -ExternalClient-Xlib-nonshared.o: ${srcdir}/ExternalClient-Xlib.c - $(CC) -c $(cflags) ${srcdir}/ExternalClient-Xlib.c +ExternalClient-Xlib-nonshared.o: $(SRC)/ExternalClient-Xlib.c + $(CC) -c $(cflags) $(SRC)/ExternalClient-Xlib.c mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o ## We compile the common files twice (once with PIC and once without) ## because on some systems, compiling with PIC but not linking into ## a shared library messes things up. -extw-Xt-shared.o: ${srcdir}/extw-Xt.c extw-Xt-nonshared.o - $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xt.c +extw-Xt-shared.o: $(SRC)/extw-Xt.c extw-Xt-nonshared.o + $(CC) -c $(pic_arg) $(cflags) $(SRC)/extw-Xt.c mv extw-Xt.o extw-Xt-shared.o -extw-Xlib-shared.o: ${srcdir}/extw-Xlib.c extw-Xlib-nonshared.o - $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xlib.c +extw-Xlib-shared.o: $(SRC)/extw-Xlib.c extw-Xlib-nonshared.o + $(CC) -c $(pic_arg) $(cflags) $(SRC)/extw-Xlib.c mv extw-Xlib.o extw-Xlib-shared.o -extw-Xt-nonshared.o: ${srcdir}/extw-Xt.c - $(CC) -c $(cflags) ${srcdir}/extw-Xt.c +extw-Xt-nonshared.o: $(SRC)/extw-Xt.c + $(CC) -c $(cflags) $(SRC)/extw-Xt.c mv extw-Xt.o extw-Xt-nonshared.o -extw-Xlib-nonshared.o: ${srcdir}/extw-Xlib.c - $(CC) -c $(cflags) ${srcdir}/extw-Xlib.c +extw-Xlib-nonshared.o: $(SRC)/extw-Xlib.c + $(CC) -c $(cflags) $(SRC)/extw-Xlib.c mv extw-Xlib.o extw-Xlib-nonshared.o -libextcli_Xm.a: ${external_client_motif_objs_nonshared} - ar r libextcli_Xm.a ${external_client_motif_objs_nonshared} +libextcli_Xm.a: $(external_client_motif_objs_nonshared) + ar r libextcli_Xm.a $(external_client_motif_objs_nonshared) + +libextcli_Xt.a: $(external_client_xt_objs_nonshared) + ar r libextcli_Xt.a $(external_client_xt_objs_nonshared) -libextcli_Xt.a: ${external_client_xt_objs_nonshared} - ar r libextcli_Xt.a ${external_client_xt_objs_nonshared} +libextcli_Xlib.a: $(external_client_xlib_objs_nonshared) + ar r libextcli_Xlib.a $(external_client_xlib_objs_nonshared) -libextcli_Xlib.a: ${external_client_xlib_objs_nonshared} - ar r libextcli_Xlib.a ${external_client_xlib_objs_nonshared} +## Now we try to figure out how to link a shared library. +## If we cannot figure it out, leave EXTW_LINK undefined and a shared +## library will not be created. + +# ifdef USE_GCC +# ifdef USG5 +# define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output +extw_link_beg = $(CC) -shared +extw_link_mid = -Xlinker -z -Xlinker text -o +extw_link_end = +## I cannot figure out how to do shared a.out libraries, so just punt. +# elif !defined (LINUX) || defined (__ELF__) +# define EXTW_LINK(objs, output) $(CC) -shared objs -o output +extw_link_beg = $(CC) -shared +extw_link_mid = -o +extw_link_end = +# endif +# elif defined (USG5) +# if defined (IRIX) +# define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations objs -o output +extw_link_beg = $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations +extw_link_mid = -o +extw_link_end = +# else /* not IRIX */ +# define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output +extw_link_beg = $(CC) -G +extw_link_mid = -z text -o +extw_link_end = +# endif /* not IRIX */ +# else /* not USG5 */ +# if defined (DEC_ALPHA) && defined (OSF1) +# define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES) +extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d +extw_link_mid = -o +extw_link_end = $(LIBES) +# else /* !(DEC_ALPHA && OSF1) */ +# define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output +extw_link_beg = $(LD) -dc +extw_link_mid = -assert pure-text -o +extw_link_end = +# endif /* !(DEC_ALPHA && OSF1) */ +# endif /* not USG5 */ #ifdef EXTW_LINK -libextcli_Xm.so.1: ${external_client_motif_objs_shared} - ${extw_link_beg} ${external_client_motif_objs_shared} ${extw_link_mid} libextcli_Xm.so.1 ${extw_link_end} +libextcli_Xm.so.1: $(external_client_motif_objs_shared) + $(extw_link_beg) $(external_client_motif_objs_shared) $(extw_link_mid) libextcli_Xm.so.1 $(extw_link_end) -libextcli_Xt.so.1: ${external_client_xt_objs_shared} - ${extw_link_beg} ${external_client_xt_objs_shared} ${extw_link_mid} libextcli_Xt.so.1 ${extw_link_end} +libextcli_Xt.so.1: $(external_client_xt_objs_shared) + $(extw_link_beg) $(external_client_xt_objs_shared) $(extw_link_mid) libextcli_Xt.so.1 $(extw_link_end) -libextcli_Xlib.so.1: ${external_client_xlib_objs_shared} - ${extw_link_beg} ${external_client_xlib_objs_shared} ${extw_link_mid} libextcli_Xlib.so.1 ${extw_link_end} +libextcli_Xlib.so.1: $(external_client_xlib_objs_shared) + $(extw_link_beg) $(external_client_xlib_objs_shared) $(extw_link_mid) libextcli_Xlib.so.1 $(extw_link_end) #endif /* EXTW_LINK */ #endif /* EXTERNAL_WIDGET */ -config.h: ${srcdir}/config.h.in -Emacs.ad.h: ${srcdir}/${etcdir}Emacs.ad +config.h: $(SRC)/config.h.in +Emacs.ad.h: $(ETC)/Emacs.ad config.h sheap-adjust.h paths.h Emacs.ad.h : @echo "The file $@ needs to be re-generated." @@ -810,10 +818,10 @@ #ifdef C_ALLOCA #else #ifndef HAVE_ALLOCA -allocax.o : ${srcdir}/alloca.s config.h +allocax.o : $(SRC)/alloca.s config.h ## $(CPP) is cc -E, which may get confused by filenames ## that do not end in .c. So copy file to a safe name. */ -## cp ${srcdir}/alloca.s allocatem.c +## cp $(SRC)/alloca.s allocatem.c ## Remove any ^L, blank lines, and preprocessor comments, ## since some assemblers barf on them. Use a different basename for the ## output file, since some stupid compilers (Green Hill) use that @@ -830,10 +838,10 @@ #ifdef HAVE_NATIVE_SOUND sound_cflags=@sound_cflags@ -sunplay.o: ${srcdir}/sunplay.c - $(CC) -c $(sound_cflags) $(cflags) ${srcdir}/sunplay.c -hpplay.o: ${srcdir}/hpplay.c - $(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c +sunplay.o: $(SRC)/sunplay.c + $(CC) -c $(sound_cflags) $(cflags) $(SRC)/sunplay.c +hpplay.o: $(SRC)/hpplay.c + $(CC) -c -Demacs $(sound_cflags) $(cflags) $(SRC)/hpplay.c #endif /* HAVE_NATIVE_SOUND */ #if defined(HAVE_GLADE_GLADE_H) || defined(HAVE_GLADE_H) @@ -844,30 +852,132 @@ extra_doc_files=emacs-widget-accessors.c ui-byhand.c $(glade_files) #endif -xemacs_res.o: ${srcdir}/../nt/xemacs.rc - windres --include-dir ${srcdir}/../nt -i ${srcdir}/../nt/xemacs.rc -o $@ +xemacs_res.o: $(SRC)/../nt/xemacs.rc + windres --include-dir $(SRC)/../nt -i $(SRC)/../nt/xemacs.rc -o $@ + +######################################################################### +## Other random crap ## +######################################################################### -## System-specific programs to be made. -## ${other_files}, $(objects_system) and $(objects_machine) -## select which of these should be compiled. */ +dortl : $(obj_rtl) $(otherrtls) + echo "(defvar source-files '(" > $(LISP)/source-files.el + (for a in $(obj_src) $(othersrcs);do \ + echo -n "\""$$a"\"" >> $(LISP)/source-files.el ;\ + done) + echo "))" >> $(LISP)/source-files.el + +###################### Lint +LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES) +LINTFILES= $(objs:.o=.ln) +LINTINCLUDES = $(cppflags) +## LINTFLAGS= -fd -m -p -s -u -v -x +LINTFLAGS= -fd -m -s -u -v -x +.PHONY: lint +lint: $(LINTFILES) + $(LINT.c) $(LINTFILES) + +###################### Automated tests +testdir = $(SRC)/../tests/automated +batch_test_emacs = $(BATCH_PACKAGES) -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir) + +.PHONY: check check-temacs check-features +check: + $(DO_XEMACS) $(batch_test_emacs) +check-temacs: + $(TEMACS_BATCH) $(run_temacs_args) $(batch_test_emacs) +check-features: all + $(XEMACS_BATCH) -l check-features.el + +###################### Debugging targets + +## None of the debugging products work with a dumped xemacs binary, +## because it does unexpected things like free memory that has been +## malloc'ed in a *different* process!! So we need to run these on +## temacs. + +## RTC is Sun WorkShop's Run Time Checking, integrated with dbx +rtc_patch.o: + rtc_patch_area -o $@ + +rtcmacs: $(temacs_deps) rtc_patch.o + $(RM) $(RAW_EXE); $(RECURSIVE_MAKE) $(RAW_EXE) RTC_patch_objs=rtc_patch.o + mv $(RAW_EXE) rtcmacs + +.PHONY: run-rtcmacs +run-rtcmacs: rtcmacs + dbx -q -C -c \ + 'dbxenv rtc_error_log_file_name /dev/fd/1; \ + dbxenv suppress_startup_message 5.0; \ + ignore POLL; \ + check -access; \ + suppress rui; \ + runargs -nd $(BATCH) $(run_temacs_args) -vanilla; \ + run' rtcmacs + +debug-temacs: $(RAW_EXE) + -gdb $(RAW_EXE) + +## Purify, Quantify, PureCoverage are software quality products from +## Rational, formerly Pure Atria, formerly Pure Software. +## +## Purify +PURIFY_PROG = purify +PURIFY_LIBS = +PURIFY_FLAGS =\ +#ifdef PDUMP + -search-mmaps=yes\ +#endif + -chain-length=32 -ignore-signals=SIGPOLL\ + -cache-dir=$(blddir)/purecache -always-use-cache-dir=yes + +puremacs: $(temacs_deps) + $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS) + cp $@ $(RAW_EXE) + +## Quantify +#ifdef QUANTIFY +QUANTIFY_PROG = quantify +QUANTIFY_HOME = `$(QUANTIFY_PROG) -print-home-dir` +QUANTIFY_FLAGS = -cache-dir=./purecache -always-use-cache-dir=yes +cppflags += -I$(QUANTIFY_HOME) +temacs_link_args += $(QUANTIFY_HOME)/quantify_stubs.a + +quantmacs: $(temacs_deps) + $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args) + cp $@ $(RAW_EXE) +#endif /* QUANTIFY */ + +PURECOV_PROG=purecov +covmacs: $(temacs_deps) + $(PURECOV_PROG) $(LD) $(temacs_link_args) + +###################### Clean .PHONY: mostlyclean clean distclean realclean versionclean extraclean mostlyclean: - $(RM) temacs puremacs quantmacs *.o *.i \ - core temacs.exe sheap-adjust.h + $(RM) *.o *.i *.rtl *.ln core \ + temacs puremacs quantmacs covmacs rtcmacs temacs.exe \ + sheap-adjust.h dump-id.c $(BLDSRC)/NEEDTODUMP SATISFIED \ + $(LIB_SRC)/*.po $(LIB_SRC)/*.mo +versionclean: + $(RM) $(RAW_EXE) $(DUMP_TARGET) $(LIB_SRC)/DOC +## Remove the generated load files here; they cause lots of problems +## when they don't work right. clean: mostlyclean versionclean - $(RM) libextcli* update-elc.stamp + $(RM) libextcli* $(LISP)/auto-autoloads.el* $(LISP)/custom-load.el* \ + $(LISP)/mule/auto-autoloads.el* $(LISP)/mule/custom-load.el* \ + $(SRCMODULES)/auto-autoloads.el* $(SRCMODULES)/custom-load.el* ## This is used in making a distribution. ## Do not use it on development directories! distclean: clean - $(RM) config.h paths.h Emacs.ad.h \ - GNUmakefile Makefile Makefile.in TAGS ${PROGNAME}.* + $(RM) config.h paths.h Emacs.ad.h $(LISP)/finder-inf.el* \ + GNUmakefile Makefile Makefile.in TAGS $(PROGNAME).* realclean: distclean -versionclean: - $(RM) ${EXE_TARGET} ${DUMP_TARGET} ${libsrc}DOC extraclean: realclean $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#* +###################### Lock, unlock + .PHONY : lock unlock SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \ config.h.in README COPYING ChangeLog @@ -877,14 +987,16 @@ relock: chmod -w $(SOURCES) +###################### Installation + ## Header files for ellcc #ifdef HAVE_SHLIB MAKEPATH=../lib-src/make-path -install: ${PROGNAME} - ${MAKEPATH} ${archlibdir}/include ${archlibdir}/include/m ${archlibdir}/include/s +install: $(PROGNAME) + $(MAKEPATH) $(archlibdir)/include $(archlibdir)/include/m $(archlibdir)/include/s -@echo "Copying include files for ellcc..." -@hdir=`pwd`; \ - cd ${srcdir}; hdrdir2=`pwd`; cd $$hdir; \ + cd $(SRC); hdrdir2=`pwd`; cd $$hdir; \ test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \ (for thisdir in $$hdir; do \ cd $$thisdir && \ @@ -895,22 +1007,32 @@ test -d s && hdrtars="$$hdrtars s/*"; \ test -d m && hdrtars="$$hdrtars m/*"; \ test -n "$$hdrtars" && (tar cf - $$hdrtars) | \ - (cd ${archlibdir}/include && umask 022 && tar xf -); \ - chmod 755 ${archlibdir}/include; \ - test -d ${archlibdir}/include/s && \ - chmod 755 ${archlibdir}/include/s; \ - test -d ${archlibdir}/include/m && \ - chmod 755 ${archlibdir}/include/s;) \ + (cd $(archlibdir)/include && umask 022 && tar xf -); \ + chmod 755 $(archlibdir)/include; \ + test -d $(archlibdir)/include/s && \ + chmod 755 $(archlibdir)/include/s; \ + test -d $(archlibdir)/include/m && \ + chmod 755 $(archlibdir)/include/s;) \ done) #endif +###################### Dependencies + ## Dependency processing using home-grown script, not makedepend .PHONY: depend FRC.depend: depend: FRC.depend - cd ${srcdir} && $(RM) depend.tmp && \ + cd $(SRC) && $(RM) depend.tmp && \ perl ./make-src-depend > depend.tmp && \ if cmp -s depend depend.tmp; \ then $(RM) depend.tmp; \ else $(RM) depend && mv depend.tmp depend; \ fi + +###################### Unicode encapsulation + +.PHONY: unicode-encapsulate +FRC.unicode-encapsulate: +unicode-encapsulate: FRC.unicode-encapsulate + cd $(SRC) && \ + perl ../lib-src/make-mswin-unicode.pl --c-output intl-auto-encap-win32.c --h-output intl-auto-encap-win32.h intl-encap-win32.c Index: src/alloc.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/alloc.c,v retrieving revision 1.84 retrieving revision 1.88 diff -u -r1.84 -r1.88 --- src/alloc.c 13 Feb 2003 09:57:05 -0000 1.84 +++ src/alloc.c 9 Mar 2003 02:27:39 -0000 1.88 @@ -187,7 +187,7 @@ /* Nonzero when calling certain hooks or doing other things where a GC would be bad */ -int gc_currently_forbidden; +static int gc_currently_forbidden; /* Hooks. */ Lisp_Object Vpre_gc_hook, Qpre_gc_hook; @@ -313,7 +313,10 @@ /* like malloc and realloc but check for no memory left. */ +#ifdef ERROR_CHECK_MALLOC static int in_malloc; +extern int regex_malloc_disallowed; +#endif #undef xmalloc void * @@ -322,6 +325,7 @@ void *val; #ifdef ERROR_CHECK_MALLOC assert (!in_malloc); + assert (!regex_malloc_disallowed); in_malloc = 1; #endif val = malloc (size); @@ -340,6 +344,7 @@ void *val; #ifdef ERROR_CHECK_MALLOC assert (!in_malloc); + assert (!regex_malloc_disallowed); in_malloc = 1; #endif val= calloc (nelem, elsize); @@ -364,6 +369,7 @@ { #ifdef ERROR_CHECK_MALLOC assert (!in_malloc); + assert (!regex_malloc_disallowed); in_malloc = 1; #endif block = realloc (block, size); @@ -390,6 +396,7 @@ assert (block != (void *) 0xDEADBEEF); assert (block); assert (!in_malloc); + assert (!regex_malloc_disallowed); in_malloc = 1; #endif /* ERROR_CHECK_MALLOC */ free (block); @@ -4278,7 +4285,6 @@ Vdata_directory = Qnil; Vsite_directory = Qnil; Vdoc_directory = Qnil; - Vconfigure_info_directory = Qnil; Vexec_path = Qnil; Vload_path = Qnil; /* Vdump_load_path = Qnil; */ @@ -4442,11 +4448,11 @@ speccount = begin_gc_forbidden (); need_to_signal_post_gc = 0; - recompute_funcall_allocation_flag(); + recompute_funcall_allocation_flag (); if (!gc_hooks_inhibited) run_hook_trapping_problems - ("Error in pre-gc-hook", Qpre_gc_hook, + (Qgarbage_collecting, Qpre_gc_hook, INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); /* Now show the GC cursor/message. */ Index: src/chartab.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/chartab.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- src/chartab.c 14 Feb 2003 09:50:16 -0000 1.29 +++ src/chartab.c 1 Mar 2003 07:25:35 -0000 1.30 @@ -470,9 +470,11 @@ #ifdef MULE for (i = 0; i < NUM_LEADING_BYTES; i++) { - /* Don't get stymied when initting the table */ + /* Don't get stymied when initting the table, or when trying to + free a pdump object. */ if (!EQ (ct->level1[i], Qnull_pointer) && - CHAR_TABLE_ENTRYP (ct->level1[i])) + CHAR_TABLE_ENTRYP (ct->level1[i]) && + !OBJECT_DUMPED_P (ct->level1[1])) free_lcrecord (ct->level1[i]); ct->level1[i] = value; } @@ -1050,7 +1052,8 @@ else { int lb = XCHARSET_LEADING_BYTE (range->charset) - MIN_LEADING_BYTE; - if (CHAR_TABLE_ENTRYP (ct->level1[lb])) + if (CHAR_TABLE_ENTRYP (ct->level1[lb]) && + !OBJECT_DUMPED_P (ct->level1[lb])) free_lcrecord (ct->level1[lb]); ct->level1[lb] = val; } Index: src/config.h.in =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/config.h.in,v retrieving revision 1.83 retrieving revision 1.86 diff -u -r1.83 -r1.86 --- src/config.h.in 15 Feb 2003 10:16:04 -0000 1.83 +++ src/config.h.in 26 Mar 2003 04:22:49 -0000 1.86 @@ -304,6 +304,7 @@ #undef HAVE_SHL_LOAD #undef HAVE_DLD_INIT #undef HAVE_SHLIB +#undef HAVE_DYLD #undef DLSYM_NEEDS_UNDERSCORE #undef HAVE_LIBINTL @@ -1006,10 +1007,6 @@ merge the two. */ #define USE_C_FONT_LOCK -#if defined (WIN32_NATIVE) || defined (CYGWIN) -# define HAVE_WIN32_CODING_SYSTEMS -#endif - #ifdef ERROR_CHECK_ALL #define ERROR_CHECK_EXTENTS #define ERROR_CHECK_TYPES @@ -1021,32 +1018,5 @@ #define ERROR_CHECK_DISPLAY #define ERROR_CHECK_STRUCTURES #endif /* ERROR_CHECK_ALL */ - -/* Move these down here so that the s/m files (esp. windowsnt.h) can - set them. */ -#ifdef ERROR_CHECK_TYPES -#define type_checking_assert(assertion) assert (assertion) -#define type_checking_assert_at_line(assertion, file, line) \ - assert_at_line (assertion, file, line) -#else -#define type_checking_assert(assertion) -#define type_checking_assert_at_line(assertion, file, line) -#endif -#ifdef ERROR_CHECK_GC -#define gc_checking_assert(assertion) assert (assertion) -#define gc_checking_assert_at_line(assertion, file, line) \ - assert_at_line (assertion, file, line) -#else -#define gc_checking_assert(assertion) -#define gc_checking_assert_at_line(assertion, file, line) -#endif -#ifdef ERROR_CHECK_TEXT -#define text_checking_assert(assertion) assert (assertion) -#define text_checking_assert_at_line(assertion, file, line) \ - assert_at_line (assertion, file, line) -#else -#define text_checking_assert(assertion) -#define text_checking_assert_at_line(assertion, file, line) -#endif #endif /* _SRC_CONFIG_H_ */ Index: src/console-gtk-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-gtk-impl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/console-gtk-impl.h 12 Jan 2003 11:08:09 -0000 1.2 +++ src/console-gtk-impl.h 9 Mar 2003 02:27:40 -0000 1.3 @@ -146,7 +146,7 @@ /* Our container widget as a Lisp_Object */ Lisp_Object lisp_visible_widgets[3]; - /*************************** Miscellaneous **************************/ + Lisp_Object menubar_data; /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ Lisp_Object icon_pixmap; @@ -182,6 +182,8 @@ #define FRAME_GTK_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->top_widgets) #define FRAME_GTK_NUM_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->num_top_widgets) #define FRAME_GTK_ICONIFIED_P(f) (FRAME_GTK_DATA (f)->iconfigied_p) + +#define FRAME_GTK_MENUBAR_DATA(f) (FRAME_GTK_DATA (f)->menubar_data) #define FRAME_GTK_LISP_WIDGETS(f) (FRAME_GTK_DATA (f)->lisp_visible_widgets) #define FRAME_GTK_ICON_PIXMAP(f) (FRAME_GTK_DATA (f)->icon_pixmap) Index: src/console-gtk.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-gtk.h,v retrieving revision 1.6 retrieving revision 1.8 diff -u -r1.6 -r1.8 --- src/console-gtk.h 20 Jun 2002 21:18:23 -0000 1.6 +++ src/console-gtk.h 9 Mar 2003 02:27:40 -0000 1.8 @@ -1,7 +1,7 @@ /* Define X specific console, device, and frame object for XEmacs. Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -58,8 +58,6 @@ void signal_special_gtk_user_event (Lisp_Object channel, Lisp_Object function, Lisp_Object object); -void gtk_redraw_exposed_area (struct frame *f, int x, int y, - int width, int height); void gtk_output_string (struct window *w, struct display_line *dl, Ichar_dynarr *buf, int xpos, int xoffset, int start_pixpos, int width, face_index findex, @@ -92,6 +90,13 @@ void emacs_gtk_selection_received (GtkWidget *widget, GtkSelectionData *selection_data, gpointer user_data); + +typedef unsigned int GUI_ID; +extern GUI_ID new_gui_id (void); + +extern void gcpro_popup_callbacks (GUI_ID id, Lisp_Object data); +extern void ungcpro_popup_callbacks (GUI_ID id); +extern Lisp_Object get_gcpro_popup_callbacks (GUI_ID id); #endif /* HAVE_GTK */ #endif /* _XEMACS_DEVICE_X_H_ */ Index: src/console-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-impl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/console-impl.h 12 Jan 2003 11:08:09 -0000 1.4 +++ src/console-impl.h 21 Feb 2003 06:56:56 -0000 1.5 @@ -1,5 +1,5 @@ /* Define console object for XEmacs. - Copyright (C) 1996, 2002 Ben Wing + Copyright (C) 1996, 2002, 2003 Ben Wing This file is part of XEmacs. @@ -290,6 +290,10 @@ struct scrollbar_instance *, struct overhead_stats *); #endif + /* Paint the window's deadbox, a rectangle between window + borders and two short edges of both scrollbars. */ + void (*redisplay_deadbox_method) (struct window *w, int x, int y, int width, + int height); #endif /* HAVE_SCROLLBARS */ #ifdef HAVE_MENUBARS Index: src/console-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-msw.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/console-msw.c 12 Jan 2003 11:08:09 -0000 1.15 +++ src/console-msw.c 9 Mar 2003 02:27:40 -0000 1.16 @@ -282,7 +282,7 @@ } void -write_string_to_mswindows_debugging_output (Ibyte *str, Bytecount len) +write_string_to_mswindows_debugging_output (const Ibyte *str, Bytecount len) { const Extbyte *extptr; if (initialized && !inhibit_non_essential_printing_operations) Index: src/console-msw.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-msw.h,v retrieving revision 1.43 retrieving revision 1.45 diff -u -r1.43 -r1.45 --- src/console-msw.h 7 Feb 2003 11:50:52 -0000 1.43 +++ src/console-msw.h 9 Mar 2003 02:27:40 -0000 1.45 @@ -1,7 +1,7 @@ /* Define mswindows-specific console, device, and frame object for XEmacs. Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -93,8 +93,6 @@ UINT msg, WPARAM wParam, LPARAM lParam); -void mswindows_redraw_exposed_area (struct frame *f, int x, int y, - int width, int height); void mswindows_size_frame_internal (struct frame *f, XEMACS_RECT_WH *dest); HWND mswindows_get_selected_frame_hwnd (void); void mswindows_enqueue_magic_event (HWND hwnd, UINT msg); @@ -144,6 +142,11 @@ #ifdef HAVE_MENUBARS int mswindows_char_is_accelerator (struct frame *f, Ichar ch); + +/* Message handlers. Called from window procedure */ +Lisp_Object mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame *frm); +Lisp_Object mswindows_handle_wm_initmenu (HMENU hmenu, struct frame *f); +Lisp_Object mswindows_handle_wm_command (struct frame *f, WORD command); #endif #ifdef HAVE_TOOLBARS @@ -180,7 +183,8 @@ extern int mswindows_message_outputted; void mswindows_hide_console (void); int mswindows_output_console_string (const Ibyte *ptr, Bytecount len); -void write_string_to_mswindows_debugging_output (Ibyte *str, Bytecount len); +void write_string_to_mswindows_debugging_output (const Ibyte *str, + Bytecount len); #ifdef MULE Index: src/console-x-impl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-x-impl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/console-x-impl.h 20 Jun 2002 21:18:24 -0000 1.1 +++ src/console-x-impl.h 9 Mar 2003 02:27:40 -0000 1.2 @@ -1,7 +1,7 @@ /* Define X specific console, device, and frame object for XEmacs. Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 1996, 2002 Ben Wing. + Copyright (C) 1996, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -245,7 +245,22 @@ Widget top_widgets[MAX_CONCURRENT_TOP_WIDGETS]; int num_top_widgets; - /*************************** Miscellaneous **************************/ + /* lwlib ID of the tree of widgets corresponding to this popup. We pass + this to lw_map_widget_values() to retrieve all of our Lispy call-data + and accel values that need to be GCPRO'd, and store them in the + following list. (We used to call lw_map_widget_values() during GC + mark, but that isn't compatible with KKCC.) */ + LWLIB_ID menubar_id; + + /* For the frame popup data, this is the last buffer for which the + menubar was displayed. If the buffer has changed, we may have to + update things. */ + Lisp_Object last_menubar_buffer; + + /* This flag tells us if the menubar contents are up-to-date with respect + to the current menubar structure. If we want to actually pull down a + menu and this is false, then we need to update things. */ + char menubar_contents_up_to_date; /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ Lisp_Object icon_pixmap; @@ -304,6 +319,11 @@ #define FRAME_X_TEXT_WIDGET(f) (FRAME_X_DATA (f)->edit_widget) #define FRAME_X_TOP_WIDGETS(f) (FRAME_X_DATA (f)->top_widgets) #define FRAME_X_NUM_TOP_WIDGETS(f) (FRAME_X_DATA (f)->num_top_widgets) + +#define FRAME_X_MENUBAR_ID(f) (FRAME_X_DATA (f)->menubar_id) +#define FRAME_X_LAST_MENUBAR_BUFFER(f) (FRAME_X_DATA (f)->last_menubar_buffer) +#define FRAME_X_MENUBAR_CONTENTS_UP_TO_DATE(f) \ + (FRAME_X_DATA (f)->menubar_contents_up_to_date) #define FRAME_X_ICON_PIXMAP(f) (FRAME_X_DATA (f)->icon_pixmap) #define FRAME_X_ICON_PIXMAP_MASK(f) (FRAME_X_DATA (f)->icon_pixmap_mask) Index: src/console-x.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-x.h,v retrieving revision 1.18 retrieving revision 1.20 diff -u -r1.18 -r1.20 --- src/console-x.h 12 Jan 2003 11:08:10 -0000 1.18 +++ src/console-x.h 9 Mar 2003 02:27:40 -0000 1.20 @@ -1,7 +1,7 @@ /* Define X specific console, device, and frame object for XEmacs. Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 1996, 2002 Ben Wing. + Copyright (C) 1996, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -37,6 +37,7 @@ #include "console.h" #include "xintrinsic.h" +#include "../lwlib/lwlib.h" #include #include @@ -111,8 +112,26 @@ int signal_if_x_error (Display *dpy, int resumable_p); int x_IO_error_handler (Display *disp); -void x_redraw_exposed_area (struct frame *f, int x, int y, - int width, int height); +widget_value *xmalloc_widget_value (void); + +LWLIB_ID new_lwlib_id (void); + +void gcpro_popup_callbacks (LWLIB_ID id); +void ungcpro_popup_callbacks (LWLIB_ID id); +int popup_handled_p (LWLIB_ID id); +void free_popup_widget_value_tree (widget_value *wv); +void popup_selection_callback (Widget widget, LWLIB_ID ignored_id, + XtPointer client_data); +Extbyte *add_accel_and_to_external (Lisp_Object string); +int button_item_to_widget_value (Lisp_Object gui_object_instance, + Lisp_Object gui_item, widget_value *wv, + int allow_text_field_p, int no_keys_p, + int menu_entry_p, int accel_p); +widget_value * gui_items_to_widget_values (Lisp_Object gui_object_instance, + Lisp_Object items, int accel_p); +Extbyte *menu_separator_style_and_to_external (const Ibyte *s); +Lisp_Object widget_value_unwind (Lisp_Object closure); + void x_output_string (struct window *w, struct display_line *dl, Ichar_dynarr *buf, int xpos, int xoffset, int start_pixpos, int width, face_index findex, Index: src/console.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console.c,v retrieving revision 1.32 retrieving revision 1.34 diff -u -r1.32 -r1.34 --- src/console.c 12 Jan 2003 11:08:10 -0000 1.32 +++ src/console.c 9 Mar 2003 02:27:40 -0000 1.34 @@ -247,6 +247,9 @@ if (EQ (type, Qmswindows)) return mswindows_console; + if (EQ (type, Qmsprinter)) + return msprinter_console; + if (EQ (type, Qstream)) return stream_console; @@ -262,7 +265,7 @@ DEFUN ("valid-console-type-p", Fvalid_console_type_p, 1, 1, 0, /* Return t if CONSOLE-TYPE is a valid console type. -Valid types are 'x, 'tty, and 'stream. +Valid types are 'x, 'tty, 'mswindows, 'msprinter, 'gtk, and 'stream. */ (console_type)) { @@ -390,11 +393,12 @@ DEFUN ("console-type", Fconsole_type, 0, 1, 0, /* Return the console type (e.g. `x' or `tty') of CONSOLE. -Value is `tty' for a tty console (a character-only terminal), +Value is +`tty' for a tty console (a character-only terminal), `x' for a console that is an X display, -`mswindows' for a console that is a Windows NT/95/97 connection, -`pc' for a console that is a direct-write MS-DOS connection (not yet - implemented), +`mswindows' for a console that is an MS Windows connection, +`msprinter' for a console that is an MS Windows printer connection, +`gtk' for a console that is a GTK connection, `stream' for a stream console (which acts like a stdio stream), and `dead' for a deleted console. */ Index: src/console.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- src/console.h 12 Jan 2003 11:08:10 -0000 1.40 +++ src/console.h 9 Mar 2003 02:27:40 -0000 1.41 @@ -53,6 +53,7 @@ gtk_console, x_console, mswindows_console, + msprinter_console, stream_console }; Index: src/data.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/data.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- src/data.c 12 Jan 2003 11:08:10 -0000 1.45 +++ src/data.c 1 Mar 2003 07:25:35 -0000 1.46 @@ -1,7 +1,7 @@ /* Primitive operations on Lisp data types for XEmacs Lisp interpreter. Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -2332,10 +2332,8 @@ We don't want to call `signal' in this case so that we don't have trouble with dumping signal-delivering routines in an inconsistent state. */ -#ifndef CANNOT_DUMP if (!initialized) return; -#endif /* CANNOT_DUMP */ EMACS_SIGNAL (SIGFPE, arith_error); #ifdef uts EMACS_SIGNAL (SIGEMT, arith_error); Index: src/database.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/database.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- src/database.c 12 Jan 2003 11:08:10 -0000 1.25 +++ src/database.c 24 Mar 2003 15:01:50 -0000 1.26 @@ -713,8 +713,9 @@ status = dbase->open (dbase, filename, NULL, real_subtype, accessmask, modemask); #else /* DB_VERSION >= 4.1 */ + /* You can't use DB_AUTO_COMMIT unless you have a txn environment. */ status = dbase->open (dbase, NULL, filename, NULL, real_subtype, - accessmask | DB_AUTO_COMMIT, modemask); + accessmask, modemask); #endif /* DB_VERSION < 4.1 */ if (status) { Index: src/debug.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/debug.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/debug.c 12 Jan 2003 11:08:10 -0000 1.8 +++ src/debug.c 21 Feb 2003 06:56:56 -0000 1.9 @@ -31,16 +31,14 @@ /* * To add a new debug class: - * 1. Add a symbol definition for it here, if one doesn't exist - * elsewhere. If you add it here, make sure to add a defsymbol - * line for it in syms_of_debug. + * 1. Add a symbol definition for it here or in general-slots.h, if one + * doesn't exist elsewhere. If you add it here, make sure to add a + * defsymbol line for it in syms_of_debug. * 2. Add an extern definition for the symbol to debug.h. * 3. Add entries for the class to struct debug_classes in debug.h. * 4. Add a FROB line for it in xemacs_debug_loop. */ -static Lisp_Object Qredisplay, Qbuffers, Qfaces, Qwindows, Qframes, Qdevices; - struct debug_classes active_debug_classes; enum debug_loop @@ -61,21 +59,21 @@ int flag = (op == X_ADD) ? 1 : 0; Lisp_Object retval = Qnil; -#define FROB(item) \ - if (op == X_LIST || op == X_ACTIVE || op == X_INIT || EQ (class_, Q##item)) \ - { \ - if (op == X_ADD || op == X_DELETE || op == X_INIT) \ - active_debug_classes.item = flag; \ - else if (op == X_LIST \ - || (op == X_ACTIVE && active_debug_classes.item)) \ - retval = Fcons (Q##item, retval); \ - else if (op == X_VALIDATE) \ - return Qt; \ - else if (op == X_SETTYPE) \ - active_debug_classes.types_of_##item = XINT (type); \ - else if (op == X_TYPE) \ - retval = make_int (active_debug_classes.types_of_##item); \ - if (op == X_INIT) active_debug_classes.types_of_##item = VALBITS; \ +#define FROB(item) \ + if (op == X_LIST || op == X_ACTIVE || op == X_INIT || EQ (class_, Q##item)) \ + { \ + if (op == X_ADD || op == X_DELETE || op == X_INIT) \ + active_debug_classes.item = flag; \ + else if (op == X_LIST \ + || (op == X_ACTIVE && active_debug_classes.item)) \ + retval = Fcons (Q##item, retval); \ + else if (op == X_VALIDATE) \ + return Qt; \ + else if (op == X_SETTYPE) \ + active_debug_classes.types_of_##item = XINT (type); \ + else if (op == X_TYPE) \ + retval = make_int (active_debug_classes.types_of_##item); \ + if (op == X_INIT) active_debug_classes.types_of_##item = VALBITS; \ } FROB (redisplay); @@ -187,13 +185,6 @@ void syms_of_debug (void) { - DEFSYMBOL (Qredisplay); - DEFSYMBOL (Qbuffers); - DEFSYMBOL (Qfaces); - DEFSYMBOL (Qwindows); - DEFSYMBOL (Qframes); - DEFSYMBOL (Qdevices); - DEFSUBR (Fadd_debug_class_to_check); DEFSUBR (Fdelete_debug_class_to_check); DEFSUBR (Fdebug_classes_being_checked); Index: src/depend =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/depend,v retrieving revision 1.37 retrieving revision 1.40 diff -u -r1.37 -r1.40 --- src/depend 15 Feb 2003 10:16:04 -0000 1.37 +++ src/depend 9 Mar 2003 02:27:41 -0000 1.40 @@ -19,11 +19,11 @@ device-msw.o: $(LISP_H) charset.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream.h console.h device-impl.h device.h devslots.h events.h faces.h frame.h intl-auto-encap-win32.h objects-msw.h objects.h redisplay.h sysdep.h systime.h syswindows.h dialog-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h frame-impl.h frame.h frameslots.h gui.h intl-auto-encap-win32.h opaque.h redisplay.h sysfile.h syswindows.h dired-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console-msw.h console.h intl-auto-encap-win32.h ndir.h regex.h syntax.h sysdir.h sysfile.h sysfloat.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h -event-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream-impl.h console-stream.h console.h device-impl.h device.h devslots.h dragdrop.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h lstream.h menubar-msw.h menubar.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h window-impl.h window.h winslots.h +event-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream-impl.h console-stream.h console.h device-impl.h device.h devslots.h dragdrop.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h lstream.h menubar.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h window-impl.h window.h winslots.h frame-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h glyphs-msw.o: $(LISP_H) charset.h coding-system-slots.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lstream.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syswindows.h window-impl.h window.h winslots.h gui-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h events.h frame-impl.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h -menubar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h events.h frame-impl.h frame.h frameslots.h gui.h intl-auto-encap-win32.h menubar-msw.h menubar.h opaque.h redisplay.h scrollbar.h systime.h syswindows.h window-impl.h window.h winslots.h +menubar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h events.h frame-impl.h frame.h frameslots.h gui.h intl-auto-encap-win32.h menubar.h opaque.h redisplay.h scrollbar.h systime.h syswindows.h window-impl.h window.h winslots.h objects-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h insdel.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h specifier.h syswindows.h redisplay-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h debug.h device-impl.h device.h devslots.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h gutter.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h syswindows.h window-impl.h window.h winslots.h scrollbar-msw.o: $(LISP_H) conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h elhash.h events.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h opaque.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h @@ -34,25 +34,25 @@ event-xlike-inc.o: #endif #if defined(HAVE_X_WINDOWS) -EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h -EmacsManager.o: $(CONFIG_H) EmacsManager.h EmacsManagerP.h xintrinsicp.h xmmanagerp.h +EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h xmu.h +EmacsManager.o: $(CONFIG_H) EmacsManager.h EmacsManagerP.h xintrinsicp.h xmmanagerp.h xmotif.h xmprimitivep.h EmacsShell-sub.o: $(CONFIG_H) EmacsShell.h EmacsShellP.h xintrinsic.h xintrinsicp.h EmacsShell.o: $(CONFIG_H) EmacsShell.h ExternalShell.h xintrinsicp.h -balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h xintrinsic.h +balloon-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h balloon_help.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h xintrinsic.h balloon_help.o: $(CONFIG_H) balloon_help.h xintrinsic.h -console-x.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h process.h redisplay.h xintrinsic.h +console-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h process.h redisplay.h xintrinsic.h device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h systime.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h -dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h events.h frame-impl.h frame.h frameslots.h gui-x.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h xintrinsic.h -frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h objects-impl.h objects-x-impl.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h -glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h objects-impl.h objects-x-impl.h objects-x.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xintrinsic.h xmu.h -gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame.h glyphs.h gui-x.h gui.h menubar.h opaque.h redisplay.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h -intl-x.o: $(LISP_H) console-x.h console.h xintrinsic.h -menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui-x.h gui.h keymap.h menubar.h opaque.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h -objects-x.o: $(LISP_H) charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h insdel.h objects-impl.h objects-x-impl.h objects-x.h objects.h specifier.h xintrinsic.h -redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-x-impl.h console-x.h console.h debug.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h mule-ccl.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h -scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h redisplay.h scrollbar-x.h scrollbar.h specifier.h window-impl.h window.h winslots.h xintrinsic.h -select-x.o: $(LISP_H) charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h systime.h xintrinsic.h -toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h +dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h events.h frame-impl.h frame.h frameslots.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h xintrinsic.h +frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h objects-impl.h objects-x-impl.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h xmu.h +glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h imgproc.h insdel.h lstream.h objects-impl.h objects-x-impl.h objects-x.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h xmu.h +gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame.h glyphs.h gui.h menubar.h opaque.h redisplay.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h +intl-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h console-x.h console.h xintrinsic.h +menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui.h keymap.h menubar.h opaque.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h +objects-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h insdel.h objects-impl.h objects-x-impl.h objects-x.h objects.h specifier.h xintrinsic.h +redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-x-impl.h console-x.h console.h debug.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h mule-ccl.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h +scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h redisplay.h scrollbar-x.h scrollbar.h specifier.h window-impl.h window.h winslots.h xintrinsic.h +select-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h systime.h xintrinsic.h xmotif.h +toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h xgccache.o: $(LISP_H) hash.h xgccache.h #endif #if defined(HAVE_TTY) @@ -66,26 +66,26 @@ #if defined(HAVE_GTK) console-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h process.h redisplay.h device-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window-impl.h window.h winslots.h -dialog-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h events.h frame.h gui-gtk.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h +dialog-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h events.h frame.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h emacs-marshals.o: hash.h emacs-widget-accessors.o: event-gtk.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h event-gtk.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gtk-xemacs.h lstream.h objects-gtk.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h sysproc.h syssignal.h systime.h systty.h window.h xintrinsic.h frame-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h gccache-gtk.o: $(LISP_H) gccache-gtk.h hash.h glade.o: bytecode.h -glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h gui.h imgproc.h insdel.h lstream.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h ui-gtk.h window-impl.h window.h winslots.h +glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui.h imgproc.h insdel.h lstream.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h ui-gtk.h window-impl.h window.h winslots.h gtk-glue.o: objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h gtk-xemacs.o: $(LISP_H) charset.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h event-gtk.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h -gui-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h frame.h gui-gtk.h gui.h opaque.h redisplay.h -menubar-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui-gtk.h gui.h menubar.h opaque.h redisplay.h scrollbar.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h +gui-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h frame.h gui.h opaque.h redisplay.h +menubar-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui.h menubar.h opaque.h redisplay.h scrollbar.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h native-gtk-toolbar.o: $(LISP_H) charset.h console-gtk.h console.h faces.h frame.h glyphs-gtk.h glyphs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h objects-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h insdel.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h redisplay-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h debug.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gutter.h mule-ccl.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h -scrollbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h window-impl.h window.h winslots.h +scrollbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h window-impl.h window.h winslots.h select-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame.h opaque.h redisplay.h select-common.h select.h systime.h toolbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame.h redisplay.h toolbar-common.h ui-byhand.o: gui.h -ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console-gtk.h console.h device.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui-gtk.h gui.h hash.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window-impl.h window.h winslots.h +ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console-gtk.h console.h device.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window-impl.h window.h winslots.h #endif #if defined(HAVE_DATABASE) database.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h database.h sysfile.h @@ -137,7 +137,7 @@ emodules.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h console.h emodules.h file-coding.h frame.h insdel.h lstream.h redisplay.h scrollbar.h sysdep.h sysdll.h window.h esd.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h miscplay.h sound.h sysfile.h eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device.h frame.h lstream.h opaque.h profile.h redisplay.h scrollbar.h window.h -event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.h coding-system-slots.h conslots.h console-impl.h console-tty.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h glyphs.h lstream.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h +event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.h coding-system-slots.h conslots.h console-impl.h console-tty.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h glyphs.h lstream.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h event-stream.o: $(LISP_H) backtrace.h blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h events.h file-coding.h frame-impl.h frame.h frameslots.h gui.h insdel.h keymap.h lstream.h macros.h menubar.h process.h profile.h redisplay.h scrollbar.h sysdep.h sysfile.h syssignal.h systime.h window-impl.h window.h winslots.h event-unixoid.o: $(LISP_H) conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h lstream.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h events.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h events.h extents.h frame-impl.h frame.h frameslots.h glyphs.h keymap.h lstream.h redisplay.h scrollbar.h specifier.h systime.h systty.h toolbar.h window-impl.h window.h winslots.h @@ -152,7 +152,7 @@ font-lock.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h insdel.h syntax.h frame.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h gutter.h menubar.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window-impl.h window.h winslots.h free-hook.o: $(LISP_H) hash.h -general.o: $(LISP_H) +general.o: $(LISP_H) general-slots.h getloadavg.o: $(LISP_H) sysfile.h syssignal.h gif_io.o: $(LISP_H) gifrlib.h sysfile.h glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame.h gifrlib.h glyphs.h lstream.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h window-impl.h window.h winslots.h @@ -161,16 +161,16 @@ glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h insdel.h objects-impl.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h sysfile.h window-impl.h window.h winslots.h gmalloc.o: $(LISP_H) getpagesize.h sysdep.h gpmevent.o: $(LISP_H) commands.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h frame.h gpmevent.h lstream.h process.h redisplay.h sysdep.h sysproc.h syssignal.h systime.h systty.h -gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h elhash.h gui.h menubar.h +gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h elhash.h gui.h menubar.h redisplay.h gutter.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h hash.o: $(LISP_H) hash.h hftctl.o: $(LISP_H) sysfile.h hpplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h sound.h imgproc.o: $(LISP_H) imgproc.h indent.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h extents.h faces.h frame.h glyphs.h insdel.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h -inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk.h console-impl.h console-msw.h console.h database.h device-impl.h device.h devslots.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h intl-auto-encap-win32.h keymap.h lstream.h objects-impl.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h sysdll.h sysfile.h systime.h syswindows.h toolbar.h tooltalk.h ui-gtk.h window-impl.h window.h winslots.h xintrinsic.h -input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device.h frame-impl.h frame.h frameslots.h redisplay.h xintrinsic.h -input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h +inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk.h console-impl.h console-msw.h console.h database.h device-impl.h device.h devslots.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h intl-auto-encap-win32.h keymap.h lstream.h objects-impl.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h sysdll.h sysfile.h systime.h syswindows.h toolbar.h tooltalk.h ui-gtk.h window-impl.h window.h winslots.h xintrinsic.h +input-method-motif.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device.h frame-impl.h frame.h frameslots.h redisplay.h xintrinsic.h xmotif.h +input-method-xlib.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h insdel.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h extents.h frame.h insdel.h line-number.h lstream.h redisplay.h intl-auto-encap-win32.o: $(LISP_H) intl-auto-encap-win32.h syswindows.h intl-encap-win32.o: $(LISP_H) console-msw.h console.h intl-auto-encap-win32.h syswindows.h @@ -202,12 +202,12 @@ process-nt.o: $(LISP_H) console-msw.h console.h hash.h intl-auto-encap-win32.h lstream.h process-slots.h process.h procimpl.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h process-unix.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h console.h events.h file-coding.h frame.h hash.h lstream.h ndir.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h window.h process.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h console.h device.h events.h file-coding.h frame.h hash.h insdel.h lstream.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h window.h -profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h syssignal.h systime.h +profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h profile.h syssignal.h systime.h ralloc.o: $(LISP_H) getpagesize.h rangetab.o: $(LISP_H) rangetab.h realpath.o: $(LISP_H) intl-auto-encap-win32.h ndir.h sysdir.h sysfile.h syswindows.h redisplay-output.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h -redisplay.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h conslots.h console-impl.h console-tty.h console.h debug.h device-impl.h device.h devslots.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h menubar.h objects-impl.h objects.h process.h profile.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h systty.h toolbar.h window-impl.h window.h winslots.h +redisplay.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h conslots.h console-impl.h console-tty.h console.h debug.h device-impl.h device.h devslots.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h menubar.h objects-impl.h objects.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h systty.h toolbar.h window-impl.h window.h winslots.h regex.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h regex.h syntax.h scrollbar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h search.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h insdel.h opaque.h regex.h syntax.h @@ -215,7 +215,7 @@ sgiplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h libst.h sound.h sysfile.h sysproc.h syssignal.h systime.h sheap.o: $(LISP_H) sheap-adjust.h sysfile.h signal.o: $(LISP_H) conslots.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h process.h redisplay.h sysdep.h sysfile.h syssignal.h systime.h -sound.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h intl-auto-encap-win32.h redisplay.h sound.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h xintrinsic.h +sound.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h intl-auto-encap-win32.h redisplay.h sound.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h xintrinsic.h specifier.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame.h glyphs.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h strcat.o: $(CONFIG_H) strcmp.o: $(CONFIG_H) @@ -231,7 +231,7 @@ terminfo.o: $(CONFIG_H) tests.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h elhash.h lstream.h opaque.h text.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h file-coding.h lstream.h profile.h -toolbar-common.o: $(LISP_H) charset.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h +toolbar-common.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h tooltalk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h elhash.h process.h syssignal.h tooltalk.h tparam.o: $(LISP_H) Index: src/device-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device-msw.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- src/device-msw.c 12 Jan 2003 11:08:11 -0000 1.50 +++ src/device-msw.c 9 Mar 2003 02:27:41 -0000 1.51 @@ -79,6 +79,19 @@ sizeof (struct mswindows_device), mswindows_device_data_description_1 }; +static const struct memory_description msprinter_device_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct msprinter_device, name) }, + { XD_LISP_OBJECT, offsetof (struct msprinter_device, devmode) }, + { XD_LISP_OBJECT, offsetof (struct msprinter_device, fontlist) }, + { XD_END } +}; + +extern const struct sized_memory_description msprinter_device_data_description; + +const struct sized_memory_description msprinter_device_data_description = { + sizeof (struct msprinter_device), msprinter_device_data_description_1 +}; + static Lisp_Object allocate_devmode (DEVMODEW *src_devmode, int do_copy, Lisp_Object src_name, struct device *d); Index: src/device.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- src/device.c 12 Jan 2003 11:08:11 -0000 1.28 +++ src/device.c 9 Mar 2003 02:27:41 -0000 1.29 @@ -87,6 +87,7 @@ extern const struct sized_memory_description gtk_device_data_description; extern const struct sized_memory_description mswindows_device_data_description; +extern const struct sized_memory_description msprinter_device_data_description; extern const struct sized_memory_description x_device_data_description; static const struct memory_description device_data_description_1 []= { @@ -95,6 +96,7 @@ #endif #ifdef HAVE_MS_WINDOWS { XD_STRUCT_PTR, mswindows_console, 1, &mswindows_device_data_description}, + { XD_STRUCT_PTR, msprinter_console, 1, &msprinter_device_data_description}, #endif #ifdef HAVE_X_WINDOWS { XD_STRUCT_PTR, x_console, 1, &x_device_data_description}, Index: src/dialog-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dialog-gtk.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/dialog-gtk.c 23 Jun 2002 09:25:11 -0000 1.5 +++ src/dialog-gtk.c 9 Mar 2003 02:27:41 -0000 1.6 @@ -33,9 +33,7 @@ #include "window.h" #include "console-impl.h" -#include "console-gtk.h" #include "console-gtk-impl.h" -#include "gui-gtk.h" Lisp_Object Qgtk_make_dialog_box_internal; Index: src/dialog-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dialog-msw.c,v retrieving revision 1.25 retrieving revision 1.27 diff -u -r1.25 -r1.27 --- src/dialog-msw.c 12 Jan 2003 11:08:11 -0000 1.25 +++ src/dialog-msw.c 2 Mar 2003 09:38:52 -0000 1.27 @@ -1,6 +1,6 @@ /* Implements elisp-programmable dialog boxes -- MS Windows interface. Copyright (C) 1998 Kirill M. Katsnelson - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -230,7 +230,7 @@ mswindows_enqueue_misc_user_event (did->frame, Qrun_hooks, Qmenu_no_selection_hook); va_run_hook_with_args_trapping_problems - (0, Qdelete_dialog_box_hook, 1, data, 0); + (Qdialog, Qdelete_dialog_box_hook, 1, data, 0); DestroyWindow (hwnd); } @@ -714,7 +714,8 @@ Lisp_Gui_Item *pgui_item = XGUI_ITEM (*gui_item); item_tem.style = (WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON - | (gui_item_active_p (*gui_item) ? 0 : WS_DISABLED)); + | (gui_item_active_p (*gui_item, 0) ? 0 : + WS_DISABLED)); item_tem.cx = button_width (pgui_item->name); /* Item ids are indices into dialog_items plus offset, to avoid having items by reserved ids (IDOK, IDCANCEL) */ Index: src/dialog-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dialog-x.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/dialog-x.c 20 Jun 2002 21:18:27 -0000 1.12 +++ src/dialog-x.c 9 Mar 2003 02:27:41 -0000 1.13 @@ -1,7 +1,7 @@ /* Implements elisp-programmable dialog boxes -- X interface. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 2000, 2002 Ben Wing. + Copyright (C) 2000, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -36,7 +36,6 @@ #include "window.h" #include "console-x-impl.h" -#include "gui-x.h" #include "EmacsFrame.h" Index: src/doc.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/doc.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- src/doc.c 5 Jun 2002 09:55:12 -0000 1.30 +++ src/doc.c 1 Mar 2003 07:25:35 -0000 1.31 @@ -245,7 +245,6 @@ XSTRING_DATA (name_reloc), O_RDONLY | OPEN_BINARY, 0); if (fd < 0) { -#ifndef CANNOT_DUMP if (purify_flag) { /* sizeof ("../lib-src/") == 12 */ @@ -257,7 +256,6 @@ fd = qxe_open (name_nonreloc, O_RDONLY | OPEN_BINARY, 0); } -#endif /* CANNOT_DUMP */ if (fd < 0) report_file_error ("Cannot open doc string file", @@ -456,28 +454,15 @@ ISO 2022 data because our pointers will reflect internal format, not external format. */ -#ifndef CANNOT_DUMP if (!purify_flag) invalid_operation ("Snarf-documentation can only be called in an undumped Emacs", Qunbound); -#endif CHECK_STRING (filename); -#ifdef CANNOT_DUMP - if (!NILP (Vdoc_directory)) - { - CHECK_STRING (Vdoc_directory); - name = alloca_ibytes (XSTRING_LENGTH (filename) - + XSTRING_LENGTH (Vdoc_directory) - + 1); - qxestrcpy (name, XSTRING_DATA (Vdoc_directory)); - } - else -#endif /* CANNOT_DUMP */ - { - name = alloca_ibytes (XSTRING_LENGTH (filename) + 14); - qxestrcpy (name, (Ibyte *) "../lib-src/"); - } + { + name = alloca_ibytes (XSTRING_LENGTH (filename) + 14); + qxestrcpy (name, (Ibyte *) "../lib-src/"); + } qxestrcat (name, XSTRING_DATA (filename)); Index: src/doprnt.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/doprnt.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- src/doprnt.c 12 Jan 2003 11:08:11 -0000 1.23 +++ src/doprnt.c 21 Feb 2003 06:56:56 -0000 1.24 @@ -358,7 +358,7 @@ } if (j == Dynarr_length (specs)) - syntax_error ("No conversion spec for argument", make_int (i)); + syntax_error ("No conversion spec for argument", make_int (i)); ch = spec->converter; @@ -431,10 +431,10 @@ /* allow too many args for string, but not too few */ if (nargs < get_args_needed (specs)) signal_error_1 (Qwrong_number_of_arguments, - list3 (Qformat, - make_int (nargs), - !NILP (format_reloc) ? format_reloc : - make_string (format_nonreloc, format_length))); + list3 (Qformat, + make_int (nargs), + !NILP (format_reloc) ? format_reloc : + make_string (format_nonreloc, format_length))); } else { Index: src/dumper.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dumper.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/dumper.c 12 Jan 2003 11:08:12 -0000 1.13 +++ src/dumper.c 2 Mar 2003 09:38:52 -0000 1.14 @@ -1,7 +1,7 @@ /* Portable data dumper for XEmacs. Copyright (C) 1999-2000 Olivier Galibert Copyright (C) 2001 Martin Buchholz - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -410,6 +410,20 @@ } static void +pdump_unsupported_dump_type (enum memory_description_type type, + int do_backtrace) +{ + stderr_out ("Unsupported dump type : %d\n", type); +#ifdef WIN32_NATIVE + stderr_out ("Are you compiling with SUPPORT_EDIT_AND_CONTINUE?\n"); + stderr_out ("See the PROBLEMS file.\n"); +#endif + if (do_backtrace) + pdump_backtrace (); + abort (); +} + +static void pdump_bump_depth (void) { int me = pdump_depth++; @@ -545,9 +559,7 @@ break; default: - stderr_out ("Unsupported dump type : %d\n", desc1->type); - pdump_backtrace (); - abort (); + pdump_unsupported_dump_type (desc1->type, 1); } } } @@ -807,8 +819,7 @@ break; default: - stderr_out ("Unsupported dump type : %d\n", desc1->type); - abort (); + pdump_unsupported_dump_type (desc1->type, 0); } } } @@ -942,8 +953,7 @@ break; default: - stderr_out ("Unsupported dump type : %d\n", desc1->type); - abort (); + pdump_unsupported_dump_type (desc1->type, 0); } } } @@ -997,8 +1007,10 @@ pdump_static_pointer *data = alloca_array (pdump_static_pointer, count); for (i = 0; i < count; i++) { - data[i].address = (char **) Dynarr_atp (pdump_root_struct_ptrs, i)->ptraddress; - data[i].value = (char *) pdump_get_entry (* data[i].address)->save_offset; + data[i].address = + (char **) Dynarr_atp (pdump_root_struct_ptrs, i)->ptraddress; + data[i].value = + (char *) pdump_get_entry (* data[i].address)->save_offset; } PDUMP_ALIGN_OUTPUT (pdump_static_pointer); retry_fwrite (data, sizeof (pdump_static_pointer), count, pdump_out); Index: src/dynarr.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dynarr.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/dynarr.c 29 Mar 2002 04:47:14 -0000 1.8 +++ src/dynarr.c 21 Feb 2003 06:56:56 -0000 1.9 @@ -1,6 +1,6 @@ -/* Simple 'n' stupid dynamic-array module. +/* Support for dynamic arrays. Copyright (C) 1993 Sun Microsystems, Inc. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -155,7 +155,7 @@ { int newsize; double multiplier; - Dynarr *dy = (Dynarr *) d; + Dynarr *dy = (Dynarr *) Dynarr_verify (d); if (dy->max <= 8) multiplier = 2; @@ -180,11 +180,16 @@ Dynarr *dy = (Dynarr *) Dynarr_verify (d); Dynarr_resize (dy, dy->cur+len); +#if 0 + /* WTF? We should be catching these problems. */ /* Silently adjust start to be valid. */ if (start > dy->cur) start = dy->cur; else if (start < 0) start = 0; +#else + assert (start >= 0 && start <= dy->cur); +#endif if (start != dy->cur) { @@ -203,7 +208,7 @@ void Dynarr_delete_many (void *d, int start, int len) { - Dynarr *dy = (Dynarr *) d; + Dynarr *dy = (Dynarr *) Dynarr_verify (d); assert (start >= 0 && len >= 0 && start + len <= dy->cur); memmove ((char *) dy->base + start*dy->elsize, @@ -246,11 +251,11 @@ if (dy->base) { Bytecount malloc_used = malloced_storage_size (dy->base, - dy->elsize * dy->max, 0); + dy->elsize * dy->max, 0); /* #### This may or may not be correct. Some Dynarrs would prefer that we use dy->cur instead of dy->largest here. */ - int was_requested = dy->elsize * dy->largest; - int dynarr_overhead = dy->elsize * (dy->max - dy->largest); + Bytecount was_requested = dy->elsize * dy->largest; + Bytecount dynarr_overhead = dy->elsize * (dy->max - dy->largest); total += malloc_used; stats->was_requested += was_requested; Index: src/editfns.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/editfns.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- src/editfns.c 12 Jan 2003 11:08:12 -0000 1.46 +++ src/editfns.c 1 Mar 2003 07:25:35 -0000 1.47 @@ -89,10 +89,8 @@ /* Set up system_name even when dumping. */ init_system_name (); -#ifndef CANNOT_DUMP if (!initialized) return; -#endif if ((p = egetenv ("NAME"))) /* I don't think it's the right thing to do the ampersand Index: src/emacs.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emacs.c,v retrieving revision 1.133 retrieving revision 1.136 diff -u -r1.133 -r1.136 --- src/emacs.c 15 Feb 2003 10:16:04 -0000 1.133 +++ src/emacs.c 9 Mar 2003 02:27:42 -0000 1.136 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -268,7 +268,7 @@ #include TT_C_H_FILE #endif -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY #include "console-msw.h" #endif @@ -466,6 +466,8 @@ Lisp_Object Qkill_emacs_hook; Lisp_Object Qsave_buffers_kill_emacs; +Lisp_Object Qtemacs, Qdumping, Qrestarted, Qpdump, Qbatch; + /* Nonzero if handling a fatal error already. */ int fatal_error_in_progress; @@ -678,6 +680,15 @@ } } +static void +check_compatible_window_system (char *must) +{ + if (display_use && strcmp (display_use, must)) + fatal ("Incompatible window system type `%s': `%s' already specified", + must, display_use); + display_use = must; +} + /************************************************************************/ /* main and friends: XEmacs startup */ @@ -703,7 +714,6 @@ char stack_bottom_variable; int skip_args = 0; Lisp_Object load_me; - int inhibit_window_system; #ifdef NeXT extern int malloc_cookie; #endif @@ -730,6 +740,7 @@ #endif /* not SYSTEM_MALLOC or HAVE_LIBMCHECK or DOUG_LEA_MALLOC */ noninteractive = 0; + display_use = 0; inhibit_non_essential_printing_operations = 1; #ifdef NeXT @@ -803,12 +814,6 @@ EXTRA_INITIALIZE; #endif -#ifdef HAVE_WINDOW_SYSTEM - inhibit_window_system = 0; -#else - inhibit_window_system = 1; -#endif - /* NOTE NOTE NOTE: Keep the following args in sync with the big list of arguments below in standard_args[], with the help text in startup.el, and with the list of non-clobbered variables near where pdump_load() @@ -826,36 +831,11 @@ exit (0); } - /* Handle the -t switch, which specifies filename to use as terminal */ - { - Extbyte *term; - if (argmatch (argv, argc, "-t", "--terminal", 0, &term, &skip_args)) - { - retry_close (0); - retry_close (1); - if (open (term, O_RDWR | OPEN_BINARY, 2) < 0) - fatal ("%s: %s", term, strerror (errno)); - dup (0); - if (! isatty (0)) - fatal ("%s: not a tty", term); - -#if 0 - stderr_out ("Using %s", ttyname (0)); -#endif - stderr_out ("Using %s", term); - inhibit_window_system = 1; /* -t => -nw */ - } - } - /* Handle the --no-dump-file/-nd switch, which means don't load the dump file (ignored when not using pdump) */ if (argmatch (argv, argc, "-nd", "--no-dump-file", 0, NULL, &skip_args)) nodumpfile = 1; - /* Handle -nw switch */ - if (argmatch (argv, argc, "-nw", "--no-windows", 0, NULL, &skip_args)) - inhibit_window_system = 1; - /* Handle the -batch switch, which means don't do interactive display. */ if (argmatch (argv, argc, "-batch", "--batch", 0, NULL, &skip_args)) { @@ -950,35 +930,85 @@ /* Now, figure out which type of console is our first console. */ - display_arg = 0; - if (noninteractive) display_use = "stream"; - else - display_use = "tty"; + if (argmatch (argv, argc, "-nw", "--no-windows", 0, NULL, &skip_args) || + argmatch (argv, argc, "-tty", "--use-tty", 0, NULL, &skip_args)) + { + check_compatible_window_system ("tty"); #ifndef HAVE_TTY - if (inhibit_window_system) - fatal ("Sorry, this XEmacs was not compiled with TTY support"); + fatal ("Sorry, this XEmacs was not compiled with TTY support"); #endif + } + + if (argmatch (argv, argc, "-x", "--use-x", 0, NULL, &skip_args)) + { + check_compatible_window_system ("x"); +#ifndef HAVE_X_WINDOWS + fatal ("Sorry, this XEmacs was not compiled with X support"); +#endif + } + + if (argmatch (argv, argc, "-gtk", "--use-gtk", 0, NULL, &skip_args) || + argmatch (argv, argc, "-gnome", "--use-gnome", 0, NULL, &skip_args)) + { + check_compatible_window_system ("gtk"); +#ifndef HAVE_GTK + fatal ("Sorry, this XEmacs was not compiled with GTK support"); +#endif + } + + if (argmatch (argv, argc, "-msw", "--use-ms-windows", 0, NULL, &skip_args)) + { + check_compatible_window_system ("mswindows"); +#ifndef HAVE_MS_WINDOWS + fatal ("Sorry, this XEmacs was not compiled with MS Windows support"); +#endif + } + + /* Handle other switches implying particular window systems: */ + + /* Handle the -t switch, which specifies filename to use as terminal */ + { + Extbyte *term; + if (argmatch (argv, argc, "-t", "--terminal", 0, &term, &skip_args)) + { + check_compatible_window_system ("tty"); +#ifndef HAVE_TTY + fatal ("Sorry, this XEmacs was not compiled with TTY support"); +#endif + + retry_close (0); + retry_close (1); + if (open (term, O_RDWR | OPEN_BINARY, 2) < 0) + fatal ("%s: %s", term, strerror (errno)); + dup (0); + if (! isatty (0)) + fatal ("%s: not a tty", term); + +#if 0 + stderr_out ("Using %s", ttyname (0)); +#endif + stderr_out ("Using %s", term); + } + } -#ifdef HAVE_WINDOW_SYSTEM /* Stupid kludge to catch command-line display spec. We can't handle this argument entirely in window-system-dependent code because we don't even know which window-system-dependent code to run until we've recognized this argument. */ - if (!inhibit_window_system && !noninteractive) - { + { #ifdef HAVE_X_WINDOWS - char *dpy = 0; - int count_before = skip_args; + char *dpy = 0; + int count_before = skip_args; - if (argmatch (argv, argc, "-d", "--display", 3, &dpy, &skip_args) || - argmatch (argv, argc, "-display", 0, 3, &dpy, &skip_args)) - { - display_arg = 1; - display_use = "x"; - } + if (argmatch (argv, argc, "-d", "--display", 3, &dpy, &skip_args) || + argmatch (argv, argc, "-display", 0, 3, &dpy, &skip_args)) + { + check_compatible_window_system ("x"); + display_arg = 1; + } /* If we have the form --display=NAME, convert it into -d name. This requires inserting a new element into argv. */ @@ -1003,27 +1033,43 @@ /* Don't actually discard this arg. */ skip_args = count_before; +#endif /* HAVE_X_WINDOWS */ + } + + /* If no switch telling us which window system to use, try other + possibilities: */ - /* If there is a non-empty environment var DISPLAY, set - `display_use', but not `display_arg', which is only to be set - if the display was specified on the command line. */ +#if defined (HAVE_X_WINDOWS) || defined (HAVE_GTK) + if (!display_use) + { + char *dpy; + /* If there is a non-empty environment var DISPLAY, assume X or GTK, + but don't set `display_arg', which is only to be set if the + display was specified on the command line. */ if ((dpy = getenv ("DISPLAY")) && dpy[0]) +#ifdef HAVE_X_WINDOWS + /* #### Who gets precedence? X or GTK? For the moment, GTK support is + unstable so use X. Maybe eventually we will switch this. */ display_use = "x"; - -#endif /* HAVE_X_WINDOWS */ -#ifdef HAVE_GTK - { - char *dpy = getenv ("DISPLAY"); - if (dpy && dpy[0]) - display_use = "gtk"; - } +#else + display_use = "gtk"; #endif + } +#endif /* defined (HAVE_X_WINDOWS) || defined (HAVE_GTK) */ + #ifdef HAVE_MS_WINDOWS - if (strcmp (display_use, "x") != 0) - display_use = "mswindows"; + if (!display_use) + display_use = "mswindows"; +#endif /* HAVE_MS_WINDOWS */ + +#ifdef HAVE_TTY + if (!display_use) + display_use = "tty"; #endif /* HAVE_MS_WINDOWS */ - } -#endif /* HAVE_WINDOW_SYSTEM */ + + if (!display_use) + fatal ("No window systems and no TTY's in this XEmacs: Must specify " + "-batch"); noninteractive1 = noninteractive; @@ -1069,7 +1115,7 @@ As early as possible, of course, so we can be fairly accurate. */ -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY init_win32_very_early (); #endif #ifdef HAVE_MS_WINDOWS @@ -1086,8 +1132,11 @@ We try to do things in an order that minimizes the non-obvious dependencies between functions. */ - /* purify_flag 1 is correct even if CANNOT_DUMP. - * loadup.el will set to nil at end. */ + /* purify_flag is set to indicate we are dumping (its name refers to + purespace, which no longer exists and was a way of marking some + areas read-only so they could be shared among many processes). + + loadup.el will set to nil at end. */ purify_flag = 0; #ifdef PDUMP @@ -1137,7 +1186,7 @@ inhibit_site_modules = inhibit_site_modules_save; if (initialized) - run_temacs_argc = -1; + run_temacs_argc = restart ? -2 : -1; else purify_flag = 1; } @@ -1373,7 +1422,7 @@ syms_of_dired_mswindows (); syms_of_nt (); #endif -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY syms_of_win32 (); #endif @@ -1391,7 +1440,7 @@ #endif /* HAVE_CANNA */ #endif /* MULE */ -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY syms_of_intl_win32 (); #endif @@ -1556,7 +1605,7 @@ coding_system_type_create (); coding_system_type_create_unicode (); -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY coding_system_type_create_intl_win32 (); #endif #ifdef MULE @@ -1751,7 +1800,7 @@ vars_of_indent (); vars_of_insdel (); vars_of_intl (); -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY vars_of_intl_win32 (); #endif #ifdef HAVE_XIM @@ -1813,7 +1862,7 @@ #endif vars_of_undo (); vars_of_window (); -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY vars_of_win32 (); #endif @@ -1967,7 +2016,7 @@ complex_vars_of_(), for example if a charset appears anywhere, then we suddenly have dependence on the previous call. */ complex_vars_of_file_coding (); -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY complex_vars_of_intl_win32 (); #endif @@ -2089,7 +2138,7 @@ reinit_coding_system_type_create (); reinit_coding_system_type_create_unicode (); -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY reinit_coding_system_type_create_intl_win32 (); #endif #ifdef MULE @@ -2205,7 +2254,7 @@ to be done both at dump time and at run time. Some will be done only at run time, by querying the `initialized' variable. */ -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY init_intl_win32 (); /* Under Windows, determine whether we use Unicode or ANSI to call the system routines -- i.e. determine what the coding system `mswindows-tstr' @@ -2258,7 +2307,7 @@ #ifdef SUNPRO init_sunpro (); /* Set up Sunpro usage tracking */ #endif -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY init_win32 (); #endif #if defined (HAVE_NATIVE_SOUND) && defined (hp9000s800) @@ -2374,9 +2423,7 @@ /* Handled by main_1 above: Each must have its own priority and must be in the order mentioned in main_1. */ { "-sd", "--show-dump-id", 105, 0 }, - { "-t", "--terminal", 100, 1 }, { "-nd", "--no-dump-file", 95, 0 }, - { "-nw", "--no-windows", 90, 0 }, { "-batch", "--batch", 88, 0 }, #ifdef WIN32_NATIVE { "-mswindows-termination-handle", 0, 84, 1 }, @@ -2391,8 +2438,15 @@ { "-help", "--help", 72, 0 }, { "-version", "--version", 70, 0 }, { "-V", 0, 68, 0 }, - { "-d", "--display", 66, 1 }, - { "-display", 0, 64, 1 }, + { "-nw", "--no-windows", 66, 0 }, + { "-tty", "--use-tty", 65, 0 }, + { "-x", "--use-x", 64, 0 }, + { "-gtk", "--use-gtk", 63, 0 }, + { "-gnome", "--use-gnome", 62, 0 }, + { "-msw", "--use-ms-windows", 61, 0 }, + { "-t", "--terminal", 58, 1 }, + { "-d", "--display", 57, 1 }, + { "-display", 0, 56, 1 }, /* Handled by command-line-early in startup.el: */ { "-q", "--no-init-file", 50, 0 }, @@ -2560,7 +2614,8 @@ if (best < 0) abort (); - /* Copy the highest priority remaining option, with its args, to NEW_ARGV. */ + /* Copy the highest priority remaining option, with its args, to + NEW_ARGV. */ new_argv[to++] = argv[best]; for (i = 0; i < options[best]; i++) new_argv[to++] = argv[best + i + 1]; @@ -2587,6 +2642,48 @@ return run_temacs_argc >= 0 ? Qt : Qnil; } +DEFUN ("emacs-run-status", Femacs_run_status, 0, 0, 0, /* +Plist of values indicating the current run status of this XEmacs. +Currently defined values: + +`temacs' + If non-nil, we are running a "raw temacs" (no dump data is present + and `run-emacs-from-temacs' not called). (same as `running-temacs-p') + +`dumping' + If non-nil, we are in the process of creating dump data. (same as + `purify-flag') + +`restarted' + If non-nil, `run-emacs-from-temacs' was called. + +`pdump' + If non-nil, we were compiled with pdump (portable dumping) support. + +`batch' + If non-nil, we are running non-interactively. (same as `noninteractive') +*/ + ()) +{ + Lisp_Object plist = Qnil; + +#define ADD_PLIST(key, val) plist = Fcons (val, Fcons (key, plist)) + if (run_temacs_argc >= 0) + ADD_PLIST (Qtemacs, Qt); + if (purify_flag) + ADD_PLIST (Qdumping, Qt); + if (run_temacs_argc == -2) + ADD_PLIST (Qrestarted, Qt); +#ifdef PDUMP + ADD_PLIST (Qpdump, Qt); +#endif + if (noninteractive) + ADD_PLIST (Qbatch, Qt); + +#undef ADD_PLIST + return Fnreverse (plist); +} + DEFUN ("run-emacs-from-temacs", Frun_emacs_from_temacs, 0, MANY, 0, /* Do not call this. It will reinitialize your XEmacs. You'll be sorry. */ @@ -2654,6 +2751,12 @@ #if defined (HEAP_IN_DATA) && !defined (PDUMP) report_sheap_usage (0); #endif + + /* run-temacs usually only occurs as a result of building, and in all such + cases we want a backtrace, even if it occurs very early. */ + if (NILP (Vstack_trace_on_error)) + Vstack_trace_on_error = Qt; + LONGJMP (run_temacs_catch, 1); RETURN_NOT_REACHED (Qnil); } @@ -2750,7 +2853,7 @@ { extern char **_environ; if ((unsigned) environ == 0) - environ=_environ; + environ = _environ; } #endif /* _SCO_DS */ vol_envp = environ; @@ -2787,7 +2890,7 @@ } #endif /* DOUG_LEA_MALLOC */ - run_temacs_argc = -1; + run_temacs_argc = -2; main_1 (vol_argc, vol_argv, vol_envp, restarted); @@ -2806,8 +2909,6 @@ /* dumping XEmacs (to a new EXE file) */ /************************************************************************/ -#ifndef CANNOT_DUMP - #if !defined (PDUMP) || !defined (SYSTEM_MALLOC) extern Char_Binary my_edata[]; #endif @@ -2912,8 +3013,6 @@ return Qnil; } -#endif /* not CANNOT_DUMP */ - /************************************************************************/ /* exiting XEmacs (intended or not) */ @@ -2984,7 +3083,7 @@ debugging_breakpoint (); } -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY /* Return whether all bytes in the specified memory block can be read. */ int @@ -2993,7 +3092,7 @@ return !IsBadReadPtr (ptr, len); } -#else /* !(defined (WIN32_NATIVE) || defined (CYGWIN)) */ +#else /* !WIN32_ANY */ /* #### There must be a better way!!!! */ @@ -3041,7 +3140,7 @@ return retval; } -#endif /* defined (WIN32_NATIVE) || defined (CYGWIN) */ +#endif /* WIN32_ANY */ #ifdef DEBUG_XEMACS @@ -3082,7 +3181,7 @@ { static int already_paused; - if (already_paused || !noninteractive) + if (already_paused) return; if (!allow_further) already_paused = 1; @@ -3090,7 +3189,11 @@ user to see this message. This may be unnecessary, but can't hurt, and we can't necessarily check arg; e.g. xemacs --help kills with argument 0. */ - if (mswindows_message_outputted) + if (mswindows_message_outputted && + /* noninteractive, we always show the box. Else, + do it when there is not yet an initial frame -- in such case, + XEmacs will just die immediately and we wouldn't see anything. */ + (noninteractive || NILP (Fselected_frame (Qnil)))) Fmswindows_message_box (build_msg_string ("Messages outputted. XEmacs is exiting."), Qnil, Qnil); @@ -3599,8 +3702,8 @@ were in the middle of doing something */ /* debugging_breakpoint (); */ #if !defined (ASSERTIONS_DONT_ABORT) -#ifdef _MSC_VER - /* Calling abort() directly just seems to exit, in a way we can't +#if defined (_MSC_VER) || defined (CYGWIN) + /* In VC++, calling abort() directly just seems to exit, in a way we can't trap. (#### The docs say it does raise (SIGABRT), which we should be able to trap. Perhaps we're messing up somewhere? Or perhaps MS is messed up.) @@ -3617,12 +3720,14 @@ software exception ..." without the obvious "OK to terminate", "Cancel to debug"; instead, you just get OK/Cancel, which in fact do those same things. */ + /* In Cygwin, abort() doesn't get trapped properly in gdb but seg faults + do, so we resort to the same trick. */ * ((int *) 0) = 666; /* RaiseException (STATUS_ASSERTION_FAILURE, EXCEPTION_NONCONTINUABLE, 0, 0); */ #else really_abort (); -#endif /* _MSC_VER */ +#endif /* defined (_MSC_VER) || defined (CYGWIN) */ #endif /* !defined (ASSERTIONS_DONT_ABORT) */ inhibit_non_essential_printing_operations = 0; in_assert_failed = 0; @@ -3698,12 +3803,11 @@ void syms_of_emacs (void) { -#ifndef CANNOT_DUMP DEFSUBR (Fdump_emacs); -#endif /* !CANNOT_DUMP */ DEFSUBR (Frun_emacs_from_temacs); DEFSUBR (Frunning_temacs_p); + DEFSUBR (Femacs_run_status); DEFSUBR (Finvocation_name); DEFSUBR (Finvocation_directory); DEFSUBR (Fkill_emacs); @@ -3721,6 +3825,12 @@ DEFSYMBOL (Qkill_emacs_hook); DEFSYMBOL (Qsave_buffers_kill_emacs); + + DEFSYMBOL (Qtemacs); + DEFSYMBOL (Qdumping); + DEFSYMBOL (Qrestarted); + DEFSYMBOL (Qpdump); + DEFSYMBOL (Qbatch); } /* Yuck! These variables may get set from command-line options when Index: src/emodules.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emodules.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- src/emodules.c 10 Sep 2002 15:27:36 -0000 1.14 +++ src/emodules.c 25 Mar 2003 23:09:56 -0000 1.15 @@ -634,9 +634,10 @@ */); /* #### Export this to Lisp */ - Vmodule_extensions = list3 (build_string (".ell"), + Vmodule_extensions = list4 (build_string (".ell"), build_string (".so"), - build_string (".dll")); + build_string (".dll"), + build_string (".dylib")); staticpro (&Vmodule_extensions); load_modules_quietly = 0; Index: src/eval.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/eval.c,v retrieving revision 1.67 retrieving revision 1.71 diff -u -r1.67 -r1.71 --- src/eval.c 13 Feb 2003 09:57:06 -0000 1.67 +++ src/eval.c 2 Mar 2003 09:38:53 -0000 1.71 @@ -404,7 +404,6 @@ #endif static int warning_will_be_discarded (Lisp_Object level); -static void check_proper_critical_section_nonlocal_exit_protection (void); /************************************************************************/ @@ -1442,6 +1441,34 @@ /* Non-local exits */ /************************************************************************/ +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS + +int +proper_redisplay_wrapping_in_place (void) +{ + return !in_display + || ((get_inhibit_flags () & INTERNAL_INHIBIT_ERRORS) + && (get_inhibit_flags () & INTERNAL_INHIBIT_THROWS)); +} + +static void +check_proper_critical_section_nonlocal_exit_protection (void) +{ + assert_with_message + (proper_redisplay_wrapping_in_place (), + "Attempted non-local exit from within redisplay without being properly wrapped"); +} + +static void +check_proper_critical_section_lisp_protection (void) +{ + assert_with_message + (proper_redisplay_wrapping_in_place (), + "Attempt to call Lisp code from within redisplay without being properly wrapped"); +} + +#endif /* ERROR_CHECK_TRAPPING_PROBLEMS */ + DEFUN ("catch", Fcatch, 1, UNEVALLED, 0, /* \(catch TAG BODY...): eval BODY allowing nonlocal exits using `throw'. TAG is evalled to get the tag to use. Then the BODY is executed. @@ -1613,7 +1640,9 @@ abort (); #endif +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS check_proper_critical_section_nonlocal_exit_protection (); +#endif /* If bomb_out_p is t, this is being called from Fsignal as a "last resort" when there is no handler for this error and @@ -2135,9 +2164,6 @@ #endif } -extern int in_display; -extern int gc_currently_forbidden; - /************************************************************************/ /* the workhorse error-signaling function */ @@ -2155,28 +2181,6 @@ { } -#ifdef ERROR_CHECK_TRAPPING_PROBLEMS - -static void -check_proper_critical_section_gc_protection (void) -{ - assert_with_message - (!in_display || gc_currently_forbidden, - "Potential GC from within redisplay without being properly wrapped"); -} - -#endif /* ERROR_CHECK_TRAPPING_PROBLEMS */ - -static void -check_proper_critical_section_nonlocal_exit_protection (void) -{ - assert_with_message - (!in_display - || ((get_inhibit_flags () & INTERNAL_INHIBIT_ERRORS) - && (get_inhibit_flags () & INTERNAL_INHIBIT_THROWS)), - "Attempted non-local exit from within redisplay without being properly wrapped"); -} - /* #### This function has not been synched with FSF. It diverges significantly. */ @@ -2234,7 +2238,9 @@ messy, difficult-to-debug ways. See enter_redisplay_critical_section(). */ +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS check_proper_critical_section_nonlocal_exit_protection (); +#endif conditions = Fget (error_symbol, Qerror_conditions, Qnil); @@ -3464,6 +3470,10 @@ int nargs; struct backtrace backtrace; +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS + check_proper_critical_section_lisp_protection (); +#endif + /* I think this is a pretty safe place to call Lisp code, don't you? */ while (!in_warnings && !NILP (Vpending_warnings) /* well, perhaps not so safe after all! */ @@ -3505,9 +3515,6 @@ } QUIT; -#ifdef ERROR_CHECK_TRAPPING_PROBLEMS - check_proper_critical_section_gc_protection (); -#endif if (need_to_garbage_collect) { struct gcpro gcpro1; @@ -3739,9 +3746,7 @@ args[1] = Fcons (Fcons (Qfinalize_list, zap_finalize_list ()), Qnil); run_hook_with_args_trapping_problems - ("Error in post-gc-hook", - 2, args, - RUN_HOOKS_TO_COMPLETION, + (Qgarbage_collecting, 2, args, RUN_HOOKS_TO_COMPLETION, INHIBIT_QUIT | NO_INHIBIT_ERRORS); } @@ -3759,13 +3764,12 @@ Lisp_Object *fun_args = args + 1; Lisp_Object orig_fun; + /* QUIT will check for proper redisplay wrapping */ + QUIT; if (funcall_allocation_flag) { -#ifdef ERROR_CHECK_TRAPPING_PROBLEMS - check_proper_critical_section_gc_protection (); -#endif if (need_to_garbage_collect) /* Callers should gcpro lexpr args */ garbage_collect_1 (); @@ -4812,14 +4816,14 @@ { struct call_trapping_problems *p = (struct call_trapping_problems *) get_opaque_ptr (opaque); - struct gcpro gcpro1; - Lisp_Object lstream = Qnil; - Lisp_Object errstr; - int speccount = specpdl_depth (); if (!(inhibit_flags & INHIBIT_WARNING_ISSUE) && !warning_will_be_discarded (current_warning_level ())) { + struct gcpro gcpro1; + Lisp_Object lstream = Qnil; + int speccount = specpdl_depth (); + /* We're no longer protected against errors or quit here, so at least let's temporarily inhibit quit. We definitely do not want to inhibit quit during the calling of the function @@ -4835,19 +4839,6 @@ Lstream_delete (XLSTREAM (lstream)); UNGCPRO; - /* #### This should call - (with-output-to-string (display-error (cons error_conditions data)) - but that stuff is all in Lisp currently. */ - errstr = - emacs_sprintf_string_lisp - ("%s: (%s %s)\n\nBacktrace follows:\n\n%s", - Qnil, 4, - build_msg_string (p->warning_string ? p->warning_string : "error"), - error_conditions, data, p->backtrace); - - warn_when_safe_lispobj (p->warning_class, current_warning_level (), - errstr); - unbind_to (speccount); } else @@ -4876,6 +4867,98 @@ call_trapping_problems_2, opaque); } +static void +issue_call_trapping_problems_warning (Lisp_Object warning_class, + const CIbyte *warning_string, + struct call_trapping_problems_result *p) +{ + if (!warning_will_be_discarded (current_warning_level ())) + { + int depth = specpdl_depth (); + + /* We're no longer protected against errors or quit here, so at + least let's temporarily inhibit quit. */ + specbind (Qinhibit_quit, Qt); + + if (p->caught_throw) + { + Lisp_Object errstr = + emacs_sprintf_string_lisp + ("%s: Attempt to throw outside of function " + "to catch `%s' with value `%s'", + Qnil, 3, + build_msg_string (warning_string ? warning_string : "error"), + p->thrown_tag, p->thrown_value); + warn_when_safe_lispobj (Qerror, current_warning_level (), errstr); + } + else if (p->caught_error) + { + Lisp_Object errstr; + /* #### This should call + (with-output-to-string (display-error (cons error_conditions + data)) + but that stuff is all in Lisp currently. */ + errstr = + emacs_sprintf_string_lisp + ("%s: (%s %s)\n\nBacktrace follows:\n\n%s", + Qnil, 4, + build_msg_string (warning_string ? warning_string : "error"), + p->error_conditions, p->data, p->backtrace); + + warn_when_safe_lispobj (warning_class, current_warning_level (), + errstr); + } + + unbind_to (depth); + } +} + +/* Turn on the trapping flags in FLAGS -- see call_trapping_problems(). + This cannot handle INTERNAL_INHIBIT_THROWS() or INTERNAL_INHIBIT_ERRORS + (because they ultimately boil down to a setjmp()!) -- you must directly + use call_trapping_problems() for that. Turn the flags off with + unbind_to(). Returns the "canonicalized" flags (particularly in the + case of INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY, which is shorthand for + various other flags). */ + +int +set_trapping_problems_flags (int flags) +{ + int new_inhibit_flags; + + if (flags & INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY) + flags |= INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION + | INHIBIT_EXISTING_BUFFER_TEXT_MODIFICATION + | INHIBIT_ENTERING_DEBUGGER + | INHIBIT_WARNING_ISSUE + | INHIBIT_GC; + + new_inhibit_flags = inhibit_flags | flags; + if (new_inhibit_flags != inhibit_flags) + internal_bind_int (&inhibit_flags, new_inhibit_flags); + + if (flags & INHIBIT_QUIT) + specbind (Qinhibit_quit, Qt); + + if (flags & UNINHIBIT_QUIT) + begin_do_check_for_quit (); + + if (flags & INHIBIT_GC) + begin_gc_forbidden (); + + /* #### If we have nested calls to call_trapping_problems(), and the + inner one creates some buffers/etc., should the outer one be able + to delete them? I think so, but it means we need to combine rather + than just reset the value. */ + if (flags & INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION) + internal_bind_lisp_object (&Vdeletable_permanent_display_objects, Qnil); + + if (flags & INHIBIT_EXISTING_BUFFER_TEXT_MODIFICATION) + internal_bind_lisp_object (&Vmodifiable_buffers, Qnil); + + return flags; +} + /* This is equivalent to (*fun) (arg), except that various conditions can be trapped or inhibited, according to FLAGS. @@ -4892,6 +4975,11 @@ (If FLAGS contains INHIBIT_WARNING_ISSUE, no warnings are issued; this applies to recursive invocations of call_trapping_problems, too. + If FLAGS contains POSTPONE_WARNING_ISSUE, no warnings are issued; + but values useful for generating a warning are still computed (in + particular, the backtrace), so that the calling function can issue + a warning. + If FLAGS contains ISSUE_WARNINGS_AT_DEBUG_LEVEL, warnings will be issued, but at level `debug', which normally is below the minimum specified by `log-warning-minimum-level', meaning such warnings will @@ -5010,9 +5098,10 @@ Lisp_Object (*fun) (void *), void *arg) { - int speccount = specpdl_depth(); + int speccount = specpdl_depth (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; struct call_trapping_problems package; + struct call_trapping_problems_result real_problem; Lisp_Object opaque, thrown_tag, tem; int thrown = 0; @@ -5033,37 +5122,7 @@ package.data = Qnil; package.backtrace = Qnil; - if (flags & INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY) - flags |= INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION - | INHIBIT_EXISTING_BUFFER_TEXT_MODIFICATION - | INHIBIT_ENTERING_DEBUGGER - | INHIBIT_WARNING_ISSUE - | INHIBIT_GC; - - { - int new_inhibit_flags = inhibit_flags | flags; - if (new_inhibit_flags != inhibit_flags) - internal_bind_int (&inhibit_flags, new_inhibit_flags); - } - - if (flags & INHIBIT_QUIT) - specbind (Qinhibit_quit, Qt); - - if (flags & UNINHIBIT_QUIT) - begin_do_check_for_quit (); - - if (flags & INHIBIT_GC) - begin_gc_forbidden (); - - /* #### If we have nested calls to call_trapping_problems(), and the - inner one creates some buffers/etc., should the outer one be able - to delete them? I think so, but it means we need to combine rather - than just reset the value. */ - if (flags & INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION) - internal_bind_lisp_object (&Vdeletable_permanent_display_objects, Qnil); - - if (flags & INHIBIT_EXISTING_BUFFER_TEXT_MODIFICATION) - internal_bind_lisp_object (&Vmodifiable_buffers, Qnil); + flags = set_trapping_problems_flags (flags); if (flags & (INTERNAL_INHIBIT_THROWS | INTERNAL_INHIBIT_ERRORS)) opaque = make_opaque_ptr (&package); @@ -5087,60 +5146,44 @@ /* Nothing special. */ tem = (fun) (arg); - if (thrown && !EQ (thrown_tag, package.catchtag) - && !(flags & INHIBIT_WARNING_ISSUE) - && !warning_will_be_discarded (current_warning_level ())) - { - Lisp_Object errstr; + if (!problem) + problem = &real_problem; - if (!(flags & INHIBIT_QUIT)) - /* We're no longer protected against errors or quit here, so at - least let's temporarily inhibit quit. */ - specbind (Qinhibit_quit, Qt); - errstr = - emacs_sprintf_string_lisp - ("%s: Attempt to throw outside of function " - "to catch `%s' with value `%s'", - Qnil, 3, build_msg_string (warning_string ? warning_string : "error"), - thrown_tag, tem); - - warn_when_safe_lispobj (Qerror, current_warning_level (), errstr); - } - - if (problem) - { - if (!thrown) - { - problem->caught_error = 0; - problem->caught_throw = 0; - problem->error_conditions = Qnil; - problem->data = Qnil; - problem->backtrace = Qnil; - problem->thrown_tag = Qnil; - problem->thrown_value = Qnil; - } - else if (EQ (thrown_tag, package.catchtag)) - { - problem->caught_error = 1; - problem->caught_throw = 0; - problem->error_conditions = package.error_conditions; - problem->data = package.data; - problem->backtrace = package.backtrace; - problem->thrown_tag = Qnil; - problem->thrown_value = Qnil; - } - else - { - problem->caught_error = 0; - problem->caught_throw = 1; - problem->error_conditions = Qnil; - problem->data = Qnil; - problem->backtrace = Qnil; - problem->thrown_tag = thrown_tag; - problem->thrown_value = tem; - } + if (!thrown) + { + problem->caught_error = 0; + problem->caught_throw = 0; + problem->error_conditions = Qnil; + problem->data = Qnil; + problem->backtrace = Qnil; + problem->thrown_tag = Qnil; + problem->thrown_value = Qnil; + } + else if (EQ (thrown_tag, package.catchtag)) + { + problem->caught_error = 1; + problem->caught_throw = 0; + problem->error_conditions = package.error_conditions; + problem->data = package.data; + problem->backtrace = package.backtrace; + problem->thrown_tag = Qnil; + problem->thrown_value = Qnil; + } + else + { + problem->caught_error = 0; + problem->caught_throw = 1; + problem->error_conditions = Qnil; + problem->data = Qnil; + problem->backtrace = Qnil; + problem->thrown_tag = thrown_tag; + problem->thrown_value = tem; } + if (!(flags & INHIBIT_WARNING_ISSUE) && !(flags & POSTPONE_WARNING_ISSUE)) + issue_call_trapping_problems_warning (warning_class, warning_string, + problem); + if (!NILP (package.catchtag) && !EQ (package.catchtag, Vcatch_everything_tag)) free_opaque_ptr (package.catchtag); @@ -5450,11 +5493,11 @@ } Lisp_Object -run_hook_trapping_problems (const CIbyte *warning_string, +run_hook_trapping_problems (Lisp_Object warning_class, Lisp_Object hook_symbol, int flags) { - return run_hook_with_args_trapping_problems (warning_string, 1, &hook_symbol, + return run_hook_with_args_trapping_problems (warning_class, 1, &hook_symbol, RUN_HOOKS_TO_COMPLETION, flags); } @@ -5472,9 +5515,8 @@ if an error occurs (but not a quit). */ Lisp_Object -safe_run_hook_trapping_problems (const CIbyte *warning_string, - Lisp_Object hook_symbol, - int flags) +safe_run_hook_trapping_problems (Lisp_Object warning_class, + Lisp_Object hook_symbol, int flags) { Lisp_Object tem; struct gcpro gcpro1, gcpro2; @@ -5487,14 +5529,32 @@ return Qnil; GCPRO2 (hook_symbol, tem); - tem = call_trapping_problems (Qerror, warning_string, flags, + tem = call_trapping_problems (Qerror, NULL, + flags | POSTPONE_WARNING_ISSUE, &prob, safe_run_hook_trapping_problems_1, LISP_TO_VOID (hook_symbol)); - if (prob.caught_throw || (prob.caught_error && !EQ (prob.error_conditions, - Qquit))) - Fset (hook_symbol, Qnil); - RETURN_UNGCPRO (tem); + { + Lisp_Object hook_name = XSYMBOL_NAME (hook_symbol); + Ibyte *hook_str = XSTRING_DATA (hook_name); + Ibyte *err = alloca_ibytes (XSTRING_LENGTH (hook_name) + 100); + + if (prob.caught_throw || (prob.caught_error && !EQ (prob.error_conditions, + Qquit))) + { + Fset (hook_symbol, Qnil); + qxesprintf (err, "Error in `%s' (resetting to nil)", hook_str); + } + else + qxesprintf (err, "Quit in `%s'", hook_str); + + + issue_call_trapping_problems_warning (warning_class, (CIbyte *) err, + &prob); + } + + UNGCPRO; + return tem; } struct run_hook_with_args_in_buffer_trapping_problems @@ -5519,7 +5579,7 @@ call_trapping_problems! */ Lisp_Object -run_hook_with_args_in_buffer_trapping_problems (const CIbyte *warning_string, +run_hook_with_args_in_buffer_trapping_problems (Lisp_Object warning_class, struct buffer *buf, int nargs, Lisp_Object *args, enum run_hooks_condition cond, @@ -5528,6 +5588,9 @@ Lisp_Object sym, val, ret; struct run_hook_with_args_in_buffer_trapping_problems diversity_and_distrust; struct gcpro gcpro1; + Lisp_Object hook_name; + Ibyte *hook_str; + Ibyte *err; if (!initialized || preparing_for_armageddon) /* We need to bail out of here pronto. */ @@ -5547,27 +5610,30 @@ diversity_and_distrust.args = args; diversity_and_distrust.cond = cond; + hook_name = XSYMBOL_NAME (args[0]); + hook_str = XSTRING_DATA (hook_name); + err = alloca_ibytes (XSTRING_LENGTH (hook_name) + 100); + qxesprintf (err, "Error in `%s'", hook_str); RETURN_UNGCPRO (call_trapping_problems - (Qerror, warning_string, - flags, 0, + (warning_class, (CIbyte *) err, flags, 0, run_hook_with_args_in_buffer_trapping_problems_1, &diversity_and_distrust)); } Lisp_Object -run_hook_with_args_trapping_problems (const CIbyte *warning_string, +run_hook_with_args_trapping_problems (Lisp_Object warning_class, int nargs, Lisp_Object *args, enum run_hooks_condition cond, int flags) { return run_hook_with_args_in_buffer_trapping_problems - (warning_string, current_buffer, nargs, args, cond, flags); + (warning_class, current_buffer, nargs, args, cond, flags); } Lisp_Object -va_run_hook_with_args_trapping_problems (const CIbyte *warning_string, +va_run_hook_with_args_trapping_problems (Lisp_Object warning_class, Lisp_Object hook_var, int nargs, ...) { @@ -5587,13 +5653,12 @@ GCPRO1_ARRAY (funcall_args, nargs + 1); RETURN_UNGCPRO (run_hook_with_args_in_buffer_trapping_problems - (warning_string, current_buffer, nargs + 1, funcall_args, + (warning_class, current_buffer, nargs + 1, funcall_args, RUN_HOOKS_TO_COMPLETION, flags)); } Lisp_Object -va_run_hook_with_args_in_buffer_trapping_problems (const CIbyte * - warning_string, +va_run_hook_with_args_in_buffer_trapping_problems (Lisp_Object warning_class, struct buffer *buf, Lisp_Object hook_var, int nargs, ...) @@ -5614,7 +5679,7 @@ GCPRO1_ARRAY (funcall_args, nargs + 1); RETURN_UNGCPRO (run_hook_with_args_in_buffer_trapping_problems - (warning_string, buf, nargs + 1, funcall_args, + (warning_class, buf, nargs + 1, funcall_args, RUN_HOOKS_TO_COMPLETION, flags)); } @@ -5854,7 +5919,7 @@ /* Establish an unwind-protect which will restore the int pointed to by ADDR with the value VAL. This function works correctly with all ints, even those that don't fit into a Lisp integer. */ -static int +int record_unwind_protect_restoring_int (int *addr, int val) { Lisp_Object opaque = make_opaque_ptr (addr); @@ -5930,25 +5995,47 @@ void unbind_to_hairy (int count) { - Lisp_Object oquit; - ++specpdl_ptr; ++specpdl_depth_counter; - /* Allow QUIT within unwind-protect routines, but defer any existing QUIT - until afterwards. */ - check_quit (); /* make Vquit_flag accurate */ - oquit = Vquit_flag; - Vquit_flag = Qnil; - while (specpdl_depth_counter != count) { + Lisp_Object oquit = Qunbound; + + /* Do this check BEFORE decrementing the values below, because once + they're decremented, GC protection is lost on + specpdl_ptr->old_value. */ + if (specpdl_ptr[-1].func == Fprogn) + { + /* Allow QUIT within unwind-protect routines, but defer any + existing QUIT until afterwards. Only do this, however, for + unwind-protects established by Lisp code, not by C code + (e.g. free_opaque_ptr() or something), because the act of + checking for QUIT can cause all sorts of weird things to + happen, since it churns the event loop -- redisplay, running + Lisp, etc. Code should not have to worry about this just + because of establishing an unwind-protect. */ + check_quit (); /* make Vquit_flag accurate */ + oquit = Vquit_flag; + Vquit_flag = Qnil; + } + --specpdl_ptr; --specpdl_depth_counter; + /* #### At this point, there is no GC protection on old_value. This + could be a real problem, depending on what unwind-protect function + is called. It looks like it just so happens that the ones + actually called don't have a problem with this, e.g. Fprogn. But + we should look into fixing this. (Many unwind-protect functions + free values. Is it a problem if freed values are + GC-protected?) */ if (specpdl_ptr->func != 0) - /* An unwind-protect */ - (*specpdl_ptr->func) (specpdl_ptr->old_value); + { + /* An unwind-protect */ + (*specpdl_ptr->func) (specpdl_ptr->old_value); + } + else { /* We checked symbol for validity when we specbound it, @@ -5979,8 +6066,10 @@ } #endif #endif + + if (!UNBOUNDP (oquit)) + Vquit_flag = oquit; } - Vquit_flag = oquit; check_specbind_stack_sanity (); } Index: src/event-Xt.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-Xt.c,v retrieving revision 1.74 retrieving revision 1.76 diff -u -r1.74 -r1.76 --- src/event-Xt.c 13 Feb 2003 09:57:06 -0000 1.74 +++ src/event-Xt.c 21 Feb 2003 06:56:56 -0000 1.76 @@ -56,7 +56,7 @@ #include #if defined (HAVE_XIM) && defined (XIM_MOTIF) -#include +#include "xmotif.h" #endif #ifdef HAVE_DRAGNDROP @@ -1965,18 +1965,21 @@ case Expose: if (!check_for_ignored_expose (f, event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height) + event->xexpose.width, + event->xexpose.height) && !find_matching_subwindow (f, event->xexpose.x, event->xexpose.y, event->xexpose.width, event->xexpose.height)) - x_redraw_exposed_area (f, event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height); + redisplay_redraw_exposed_area (f, event->xexpose.x, event->xexpose.y, + event->xexpose.width, + event->xexpose.height); break; case GraphicsExpose: /* This occurs when an XCopyArea's source area was obscured or not available. */ - x_redraw_exposed_area (f, event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height); + redisplay_redraw_exposed_area (f, event->xexpose.x, event->xexpose.y, + event->xexpose.width, + event->xexpose.height); break; case MapNotify: Index: src/event-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-gtk.c,v retrieving revision 1.21 retrieving revision 1.23 diff -u -r1.21 -r1.23 --- src/event-gtk.c 13 Feb 2003 09:57:06 -0000 1.21 +++ src/event-gtk.c 15 Apr 2003 17:21:36 -0000 1.23 @@ -79,7 +79,8 @@ static int tty_events_occurred; /* Mask of bits indicating the descriptors that we wait for input on */ -extern SELECT_TYPE input_wait_mask, process_only_mask, tty_only_mask; +extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask; +extern SELECT_TYPE process_only_mask, tty_only_mask; static Lisp_Object gtk_keysym_to_emacs_keysym (); void debug_process_finalization (struct Lisp_Process *p); @@ -1475,17 +1476,20 @@ return (FALSE); } -gint emacs_gtk_key_event_handler(GtkWidget *widget, GdkEventKey *event) +gint +emacs_gtk_key_event_handler (GtkWidget *widget, GdkEventKey *event) { return (generic_event_handler (widget, (GdkEvent *) event)); } -gint emacs_gtk_button_event_handler(GtkWidget *widget, GdkEventButton *event) +gint +emacs_gtk_button_event_handler (GtkWidget *widget, GdkEventButton *event) { return (generic_event_handler (widget, (GdkEvent *) event)); } -gint emacs_gtk_motion_event_handler (GtkWidget *widget, GdkEventMotion *event) +gint +emacs_gtk_motion_event_handler (GtkWidget *widget, GdkEventMotion *event) { return (generic_event_handler (widget, (GdkEvent *) event)); } @@ -1593,7 +1597,8 @@ DEFSYMBOL (Qsans_modifiers); } -void reinit_vars_of_event_gtk (void) +void +reinit_vars_of_event_gtk (void) { gtk_event_stream = xnew_and_zero (struct event_stream); gtk_event_stream->event_pending_p = emacs_gtk_event_pending_p; @@ -1652,7 +1657,8 @@ } /* Bogus utility routines */ -static const char *event_name (GdkEvent *ev) +static const char * +event_name (GdkEvent *ev) { return (gtk_event_name (ev->any.type)); } Index: src/event-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-msw.c,v retrieving revision 1.92 retrieving revision 1.94 diff -u -r1.92 -r1.94 --- src/event-msw.c 15 Feb 2003 11:20:39 -0000 1.92 +++ src/event-msw.c 9 Mar 2003 02:27:42 -0000 1.94 @@ -83,7 +83,6 @@ #ifdef HAVE_MENUBARS # include "menubar.h" -# include "menubar-msw.h" #endif #ifdef HAVE_DRAGNDROP @@ -1323,6 +1322,7 @@ static void emacs_mswindows_drain_queue (void) { + /* This can call Lisp */ mswindows_drain_windows_queue (0); #ifdef HAVE_TTY drain_tty_devices (); @@ -2173,7 +2173,7 @@ if (!check_for_ignored_expose (frame, x, y, width, height)) { hold_ignored_expose_registration = 1; - mswindows_redraw_exposed_area (frame, x, y, width, height); + redisplay_redraw_exposed_area (frame, x, y, width, height); hold_ignored_expose_registration = 0; } EndPaint (hwnd, &paintStruct); @@ -4343,6 +4343,7 @@ static int emacs_mswindows_event_pending_p (int how_many) { + /* This can call Lisp */ if (!how_many) { mswindows_need_event (0); Index: src/event-stream.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-stream.c,v retrieving revision 1.78 retrieving revision 1.81 diff -u -r1.78 -r1.81 --- src/event-stream.c 13 Feb 2003 09:57:07 -0000 1.78 +++ src/event-stream.c 2 Mar 2003 09:38:53 -0000 1.81 @@ -131,11 +131,11 @@ /* Here FSF Emacs 20.7 defines Vpost_command_idle_hook, post_command_idle_delay, Vdeferred_action_list, and Vdeferred_action_function, but we don't because that stuff is crap, - and we're smarter than them, and their momas are fat. */ + and we're smarter than them, and their mommas are fat. */ /* FSF Emacs 20.7 also defines Vinput_method_function, Qinput_method_exit_on_first_char and Qinput_method_use_echo_area. - I don't know this should be imported or not. */ + I don't know whether this should be imported or not. */ /* Non-nil disable property on a command means do not execute it; call disabled-command-hook's value instead. */ @@ -1882,6 +1882,7 @@ void event_stream_drain_queue (void) { + /* This can call Lisp */ if (event_stream && event_stream->drain_queue_cb) event_stream->drain_queue_cb (); } @@ -1890,6 +1891,7 @@ int detect_input_pending (int how_many) { + /* This can call Lisp */ Lisp_Object event; if (!NILP (Vunread_command_event)) @@ -1920,6 +1922,7 @@ */ ()) { + /* This can call Lisp */ return detect_input_pending (1) ? Qt : Qnil; } @@ -1977,6 +1980,7 @@ void event_stream_quit_p (void) { + /* This can call Lisp */ struct remove_quit_p_data data; /* Quit checking cannot happen in modal loop. Because it attempts to @@ -2173,11 +2177,11 @@ void run_pre_idle_hook (void) { + /* This can call Lisp */ if (!NILP (Vpre_idle_hook) && !detect_input_pending (1)) safe_run_hook_trapping_problems - ("Error in `pre-idle-hook' (setting hook to nil)", - Qpre_idle_hook, + (Qredisplay, Qpre_idle_hook, /* Quit is inhibited as a result of being within next-event so we need to fix that. */ INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION | UNINHIBIT_QUIT); @@ -2259,9 +2263,11 @@ #### I used to conditionalize on in_modal_loop but that fails utterly because event-msw.c specifically calls Fnext_event() inside of a modal loop to clear the dispatch queue. --ben */ +#ifdef HAVE_MENUBARS if (in_menu_callback) invalid_operation ("Attempt to call next-event inside menu callback", Qunbound); +#endif /* HAVE_MENUBARS */ PROFILE_RECORD_ENTERING_SECTION (Qnext_event); @@ -2613,6 +2619,7 @@ */ ()) { + /* This can call Lisp */ Lisp_Object concons; CONSOLE_LOOP (concons) @@ -4251,8 +4258,8 @@ last_point_position_buffer = wrap_buffer (current_buffer); /* This function can GC */ safe_run_hook_trapping_problems - ("Error in `pre-command-hook' (setting hook to nil)", - Qpre_command_hook, INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); + (Qcommand, Qpre_command_hook, + INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); /* This is a kludge, but necessary; see simple.el */ call0 (Qhandle_pre_motion_command); @@ -4296,23 +4303,8 @@ zmacs_update_region (); safe_run_hook_trapping_problems - ("Error in `post-command-hook' (setting hook to nil)", - Qpost_command_hook, INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); - -#if 0 /* FSF Emacs crap */ - if (!NILP (Vdeferred_action_list)) - call0 (Vdeferred_action_function); - - if (NILP (Vunread_command_events) - && NILP (Vexecuting_macro) - && !NILP (Vpost_command_idle_hook) - && !NILP (Fsit_for (make_float ((double) post_command_idle_delay - / 1000000), Qnil))) - safe_run_hook_trapping_problems - ("Error in `post-command-idle-hook' (setting hook to nil)", - Qpost_command_idle_hook, + (Qcommand, Qpost_command_hook, INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); -#endif /* FSF Emacs crap */ #if 0 /* FSF Emacs */ if (!NILP (current_buffer->mark_active)) Index: src/file-coding.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/file-coding.c,v retrieving revision 1.32 retrieving revision 1.35 diff -u -r1.32 -r1.35 --- src/file-coding.c 31 Jan 2003 12:02:36 -0000 1.32 +++ src/file-coding.c 9 Mar 2003 13:24:48 -0000 1.35 @@ -2,7 +2,7 @@ #### rename me to coding-system.c or coding.c Copyright (C) 1991, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -481,6 +481,8 @@ Lisp_Object Qcanonicalize_after_coding; +Lisp_Object QScoding_system_cookie; + /* This is used to convert autodetected coding systems into existing systems. For example, the chain undecided->convert-eol-autodetect may have its separate parts detected as mswindows-multibyte and @@ -3751,6 +3753,38 @@ } } +/* Look for a coding system in the string (skipping over leading + blanks). If found, return it, otherwise nil. */ + +static Lisp_Object +snarf_coding_system (const Ibyte *p, Bytecount len) +{ + Bytecount n; + Ibyte *name; + + while (*p == ' ' || *p == '\t') p++, len--; + len = min (len, 1000); + name = alloca_ibytes (len + 1); + memcpy (name, p, len); + name[len] = '\0'; + + /* Get coding system name */ + /* Characters valid in a MIME charset name (rfc 1521), + and in a Lisp symbol name. */ + n = qxestrspn (name, + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "!$%&*+-.^_{|}~"); + if (n > 0) + { + name[n] = '\0'; + return find_coding_system_for_text_file (intern_int (name), 0); + } + + return Qnil; +} + /* Given a seekable read stream and potential coding system and EOL type as specified, do any autodetection that is called for. If the coding system and/or EOL type are not `autodetect', they will be left @@ -3772,10 +3806,12 @@ return Qnil; } +/* #### This duplicates code in `find-coding-system-magic-cookie-in-file' + in files.el. Look into combining them. */ + static Lisp_Object look_for_coding_system_magic_cookie (const UExtbyte *data, Bytecount len) { - Lisp_Object coding_system = Qnil; const UExtbyte *p; const UExtbyte *scan_end; @@ -3810,30 +3846,8 @@ *(p-1) == '\t' || *(p-1) == ';'))) { - Bytecount n; - Ibyte *name; - p += LENGTH ("coding:"); - while (*p == ' ' || *p == '\t') p++; - name = alloca_ibytes (suffix - p + 1); - memcpy (name, p, suffix - p); - name[suffix - p] = '\0'; - - /* Get coding system name */ - /* Characters valid in a MIME charset name (rfc 1521), - and in a Lisp symbol name. */ - n = qxestrspn (name, - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789" - "!$%&*+-.^_{|}~"); - if (n > 0) - { - name[n] = '\0'; - coding_system = - find_coding_system_for_text_file (intern_int (name), - 0); - } + return snarf_coding_system (p, suffix - p); break; } break; @@ -3841,7 +3855,22 @@ break; } - return coding_system; +#if 0 + /* #### Totally wrong as is, rewrite */ + /* Look for initial ;;;###coding system */ + + { + Bytecount ind = fast_string_match (QScoding_system_cookie, + data, Qnil, 0, len, 0, ERROR_ME_NOT, + 1); + if (ind >= 0) + return + snarf_coding_system (data + ind + LENGTH (";;;###coding system: "), + len - ind - LENGTH (";;;###coding system: ")); + } +#endif /* 0 */ + + return Qnil; } static Lisp_Object @@ -4756,6 +4785,9 @@ /* We always have file-coding support */ Fprovide (intern ("file-coding")); + QScoding_system_cookie = build_string (";;;###coding system: "); + staticpro (&QScoding_system_cookie); + #ifdef HAVE_DEFAULT_EOL_DETECTION /* WARNING: The existing categories are intimately tied to the function `coding-system-category' in coding.el. If you change a category, or @@ -4953,15 +4985,14 @@ Fdefine_coding_system_alias (intern ("no-conversion-mac"), intern ("raw-text-mac")); - /* These four below will get their defaults set correctly in - code-init.el. We init them now so we can handle stuff at dump + /* These three below will get their defaults set correctly + in code-init.el. We init them now so we can handle stuff at dump time before we get to code-init.el. */ - Fdefine_coding_system_alias (Qfile_name, Qbinary); - Fdefine_coding_system_alias (Qnative, Qfile_name); - + Fdefine_coding_system_alias (Qnative, Qbinary); Fdefine_coding_system_alias (Qterminal, Qbinary); Fdefine_coding_system_alias (Qkeyboard, Qbinary); + Fdefine_coding_system_alias (Qfile_name, Qnative); Fdefine_coding_system_alias (Qidentity, Qconvert_eol_lf); /* Need this for bootstrapping */ Index: src/file-coding.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/file-coding.h,v retrieving revision 1.20 retrieving revision 1.22 diff -u -r1.20 -r1.22 --- src/file-coding.h 12 Jan 2003 11:08:15 -0000 1.20 +++ src/file-coding.h 24 Apr 2003 05:33:44 -0000 1.22 @@ -179,7 +179,7 @@ EOL_LF, EOL_CRLF, EOL_CR, - EOL_AUTODETECT, + EOL_AUTODETECT }; struct Lisp_Coding_System @@ -226,7 +226,7 @@ ccl_coding_system, shift_jis_coding_system, big5_coding_system, - unicode_coding_system, + unicode_coding_system }; struct coding_system_methods @@ -730,7 +730,7 @@ DET_QUITE_IMPROBABLE = -2, /* An erroneous sequence was seen. */ DET_NEARLY_IMPOSSIBLE = -3, - DET_LOWEST = -3, + DET_LOWEST = -3 }; extern int coding_detector_count; @@ -1029,7 +1029,7 @@ DECLARE_CODING_SYSTEM_TYPE (unicode); -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY DECLARE_CODING_SYSTEM_TYPE (mswindows_multibyte_to_unicode); DECLARE_CODING_SYSTEM_TYPE (mswindows_multibyte); #endif Index: src/fileio.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fileio.c,v retrieving revision 1.96 retrieving revision 1.98 diff -u -r1.96 -r1.98 --- src/fileio.c 12 Jan 2003 11:08:15 -0000 1.96 +++ src/fileio.c 2 Mar 2003 09:38:53 -0000 1.98 @@ -1,6 +1,6 @@ /* File IO for XEmacs. Copyright (C) 1985-1988, 1992-1995 Free Software Foundation, Inc. - Copyright (C) 1996, 2001, 2002 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -25,6 +25,7 @@ incomplete synching, so beware.) */ /* Mule-ized completely except for the #if 0-code including decrypt-string and encrypt-string. --ben 7-2-00 */ +/* #if 0-code Mule-ized, 2-22-03. --ben */ #include @@ -55,7 +56,7 @@ #endif /* HPUX_PRE_8_0 */ #endif /* HPUX */ -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY #define WIN32_FILENAMES #include "syswindows.h" #define IS_DRIVE(x) isalpha (x) @@ -1698,7 +1699,7 @@ If the file does not exist, STATPTR->st_mode is set to 0. */ static void -barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring, +barf_or_query_if_file_exists (Lisp_Object absname, const CIbyte *querystring, int interactive, struct stat *statptr) { /* This function can call Lisp. GC checked 2000-07-28 ben */ @@ -2193,8 +2194,8 @@ (path, login)) { int netresult; - const char *path_ext; - const char *login_ext; + const Extbyte *path_ext; + const Extbyte *login_ext; CHECK_STRING (path); CHECK_STRING (login); @@ -3667,28 +3668,31 @@ */ (string, key)) { - char *encrypted_string, *raw_key; - int rounded_size, extra, key_size; + Extbyte *encrypted_string, *raw_key; + Extbyte *string_ext, *key_ext; + Bytecount string_size_ext, key_size_ext, rounded_size, extra, key_size; - /* !!#### May produce bogus data under Mule. */ CHECK_STRING (string); CHECK_STRING (key); - extra = XSTRING_LENGTH (string) % CRYPT_BLOCK_SIZE; - rounded_size = XSTRING_LENGTH (string) + extra; + LISP_STRING_TO_SIZED_EXTERNAL (string, string_ext, string_size_ext, Qbinary); + LISP_STRING_TO_SIZED_EXTERNAL (key, key_ext, key_size_ext, Qbinary); + + extra = string_size_ext % CRYPT_BLOCK_SIZE; + rounded_size = string_size_ext + extra; encrypted_string = ALLOCA (rounded_size + 1); - memcpy (encrypted_string, XSTRING_DATA (string), XSTRING_LENGTH (string)); + memcpy (encrypted_string, string_ext, string_size_ext); memset (encrypted_string + rounded_size - extra, 0, extra + 1); - key_size = min (CRYPT_KEY_SIZE, XSTRING_LENGTH (key)) + key_size = min (CRYPT_KEY_SIZE, key_size_ext); raw_key = ALLOCA (CRYPT_KEY_SIZE + 1); - memcpy (raw_key, XSTRING_DATA (key), key_size); + memcpy (raw_key, key_ext, key_size); memset (raw_key + key_size, 0, (CRYPT_KEY_SIZE + 1) - key_size); ecb_crypt (raw_key, encrypted_string, rounded_size, DES_ENCRYPT | DES_SW); - return make_string (encrypted_string, rounded_size); + return make_ext_string (encrypted_string, rounded_size, Qbinary); } DEFUN ("decrypt-string", Fdecrypt_string, 2, 2, 0, /* @@ -3696,27 +3700,30 @@ */ (string, key)) { - /* !!#### May produce bogus data under Mule. */ - char *decrypted_string, *raw_key; - int string_size, key_size; + Extbyte *decrypted_string, *raw_key; + Extbyte *string_ext, *key_ext; + Bytecount string_size_ext, key_size_ext, string_size, key_size; CHECK_STRING (string); CHECK_STRING (key); - string_size = XSTRING_LENGTH (string) + 1; + LISP_STRING_TO_SIZED_EXTERNAL (string, string_ext, string_size_ext, Qbinary); + LISP_STRING_TO_SIZED_EXTERNAL (key, key_ext, key_size_ext, Qbinary); + + string_size = string_size_ext + 1; decrypted_string = ALLOCA (string_size); - memcpy (decrypted_string, XSTRING_DATA (string), string_size); + memcpy (decrypted_string, string_ext, string_size); decrypted_string[string_size - 1] = '\0'; - key_size = min (CRYPT_KEY_SIZE, XSTRING_LENGTH (key)) + key_size = min (CRYPT_KEY_SIZE, key_size_ext); raw_key = ALLOCA (CRYPT_KEY_SIZE + 1); - memcpy (raw_key, XSTRING_DATA (key), key_size); + memcpy (raw_key, key_ext, key_size); memset (raw_key + key_size, 0, (CRYPT_KEY_SIZE + 1) - key_size); ecb_crypt (raw_key, decrypted_string, string_size, D | DES_SW); - return make_string (decrypted_string, string_size - 1); + return make_ext_string (decrypted_string, string_size - 1, Qbinary); } #endif /* 0 */ @@ -4040,10 +4047,9 @@ set_buffer_internal (b); if (!auto_saved && NILP (no_message)) { - static const unsigned char *msg - = (const unsigned char *) "Auto-saving..."; + static const Ibyte *msg = (const Ibyte *) "Auto-saving..."; echo_area_message (selected_frame (), msg, Qnil, - 0, strlen ((const char *) msg), + 0, qxestrlen (msg), Qauto_saving); } @@ -4150,10 +4156,9 @@ if (auto_saved && NILP (no_message) && NILP (clear_echo_area (selected_frame (), Qauto_saving, 0))) { - static const unsigned char *msg - = (const unsigned char *)"Auto-saving...done"; + static const Ibyte *msg = (const Ibyte *)"Auto-saving...done"; echo_area_message (selected_frame (), msg, Qnil, 0, - strlen ((const char *) msg), Qauto_saving); + qxestrlen (msg), Qauto_saving); } Vquit_flag = oquit; Index: src/frame-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-gtk.c,v retrieving revision 1.11 retrieving revision 1.13 diff -u -r1.11 -r1.13 --- src/frame-gtk.c 12 Jan 2003 11:08:15 -0000 1.11 +++ src/frame-gtk.c 9 Mar 2003 02:27:42 -0000 1.13 @@ -1,6 +1,6 @@ /* Functions for the X window system. Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc. - Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -67,7 +67,6 @@ /* Default properties to use when creating frames. */ Lisp_Object Vdefault_gtk_frame_plist; -Lisp_Object Qwindow_id; Lisp_Object Qdetachable_menubar; Lisp_Object Qtext_widget; Lisp_Object Qcontainer_widget; @@ -99,6 +98,7 @@ { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap_mask) }, { XD_LISP_OBJECT_ARRAY, offsetof (struct gtk_frame, lisp_visible_widgets), 3 }, + { XD_LISP_OBJECT, offsetof (struct gtk_frame, menubar_data) }, { XD_END } }; @@ -943,12 +943,17 @@ static void allocate_gtk_frame_struct (struct frame *f) { + int i; + /* zero out all slots. */ f->frame_data = xnew_and_zero (struct gtk_frame); /* yeah, except the lisp ones */ FRAME_GTK_ICON_PIXMAP (f) = Qnil; FRAME_GTK_ICON_PIXMAP_MASK (f) = Qnil; + FRAME_GTK_MENUBAR_DATA (f) = Qnil; + for (i = 0; i < 3; i++) + FRAME_GTK_LISP_WIDGETS (f)[i] = Qnil; } @@ -1032,6 +1037,7 @@ { mark_object (FRAME_GTK_ICON_PIXMAP (f)); mark_object (FRAME_GTK_ICON_PIXMAP_MASK (f)); + mark_object (FRAME_GTK_MENUBAR_DATA (f)); mark_object (FRAME_GTK_LISP_WIDGETS (f)[0]); mark_object (FRAME_GTK_LISP_WIDGETS (f)[1]); mark_object (FRAME_GTK_LISP_WIDGETS (f)[2]); @@ -1404,7 +1410,6 @@ void syms_of_frame_gtk (void) { - DEFSYMBOL (Qwindow_id); DEFSYMBOL (Qtext_widget); DEFSYMBOL (Qcontainer_widget); DEFSYMBOL (Qshell_widget); Index: src/frame-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-msw.c,v retrieving revision 1.50 retrieving revision 1.52 diff -u -r1.50 -r1.52 --- src/frame-msw.c 12 Jan 2003 11:08:16 -0000 1.50 +++ src/frame-msw.c 31 Mar 2003 08:13:20 -0000 1.52 @@ -337,10 +337,17 @@ mswindows_set_frame_size (struct frame *f, int width, int height) { RECT rect; + int columns, rows; + rect.left = rect.top = 0; rect.right = width; rect.bottom = height; + pixel_to_char_size (f, rect.right, rect.bottom, &columns, &rows); + change_frame_size (f, rows, columns, 0); + + /* This can call Lisp, because it runs the window procedure, which can + call redisplay() */ AdjustWindowRectEx (&rect, qxeGetWindowLong (FRAME_MSWINDOWS_HANDLE (f), GWL_STYLE), GetMenu (FRAME_MSWINDOWS_HANDLE (f)) != NULL, Index: src/frame-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-x.c,v retrieving revision 1.59 retrieving revision 1.61 diff -u -r1.59 -r1.61 --- src/frame-x.c 12 Jan 2003 11:08:16 -0000 1.59 +++ src/frame-x.c 9 Mar 2003 02:27:43 -0000 1.61 @@ -67,10 +67,10 @@ /* Default properties to use when creating frames. */ Lisp_Object Vdefault_x_frame_plist; -Lisp_Object Qwindow_id; Lisp_Object Qx_resource_name; static const struct memory_description x_frame_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct x_frame, last_menubar_buffer) }, { XD_LISP_OBJECT, offsetof (struct x_frame, icon_pixmap) }, { XD_LISP_OBJECT, offsetof (struct x_frame, icon_pixmap_mask) }, { XD_END } @@ -2120,6 +2120,7 @@ f->frame_data = xnew_and_zero (struct x_frame); /* yeah, except the lisp ones */ + FRAME_X_LAST_MENUBAR_BUFFER (f) = Qnil; FRAME_X_ICON_PIXMAP (f) = Qnil; FRAME_X_ICON_PIXMAP_MASK (f) = Qnil; } @@ -2195,6 +2196,7 @@ static void x_mark_frame (struct frame *f) { + mark_object (FRAME_X_LAST_MENUBAR_BUFFER (f)); mark_object (FRAME_X_ICON_PIXMAP (f)); mark_object (FRAME_X_ICON_PIXMAP_MASK (f)); } @@ -2757,7 +2759,6 @@ void syms_of_frame_x (void) { - DEFSYMBOL (Qwindow_id); DEFSYMBOL (Qx_resource_name); DEFSUBR (Fx_window_id); Index: src/frame.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame.c,v retrieving revision 1.59 retrieving revision 1.62 diff -u -r1.59 -r1.62 --- src/frame.c 12 Jan 2003 11:08:16 -0000 1.59 +++ src/frame.c 24 Apr 2003 05:33:44 -0000 1.62 @@ -1,6 +1,6 @@ /* Generic frame functions. Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. Copyright (C) 1995 Sun Microsystems, Inc. This file is part of XEmacs. @@ -123,7 +123,7 @@ DISPLAYABLE_PIXEL_TO_CHAR, TOTAL_PIXEL_TO_CHAR, CHAR_TO_TOTAL_PIXEL, - CHAR_TO_DISPLAYABLE_PIXEL, + CHAR_TO_DISPLAYABLE_PIXEL } pixel_to_char_mode_t; static void frame_conversion_internal (struct frame *f, @@ -705,70 +705,6 @@ } -#ifdef ERROR_CHECK_TRAPPING_PROBLEMS - -static Lisp_Object -commit_ritual_suicide (Lisp_Object ceci_nest_pas_une_pipe) -{ - assert (!in_display); - return Qnil; -} - -#endif - -/* - * window size changes are held up during critical regions. Afterwards, - * we want to deal with any delayed changes. - */ -int -enter_redisplay_critical_section (void) -{ - int depth = specpdl_depth (); - - /* NOTE NOTE NOTE: Inside the redisplay critical section, every place - that could QUIT or call Lisp code needs to be wrapped, since GC - or a non-local exit will be fatal. The way to do this is with - call_trapping_problems(..., INHIBIT_GC), or the like. */ - -#ifdef ERROR_CHECK_TRAPPING_PROBLEMS - /* Force every call to QUIT to check for in_displayness. This will - verify proper wrapping, as in the previous comment, aborting if not. */ - something_happened++; - record_unwind_protect (commit_ritual_suicide, Qnil); -#endif - begin_gc_forbidden (); - in_display = 1; - - return depth; -} - -void -exit_redisplay_critical_section (int depth) -{ - Lisp_Object frmcons, devcons, concons; - - in_display = 0; - - unbind_to (depth); -#ifdef ERROR_CHECK_TRAPPING_PROBLEMS - something_happened--; -#endif - - /* we used to have a function to do this for only one frame, and - it was typical to call it at the end of a critical section - (which occurs once per frame); but what then happens if multiple - frames have frame changes held up? - - this means we are O(N^2) over frames. i seriously doubt it matters. - --ben */ - FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) - { - struct frame *f = XFRAME (XCAR (frmcons)); - if (f->size_change_pending) - change_frame_size (f, f->new_height, f->new_width, 0); - } -} - void invalidate_vertical_divider_cache_in_frame (struct frame *f) { @@ -785,10 +721,10 @@ void adjust_frame_size (struct frame *f) { + /* This can call Lisp. */ int keep_char_size = 0; Lisp_Object frame = wrap_frame (f); - if (!f->size_slipped) return; @@ -1459,6 +1395,7 @@ Lisp_Object device; Lisp_Object console; struct gcpro gcpro1; + int depth; /* OK to delete an already deleted frame. */ if (!FRAME_LIVE_P (f)) @@ -1682,6 +1619,10 @@ /* After this point, no errors must be allowed to occur. */ + /* Checking for QUIT can run all sorts of weird code and may be deadly + so don't let it happen. */ + depth = begin_dont_check_for_quit (); + #ifdef HAVE_MENUBARS free_frame_menubars (f); #endif @@ -1822,6 +1763,8 @@ note_object_deleted (frame); + unbind_to (depth); + UNGCPRO; } @@ -2309,9 +2252,9 @@ static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val) { + /* This can call Lisp. */ Lisp_Object frame = wrap_frame (f); - if (WINDOWP (val)) { if (! MINI_WINDOW_P (XWINDOW (val))) @@ -2498,6 +2441,7 @@ */ (frame, plist)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); Lisp_Object tail; Lisp_Object *tailp; @@ -2809,8 +2753,9 @@ static void internal_set_frame_size (struct frame *f, int cols, int rows, int pretend) { + /* This can call Lisp. See mswindows_set_frame_size(). */ /* An explicit size change cancels any pending frame size adjustment */ - CLEAR_FRAME_SIZE_SLIPPED(f); + CLEAR_FRAME_SIZE_SLIPPED (f); if (pretend || !HAS_FRAMEMETH_P (f, set_frame_size)) change_frame_size (f, rows, cols, 0); @@ -2825,6 +2770,7 @@ */ (frame, lines, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int height, width; frame = wrap_frame (f); @@ -2852,6 +2798,7 @@ */ (frame, height, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int pheight, width; frame = wrap_frame (f); @@ -2881,6 +2828,7 @@ */ (frame, height, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int pheight, width; frame = wrap_frame (f); @@ -2910,6 +2858,7 @@ */ (frame, cols, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int width, height; frame = wrap_frame (f); @@ -2937,6 +2886,7 @@ */ (frame, width, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int height, pwidth; frame = wrap_frame (f); @@ -2965,6 +2915,7 @@ */ (frame, width, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int height, pwidth; frame = wrap_frame (f); @@ -2993,6 +2944,7 @@ */ (frame, cols, rows, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int height, width; frame = wrap_frame (f); @@ -3018,6 +2970,7 @@ */ (frame, width, height, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int pheight, pwidth; frame = wrap_frame (f); @@ -3047,6 +3000,7 @@ */ (frame, width, height, pretend)) { + /* This can call Lisp. */ struct frame *f = decode_frame (frame); int pheight, pwidth; frame = wrap_frame (f); @@ -3257,7 +3211,7 @@ update code relies on this function to cause window `top' and `left' coordinates to be recomputed even though no frame size change occurs. --kyle */ - if (in_display) + if (in_display || hold_frame_size_changes) abort (); frame = wrap_frame (f); @@ -3432,7 +3386,7 @@ --andy. */ MARK_FRAME_SIZE_CHANGED (f); - if (delay || in_display || gc_in_progress) + if (delay || hold_frame_size_changes || gc_in_progress) { f->new_width = newwidth; f->new_height = newheight; Index: src/frame.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- src/frame.h 20 Jun 2002 21:18:33 -0000 1.28 +++ src/frame.h 21 Feb 2003 06:56:57 -0000 1.29 @@ -138,8 +138,6 @@ void adjust_frame_size (struct frame *frame); void frame_size_slipped (Lisp_Object specifier, struct frame *f, Lisp_Object oldval); -int enter_redisplay_critical_section (void); -void exit_redisplay_critical_section (int); void select_frame_1 (Lisp_Object frame); void select_frame_2 (Lisp_Object frame); struct frame *selected_frame (void); Index: src/frameslots.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frameslots.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/frameslots.h 12 Jan 2003 11:08:16 -0000 1.8 +++ src/frameslots.h 9 Mar 2003 02:27:43 -0000 1.9 @@ -1,6 +1,6 @@ /* Definitions of marked slots in frames Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996, 2002 Ben Wing. + Copyright (C) 1996, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -117,11 +117,6 @@ /* The current icon for the frame. */ MARKED_SLOT (icon) - -#ifdef HAVE_MENUBARS - /* Vector representing the menubar currently displayed. See menubar-x.c. */ - MARKED_SLOT (menubar_data) -#endif /* specifier values cached in the struct frame: */ Index: src/general-slots.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/general-slots.h,v retrieving revision 1.10 retrieving revision 1.12 diff -u -r1.10 -r1.12 --- src/general-slots.h 6 Jul 2002 05:48:21 -0000 1.10 +++ src/general-slots.h 2 Mar 2003 09:38:53 -0000 1.12 @@ -1,6 +1,6 @@ /* Commonly-used symbols -- include file Copyright (C) 1995 Sun Microsystems. - Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -63,6 +63,7 @@ SYMBOL (Qbottom); SYMBOL (Qbottom_margin); SYMBOL (Qbuffer); +SYMBOL (Qbuffers); SYMBOL (Qbuilt_in); SYMBOL (Qbutton); SYMBOL_KEYWORD (Q_buttons); @@ -72,6 +73,7 @@ SYMBOL (Qcategory); SYMBOL (Qcenter); SYMBOL (Qchain); +SYMBOL (Qchange); SYMBOL (Qchannel); SYMBOL (Qchar); SYMBOL (Qcharacter); @@ -99,6 +101,7 @@ SYMBOL (Qdescription); SYMBOL_KEYWORD (Q_descriptor); SYMBOL (Qdevice); +SYMBOL (Qdevices); SYMBOL_KEYWORD (Q_device); SYMBOL (Qdialog); SYMBOL (Qdirectory); @@ -118,17 +121,20 @@ SYMBOL (Qextents); SYMBOL (Qexternal); SYMBOL (Qface); +SYMBOL (Qfaces); SYMBOL (Qfallback); SYMBOL (Qfile); SYMBOL (Qfile_name); SYMBOL_KEYWORD (Q_filter); SYMBOL (Qfont); SYMBOL (Qframe); +SYMBOL (Qframes); SYMBOL (Qfrom_page); SYMBOL (Qfull_assoc); SYMBOL (Qfuncall); SYMBOL (Qfunction); SYMBOL (Qgap_overhead); +SYMBOL (Qgarbage_collection); SYMBOL (Qgeneric); SYMBOL (Qgeometry); SYMBOL (Qglobal); @@ -225,6 +231,7 @@ SYMBOL (Qradio); SYMBOL (Qrassoc); SYMBOL (Qrassq); +SYMBOL (Qredisplay); SYMBOL (Qremove_all); SYMBOL (Qrequire); SYMBOL (Qresource); @@ -280,6 +287,8 @@ SYMBOL (Qwidth); SYMBOL_KEYWORD (Q_width); SYMBOL (Qwindow); +SYMBOL (Qwindows); +SYMBOL (Qwindow_id); SYMBOL (Qwindow_system); SYMBOL (Qx); SYMBOL (Qy); Index: src/getloadavg.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/getloadavg.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/getloadavg.c 29 Aug 2002 19:45:30 -0000 1.17 +++ src/getloadavg.c 20 Feb 2003 08:19:42 -0000 1.18 @@ -750,7 +750,7 @@ : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); #endif /* OSF_MIPS */ -#if !defined (LDAV_DONE) && (defined (WIN32_NATIVE) || defined (CYGWIN)) +#if !defined (LDAV_DONE) && defined (WIN32_ANY) #define LDAV_DONE /* A faithful emulation is going to have to be saved for a rainy day. */ Index: src/glyphs-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-gtk.c,v retrieving revision 1.16 retrieving revision 1.18 diff -u -r1.16 -r1.18 --- src/glyphs-gtk.c 20 Jun 2002 21:18:33 -0000 1.16 +++ src/glyphs-gtk.c 9 Mar 2003 02:27:43 -0000 1.18 @@ -65,7 +65,6 @@ #include "console-gtk-impl.h" #include "glyphs-gtk.h" -#include "gui-gtk.h" #include "objects-gtk-impl.h" #include "ui-gtk.h" @@ -2452,7 +2451,7 @@ LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) { - if (gui_item_equal_sans_selected (XCAR (rest), selected, 0)) + if (gui_item_equal_sans_selected (XCAR (rest), selected, 0, 1)) { Lisp_Object old_selected =gui_item_list_find_selected (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); @@ -2494,17 +2493,21 @@ char *c_name = NULL; if (!STRINGP (pgui->name)) - pgui->name = Feval (pgui->name); + pgui->name = eval_within_redisplay (pgui->name); - CHECK_STRING (pgui->name); - - TO_EXTERNAL_FORMAT (LISP_STRING, pgui->name, - C_STRING_ALLOCA, c_name, - Qctext); - - gtk_notebook_append_page (nb, - gtk_vbox_new (FALSE, 3), - gtk_label_new (c_name)); + if (!STRINGP (pgui->name)) + warn_when_safe (Qredisplay, Qwarning, + "Name does not evaluate to string"); + else + { + TO_EXTERNAL_FORMAT (LISP_STRING, pgui->name, + C_STRING_ALLOCA, c_name, + Qctext); + + gtk_notebook_append_page (nb, + gtk_vbox_new (FALSE, 3), + gtk_label_new (c_name)); + } } /* Show all the new widgets we just added... */ Index: src/glyphs-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-msw.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- src/glyphs-msw.c 12 Jan 2003 11:08:16 -0000 1.46 +++ src/glyphs-msw.c 21 Feb 2003 06:56:58 -0000 1.47 @@ -1,6 +1,6 @@ /* mswindows-specific glyph objects. Copyright (C) 1998, 1999, 2000 Andy Piper. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -2039,7 +2039,7 @@ if (CONSP (item)) item = XCAR (item); - if (gui_item_active_p (item)) + if (gui_item_active_p (item, 1)) qxeSetWindowLong (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), GWL_STYLE, style & ~WS_DISABLED); else @@ -2230,7 +2230,7 @@ CHECK_MSWINDOWS_DEVICE (device); - if (!gui_item_active_p (gui)) + if (!gui_item_active_p (gui, 0)) flags |= WS_DISABLED; style = pgui->style; @@ -2375,7 +2375,7 @@ wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* set the checked state */ - if (gui_item_selected_p (gui)) + if (gui_item_selected_p (gui, 0)) qxeSendMessage (wnd, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); else qxeSendMessage (wnd, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); @@ -2401,7 +2401,7 @@ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); /* buttons checked or otherwise */ - if (gui_item_selected_p (IMAGE_INSTANCE_WIDGET_ITEM (ii))) + if (gui_item_selected_p (IMAGE_INSTANCE_WIDGET_ITEM (ii), 1)) qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), BM_SETCHECK, (WPARAM)BST_CHECKED, 0); else @@ -2643,7 +2643,7 @@ { int idx = add_tab_item (image_instance, wnd, XCAR (rest), domain, i); assert (idx == i); - if (gui_item_selected_p (XCAR (rest))) + if (gui_item_selected_p (XCAR (rest), 0)) selected = i; i++; } @@ -2657,7 +2657,8 @@ /* This function can GC if IN_REDISPLAY is false. */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); #ifdef DEBUG_WIDGET_OUTPUT - stderr_out ("tab control %p redisplayed\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); + stderr_out ("tab control %p redisplayed\n", + IMAGE_INSTANCE_SUBWINDOW_ID (ii)); #endif if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) || @@ -2682,9 +2683,10 @@ LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) { - if (gui_item_equal_sans_selected (XCAR (rest), selected, 0)) + if (gui_item_equal_sans_selected (XCAR (rest), selected, 0, 1)) { - Lisp_Object old_selected = gui_item_list_find_selected + Lisp_Object old_selected = + gui_item_list_find_selected (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); /* Pick up the new selected item. */ @@ -2699,7 +2701,7 @@ qxeSendMessage (wnd, TCM_SETCURSEL, i, 0); #ifdef DEBUG_WIDGET_OUTPUT stderr_out ("tab control %p selected item %d\n", - IMAGE_INSTANCE_SUBWINDOW_ID (ii), i); + IMAGE_INSTANCE_SUBWINDOW_ID (ii), i); #endif break; } @@ -2716,7 +2718,7 @@ { add_tab_item (image_instance, wnd, XCAR (rest), IMAGE_INSTANCE_FRAME (ii), i); - if (gui_item_selected_p (XCAR (rest))) + if (gui_item_selected_p (XCAR (rest), 1)) selected_idx = i; i++; } Index: src/glyphs-widget.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-widget.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/glyphs-widget.c 24 Oct 2002 14:19:36 -0000 1.12 +++ src/glyphs-widget.c 21 Feb 2003 06:56:58 -0000 1.13 @@ -1,5 +1,6 @@ /* Widget-specific glyph objects. Copyright (C) 1998, 1999, 2000, 2002 Andy Piper. + Copyright (C) 2003 Ben Wing. This file is part of XEmacs. @@ -670,7 +671,8 @@ #### should just normalize the data. */ if (!NILP (glyph)) { - substitute_keyword_value (inst, Q_image, glyph_instantiator_to_glyph (glyph)); + substitute_keyword_value (inst, Q_image, + glyph_instantiator_to_glyph (glyph)); } return inst; @@ -989,8 +991,10 @@ } /* Determine whether only the order has changed for a tab. */ -int tab_control_order_only_changed (Lisp_Object image_instance) +int +tab_control_order_only_changed (Lisp_Object image_instance) { + /* Called within redisplay */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); int found = 0, len, pending_len; Lisp_Object rest; @@ -1013,7 +1017,7 @@ XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))) { if (gui_item_equal_sans_selected (XCAR (rest), - XCAR (pending_rest), 0)) + XCAR (pending_rest), 0, 1)) { found = 1; break; @@ -1362,49 +1366,51 @@ /* Work out minimum space we need to fit all the items. This could have been fixed by the user. */ - if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii)) { + if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii)) + { if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii))) - { + { Lisp_Object dynamic_width = - Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); + eval_within_redisplay (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); if (INTP (dynamic_width)) - *width = XINT (dynamic_width); - } + *width = XINT (dynamic_width); + } else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL) - { + { *width = maxpw + ((nitems + 1) * widget_instance_border_width (ii) + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2; - } + } else - { + { *width = maxpw + 2 * (widget_instance_border_width (ii) * 2 + IMAGE_INSTANCE_MARGIN_WIDTH (ii)); - } + } } /* Work out vertical spacings. */ - if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii)) { + if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii)) + { if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii))) - { + { Lisp_Object dynamic_height = - Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); + eval_within_redisplay (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); if (INTP (dynamic_height)) - *height = XINT (dynamic_height); - } + *height = XINT (dynamic_height); + } else if (IMAGE_INSTANCE_SUBWINDOW_LOGICAL_LAYOUT (ii)) - { + { *height = nitems * luh + ph_adjust; - } + } else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_VERTICAL) - { + { *height = maxph + ((nitems + 1) * widget_instance_border_width (ii) + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; - } + } else - { + { *height = maxph + (2 * widget_instance_border_width (ii) + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; - } + } } #ifdef DEBUG_WIDGET_OUTPUT stderr_out ("layout wants %dx%d\n", *width, *height); Index: src/glyphs-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-x.c,v retrieving revision 1.72 retrieving revision 1.75 diff -u -r1.72 -r1.75 --- src/glyphs-x.c 12 Jan 2003 11:08:16 -0000 1.72 +++ src/glyphs-x.c 9 Mar 2003 02:27:43 -0000 1.75 @@ -2,7 +2,7 @@ Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Tinker Systems - Copyright (C) 1995, 1996, 2001, 2002 Ben Wing + Copyright (C) 1995, 1996, 2001, 2002, 2003 Ben Wing Copyright (C) 1995 Sun Microsystems Copyright (C) 1999, 2000, 2002 Andy Piper @@ -69,9 +69,6 @@ #include "console-x-impl.h" #include "glyphs-x.h" -#ifdef HAVE_X_WIDGETS -#include "gui-x.h" -#endif #include "objects-x-impl.h" #include "xmu.h" @@ -81,7 +78,7 @@ #include #ifdef LWLIB_WIDGETS_MOTIF -#include +#include "xmotif.h" #include #endif #include @@ -2202,9 +2199,9 @@ } /* now modify the widget */ - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), - wv, True); + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), wv, True); free_widget_value_tree (wv); + gcpro_popup_callbacks (IMAGE_INSTANCE_X_WIDGET_LWID (p)); #endif } @@ -2466,7 +2463,8 @@ /* update the font. */ update_widget_face (wv, ii, domain); - wid = lw_create_widget (type, wv->name, id, wv, IMAGE_INSTANCE_X_CLIPWIDGET (ii), + wid = lw_create_widget (type, wv->name, id, wv, + IMAGE_INSTANCE_X_CLIPWIDGET (ii), False, 0, popup_selection_callback, 0); IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)wid; @@ -2545,7 +2543,8 @@ int ac =0; #ifdef LWLIB_WIDGETS_MOTIF XtSetArg (al [ac], XmNlabelType, XmPIXMAP); ac++; - XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));ac++; + XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); + ac++; #else XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++; #endif @@ -2572,9 +2571,9 @@ IMAGE_INSTANCE_WIDGET_ITEMS (p), 1); /* now modify the widget */ - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), - wv, True); + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), wv, True); free_widget_value_tree (wv); + gcpro_popup_callbacks (IMAGE_INSTANCE_X_WIDGET_LWID (p)); } /* get properties of a button */ @@ -2597,9 +2596,10 @@ /* instantiate a progress gauge */ static void -x_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) +x_progress_gauge_instantiate (Lisp_Object image_instance, + Lisp_Object instantiator, + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); @@ -2662,7 +2662,8 @@ #endif static void -x_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, +x_tab_control_instantiate (Lisp_Object image_instance, + Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { @@ -2682,8 +2683,7 @@ { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) - || + if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) || IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii)) { /* If only the order has changed then simply select the first @@ -2700,11 +2700,12 @@ LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) { - if (gui_item_equal_sans_selected (XCAR (rest), selected, 0)) + if (gui_item_equal_sans_selected (XCAR (rest), selected, 0, 1)) { /* There may be an encapsulated way of doing this, but I couldn't find it. */ - Lisp_Object old_selected =gui_item_list_find_selected + Lisp_Object old_selected = + gui_item_list_find_selected (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); Arg al [1]; char* name; @@ -2715,8 +2716,9 @@ name, Qnative); /* The name may contain a `.' which confuses XtNameToWidget, so we do it ourselves. */ - children = XtCompositeChildren (IMAGE_INSTANCE_X_WIDGET_ID (ii), - &num_children); + children = + XtCompositeChildren (IMAGE_INSTANCE_X_WIDGET_ID (ii), + &num_children); for (i = 0; i < num_children; i++) { if (!strcmp (XtName (children [i]), name)) @@ -2761,6 +2763,7 @@ lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, True); free_widget_value_tree (wv); + gcpro_popup_callbacks (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); } } Index: src/glyphs.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- src/glyphs.c 12 Jan 2003 11:08:16 -0000 1.43 +++ src/glyphs.c 14 Apr 2003 04:11:57 -0000 1.44 @@ -2327,8 +2327,18 @@ Lisp_Object string = find_keyword_in_vector (instantiator, Q_data); Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + assert (!NILP (string)); + /* Should never get here with a domain other than a window. */ - assert (!NILP (string) && WINDOWP (DOMAIN_WINDOW (domain))); +#ifndef NDEBUG + /* Work Around for an Intel Compiler 7.0 internal error */ + /* assert (WINDOWP (DOMAIN_WINDOW (domain))); internal error: 0_5086 */ + { + Lisp_Object w = DOMAIN_WINDOW (domain); + assert (WINDOWP (w)); + } +#endif + if (dest_mask & IMAGE_TEXT_MASK) { IMAGE_INSTANCE_TYPE (ii) = IMAGE_TEXT; @@ -3957,6 +3967,22 @@ return instance; } +inline static int +image_instance_needs_layout (Lisp_Object instance) +{ + Lisp_Image_Instance *ii = XIMAGE_INSTANCE (instance); + + if (IMAGE_INSTANCE_DIRTYP (ii) && IMAGE_INSTANCE_LAYOUT_CHANGED (ii)) + { + return 1; + } + else + { + Lisp_Object iif = IMAGE_INSTANCE_FRAME (ii); + return FRAMEP (iif) && XFRAME (iif)->size_changed; + } +} + /***************************************************************************** glyph_width @@ -3972,7 +3998,7 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) + if (image_instance_needs_layout (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNCHANGED_GEOMETRY, @@ -4002,7 +4028,7 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) + if (image_instance_needs_layout (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNCHANGED_GEOMETRY, @@ -4022,7 +4048,7 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) + if (image_instance_needs_layout (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNCHANGED_GEOMETRY, @@ -4044,7 +4070,7 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) + if (image_instance_needs_layout (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNCHANGED_GEOMETRY, Index: src/gtk-xemacs.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gtk-xemacs.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/gtk-xemacs.c 12 Jan 2003 11:08:17 -0000 1.8 +++ src/gtk-xemacs.c 21 Feb 2003 06:56:58 -0000 1.9 @@ -298,7 +298,8 @@ { GtkXEmacs *x = GTK_XEMACS (widget); struct frame *f = GTK_XEMACS_FRAME (x); - gtk_redraw_exposed_area (f, area->x, area->y, area->width, area->height); + redisplay_redraw_exposed_area (f, area->x, area->y, area->width, + area->height); } static void @@ -355,7 +356,7 @@ /* Now draw the actual frame data */ if (!check_for_ignored_expose (f, a->x, a->y, a->width, a->height) && !find_matching_subwindow (f, a->x, a->y, a->width, a->height)) - gtk_redraw_exposed_area (f, a->x, a->y, a->width, a->height); + redisplay_redraw_exposed_area (f, a->x, a->y, a->width, a->height); return (TRUE); } Index: src/gui-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui-gtk.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/gui-gtk.c 20 Jun 2002 21:18:35 -0000 1.4 +++ src/gui-gtk.c 9 Mar 2003 02:27:43 -0000 1.5 @@ -33,7 +33,6 @@ #include "opaque.h" #include "console-gtk-impl.h" -#include "gui-gtk.h" #ifdef HAVE_POPUPS Lisp_Object Qmenu_no_selection_hook; Index: src/gui-gtk.h =================================================================== RCS file: src/gui-gtk.h diff -N src/gui-gtk.h --- src/gui-gtk.h 12 Apr 2001 18:23:54 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ -/* General GUI code -- X-specific header file. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996 Ben Wing. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -#ifndef _XEMACS_GUI_GTK_H_ -#define _XEMACS_GUI_GTK_H_ - -#include - -typedef unsigned int GUI_ID; -extern GUI_ID new_gui_id (void); - -extern void gcpro_popup_callbacks (GUI_ID id, Lisp_Object data); -extern void ungcpro_popup_callbacks (GUI_ID id); -extern Lisp_Object get_gcpro_popup_callbacks (GUI_ID id); - -#endif /* _XEMACS_GUI_GTK_H_ */ Index: src/gui-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui-x.c,v retrieving revision 1.31 retrieving revision 1.33 diff -u -r1.31 -r1.33 --- src/gui-x.c 6 Feb 2003 06:36:03 -0000 1.31 +++ src/gui-x.c 9 Mar 2003 02:27:43 -0000 1.33 @@ -39,10 +39,9 @@ #include "redisplay.h" #include "console-x-impl.h" -#include "gui-x.h" #ifdef LWLIB_USES_MOTIF -#include /* for XmVersion */ +#include "xmotif.h" /* for XmVersion */ #endif /* we need a unique id for each popup menu, dialog box, and scrollbar */ @@ -51,7 +50,10 @@ LWLIB_ID new_lwlib_id (void) { - return ++lwlib_id_tick; + lwlib_id_tick++; + if (!lwlib_id_tick) + lwlib_id_tick++; + return lwlib_id_tick; } widget_value * @@ -63,93 +65,75 @@ } -static Lisp_Object -mark_popup_data (Lisp_Object obj) -{ - struct popup_data *data = (struct popup_data *) XPOPUP_DATA (obj); - - mark_object (data->last_menubar_buffer); - return data->protect_me; -} - -static const struct memory_description popup_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct popup_data, last_menubar_buffer) }, - { XD_LISP_OBJECT, offsetof (struct popup_data, protect_me) }, - { XD_END } -}; - -DEFINE_LRECORD_IMPLEMENTATION ("popup-data", popup_data, - 0, /*dumpable-flag*/ - mark_popup_data, internal_object_printer, - 0, 0, 0, - popup_data_description, - struct popup_data); -/* This is like FRAME_MENUBAR_DATA (f), but contains an alist of - (id . popup-data) for GCPRO'ing the callbacks of the popup menus - and dialog boxes. */ +/* This contains an alist of (id . protect-me) for GCPRO'ing the callbacks + of the popup menus and dialog boxes. */ static Lisp_Object Vpopup_callbacks; +struct widget_value_mapper +{ + Lisp_Object protect_me; +}; + static int snarf_widget_value_mapper (widget_value *val, void *closure) { - struct popup_data *pdata = (struct popup_data *) closure; + struct widget_value_mapper *z = (struct widget_value_mapper *) closure; if (val->call_data) - pdata->protect_me = Fcons (VOID_TO_LISP (val->call_data), - pdata->protect_me); + z->protect_me = Fcons (VOID_TO_LISP (val->call_data), z->protect_me); if (val->accel) - pdata->protect_me = Fcons (VOID_TO_LISP (val->accel), - pdata->protect_me); + z->protect_me = Fcons (VOID_TO_LISP (val->accel), z->protect_me); return 0; } /* Snarf the callbacks and other Lisp data that are hidden in the lwlib - call-data and accel and stick them into POPUP-DATA for proper marking. */ + call-data and accel associated with id ID and return them for + proper marking. */ -void -snarf_widget_values_for_gcpro (Lisp_Object popup_data) +static Lisp_Object +snarf_widget_values_for_gcpro (LWLIB_ID id) { - struct popup_data *pdata = XPOPUP_DATA (popup_data); - - free_list (pdata->protect_me); - pdata->protect_me = Qnil; + struct widget_value_mapper z; - if (pdata->id) - lw_map_widget_values (pdata->id, snarf_widget_value_mapper, pdata); + z.protect_me = Qnil; + lw_map_widget_values (id, snarf_widget_value_mapper, &z); + return z.protect_me; } +/* Given an lwlib id ID associated with a widget tree, make sure that all + Lisp callbacks in the tree are GC-protected. This can be called + multiple times on the same widget tree -- this should be done at + creation time and each time the tree is modified. */ + void gcpro_popup_callbacks (LWLIB_ID id) { - struct popup_data *pdata; Lisp_Object lid = make_int (id); - Lisp_Object lpdata; - - assert (NILP (assq_no_quit (lid, Vpopup_callbacks))); - pdata = alloc_lcrecord_type (struct popup_data, &lrecord_popup_data); - pdata->id = id; - pdata->last_menubar_buffer = Qnil; - pdata->protect_me = Qnil; - pdata->menubar_contents_up_to_date = 0; - lpdata = wrap_popup_data (pdata); - - snarf_widget_values_for_gcpro (lpdata); + Lisp_Object this = assq_no_quit (lid, Vpopup_callbacks); - Vpopup_callbacks = Fcons (Fcons (lid, lpdata), Vpopup_callbacks); + if (!NILP (this)) + { + free_list (XCDR (this)); + XCDR (this) = snarf_widget_values_for_gcpro (id); + } + else + Vpopup_callbacks = Fcons (Fcons (lid, snarf_widget_values_for_gcpro (id)), + Vpopup_callbacks); } +/* Remove GC-protection from the just-destroyed widget tree associated + with lwlib id ID. */ + void ungcpro_popup_callbacks (LWLIB_ID id) { - struct popup_data *pdata; Lisp_Object lid = make_int (id); Lisp_Object this = assq_no_quit (lid, Vpopup_callbacks); + assert (!NILP (this)); - pdata = XPOPUP_DATA (XCDR (this)); - free_list (pdata->protect_me); - pdata->protect_me = Qnil; + free_list (XCDR (this)); Vpopup_callbacks = delq_no_quit (this, Vpopup_callbacks); } @@ -692,7 +676,6 @@ void syms_of_gui_x (void) { - INIT_LRECORD_IMPLEMENTATION (popup_data); } void Index: src/gui-x.h =================================================================== RCS file: src/gui-x.h diff -N src/gui-x.h --- src/gui-x.h 6 Feb 2003 06:36:03 -0000 1.12 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,89 +0,0 @@ -/* General GUI code -- X-specific header file. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996, 2000, 2002, 2003 Ben Wing. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -/* This file Mule-ized by Ben Wing, 7-8-00. */ - -#ifndef INCLUDED_gui_x_h_ -#define INCLUDED_gui_x_h_ - -#include "../lwlib/lwlib.h" - -widget_value *xmalloc_widget_value (void); - -LWLIB_ID new_lwlib_id (void); - -/* Each frame has one of these, and they are also contained in - Vpopup_callbacks. - It doesn't really need to be an lrecord (it's not lisp-accessible) - but it makes marking slightly more modular. - */ - -struct popup_data -{ - struct lcrecord_header header; - - /* lwlib ID of the tree of widgets corresponding to this popup. We pass - this to lw_map_widget_values() to retrieve all of our Lispy call-data - and accel values that need to be GCPRO'd, and store them in the - following list. (We used to call lw_map_widget_values() during GC - mark, but that isn't compatible with KKCC.) */ - LWLIB_ID id; - - /* List of GC-protected objects. */ - Lisp_Object protect_me; - - /* For the frame popup data, this is the last buffer for which the - menubar was displayed. If the buffer has changed, we may have to - update things. */ - Lisp_Object last_menubar_buffer; - - /* This flag tells us if the menubar contents are up-to-date with respect - to the current menubar structure. If we want to actually pull down a - menu and this is false, then we need to update things. */ - char menubar_contents_up_to_date; -}; - -DECLARE_LRECORD (popup_data, struct popup_data); -#define XPOPUP_DATA(x) XRECORD (x, popup_data, struct popup_data) -#define wrap_popup_data(p) wrap_record (p, popup_data) -#define POPUP_DATAP(x) RECORDP (x, popup_data) -#define CHECK_POPUP_DATA(x) CHECK_RECORD (x, popup_data) - -void snarf_widget_values_for_gcpro (Lisp_Object popup_data); -void gcpro_popup_callbacks (LWLIB_ID id); -void ungcpro_popup_callbacks (LWLIB_ID id); -int popup_handled_p (LWLIB_ID id); -void free_popup_widget_value_tree (widget_value *wv); -void popup_selection_callback (Widget widget, LWLIB_ID ignored_id, - XtPointer client_data); -Extbyte *add_accel_and_to_external (Lisp_Object string); -int button_item_to_widget_value (Lisp_Object gui_object_instance, - Lisp_Object gui_item, widget_value *wv, - int allow_text_field_p, int no_keys_p, - int menu_entry_p, int accel_p); -widget_value * gui_items_to_widget_values (Lisp_Object gui_object_instance, - Lisp_Object items, int accel_p); -Extbyte *menu_separator_style_and_to_external (const Ibyte *s); -Lisp_Object widget_value_unwind (Lisp_Object closure); - -#endif /* INCLUDED_gui_x_h_ */ Index: src/gui.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- src/gui.c 12 Jan 2003 11:08:17 -0000 1.25 +++ src/gui.c 21 Feb 2003 06:56:58 -0000 1.26 @@ -1,6 +1,6 @@ /* Generic GUI code. (menubars, scrollbars, toolbars, dialogs) Copyright (C) 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1998 Free Software Foundation, Inc. @@ -33,6 +33,7 @@ #include "elhash.h" #include "gui.h" #include "menubar.h" +#include "redisplay.h" Lisp_Object Qmenu_no_selection_hook; Lisp_Object Vmenu_no_selection_hook; @@ -381,18 +382,33 @@ Fplist_put (plist, Q_value, pgui_item->value); } +static int +gui_item_value (Lisp_Object form, int in_redisplay) +{ + /* This function can call Lisp. */ + +#ifndef ERROR_CHECK_DISPLAY + /* Shortcut to avoid evaluating Qt/Qnil each time; but don't do it when + error-checking so we catch unprotected eval within redisplay quicker */ + if (NILP (form)) + return 0; + if (EQ (form, Qt)) + return 1; +#endif + if (in_redisplay) + return !NILP (eval_within_redisplay (form)); + else + return !NILP (Feval (form)); +} + /* * Decide whether a GUI item is active by evaluating its :active form * if any */ int -gui_item_active_p (Lisp_Object gui_item) +gui_item_active_p (Lisp_Object gui_item, int in_redisplay) { - /* This function can call lisp */ - - /* Shortcut to avoid evaluating Qt each time */ - return (EQ (XGUI_ITEM (gui_item)->active, Qt) - || !NILP (Feval (XGUI_ITEM (gui_item)->active))); + return gui_item_value (XGUI_ITEM (gui_item)->active, in_redisplay); } /* set menu accelerator key to first underlined character in menu name */ @@ -436,23 +452,20 @@ * if any */ int -gui_item_selected_p (Lisp_Object gui_item) +gui_item_selected_p (Lisp_Object gui_item, int in_redisplay) { - /* This function can call lisp */ - - /* Shortcut to avoid evaluating Qt each time */ - return (EQ (XGUI_ITEM (gui_item)->selected, Qt) - || !NILP (Feval (XGUI_ITEM (gui_item)->selected))); + return gui_item_value (XGUI_ITEM (gui_item)->selected, in_redisplay); } Lisp_Object gui_item_list_find_selected (Lisp_Object gui_item_list) { - /* This function can GC. */ + /* This function can call Lisp but cannot GC because it is called within + redisplay, and redisplay disables GC. */ Lisp_Object rest; LIST_LOOP (rest, gui_item_list) { - if (gui_item_selected_p (XCAR (rest))) + if (gui_item_selected_p (XCAR (rest), 1)) return XCAR (rest); } return XCAR (gui_item_list); @@ -470,8 +483,7 @@ Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); /* Evaluate :included first. Shortcut to avoid evaluating Qt each time */ - if (!EQ (pgui_item->included, Qt) - && NILP (Feval (pgui_item->included))) + if (!gui_item_value (pgui_item->included, 0)) return 0; /* Do :config if conflist is given */ @@ -619,17 +631,33 @@ return id; } +static int +gui_value_equal (Lisp_Object a, Lisp_Object b, int depth, int in_redisplay) +{ + if (in_redisplay) + return internal_equal_trapping_problems + (Qredisplay, "Error calling function within redisplay", 0, 0, + /* say they're not equal in case of error; code calling + gui_item_equal_sans_selected() in redisplay does extra stuff + only when equal */ + 0, a, b, depth); + else + return internal_equal (a, b, depth); +} + int -gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth) +gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth, + int in_redisplay) { Lisp_Gui_Item *p1 = XGUI_ITEM (obj1); Lisp_Gui_Item *p2 = XGUI_ITEM (obj2); - if (!(internal_equal (p1->name, p2->name, depth + 1) + if (!(gui_value_equal (p1->name, p2->name, depth + 1, in_redisplay) && - internal_equal (p1->callback, p2->callback, depth + 1) + gui_value_equal (p1->callback, p2->callback, depth + 1, in_redisplay) && - internal_equal (p1->callback_ex, p2->callback_ex, depth + 1) + gui_value_equal (p1->callback_ex, p2->callback_ex, depth + 1, + in_redisplay) && EQ (p1->suffix, p2->suffix) && @@ -658,8 +686,7 @@ Lisp_Gui_Item *p1 = XGUI_ITEM (obj1); Lisp_Gui_Item *p2 = XGUI_ITEM (obj2); - if (!(gui_item_equal_sans_selected (obj1, obj2, depth) - && + if (!(gui_item_equal_sans_selected (obj1, obj2, depth, 0) && EQ (p1->selected, p2->selected))) return 0; return 1; Index: src/gui.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/gui.h 5 Jun 2002 09:56:03 -0000 1.16 +++ src/gui.h 21 Feb 2003 06:56:58 -0000 1.17 @@ -29,7 +29,8 @@ int separator_string_p (const Ibyte *s); void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *); -int gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth); +int gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, + int depth, int in_redisplay); @@ -76,13 +77,13 @@ Lisp_Object gui_parse_item_keywords (Lisp_Object item); Lisp_Object gui_parse_item_keywords_no_errors (Lisp_Object item); void gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item); -int gui_item_active_p (Lisp_Object); -int gui_item_selected_p (Lisp_Object); +int gui_item_active_p (Lisp_Object, int); +int gui_item_selected_p (Lisp_Object, int); Lisp_Object gui_item_list_find_selected (Lisp_Object gui_item_list); -int gui_item_included_p (Lisp_Object, Lisp_Object into); +int gui_item_included_p (Lisp_Object, Lisp_Object into); Lisp_Object gui_item_accelerator (Lisp_Object gui_item); Lisp_Object gui_name_accelerator (Lisp_Object name); -int gui_item_id_hash (Lisp_Object, Lisp_Object gui_item, int); +int gui_item_id_hash (Lisp_Object, Lisp_Object gui_item, int); Lisp_Object gui_item_display_flush_left (Lisp_Object gui_item); Lisp_Object gui_item_display_flush_right (Lisp_Object gui_item); Lisp_Object allocate_gui_item (void); Index: src/gutter.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gutter.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/gutter.c 12 Jan 2003 11:08:17 -0000 1.13 +++ src/gutter.c 21 Feb 2003 06:56:58 -0000 1.14 @@ -335,10 +335,11 @@ calculate_gutter_size (struct window *w, enum gutter_pos pos) { struct frame* f = XFRAME (WINDOW_FRAME (w)); - int count; - display_line_dynarr* ddla; + display_line_dynarr *ddla; Lisp_Object ret = Qnil; + /* Callers need to handle this. */ + assert (!in_display); /* degenerate case */ if (NILP (RAW_WINDOW_GUTTER (w, pos)) || @@ -347,26 +348,31 @@ NILP (w->buffer)) return Qnil; - /* Redisplay code that we use relies on GC not happening. Make it - so. */ - count = begin_gc_forbidden (); + if (!in_display) + { + int count; - ddla = Dynarr_new (display_line); - /* generate some display lines */ - generate_displayable_area (w, WINDOW_GUTTER (w, pos), - FRAME_LEFT_BORDER_END (f), - FRAME_TOP_BORDER_END (f), - FRAME_RIGHT_BORDER_START (f) - - FRAME_LEFT_BORDER_END (f), - FRAME_BOTTOM_BORDER_START (f) - - FRAME_TOP_BORDER_END (f), - ddla, 0, 0); + /* We are calling directly into redisplay from the outside, so turn on + critical section protection. */ + count = enter_redisplay_critical_section (); + + ddla = Dynarr_new (display_line); + /* generate some display lines */ + generate_displayable_area (w, WINDOW_GUTTER (w, pos), + FRAME_LEFT_BORDER_END (f), + FRAME_TOP_BORDER_END (f), + FRAME_RIGHT_BORDER_START (f) + - FRAME_LEFT_BORDER_END (f), + FRAME_BOTTOM_BORDER_START (f) + - FRAME_TOP_BORDER_END (f), + ddla, 0, 0); - /* Let GC happen again. */ - unbind_to (count); + /* Let GC happen again. */ + exit_redisplay_critical_section (count); - ret = make_int (calculate_gutter_size_from_display_lines (pos, ddla)); - free_display_lines (ddla); + ret = make_int (calculate_gutter_size_from_display_lines (pos, ddla)); + free_display_lines (ddla); + } return ret; } @@ -693,17 +699,13 @@ int height) { enum gutter_pos pos; - int depth; - /* We have to be "in display" when we output the gutter - make it - so. */ - depth = enter_redisplay_critical_section (); + /* We are already inside the critical section -- our caller did that. */ GUTTER_POS_LOOP (pos) { if (FRAME_GUTTER_VISIBLE (f, pos)) redraw_exposed_gutter (f, pos, x, y, width, height); } - exit_redisplay_critical_section (depth); } void @@ -749,13 +751,12 @@ if (cur != new) { - int depth; - /* The following calls will automatically cause the dirty flags to be set; we delay frame size changes to avoid lots of frame flickering. */ /* #### I think this should be GC protected. -sb */ - depth = enter_redisplay_critical_section (); + int depth = begin_hold_frame_size_changes (); + set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil))); set_specifier_fallback (Vgutter[new], Vdefault_gutter); set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero))); @@ -769,9 +770,9 @@ Vdefault_gutter_border_width); set_specifier_fallback (Vgutter_visible_p[cur], list1 (Fcons (Qnil, Qt))); set_specifier_fallback (Vgutter_visible_p[new], Vdefault_gutter_visible_p); - Vdefault_gutter_position = position; - exit_redisplay_critical_section (depth); + + unbind_to (depth); } run_hook (Qdefault_gutter_position_changed_hook); @@ -885,21 +886,39 @@ Fset_specifier_dirty_flag (real_one[pos]); } +static void gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval, enum gutter_pos pos); + static void -gutter_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval, enum gutter_pos pos) +gutter_specs_changed_1 (Lisp_Object arg) { - w->real_gutter[pos] = construct_window_gutter_spec (w, pos); - w->real_gutter_size[pos] = w->gutter_size[pos]; + gutter_specs_changed (X1ST (arg), XWINDOW (X2ND (arg)), + X3RD (arg), (enum gutter_pos) XINT (X4TH (arg))); + free_list (arg); +} - if (EQ (w->real_gutter_size[pos], Qautodetect) - && !NILP (w->gutter_visible_p[pos])) +static void +gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval, enum gutter_pos pos) +{ + if (in_display) + register_post_redisplay_action (gutter_specs_changed_1, + list4 (specifier, wrap_window (w), + oldval, make_int (pos))); + else { - w->real_gutter_size [pos] = calculate_gutter_size (w, pos); + w->real_gutter[pos] = construct_window_gutter_spec (w, pos); + w->real_gutter_size[pos] = w->gutter_size[pos]; + + if (EQ (w->real_gutter_size[pos], Qautodetect) + && !NILP (w->gutter_visible_p[pos])) + { + w->real_gutter_size [pos] = calculate_gutter_size (w, pos); + } + MARK_GUTTER_CHANGED; + MARK_MODELINE_CHANGED; + MARK_WINDOWS_CHANGED (w); } - MARK_GUTTER_CHANGED; - MARK_MODELINE_CHANGED; - MARK_WINDOWS_CHANGED (w); } /* We define all of these so we can access which actual gutter changed. */ @@ -938,24 +957,43 @@ recompute_overlaying_specifier (Vgutter); } +static void gutter_geometry_changed_in_window (Lisp_Object specifier, + struct window *w, + Lisp_Object oldval); + +static void +gutter_geometry_changed_in_window_1 (Lisp_Object arg) +{ + gutter_geometry_changed_in_window (X1ST (arg), XWINDOW (X2ND (arg)), + X3RD (arg)); + free_list (arg); +} + static void gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w, Lisp_Object oldval) { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + if (in_display) + register_post_redisplay_action (gutter_geometry_changed_in_window_1, + list3 (specifier, wrap_window (w), + oldval)); + else { - w->real_gutter_size[pos] = w->gutter_size[pos]; - if (EQ (w->real_gutter_size[pos], Qautodetect) - && !NILP (w->gutter_visible_p[pos])) + enum gutter_pos pos; + GUTTER_POS_LOOP (pos) { - w->real_gutter_size [pos] = calculate_gutter_size (w, pos); + w->real_gutter_size[pos] = w->gutter_size[pos]; + if (EQ (w->real_gutter_size[pos], Qautodetect) + && !NILP (w->gutter_visible_p[pos])) + { + w->real_gutter_size [pos] = calculate_gutter_size (w, pos); + } } - } - MARK_GUTTER_CHANGED; - MARK_MODELINE_CHANGED; - MARK_WINDOWS_CHANGED (w); + MARK_GUTTER_CHANGED; + MARK_MODELINE_CHANGED; + MARK_WINDOWS_CHANGED (w); + } } static void @@ -1054,6 +1092,10 @@ ()) { Lisp_Object devcons, concons; + + /* Can't reentrantly enter redisplay */ + if (in_display) + return Qnil; DEVICE_LOOP_NO_BREAK (devcons, concons) { Index: src/inline.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/inline.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- src/inline.c 10 Sep 2002 15:27:37 -0000 1.19 +++ src/inline.c 9 Mar 2003 02:27:44 -0000 1.20 @@ -89,7 +89,6 @@ #ifdef HAVE_X_WINDOWS #include "glyphs-x.h" -#include "gui-x.h" #endif #ifdef HAVE_MS_WINDOWS Index: src/input-method-motif.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/input-method-motif.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/input-method-motif.c 12 Jan 2003 11:08:17 -0000 1.15 +++ src/input-method-motif.c 20 Feb 2003 08:19:42 -0000 1.16 @@ -31,7 +31,7 @@ #include "device.h" #include "frame.h" #include "EmacsFrame.h" -#include +#include "xmotif.h" #ifndef XIM_MOTIF #error XIM_MOTIF is not defined?? Index: src/insdel.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/insdel.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- src/insdel.c 5 Jun 2002 09:56:07 -0000 1.30 +++ src/insdel.c 2 Mar 2003 09:38:53 -0000 1.31 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -736,7 +736,7 @@ set_buffer_internal (buf); in_first_change = 1; run_hook_trapping_problems - (0, Qfirst_change_hook, + (Qchange, Qfirst_change_hook, INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); unbind_to (speccount); } @@ -807,12 +807,12 @@ { set_buffer_internal (buf); va_run_hook_with_args_trapping_problems - (0, Qbefore_change_functions, 2, + (Qchange, Qbefore_change_functions, 2, make_int (start), make_int (end), INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); /* Obsolete, for compatibility */ va_run_hook_with_args_trapping_problems - (0, Qbefore_change_function, 2, + (Qchange, Qbefore_change_function, 2, make_int (start), make_int (end), INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); } @@ -896,13 +896,13 @@ /* The actual after-change functions take slightly different arguments than what we were passed. */ va_run_hook_with_args_trapping_problems - (0, Qafter_change_functions, 3, + (Qchange, Qafter_change_functions, 3, make_int (start), make_int (new_end), make_int (orig_end - start), INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); /* Obsolete, for compatibility */ va_run_hook_with_args_trapping_problems - (0, Qafter_change_function, 3, + (Qchange, Qafter_change_function, 3, make_int (start), make_int (new_end), make_int (orig_end - start), INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); Index: src/lisp.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v retrieving revision 1.95 retrieving revision 1.100 diff -u -r1.95 -r1.100 --- src/lisp.h 13 Feb 2003 09:57:07 -0000 1.95 +++ src/lisp.h 24 Apr 2003 05:33:44 -0000 1.100 @@ -54,7 +54,7 @@ /* general definitions */ /************************************************************************/ -/* ------------------------ include files ------------------- */ +/* -------------------------- include files --------------------- */ /* We include the following generally useful header files so that you don't have to worry about prototypes when using the standard C @@ -70,7 +70,7 @@ #include #include -/* --------------------- error-checking sublevels --------------------- */ +/* -------------------------- error-checking ------------------------ */ /* The large categories established by configure can be subdivided into smaller subcategories, for problems in specific modules. You can't @@ -85,6 +85,51 @@ #define ERROR_CHECK_TRAPPING_PROBLEMS #endif +#ifdef ERROR_CHECK_TYPES +#define type_checking_assert(assertion) assert (assertion) +#define type_checking_assert_at_line(assertion, file, line) \ + assert_at_line (assertion, file, line) +#define type_checking_assert_with_message(assertion, msg) \ + assert_with_message (assertion, msg) +#else +#define type_checking_assert(assertion) +#define type_checking_assert_at_line(assertion, file, line) +#define type_checking_assert_with_message(assertion, msg) +#endif +#ifdef ERROR_CHECK_GC +#define gc_checking_assert(assertion) assert (assertion) +#define gc_checking_assert_at_line(assertion, file, line) \ + assert_at_line (assertion, file, line) +#define gc_checking_assert_with_message(assertion, msg) \ + assert_with_message (assertion, msg) +#else +#define gc_checking_assert(assertion) +#define gc_checking_assert_at_line(assertion, file, line) +#define gc_checking_assert_with_message(assertion, msg) +#endif +#ifdef ERROR_CHECK_TEXT +#define text_checking_assert(assertion) assert (assertion) +#define text_checking_assert_at_line(assertion, file, line) \ + assert_at_line (assertion, file, line) +#define text_checking_assert_with_message(assertion, msg) \ + assert_with_message (assertion, msg) +#else +#define text_checking_assert(assertion) +#define text_checking_assert_at_line(assertion, file, line) +#define text_checking_assert_with_message(assertion, msg) +#endif +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS +#define trapping_problems_checking_assert(assertion) assert (assertion) +#define trapping_problems_checking_assert_at_line(assertion, file, line) \ + assert_at_line (assertion, file, line) +#define trapping_problems_checking_assert_with_message(assertion, msg) \ + assert_with_message (assertion, msg) +#else +#define trapping_problems_checking_assert(assertion) +#define trapping_problems_checking_assert_at_line(assertion, file, line) +#define trapping_problems_checking_assert_with_message(assertion, msg) +#endif + /* ------------------------ definition of EMACS_INT ------------------- */ /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. @@ -142,7 +187,7 @@ #define INT_32_BIT short #define UINT_32_BIT unsigned short #define MAKE_32_BIT_UNSIGNED_CONSTANT(num) num##U -#elif /* Unable to find a 32-bit integral type! */ +#elif 1 /* Unable to find a 32-bit integral type! */ #error What kind of strange-ass system are you running on? #endif @@ -578,7 +623,7 @@ /* Basic declaration at the top of all X-position classes (that can refer to buffers or strings). CL1 and CL2 are the equivalent more specific - classes referring only to buffers or strings, respefitvely. */ + classes referring only to buffers or strings, respectively. */ #define DECLARE_XPOS_CLASS(cl, countcl, cl1, cl2) \ DECLARE_INTCLASS (cl) \ @@ -813,7 +858,11 @@ #ifndef DOESNT_RETURN # if defined __GNUC__ # if ((__GNUC__ > 2) || (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)) -# define RETURN_NOT_REACHED(value) DO_NOTHING +# if __GNUC__ < 3 + /* GCC 3.2 -O3 issues complaints in Fcommand_loop_1 about no return + statement if we have this definition */ +# define RETURN_NOT_REACHED(value) DO_NOTHING +# endif # define DOESNT_RETURN void # define DECLARE_DOESNT_RETURN(decl) \ extern void decl __attribute__ ((noreturn)) @@ -1096,6 +1145,13 @@ extern Bytecount __temp_alloca_size__; extern Bytecount funcall_alloca_count; +#ifdef ERROR_CHECK_MALLOC +extern int regex_malloc_disallowed; +#define REGEX_MALLOC_CHECK() assert (!regex_malloc_disallowed) +#else +#define REGEX_MALLOC_CHECK() ((void) 0) +#endif + /* Do stack or heap alloca() depending on size. NOTE: The use of a global temporary like this is unsafe if ALLOCA() occurs @@ -1104,17 +1160,28 @@ expression has side effects -- something easy to forget. */ #define ALLOCA(size) \ - (__temp_alloca_size__ = (size), \ + (REGEX_MALLOC_CHECK (), \ + __temp_alloca_size__ = (size), \ __temp_alloca_size__ > MAX_ALLOCA_VS_C_ALLOCA ? \ xemacs_c_alloca (__temp_alloca_size__) : \ (need_to_check_c_alloca ? xemacs_c_alloca (0) : 0, \ alloca (__temp_alloca_size__))) +/* Version of ALLOCA() that is guaranteed to work inside of function calls + (i.e., we call the C alloca if regular alloca() is broken inside of + function calls). */ +#ifdef BROKEN_ALLOCA_IN_FUNCTION_CALLS +#define ALLOCA_FUNCALL_OK(size) xemacs_c_alloca (size) +#else +#define ALLOCA_FUNCALL_OK(size) ALLOCA (size) +#endif + /* WARNING: If you use this, you must unbind_to() at the end of your function! */ #define MALLOC_OR_ALLOCA(size) \ - (__temp_alloca_size__ = (size), \ + (REGEX_MALLOC_CHECK (), \ + __temp_alloca_size__ = (size), \ __temp_alloca_size__ > MAX_ALLOCA_VS_MALLOC ? \ xmalloc_and_record_unwind (__temp_alloca_size__) : \ (need_to_check_c_alloca ? xemacs_c_alloca (0) : 0, \ @@ -1129,6 +1196,7 @@ which ensures constant amortized time per element. */ #define DO_REALLOC(basevar, sizevar, needed_size, type) do { \ Bytecount do_realloc_needed_size = (needed_size); \ + REGEX_MALLOC_CHECK (); \ if ((sizevar) < do_realloc_needed_size) \ { \ if ((sizevar) < 32) \ @@ -1153,12 +1221,22 @@ /* ------------------------ dynamic arrays ------------------- */ +#ifdef ERROR_CHECK_STRUCTURES +#define Dynarr_declare(type) \ + type *base; \ + int locked; \ + int elsize; \ + int cur; \ + int largest; \ + int max +#else #define Dynarr_declare(type) \ type *base; \ int elsize; \ int cur; \ int largest; \ int max +#endif /* ERROR_CHECK_STRUCTURES */ typedef struct dynarr { @@ -1192,58 +1270,75 @@ return dy; } +DECLARE_INLINE_HEADER ( +Dynarr * +Dynarr_verify_mod_1 (void *d, const char *file, int line) +) +{ + Dynarr *dy = (Dynarr *) d; + assert_at_line (!dy->locked, file, line); + assert_at_line (dy->cur >= 0 && dy->cur <= dy->largest && + dy->largest <= dy->max, file, line); + return dy; +} + #define Dynarr_verify(d) Dynarr_verify_1 (d, __FILE__, __LINE__) +#define Dynarr_verify_mod(d) Dynarr_verify_mod_1 (d, __FILE__, __LINE__) +#define Dynarr_lock(d) (Dynarr_verify_mod (d)->locked = 1) +#define Dynarr_unlock(d) ((d)->locked = 0) #else #define Dynarr_verify(d) (d) +#define Dynarr_verify_mod(d) (d) +#define Dynarr_lock(d) +#define Dynarr_unlock(d) #endif /* ERROR_CHECK_STRUCTURES */ #define Dynarr_length(d) (Dynarr_verify (d)->cur) #define Dynarr_largest(d) (Dynarr_verify (d)->largest) -#define Dynarr_reset(d) (Dynarr_verify (d)->cur = 0) +#define Dynarr_reset(d) (Dynarr_verify_mod (d)->cur = 0) #define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur) #define Dynarr_insert_many_at_start(d, el, len) \ Dynarr_insert_many (d, el, len, 0) #define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1) -#define Dynarr_add_lisp_string(d, s, codesys) \ -do { \ - Lisp_Object dyna_ls_s = (s); \ - Lisp_Object dyna_ls_cs = (codesys); \ - Extbyte *dyna_ls_eb; \ - Bytecount dyna_ls_bc; \ - \ - TO_EXTERNAL_FORMAT (LISP_STRING, dyna_ls_s, \ - ALLOCA, (dyna_ls_eb, dyna_ls_bc), \ - dyna_ls_cs); \ - Dynarr_add_many (d, dyna_ls_eb, dyna_ls_bc); \ +#define Dynarr_add_lisp_string(d, s, codesys) \ +do { \ + Lisp_Object dyna_ls_s = (s); \ + Lisp_Object dyna_ls_cs = (codesys); \ + Extbyte *dyna_ls_eb; \ + Bytecount dyna_ls_bc; \ + \ + LISP_STRING_TO_SIZED_EXTERNAL (dyna_ls_s, dyna_ls_eb, \ + dyna_ls_bc, dyna_ls_cs); \ + Dynarr_add_many (d, dyna_ls_eb, dyna_ls_bc); \ } while (0) -#define Dynarr_add(d, el) ( \ - Dynarr_verify (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : \ - (void) 0, \ - ((d)->base)[(d)->cur++] = (el), \ +#define Dynarr_add(d, el) ( \ + Dynarr_verify_mod (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : \ + (void) 0, \ + ((d)->base)[(d)->cur++] = (el), \ (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0) /* The following defines will get you into real trouble if you aren't careful. But they can save a lot of execution time when used wisely. */ -#define Dynarr_increment(d) ((d)->cur++) -#define Dynarr_set_size(d, n) ((d)->cur = n) +#define Dynarr_increment(d) (Dynarr_verify_mod (d)->cur++) +#define Dynarr_set_size(d, n) (Dynarr_verify_mod (d)->cur = n) -#define Dynarr_pop(d) \ - (assert ((d)->cur > 0), (d)->cur--, Dynarr_at (d, (d)->cur)) -#define Dynarr_delete(d, i) Dynarr_delete_many (d, i, len) +#define Dynarr_pop(d) \ + (assert ((d)->cur > 0), Dynarr_verify_mod (d)->cur--, \ + Dynarr_at (d, (d)->cur)) +#define Dynarr_delete(d, i) Dynarr_delete_many (d, i, 1) #define Dynarr_delete_by_pointer(d, p) \ Dynarr_delete_many (d, (p) - ((d)->base), 1) -#define Dynarr_delete_object(d, el) \ -do { \ - if (d != NULL) { \ - REGISTER int i; \ - for (i = Dynarr_length (d) - 1; i >= 0; i--) { \ - if (el == Dynarr_at (d, i)) { \ - Dynarr_delete_many (d, i, 1); \ - } \ - } \ - } \ +#define Dynarr_delete_object(d, el) \ +do \ +{ \ + REGISTER int i; \ + for (i = Dynarr_length (d) - 1; i >= 0; i--) \ + { \ + if (el == Dynarr_at (d, i)) \ + Dynarr_delete_many (d, i, 1); \ + } \ } while (0) #ifdef MEMORY_USAGE_STATS @@ -1629,6 +1724,23 @@ #define cons_cdr(a) ((a)->cdr_) #define XCAR(a) (XCONS (a)->car_) #define XCDR(a) (XCONS (a)->cdr_) +#define XCADR(a) (XCAR (XCDR (a))) +#define XCDDR(a) (XCDR (XCDR (a))) +#define XCADDR(a) (XCAR (XCDDR (a))) +#define XCDDDR(a) (XCDR (XCDDR (a))) +#define XCADDDR(a) (XCAR (XCDDDR (a))) +#define XCDDDDR(a) (XCDR (XCDDDR (a))) +#define XCADDDDR(a) (XCAR (XCDDDDR (a))) +#define XCDDDDDR(a) (XCDR (XCDDDDR (a))) +#define XCADDDDDR(a) (XCAR (XCDDDDDR (a))) +#define XCDDDDDDR(a) (XCDR (XCDDDDDR (a))) +#define X1ST(a) XCAR (a) +#define X2ND(a) XCADR (a) +#define X3RD(a) XCADDR (a) +#define X4TH(a) XCADDDR (a) +#define X5TH(a) XCADDDDR (a) +#define X6TH(a) XCADDDDDR (a) + #define XSETCAR(a, b) (XCONS (a)->car_ = (b)) #define XSETCDR(a, b) (XCONS (a)->cdr_ = (b)) #define LISTP(x) (CONSP(x) || NILP(x)) @@ -3458,7 +3570,7 @@ extern int need_to_garbage_collect; extern int need_to_check_c_alloca; extern int need_to_signal_post_gc; -extern Lisp_Object Qpost_gc_hook; +extern Lisp_Object Qpost_gc_hook, Qgarbage_collecting; void recompute_funcall_allocation_flag (void); #ifdef MEMORY_USAGE_STATS @@ -3936,13 +4048,14 @@ #define INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY (1<<14) #define INHIBIT_ENTERING_DEBUGGER (1<<15) #define CALL_WITH_SUSPENDED_ERRORS (1<<16) +#define POSTPONE_WARNING_ISSUE (1<<17) enum check_allowed_operation { OPERATION_DELETE_OBJECT, OPERATION_CREATE_OBJECT, OPERATION_MODIFY_BUFFER_TEXT, - OPERATION_MODIFY_OBJECT_PROPERTY, + OPERATION_MODIFY_OBJECT_PROPERTY }; int get_inhibit_flags (void); @@ -3955,6 +4068,7 @@ Lisp_Object handler_arg, Lisp_Object (*fun) (Lisp_Object), Lisp_Object arg); +int set_trapping_problems_flags (int flags); Lisp_Object call_trapping_problems (Lisp_Object warning_class, const char *warning_string, int flags, @@ -3983,37 +4097,33 @@ Lisp_Object, int); Lisp_Object eval_in_buffer_trapping_problems (const char *, struct buffer *, Lisp_Object, int); -Lisp_Object run_hook_trapping_problems (const char *, Lisp_Object, int); -Lisp_Object safe_run_hook_trapping_problems (const char *, Lisp_Object, int); -Lisp_Object run_hook_with_args_in_buffer_trapping_problems (const char - *warning_string, - struct buffer - *buf, int nargs, +Lisp_Object run_hook_trapping_problems (Lisp_Object, Lisp_Object, int); +Lisp_Object safe_run_hook_trapping_problems (Lisp_Object, Lisp_Object, int); +Lisp_Object run_hook_with_args_in_buffer_trapping_problems (Lisp_Object, + struct buffer *, + int nargs, Lisp_Object *args, enum run_hooks_condition cond, int flags); -Lisp_Object run_hook_with_args_trapping_problems (const char *warning_string, +Lisp_Object run_hook_with_args_trapping_problems (Lisp_Object, int nargs, Lisp_Object *args, enum run_hooks_condition cond, int flags); -Lisp_Object va_run_hook_with_args_trapping_problems (const char - *warning_string, +Lisp_Object va_run_hook_with_args_trapping_problems (Lisp_Object, Lisp_Object hook_var, int nargs, ...); -Lisp_Object va_run_hook_with_args_in_buffer_trapping_problems (const char - *warning_string, - struct buffer - *buf, - Lisp_Object - hook_var, +Lisp_Object va_run_hook_with_args_in_buffer_trapping_problems (Lisp_Object, + struct buffer *, + Lisp_Object, int nargs, ...); Lisp_Object call_with_suspended_errors (lisp_fn_t, Lisp_Object, Lisp_Object, Error_Behavior, int, ...); /* C Code should be using internal_catch, record_unwind_p, condition_case_1 */ +int proper_redisplay_wrapping_in_place (void); Lisp_Object internal_catch (Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object, int * volatile, Lisp_Object * volatile); @@ -4029,6 +4139,7 @@ int record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); int record_unwind_protect_freeing (void *ptr); int record_unwind_protect_freeing_dynarr (void *ptr); +int record_unwind_protect_restoring_int (int *addr, int val); int internal_bind_int (int *addr, int newval); int internal_bind_lisp_object (Lisp_Object *addr, Lisp_Object newval); void do_autoload (Lisp_Object, Lisp_Object); /* GCPROs both arguments */ @@ -4038,6 +4149,7 @@ ...) PRINTF_ARGS (3, 4); extern int backtrace_with_internal_sections; +extern Lisp_Object Vstack_trace_on_error; /* Defined in event-stream.c */ EXFUN (Faccept_process_output, 3); @@ -4429,6 +4541,7 @@ void stderr_out (const CIbyte *, ...) PRINTF_ARGS (1, 2); void stderr_out_lisp (const CIbyte *, int nargs, ...); void stdout_out (const CIbyte *, ...) PRINTF_ARGS (1, 2); +void external_out (int dest, const CIbyte *fmt, ...) PRINTF_ARGS (2, 3); void debug_out (const CIbyte *, ...) PRINTF_ARGS (1, 2); DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (fatal (const CIbyte *, ...), 1, 2); Index: src/lrecord.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lrecord.h,v retrieving revision 1.24 retrieving revision 1.26 diff -u -r1.24 -r1.26 --- src/lrecord.h 12 Jan 2003 11:08:18 -0000 1.24 +++ src/lrecord.h 24 Apr 2003 05:33:44 -0000 1.26 @@ -811,8 +811,9 @@ lcrecord-lists, where the objects have had their type changed to lrecord_type_free and also have had their free bit set, but we mark them as normal. */ - XD_FLAG_FREE_LISP_OBJECT = 8, + XD_FLAG_FREE_LISP_OBJECT = 8 #if 0 + , /* Suggestions for other possible flags: */ /* Eliminate XD_UNION_DYNAMIC_SIZE and replace it with a flag, like this. */ @@ -824,7 +825,7 @@ expanded and we need to stick a pointer in the second slot (although we could still ensure that the second slot in the first entry was NULL or <0). */ - XD_FLAG_DESCRIPTION_MAP = 32, + XD_FLAG_DESCRIPTION_MAP = 32 #endif }; @@ -1474,11 +1475,13 @@ extern unsigned int dump_id; extern char *pdump_start, *pdump_end; -#define DUMPEDP(adr) ((((char *)(adr)) < pdump_end) && (((char *)(adr)) >= pdump_start)) - +#define DUMPEDP(adr) ((((char *) (adr)) < pdump_end) && \ + (((char *) (adr)) >= pdump_start)) #else #define DUMPEDP(adr) 0 #endif + +#define OBJECT_DUMPED_P(obj) DUMPEDP (XPNTR (obj)) /***********************************************************************/ /* data descriptions */ Index: src/make-src-depend =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/make-src-depend,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/make-src-depend 15 Feb 2003 11:20:40 -0000 1.7 +++ src/make-src-depend 2 Mar 2003 09:38:54 -0000 1.8 @@ -124,6 +124,9 @@ delete $uses{$file}{'config.h'}; $uses{$file}{'$(CONFIG_H)'} = 1; } + # Huge hack. With QUICK_BUILD, general.c has no dependence on + # general-slots.h but really should. + $uses{$file}{'general-slots.h'} = 1 if $file eq "general.c"; print "@{[sort keys %{$uses{$file}}]}\n"; } Index: src/menubar-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar-gtk.c,v retrieving revision 1.14 retrieving revision 1.16 diff -u -r1.14 -r1.16 --- src/menubar-gtk.c 31 Jan 2003 12:02:37 -0000 1.14 +++ src/menubar-gtk.c 15 Apr 2003 17:21:36 -0000 1.16 @@ -1,7 +1,7 @@ /* Implements an elisp-programmable menubar -- X interface. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -29,9 +29,8 @@ #include "buffer.h" #include "commands.h" /* zmacs_regions */ -#include "device.h" -#include "events.h" #include "device-impl.h" +#include "events.h" #include "frame-impl.h" #include "gui.h" #include "opaque.h" @@ -39,7 +38,6 @@ #include "window-impl.h" #include "console-gtk-impl.h" -#include "gui-gtk.h" #include "ui-gtk.h" #include "menubar.h" @@ -53,9 +51,9 @@ static GtkWidget *menu_descriptor_to_widget_1 (Lisp_Object descr); -#define FRAME_MENUBAR_DATA(frame) ((frame)->menubar_data) -#define XFRAME_MENUBAR_DATA_LASTBUFF(frame) (XCAR ((frame)->menubar_data)) -#define XFRAME_MENUBAR_DATA_UPTODATE(frame) (XCDR ((frame)->menubar_data)) +#define FRAME_GTK_MENUBAR_DATA(f) (FRAME_GTK_DATA (f)->menubar_data) +#define XFRAME_GTK_MENUBAR_DATA_LASTBUFF(f) XCAR (FRAME_GTK_MENUBAR_DATA (f)) +#define XFRAME_GTK_MENUBAR_DATA_UPTODATE(f) XCDR (FRAME_GTK_MENUBAR_DATA (f)) /* This is a bogus subclass of GtkMenuBar so that the menu never tries @@ -117,7 +115,8 @@ static GtkWidgetClass *parent_class; -static void gtk_xemacs_menubar_class_init (GtkXEmacsMenubarClass *klass) +static void +gtk_xemacs_menubar_class_init (GtkXEmacsMenubarClass *klass) { GtkWidgetClass *widget_class; @@ -127,11 +126,13 @@ widget_class->size_request = gtk_xemacs_menubar_size_request; } -static void gtk_xemacs_menubar_init (GtkXEmacsMenubar *xemacs) +static void +gtk_xemacs_menubar_init (GtkXEmacsMenubar *xemacs) { } -static void gtk_xemacs_menubar_size_request (GtkWidget *widget, GtkRequisition *requisition) +static void +gtk_xemacs_menubar_size_request (GtkWidget *widget, GtkRequisition *requisition) { GtkXEmacsMenubar *x = GTK_XEMACS_MENUBAR (widget); GtkRequisition frame_size; @@ -581,7 +582,8 @@ /* This function cannot GC. It is only called from menu_item_descriptor_to_widget_value, which prohibits GC. */ -static GtkWidget *menu_descriptor_to_widget_1 (Lisp_Object descr) +static GtkWidget * +menu_descriptor_to_widget_1 (Lisp_Object descr) { if (STRINGP (descr)) { @@ -882,7 +884,8 @@ } } -static GtkWidget *menu_descriptor_to_widget (Lisp_Object descr) +static GtkWidget * +menu_descriptor_to_widget (Lisp_Object descr) { GtkWidget *rval = NULL; int count = begin_gc_forbidden (); @@ -1126,7 +1129,7 @@ unbind_to (count); } - FRAME_MENUBAR_DATA (f) = Fcons (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer, Qt); + FRAME_GTK_MENUBAR_DATA (f) = Fcons (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer, Qt); return (menubar_visible); } @@ -1152,8 +1155,8 @@ */ int menubar_contents_changed = (f->menubar_changed - || NILP (FRAME_MENUBAR_DATA (f)) - || (!EQ (XFRAME_MENUBAR_DATA_LASTBUFF (f), + || NILP (FRAME_GTK_MENUBAR_DATA (f)) + || (!EQ (XFRAME_GTK_MENUBAR_DATA_LASTBUFF (f), XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer))); gboolean menubar_was_visible = GTK_WIDGET_VISIBLE (FRAME_GTK_MENUBAR_WIDGET (f)); @@ -1222,7 +1225,8 @@ } } -static void popdown_menu_cb (GtkMenuShell *menu, gpointer user_data) +static void +popdown_menu_cb (GtkMenuShell *menu, gpointer user_data) { popup_up_p--; } @@ -1306,7 +1310,8 @@ CONSOLE_HAS_METHOD (gtk, popup_menu); } -void reinit_vars_of_menubar_gtk (void) +void +reinit_vars_of_menubar_gtk (void) { dockable_menubar = 1; #ifdef TEAR_OFF_MENUS Index: src/menubar-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar-msw.c,v retrieving revision 1.37 retrieving revision 1.40 diff -u -r1.37 -r1.40 --- src/menubar-msw.c 9 Feb 2003 09:33:48 -0000 1.37 +++ src/menubar-msw.c 9 Mar 2003 02:27:45 -0000 1.40 @@ -2,7 +2,7 @@ Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. Copyright (C) 1997 Kirill M. Katsnelson . - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -91,7 +91,6 @@ #include "gui.h" #include "lisp.h" #include "menubar.h" -#include "menubar-msw.h" #include "opaque.h" #include "window-impl.h" @@ -274,7 +273,7 @@ goto done; } - if (!gui_item_active_p (gui_item)) + if (!gui_item_active_p (gui_item, 0)) item_info.fState = MFS_GRAYED; /* Temptation is to put 'else' right here. Although, the displayed item won't have an arrow indicating that it is a @@ -329,7 +328,7 @@ if (!STRINGP (pgui_item->name)) pgui_item->name = Feval (pgui_item->name); - if (!gui_item_active_p (gui_item)) + if (!gui_item_active_p (gui_item, 0)) item_info.fState = MFS_GRAYED; style = (NILP (pgui_item->selected) || NILP (Feval (pgui_item->selected)) @@ -655,7 +654,7 @@ /* We simply ignore return value. In any case, we construct the bar on the fly */ run_hook_trapping_problems - ("Error in activate-menubar-hook", Qactivate_menubar_hook, + (Qmenubar, Qactivate_menubar_hook, INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); update_frame_menubar_maybe (f); Index: src/menubar-msw.h =================================================================== RCS file: src/menubar-msw.h diff -N src/menubar-msw.h --- src/menubar-msw.h 13 Mar 2002 08:52:52 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,43 +0,0 @@ -/* Implements an elisp-programmable menubar -- Win32 - Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 1997 Kirill M. Katsnelson - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -/* Author: - Initially written by kkm 12/24/97, - */ - -#ifndef INCLUDED_menubar_msw_h_ -#define INCLUDED_menubar_msw_h_ - - -#ifdef HAVE_MENUBARS - -/* Message handlers. Called from window procedure */ -Lisp_Object mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame *frm); -Lisp_Object mswindows_handle_wm_initmenu (HMENU hmenu, struct frame *f); -Lisp_Object mswindows_handle_wm_command (struct frame *f, WORD command); - -#endif /* HAVE_MENUBARS */ - -#endif /* INCLUDED_menubar_msw_h_ */ - Index: src/menubar-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar-x.c,v retrieving revision 1.39 retrieving revision 1.41 diff -u -r1.39 -r1.41 --- src/menubar-x.c 9 Feb 2003 09:33:48 -0000 1.39 +++ src/menubar-x.c 9 Mar 2003 02:27:45 -0000 1.41 @@ -48,7 +48,6 @@ #include "window-impl.h" #include "console-x-impl.h" -#include "gui-x.h" #include "EmacsFrame.h" #include "../lwlib/lwlib.h" @@ -57,9 +56,6 @@ int deep_p, int first_time_p); -#define FRAME_MENUBAR_DATA(frame) ((frame)->menubar_data) -#define XFRAME_MENUBAR_DATA(frame) XPOPUP_DATA ((frame)->menubar_data) - #define MENUBAR_TYPE 0 #define SUBMENU_TYPE 1 #define POPUP_TYPE 2 @@ -481,9 +477,9 @@ /* Now that we've destructively modified part of the widget value hierarchy, our list of protected callbacks will no longer be valid, so we need to recompute it. */ - snarf_widget_values_for_gcpro (FRAME_MENUBAR_DATA (f)); + gcpro_popup_callbacks (FRAME_X_MENUBAR_ID (f)); } - else if (!POPUP_DATAP (FRAME_MENUBAR_DATA (f))) + else if (!FRAME_X_MENUBAR_ID (f)) return; else { @@ -496,7 +492,7 @@ a pointer back to lisp data needs to be hidden away somewhere. So that an INCREMENTAL_TYPE widget_value can be recreated... Hmmmmm. */ run_hook_trapping_problems - ("Error in activate-menubar-hook", Qactivate_menubar_hook, + (Qmenubar, Qactivate_menubar_hook, INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION); set_frame_menubar (f, 1, 0); DEVICE_X_MOUSE_TIMESTAMP (XDEVICE (FRAME_DEVICE (f))) = @@ -565,21 +561,12 @@ if (!data || (!data->next && !data->contents)) abort (); - if (NILP (FRAME_MENUBAR_DATA (f))) - { - struct popup_data *mdata = - alloc_lcrecord_type (struct popup_data, &lrecord_popup_data); - - mdata->id = new_lwlib_id (); - mdata->last_menubar_buffer = Qnil; - mdata->protect_me = Qnil; - mdata->menubar_contents_up_to_date = 0; - FRAME_MENUBAR_DATA (f) = wrap_popup_data (mdata); - } + if (!FRAME_X_MENUBAR_ID (f)) + FRAME_X_MENUBAR_ID (f) = new_lwlib_id (); /***** now store into the menubar widget, creating it if necessary *****/ - id = XFRAME_MENUBAR_DATA (f)->id; + id = FRAME_X_MENUBAR_ID (f); if (!FRAME_X_MENUBAR_WIDGET (f)) { Widget parent = FRAME_X_CONTAINER_WIDGET (f); @@ -612,10 +599,10 @@ have been freshly created. They need to be GC-protected, so snarf them now and record them into the popup-data object associated with the frame. */ - snarf_widget_values_for_gcpro (FRAME_MENUBAR_DATA (f)); + gcpro_popup_callbacks (id); - XFRAME_MENUBAR_DATA (f)->menubar_contents_up_to_date = deep_p; - XFRAME_MENUBAR_DATA (f)->last_menubar_buffer = + FRAME_X_MENUBAR_CONTENTS_UP_TO_DATE (f) = deep_p; + FRAME_X_LAST_MENUBAR_BUFFER (f) = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer; return menubar_visible; } @@ -721,8 +708,8 @@ */ int menubar_contents_changed = (f->menubar_changed - || NILP (FRAME_MENUBAR_DATA (f)) - || (!EQ (XFRAME_MENUBAR_DATA (f)->last_menubar_buffer, + || !FRAME_X_MENUBAR_ID (f) + || (!EQ (FRAME_X_LAST_MENUBAR_BUFFER (f), XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer))); Boolean menubar_was_visible = XtIsManaged (FRAME_X_MENUBAR_WIDGET (f)); @@ -765,9 +752,10 @@ menubar_widget = FRAME_X_MENUBAR_WIDGET (f); if (menubar_widget) { - LWLIB_ID id = XFRAME_MENUBAR_DATA (f)->id; + LWLIB_ID id = FRAME_X_MENUBAR_ID (f); lw_destroy_all_widgets (id); - XFRAME_MENUBAR_DATA (f)->id = 0; + ungcpro_popup_callbacks (id); + FRAME_X_MENUBAR_ID (f) = 0; } } @@ -1234,7 +1222,7 @@ Lisp_Object matchp; widget_value *val; - LWLIB_ID id = XPOPUP_DATA (f->menubar_data)->id; + LWLIB_ID id = FRAME_X_MENUBAR_ID (f); val = lw_get_all_values (id); if (val) @@ -1323,10 +1311,10 @@ LWLIB_ID id; widget_value *val; - if (NILP (f->menubar_data)) + if (!FRAME_X_MENUBAR_ID (f)) invalid_argument ("Frame has no menubar", Qunbound); - id = XPOPUP_DATA (f->menubar_data)->id; + id = FRAME_X_MENUBAR_ID (f); val = lw_get_all_values (id); val = val->contents; lw_set_menu (FRAME_X_MENUBAR_WIDGET (f), val); Index: src/menubar.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/menubar.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- src/menubar.c 9 Feb 2003 09:33:48 -0000 1.24 +++ src/menubar.c 21 Feb 2003 06:56:59 -0000 1.25 @@ -202,7 +202,7 @@ desc = menu_parse_submenu_keywords (desc, gui_item); /* Check that this (sub)menu is active */ - if (!gui_item_active_p (gui_item)) + if (!gui_item_active_p (gui_item, 0)) RETURN_UNGCPRO (Qnil); /* Apply :filter */ Index: src/nas.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/nas.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/nas.c 11 Nov 2002 16:03:12 -0000 1.11 +++ src/nas.c 9 Mar 2003 02:27:45 -0000 1.12 @@ -852,7 +852,7 @@ fileSize = PAD2(ck.ckSize) - sizeof(RIFF_FOURCC); - while (fileSize >= sizeof(RiffChunk)) + while (fileSize >= (AuInt32) sizeof(RiffChunk)) { if (!readChunk(&ck)) Err(); Index: src/ntheap.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ntheap.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/ntheap.c 14 Apr 2002 12:42:21 -0000 1.15 +++ src/ntheap.c 1 Mar 2003 07:25:36 -0000 1.16 @@ -224,7 +224,7 @@ return result; } -#if !defined (CANNOT_DUMP) && !defined (HEAP_IN_DATA) && !defined (PDUMP) +#if !defined (HEAP_IN_DATA) && !defined (PDUMP) /* Recreate the heap from the data that was dumped to the executable. EXECUTABLE_PATH tells us where to find the executable. */ @@ -286,7 +286,8 @@ /* Update system version information to match current system. */ cache_system_info (); } -#endif /* CANNOT_DUMP */ + +#endif /* !defined (HEAP_IN_DATA) && !defined (PDUMP) */ /* Round the heap up to the given alignment. */ void Index: src/print.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/print.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- src/print.c 6 Feb 2003 06:36:04 -0000 1.46 +++ src/print.c 9 Mar 2003 02:27:45 -0000 1.47 @@ -116,19 +116,20 @@ FILE *termscript; /* Stdio stream being used for copy of all output. */ -static void write_string_to_alternate_debugging_output (Ibyte *str, +static void write_string_to_alternate_debugging_output (const Ibyte *str, Bytecount len); int stdout_needs_newline; +int stdout_clear_before_next_output; /* Basic function to actually write to a stdio stream or TTY console. */ static void -write_string_to_stdio_stream (FILE *stream, struct console *con, - const Ibyte *ptr, Bytecount len, - int must_flush) +write_string_to_stdio_stream_1 (FILE *stream, struct console *con, + const Ibyte *ptr, Bytecount len, + int must_flush) { Extbyte *extptr = 0; Bytecount extlen = 0; @@ -187,15 +188,74 @@ retry_fwrite (extptr, 1, extlen, termscript); fflush (termscript); } - stdout_needs_newline = (ptr[extlen - 1] != '\n'); + stdout_needs_newline = (ptr[len - 1] != '\n'); } } -/* #### The following function should be replaced a call to the - emacs_vsprintf_*() functions. This is the only way to ensure that - I18N3 works properly (many implementations of the *printf() - functions, including the ones included in glibc, do not implement - the %###$ argument-positioning syntax). +/* Write to a stdio stream or TTY console, first clearing the left side + if necessary. */ + +static void +write_string_to_stdio_stream (FILE *stream, struct console *con, + const Ibyte *ptr, Bytecount len, + int must_flush) +{ + if (stdout_clear_before_next_output && + (stream ? stream == stdout || stream == stderr : + CONSOLE_TTY_DATA (con)->is_stdio)) + { + if (stdout_needs_newline) + write_string_to_stdio_stream_1 (stream, con, (Ibyte *) "\n", 1, + must_flush); + stdout_clear_before_next_output = 0; + } + + write_string_to_stdio_stream_1 (stream, con, ptr, len, must_flush); +} + +/* + EXT_PRINT_STDOUT = stdout or its equivalent (may be a + console window under MS Windows) + EXT_PRINT_STDERR = stderr or its equivalent (may be a + console window under MS Windows) + EXT_PRINT_ALTERNATE = an internal character array; see + `alternate-debugging-output' + EXT_PRINT_MSWINDOWS = Under MS Windows, the "debugging output" that + debuggers can hook into; uses OutputDebugString() + system call + EXT_PRINT_ALL = all of the above except stdout +*/ + +enum ext_print + { + EXT_PRINT_STDOUT = 1, + EXT_PRINT_STDERR = 2, + EXT_PRINT_ALTERNATE = 4, + EXT_PRINT_MSWINDOWS = 8, + EXT_PRINT_ALL = 14 + }; + +static void +write_string_to_external_output (const Ibyte *ptr, Bytecount len, + int dest) +{ + if (dest & EXT_PRINT_STDOUT) + write_string_to_stdio_stream (stdout, 0, ptr, len, 1); + if (dest & EXT_PRINT_STDERR) + write_string_to_stdio_stream (stderr, 0, ptr, len, 1); + if (dest & EXT_PRINT_ALTERNATE) + write_string_to_alternate_debugging_output (ptr, len); +#ifdef WIN32_NATIVE + if (dest & EXT_PRINT_MSWINDOWS) + write_string_to_mswindows_debugging_output (ptr, len); +#endif +} + +/* #### The following function should make use of a call to the + emacs_vsprintf_*() functions rather than just using vsprintf. This is + the only way to ensure that I18N3 works properly (many implementations + of the *printf() functions, including the ones included in glibc, do not + implement the %###$ argument-positioning syntax). Note, however, that to do this, we'd have to @@ -204,11 +264,14 @@ called from fatal_error_signal(). 2) (to be really correct) make a new lstream that outputs using - mswindows_output_console_string(). */ + mswindows_output_console_string(). + + 3) A reasonable compromise might be to use emacs_vsprintf() when we're + in a safe state, and when not, use plain vsprintf(). */ static void -std_handle_out_va (FILE *stream, const CIbyte *fmt, va_list args, - int debug_output_as_well) +write_string_to_external_output_va (const CIbyte *fmt, va_list args, + int dest) { Ibyte kludge[8192]; Bytecount kludgelen; @@ -217,15 +280,7 @@ fmt = GETTEXT (fmt); vsprintf ((CIbyte *) kludge, fmt, args); kludgelen = qxestrlen (kludge); - - write_string_to_stdio_stream (stream, 0, kludge, kludgelen, 1); - if (debug_output_as_well) - { - write_string_to_alternate_debugging_output (kludge, kludgelen); -#ifdef WIN32_NATIVE - write_string_to_mswindows_debugging_output (kludge, kludgelen); -#endif - } + write_string_to_external_output (kludge, kludgelen, dest); } /* Output portably to stderr or its equivalent (i.e. may be a console @@ -240,7 +295,7 @@ { va_list args; va_start (args, fmt); - std_handle_out_va (stderr, fmt, args, 0); + write_string_to_external_output_va (fmt, args, EXT_PRINT_STDERR); va_end (args); } @@ -252,7 +307,18 @@ { va_list args; va_start (args, fmt); - std_handle_out_va (stdout, fmt, args, 0); + write_string_to_external_output_va (fmt, args, EXT_PRINT_STDOUT); + va_end (args); +} + +/* Output portably to print destination as specified by DEST. */ + +void +external_out (int dest, const CIbyte *fmt, ...) +{ + va_list args; + va_start (args, fmt); + write_string_to_external_output_va (fmt, args, dest); va_end (args); } @@ -266,7 +332,7 @@ { va_list args; va_start (args, fmt); - std_handle_out_va (stderr, fmt, args, 1); + write_string_to_external_output_va (fmt, args, EXT_PRINT_ALL); va_end (args); } @@ -277,7 +343,7 @@ va_start (args, fmt); stderr_out ("\nXEmacs: fatal error: "); - std_handle_out_va (stderr, fmt, args, 0); + write_string_to_external_output_va (fmt, args, EXT_PRINT_STDERR); stderr_out ("\n"); va_end (args); @@ -1812,7 +1878,7 @@ } static void -write_string_to_alternate_debugging_output (Ibyte *str, Bytecount len) +write_string_to_alternate_debugging_output (const Ibyte *str, Bytecount len) { int extlen; const Extbyte *extptr; @@ -1832,6 +1898,35 @@ alternate_do_string[alternate_do_pointer] = 0; } + +DEFUN ("set-device-clear-left-side", Fset_device_clear_left_side, 2, 2, 0, /* +Set whether to output a newline before the next output to a stream device. +This will happen only if the most recently-outputted character was not +a newline -- i.e. it will make sure the left side is "clear" of text. +*/ + (device, value)) +{ + if (!NILP (device)) + CHECK_LIVE_DEVICE (device); + if (NILP (device) || DEVICE_STREAM_P (XDEVICE (device))) + /* #### This should be per-device */ + stdout_clear_before_next_output = !NILP (value); + return Qnil; +} + +DEFUN ("device-left-side-clear-p", Fdevice_left_side_clear_p, 0, 1, 0, /* +For stream devices, true if the most recent-outputted character was a newline. +*/ + (device)) +{ + if (!NILP (device)) + CHECK_LIVE_DEVICE (device); + if (NILP (device) || DEVICE_STREAM_P (XDEVICE (device))) + /* #### This should be per-device */ + return stdout_needs_newline ? Qt : Qnil; + return Qnil; +} + DEFUN ("external-debugging-output", Fexternal_debugging_output, 1, 3, 0, /* Write CHAR-OR-STRING to stderr or stdout. If optional arg STDOUT-P is non-nil, write to stdout; otherwise, write @@ -1917,9 +2012,14 @@ static int debug_print_level = 15; static int debug_print_readably = -1; -/* Debugging kludge -- unbuffered */ +/* Print an object, `prin1'-style, to various possible debugging outputs. + Make sure it's completely unbuffered so that, in the event of a crash + somewhere, we see as much as possible that happened before it. + + + */ static void -debug_print_no_newline (Lisp_Object debug_print_obj) +debug_prin1 (Lisp_Object debug_print_obj, int flags) { /* This function can GC */ @@ -1938,13 +2038,17 @@ internal_bind_lisp_object (&Vprint_level, make_int (debug_print_level)); /* #### Do we need this? It was in the old code. */ internal_bind_lisp_object (&Vinhibit_quit, Vinhibit_quit); - - print_internal (debug_print_obj, Qexternal_debugging_output, 1); - alternate_do_pointer = 0; - print_internal (debug_print_obj, Qalternate_debugging_output, 1); + + if ((flags & EXT_PRINT_STDOUT) || (flags & EXT_PRINT_STDERR)) + print_internal (debug_print_obj, Qexternal_debugging_output, 1); + if (flags & EXT_PRINT_ALTERNATE) + print_internal (debug_print_obj, Qalternate_debugging_output, 1); #ifdef WIN32_NATIVE - /* Write out to the debugger, as well */ - print_internal (debug_print_obj, Qmswindows_debugging_output, 1); + if (flags & EXT_PRINT_MSWINDOWS) + { + /* Write out to the debugger, as well */ + print_internal (debug_print_obj, Qmswindows_debugging_output, 1); + } #endif unbind_to (specdepth); @@ -2023,6 +2127,31 @@ inhibit_non_essential_printing_operations = 0; } +static void +ext_print_begin (int dest) +{ + if (dest & EXT_PRINT_ALTERNATE) + alternate_do_pointer = 0; + if (dest & (EXT_PRINT_STDERR | EXT_PRINT_STDOUT)) + stdout_clear_before_next_output = 1; +} + +static void +ext_print_end (int dest) +{ + if (dest & (EXT_PRINT_MSWINDOWS | EXT_PRINT_STDERR | EXT_PRINT_STDOUT)) + external_out (dest & (EXT_PRINT_MSWINDOWS | EXT_PRINT_STDERR | + EXT_PRINT_STDOUT), "\n"); +} + +static void +external_debug_print (Lisp_Object object, int dest) +{ + ext_print_begin (dest); + debug_prin1 (object, dest); + ext_print_end (dest); +} + void debug_p3 (Lisp_Object obj) { @@ -2035,8 +2164,7 @@ void debug_print (Lisp_Object debug_print_obj) { - debug_print_no_newline (debug_print_obj); - debug_out ("\n"); + external_debug_print (debug_print_obj, EXT_PRINT_ALL); } /* Getting tired of typing debug_print() ... */ @@ -2047,6 +2175,16 @@ debug_print (debug_print_obj); } +/* Alternate debug printer: Return a char * pointer to the output */ +char *dpa (Lisp_Object debug_print_obj); +char * +dpa (Lisp_Object debug_print_obj) +{ + external_debug_print (debug_print_obj, EXT_PRINT_ALTERNATE); + + return alternate_do_string; +} + /* Debugging kludge -- unbuffered */ /* This function provided for the benefit of the debugger. */ void @@ -2097,7 +2235,7 @@ } if (COMPILED_FUNCTIONP (*bt->function)) { -#if defined(COMPILED_FUNCTION_ANNOTATION_HACK) +#if defined (COMPILED_FUNCTION_ANNOTATION_HACK) Lisp_Object ann = compiled_function_annotation (XCOMPILED_FUNCTION (*bt->function)); #else @@ -2106,7 +2244,7 @@ if (!NILP (ann)) { debug_out (""); } else @@ -2115,7 +2253,7 @@ } } else - debug_print_no_newline (*bt->function); + debug_prin1 (*bt->function, EXT_PRINT_ALL); first = 0; length--; bt = bt->next; @@ -2145,6 +2283,8 @@ DEFSUBR (Fterpri); DEFSUBR (Fwrite_char); DEFSUBR (Falternate_debugging_output); + DEFSUBR (Fset_device_clear_left_side); + DEFSUBR (Fdevice_left_side_clear_p); DEFSUBR (Fexternal_debugging_output); DEFSUBR (Fopen_termscript); DEFSYMBOL (Qexternal_debugging_output); Index: src/process-unix.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-unix.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- src/process-unix.c 12 Jan 2003 11:08:20 -0000 1.51 +++ src/process-unix.c 1 Mar 2003 07:25:36 -0000 1.52 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -823,9 +823,7 @@ static void unix_init_process (void) { -#ifndef CANNOT_DUMP if (! noninteractive || initialized) -#endif EMACS_SIGNAL (SIGCHLD, sigchld_handler); } #endif /* SIGCHLD */ Index: src/profile.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/profile.c,v retrieving revision 1.16 retrieving revision 1.18 diff -u -r1.16 -r1.18 --- src/profile.c 13 Feb 2003 09:57:08 -0000 1.16 +++ src/profile.c 9 Mar 2003 02:27:45 -0000 1.18 @@ -26,6 +26,7 @@ #include "bytecode.h" #include "elhash.h" #include "hash.h" +#include "profile.h" #include "syssignal.h" #include "systime.h" @@ -50,8 +51,15 @@ The basic idea is simple. We set a profiling timer using setitimer (ITIMER_PROF), which generates a SIGPROF every so often. (This runs not in real time but rather when the process is executing or the system is - running on behalf of the process.) When the signal goes off, we see what - we're in, and add 1 to the count associated with that function. + running on behalf of the process -- at least, that is the case under + Unix. Under MS Windows and Cygwin, there is no setitimer(), so we + simulate it using multimedia timers, which run in real time. To make + the results a bit more realistic, we ignore ticks that go off while + blocking on an event wait. Note that Cygwin does provide a simulation + of setitimer(), but it's in real time anyway, since Windows doesn't + provide a way to have process-time timers, and furthermore, it's broken, + so we don't use it.) When the signal goes off, we see what we're in, and + add 1 to the count associated with that function. It would be nice to use the Lisp allocation mechanism etc. to keep track of the profiling information (i.e. to use Lisp hash tables), but we @@ -705,9 +713,12 @@ DEFVAR_INT ("default-profiling-interval", &default_profiling_interval /* Default CPU time in microseconds between profiling sampling. Used when the argument to `start-profiling' is nil or omitted. -Note that the time in question is CPU time (when the program is executing -or the kernel is executing on behalf of the program) and not real time, and -there is usually a machine-dependent limit on how small this value can be. +Under Unix, the time in question is CPU time (when the program is executing +or the kernel is executing on behalf of the program) and not real time. +Under MS Windows and Cygwin, the time is real time, but time spent blocking +while waiting for an event is ignored, to get more accurate results. +Note that there is usually a machine-dependent limit on how small this +value can be. */ ); default_profiling_interval = 1000; Index: src/ralloc.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ralloc.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/ralloc.c 9 Jul 2002 11:55:36 -0000 1.15 +++ src/ralloc.c 2 Mar 2003 09:38:54 -0000 1.16 @@ -65,6 +65,8 @@ #else /* Not emacs. */ +#define REGEX_MALLOC_CHECK() + #include typedef void *POINTER; @@ -943,6 +945,8 @@ { bloc_ptr new_bloc; + REGEX_MALLOC_CHECK (); + if (! r_alloc_initialized) init_ralloc (); @@ -967,6 +971,8 @@ { register bloc_ptr dead_bloc; + REGEX_MALLOC_CHECK (); + if (! r_alloc_initialized) init_ralloc (); @@ -1002,6 +1008,8 @@ { register bloc_ptr bloc; + REGEX_MALLOC_CHECK (); + if (! r_alloc_initialized) init_ralloc (); @@ -1854,6 +1862,8 @@ { MMAP_HANDLE mh; + REGEX_MALLOC_CHECK (); + switch(r_alloc_initialized) { case 0: @@ -1896,6 +1906,8 @@ void r_alloc_free (POINTER *ptr) { + REGEX_MALLOC_CHECK (); + switch( r_alloc_initialized) { case 0: abort(); @@ -1938,6 +1950,8 @@ POINTER r_re_alloc (POINTER *ptr, size_t sz) { + REGEX_MALLOC_CHECK (); + if (r_alloc_initialized == 0) { abort (); Index: src/redisplay-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-gtk.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/redisplay-gtk.c 20 Jun 2002 21:18:41 -0000 1.12 +++ src/redisplay-gtk.c 21 Feb 2003 06:56:59 -0000 1.13 @@ -2,7 +2,7 @@ Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1994 Lucid, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -73,10 +73,6 @@ static void gtk_output_horizontal_line (struct window *w, struct display_line *dl, struct rune *rb); -static void gtk_redraw_exposed_window (struct window *w, int x, int y, - int width, int height); -static void gtk_redraw_exposed_windows (Lisp_Object window, int x, int y, - int width, int height); static void gtk_clear_region (Lisp_Object locale, struct device* d, struct frame* f, face_index findex, int x, int y, int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, @@ -1467,133 +1463,6 @@ redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f), ypos1, FRAME_BORDER_WIDTH (f), height); } -} - -/***************************************************************************** - gtk_redraw_exposed_window - - Given a bounding box for an area that needs to be redrawn, determine - what parts of what lines are contained within and re-output their - contents. - ****************************************************************************/ -static void -gtk_redraw_exposed_window (struct window *w, int x, int y, int width, int height) -{ - struct frame *f = XFRAME (w->frame); - int line; - int start_x, start_y, end_x, end_y; - int orig_windows_structure_changed; - - display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP); - - if (!NILP (w->vchild)) - { - gtk_redraw_exposed_windows (w->vchild, x, y, width, height); - return; - } - else if (!NILP (w->hchild)) - { - gtk_redraw_exposed_windows (w->hchild, x, y, width, height); - return; - } - - /* If the window doesn't intersect the exposed region, we're done here. */ - if (x >= WINDOW_RIGHT (w) || (x + width) <= WINDOW_LEFT (w) - || y >= WINDOW_BOTTOM (w) || (y + height) <= WINDOW_TOP (w)) - { - return; - } - else - { - start_x = max (WINDOW_LEFT (w), x); - end_x = min (WINDOW_RIGHT (w), (x + width)); - start_y = max (WINDOW_TOP (w), y); - end_y = min (WINDOW_BOTTOM (w), y + height); - - /* We do this to make sure that the 3D modelines get redrawn if - they are in the exposed region. */ - orig_windows_structure_changed = f->windows_structure_changed; - f->windows_structure_changed = 1; - } - - if (window_needs_vertical_divider (w)) - { - gtk_output_vertical_divider (w, 0); - } - - for (line = 0; line < Dynarr_length (cdla); line++) - { - struct display_line *cdl = Dynarr_atp (cdla, line); - int top_y = cdl->ypos - cdl->ascent; - int bottom_y = cdl->ypos + cdl->descent; - - if (bottom_y >= start_y) - { - if (top_y > end_y) - { - if (line == 0) - continue; - else - break; - } - else - { - output_display_line (w, 0, cdla, line, start_x, end_x); - } - } - } - - f->windows_structure_changed = orig_windows_structure_changed; - - /* If there have never been any face cache_elements created, then this - expose event doesn't actually have anything to do. */ - if (Dynarr_largest (w->face_cachels)) - redisplay_clear_bottom_of_window (w, cdla, start_y, end_y); -} - -/***************************************************************************** - gtk_redraw_exposed_windows - - For each window beneath the given window in the window hierarchy, - ensure that it is redrawn if necessary after an Expose event. - ****************************************************************************/ -static void -gtk_redraw_exposed_windows (Lisp_Object window, int x, int y, int width, - int height) -{ - for (; !NILP (window); window = XWINDOW (window)->next) - gtk_redraw_exposed_window (XWINDOW (window), x, y, width, height); -} - -/***************************************************************************** - gtk_redraw_exposed_area - - For each window on the given frame, ensure that any area in the - Exposed area is redrawn. - ****************************************************************************/ -void -gtk_redraw_exposed_area (struct frame *f, int x, int y, int width, int height) -{ - /* If any window on the frame has had its face cache reset then the - redisplay structures are effectively invalid. If we attempt to - use them we'll blow up. We mark the frame as changed to ensure - that redisplay will do a full update. This probably isn't - necessary but it can't hurt. */ - -#ifdef HAVE_TOOLBARS - /* #### We would rather put these off as well but there is currently - no combination of flags which will force an unchanged toolbar to - redraw anyhow. */ - MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height)); -#endif - redraw_exposed_gutters (f, x, y, width, height); - - if (!f->window_face_cache_reset) - { - gtk_redraw_exposed_windows (f->root_window, x, y, width, height); - } - else - MARK_FRAME_CHANGED (f); } /**************************************************************************** Index: src/redisplay-msw.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-msw.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- src/redisplay-msw.c 20 Jun 2002 21:18:41 -0000 1.38 +++ src/redisplay-msw.c 21 Feb 2003 06:56:59 -0000 1.39 @@ -2,7 +2,7 @@ Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1994 Lucid, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -63,8 +63,6 @@ static void mswindows_set_dc_font (HDC hdc, Lisp_Object font, int under, int strike); static void mswindows_output_vertical_divider (struct window *w, int clear); -static void mswindows_redraw_exposed_windows (Lisp_Object window, int x, - int y, int width, int height); static void mswindows_output_dibitmap (struct frame *f, Lisp_Image_Instance *p, struct display_box *db, @@ -714,8 +712,10 @@ * to by PRC, and paints only the intersection */ static void -mswindows_redisplay_deadbox_maybe (struct window *w, const RECT *prc) +mswindows_redisplay_deadbox (struct window *w, int x, int y, int width, + int height) { + RECT rc = { x, y, x + width, y + height }; int sbh = window_scrollbar_height (w); int sbw = window_scrollbar_width (w); RECT rect_dead, rect_paint; @@ -734,7 +734,7 @@ rect_dead.top = WINDOW_TEXT_BOTTOM (w); rect_dead.bottom = rect_dead.top + sbh; - if (IntersectRect (&rect_paint, &rect_dead, prc)) + if (IntersectRect (&rect_paint, &rect_dead, &rc)) { struct frame *f = XFRAME (WINDOW_FRAME (w)); FillRect (get_frame_dc (f, 1), &rect_paint, @@ -745,133 +745,6 @@ #endif /* HAVE_SCROLLBARS */ /***************************************************************************** - mswindows_redraw_exposed_window - - Given a bounding box for an area that needs to be redrawn, determine - what parts of what lines are contained within and re-output their - contents. - Copied from redisplay-x.c - ****************************************************************************/ -static void -mswindows_redraw_exposed_window (struct window *w, int x, int y, int width, - int height) -{ - struct frame *f = XFRAME (w->frame); - int line; - int orig_windows_structure_changed; - RECT rect_window = { WINDOW_LEFT (w), WINDOW_TOP (w), - WINDOW_RIGHT (w), WINDOW_BOTTOM (w) }; - RECT rect_expose = { x, y, x + width, y + height }; - RECT rect_draw; - - display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP); - - if (!NILP (w->vchild)) - { - mswindows_redraw_exposed_windows (w->vchild, x, y, width, height); - return; - } - else if (!NILP (w->hchild)) - { - mswindows_redraw_exposed_windows (w->hchild, x, y, width, height); - return; - } - - /* If the window doesn't intersect the exposed region, we're done here. */ - if (!IntersectRect (&rect_draw, &rect_window, &rect_expose)) - return; - - /* We do this to make sure that the 3D modelines get redrawn if - they are in the exposed region. */ - orig_windows_structure_changed = f->windows_structure_changed; - f->windows_structure_changed = 1; - - if (window_needs_vertical_divider (w)) - { - mswindows_output_vertical_divider (w, 0); - } - - for (line = 0; line < Dynarr_length (cdla); line++) - { - struct display_line *cdl = Dynarr_atp (cdla, line); - - if (DISPLAY_LINE_YPOS (cdl) + DISPLAY_LINE_HEIGHT (cdl) - >= rect_draw.top) - { - if (DISPLAY_LINE_YPOS (cdl) > rect_draw.bottom) - { - if (line == 0) - continue; - else - break; - } - else - { - output_display_line (w, 0, cdla, line, - rect_draw.left, rect_draw.right); - } - } - } - - f->windows_structure_changed = orig_windows_structure_changed; - - /* If there have never been any face cache_elements created, then this - expose event doesn't actually have anything to do. */ - if (Dynarr_largest (w->face_cachels)) - redisplay_clear_bottom_of_window (w, cdla, rect_draw.top, rect_draw.bottom); - -#ifdef HAVE_SCROLLBARS - mswindows_redisplay_deadbox_maybe (w, &rect_expose); -#endif -} - -/***************************************************************************** - mswindows_redraw_exposed_windows - - For each window beneath the given window in the window hierarchy, - ensure that it is redrawn if necessary after an Expose event. - ****************************************************************************/ -static void -mswindows_redraw_exposed_windows (Lisp_Object window, int x, int y, int width, - int height) -{ - for (; !NILP (window); window = XWINDOW (window)->next) - mswindows_redraw_exposed_window (XWINDOW (window), x, y, width, height); -} - -/***************************************************************************** - mswindows_redraw_exposed_area - - For each window on the given frame, ensure that any area in the - Exposed area is redrawn. - ****************************************************************************/ -void -mswindows_redraw_exposed_area (struct frame *f, int x, int y, int width, int height) -{ - /* If any window on the frame has had its face cache reset then the - redisplay structures are effectively invalid. If we attempt to - use them we'll blow up. We mark the frame as changed to ensure - that redisplay will do a full update. This probably isn't - necessary but it can't hurt. */ -#ifdef HAVE_TOOLBARS - /* #### We would rather put these off as well but there is currently - no combination of flags which will force an unchanged toolbar to - redraw anyhow. */ - MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height)); -#endif - redraw_exposed_gutters (f, x, y, width, height); - - if (!f->window_face_cache_reset) - { - mswindows_redraw_exposed_windows (f->root_window, x, y, width, height); - GdiFlush(); - } - else - MARK_FRAME_CHANGED (f); -} - - -/***************************************************************************** mswindows_bevel_area Draw a 3d border around the specified area on window W. @@ -1338,15 +1211,15 @@ #ifdef HAVE_SCROLLBARS if (WINDOWP (locale)) - mswindows_redisplay_deadbox_maybe (XWINDOW (locale), &rect); + mswindows_redisplay_deadbox (XWINDOW (locale), x, y, width, height); #endif } -/* XXX Implement me! */ +/* #### Implement me! */ static void mswindows_clear_frame (struct frame *f) { - GdiFlush(); + GdiFlush (); } @@ -1372,6 +1245,9 @@ CONSOLE_HAS_METHOD (mswindows, bevel_area); CONSOLE_HAS_METHOD (mswindows, output_string); CONSOLE_HAS_METHOD (mswindows, output_pixmap); +#ifdef HAVE_SCROLLBARS + CONSOLE_HAS_METHOD (mswindows, redisplay_deadbox); +#endif /* redisplay methods - printer */ CONSOLE_HAS_METHOD (msprinter, frame_output_end); Index: src/redisplay-output.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-output.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- src/redisplay-output.c 9 Feb 2003 09:33:48 -0000 1.23 +++ src/redisplay-output.c 21 Feb 2003 06:56:59 -0000 1.24 @@ -1,6 +1,6 @@ /* Synchronize redisplay structures and output changes. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. Copyright (C) 1996 Chuck Thompson. Copyright (C) 1999, 2002 Andy Piper. @@ -59,6 +59,8 @@ struct display_box* dest, struct display_glyph_area* glyphsrc, int fullheight_p, Lisp_Object); +static void redisplay_redraw_exposed_windows (Lisp_Object window, int x, + int y, int width, int height); /***************************************************************************** sync_rune_structs @@ -2488,6 +2490,177 @@ #ifdef HAVE_SCROLLBARS update_window_scrollbars (w, NULL, !MINI_WINDOW_P (w), 0); #endif +} + +/***************************************************************************** + redisplay_redraw_exposed_window + + Given a bounding box for an area that needs to be redrawn, determine + what parts of what lines are contained within and re-output their + contents. + ****************************************************************************/ +static void +redisplay_redraw_exposed_window (struct window *w, int x, int y, int width, + int height) +{ + struct frame *f = XFRAME (w->frame); + int line; + int start_x, start_y, end_x, end_y; + int orig_windows_structure_changed; + + display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP); + + if (!NILP (w->vchild)) + { + redisplay_redraw_exposed_windows (w->vchild, x, y, width, height); + return; + } + else if (!NILP (w->hchild)) + { + redisplay_redraw_exposed_windows (w->hchild, x, y, width, height); + return; + } + + /* If the window doesn't intersect the exposed region, we're done here. */ + if (x >= WINDOW_RIGHT (w) || (x + width) <= WINDOW_LEFT (w) + || y >= WINDOW_BOTTOM (w) || (y + height) <= WINDOW_TOP (w)) + { + return; + } + else + { + start_x = max (WINDOW_LEFT (w), x); + end_x = min (WINDOW_RIGHT (w), (x + width)); + start_y = max (WINDOW_TOP (w), y); + end_y = min (WINDOW_BOTTOM (w), y + height); + + /* We do this to make sure that the 3D modelines get redrawn if + they are in the exposed region. */ + orig_windows_structure_changed = f->windows_structure_changed; + f->windows_structure_changed = 1; + } + + /* #### Not in GTK or MS Windows. I think is because of toolbars, which + are handled as widgets in GTK and MS Windows, but drawn ourselves in + X. For the moment I'm leaving this in, if it causes problems we have + some device method indicating whether we're drawing our own + toolbars. */ + redisplay_clear_top_of_window (w); + if (window_needs_vertical_divider (w)) + { + FRAMEMETH (f, output_vertical_divider, (w, 0)); + } + + for (line = 0; line < Dynarr_length (cdla); line++) + { + struct display_line *cdl = Dynarr_atp (cdla, line); + int top_y = DISPLAY_LINE_YPOS (cdl); + int bottom_y = DISPLAY_LINE_YPOS (cdl) + DISPLAY_LINE_HEIGHT (cdl); + + if (bottom_y >= start_y) + { + if (top_y > end_y) + { + if (line == 0) + continue; + else + break; + } + else + { + output_display_line (w, 0, cdla, line, start_x, end_x); + } + } + } + + f->windows_structure_changed = orig_windows_structure_changed; + + /* If there have never been any face cache_elements created, then this + expose event doesn't actually have anything to do. */ + if (Dynarr_largest (w->face_cachels)) + redisplay_clear_bottom_of_window (w, cdla, start_y, end_y); + +#ifdef HAVE_SCROLLBARS + MAYBE_FRAMEMETH (f, redisplay_deadbox, (w, x, y, width, height)); +#endif +} + + +/***************************************************************************** + redisplay_redraw_exposed_windows + + For each window beneath the given window in the window hierarchy, + ensure that it is redrawn if necessary after an Expose event. + ****************************************************************************/ +static void +redisplay_redraw_exposed_windows (Lisp_Object window, int x, int y, int width, + int height) +{ + for (; !NILP (window); window = XWINDOW (window)->next) + redisplay_redraw_exposed_window (XWINDOW (window), x, y, width, height); +} + +static void +redisplay_redraw_exposed_area_1 (Lisp_Object arg) +{ + assert (!in_display); + redisplay_redraw_exposed_area (XFRAME (X1ST (arg)), + XINT (X2ND (arg)), + XINT (X3RD (arg)), + XINT (X4TH (arg)), + XINT (X5TH (arg))); + free_list (arg); +} + +/***************************************************************************** + redisplay_redraw_exposed_area + + For each window on the given frame, ensure that any area in the + Exposed area is redrawn. + ****************************************************************************/ +void +redisplay_redraw_exposed_area (struct frame *f, int x, int y, int width, + int height) +{ + int depth; + + if (in_display) + { + /* Not safe to do it now, so delay it */ + register_post_redisplay_action (redisplay_redraw_exposed_area_1, + list5 (wrap_frame (f), make_int (x), + make_int (y), make_int (width), + make_int (height))); + return; + } + + depth = enter_redisplay_critical_section (); + + MAYBE_FRAMEMETH (f, frame_output_begin, (f)); + + /* If any window on the frame has had its face cache reset then the + redisplay structures are effectively invalid. If we attempt to + use them we'll blow up. We mark the frame as changed to ensure + that redisplay will do a full update. This probably isn't + necessary but it can't hurt. */ +#ifdef HAVE_TOOLBARS + /* #### We would rather put these off as well but there is currently + no combination of flags which will force an unchanged toolbar to + redraw anyhow. */ + MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height)); +#endif + redraw_exposed_gutters (f, x, y, width, height); + + if (!f->window_face_cache_reset) + { + redisplay_redraw_exposed_windows (f->root_window, x, y, width, height); + /* #### Why not call this always? */ + MAYBE_FRAMEMETH (f, frame_output_end, (f)); + } + else + MARK_FRAME_CHANGED (f); + + exit_redisplay_critical_section (depth); } /***************************************************************************** Index: src/redisplay-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-x.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- src/redisplay-x.c 12 Jan 2003 11:08:20 -0000 1.35 +++ src/redisplay-x.c 21 Feb 2003 06:56:59 -0000 1.36 @@ -2,7 +2,7 @@ Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1994 Lucid, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -68,10 +68,6 @@ int cursor_start, int cursor_width); static void x_output_hline (struct window *w, struct display_line *dl, struct rune *rb); -static void x_redraw_exposed_window (struct window *w, int x, int y, - int width, int height); -static void x_redraw_exposed_windows (Lisp_Object window, int x, int y, - int width, int height); static void x_output_eol_cursor (struct window *w, struct display_line *dl, int xpos, face_index findex); static void x_clear_frame (struct frame *f); @@ -1674,137 +1670,6 @@ *bottom_shadow = background; } } -} - -/***************************************************************************** - x_redraw_exposed_window - - Given a bounding box for an area that needs to be redrawn, determine - what parts of what lines are contained within and re-output their - contents. - ****************************************************************************/ -static void -x_redraw_exposed_window (struct window *w, int x, int y, int width, int height) -{ - struct frame *f = XFRAME (w->frame); - int line; - int start_x, start_y, end_x, end_y; - int orig_windows_structure_changed; - - display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP); - - if (!NILP (w->vchild)) - { - x_redraw_exposed_windows (w->vchild, x, y, width, height); - return; - } - else if (!NILP (w->hchild)) - { - x_redraw_exposed_windows (w->hchild, x, y, width, height); - return; - } - - /* If the window doesn't intersect the exposed region, we're done here. */ - if (x >= WINDOW_RIGHT (w) || (x + width) <= WINDOW_LEFT (w) - || y >= WINDOW_BOTTOM (w) || (y + height) <= WINDOW_TOP (w)) - { - return; - } - else - { - start_x = max (WINDOW_LEFT (w), x); - end_x = min (WINDOW_RIGHT (w), (x + width)); - start_y = max (WINDOW_TOP (w), y); - end_y = min (WINDOW_BOTTOM (w), y + height); - - /* We do this to make sure that the 3D modelines get redrawn if - they are in the exposed region. */ - orig_windows_structure_changed = f->windows_structure_changed; - f->windows_structure_changed = 1; - } - - redisplay_clear_top_of_window (w); - if (window_needs_vertical_divider (w)) - { - x_output_vertical_divider (w, 0); - } - - for (line = 0; line < Dynarr_length (cdla); line++) - { - struct display_line *cdl = Dynarr_atp (cdla, line); - int top_y = cdl->ypos - cdl->ascent; - int bottom_y = cdl->ypos + cdl->descent; - - if (bottom_y >= start_y) - { - if (top_y > end_y) - { - if (line == 0) - continue; - else - break; - } - else - { - output_display_line (w, 0, cdla, line, start_x, end_x); - } - } - } - - f->windows_structure_changed = orig_windows_structure_changed; - - /* If there have never been any face cache_elements created, then this - expose event doesn't actually have anything to do. */ - if (Dynarr_largest (w->face_cachels)) - redisplay_clear_bottom_of_window (w, cdla, start_y, end_y); -} - -/***************************************************************************** - x_redraw_exposed_windows - - For each window beneath the given window in the window hierarchy, - ensure that it is redrawn if necessary after an Expose event. - ****************************************************************************/ -static void -x_redraw_exposed_windows (Lisp_Object window, int x, int y, int width, - int height) -{ - for (; !NILP (window); window = XWINDOW (window)->next) - x_redraw_exposed_window (XWINDOW (window), x, y, width, height); -} - -/***************************************************************************** - x_redraw_exposed_area - - For each window on the given frame, ensure that any area in the - Exposed area is redrawn. - ****************************************************************************/ -void -x_redraw_exposed_area (struct frame *f, int x, int y, int width, int height) -{ - /* If any window on the frame has had its face cache reset then the - redisplay structures are effectively invalid. If we attempt to - use them we'll blow up. We mark the frame as changed to ensure - that redisplay will do a full update. This probably isn't - necessary but it can't hurt. */ - -#ifdef HAVE_TOOLBARS - /* #### We would rather put these off as well but there is currently - no combination of flags which will force an unchanged toolbar to - redraw anyhow. */ - MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height)); -#endif - redraw_exposed_gutters (f, x, y, width, height); - - if (!f->window_face_cache_reset) - { - x_redraw_exposed_windows (f->root_window, x, y, width, height); - - if (!(check_if_pending_expose_event (FRAME_XDEVICE (f)))) - XFlush (DEVICE_X_DISPLAY (FRAME_XDEVICE (f))); - } - else - MARK_FRAME_CHANGED (f); } /**************************************************************************** Index: src/redisplay.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay.c,v retrieving revision 1.86 retrieving revision 1.88 diff -u -r1.86 -r1.88 --- src/redisplay.c 13 Feb 2003 09:57:08 -0000 1.86 +++ src/redisplay.c 22 Feb 2003 02:08:33 -0000 1.88 @@ -38,15 +38,9 @@ Third: It Is Better To Be Fast Than Not To Be ****************************************************************************/ -/* Note: The second rule used to prohibit running Elisp from within redisplay, - but that's not correct. - - Use - - callN_trapping_problems (..., INHIBIT_GC - | INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY) - - instead. +/* Note: The second rule used to prohibit running Elisp from within + redisplay, but that's not correct any more -- use + call*_trapping_problems() or call_with_suspended_errors() instead. --ben */ @@ -68,6 +62,7 @@ #include "insdel.h" #include "menubar.h" #include "objects-impl.h" +#include "opaque.h" #include "process.h" #include "profile.h" #include "redisplay.h" @@ -319,6 +314,7 @@ #define QUEUED_EVENTS_REQUIRED_FOR_PREEMPTION 4 +/* Note that doing this can call Lisp. */ #define REDISPLAY_PREEMPTION_CHECK \ ((void) \ (preempted = \ @@ -358,6 +354,10 @@ int in_display; /* 1 if in redisplay. */ +/* Whether we should delay size changes. Broken out of + enter_redisplay_critical_section(). */ +int hold_frame_size_changes; + int disable_preemption; /* Used for debugging redisplay and for force-redisplay. */ @@ -503,6 +503,8 @@ static Lisp_Object QSin_redisplay; +static Lisp_Object Vpost_redisplay_actions; + int column_number_start_at_one; Lisp_Object Qtop_bottom; @@ -5314,6 +5316,115 @@ return ret_charcount; } + +/* Tricky tricky tricky. generate_displayable_area() can (could) be called reentrantly, and redisplay is not prepared to handle this: + +assert_failed(const char * 0x0129c8c8 `string', int 5328, const char * 0x01274068 `string') line 3620 +Dynarr_verify_mod_1(void * 0x0250f228, const char * 0x0129c8c8 `string', int 5328) line 1256 + 36 bytes +generate_displayable_area(window * 0x02480028, long 38776292, int 0, int 0, int 265, int 169, display_line_dynarr * 0x0250f228, long 0, int 2) line 5328 + 25 bytes +output_gutter(frame * 0x0228ad90, gutter_pos TOP_GUTTER, int 1) line 409 + 69 bytes +redraw_exposed_gutter(frame * 0x0228ad90, gutter_pos TOP_GUTTER, int 8, int 23, int 249, int 127) line 687 + 15 bytes +redraw_exposed_gutters(frame * 0x0228ad90, int 8, int 23, int 249, int 127) line 703 + 29 bytes +mswindows_redraw_exposed_area(frame * 0x0228ad90, int 8, int 23, int 249, int 127) line 862 + 25 bytes +mswindows_handle_paint(frame * 0x0228ad90) line 2176 + 25 bytes +mswindows_wnd_proc(HWND__ * 0x001003e2, unsigned int 15, unsigned int 0, long 0) line 3233 + 45 bytes +intercepted_wnd_proc(HWND__ * 0x001003e2, unsigned int 15, unsigned int 0, long 0) line 2488 +USER32! 77e3a244() +USER32! 77e14730() +USER32! 77e1558a() +NTDLL! KiUserCallbackDispatcher@12 + 19 bytes +USER32! 77e14680() +USER32! 77e1a792() +qxeIsDialogMessage(HWND__ * 0x001003e2, tagMSG * 0x0082a93c {msg=0x0000000f wp=0x00000000 lp=0x00000000}) line 2298 + 14 bytes +mswindows_is_dialog_msg(tagMSG * 0x0082a93c {msg=0x0000000f wp=0x00000000 lp=0x00000000}) line 165 + 13 bytes +mswindows_drain_windows_queue(int 0) line 1282 + 9 bytes +emacs_mswindows_drain_queue() line 1326 + 7 bytes +event_stream_drain_queue() line 1887 +event_stream_quit_p() line 1992 +check_quit() line 993 +unbind_to_hairy(int 35) line 5963 +unbind_to_1(int 35, long 20888208) line 5945 + 200 bytes +specifier_instance_from_inst_list(long 21379344, long 38135616, long 36220304, long 20888208, _error_behavior_struct_ {...}, int 1, long 3) line 2522 + 16 bytes +specifier_instance(long 21379344, long 38135616, long 36220304, _error_behavior_struct_ {...}, int 1, int 0, long 3) line 2625 + 65 bytes +specifier_instance_no_quit(long 21379344, long 38135616, long 36220304, _error_behavior_struct_ {...}, int 0, long 1) line 2658 + 31 bytes +face_property_matching_instance(long 22612340, long 20860632, long 22530956, long 36220304, _error_behavior_struct_ {...}, int 0, long 1) line 565 + 48 bytes +ensure_face_cachel_contains_charset(face_cachel * 0x0082b014, long 36220304, long 22530956) line 1104 + 35 bytes +update_face_cachel_data(face_cachel * 0x0082b014, long 36220304, long 22612340) line 1304 + 19 bytes +query_string_geometry(long 21110576, long 22612340, int * 0x00000000, int * 0x0082b5b4, int * 0x00000000, long 38852960) line 2370 + 23 bytes +mswindows_widget_query_string_geometry(long 21110576, long 22612340, int * 0x0082b5b8, int * 0x0082b5b4, long 38852960) line 2914 + 25 bytes +widget_query_string_geometry(long 21110576, long 22612340, int * 0x0082b5b8, int * 0x0082b5b4, long 38852960) line 514 + 32 bytes +edit_field_query_geometry(long 38857648, int * 0x0082b7b4, int * 0x0082b7b8, image_instance_geometry IMAGE_DESIRED_GEOMETRY, long 38852960) line 920 + 390 bytes +widget_query_geometry(long 38857648, int * 0x0082b7b4, int * 0x0082b7b8, image_instance_geometry IMAGE_DESIRED_GEOMETRY, long 38852960) line 567 + 26 bytes +image_instance_query_geometry(long 38857648, int * 0x0082b7b4, int * 0x0082b7b8, image_instance_geometry IMAGE_DESIRED_GEOMETRY, long 38852960) line 2015 + 26 bytes +glyph_query_geometry(long 38853384, int * 0x0082b7b4, int * 0x0082b7b8, image_instance_geometry IMAGE_DESIRED_GEOMETRY, long 38852960) line 4197 + 25 bytes +layout_query_geometry(long 38852960, int * 0x0082b9cc, int * 0x0082b9d0, image_instance_geometry IMAGE_DESIRED_GEOMETRY, long 38404624) line 1351 + 25 bytes +widget_query_geometry(long 38852960, int * 0x0082b9cc, int * 0x0082b9d0, image_instance_geometry IMAGE_DESIRED_GEOMETRY, long 38404624) line 567 + 26 bytes +image_instance_query_geometry(long 38852960, int * 0x0082b9cc, int * 0x0082b9d0, image_instance_geometry IMAGE_DESIRED_GEOMETRY, long 38404624) line 2015 + 26 bytes +glyph_query_geometry(long 38537976, int * 0x0082b9cc, int * 0x0082b9d0, image_instance_geometry IMAGE_DESIRED_GEOMETRY, long 38404624) line 4197 + 25 bytes +layout_layout(long 38404624, int 265, int 156, int -2, int -2, long 38273064) line 1468 + 23 bytes +widget_layout(long 38404624, int 265, int 156, int -2, int -2, long 38273064) line 626 + 30 bytes +image_instance_layout(long 38404624, int 265, int 156, int -2, int -2, long 38273064) line 2102 + 51 bytes +glyph_ascent(long 38404624, long 38273064) line 4009 + 21 bytes +update_glyph_cachel_data(window * 0x02480028, long 36201168, glyph_cachel * 0x0248c3d8) line 4272 + 13 bytes +get_glyph_cachel_index(window * 0x02480028, long 36201168) line 4306 + 17 bytes +add_glyph_rune(position_redisplay_data_type * 0x0082bf2c, glyph_block * 0x024bd028, int 0, int 0, glyph_cachel * 0x00000000) line 1800 + 15 bytes +add_glyph_runes(position_redisplay_data_type * 0x0082bf2c, int 0) line 2085 + 31 bytes +create_string_text_block(window * 0x02480028, long 38776292, display_line * 0x02514500, long 0, prop_block_dynarr * * 0x0082c13c, int 2) line 4907 + 14 bytes +generate_string_display_line(window * 0x02480028, long 38776292, display_line * 0x02514500, long 0, prop_block_dynarr * * 0x0082c13c, int 2) line 5293 + 29 bytes +generate_displayable_area(window * 0x02480028, long 38776292, int 0, int 0, int 265, int 169, display_line_dynarr * 0x0250f228, long 0, int 2) line 5372 + 29 bytes +output_gutter(frame * 0x0228ad90, gutter_pos TOP_GUTTER, int 0) line 409 + 69 bytes +update_frame_gutters(frame * 0x0228ad90) line 639 + 15 bytes +redisplay_frame(frame * 0x0228ad90, int 1) line 6792 + 9 bytes +redisplay_device(device * 0x0171df00, int 1) line 6911 + 11 bytes +redisplay_without_hooks() line 6957 + 11 bytes +redisplay_no_pre_idle_hook() line 7029 +redisplay() line 7011 +mswindows_wnd_proc(HWND__ * 0x001003e2, unsigned int 5, unsigned int 0, long 10223881) line 3424 +intercepted_wnd_proc(HWND__ * 0x001003e2, unsigned int 5, unsigned int 0, long 10223881) line 2488 +USER32! 77e3a244() +USER32! 77e16362() +USER32! 77e14c1a() +USER32! 77e1dd30() +mswindows_wnd_proc(HWND__ * 0x001003e2, unsigned int 71, unsigned int 0, long 8578308) line 3926 + 21 bytes +intercepted_wnd_proc(HWND__ * 0x001003e2, unsigned int 71, unsigned int 0, long 8578308) line 2488 +USER32! 77e3a244() +USER32! 77e14730() +USER32! 77e174b4() +NTDLL! KiUserCallbackDispatcher@12 + 19 bytes +mswindows_set_frame_size(frame * 0x0228ad90, int 265, int 156) line 355 +internal_set_frame_size(frame * 0x0228ad90, int 265, int 156, int 0) line 2754 + 24 bytes +Fset_frame_displayable_pixel_size(long 36220304, long 531, long 313, long 20888208) line 3004 + 32 bytes +Ffuncall(int 4, long * 0x0082e778) line 3844 + 168 bytes +execute_optimized_program(const unsigned char * 0x02286e48, int 40, long * 0x01529b80) line 609 + 16 bytes +funcall_compiled_function(long 22433308, int 0, long * 0x0082ec08) line 3452 + 85 bytes +Ffuncall(int 1, long * 0x0082ec04) line 3883 + 17 bytes +execute_optimized_program(const unsigned char * 0x02286d40, int 6, long * 0x01548ddc) line 609 + 16 bytes +funcall_compiled_function(long 22505864, int 11, long * 0x0082f00c) line 3452 + 85 bytes +Ffuncall(int 12, long * 0x0082f008) line 3883 + 17 bytes +execute_optimized_program(const unsigned char * 0x02503e38, int 47, long * 0x0152dc48) line 609 + 16 bytes +funcall_compiled_function(long 22436784, int 0, long * 0x0082f534) line 3452 + 85 bytes +Ffuncall(int 1, long * 0x0082f530) line 3883 + 17 bytes +apply1(long 22436784, long 20888208) line 4458 + 11 bytes +Fcall_interactively(long 20742816, long 20888208, long 20888208) line 460 + 13 bytes +Ffuncall(int 2, long * 0x0082f8ec) line 3844 + 127 bytes +call1(long 20854392, long 20742816) line 4489 + 11 bytes +execute_command_event(command_builder * 0x01798f98, long 24439276) line 4198 + 69 bytes +Fdispatch_event(long 24439276) line 4569 + 13 bytes +Fcommand_loop_1() line 569 + 9 bytes +command_loop_1(long 20888208) line 489 +condition_case_1(long 20886024, long (long)* 0x010955a0 command_loop_1(long), long 20888208, long (long, long)* 0x01095150 cmd_error(long, long), long 20888208) line 1917 + 7 bytes +command_loop_3() line 251 + 35 bytes +command_loop_2(long 20888208) line 264 +internal_catch(long 20650992, long (long)* 0x010952c0 command_loop_2(long), long 20888208, int * volatile 0x00000000, long * volatile 0x00000000) line 1527 + 7 bytes +initial_command_loop(long 20888208) line 300 + 28 bytes +xemacs_21_5_b10_i586_pc_win32(int 1, char * * 0x00e52620, char * * 0x00e52bb0, int 0) line 2356 +main(int 1, char * * 0x00e52620, char * * 0x00e52bb0) line 2733 +mainCRTStartup() line 338 + 17 bytes +KERNEL32! 77ea847c() + +*/ + + /* This is ripped off from regenerate_window. All we want to do is loop through elements in the string creating display lines until we have covered the provided area. Simple really. */ @@ -5373,8 +5484,10 @@ dlp->bounds = bounds; dlp->offset = 0; + Dynarr_lock (dla); next_pos = generate_string_display_line (w, disp_string, dlp, start_pos, &prop, default_face); + Dynarr_unlock (dla); /* we need to make sure that we continue along the line if there is more left to display otherwise we just end up redisplaying the same chunk over and over again. */ @@ -5521,7 +5634,9 @@ dlp->bounds = bounds; dlp->offset = 0; + Dynarr_lock (dla); start_pos = generate_display_line (w, dlp, 1, start_pos, &prop, type); + Dynarr_unlock (dla); if (yclip > dlp->ascent) { @@ -5577,8 +5692,11 @@ { /* #### This means that we've added a cursor at EOB twice. Yuck oh yuck. */ - struct display_block *db = - get_display_block_from_line (dlp, TEXT); + struct display_block *db; + + Dynarr_lock (dla); + db = get_display_block_from_line (dlp, TEXT); + Dynarr_unlock (dla); Dynarr_atp (db->runes, dlp->cursor_elt)->cursor_type = NO_CURSOR; dlp->cursor_elt = -1; @@ -6580,6 +6698,217 @@ } } +/* Register an action to be called at the end of redisplay. + in_display is 0 when this is called. + This is used when it is discovered that an action needs to be taken, + but it's during redisplay, so it's not safe. (Typically, it's an action + that needs to enter redisplay, which can't happen reentrantly.) + + NEVER signal an error in these functions. +*/ + +void +register_post_redisplay_action (void (*fun) (Lisp_Object), Lisp_Object arg) +{ + Vpost_redisplay_actions = nconc2 (Vpost_redisplay_actions, + list1 (Fcons (make_opaque_ptr + ((void *) fun), arg))); +} + +static int running_post_redisplay_actions; + +static void +run_post_redisplay_actions (void) +{ + int depth; + + if (running_post_redisplay_actions) + return; + + depth = internal_bind_int (&running_post_redisplay_actions, 1); + /* If the function pushes further actions, they will be tacked onto + the end of the list, and we'll run them when we're done with the + current ones. */ + while (!NILP (Vpost_redisplay_actions)) + { + Lisp_Object car = XCAR (Vpost_redisplay_actions); + void (*fun) (Lisp_Object) = + (void (*)(Lisp_Object)) get_opaque_ptr (XCAR (car)); + (*fun) (XCDR (car)); + free_opaque_ptr (XCAR (car)); + free_cons (car); + Vpost_redisplay_actions = XCDR (Vpost_redisplay_actions); + } + unbind_to (depth); +} + +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS + +static Lisp_Object +commit_ritual_suicide (Lisp_Object ceci_nest_pas_une_pipe) +{ + assert (!in_display); + return Qnil; +} + +#endif + +/* Within the guts of redisplay, we are defenseless and cannot allow any of + the following to happen: + + 1) garbage collection + 2) QUIT + 3) any non-local exits + 4) frame size changes + 5) deletion of any buffers, windows, frames, etc. + 6) modification of buffer text + 7) reentrant entry of redisplay (see the stack trace above + generate_displayable_area()) + + The general reason is that the redisplay code is written to assume that + it is the only code running, and thus (a) cannot tolerate structures + changed out from under it (hence 1, 4, 5, 6, 7) and (b) at various points + within redisplay the redisplay structures may be in an inconsistent + state and there are no unwind-protects to clean the structures up in + case of non-local exit (hence 2, 3). Fixing redisplay to address these + issues is hard and perhaps not worth it (and might slow things down a + fair amount). We address 1, 4, 5 and 6 ourselves inside of + enter_redisplay_critical_section() by simply inhibiting them, but we + cannot handle 2 and 3, which must be handled at the actual point where + they may occur (especially, internal_equal() or any place that may call + Lisp), by wrapping the code in call_trapping_problems() or + call_with_suspended_errors(). [[ NOTE: We could address QUIT by inhibiting + it but this would be anti-social because it would prevent the user from + interrupting any Lisp code called within the critical section. With the + call_*() wrapping, C-g will interrupt the Lisp code and throw back to + the innermost wrapping. ]] In fact we do turn off QUIT handling, since + it's just too dangerous otherwise. See below. + + Code calling enter_redisplay_critical_section() must check for reentrancy + (#7) and take appropriate corrective action. + + To help debug potential problems, we arrange (when + ERROR_CHECK_TRAPPING_PROBLEMS is set) to crash automatically every time + we execute QUIT or call Lisp code unless proper wrapping is in place, as + well as further checks when we actually Fsignal(), Fthrow(), + garbage_collect_1(). + + #### If a frame-size change does occur we should probably actually be + preempting redisplay. */ + +/* Count of number of recursive times we call + enter_redisplay_critical_section() or + enter_redisplay_critical_section_maybe(). + enter_redisplay_critical_section() cannot occur reentrantly but we have + to know in the *maybe() version whether to exit the section when we're + done. */ +static int in_display_nesting; + +static Lisp_Object +end_hold_frame_size_changes (Lisp_Object obj) +{ + if (!hold_frame_size_changes) + { + /* we used to have a function to do this for only one frame, and + it was typical to call it at the end of a critical section + (which occurs once per frame); but what then happens if multiple + frames have frame changes held up? + + This means we are O(N^2) over frames. I seriously doubt it matters. + --ben */ + Lisp_Object frmcons, devcons, concons; + + FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) + { + struct frame *f = XFRAME (XCAR (frmcons)); + if (f->size_change_pending) + change_frame_size (f, f->new_height, f->new_width, 0); + } + } + return Qnil; +} + +/* Call this to temporarily prevent frame-size changes from being processed. + To undo, use unbind_to(), passing it the value returned by this function. +*/ + +int +begin_hold_frame_size_changes (void) +{ + int depth = specpdl_depth (); + record_unwind_protect (end_hold_frame_size_changes, Qnil); + internal_bind_int (&hold_frame_size_changes, 1 + hold_frame_size_changes); + return depth; +} + +int +enter_redisplay_critical_section (void) +{ + int depth = specpdl_depth (); + + /* Reentrant entry is deadly. The calling function must check for this. */ + assert (!in_display); + begin_hold_frame_size_changes (); + /* Make sure in_display gets reset, but don't set it yet so that + commit_ritual_suicide() can be used. */ + internal_bind_int (&in_display, 0); + internal_bind_int (&in_display_nesting, 1 + in_display_nesting); +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS + /* Force every call to QUIT to check for in_displayness. This will + verify proper wrapping, as in the previous comment, aborting if not. */ + something_happened++; + /* Verify that no nonlocal exits blow past us. */ + record_unwind_protect (commit_ritual_suicide, Qnil); +#endif + in_display++; + + set_trapping_problems_flags (INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY); + /* Even checking for QUIT can cause arbitrary Lisp code to be executed, + e.g. through a menu handler. We really don't want that happening + inside of redisplay. Code that we `eval' is at least written with the + expectation that it's inside of redisplay, and shouldn't try anything + weird; but that's not the case for menu code (e.g. custom loads huge + amounts of LISP FILES from a menu handler! FMH!). Safest just to turn + this off. We could turn it on using UNINHIBIT_QUIT or + begin_do_check_for_quit() in certain places if we want, if we know + it's not in an especially tricky place. */ + begin_dont_check_for_quit (); + return depth; +} + +void +exit_redisplay_critical_section (int depth) +{ + in_display--; + assert (!in_display); + unbind_to (depth); + + run_post_redisplay_actions (); +} + +/* Enter the redisplay critical section if we're not already in it. This + is for code that needs frame changes held up and other protections from + being inside, but doesn't modify the redisplay structures, and doesn't + look at them in a way that they will be confused by inconsistencies. */ + +int +enter_redisplay_critical_section_maybe (void) +{ + if (!in_display) + return enter_redisplay_critical_section (); + else + return internal_bind_int (&in_display_nesting, 1 + in_display_nesting); +} + +void +exit_redisplay_critical_section_maybe (int depth) +{ + if (in_display_nesting == 1) + exit_redisplay_critical_section (depth); + else + unbind_to (depth); +} + /* Ensure that all windows on the given frame are correctly displayed. Return non-zero if pre-empted. */ @@ -6591,9 +6920,19 @@ assert (f->init_finished); + /* NOTE: Without sufficient checks for stream frames, we got weird + crashes in pdump. These came and went very easily -- adding the + critical-section code for redisplay was enough to trigger them. + Perhaps I should have debugged them but there didn't seem to be any + point. --ben */ if (FRAME_STREAM_P (f)) /* nothing to do */ return 0; + /* Reentrancy into redisplay can be deadly. See stack trace above + generate_displayable_area(). */ + if (in_display) + return 1; + if (preemption_check && !DEVICE_IMPL_FLAG (d, XDEVIMPF_DONT_PREEMPT_REDISPLAY)) { @@ -6630,11 +6969,11 @@ assert (!f->size_slipped); } - /* The menubar, toolbar, and icon updates must be done before + /* The menubar, toolbar, and icon updates should be done before enter_redisplay_critical_section is called and we are officially - 'in_display'. They may eval lisp code which may call QUIT. - If in_display is set, QUIT will abort (unless the code is wrapped - to protect against errors). */ + 'in_display'. They is because they tend to eval Lisp code, which + needs to be carefully wrapped within the critical section (and hence + is difficult to debug). */ #ifdef HAVE_MENUBARS /* Update the menubar. It is done first since it could change @@ -6679,32 +7018,8 @@ depth = enter_redisplay_critical_section (); /* ----------------- BEGIN CRITICAL REDISPLAY SECTION ---------------- */ - /* Within this section, we are defenseless and assume that the - following cannot happen: - 1) garbage collection - 2) QUIT - 3) Any non-local exits - 4) frame size changes - - We ensure (4) by calling enter_redisplay_critical_section(), which - will cause any pending frame size changes to get put on hold - till after the end of the critical section. (2) is required because - of the possibility of (3). (2) and (3) mean that any place that - can execute QUIT (e.g. internal_equal()), and especially any place - that executes Lisp code, need to be properly wrapped to protect - against these possibilities. This wrapping happens using - call_trapping_problems(..., INHIBIT_GC), or related functions. - - To help debug potential problems, we arrange (when - ERROR_CHECK_TRAPPING_PROBLEMS is set) to crash automatically every - time we execute QUIT or check to see whether garbage collection is - necessary, inside of an unprotected critical section, as well as - further checks when we actually Fsignal(), Fthrow(), - garbage_collect_1(). - - #### If a frame-size change does occur we should probably - actually be preempting redisplay. */ + /* See comments in enter_redisplay_critical_section() */ MAYBE_DEVMETH (d, frame_output_begin, (f)); @@ -6715,7 +7030,11 @@ inhibit_quit. More importantly the code involving display lines *assumes* that GC will not happen and so does not GCPRO anything. Since we use this code the whole time with the gutters - we cannot allow GC to happen when manipulating the gutters. */ + we cannot allow GC to happen when manipulating the gutters. + + This must be inside of the critical section for various reasons. + For example, it messes with display structures, which be left in + an inconsistent state. */ update_frame_gutters (f); /* Erase the frame before outputting its contents. */ @@ -6920,16 +7239,10 @@ PROFILE_RECORD_EXITING_SECTION (QSin_redisplay); } -/* Note: All places in the C code that call redisplay() are prepared - to handle GCing. However, we can't currently handle GC inside the - guts of redisplay (#### someone should fix this), so we need to use - INHIBIT_GC when calling Lisp. - - #### We probably can't handle any deletion of existing buffers, frames, - windows, devices, consoles, text changes, etc. either. We should - - (a) Create the appropriate INHIBIT_ flags for this. - (b) In the longer run, fix redisplay to handle this. +/* Note: All places in the C code that call redisplay() are prepared to + handle GCing, which can happen from run_pre_idle_hook(). However, we + can't currently handle GC inside the guts of redisplay; see + enter_redisplay_critical_section(). (#### What about other external entry points to the redisplay code? Someone should go through and make sure that all callers can handle @@ -6967,8 +7280,7 @@ return eval_in_buffer_trapping_problems ("Error calling function within redisplay", current_buffer, - dont_trust_this_damn_sucker, - INHIBIT_GC | INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY); + dont_trust_this_damn_sucker, 0); } /* Efficiently determine the window line number, and return a pointer @@ -7308,7 +7620,7 @@ if (dl->display_blocks) { for (block = 0; block < Dynarr_largest (dl->display_blocks); block++) - { + { struct display_block *db = Dynarr_atp (dl->display_blocks, block); Dynarr_free (db->runes); @@ -9120,6 +9432,9 @@ { Lisp_Object devcons, concons; + if (in_display) + return Qnil; + DEVICE_LOOP_NO_BREAK (devcons, concons) { struct device *d = XDEVICE (XCAR (devcons)); @@ -9660,6 +9975,9 @@ { QSin_redisplay = build_msg_string ("(in redisplay)"); staticpro (&QSin_redisplay); + + Vpost_redisplay_actions = Qnil; + staticpro (&Vpost_redisplay_actions); #if 0 staticpro (&last_arrow_position); Index: src/redisplay.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- src/redisplay.h 12 Jan 2003 11:08:21 -0000 1.18 +++ src/redisplay.h 21 Feb 2003 06:56:59 -0000 1.19 @@ -1,7 +1,7 @@ /* Redisplay data structures. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1996 Chuck Thompson. - Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -662,6 +662,10 @@ /* Nonzero if we're in a display critical section. */ extern int in_display; +/* Whether we should delay size changes. Broken out of + enter_redisplay_critical_section(). */ +extern int hold_frame_size_changes; + /* Nonzero means no need to redraw the entire frame on resuming a suspended Emacs. This is useful on terminals with multiple pages, where one page is used for Emacs and another for all else. */ @@ -827,5 +831,14 @@ void sync_display_line_structs (struct window *w, int line, int do_blocks, display_line_dynarr *cdla, display_line_dynarr *ddla); +void redisplay_redraw_exposed_area (struct frame *f, int x, int y, int width, + int height); +void register_post_redisplay_action (void (*fun) (Lisp_Object), + Lisp_Object arg); +int begin_hold_frame_size_changes (void); +int enter_redisplay_critical_section (void); +void exit_redisplay_critical_section (int); +int enter_redisplay_critical_section_maybe (void); +void exit_redisplay_critical_section_maybe (int depth); #endif /* INCLUDED_redisplay_h_ */ Index: src/regex.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.c,v retrieving revision 1.39 retrieving revision 1.45 diff -u -r1.39 -r1.45 --- src/regex.c 3 Oct 2002 18:08:24 -0000 1.39 +++ src/regex.c 23 Apr 2003 15:42:45 -0000 1.45 @@ -5,7 +5,7 @@ Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 2001, 2002 Ben Wing. + Copyright (C) 1995, 2001, 2002, 2003 Ben Wing. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -81,26 +81,6 @@ #define DEBUG #endif -#ifdef MULE - -Lisp_Object Vthe_lisp_rangetab; - -void -vars_of_regex (void) -{ - Vthe_lisp_rangetab = Fmake_range_table (); - staticpro (&Vthe_lisp_rangetab); -} - -#else /* not MULE */ - -void -vars_of_regex (void) -{ -} - -#endif /* MULE */ - #define RE_TRANSLATE_1(ch) TRT_TABLE_OF (translate, (Ichar) ch) #define TRANSLATE_P(tr) (!NILP (tr)) @@ -108,24 +88,6 @@ #define PTR_TO_OFFSET(d) (MATCHING_IN_FIRST_STRING \ ? (d) - string1 : (d) - (string2 - size1)) -/* Convert an offset from the start of the logical text string formed by - concatenating the two strings together into a character position in the - Lisp buffer or string that the text represents. Knows that - when handling buffer text, the "string" we're passed in is always - BEGV - ZV. */ - -static Charxpos -offset_to_charxpos (Lisp_Object lispobj, int off) -{ - if (STRINGP (lispobj)) - return string_index_byte_to_char (lispobj, off); - else if (BUFFERP (lispobj)) - return bytebpos_to_charbpos (XBUFFER (lispobj), - off + BYTE_BUF_BEGV (XBUFFER (lispobj))); - else - return 0; -} - #else /* not emacs */ /* If we are not linking with Emacs proper, @@ -300,11 +262,61 @@ not functions -- `alloca'-allocated space disappears at the end of the function it is called in. */ +#ifndef emacs +#define ALLOCA alloca +#define xmalloc malloc +#define xrealloc realloc +#define xfree free +#endif + +#ifdef emacs +#define ALLOCA_GARBAGE_COLLECT() \ +do \ +{ \ + if (need_to_check_c_alloca) \ + xemacs_c_alloca (0); \ +} while (0) +#elif defined (C_ALLOCA) +#define ALLOCA_GARBAGE_COLLECT() alloca (0) +#else +#define ALLOCA_GARBAGE_COLLECT() +#endif + +#ifndef emacs +/* So we can use just it to conditionalize on */ +#undef ERROR_CHECK_MALLOC +#endif + +#ifdef ERROR_CHECK_MALLOC +/* When REL_ALLOC, malloc() is problematic because it could potentially + cause all rel-alloc()ed data -- including buffer text -- to be relocated. + We deal with this by checking for such relocation whenever we have + executed a statement that may call malloc() -- or alloca(), which may + end up calling malloc() in some circumstances -- and recomputing all + of our string pointers in re_match_2_internal() and re_search_2(). + However, if malloc() or alloca() happens and we don't know about it, + we could still be screwed. So we set up a system where we indicate all + places where we are prepared for malloc() or alloca(), and in any + other circumstances, calls to those functions (from anywhere inside of + XEmacs!) will abort(). We do this even when REL_ALLOC is not defined + so that we catch these problems sooner, since many developers and beta + testers will not be running with REL_ALLOC. */ +int regex_malloc_disallowed; +#define BEGIN_REGEX_MALLOC_OK() regex_malloc_disallowed = 0 +#define END_REGEX_MALLOC_OK() regex_malloc_disallowed = 1 +#define UNBIND_REGEX_MALLOC_CHECK() unbind_to (depth) +#else +#define BEGIN_REGEX_MALLOC_OK() +#define END_REGEX_MALLOC_OK() +#define UNBIND_REGEX_MALLOC_CHECK() +#endif + + #ifdef REGEX_MALLOC -#define REGEX_ALLOCATE malloc -#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) -#define REGEX_FREE free +#define REGEX_ALLOCATE xmalloc +#define REGEX_REALLOCATE(source, osize, nsize) xrealloc (source, nsize) +#define REGEX_FREE xfree #else /* not REGEX_MALLOC */ @@ -329,11 +341,11 @@ #endif /* not alloca */ -#define REGEX_ALLOCATE alloca +#define REGEX_ALLOCATE ALLOCA /* Assumes a `char *destination' variable. */ #define REGEX_REALLOCATE(source, osize, nsize) \ - (destination = (char *) alloca (nsize), \ + (destination = (char *) ALLOCA (nsize), \ memmove (destination, source, osize), \ destination) @@ -346,23 +358,23 @@ #ifdef REGEX_REL_ALLOC #define REGEX_ALLOCATE_STACK(size) \ - r_alloc ((char **) &failure_stack_ptr, (size)) + r_alloc ((unsigned char **) &failure_stack_ptr, (size)) #define REGEX_REALLOCATE_STACK(source, osize, nsize) \ - r_re_alloc ((char **) &failure_stack_ptr, (nsize)) + r_re_alloc ((unsigned char **) &failure_stack_ptr, (nsize)) #define REGEX_FREE_STACK(ptr) \ - r_alloc_free ((void **) &failure_stack_ptr) + r_alloc_free ((unsigned char **) &failure_stack_ptr) #else /* not REGEX_REL_ALLOC */ #ifdef REGEX_MALLOC -#define REGEX_ALLOCATE_STACK malloc -#define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) -#define REGEX_FREE_STACK free +#define REGEX_ALLOCATE_STACK xmalloc +#define REGEX_REALLOCATE_STACK(source, osize, nsize) xrealloc (source, nsize) +#define REGEX_FREE_STACK xfree #else /* not REGEX_MALLOC */ -#define REGEX_ALLOCATE_STACK alloca +#define REGEX_ALLOCATE_STACK ALLOCA #define REGEX_REALLOCATE_STACK(source, osize, nsize) \ REGEX_REALLOCATE (source, osize, nsize) @@ -380,8 +392,8 @@ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) /* (Re)Allocate N items of type T using malloc, or fail. */ -#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) -#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) +#define TALLOC(n, t) ((t *) xmalloc ((n) * sizeof (t))) +#define RETALLOC(addr, n, t) ((addr) = (t *) xrealloc (addr, (n) * sizeof (t))) #define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) #define BYTEWIDTH 8 /* In bits. */ @@ -401,6 +413,88 @@ #define true 1 +#ifdef emacs + +#ifdef MULE + +Lisp_Object Vthe_lisp_rangetab; + +void +vars_of_regex (void) +{ + Vthe_lisp_rangetab = Fmake_range_table (); + staticpro (&Vthe_lisp_rangetab); +} + +#else /* not MULE */ + +void +vars_of_regex (void) +{ +} + +#endif /* MULE */ + +/* Convert an offset from the start of the logical text string formed by + concatenating the two strings together into a character position in the + Lisp buffer or string that the text represents. Knows that + when handling buffer text, the "string" we're passed in is always + BEGV - ZV. */ + +static Charxpos +offset_to_charxpos (Lisp_Object lispobj, int off) +{ + if (STRINGP (lispobj)) + return string_index_byte_to_char (lispobj, off); + else if (BUFFERP (lispobj)) + return bytebpos_to_charbpos (XBUFFER (lispobj), + off + BYTE_BUF_BEGV (XBUFFER (lispobj))); + else + return 0; +} + +#ifdef REL_ALLOC + +/* STRING1 is the value of STRING1 given to re_match_2(). LISPOBJ is + the Lisp object (if any) from which the string is taken. If LISPOBJ + is a buffer, return a relocation offset to be added to all pointers to + string data so that they will be accurate again, after an allocation or + reallocation that potentially relocated the buffer data. +*/ +static Bytecount +offset_post_relocation (Lisp_Object lispobj, Ibyte *orig_buftext) +{ + if (!BUFFERP (lispobj)) + return 0; + return (BYTE_BUF_BYTE_ADDRESS (XBUFFER (lispobj), + BYTE_BUF_BEGV (XBUFFER (lispobj))) - + orig_buftext); +} + +#endif /* REL_ALLOC */ + +#ifdef ERROR_CHECK_MALLOC + +/* NOTE that this can run malloc() so you need to adjust afterwards. */ + +static int +bind_regex_malloc_disallowed (int value) +{ + /* Tricky, because the act of binding can run malloc(). */ + int old_regex_malloc_disallowed = regex_malloc_disallowed; + int depth; + regex_malloc_disallowed = 0; + depth = record_unwind_protect_restoring_int (®ex_malloc_disallowed, + old_regex_malloc_disallowed); + regex_malloc_disallowed = value; + return depth; +} + +#endif /* ERROR_CHECK_MALLOC */ + +#endif /* emacs */ + + /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A command code can specify any interpretation whatsoever for its @@ -1115,6 +1209,26 @@ /* Avoiding alloca during matching, to placate r_alloc. */ +/* About these various flags: + + MATCH_MAY_ALLOCATE indicates that it's OK to do allocation in the + searching and matching functions. In this case, we use local variables + to hold the values allocated. If not, we use *global* variables, which + are pre-allocated. NOTE: XEmacs ***MUST*** run with MATCH_MAY_ALLOCATE, + because the regexp routines may get called reentrantly as a result of + QUIT processing (e.g. under Windows: re_match -> QUIT -> quit_p -> drain + events -> process WM_INITMENU -> call filter -> re_match; see stack + trace in signal.c), so we cannot have any global variables (unless we do + lots of trickiness including some unwind-protects, which isn't worth it + at this point). + + REL_ALLOC means that the relocating allocator is in use, for buffers + and such. REGEX_REL_ALLOC means that we use rel-alloc to manage the + fail stack, which may grow quite large. REGEX_MALLOC means we use + malloc() in place of alloca() to allocate the fail stack -- only + applicable if REGEX_REL_ALLOC is not defined. +*/ + /* Define MATCH_MAY_ALLOCATE unless we need to make sure that the searching and matching functions should not call alloca. On some systems, alloca is implemented in terms of malloc, and if we're @@ -1147,21 +1261,25 @@ matching routines; then we don't notice interrupts when they come in. So, Emacs blocks input around all regexp calls except the matching calls, which it leaves unprotected, in the faith that they - will not malloc.]] This previous paragraph is irrelevant. - - XEmacs: We *do not* do anything so stupid as process input from within a - signal handler. However, the regexp routines may get called reentrantly - as a result of QUIT processing (e.g. under Windows: re_match -> QUIT -> - quit_p -> drain events -> process WM_INITMENU -> call filter -> - re_match; see stack trace in signal.c), so we cannot have any global - variables (unless we do lots of trickiness including some - unwind-protects, which isn't worth it at this point). The first - paragraph appears utterly garbled to me -- shouldn't *ANY* use of - rel-alloc to different potentially cause buffer data to be relocated? I + will not malloc.]] This previous paragraph is irrelevant under XEmacs, + as we *do not* do anything so stupid as process input from within a + signal handler. + + However, the regexp routines may get called reentrantly as a result of + QUIT processing (e.g. under Windows: re_match -> QUIT -> quit_p -> drain + events -> process WM_INITMENU -> call filter -> re_match; see stack + trace in signal.c), so we cannot have any global variables (unless we do + lots of trickiness including some unwind-protects, which isn't worth it + at this point). Hence we MUST have MATCH_MAY_ALLOCATE defined. + + Also, the first paragraph does not make complete sense to me -- what + about the use of rel-alloc to handle the fail stacks? Shouldn't these + reallocations potentially cause buffer data to be relocated as well? I must be missing something, though -- perhaps the writer above is assuming that the failure stack(s) will always be allocated after the buffer data, and thus reallocating them with rel-alloc won't move buffer - data. --ben */ + data. (In fact, a cursory glance at the code in ralloc.c seems to + confirm this.) --ben */ /* Normally, this is fine. */ #define MATCH_MAY_ALLOCATE @@ -1178,14 +1296,12 @@ failure stack, but we would still use it for the register vectors; so REL_ALLOC should not affect this. */ -/* XEmacs change emacs -> REL_ALLOC */ -#if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (REL_ALLOC) +/* XEmacs can handle REL_ALLOC and malloc() OK */ +#if !defined (emacs) && (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (REL_ALLOC) #undef MATCH_MAY_ALLOCATE #endif -/* #### need better check */ - -#if !defined (MATCH_MAY_ALLOCATE) && defined (emacs) && defined (HAVE_MS_WINDOWS) +#if !defined (MATCH_MAY_ALLOCATE) && defined (emacs) #error regex must be handle reentrancy; MATCH_MAY_ALLOCATE must be defined #endif @@ -1238,16 +1354,20 @@ Do `return -2' if the alloc fails. */ #ifdef MATCH_MAY_ALLOCATE -#define INIT_FAIL_STACK() \ - do { \ - fail_stack.stack = (fail_stack_elt_t *) \ - REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \ - \ - if (fail_stack.stack == NULL) \ - return -2; \ - \ - fail_stack.size = INIT_FAILURE_ALLOC; \ - fail_stack.avail = 0; \ +#define INIT_FAIL_STACK() \ + do { \ + fail_stack.stack = (fail_stack_elt_t *) \ + REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * \ + sizeof (fail_stack_elt_t)); \ + \ + if (fail_stack.stack == NULL) \ + { \ + UNBIND_REGEX_MALLOC_CHECK (); \ + return -2; \ + } \ + \ + fail_stack.size = INIT_FAILURE_ALLOC; \ + fail_stack.avail = 0; \ } while (0) #define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack) @@ -1281,6 +1401,67 @@ : ((fail_stack).size <<= 1, \ 1))) +#if !defined (emacs) || !defined (REL_ALLOC) +#define RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS() +#else +/* Don't change NULL pointers */ +#define ADD_IF_NZ(val) if (val) val += rmdp_offset +#define RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS() \ +do \ +{ \ + Bytecount rmdp_offset = offset_post_relocation (lispobj, orig_buftext); \ + \ + if (rmdp_offset) \ + { \ + int i; \ + \ + ADD_IF_NZ (string1); \ + ADD_IF_NZ (string2); \ + ADD_IF_NZ (d); \ + ADD_IF_NZ (dend); \ + ADD_IF_NZ (end1); \ + ADD_IF_NZ (end2); \ + ADD_IF_NZ (end_match_1); \ + ADD_IF_NZ (end_match_2); \ + \ + if (bufp->re_ngroups) \ + { \ + for (i = 0; i < num_regs; i++) \ + { \ + ADD_IF_NZ (regstart[i]); \ + ADD_IF_NZ (regend[i]); \ + ADD_IF_NZ (old_regstart[i]); \ + ADD_IF_NZ (old_regend[i]); \ + ADD_IF_NZ (best_regstart[i]); \ + ADD_IF_NZ (best_regend[i]); \ + ADD_IF_NZ (reg_dummy[i]); \ + } \ + } \ + \ + ADD_IF_NZ (match_end); \ + } \ +} while (0) +#endif /* !defined (emacs) || !defined (REL_ALLOC) */ + +#if !defined (emacs) || !defined (REL_ALLOC) +#define RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS() +#else +#define RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS() \ +do \ +{ \ + Bytecount rmdp_offset = offset_post_relocation (lispobj, orig_buftext); \ + \ + if (rmdp_offset) \ + { \ + ADD_IF_NZ (str1); \ + ADD_IF_NZ (str2); \ + ADD_IF_NZ (string1); \ + ADD_IF_NZ (string2); \ + ADD_IF_NZ (d); \ + } \ +} while (0) + +#endif /* emacs */ /* Push pointer POINTER on FAIL_STACK. Return 1 if was able to do so and 0 if ran out of memory allocating @@ -1363,13 +1544,20 @@ /* Ensure we have enough space allocated for what we will push. */ \ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ { \ + BEGIN_REGEX_MALLOC_OK (); \ if (!DOUBLE_FAIL_STACK (fail_stack)) \ - return failure_code; \ - \ + { \ + END_REGEX_MALLOC_OK (); \ + UNBIND_REGEX_MALLOC_CHECK (); \ + return failure_code; \ + } \ + END_REGEX_MALLOC_OK (); \ DEBUG_PRINT2 ("\n Doubled stack; size now: %ld\n", \ (long) (fail_stack).size); \ DEBUG_PRINT2 (" slots available: %ld\n", \ (long) REMAINING_AVAIL_SLOTS); \ + \ + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); \ } \ \ /* Push the info, starting with the registers. */ \ @@ -1676,29 +1864,30 @@ reset the pointers that pointed into the old block to point to the correct places in the new one. If extending the buffer results in it being larger than MAX_BUF_SIZE, then flag memory exhausted. */ -#define EXTEND_BUFFER() \ - do { \ - re_char *old_buffer = bufp->buffer; \ - if (bufp->allocated == MAX_BUF_SIZE) \ - return REG_ESIZE; \ - bufp->allocated <<= 1; \ - if (bufp->allocated > MAX_BUF_SIZE) \ - bufp->allocated = MAX_BUF_SIZE; \ - bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\ - if (bufp->buffer == NULL) \ - return REG_ESPACE; \ - /* If the buffer moved, move all the pointers into it. */ \ - if (old_buffer != bufp->buffer) \ - { \ - buf_end = (buf_end - old_buffer) + bufp->buffer; \ - begalt = (begalt - old_buffer) + bufp->buffer; \ - if (fixup_alt_jump) \ - fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ - if (laststart) \ - laststart = (laststart - old_buffer) + bufp->buffer; \ - if (pending_exact) \ - pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ - } \ +#define EXTEND_BUFFER() \ + do { \ + re_char *old_buffer = bufp->buffer; \ + if (bufp->allocated == MAX_BUF_SIZE) \ + return REG_ESIZE; \ + bufp->allocated <<= 1; \ + if (bufp->allocated > MAX_BUF_SIZE) \ + bufp->allocated = MAX_BUF_SIZE; \ + bufp->buffer = \ + (unsigned char *) xrealloc (bufp->buffer, bufp->allocated); \ + if (bufp->buffer == NULL) \ + return REG_ESPACE; \ + /* If the buffer moved, move all the pointers into it. */ \ + if (old_buffer != bufp->buffer) \ + { \ + buf_end = (buf_end - old_buffer) + bufp->buffer; \ + begalt = (begalt - old_buffer) + bufp->buffer; \ + if (fixup_alt_jump) \ + fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; \ + if (laststart) \ + laststart = (laststart - old_buffer) + bufp->buffer; \ + if (pending_exact) \ + pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ + } \ } while (0) @@ -1913,7 +2102,11 @@ /* Return, freeing storage we allocated. */ #define FREE_STACK_RETURN(value) \ - return (free (compile_stack.stack), value) +do \ +{ \ + xfree (compile_stack.stack); \ + return value; \ +} while (0) static reg_errcode_t regex_compile (re_char *pattern, int size, reg_syntax_t syntax, @@ -3216,7 +3409,7 @@ if (syntax & RE_NO_POSIX_BACKTRACKING) BUF_PUSH (succeed); - free (compile_stack.stack); + xfree (compile_stack.stack); /* We have succeeded; set the length of the buffer. */ bufp->used = buf_end - bufp->buffer; @@ -3243,7 +3436,6 @@ { fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS); -#ifdef emacs if (! fail_stack.stack) fail_stack.stack = (fail_stack_elt_t *) xmalloc (fail_stack.size @@ -3253,17 +3445,6 @@ = (fail_stack_elt_t *) xrealloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); -#else /* not emacs */ - if (! fail_stack.stack) - fail_stack.stack - = (fail_stack_elt_t *) malloc (fail_stack.size - * sizeof (fail_stack_elt_t)); - else - fail_stack.stack - = (fail_stack_elt_t *) realloc (fail_stack.stack, - (fail_stack.size - * sizeof (fail_stack_elt_t))); -#endif /* emacs */ } regex_grow_registers (num_regs); @@ -3549,6 +3730,13 @@ /* We aren't doing a `succeed_n' to begin with. */ re_bool succeed_n_p = false; +#ifdef ERROR_CHECK_MALLOC + /* The pattern comes from string data, not buffer data. We don't access + any buffer data, so we don't have to worry about malloc() (but the + disallowed flag may have been set by a caller). */ + int depth = bind_regex_malloc_disallowed (0); +#endif + assert (fastmap != NULL && p != NULL); INIT_FAIL_STACK (); @@ -3838,6 +4026,7 @@ case categoryspec: case notcategoryspec: bufp->can_be_null = 1; + UNBIND_REGEX_MALLOC_CHECK (); return 0; /* end if category patch */ #endif /* MULE */ @@ -3915,6 +4104,7 @@ if (!PUSH_PATTERN_OP (p + j, fail_stack)) { RESET_FAIL_STACK (); + UNBIND_REGEX_MALLOC_CHECK (); return -2; } } @@ -3976,6 +4166,7 @@ done: RESET_FAIL_STACK (); + UNBIND_REGEX_MALLOC_CHECK (); return 0; } /* re_compile_fastmap */ @@ -4072,6 +4263,16 @@ re_char *d; #ifdef emacs Internal_Format fmt = buffer_or_other_internal_format (lispobj); +#ifdef REL_ALLOC + Ibyte *orig_buftext = + BUFFERP (lispobj) ? + BYTE_BUF_BYTE_ADDRESS (XBUFFER (lispobj), + BYTE_BUF_BEGV (XBUFFER (lispobj))) : + 0; +#endif +#ifdef ERROR_CHECK_MALLOC + int depth; +#endif #endif /* emacs */ #if 1 int forward_search_p; @@ -4120,10 +4321,23 @@ } #endif /* emacs */ +#ifdef ERROR_CHECK_MALLOC + /* Do this after the above return()s. */ + depth = bind_regex_malloc_disallowed (1); +#endif + /* Update the fastmap now if not correct already. */ + BEGIN_REGEX_MALLOC_OK (); if (fastmap && !bufp->fastmap_accurate) if (re_compile_fastmap (bufp RE_LISP_SHORT_CONTEXT_ARGS) == -2) - return -2; + { + END_REGEX_MALLOC_OK (); + UNBIND_REGEX_MALLOC_CHECK (); + return -2; + } + + END_REGEX_MALLOC_OK (); + RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS (); #ifdef REGEX_BEGLINE_CHECK { @@ -4142,9 +4356,12 @@ #endif #ifdef emacs + BEGIN_REGEX_MALLOC_OK (); scache = setup_syntax_cache (scache, lispobj, lispbuf, offset_to_charxpos (lispobj, startpos), 1); + END_REGEX_MALLOC_OK (); + RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS (); #endif /* Loop through the string, looking for a place to start matching. */ @@ -4274,7 +4491,7 @@ INC_IBYTEPTR_FMT (d, fmt); range -= (d - old_d); #if 1 - assert (!forward_search_p || range >= 0); + assert (!forward_search_p || range >= 0); #endif } } @@ -4292,7 +4509,7 @@ INC_IBYTEPTR_FMT (d, fmt); range -= (d - old_d); #if 1 - assert (!forward_search_p || range >= 0); + assert (!forward_search_p || range >= 0); #endif } } @@ -4338,27 +4555,44 @@ /* If can't match the null string, and that's all we have left, fail. */ if (range >= 0 && startpos == total_size && fastmap && !bufp->can_be_null) - return -1; + { + UNBIND_REGEX_MALLOC_CHECK (); + return -1; + } #ifdef emacs /* XEmacs added, w/removal of immediate_quit */ if (!no_quit_in_re_search) - QUIT; + { + BEGIN_REGEX_MALLOC_OK (); + QUIT; + END_REGEX_MALLOC_OK (); + RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS (); + } + #endif + BEGIN_REGEX_MALLOC_OK (); val = re_match_2_internal (bufp, string1, size1, string2, size2, startpos, regs, stop RE_LISP_CONTEXT_ARGS); #ifndef REGEX_MALLOC -#ifdef C_ALLOCA - alloca (0); -#endif + ALLOCA_GARBAGE_COLLECT (); #endif + END_REGEX_MALLOC_OK (); + RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS (); if (val >= 0) - return startpos; + { + UNBIND_REGEX_MALLOC_CHECK (); + return startpos; + } if (val == -2) - return -2; + { + UNBIND_REGEX_MALLOC_CHECK (); + return -2; + } + RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS (); advance: if (!range) break; @@ -4390,6 +4624,7 @@ startpos -= d_size; } } + UNBIND_REGEX_MALLOC_CHECK (); return -1; } /* re_search_2 */ @@ -4442,6 +4677,7 @@ #define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL #define FREE_VARIABLES() \ do { \ + UNBIND_REGEX_MALLOC_CHECK (); \ REGEX_FREE_STACK (fail_stack.stack); \ FREE_VAR (regstart); \ FREE_VAR (regend); \ @@ -4454,7 +4690,10 @@ FREE_VAR (reg_info_dummy); \ } while (0) #else /* not MATCH_MAY_ALLOCATE */ -#define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ +#define FREE_VARIABLES() \ + do { \ + UNBIND_REGEX_MALLOC_CHECK (); \ + } while (0) #endif /* MATCH_MAY_ALLOCATE */ /* These values must meet several constraints. They must not be valid @@ -4480,7 +4719,7 @@ int result = re_match_2_internal (bufp, NULL, 0, (re_char *) string, size, pos, regs, size RE_LISP_CONTEXT_ARGS); - alloca (0); + ALLOCA_GARBAGE_COLLECT (); return result; } #endif /* not emacs */ @@ -4517,7 +4756,7 @@ pos, regs, stop RE_LISP_CONTEXT_ARGS); - alloca (0); + ALLOCA_GARBAGE_COLLECT (); return result; } @@ -4659,11 +4898,24 @@ #ifdef emacs Internal_Format fmt = buffer_or_other_internal_format (lispobj); +#ifdef REL_ALLOC + Ibyte *orig_buftext = + BUFFERP (lispobj) ? + BYTE_BUF_BYTE_ADDRESS (XBUFFER (lispobj), + BYTE_BUF_BEGV (XBUFFER (lispobj))) : + 0; +#endif + +#ifdef ERROR_CHECK_MALLOC + int depth = bind_regex_malloc_disallowed (1); +#endif #endif /* emacs */ DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); + BEGIN_REGEX_MALLOC_OK (); INIT_FAIL_STACK (); + END_REGEX_MALLOC_OK (); #ifdef MATCH_MAY_ALLOCATE /* Do not bother to initialize all the register variables if there are @@ -4673,6 +4925,7 @@ array indexing. We should fix this. */ if (bufp->re_ngroups) { + BEGIN_REGEX_MALLOC_OK (); regstart = REGEX_TALLOC (num_regs, re_char *); regend = REGEX_TALLOC (num_regs, re_char *); old_regstart = REGEX_TALLOC (num_regs, re_char *); @@ -4682,6 +4935,7 @@ reg_info = REGEX_TALLOC (num_regs, register_info_type); reg_dummy = REGEX_TALLOC (num_regs, re_char *); reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); + END_REGEX_MALLOC_OK (); if (!(regstart && regend && old_regstart && old_regend && reg_info && best_regstart && best_regend && reg_dummy && reg_info_dummy)) @@ -4700,6 +4954,20 @@ } #endif /* MATCH_MAY_ALLOCATE */ +#if defined (emacs) && defined (REL_ALLOC) + { + /* If the allocations above (or the call to setup_syntax_cache() in + re_match_2) caused a rel-alloc relocation, then fix up the data + pointers */ + Bytecount offset = offset_post_relocation (lispobj, orig_buftext); + if (offset) + { + string1 += offset; + string2 += offset; + } + } +#endif /* defined (emacs) && defined (REL_ALLOC) */ + /* The starting position is bogus. */ if (pos < 0 || pos > size1 + size2) { @@ -4775,7 +5043,12 @@ DEBUG_PRINT2 ("\n0x%lx: ", (long) p); #ifdef emacs /* XEmacs added, w/removal of immediate_quit */ if (!no_quit_in_re_search) - QUIT; + { + BEGIN_REGEX_MALLOC_OK (); + QUIT; + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); + } #endif if (p == pend) @@ -4857,8 +5130,11 @@ extra element beyond `num_regs' for the `-1' marker GNU code uses. */ regs->num_regs = MAX (RE_NREGS, num_nonshy_regs + 1); + BEGIN_REGEX_MALLOC_OK (); regs->start = TALLOC (regs->num_regs, regoff_t); regs->end = TALLOC (regs->num_regs, regoff_t); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); if (regs->start == NULL || regs->end == NULL) { FREE_VARIABLES (); @@ -4873,8 +5149,11 @@ if (regs->num_regs < num_nonshy_regs + 1) { regs->num_regs = num_nonshy_regs + 1; + BEGIN_REGEX_MALLOC_OK (); RETALLOC (regs->start, regs->num_regs, regoff_t); RETALLOC (regs->end, regs->num_regs, regoff_t); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); if (regs->start == NULL || regs->end == NULL) { FREE_VARIABLES (); @@ -4930,7 +5209,10 @@ It would be possible to require the caller to do this, but we'd have to change the API for this function to reflect that, and - audit all callers. */ + audit all callers. Note: as of 2003-04-17 callers in XEmacs + do clear the registers, but it's safer to leave this code in + because of reallocation. + */ if (regs && regs->num_regs > 0) for (mcnt = num_nonshy_regs; mcnt < regs->num_regs; mcnt++) regs->start[mcnt] = regs->end[mcnt] = -1; @@ -5062,7 +5344,7 @@ case charset: case charset_not: { - REGISTER unsigned char c; + REGISTER Ichar c; re_bool not_p = (re_opcode_t) *(p - 1) == charset_not; DEBUG_PRINT2 ("EXECUTING charset%s.\n", not_p ? "_not" : ""); @@ -5073,7 +5355,7 @@ /* Cast to `unsigned int' instead of `unsigned char' in case the bit list is a full 32 bytes long. */ - if (c < (unsigned int) (*p * BYTEWIDTH) + if ((unsigned int)c < (unsigned int) (*p * BYTEWIDTH) && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not_p = !not_p; @@ -5791,40 +6073,63 @@ matchwordbound: { /* XEmacs change */ - int result; - if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) - result = 1; - else - { - re_char *d_before = POS_BEFORE_GAP_UNSAFE (d); - re_char *d_after = POS_AFTER_GAP_UNSAFE (d); - - /* emch1 is the character before d, syn1 is the syntax of - emch1, emch2 is the character at d, and syn2 is the - syntax of emch2. */ - Ichar emch1, emch2; - int syn1, syn2; + /* Straightforward and (I hope) correct implementation. + Probably should be optimized by arranging to compute + pos only once. */ + /* emch1 is the character before d, syn1 is the syntax of + emch1, emch2 is the character at d, and syn2 is the + syntax of emch2. */ + Ichar emch1, emch2; + int syn1, syn2; + re_char *d_before, *d_after; + int result, + at_beg = AT_STRINGS_BEG (d), + at_end = AT_STRINGS_END (d); #ifdef emacs - Charxpos pos_before; + Charxpos pos; #endif - DEC_IBYTEPTR_FMT (d_before, fmt); - emch1 = itext_ichar_fmt (d_before, fmt, lispobj); - emch2 = itext_ichar_fmt (d_after, fmt, lispobj); - + if (at_beg && at_end) + { + result = 0; + } + else + { + if (!at_beg) + { + d_before = POS_BEFORE_GAP_UNSAFE (d); + DEC_IBYTEPTR_FMT (d_before, fmt); + emch1 = itext_ichar_fmt (d_before, fmt, lispobj); #ifdef emacs - pos_before = - offset_to_charxpos (lispobj, PTR_TO_OFFSET (d)) - 1; - UPDATE_SYNTAX_CACHE (scache, pos_before); + pos = offset_to_charxpos (lispobj, PTR_TO_OFFSET (d)) - 1; + BEGIN_REGEX_MALLOC_OK (); + UPDATE_SYNTAX_CACHE (scache, pos); #endif - syn1 = SYNTAX_FROM_CACHE (scache, emch1); + syn1 = SYNTAX_FROM_CACHE (scache, emch1); + END_REGEX_MALLOC_OK (); + } + if (!at_end) + { + d_after = POS_AFTER_GAP_UNSAFE (d); + emch2 = itext_ichar_fmt (d_after, fmt, lispobj); #ifdef emacs - UPDATE_SYNTAX_CACHE_FORWARD (scache, pos_before + 1); + pos = offset_to_charxpos (lispobj, PTR_TO_OFFSET (d)); + BEGIN_REGEX_MALLOC_OK (); + UPDATE_SYNTAX_CACHE_FORWARD (scache, pos); #endif - syn2 = SYNTAX_FROM_CACHE (scache, emch2); + syn2 = SYNTAX_FROM_CACHE (scache, emch2); + END_REGEX_MALLOC_OK (); + } + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); - result = ((syn1 == Sword) != (syn2 == Sword)); + if (at_beg) + result = (syn2 == Sword); + else if (at_end) + result = (syn1 == Sword); + else + result = ((syn1 == Sword) != (syn2 == Sword)); } + if (result == should_succeed) break; goto fail; @@ -5848,21 +6153,32 @@ */ re_char *dtmp = POS_AFTER_GAP_UNSAFE (d); Ichar emch = itext_ichar_fmt (dtmp, fmt, lispobj); + int tempres; #ifdef emacs Charxpos charpos = offset_to_charxpos (lispobj, PTR_TO_OFFSET (d)); +#endif + BEGIN_REGEX_MALLOC_OK (); +#ifdef emacs UPDATE_SYNTAX_CACHE (scache, charpos); #endif - if (SYNTAX_FROM_CACHE (scache, emch) != Sword) + tempres = (SYNTAX_FROM_CACHE (scache, emch) != Sword); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); + if (tempres) goto fail; if (AT_STRINGS_BEG (d)) break; dtmp = POS_BEFORE_GAP_UNSAFE (d); DEC_IBYTEPTR_FMT (dtmp, fmt); emch = itext_ichar_fmt (dtmp, fmt, lispobj); + BEGIN_REGEX_MALLOC_OK (); #ifdef emacs UPDATE_SYNTAX_CACHE_BACKWARD (scache, charpos - 1); #endif - if (SYNTAX_FROM_CACHE (scache, emch) != Sword) + tempres = (SYNTAX_FROM_CACHE (scache, emch) != Sword); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); + if (tempres) break; goto fail; } @@ -5882,23 +6198,35 @@ */ re_char *dtmp; Ichar emch; + int tempres; #ifdef emacs Charxpos charpos = offset_to_charxpos (lispobj, PTR_TO_OFFSET (d)); + BEGIN_REGEX_MALLOC_OK (); UPDATE_SYNTAX_CACHE (scache, charpos); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); #endif dtmp = POS_BEFORE_GAP_UNSAFE (d); DEC_IBYTEPTR_FMT (dtmp, fmt); emch = itext_ichar_fmt (dtmp, fmt, lispobj); - if (SYNTAX_FROM_CACHE (scache, emch) != Sword) + BEGIN_REGEX_MALLOC_OK (); + tempres = (SYNTAX_FROM_CACHE (scache, emch) != Sword); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); + if (tempres) goto fail; if (AT_STRINGS_END (d)) break; dtmp = POS_AFTER_GAP_UNSAFE (d); emch = itext_ichar_fmt (dtmp, fmt, lispobj); + BEGIN_REGEX_MALLOC_OK (); #ifdef emacs UPDATE_SYNTAX_CACHE_FORWARD (scache, charpos + 1); #endif - if (SYNTAX_FROM_CACHE (scache, emch) != Sword) + tempres = (SYNTAX_FROM_CACHE (scache, emch) != Sword); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); + if (tempres) break; goto fail; } @@ -5944,12 +6272,18 @@ Ichar emch; REGEX_PREFETCH (); + BEGIN_REGEX_MALLOC_OK (); UPDATE_SYNTAX_CACHE (scache, offset_to_charxpos (lispobj, PTR_TO_OFFSET (d))); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); emch = itext_ichar_fmt (d, fmt, lispobj); + BEGIN_REGEX_MALLOC_OK (); matches = (SYNTAX_FROM_CACHE (scache, emch) == (enum syntaxcode) mcnt); + END_REGEX_MALLOC_OK (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); INC_IBYTEPTR_FMT (d, fmt); if (matches != should_succeed) goto fail; @@ -6074,7 +6408,7 @@ FREE_VARIABLES (); return -1; /* Failure to match. */ -} /* re_match_2 */ +} /* re_match_2_internal */ /* Subroutine definitions for re_match_2. */ @@ -6415,12 +6749,12 @@ if (!re_comp_buf.buffer) { - re_comp_buf.buffer = (unsigned char *) malloc (200); + re_comp_buf.buffer = (unsigned char *) xmalloc (200); if (re_comp_buf.buffer == NULL) return gettext (re_error_msgid[(int) REG_ESPACE]); re_comp_buf.allocated = 200; - re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); + re_comp_buf.fastmap = (char *) xmalloc (1 << BYTEWIDTH); if (re_comp_buf.fastmap == NULL) return gettext (re_error_msgid[(int) REG_ESPACE]); } @@ -6514,7 +6848,7 @@ { int i; - preg->translate = (char *) malloc (CHAR_SET_SIZE); + preg->translate = (char *) xmalloc (CHAR_SET_SIZE); if (preg->translate == NULL) return (int) REG_ESPACE; @@ -6613,8 +6947,8 @@ } /* If we needed the temporary register info, free the space now. */ - free (regs.start); - free (regs.end); + xfree (regs.start); + xfree (regs.end); } /* We want zero return to mean success, unlike `re_search'. */ @@ -6666,19 +7000,19 @@ regfree (regex_t *preg) { if (preg->buffer != NULL) - free (preg->buffer); + xfree (preg->buffer); preg->buffer = NULL; preg->allocated = 0; preg->used = 0; if (preg->fastmap != NULL) - free (preg->fastmap); + xfree (preg->fastmap); preg->fastmap = NULL; preg->fastmap_accurate = 0; if (preg->translate != NULL) - free (preg->translate); + xfree (preg->translate); preg->translate = NULL; } Index: src/scrollbar-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/scrollbar-gtk.c,v retrieving revision 1.8 retrieving revision 1.10 diff -u -r1.8 -r1.10 --- src/scrollbar-gtk.c 27 Nov 2002 07:15:14 -0000 1.8 +++ src/scrollbar-gtk.c 9 Mar 2003 02:27:46 -0000 1.10 @@ -32,7 +32,6 @@ #include "console-gtk-impl.h" #include "glyphs-gtk.h" -#include "gui-gtk.h" #include "scrollbar-gtk.h" static gboolean scrollbar_cb (GtkAdjustment *adj, gpointer user_data); @@ -436,15 +435,9 @@ void gtk_update_frame_scrollbars (struct frame *f) { - /* Consider this code to be "in_display" (in a critical section) so we - abort() if elisp or QUIT is not properly wrapped -- see - enter_redisplay_critical_section(). */ - in_display++; gtk_scrollbar_loop (GTK_UPDATE_FRAME_SCROLLBARS, f->root_window, XWINDOW_MIRROR (f->root_mirror), 0, (GdkWindow *) NULL); - in_display--; - if (in_display < 0) abort (); } #ifdef MEMORY_USAGE_STATS Index: src/scrollbar-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/scrollbar-x.c,v retrieving revision 1.22 retrieving revision 1.24 diff -u -r1.22 -r1.24 --- src/scrollbar-x.c 27 Nov 2002 07:15:14 -0000 1.22 +++ src/scrollbar-x.c 9 Mar 2003 02:27:46 -0000 1.24 @@ -34,7 +34,6 @@ #include "console-x-impl.h" #include "glyphs-x.h" -#include "gui-x.h" #include "scrollbar-x.h" #include "EmacsFrame.h" @@ -686,14 +685,8 @@ void x_update_frame_scrollbars (struct frame *f) { - /* Consider this code to be "in_display" (in a critical section) so we - abort() if elisp or QUIT is not properly wrapped -- see - enter_redisplay_critical_section(). */ - in_display++; x_scrollbar_loop (X_UPDATE_FRAME_SCROLLBARS, f->root_window, XWINDOW_MIRROR (f->root_mirror), 0, (Window) NULL); - in_display--; - if (in_display < 0) abort (); } #ifdef MEMORY_USAGE_STATS Index: src/scrollbar.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/scrollbar.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- src/scrollbar.c 14 Feb 2003 07:54:29 -0000 1.29 +++ src/scrollbar.c 21 Feb 2003 06:57:00 -0000 1.30 @@ -3,6 +3,7 @@ Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1995 Darrell Kindred . + Copyright (C) 2003 Ben Wing. This file is part of XEmacs. @@ -285,11 +286,12 @@ { struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); + int depth; if (!HAS_DEVMETH_P (d, create_scrollbar_instance)) return; - in_display++; + depth = enter_redisplay_critical_section_maybe (); /* It is possible for this to get called from the mirror update routines. In that case the structure is in an indeterminate @@ -347,7 +349,7 @@ } } - in_display--; + exit_redisplay_critical_section_maybe (depth); } void Index: src/search.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/search.c,v retrieving revision 1.36 retrieving revision 1.38 diff -u -r1.36 -r1.38 --- src/search.c 2 Oct 2002 09:31:22 -0000 1.36 +++ src/search.c 23 Apr 2003 15:42:45 -0000 1.38 @@ -93,6 +93,30 @@ */ static struct re_registers search_regs; +/* Every function that _may_ set the match data _must_ clear the search + registers on entry. An unsuccessful search should leave the search + registers cleared. Applications that are no-ops by definition (eg, + searches with a repetition count of 0) _must not_ clear the search + registers. + + XEmacs 21.5 up to beta 11 may have permitted the following idiom to + "win" in the sense that the match data was set to the last successful + match's match data, and not cleared as the current implemenation does: + + (while (search_forward "string")) + (use-match-data-of-last-successful-search) + + This no longer can work. You must use save-match-data to preserve the + match data: + + (let (md) + (while (when (search-forward "string") (setq md (match-data)))) + (set-match-data md)) + (use-match-data-of-last-successful-search) + */ +static void set_search_regs (struct buffer *buf, Charbpos beg, Charcount len); +static void clear_search_regs (struct re_registers *regp); + /* The buffer in which the last search was performed, or Qt if the last search was done in a string; Qnil if no searching has been done yet. */ @@ -110,8 +134,6 @@ /* range table for use with skip_chars. Only needed for Mule. */ Lisp_Object Vskip_chars_range_table; -static void set_search_regs (struct buffer *buf, Charbpos beg, Charcount len); -static void clear_unused_search_regs (struct re_registers *regp, int no_sub); static Charbpos simple_search (struct buffer *buf, Ibyte *base_pat, Bytecount len, Bytebpos pos, Bytebpos lim, EMACS_INT n, Lisp_Object trt); @@ -304,6 +326,9 @@ struct syntax_cache scache_struct; struct syntax_cache *scache = &scache_struct; + /* clear search registers *now*. no mercy, not even for errors */ + clear_search_regs (&search_regs); + CHECK_STRING (string); bufp = compile_pattern (string, &search_regs, (!NILP (buf->case_fold_search) @@ -394,6 +419,9 @@ data. Not necessary because we don't call process filters asynchronously (i.e. from within QUIT). */ + /* clear search registers *now*. no mercy, not even for errors */ + clear_search_regs (&search_regs); + CHECK_STRING (regexp); CHECK_STRING (string); @@ -496,7 +524,7 @@ This does not clobber the match data. */ Bytecount -fast_string_match (Lisp_Object regexp, const Ibyte *nonreloc, +fast_string_match (Lisp_Object regexp, const Ibyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, int case_fold_search, Error_Behavior errb, int no_quit) @@ -1219,18 +1247,20 @@ data. Not necessary because we don't call process filters asynchronously (i.e. from within QUIT). */ + /* Searching 0 times means noop---don't move, don't touch registers. */ + if (n == 0) + return charbpos; + + /* clear the search regs now */ + clear_search_regs (&search_regs); + /* Null string is found at starting position. */ if (len == 0) { set_search_regs (buf, charbpos, 0); - clear_unused_search_regs (&search_regs, 0); return charbpos; } - /* Searching 0 times means noop---don't move, don't touch registers. */ - if (n == 0) - return charbpos; - pos = charbpos_to_bytebpos (buf, charbpos); lim = charbpos_to_bytebpos (buf, buflim); if (RE && !trivial_regexp_p (string)) @@ -1483,7 +1513,6 @@ end = bytebpos_to_charbpos (buf, pos + buf_len); } set_search_regs (buf, beg, end - beg); - clear_unused_search_regs (&search_regs, 0); return retval; } @@ -1617,6 +1646,10 @@ for (i = 0; i < 0400; i++) simple_translate[i] = (Ibyte) i; i = 0; + + /* clear search regs now */ + clear_search_regs (&search_regs); + while (i != infinity) { Ibyte *ptr = base_pat + i; @@ -1847,7 +1880,6 @@ Charbpos bufend = bytebpos_to_charbpos (buf, bytstart + len); set_search_regs (buf, bufstart, bufend - bufstart); - clear_unused_search_regs (&search_regs, 0); } if ((n -= direction) != 0) @@ -1938,7 +1970,6 @@ Charbpos bufend = bytebpos_to_charbpos (buf, bytstart + len); set_search_regs (buf, bufstart, bufend - bufstart); - clear_unused_search_regs (&search_regs, 0); } if ((n -= direction) != 0) @@ -1978,21 +2009,17 @@ last_thing_searched = wrap_buffer (buf); } -/* Clear unused search registers so match data will be null. +/* Clear search registers so match data will be null. REGP is a pointer to the register structure to clear, usually the global - search_regs. - NO_SUB is the number of subexpressions to allow for. (Does not count - the whole match, ie, for a string search NO_SUB == 0.) - It is an error if NO_SUB > REGP.num_regs - 1. */ + search_regs. */ static void -clear_unused_search_regs (struct re_registers *regp, int no_sub) +clear_search_regs (struct re_registers *regp) { /* This function has been Mule-ized. */ int i; - assert (no_sub >= 0 && no_sub < regp->num_regs); - for (i = no_sub + 1; i < regp->num_regs; i++) + for (i = 0; i < regp->num_regs; i++) regp->start[i] = regp->end[i] = -1; } @@ -2323,6 +2350,12 @@ the match. It says to replace just that subexpression instead of the whole match. This is useful only after a regular expression search or match since only regular expressions have distinguished subexpressions. + +If no match (including searches) has been conducted, the last match +operation failed, or the requested subexpression was not matched, an +`args-out-of-range' error will be signaled. (If no match has ever been +conducted in this instance of XEmacs, an `invalid-operation' error will +be signaled. This is very rare.) */ (replacement, fixedcase, literal, string, strbuffer)) { Index: src/select-x.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/select-x.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/select-x.c 20 Jun 2002 21:18:45 -0000 1.12 +++ src/select-x.c 20 Feb 2003 08:19:42 -0000 1.13 @@ -45,7 +45,11 @@ #endif #ifdef MOTIF_CLIPBOARDS +# include "xmotif.h" +/* Kludge around shadowing warnings */ +# define index index_ # include +# undef index static void hack_motif_clipboard_selection (Atom selection_atom, Lisp_Object selection_value, Time thyme, Display *display, Index: src/sheap.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sheap.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- src/sheap.c 13 Dec 2002 04:29:06 -0000 1.20 +++ src/sheap.c 20 Feb 2003 08:19:42 -0000 1.21 @@ -134,21 +134,26 @@ (long) (STATIC_HEAP_SIZE / 1024), (long) STATIC_HEAP_SLOP / 1024); - if (lost > STATIC_HEAP_SLOP) { - sprintf (buf + strlen (buf), " -- %ldk wasted", (long)(lost/1024)); - if (die_if_pure_storage_exceeded) { - sheap_adjust_h(STATIC_HEAP_SLOP - lost); - sprintf (buf + strlen (buf), " -- reset to %ldk", - (long) ((STATIC_HEAP_SIZE + STATIC_HEAP_SLOP - lost) / 1024)); - rc = -1; + if (lost > STATIC_HEAP_SLOP) + { + sprintf (buf + strlen (buf), " -- %ldk wasted", (long)(lost/1024)); + if (die_if_pure_storage_exceeded) + { + sheap_adjust_h(STATIC_HEAP_SLOP - lost); + sprintf (buf + strlen (buf), " -- reset to %ldk", + (long) ((STATIC_HEAP_SIZE + STATIC_HEAP_SLOP - lost) / + 1024)); + rc = -1; + } + message ("%s\n", buf); } - message ("%s", buf); - } - if (rc < 0) { - unlink("SATISFIED"); - fatal ("Static heap size adjusted, Don't Panic! I will restart the `make'"); - } + if (rc < 0) + { + unlink ("SATISFIED"); + stderr_out ("Static heap size adjusted, don't panic! I will restart the `make'\n"); + exit (0); + } } Index: src/signal.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/signal.c,v retrieving revision 1.22 retrieving revision 1.24 diff -u -r1.22 -r1.24 --- src/signal.c 27 Nov 2002 07:15:14 -0000 1.22 +++ src/signal.c 21 Feb 2003 06:57:00 -0000 1.24 @@ -292,7 +292,7 @@ qxe_setitimer (int kind, const struct itimerval *itnew, struct itimerval *itold) { -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY /* setitimer() does not exist on native MS Windows, and appears broken on Cygwin. See win32.c. @@ -428,21 +428,26 @@ void check_what_happened (void) { -#ifdef ERROR_CHECK_TRAPPING_PROBLEMS - if (in_display - && !((get_inhibit_flags () & INTERNAL_INHIBIT_ERRORS) - && (get_inhibit_flags () & INTERNAL_INHIBIT_THROWS))) - assert_with_message - (0, "QUIT called from within redisplay without being properly wrapped"); -#endif - /* No GC can happen anywhere here. handle_async_timeout_signal() prevents GC (from asynch timeout handler), so does check_quit() (from processing a message such as WM_INITMENU as a result of draining the message queue). establish_slow_interrupt_timer() is too low-level to do anything that might invoke QUIT or call Lisp code. */ - something_happened = 0; + +#ifdef ERROR_CHECK_TRAPPING_PROBLEMS + assert_with_message + (proper_redisplay_wrapping_in_place (), + "QUIT called from within redisplay without being properly wrapped"); + + /* When in a critical section, don't reset something_happened, so that + every single QUIT will verify proper wrapping. (something_happened + was set by enter_redisplay_critical_section() and will be reset + upon exit.) */ + if (!in_display) +#endif + something_happened = 0; + if (async_timeout_happened) { async_timeout_happened = 0; Index: src/sound.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sound.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- src/sound.c 20 Jun 2002 21:18:46 -0000 1.18 +++ src/sound.c 9 Mar 2003 02:27:46 -0000 1.19 @@ -346,7 +346,7 @@ #ifdef HAVE_NAS_SOUND if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound)) { - const UChar_Binary *soundext; + UChar_Binary *soundext; Bytecount soundextlen; TO_EXTERNAL_FORMAT (LISP_STRING, sound, Index: src/symsinit.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symsinit.h,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- src/symsinit.h 12 Jan 2003 11:08:21 -0000 1.46 +++ src/symsinit.h 15 Apr 2003 17:01:57 -0000 1.47 @@ -520,6 +520,7 @@ void syms_of_widget_accessors (void); void syms_of_ui_byhand (void); void console_type_create_gtk (void); +void reinit_console_type_create_gtk (void); void console_type_create_device_gtk (void); void console_type_create_frame_gtk (void); void console_type_create_glyphs_gtk (void); @@ -533,10 +534,12 @@ void vars_of_device_gtk (void); void vars_of_dialog_gtk (void); void vars_of_event_gtk (void); +void reinit_vars_of_event_gtk (void); void vars_of_frame_gtk (void); void vars_of_glyphs_gtk (void); void vars_of_gui_gtk (void); void vars_of_menubar_gtk (void); +void reinit_vars_of_menubar_gtk (void); void vars_of_objects_gtk (void); void vars_of_scrollbar_gtk (void); void vars_of_select_gtk (void); Index: src/syntax.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syntax.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/syntax.c 14 Feb 2003 09:50:17 -0000 1.17 +++ src/syntax.c 20 Feb 2003 08:19:43 -0000 1.18 @@ -646,7 +646,7 @@ (character, syntax_table)) { Lisp_Object mirrortab; - int code; + enum syntaxcode code; CHECK_CHAR_COERCE_INT (character); syntax_table = check_syntax_table (syntax_table, @@ -889,7 +889,8 @@ int prev_syncode; UPDATE_SYNTAX_CACHE_BACKWARD (scache, from - 1); prev_syncode = - SYNTAX_CODE_FROM_CACHE (scache, BUF_FETCH_CHAR (buf, from - 1)); + SYNTAX_CODE_FROM_CACHE (scache, + BUF_FETCH_CHAR (buf, from - 1)); if (SYNTAX_CODES_END_P (prev_syncode, syncode)) { @@ -913,7 +914,8 @@ int prev_syncode; UPDATE_SYNTAX_CACHE_BACKWARD (scache, from - 1); prev_syncode = - SYNTAX_CODE_FROM_CACHE (scache, BUF_FETCH_CHAR (buf, from - 1)); + SYNTAX_CODE_FROM_CACHE (scache, + BUF_FETCH_CHAR (buf, from - 1)); if (SYNTAX_CODES_START_P (prev_syncode, syncode)) { Index: src/syntax.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syntax.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/syntax.h 14 Feb 2003 09:50:17 -0000 1.11 +++ src/syntax.h 20 Feb 2003 08:19:43 -0000 1.12 @@ -86,13 +86,13 @@ /* Return the syntax code for a particular character and mirror table. */ DECLARE_INLINE_HEADER ( -enum syntaxcode +int SYNTAX_CODE (Lisp_Object table, Ichar c) ) { type_checking_assert (XCHAR_TABLE (table)->mirror_table_p); update_mirror_syntax_if_dirty (table); - return (enum syntaxcode) XINT (get_char_table_1 (c, table)); + return XINT (get_char_table_1 (c, table)); } #ifdef NOT_WORTH_THE_EFFORT @@ -100,7 +100,7 @@ /* Same but skip the dirty check. */ DECLARE_INLINE_HEADER ( -enum syntaxcode +int SYNTAX_CODE_1 (Lisp_Object table, Ichar c) ) { @@ -353,7 +353,14 @@ UPDATE_SYNTAX_CACHE_FORWARD (struct syntax_cache *cache, Charxpos pos) ) { - if (!(pos >= cache->prev_change && pos < cache->next_change)) + /* #### Formerly this function, and the next one, had + + if (pos < cache->prev_change || pos >= cache->next_change) + + just like for plain UPDATE_SYNTAX_CACHE. However, sometimes the + value of POS may be invalid (particularly, it may be 0 for a buffer). + FSF has the check at only one end, so let's try the same. */ + if (pos >= cache->next_change) update_syntax_cache (cache, pos, 1); } @@ -364,7 +371,7 @@ UPDATE_SYNTAX_CACHE_BACKWARD (struct syntax_cache *cache, Charxpos pos) ) { - if (!(pos >= cache->prev_change && pos < cache->next_change)) + if (pos < cache->prev_change) update_syntax_cache (cache, pos, -1); } @@ -374,7 +381,7 @@ UPDATE_SYNTAX_CACHE (struct syntax_cache *cache, Charxpos pos) ) { - if (!(pos >= cache->prev_change && pos < cache->next_change)) + if (pos < cache->prev_change || pos >= cache->next_change) update_syntax_cache (cache, pos, 0); } Index: src/sysdep.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdep.c,v retrieving revision 1.67 retrieving revision 1.70 diff -u -r1.67 -r1.70 --- src/sysdep.c 7 Feb 2003 21:05:35 -0000 1.67 +++ src/sysdep.c 1 Mar 2003 07:25:36 -0000 1.70 @@ -1,7 +1,7 @@ /* Interfaces to system-dependent kernel and library entries. Copyright (C) 1985-1988, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -2085,11 +2085,7 @@ /* Need start_of_data() as much as possible now, for total_data_usage(); but with PDUMP and WIN32_NATIVE, can't currently do it. */ -#if !defined (CANNOT_DUMP) && (!defined (PDUMP) || !defined (WIN32_NATIVE)) -#define NEED_STARTS -#endif - -#if !defined (SYSTEM_MALLOC) && !defined (NEED_STARTS) +#if ! (defined (PDUMP) && defined (WIN32_NATIVE) && defined (SYSTEM_MALLOC)) #define NEED_STARTS #endif @@ -2173,7 +2169,7 @@ #endif /* ORDINARY_LINK */ #endif /* DATA_START */ } -#endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */ +#endif /* NEED_STARTS aka !(PDUMP && WIN32_NATIVE && SYSTEM_MALLOC) */ extern void *minimum_address_seen; /* from xmalloc() */ extern void *maximum_address_seen; /* from xmalloc() */ @@ -2187,7 +2183,7 @@ void *data_start = minimum_address_seen; #endif -#if !defined (WIN32_NATIVE) && !defined (CYGWIN) +#ifndef WIN32_ANY void *data_end = sbrk (0); #else void *data_end = maximum_address_seen; @@ -2255,9 +2251,7 @@ /* Turn the hostname into the official, fully-qualified hostname. Don't do this if we're going to dump; this can confuse system libraries on some machines and make the dumped emacs core dump. */ -# ifndef CANNOT_DUMP if (initialized) -# endif /* not CANNOT_DUMP */ if (!strchr (hostname, '.')) { # if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO)) @@ -2469,6 +2463,11 @@ /* Encapsulations of system calls */ /************************************************************************/ +/* The documentation in VC++ claims that the pathname library functions + accept strings in the current locale-specific encoding, but that's + false, because they just call the native Win32 routines directly, which + always use the system-default encoding (which is what Qmswindows_tstr + will give us when not XEUNICODE_P). */ #ifdef WIN32_NATIVE #define PATHNAME_CONVERT_OUT(path, pathout) C_STRING_TO_TSTR (path, pathout) #else @@ -3223,6 +3222,12 @@ C_STRING_TO_EXTERNAL (envp[i], new_envp[i], Qnative); new_envp[envc] = NULL; +#if defined (WIN32_NATIVE) + if (XEUNICODE_P) + return _wexecve ((const wchar_t *) pathext, + (const wchar_t * const *) new_argv, + (const wchar_t * const *) new_envp); +#endif return execve (pathext, new_argv, new_envp); } Index: src/sysdll.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdll.c,v retrieving revision 1.10 retrieving revision 1.12 diff -u -r1.10 -r1.12 --- src/sysdll.c 7 Feb 2003 21:40:23 -0000 1.10 +++ src/sysdll.c 16 Apr 2003 20:24:07 -0000 1.12 @@ -27,6 +27,17 @@ #include "lisp.h" #include "sysdll.h" +#ifdef DLSYM_NEEDS_UNDERSCORE +#define MAYBE_PREPEND_UNDERSCORE(n) do { \ + char *buf = alloca_array (char, strlen (n) + 2); \ + *buf = '_'; \ + strcpy (buf + 1, n); \ + n = buf; \ +} while (0) +#else +#define MAYBE_PREPEND_UNDERSCORE(n) +#endif + /* This whole file is conditional upon HAVE_SHLIB */ #ifdef HAVE_SHLIB @@ -36,11 +47,19 @@ #include #ifndef RTLD_LAZY -# define RTLD_LAZY 1 +# ifdef DL_LAZY +# define RTLD_LAZY DL_LAZY +# else +# define RTLD_LAZY 1 +# endif #endif /* RTLD_LAZY isn't defined under FreeBSD - ick */ #ifndef RTLD_NOW -# define RTLD_NOW 2 +# ifdef DL_NOW +# define RTLD_NOW DL_NOW +# else +# define RTLD_NOW 2 +# endif #endif int @@ -64,24 +83,14 @@ dll_func dll_function (dll_handle h, const char *n) { -#ifdef DLSYM_NEEDS_UNDERSCORE - char *buf = alloca_array (char, strlen (n) + 2); - *buf = '_'; - strcpy (buf + 1, n); - n = buf; -#endif + MAYBE_PREPEND_UNDERSCORE (n); return (dll_func) dlsym ((void *) h, n); } dll_var dll_variable (dll_handle h, const char *n) { -#ifdef DLSYM_NEEDS_UNDERSCORE - char *buf = alloca_array (char, strlen (n) + 2); - *buf = '_'; - strcpy (buf + 1, n); - n = buf; -#endif + MAYBE_PREPEND_UNDERSCORE (n); return (dll_var)dlsym ((void *)h, n); } @@ -112,7 +121,7 @@ /* shl_load will hang hard if passed a NULL fname. */ if (fname == NULL) return NULL; - return (dll_handle) shl_load (fname, BIND_DEFERRED,0L); + return (dll_handle) shl_load (fname, BIND_DEFERRED, 0L); } int @@ -241,6 +250,71 @@ dll_error (dll_handle h) { return "Windows DLL Error"; +} +#elif defined(HAVE_DYLD) +/* This section supports MacOSX dynamic libraries. Dynamically + loadable libraries must be compiled as bundles, not dynamiclibs. +*/ + +#include + +int +dll_init (const char *arg) +{ + return 0; +} + +dll_handle +dll_open (const char *fname) +{ + NSObjectFileImage file; + NSModule out; + NSObjectFileImageReturnCode ret = + NSCreateObjectFileImageFromFile(fname, &file); + if (ret != NSObjectFileImageSuccess) { + return NULL; + } + out = NSLinkModule(file, fname, + NSLINKMODULE_OPTION_BINDNOW | + NSLINKMODULE_OPTION_PRIVATE | + NSLINKMODULE_OPTION_RETURN_ON_ERROR); + return (dll_handle)out; +} + +int +dll_close (dll_handle h) +{ + return NSUnLinkModule((NSModule)h, NSUNLINKMODULE_OPTION_NONE); +} + +dll_func +dll_function (dll_handle h, const char *n) +{ + NSSymbol sym; + MAYBE_PREPEND_UNDERSCORE (n); + sym = NSLookupSymbolInModule((NSModule)h, n); + if (sym == 0) return 0; + return (dll_func)NSAddressOfSymbol(sym); +} + +dll_var +dll_variable (dll_handle h, const char *n) +{ + NSSymbol sym; + MAYBE_PREPEND_UNDERSCORE (n); + sym = NSLookupSymbolInModule((NSModule)h, n); + if (sym == 0) return 0; + return (dll_var)NSAddressOfSymbol(sym); +} + +const char * +dll_error (dll_handle h) +{ + NSLinkEditErrors c; + int errorNumber; + const char *fileNameWithError, *errorString; + NSLinkEditError(&c, &errorNumber, &fileNameWithError, &errorString); + return errorString; } #else /* Catchall if we don't know about this systems method of dynamic loading */ Index: src/sysfile.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysfile.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/sysfile.h 5 Jun 2002 09:57:18 -0000 1.15 +++ src/sysfile.h 20 Feb 2003 08:19:43 -0000 1.16 @@ -60,7 +60,7 @@ #include -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY # include #endif @@ -452,7 +452,7 @@ #endif /* WIN32_NATIVE */ -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY #define DEVICE_SEP ':' @@ -468,13 +468,13 @@ return (c == '/' || c == '\\' || c == ':'); } -#else /* not (defined (WIN32_NATIVE) || defined (CYGWIN)) */ +#else /* not WIN32_ANY */ #define IS_DEVICE_SEP(c) 0 #define IS_DIRECTORY_SEP(c) ((c) == DIRECTORY_SEP) #define IS_ANY_SEP(c) IS_DIRECTORY_SEP (c) -#endif /* defined (WIN32_NATIVE) || defined (CYGWIN) */ +#endif /* WIN32_ANY */ #endif /* emacs */ Index: src/systime.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/systime.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/systime.h 5 Jun 2002 09:57:19 -0000 1.17 +++ src/systime.h 20 Feb 2003 08:19:43 -0000 1.18 @@ -266,12 +266,12 @@ #endif /* WIN32_NATIVE */ -#if defined (WIN32_NATIVE) || defined (CYGWIN) +#ifdef WIN32_ANY int mswindows_setitimer (int kind, const struct itimerval *itnew, struct itimerval *itold); -#endif /* defined (WIN32_NATIVE) || defined (CYGWIN) */ +#endif /* WIN32_ANY */ /* #### Move this comment elsewhere when we figure out the place. Index: src/text.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.c,v retrieving revision 1.14 retrieving revision 1.17 diff -u -r1.14 -r1.17 --- src/text.c 13 Feb 2003 09:57:08 -0000 1.14 +++ src/text.c 24 Apr 2003 05:33:44 -0000 1.17 @@ -703,38 +703,38 @@ /* strcasecmp() implementation from BSD */ static Ibyte strcasecmp_charmap[] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', - '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', - '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', - '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', + 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, + 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017, + 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027, + 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037, + 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, + 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, + 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, + 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, + 0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147, + 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157, + 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, + 0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137, + 0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147, + 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157, + 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, + 0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177, + 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207, + 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217, + 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227, + 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237, + 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247, + 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257, + 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267, + 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277, + 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307, + 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317, + 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327, + 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337, + 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347, + 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357, + 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367, + 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377 }; /* A version that works like generic strcasecmp() -- only collapsing @@ -2898,7 +2898,7 @@ #endif } -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY /* Optimize the common case involving Unicode where only ASCII is involved */ else if (source_type != DFC_TYPE_LISP_LSTREAM && sink_type != DFC_TYPE_LISP_LSTREAM && @@ -2932,7 +2932,7 @@ Dynarr_add (conversion_out_dynarr, (Extbyte) '\0'); } } -#endif /* HAVE_WIN32_CODING_SYSTEMS */ +#endif /* WIN32_ANY */ else { Lisp_Object streams_to_delete[3]; @@ -2940,9 +2940,9 @@ Lisp_Object instream, outstream; Lstream *reader, *writer; -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY the_hard_way: -#endif /* HAVE_WIN32_CODING_SYSTEMS */ +#endif /* WIN32_ANY */ delete_count = 0; if (source_type == DFC_TYPE_LISP_LSTREAM) instream = source->lisp_object; @@ -3088,7 +3088,7 @@ Dynarr_add_many (conversion_in_dynarr, source->data.ptr, source->data.len); #endif } -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY /* Optimize the common case involving Unicode where only ASCII/Latin-1 is involved */ else if (source_type != DFC_TYPE_LISP_LSTREAM && @@ -3131,7 +3131,7 @@ #endif /* MULE */ } } -#endif /* HAVE_WIN32_CODING_SYSTEMS */ +#endif /* WIN32_ANY */ else { Lisp_Object streams_to_delete[3]; @@ -3139,9 +3139,9 @@ Lisp_Object instream, outstream; Lstream *reader, *writer; -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY the_hard_way: -#endif /* HAVE_WIN32_CODING_SYSTEMS */ +#endif /* WIN32_ANY */ delete_count = 0; if (source_type == DFC_TYPE_LISP_LSTREAM) instream = source->lisp_object; @@ -3219,6 +3219,156 @@ PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion); } +/* ----------------------------------------------------------------------- */ +/* New-style DFC converters (data is returned rather than stored into var) */ +/* ----------------------------------------------------------------------- */ + +/* We handle here the cases where SRC is a Lisp_Object, internal data + (sized or unsized), or external data (sized or unsized), and return type + is unsized alloca() or malloc() data. If the return type is a + Lisp_Object, use build_ext_string() for unsized external data, + make_ext_string() for sized external data. If the return type needs to + be sized data, use the *_TO_SIZED_*() macros, and for other more + complicated cases, use the original TO_*_FORMAT() macros. */ + +static void +new_dfc_convert_now_damn_it (const void *src, Bytecount src_size, + enum new_dfc_src_type type, + void **dst, Bytecount *dst_size, + Lisp_Object codesys) +{ + /* #### In the case of alloca(), it would be a bit more efficient, for + small strings, to use static Dynarr's like are used internally in + TO_*_FORMAT(), or some other way of avoiding malloc() followed by + free(). I doubt it really matters, though. */ + + switch (type) + { + case DFC_EXTERNAL: + TO_INTERNAL_FORMAT (C_STRING, src, + MALLOC, (*dst, *dst_size), codesys); + break; + + case DFC_SIZED_EXTERNAL: + TO_INTERNAL_FORMAT (DATA, (src, src_size), + MALLOC, (*dst, *dst_size), codesys); + break; + + case DFC_INTERNAL: + TO_EXTERNAL_FORMAT (C_STRING, src, + MALLOC, (*dst, *dst_size), codesys); + break; + + case DFC_SIZED_INTERNAL: + TO_EXTERNAL_FORMAT (DATA, (src, src_size), + MALLOC, (*dst, *dst_size), codesys); + break; + + case DFC_LISP_STRING: + TO_EXTERNAL_FORMAT (LISP_STRING, VOID_TO_LISP (src), + MALLOC, (*dst, *dst_size), codesys); + break; + + default: + abort (); + } +} + +void * +new_dfc_convert_malloc (const void *src, Bytecount src_size, + enum new_dfc_src_type type, Lisp_Object codesys) +{ + void *dst; + Bytecount dst_size; + + new_dfc_convert_now_damn_it (src, src_size, type, &dst, &dst_size, codesys); + return dst; +} + +/* For alloca(), things are trickier because the calling function needs to + allocate. This means that the caller needs to do the following: + + (a) invoke us to do the conversion, remember the data and return the size. + (b) alloca() the proper size. + (c) invoke us again to copy the data. + + We need to handle the possibility of two or more invocations of the + converter in the same expression. In such cases it's conceivable that + the evaluation of the sub-expressions will be overlapping (e.g. one size + function called, then the other one called, then the copy functions + called). To handle this, we keep a list of active data, indexed by the + src expression. (We use the stringize operator to avoid evaluating the + expression multiple times.) If the caller uses the exact same src + expression twice in two converter calls in the same subexpression, we + will lose, but at least we can check for this and abort(). We could + conceivably try to index on other parameters as well, but there is not + really any point. */ + +typedef struct +{ + const char *srctext; + void *dst; + Bytecount dst_size; +} dfc_e2c_vals; + +typedef struct +{ + Dynarr_declare (dfc_e2c_vals); +} dfc_e2c_vals_dynarr; + +static dfc_e2c_vals_dynarr *active_dfc_e2c; + +static int +find_pos_of_existing_active_dfc_e2c (const char *srctext) +{ + dfc_e2c_vals *vals = NULL; + int i; + + for (i = 0; i < Dynarr_length (active_dfc_e2c); i++) + { + vals = Dynarr_atp (active_dfc_e2c, i); + if (vals->srctext == srctext) + return i; + } + + return -1; +} + +void * +new_dfc_convert_alloca (const char *srctext, void *alloca_data) +{ + dfc_e2c_vals *vals; + int i = find_pos_of_existing_active_dfc_e2c (srctext); + + assert (i >= 0); + vals = Dynarr_atp (active_dfc_e2c, i); + assert (alloca_data); + memcpy (alloca_data, vals->dst, vals->dst_size + 2); + xfree (vals->dst); + Dynarr_delete (active_dfc_e2c, i); + return alloca_data; +} + +Bytecount +new_dfc_convert_size (const char *srctext, const void *src, + Bytecount src_size, enum new_dfc_src_type type, + Lisp_Object codesys) +{ + dfc_e2c_vals vals; + + assert (find_pos_of_existing_active_dfc_e2c (srctext) < 0); + + vals.srctext = srctext; + + new_dfc_convert_now_damn_it (src, src_size, type, &vals.dst, &vals.dst_size, + codesys); + + Dynarr_add (active_dfc_e2c, vals); + /* The size is always + 2 because we have double zero-termination at the + end of all data (for Unicode-correctness). */ + return vals.dst_size + 2; +} + /************************************************************************/ /* Basic Ichar functions */ @@ -3740,6 +3890,7 @@ Ibyte_dynarr *); conversion_out_dynarr_list = Dynarr_new2 (Extbyte_dynarr_dynarr, Extbyte_dynarr *); + active_dfc_e2c = Dynarr_new (dfc_e2c_vals); for (i = 0; i <= MAX_BYTEBPOS_GAP_SIZE_3; i++) three_to_one_table[i] = i / 3; Index: src/text.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.h,v retrieving revision 1.13 retrieving revision 1.16 diff -u -r1.13 -r1.16 --- src/text.h 5 Feb 2003 06:20:51 -0000 1.13 +++ src/text.h 2 Mar 2003 09:38:54 -0000 1.16 @@ -1,7 +1,7 @@ /* Header file for text manipulation primitives and macros. Copyright (C) 1985-1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -336,7 +336,7 @@ #endif /* MULE */ -int dfc_coding_system_is_unicode (Lisp_Object coding_system); +int dfc_coding_system_is_unicode (Lisp_Object codesys); DECLARE_INLINE_HEADER ( Bytecount dfc_external_data_len (const void *ptr, Lisp_Object codesys) @@ -490,7 +490,7 @@ #ifdef ERROR_CHECK_TEXT /* We use a separate definition to avoid warnings about unused dc_ptr1 */ #define DEC_IBYTEPTR(ptr) do { \ - const Ibyte *dc_ptr1 = (ptr); \ + const Ibyte *dc_ptr1 = (ptr); \ do { \ (ptr)--; \ } while (!valid_ibyteptr_p (ptr)); \ @@ -1091,20 +1091,20 @@ /* Make an alloca'd copy of a Lisp string */ #define LISP_STRING_TO_ALLOCA(s, lval) \ do { \ - Ibyte **_lta_ = (Ibyte **) &(lval); \ + Ibyte **_lta_ = (Ibyte **) &(lval); \ Lisp_Object _lta_2 = (s); \ *_lta_ = alloca_array (Ibyte, 1 + XSTRING_LENGTH (_lta_2)); \ memcpy (*_lta_, XSTRING_DATA (_lta_2), 1 + XSTRING_LENGTH (_lta_2)); \ } while (0) -/* Make an alloca'd copy of a Ibyte * */ +/* Make an alloca'd copy of a Ibyte * */ \ #define IBYTE_STRING_TO_ALLOCA(p, lval) \ -do { \ +do { \ Ibyte **_bsta_ = (Ibyte **) &(lval); \ - const Ibyte *_bsta_2 = (p); \ - Bytecount _bsta_3 = qxestrlen (_bsta_2); \ + const Ibyte *_bsta_2 = (p); \ + Bytecount _bsta_3 = qxestrlen (_bsta_2); \ *_bsta_ = alloca_array (Ibyte, 1 + _bsta_3); \ - memcpy (*_bsta_, _bsta_2, 1 + _bsta_3); \ + memcpy (*_bsta_, _bsta_2, 1 + _bsta_3); \ } while (0) @@ -1410,10 +1410,10 @@ ... from an ASCII string, with length specified. Non-ASCII characters in the string are *ILLEGAL* (read abort() with error-checking defined). void eicpy_ext (Eistring *eistr, const Extbyte *extdata, - Lisp_Object coding_system); + Lisp_Object codesys); ... from external null-terminated data, with coding system specified. void eicpy_ext_len (Eistring *eistr, const Extbyte *extdata, - Bytecount extlen, Lisp_Object coding_system); + Bytecount extlen, Lisp_Object codesys); ... from external data, with length and coding system specified. void eicpy_lstream (Eistring *eistr, Lisp_Object lstream); ... from an lstream; reads data till eof. Data must be in default @@ -1592,7 +1592,7 @@ * Converting to an external format * ********************************************** - void eito_external (Eistring *eistr, Lisp_Object coding_system); + void eito_external (Eistring *eistr, Lisp_Object codesys); Convert the Eistring to an external format and store the result in the string. NOTE: Further changes to the Eistring will *NOT* change the external data stored in the string. You will have to @@ -1880,7 +1880,7 @@ { \ if ((ei)->mallocp_) \ /* xrealloc always preserves existing data as much as possible */ \ - (ei)->data_ = (Ibyte *) xrealloc ((ei)->data_, ei1newsize); \ + (ei)->data_ = (Ibyte *) xrealloc ((ei)->data_, ei1newsize); \ else \ { \ /* We don't have realloc, so ALLOCA() more space and copy the \ @@ -1936,7 +1936,7 @@ do { \ Lisp_Object ei3 = (lisp_string); \ EI_ALLOC_AND_COPY (ei, XSTRING_DATA (ei3), XSTRING_LENGTH (ei3), \ - string_char_length (ei3)); \ + string_char_length (ei3)); \ } while (0) #define eicpy_lstr_off(ei, lisp_string, off, charoff, len, charlen) \ @@ -1958,7 +1958,7 @@ #define eicpy_raw_fmt(ei, ptr, len, fmt, object) \ do { \ - const Ibyte *ei12ptr = (ptr); \ + const Ibyte *ei12ptr = (ptr); \ Internal_Format ei12fmt = (fmt); \ int ei12len = (len); \ assert (ei12fmt == FORMAT_DEFAULT); \ @@ -1979,11 +1979,11 @@ #define eicpy_rawz(ei, ptr) eicpy_rawz_fmt (ei, ptr, FORMAT_DEFAULT, Qnil) -#define eicpy_ch(ei, ch) \ -do { \ +#define eicpy_ch(ei, ch) \ +do { \ Ibyte ei12p2[MAX_ICHAR_LEN]; \ Bytecount ei12p2len = set_itext_ichar (ei12p2, ch); \ - EI_ALLOC_AND_COPY (ei, ei12p2, ei12p2len, 1); \ + EI_ALLOC_AND_COPY (ei, ei12p2, ei12p2len, 1); \ } while (0) #define eicpy_c(ei, c_string) \ @@ -2003,24 +2003,23 @@ eicpy_ext_len (ei, ei6, ei6len, Qbinary); \ } while (0) -#define eicpy_ext_len(ei, extdata, extlen, coding_system) \ +#define eicpy_ext_len(ei, extdata, extlen, codesys) \ do { \ const Extbyte *ei7 = (extdata); \ int ei7len = (extlen); \ \ - TO_INTERNAL_FORMAT (DATA, (ei7, ei7len), \ - ALLOCA, ((ei)->data_, (ei)->bytelen_), \ - coding_system); \ + SIZED_EXTERNAL_TO_SIZED_C_STRING (ei7, ei7len, (ei)->data_, \ + (ei)->bytelen_, codesys); \ (ei)->max_size_allocated_ = (ei)->bytelen_ + 1; \ (ei)->charlen_ = bytecount_to_charcount ((ei)->data_, (ei)->bytelen_); \ } while (0) -#define eicpy_ext(ei, extdata, coding_system) \ -do { \ - const Extbyte *ei8 = (extdata); \ - \ - eicpy_ext_len (ei, ei8, dfc_external_data_len (ei8, coding_system), \ - coding_system); \ +#define eicpy_ext(ei, extdata, codesys) \ +do { \ + const Extbyte *ei8 = (extdata); \ + \ + eicpy_ext_len (ei, ei8, dfc_external_data_len (ei8, codesys), \ + codesys); \ } while (0) #define eicpy_lbuf(eistr, lisp_buf, off, charoff, len, charlen) \ @@ -2245,7 +2244,7 @@ #define eicat_ch(ei, ch) \ do { \ - Ibyte ei22ch[MAX_ICHAR_LEN]; \ + Ibyte ei22ch[MAX_ICHAR_LEN]; \ Bytecount ei22len = set_itext_ichar (ei22ch, ch); \ eicat_1 (ei, ei22ch, ei22len, 1); \ } while (0) @@ -2286,7 +2285,7 @@ #define eisub_ei(ei, off, charoff, len, charlen, ei2) \ do { \ - const Eistring *ei19 = (ei2); \ + const Eistring *ei19 = (ei2); \ eisub_1 (ei, off, charoff, len, charlen, ei19->data_, ei19->bytelen_, \ ei19->charlen_); \ } while (0) @@ -2301,7 +2300,7 @@ #define eisub_ch(ei, off, charoff, len, charlen, ch) \ do { \ - Ibyte ei21ch[MAX_ICHAR_LEN]; \ + Ibyte ei21ch[MAX_ICHAR_LEN]; \ Bytecount ei21len = set_itext_ichar (ei21ch, ch); \ eisub_1 (ei, off, charoff, len, charlen, ei21ch, ei21len, 1); \ } while (0) @@ -2312,7 +2311,7 @@ /* ----- Converting to an external format ----- */ -#define eito_external(ei, coding_system) \ +#define eito_external(ei, codesys) \ do { \ if ((ei)->mallocp_) \ { \ @@ -2323,12 +2322,12 @@ } \ TO_EXTERNAL_FORMAT (DATA, ((ei)->data_, (ei)->bytelen_), \ MALLOC, ((ei)->extdata_, (ei)->extlen_), \ - coding_system); \ + codesys); \ } \ else \ TO_EXTERNAL_FORMAT (DATA, ((ei)->data_, (ei)->bytelen_), \ ALLOCA, ((ei)->extdata_, (ei)->extlen_), \ - coding_system); \ + codesys); \ } while (0) #define eiextdata(ei) ((ei)->extdata_) @@ -2433,15 +2432,15 @@ #define EI_CASECHANGE(ei, downp) \ do { \ int ei11new_allocmax = (ei)->charlen_ * MAX_ICHAR_LEN + 1; \ - Ibyte *ei11storage = \ - (Ibyte *) alloca_array (Ibyte, ei11new_allocmax); \ + Ibyte *ei11storage = \ + (Ibyte *) alloca_array (Ibyte, ei11new_allocmax); \ int ei11newlen = eistr_casefiddle_1 ((ei)->data_, (ei)->bytelen_, \ ei11storage, downp); \ \ if (ei11newlen) \ { \ (ei)->max_size_allocated_ = ei11new_allocmax; \ - (ei)->data_ = ei11storage; \ + (ei)->data_ = ei11storage; \ (ei)->bytelen_ = ei11newlen; \ /* charlen is the same. */ \ } \ @@ -2457,10 +2456,57 @@ /* */ /************************************************************************/ /* - All client code should use only the two macros + The macros below are used for converting data between different formats. + Generally, the data is textual, and the formats are related to + internationalization (e.g. converting between internal-format text and + UTF-8) -- but the mechanism is general, and could be used for anything, + e.g. decoding gzipped data. + + In general, conversion involves a source of data, a sink, the existing + format of the source data, and the desired format of the sink. The + macros below, however, always require that either the source or sink is + internal-format text. Therefore, in practice the conversions below + involve source, sink, an external format (specified by a coding system), + and the direction of conversion (internal->external or vice-versa). + + Sources and sinks can be raw data (sized or unsized -- when unsized, + input data is assumed to be null-terminated [double null-terminated for + Unicode-format data], and on output the length is not stored anywhere), + Lisp strings, Lisp buffers, lstreams, and opaque data objects. When the + output is raw data, the result can be allocated either with alloca() or + malloc(). (There is currently no provision for writing into a fixed + buffer. If you want this, use alloca() output and then copy the data -- + but be careful with the size! Unless you are very sure of the encoding + being used, upper bounds for the size are not in general computable.) + The obvious restrictions on source and sink types apply (e.g. Lisp + strings are a source and sink only for internal data). + + All raw data outputted will contain an extra null byte (two bytes for + Unicode -- currently, in fact, all output data, whether internal or + external, is double-null-terminated, but you can't count on this; see + below). This means that enough space is allocated to contain the extra + nulls; however, these nulls are not reflected in the returned output + size. + + The most basic macros are TO_EXTERNAL_FORMAT and TO_INTERNAL_FORMAT. + These can be used to convert between any kinds of sources or sinks. + However, 99% of conversions involve raw data or Lisp strings as both + source and sink, and usually data is output as alloca() rather than + malloc(). For this reason, convenience macros are defined for many types + of conversions involving raw data and/or Lisp strings, especially when + the output is an alloca()ed string. (When the destination is a + Lisp_String, there are other functions that should be used instead -- + build_ext_string() and make_ext_string(), for example.) The convenience + macros are of two types -- the older kind that store the result into a + specified variable, and the newer kind that return the result. The newer + kind of macros don't exist when the output is sized data, because that + would have two return values. NOTE: All convenience macros are + ultimately defined in terms of TO_EXTERNAL_FORMAT and TO_INTERNAL_FORMAT. + Thus, any comments below about the workings of these macros also apply to + all convenience macros. - TO_EXTERNAL_FORMAT (source_type, source, sink_type, sink, coding_system) - TO_INTERNAL_FORMAT (source_type, source, sink_type, sink, coding_system) + TO_EXTERNAL_FORMAT (source_type, source, sink_type, sink, codesys) + TO_INTERNAL_FORMAT (source_type, source, sink_type, sink, codesys) Typical use is @@ -2648,13 +2694,13 @@ void dfc_convert_to_external_format (dfc_conversion_type source_type, dfc_conversion_data *source, - Lisp_Object coding_system, + Lisp_Object codesys, dfc_conversion_type sink_type, dfc_conversion_data *sink); void dfc_convert_to_internal_format (dfc_conversion_type source_type, dfc_conversion_data *source, - Lisp_Object coding_system, + Lisp_Object codesys, dfc_conversion_type sink_type, dfc_conversion_data *sink); /* CPP Trickery */ @@ -2766,19 +2812,131 @@ #define DFC_LISP_BUFFER_USE_CONVERTED_DATA(sink) \ Lstream_delete (XLSTREAM (dfc_sink.lisp_object)) +/* #define TEST_NEW_DFC */ + /* Convenience macros for extremely common invocations */ -#define C_STRING_TO_EXTERNAL(in, out, coding_system) \ - TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, coding_system) -#define C_STRING_TO_EXTERNAL_MALLOC(in, out, coding_system) \ - TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, coding_system) -#define EXTERNAL_TO_C_STRING(in, out, coding_system) \ - TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, coding_system) -#define EXTERNAL_TO_C_STRING_MALLOC(in, out, coding_system) \ - TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, coding_system) -#define LISP_STRING_TO_EXTERNAL(in, out, coding_system) \ - TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_ALLOCA, out, coding_system) -#define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, coding_system) \ - TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_MALLOC, out, coding_system) +#ifdef TEST_NEW_DFC +#define C_STRING_TO_EXTERNAL(in, out, codesys) \ + do { * (Extbyte **) &(out) = \ + NEW_C_STRING_TO_EXTERNAL (in, codesys); } while (0) +#define SIZED_C_STRING_TO_EXTERNAL(in, inlen, out, codesys) \ + do { * (Extbyte **) &(out) = \ + NEW_SIZED_C_STRING_TO_EXTERNAL (in, inlen, codesys); } while (0) +#define EXTERNAL_TO_C_STRING(in, out, codesys) \ + do { * (Ibyte **) &(out) = \ + NEW_EXTERNAL_TO_C_STRING (in, codesys); } while (0) +#define SIZED_EXTERNAL_TO_C_STRING(in, inlen, out, codesys) \ + do { * (Ibyte **) &(out) = \ + NEW_SIZED_EXTERNAL_TO_C_STRING (in, inlen, codesys); } while (0) +#define LISP_STRING_TO_EXTERNAL(in, out, codesys) \ + do { * (Extbyte **) &(out) = \ + NEW_LISP_STRING_TO_EXTERNAL (in, codesys); } while (0) +#else +#define C_STRING_TO_EXTERNAL(in, out, codesys) \ + TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, codesys) +#define SIZED_C_STRING_TO_EXTERNAL(in, inlen, out, codesys) \ + TO_EXTERNAL_FORMAT (DATA, (in, inlen), C_STRING_ALLOCA, out, codesys) +#define EXTERNAL_TO_C_STRING(in, out, codesys) \ + TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, codesys) +#define SIZED_EXTERNAL_TO_C_STRING(in, inlen, out, codesys) \ + TO_INTERNAL_FORMAT (DATA, (in, inlen), C_STRING_ALLOCA, out, codesys) +#define LISP_STRING_TO_EXTERNAL(in, out, codesys) \ + TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_ALLOCA, out, codesys) +#endif /* TEST_NEW_DFC */ + +#define C_STRING_TO_SIZED_EXTERNAL(in, out, outlen, codesys) \ + TO_EXTERNAL_FORMAT (C_STRING, in, ALLOCA, (out, outlen), codesys) +#define SIZED_C_STRING_TO_SIZED_EXTERNAL(in, inlen, out, outlen, codesys) \ + TO_EXTERNAL_FORMAT (DATA, (in, inlen), ALLOCA, (out, outlen), codesys) +#define EXTERNAL_TO_SIZED_C_STRING(in, out, outlen, codesys) \ + TO_INTERNAL_FORMAT (C_STRING, in, ALLOCA, (out, outlen), codesys) +#define SIZED_EXTERNAL_TO_SIZED_C_STRING(in, inlen, out, outlen, codesys) \ + TO_INTERNAL_FORMAT (DATA, (in, inlen), ALLOCA, (out, outlen), codesys) +#define LISP_STRING_TO_SIZED_EXTERNAL(in, out, outlen, codesys) \ + TO_EXTERNAL_FORMAT (LISP_STRING, in, ALLOCA, (out, outlen), codesys) + +/* In place of EXTERNAL_TO_LISP_STRING(), use build_ext_string() and/or + make_ext_string(). */ + +#ifdef TEST_NEW_DFC +#define C_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \ + do { * (Extbyte **) &(out) = \ + NEW_C_STRING_TO_EXTERNAL_MALLOC (in, codesys); } while (0) +#define EXTERNAL_TO_C_STRING_MALLOC(in, out, codesys) \ + do { * (Ibyte **) &(out) = \ + NEW_EXTERNAL_TO_C_STRING_MALLOC (in, codesys); } while (0) +#define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \ + do { * (Extbyte **) &(out) = \ + NEW_LISP_STRING_TO_EXTERNAL_MALLOC (in, codesys); } while (0) +#else +#define C_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \ + TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, codesys) +#define EXTERNAL_TO_C_STRING_MALLOC(in, out, codesys) \ + TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, codesys) +#define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \ + TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_MALLOC, out, codesys) +#endif /* TEST_NEW_DFC */ + +enum new_dfc_src_type +{ + DFC_EXTERNAL, + DFC_SIZED_EXTERNAL, + DFC_INTERNAL, + DFC_SIZED_INTERNAL, + DFC_LISP_STRING +}; + +void *new_dfc_convert_malloc (const void *src, Bytecount src_size, + enum new_dfc_src_type type, Lisp_Object codesys); +void *new_dfc_convert_alloca (const char *srctext, void *alloca_data); +Bytecount new_dfc_convert_size (const char *srctext, const void *src, + Bytecount src_size, enum new_dfc_src_type type, + Lisp_Object codesys); + +/* Version of EXTERNAL_TO_C_STRING that *RETURNS* the translated string, + still in alloca() space. Requires some trickiness to do this, but gets + it done! */ + +/* NOTE: If you make two invocations of the dfc functions below in the same + subexpression and use the exact same expression for the source in both + cases, you will lose. In this unlikely case, you will get an abort, and + need to rewrite the code. +*/ + +/* We need to use ALLOCA_FUNCALL_OK here. Some compilers have been known + to choke when alloca() occurs as a funcall argument, and so we check + this in configure. Rewriting the expressions below to use a temporary + variable, so that the call to alloca() is outside of + new_dfc_convert_alloca(), won't help because the entire NEW_DFC call + could be inside of a function call. */ + +#define NEW_DFC_CONVERT_1_ALLOCA(src, src_size, type, codesys) \ + new_dfc_convert_alloca \ + (#src, ALLOCA_FUNCALL_OK (new_dfc_convert_size (#src, src, src_size, \ + type, codesys))) + +#define NEW_EXTERNAL_TO_C_STRING(src, codesys) \ + (Ibyte *) NEW_DFC_CONVERT_1_ALLOCA (src, -1, DFC_EXTERNAL, codesys) +#define NEW_EXTERNAL_TO_C_STRING_MALLOC(src, codesys) \ + (Ibyte *) new_dfc_convert_malloc (src, -1, DFC_EXTERNAL, codesys) +#define NEW_SIZED_EXTERNAL_TO_C_STRING(src, len, codesys) \ + (Ibyte *) NEW_DFC_CONVERT_1_ALLOCA (src, len, DFC_SIZED_EXTERNAL, codesys) +#define NEW_SIZED_EXTERNAL_TO_C_STRING_MALLOC(src, len, codesys) \ + (Ibyte *) new_dfc_convert_malloc (src, len, DFC_SIZED_EXTERNAL, codesys) +#define NEW_C_STRING_TO_EXTERNAL(src, codesys) \ + (Extbyte *) NEW_DFC_CONVERT_1_ALLOCA (src, -1, DFC_INTERNAL, codesys) +#define NEW_C_STRING_TO_EXTERNAL_MALLOC(src, codesys) \ + (Extbyte *) new_dfc_convert_malloc (src, -1, DFC_INTERNAL, codesys) +#define NEW_SIZED_C_STRING_TO_EXTERNAL(src, len, codesys) \ + (Extbyte *) NEW_DFC_CONVERT_1_ALLOCA (src, len, DFC_SIZED_INTERNAL, codesys) +#define NEW_SIZED_C_STRING_TO_EXTERNAL_MALLOC(src, len, codesys) \ + (Extbyte *) new_dfc_convert_malloc (src, len, DFC_SIZED_INTERNAL, codesys) +#define NEW_LISP_STRING_TO_EXTERNAL(src, codesys) \ + (Extbyte *) NEW_DFC_CONVERT_1_ALLOCA (LISP_TO_VOID (src), -1, \ + DFC_LISP_STRING, codesys) +#define NEW_LISP_STRING_TO_EXTERNAL_MALLOC(src, codesys) \ + (Extbyte *) new_dfc_convert_malloc (LISP_TO_VOID (src), -1, \ + DFC_LISP_STRING, codesys) /* Standins for various encodings, until we know them better */ #define Qcommand_argument_encoding Qnative @@ -2788,24 +2946,93 @@ #define Qmswindows_host_name_encoding Qmswindows_multibyte #define Qmswindows_service_name_encoding Qmswindows_multibyte -/* Standins for various X encodings, until we know them better */ +/* Standins for various X encodings, until we know them better. + + About encodings in X: + + X works with 5 different encodings: + + -- "Host Portable Character Encoding" == printable ASCII + space, tab, + newline + + -- STRING encoding == ASCII + Latin-1 + tab, newline + + -- Locale-specific encoding + + -- Compound text == STRING encoding + ISO-2022 escape sequences to + switch between different locale-specific encodings. + + -- ANSI C wide-character encoding + + The Host Portable Character Encoding (HPCE) is used for atom names, font + names, color names, keysyms, geometry strings, resource manager quarks, + display names, locale names, and various other things. When describing + such strings, the X manual typically says "If the ... is not in the Host + Portable Character Encoding, the result is implementation dependent." + + The wide-character encoding is used only in the Xwc* functions, which + are provided as equivalents to Xmb* functions. + + STRING and compound text are used in the value of string properties and + selection data, both of which are values with an associated type atom, + which can be STRING or COMPOUND_TEXT. It can also be a locale name, as + specified in setlocale() (#### as usual, there is no normalization + whatsoever of these names). + + X also defines a type called "TEXT", which is used only as a requested + type, and produces data in a type "convenient to the owner". However, + there is some indication that X expects this to be the locale-specific + encoding. + + According to the glossary, the locale is used in + + -- Encoding and processing of input method text + -- Encoding of resource files and values + -- Encoding and imaging of text strings + -- Encoding and decoding for inter-client text communication + + The functions XmbTextListToTextProperty and XmbTextPropertyToTextList + (and Xwc* equivalents) can be used to convert between the + locale-specific encoding (XTextStyle), STRING (XStringStyle), and + compound text (XCompoundTextStyle), as well as XStdICCTextStyle, which + converts to STRING if possible, and if not, COMPOUND_TEXT. This is + used, for example, in XmbSetWMProperties, in the window_name and + icon_name properties (WM_NAME and WM_ICON_NAME), which are in the + locale-specific encoding on input, and are stored as STRING if possible, + COMPOUND_TEXT otherwise. + */ /* !!#### Need to verify the encoding used in lwlib -- Qnative or Qctext? Almost certainly the former. Use a standin for now. */ #define Qlwlib_encoding Qnative -#define Qx_atom_name_encoding Qctext -/* font names are often stored in atoms, so it gets sticky if we set this - to something different from atom-name encoding */ -#define Qx_font_name_encoding Qctext - -#define Qx_color_name_encoding Qctext +/* The Host Portable Character Encoding. */ +#define Qx_hpc_encoding Qnative +#define Qx_atom_name_encoding Qx_hpc_encoding +#define Qx_font_name_encoding Qx_hpc_encoding +#define Qx_color_name_encoding Qx_hpc_encoding +#define Qx_keysym_encoding Qx_hpc_encoding +#define Qx_geometry_encoding Qx_hpc_encoding +#define Qx_resource_name_encoding Qx_hpc_encoding +#define Qx_application_class_encoding Qx_hpc_encoding /* the following probably must agree with Qcommand_argument_encoding and Qenvironment_variable_encoding */ -#define Qx_display_name_encoding Qnative +#define Qx_display_name_encoding Qx_hpc_encoding +#define Qx_xpm_data_encoding Qx_hpc_encoding + +/* RedHat 6.2 contains a locale called "Francais" with the C-cedilla + encoded in ISO2022! */ +#define Qlocale_name_encoding Qctext #define Qstrerror_encoding Qnative + +/* Encoding for strings coming from Offix drag-n-drop */ +#define Qoffix_dnd_encoding Qnative + +/* !!#### This exists to remind us that our hexify routine is totally + un-Muleized. */ +#define Qdnd_hexify_encoding Qascii #define GET_STRERROR(var, num) \ do { \ Index: src/toolbar.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/toolbar.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- src/toolbar.c 12 Jan 2003 11:08:22 -0000 1.29 +++ src/toolbar.c 21 Feb 2003 06:57:00 -0000 1.30 @@ -1,7 +1,7 @@ /* Generic toolbar implementation. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2003 Ben Wing. Copyright (C) 1996 Chuck Thompson. This file is part of XEmacs. @@ -257,8 +257,7 @@ /* The following calls will automatically cause the dirty flags to be set; we delay frame size changes to avoid lots of frame flickering. */ - /* #### I think this should be GC protected. -sb */ - int depth = enter_redisplay_critical_section (); + int depth = begin_hold_frame_size_changes (); set_specifier_fallback (Vtoolbar[cur], list1 (Fcons (Qnil, Qnil))); set_specifier_fallback (Vtoolbar[new], Vdefault_toolbar); set_specifier_fallback (Vtoolbar_size[cur], list1 (Fcons (Qnil, Qzero))); @@ -275,7 +274,7 @@ set_specifier_fallback (Vtoolbar_visible_p[new], Vdefault_toolbar_visible_p); Vdefault_toolbar_position = position; - exit_redisplay_critical_section (depth); + unbind_to (depth); } return position; Index: src/ui-gtk.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ui-gtk.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/ui-gtk.c 12 Jan 2003 11:08:22 -0000 1.12 +++ src/ui-gtk.c 9 Mar 2003 02:27:46 -0000 1.13 @@ -9,20 +9,20 @@ #include #include "lisp.h" + #include "buffer.h" #include "console-gtk.h" #include "device.h" -#include "window.h" +#include "elhash.h" +#include "event-gtk.h" +#include "events.h" +#include "faces.h" #include "glyphs-gtk.h" +#include "hash.h" #include "objects-gtk.h" -#include "ui-gtk.h" -#include "faces.h" -#include "gui-gtk.h" #include "sysdll.h" -#include "hash.h" -#include "events.h" -#include "elhash.h" -#include "event-gtk.h" +#include "ui-gtk.h" +#include "window.h" /* XEmacs specific GTK types */ #include "gtk-glue.c" Index: src/unexec.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unexec.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/unexec.c 13 Mar 2002 08:53:02 -0000 1.8 +++ src/unexec.c 1 Mar 2003 07:25:36 -0000 1.9 @@ -196,8 +196,6 @@ # define sun 1 #endif -#ifndef CANNOT_DUMP /* all rest of file! */ - #ifdef COFF_ENCAPSULATE int need_coff_header = 1; #include /* The location might be a poor assumption */ @@ -1202,5 +1200,3 @@ #endif /* COFF_BSD_SYMBOLS */ #endif /* COFF */ - -#endif /* not CANNOT_DUMP */ Index: src/unicode.c =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unicode.c,v retrieving revision 1.15 retrieving revision 1.18 diff -u -r1.15 -r1.18 --- src/unicode.c 13 Feb 2003 09:57:08 -0000 1.15 +++ src/unicode.c 24 Apr 2003 05:33:44 -0000 1.18 @@ -54,7 +54,11 @@ something evil and unpredictable? Signaling an error is OK: for all national standards, the national to Unicode map is an inclusion (1-to-1). Any character set that does not behave that way is - broken according to the Unicode standard. */ + broken according to the Unicode standard. + + Answer: You will get an abort(), since the purpose of the sledgehammer + routines is self-checking. The above problem with non-1-to-1 mapping + occurs in the Big5 tables, as provided by the Unicode Consortium. */ /* #define SLEDGEHAMMER_CHECK_UNICODE */ @@ -164,7 +168,10 @@ #ifdef MULE /* #### Using ints for to_unicode is OK (as long as they are >= 32 bits). - However, shouldn't the shorts below be unsigned? */ + However, shouldn't the shorts below be unsigned? + + Answer: Doesn't matter because the values being converted to are only + 96x96. */ static int *to_unicode_blank_1; static int **to_unicode_blank_2; @@ -299,7 +306,11 @@ for (i = 0; i < 256; i++) { /* #### IMWTK: Why does using -1 here work? Simply because there are - no existing 96x96 charsets? */ + no existing 96x96 charsets? + + Answer: I don't understand the concern. -1 indicates there is no + entry for this particular codepoint, which is always the case for + blank tables. */ from_unicode_blank_1[i] = (short) -1; from_unicode_blank_2[i] = from_unicode_blank_1; from_unicode_blank_3[i] = from_unicode_blank_2; @@ -354,7 +365,7 @@ } /* Allocate and blank the tables. - Loading them up is done by parse-unicode-translation-table. */ + Loading them up is done by load-unicode-mapping-table. */ void init_charset_unicode_tables (Lisp_Object charset) { @@ -1055,6 +1066,8 @@ The language-specific precedence list is meant to be set as part of the language environment initialization; the default precedence list is meant to be set by the user. + +#### NOTE: This interface may be changed. */ ()) { @@ -1073,13 +1086,17 @@ precedence, respectively. This means that users are sometimes going to want to set Vlanguage_unicode_precedence_list. Furthermore, this should be language-local (buffer-local would be a - reasonable approximation). */ + reasonable approximation). + + Answer: You are right, this needs rethinking. */ DEFUN ("set-language-unicode-precedence-list", Fset_language_unicode_precedence_list, 1, 1, 0, /* Set the language-specific precedence of charsets in Unicode decoding. LIST is a list of charsets. See `unicode-precedence-list' for more information. + +#### NOTE: This interface may be changed. */ (list)) { @@ -1098,6 +1115,8 @@ 0, 0, 0, /* Return the language-specific precedence list used for Unicode decoding. See `unicode-precedence-list' for more information. + +#### NOTE: This interface may be changed. */ ()) { @@ -1110,6 +1129,8 @@ Set the default precedence list used for Unicode decoding. This is intended to be set by the user. See `unicode-precedence-list' for more information. + +#### NOTE: This interface may be changed. */ (list)) { @@ -1128,6 +1149,8 @@ 0, 0, 0, /* Return the default precedence list used for Unicode decoding. See `unicode-precedence-list' for more information. + +#### NOTE: This interface may be changed. */ ()) { @@ -1259,9 +1282,7 @@ return Qnil; } -/* #### shouldn't this interface be called load-unicode-mapping-table - for consistency with Unicode Consortium terminology? */ -DEFUN ("parse-unicode-translation-table", Fparse_unicode_translation_table, +DEFUN ("load-unicode-mapping-table", Fload_unicode_mapping_table, 2, 6, 0, /* Load Unicode tables with the Unicode mapping data in FILENAME for CHARSET. Data is text, in the form of one translation per line -- charset @@ -1331,7 +1352,7 @@ big5 = 1; else invalid_constant - ("Unrecognized `parse-unicode-translation-table' flag", elt); + ("Unrecognized `load-unicode-mapping-table' flag", elt); } } @@ -1453,7 +1474,7 @@ UNICODE_UTF_16, UNICODE_UTF_8, UNICODE_UTF_7, - UNICODE_UCS_4, + UNICODE_UCS_4 }; struct unicode_coding_system @@ -2288,7 +2309,7 @@ int dfc_coding_system_is_unicode (Lisp_Object codesys) { -#ifdef HAVE_WIN32_CODING_SYSTEMS +#ifdef WIN32_ANY codesys = Fget_coding_system (codesys); return (EQ (XCODING_SYSTEM_TYPE (codesys), Qunicode) && XCODING_SYSTEM_UNICODE_TYPE (codesys) == UNICODE_UTF_16 && @@ -2315,7 +2336,7 @@ DEFSUBR (Fdefault_unicode_precedence_list); DEFSUBR (Fset_unicode_conversion); - DEFSUBR (Fparse_unicode_translation_table); + DEFSUBR (Fload_unicode_mapping_table); DEFSYMBOL (Qignore_first_column); #endif /* MULE */ Index: src/xmmanagerp.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/xmmanagerp.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/xmmanagerp.h 12 Apr 2001 18:24:30 -0000 1.3 +++ src/xmmanagerp.h 20 Feb 2003 08:19:44 -0000 1.4 @@ -26,11 +26,11 @@ #ifndef INCLUDED_xmmanagerp_h_ #define INCLUDED_xmmanagerp_h_ -#include /* to get XmVersion */ +#include "xmotif.h" /* to get XmVersion */ #if (XmVersion >= 1002) # include #else -# include +# include "xmprimitivep.h" #endif #endif /* INCLUDED_xmmanagerp_h_ */ Index: src/xmotif.h =================================================================== RCS file: src/xmotif.h diff -N src/xmotif.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/xmotif.h 20 Feb 2003 08:19:44 -0000 1.1 @@ -0,0 +1,31 @@ +/* This file just includes the Motif header file Xm.h, but does + the necessary magic to do this properly without warnings. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef INCLUDED_xmotif_h_ +#define INCLUDED_xmotif_h_ + +/* Kludge around shadowing warnings */ +#define time time_ +#include +#undef time + +#endif /* INCLUDED_xmotif_h_ */ Index: src/xmprimitivep.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/xmprimitivep.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/xmprimitivep.h 12 Apr 2001 18:24:30 -0000 1.3 +++ src/xmprimitivep.h 20 Feb 2003 08:19:44 -0000 1.4 @@ -26,11 +26,15 @@ #ifndef INCLUDED_xmprimitivep_h_ #define INCLUDED_xmprimitivep_h_ -#include /* to get XmVersion */ +#include "xmotif.h" /* to get XmVersion */ +# define time time_ +# define message message_ #if (XmVersion >= 1002) # include #else # include #endif +# undef message +# undef time #endif /* INCLUDED_xmprimitivep_h_ */ cvs server: Diffing src/m Index: src/m/acorn.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/acorn.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/acorn.h 13 Mar 2002 08:53:20 -0000 1.4 +++ src/m/acorn.h 1 Mar 2003 07:25:39 -0000 1.5 @@ -58,12 +58,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* This prevents Emacs dumping an unsqueezed binary with the SQUEEZE bit set in the magic number. */ Index: src/m/alliant-2800.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/alliant-2800.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/alliant-2800.h 12 Apr 2001 18:24:32 -0000 1.3 +++ src/m/alliant-2800.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -50,11 +50,6 @@ /* include for the definition of LOADAVG_SCALE, and also LOADAVG_SIZE, the number of items in the Loadavg array. */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ #define UNEXEC "unexfx2800.o" #define LIBS_MACHINE "-lalliant" Index: src/m/alliant.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/alliant.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/alliant.h 12 Apr 2001 18:24:32 -0000 1.3 +++ src/m/alliant.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -39,12 +39,6 @@ #undef LOAD_AVE_TYPE #undef LOAD_AVE_CVT -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/altos.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/altos.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/m/altos.h 13 Mar 2002 08:53:20 -0000 1.5 +++ src/m/altos.h 1 Mar 2003 07:25:39 -0000 1.6 @@ -41,7 +41,6 @@ #undef TERMINFO -#undef CANNOT_DUMP #define TERMCAP #define LIBS_TERMCAP "-ltermlib" Index: src/m/amdahl.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/amdahl.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/amdahl.h 12 Apr 2001 18:24:32 -0000 1.3 +++ src/m/amdahl.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -49,12 +49,6 @@ /*#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0)*/ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/arm.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/arm.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/arm.h 13 Mar 2002 08:53:20 -0000 1.4 +++ src/m/arm.h 1 Mar 2003 07:25:39 -0000 1.5 @@ -65,12 +65,6 @@ #endif -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* this brings in alloca() if we're using cc */ #ifdef USG #define NO_REMAP Index: src/m/att3b.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/att3b.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/att3b.h 12 Apr 2001 18:24:33 -0000 1.4 +++ src/m/att3b.h 1 Mar 2003 07:25:39 -0000 1.5 @@ -37,11 +37,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/aviion.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/aviion.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/aviion.h 12 Apr 2001 18:24:33 -0000 1.4 +++ src/m/aviion.h 1 Mar 2003 07:25:39 -0000 1.5 @@ -37,12 +37,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/clipper.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/clipper.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/clipper.h 12 Apr 2001 18:24:33 -0000 1.2 +++ src/m/clipper.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -40,11 +40,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/cnvrgnt.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/cnvrgnt.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/cnvrgnt.h 12 Apr 2001 18:24:33 -0000 1.2 +++ src/m/cnvrgnt.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -34,12 +34,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/convex.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/convex.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/convex.h 12 Apr 2001 18:24:33 -0000 1.4 +++ src/m/convex.h 1 Mar 2003 07:25:39 -0000 1.5 @@ -50,12 +50,6 @@ #define LOAD_AVE_CVT(x) (int) ((x) * 100.0) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/cydra5.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/cydra5.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/cydra5.h 12 Apr 2001 18:24:33 -0000 1.3 +++ src/m/cydra5.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -37,12 +37,6 @@ #define LOAD_AVE_CVT(x) x -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/*#define CANNOT_DUMP*/ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/delta.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/delta.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/m/delta.h 14 May 2001 04:52:27 -0000 1.6 +++ src/m/delta.h 1 Mar 2003 07:25:39 -0000 1.7 @@ -42,12 +42,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/delta88k.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/delta88k.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/m/delta88k.h 14 May 2001 04:52:27 -0000 1.6 +++ src/m/delta88k.h 1 Mar 2003 07:25:39 -0000 1.7 @@ -44,12 +44,6 @@ /* Convert that into an integer that is 100 for a load average of 1.0 */ /* #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp Index: src/m/dpx2.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/dpx2.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/m/dpx2.h 14 May 2001 04:52:27 -0000 1.7 +++ src/m/dpx2.h 1 Mar 2003 07:25:39 -0000 1.8 @@ -49,12 +49,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/*#define CANNOT_DUMP /**/ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/elxsi.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/elxsi.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/elxsi.h 12 Apr 2001 18:24:34 -0000 1.3 +++ src/m/elxsi.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -50,16 +50,6 @@ #define LOAD_AVE_CVT(x) (int) ((x) * 100.0) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. - - Earlier versions couldn't dump. - Changes for 12.0 release are in 19.1. - Dumping should work now. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/ews4800r.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/ews4800r.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/ews4800r.h 12 Apr 2001 18:24:34 -0000 1.3 +++ src/m/ews4800r.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -36,12 +36,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / 256.0) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/gould.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/gould.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/m/gould.h 12 Apr 2001 18:24:34 -0000 1.5 +++ src/m/gould.h 1 Mar 2003 07:25:39 -0000 1.6 @@ -65,12 +65,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/hp800.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/hp800.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/hp800.h 14 May 2001 04:52:27 -0000 1.4 +++ src/m/hp800.h 1 Mar 2003 07:25:39 -0000 1.5 @@ -51,12 +51,6 @@ #define LOAD_AVE_CVT(x) ((int) (x * 100.0)) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/hp9000s300.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/hp9000s300.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/hp9000s300.h 12 Apr 2001 18:24:34 -0000 1.3 +++ src/m/hp9000s300.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -46,12 +46,6 @@ #define hp9000s300 #endif -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Let the OS header file determine this if not HPUX. */ #ifdef HPUX # define UNEXEC "unexhp9k3.o" Index: src/m/i860.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/i860.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/i860.h 12 Apr 2001 18:24:34 -0000 1.2 +++ src/m/i860.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -39,12 +39,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/ibmps2-aix.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/ibmps2-aix.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/m/ibmps2-aix.h 13 Mar 2002 08:53:20 -0000 1.8 +++ src/m/ibmps2-aix.h 1 Mar 2003 07:25:39 -0000 1.9 @@ -53,12 +53,6 @@ /* USG systems do not actually support the load average, so disable it for them. */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define addresses, macros, change some setup for dump */ #define NO_REMAP Index: src/m/ibmrs6000.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/ibmrs6000.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/m/ibmrs6000.h 13 Mar 2002 08:53:20 -0000 1.6 +++ src/m/ibmrs6000.h 1 Mar 2003 07:25:39 -0000 1.7 @@ -29,10 +29,8 @@ #define IBMR2AIX -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ #ifdef USG5_4 +/* Just use PDUMP. */ #define CANNOT_DUMP #endif Index: src/m/ibmrt-aix.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/ibmrt-aix.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/m/ibmrt-aix.h 13 Mar 2002 08:53:20 -0000 1.5 +++ src/m/ibmrt-aix.h 1 Mar 2003 07:25:39 -0000 1.6 @@ -34,12 +34,6 @@ /* No load average information appears in the AIX kernel. VRM has this info, and if anyone desires they should fix fns.c to get it out of VRM */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define addresses, macros, change some setup for dump */ #undef COFF Index: src/m/ibmrt.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/ibmrt.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/ibmrt.h 12 Apr 2001 18:24:35 -0000 1.3 +++ src/m/ibmrt.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -43,12 +43,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/intel386.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/intel386.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/m/intel386.h 13 Mar 2002 08:53:20 -0000 1.8 +++ src/m/intel386.h 1 Mar 2003 07:25:39 -0000 1.9 @@ -106,12 +106,6 @@ #endif #endif /* not SOLARIS2 */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - #ifdef XENIX /* Define NO_REMAP if memory segmentation makes it not work well Index: src/m/iris4d.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/iris4d.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/m/iris4d.h 12 Apr 2001 18:24:35 -0000 1.6 +++ src/m/iris4d.h 1 Mar 2003 07:25:39 -0000 1.7 @@ -49,12 +49,6 @@ #define KERNEL_FILE "/unix" #endif -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/iris5d.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/iris5d.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/m/iris5d.h 12 Apr 2001 18:24:35 -0000 1.6 +++ src/m/iris5d.h 1 Mar 2003 07:25:39 -0000 1.7 @@ -50,12 +50,6 @@ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/iris6d.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/iris6d.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/iris6d.h 12 Apr 2001 18:24:35 -0000 1.2 +++ src/m/iris6d.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -49,12 +49,6 @@ #define KERNEL_FILE "/unix" #endif -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/irist.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/irist.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/irist.h 12 Apr 2001 18:24:35 -0000 1.2 +++ src/m/irist.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -76,12 +76,6 @@ #define FSCALE 1.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/m68k.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/m68k.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/m68k.h 12 Apr 2001 18:24:36 -0000 1.2 +++ src/m/m68k.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -27,12 +27,6 @@ #define m68k #endif -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - #ifdef linux #define NO_REMAP Index: src/m/masscomp.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/masscomp.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/masscomp.h 12 Apr 2001 18:24:36 -0000 1.2 +++ src/m/masscomp.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -39,12 +39,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/mg1.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/mg1.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/mg1.h 12 Apr 2001 18:24:36 -0000 1.2 +++ src/m/mg1.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -50,12 +50,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ -/* ns16000's have an unexec, so should the mg-1 */ -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/mips-nec.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/mips-nec.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/mips-nec.h 12 Apr 2001 18:24:36 -0000 1.2 +++ src/m/mips-nec.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -57,12 +57,6 @@ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/mips-siemens.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/mips-siemens.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/mips-siemens.h 12 Apr 2001 18:24:36 -0000 1.4 +++ src/m/mips-siemens.h 1 Mar 2003 07:25:39 -0000 1.5 @@ -57,12 +57,6 @@ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/mips.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/mips.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/m/mips.h 14 May 2001 04:52:28 -0000 1.8 +++ src/m/mips.h 1 Mar 2003 07:25:39 -0000 1.9 @@ -52,12 +52,6 @@ #define KERNEL_FILE "/unix" #endif /* ! linux */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/nh3000.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/nh3000.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/nh3000.h 12 Apr 2001 18:24:36 -0000 1.2 +++ src/m/nh3000.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -47,12 +47,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/nh4000.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/nh4000.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/nh4000.h 12 Apr 2001 18:24:36 -0000 1.2 +++ src/m/nh4000.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -46,12 +46,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/ns32000.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/ns32000.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/ns32000.h 13 Mar 2002 08:53:20 -0000 1.4 +++ src/m/ns32000.h 1 Mar 2003 07:25:39 -0000 1.5 @@ -37,12 +37,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/plexus.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/plexus.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/plexus.h 12 Apr 2001 18:24:37 -0000 1.3 +++ src/m/plexus.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -39,12 +39,6 @@ #undef LOAD_AVE_CVT -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/powerpc.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/powerpc.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/m/powerpc.h 12 Apr 2001 18:24:37 -0000 1.9 +++ src/m/powerpc.h 1 Mar 2003 07:25:39 -0000 1.10 @@ -57,10 +57,6 @@ #define NO_REMAP -#ifdef CANNOT_DUMP - -#endif /* CANNOT_DUMP */ - #define N_BADMAG(x) BADMAG(x) #define N_TXTOFF(x) A_TEXTPOS(x) #define N_SYMOFF(x) A_SYMPOS(x) Index: src/m/sequent-ptx.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/sequent-ptx.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/sequent-ptx.h 12 Apr 2001 18:24:39 -0000 1.3 +++ src/m/sequent-ptx.h 1 Mar 2003 07:25:39 -0000 1.4 @@ -49,12 +49,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/sequent.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/sequent.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/sequent.h 12 Apr 2001 18:24:39 -0000 1.2 +++ src/m/sequent.h 1 Mar 2003 07:25:39 -0000 1.3 @@ -58,12 +58,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/sgi-challenge.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/sgi-challenge.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/m/sgi-challenge.h 12 Apr 2001 18:24:39 -0000 1.5 +++ src/m/sgi-challenge.h 1 Mar 2003 07:25:39 -0000 1.6 @@ -62,12 +62,6 @@ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/stride.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/stride.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/stride.h 14 May 2001 04:52:28 -0000 1.4 +++ src/m/stride.h 1 Mar 2003 07:25:40 -0000 1.5 @@ -42,12 +42,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* The STRIDE system is more powerful than standard USG5. */ #define SKTPAIR Index: src/m/tad68k.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/tad68k.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/m/tad68k.h 13 Aug 2001 04:46:46 -0000 1.5 +++ src/m/tad68k.h 1 Mar 2003 07:25:40 -0000 1.6 @@ -31,11 +31,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/targon31.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/targon31.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/targon31.h 12 Apr 2001 18:24:40 -0000 1.2 +++ src/m/targon31.h 1 Mar 2003 07:25:40 -0000 1.3 @@ -40,12 +40,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/tekxd88.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/tekxd88.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/m/tekxd88.h 14 May 2001 04:52:28 -0000 1.6 +++ src/m/tekxd88.h 1 Mar 2003 07:25:40 -0000 1.7 @@ -35,11 +35,6 @@ /* Convert that into an integer that is 100 for a load average of 1.0 */ /* #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ -/*#define CANNOT_DUMP*/ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp Index: src/m/template.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/template.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/m/template.h 12 Apr 2001 18:24:40 -0000 1.2 +++ src/m/template.h 1 Mar 2003 07:25:40 -0000 1.3 @@ -37,12 +37,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#define CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/tower32.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/tower32.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/tower32.h 12 Apr 2001 18:24:40 -0000 1.3 +++ src/m/tower32.h 1 Mar 2003 07:25:40 -0000 1.4 @@ -38,12 +38,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/tower32v3.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/tower32v3.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/tower32v3.h 12 Apr 2001 18:24:40 -0000 1.3 +++ src/m/tower32v3.h 1 Mar 2003 07:25:40 -0000 1.4 @@ -38,12 +38,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/ustation.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/ustation.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/m/ustation.h 13 Mar 2002 08:53:20 -0000 1.4 +++ src/m/ustation.h 1 Mar 2003 07:25:40 -0000 1.5 @@ -40,12 +40,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/wicat.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/wicat.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/m/wicat.h 14 May 2001 04:52:28 -0000 1.5 +++ src/m/wicat.h 1 Mar 2003 07:25:40 -0000 1.6 @@ -43,12 +43,6 @@ #undef LOAD_AVE_CVT -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly Index: src/m/xps100.h =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/src/m/xps100.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/m/xps100.h 12 Apr 2001 18:24:41 -0000 1.3 +++ src/m/xps100.h 1 Mar 2003 07:25:40 -0000 1.4 @@ -39,12 +39,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - /* Define C_ALLOCA if this machine does not support a true alloca and the one written in C should be used instead. Define HAVE_ALLOCA to say that the system provides a properly cvs server: Diffing src/s cvs server: Diffing tests Index: tests/ChangeLog =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/ChangeLog,v retrieving revision 1.28 retrieving revision 1.33 diff -u -r1.28 -r1.33 --- tests/ChangeLog 16 Feb 2003 06:13:41 -0000 1.28 +++ tests/ChangeLog 24 Apr 2003 23:41:44 -0000 1.33 @@ -1,3 +1,47 @@ +2003-04-24 Steve Youngs + + * XEmacs 21.5.12 "carrot" is released. + +2003-04-23 Stephen J. Turnbull + + * automated/test-harness.el (test-harness-risk-infloops): + New variable. + + * automated/lisp-tests.el (split-string): Add tests for new API + spec. Conditionally re-enable potential infloops. + +2003-04-17 Stephen J. Turnbull + + * automated/regexp-tests.el (stale match data): Update comment. + (replace-match): Check-Error after failed match. + +2003-04-15 Stephen J. Turnbull + + * automated/test-harness.el (test-harness-known-bug): Deleted. + (test-harness-failure-tag, test-harness-success-tag): New variables. + (Known-Bug-Expect-Failure): Bind them. + (Implementation-Incomplete-Expect-Failure): New macro. Bind *-tag. + (Print-Failure, Print-Pass): Use *-tag instead of literal strings. + + * automated/symbol-tests.el (weak reference uniqueness): Mike sez + tests of garbage collector are due to incomplete descriptorization + of lisp types. Tag with Implementation-Incomplete-Expect-Failure + if KKCC. + +2003-04-03 Stephen J. Turnbull + + * automated/regexp-tests.el: Change known-bug status of Mule ranges. + +2003-03-21 Stephen J. Turnbull + + * automated/regexp-tests.el: Change known-bug status of "\\b". + +2003-02-21 Stephen J. Turnbull + + * automated/mule-tests.el (charsets-in-string): + (charsets-in-string): + Not all that glitters is gold, nor eq that which is equal. D'oh. + 2003-02-16 Steve Youngs * XEmacs 21.5.11 "cabbage" is released. cvs server: Diffing tests/DLL cvs server: Diffing tests/Dnd cvs server: Diffing tests/automated Index: tests/automated/lisp-tests.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/lisp-tests.el,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- tests/automated/lisp-tests.el 5 May 2002 11:33:20 -0000 1.3 +++ tests/automated/lisp-tests.el 23 Apr 2003 15:42:52 -0000 1.4 @@ -852,10 +852,13 @@ ;;----------------------------------------------------- ;; Test split-string ;;----------------------------------------------------- -;; Hrvoje didn't like these tests so I'm disabling them for now. -sb -;(Assert (equal (split-string "foo" "") '("" "f" "o" "o" ""))) -;(Assert (equal (split-string "foo" "^") '("" "foo"))) -;(Assert (equal (split-string "foo" "$") '("foo" ""))) +;; Keep nulls, explicit SEPARATORS +;; Hrvoje didn't like the next 3 tests so I'm disabling them for now. -sb +;; I assume Hrvoje worried about the possibility of infloops. -sjt +(when test-harness-risk-infloops + (Assert (equal (split-string "foo" "") '("" "f" "o" "o" ""))) + (Assert (equal (split-string "foo" "^") '("" "foo"))) + (Assert (equal (split-string "foo" "$") '("foo" "")))) (Assert (equal (split-string "foo,bar" ",") '("foo" "bar"))) (Assert (equal (split-string ",foo,bar," ",") '("" "foo" "bar" ""))) (Assert (equal (split-string ",foo,bar," "^,") '("" "foo,bar,"))) @@ -865,6 +868,47 @@ (Assert (equal (split-string "foo,,bar,," ",") '("foo" "" "bar" "" ""))) (Assert (equal (split-string "foo,,bar" ",+") '("foo" "bar"))) (Assert (equal (split-string ",foo,,bar," ",+") '("" "foo" "bar" ""))) +;; Omit nulls, explicit SEPARATORS +(when test-harness-risk-infloops + (Assert (equal (split-string "foo" "" t) '("f" "o" "o"))) + (Assert (equal (split-string "foo" "^" t) '("foo"))) + (Assert (equal (split-string "foo" "$" t) '("foo")))) +(Assert (equal (split-string "foo,bar" "," t) '("foo" "bar"))) +(Assert (equal (split-string ",foo,bar," "," t) '("foo" "bar"))) +(Assert (equal (split-string ",foo,bar," "^," t) '("foo,bar,"))) +(Assert (equal (split-string ",foo,bar," ",$" t) '(",foo,bar"))) +(Assert (equal (split-string ",foo,,bar," "," t) '("foo" "bar"))) +(Assert (equal (split-string "foo,,,bar" "," t) '("foo" "bar"))) +(Assert (equal (split-string "foo,,bar,," "," t) '("foo" "bar"))) +(Assert (equal (split-string "foo,,bar" ",+" t) '("foo" "bar"))) +(Assert (equal (split-string ",foo,,bar," ",+" t) '("foo" "bar"))) +;; "Double-default" case +(Assert (equal (split-string "foo bar") '("foo" "bar"))) +(Assert (equal (split-string " foo bar ") '("foo" "bar"))) +(Assert (equal (split-string " foo bar ") '("foo" "bar"))) +(Assert (equal (split-string "foo bar") '("foo" "bar"))) +(Assert (equal (split-string "foo bar ") '("foo" "bar"))) +(Assert (equal (split-string "foobar") '("foobar"))) +;; Semantics are identical to "double-default" case! Fool ya? +(Assert (equal (split-string "foo bar" nil t) '("foo" "bar"))) +(Assert (equal (split-string " foo bar " nil t) '("foo" "bar"))) +(Assert (equal (split-string " foo bar " nil t) '("foo" "bar"))) +(Assert (equal (split-string "foo bar" nil t) '("foo" "bar"))) +(Assert (equal (split-string "foo bar " nil t) '("foo" "bar"))) +(Assert (equal (split-string "foobar" nil t) '("foobar"))) +;; Perverse "anti-double-default" case +(Assert (equal (split-string "foo bar" split-string-default-separators) + '("foo" "bar"))) +(Assert (equal (split-string " foo bar " split-string-default-separators) + '("" "foo" "bar" ""))) +(Assert (equal (split-string " foo bar " split-string-default-separators) + '("" "foo" "bar" ""))) +(Assert (equal (split-string "foo bar" split-string-default-separators) + '("foo" "bar"))) +(Assert (equal (split-string "foo bar " split-string-default-separators) + '("foo" "bar" ""))) +(Assert (equal (split-string "foobar" split-string-default-separators) + '("foobar"))) (Assert (not (string-match "\\(\\.\\=\\)" "."))) (Assert (string= "" (let ((str "test string")) Index: tests/automated/mule-tests.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/mule-tests.el,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- tests/automated/mule-tests.el 9 Jan 2003 12:49:43 -0000 1.6 +++ tests/automated/mule-tests.el 20 Feb 2003 15:39:42 -0000 1.7 @@ -336,18 +336,19 @@ ;; #### rewrite robustly, both assume that the tested implementation ;; uses the same algorithm as was used by the version current at time ;; this test was written - (Assert (eq (charsets-in-region (point-min) (point-max)) - '(korean-ksc5601 chinese-big5-1 chinese-gb2312 - japanese-jisx0212 katakana-jisx0201 japanese-jisx0208 - vietnamese-viscii-lower thai-xtis cyrillic-iso8859-5 - hebrew-iso8859-8 greek-iso8859-7 latin-iso8859-1 - latin-iso8859-2 arabic-2-column arabic-1-column - ethiopic ascii))) - (Assert (eq (charsets-in-string (buffer-substring (point-min) (point-max))) - '(korean-ksc5601 chinese-big5-1 chinese-gb2312 - japanese-jisx0212 katakana-jisx0201 japanese-jisx0208 - vietnamese-viscii-lower thai-xtis cyrillic-iso8859-5 - hebrew-iso8859-8 greek-iso8859-7 latin-iso8859-1 - latin-iso8859-2 arabic-2-column arabic-1-column - ethiopic ascii)))) + (Assert (equal (charsets-in-region (point-min) (point-max)) + '(korean-ksc5601 chinese-big5-1 chinese-gb2312 + japanese-jisx0212 katakana-jisx0201 japanese-jisx0208 + vietnamese-viscii-lower thai-xtis cyrillic-iso8859-5 + hebrew-iso8859-8 greek-iso8859-7 latin-iso8859-1 + latin-iso8859-2 arabic-2-column arabic-1-column + ethiopic ascii))) + (Assert (equal (charsets-in-string (buffer-substring (point-min) + (point-max))) + '(korean-ksc5601 chinese-big5-1 chinese-gb2312 + japanese-jisx0212 katakana-jisx0201 japanese-jisx0208 + vietnamese-viscii-lower thai-xtis cyrillic-iso8859-5 + hebrew-iso8859-8 greek-iso8859-7 latin-iso8859-1 + latin-iso8859-2 arabic-2-column arabic-1-column + ethiopic ascii)))) ) Index: tests/automated/regexp-tests.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/regexp-tests.el,v retrieving revision 1.6 retrieving revision 1.9 diff -u -r1.6 -r1.9 --- tests/automated/regexp-tests.el 9 Jan 2003 12:49:43 -0000 1.6 +++ tests/automated/regexp-tests.el 23 Apr 2003 15:42:52 -0000 1.9 @@ -205,14 +205,13 @@ ;; (test-regex-charset-mule-paranoid) -;; Test replace-match +;; Test that replace-match errors after a failed match (with-temp-buffer (insert "This is a test buffer.") (goto-char (point-min)) (search-forward "this is a test ") (looking-at "Unmatchable text") - (replace-match "") - (Assert (looking-at "^buffer.$"))) + (Check-Error args-out-of-range (replace-match ""))) ;; Test that trivial regexps reset unused registers ;; Thanks to Martin Sternholm for the report. @@ -249,28 +248,26 @@ (Assert (not (string-match "\\> " " "))) (Assert (not (string-match "a\\<" "a"))) (Assert (not (string-match "\\>a" "a"))) -;; Added Known-Bug 2002-09-09 -(Known-Bug-Expect-Failure - (Assert (not (string-match "\\b" ""))) - (Assert (not (string-match "\\b" " "))) - (Assert (not (string-match " \\b" " "))) - (Assert (not (string-match "\\b " " ")))) +;; Added Known-Bug 2002-09-09 sjt +;; Fixed bug 2003-03-21 sjt +(Assert (not (string-match "\\b" ""))) +(Assert (not (string-match "\\b" " "))) +(Assert (not (string-match " \\b" " "))) +(Assert (not (string-match "\\b " " "))) ;; Character classes are broken in Mule as of 21.5.9 ;; Added Known-Bug 2002-12-27 +;; Fixed by Daiki Ueno 2003-03-24 (if (featurep 'mule) ;; note: (int-to-char 65) => ?A (let ((ch0 (make-char 'japanese-jisx0208 52 65)) (ch1 (make-char 'japanese-jisx0208 51 65))) (Assert (not (string-match "A" (string ch0)))) (Assert (not (string-match "[A]" (string ch0)))) - (Known-Bug-Expect-Failure - (Assert (eq (string-match "[^A]" (string ch0)) 0))) + (Assert (eq (string-match "[^A]" (string ch0)) 0)) (Assert (not (string-match "@A" (string ?@ ch0)))) - (Known-Bug-Expect-Failure - (Assert (not (string-match "@[A]" (string ?@ ch0))))) - (Known-Bug-Expect-Failure - (Assert (eq (string-match "@[^A]" (string ?@ ch0)) 0))) + (Assert (not (string-match "@[A]" (string ?@ ch0)))) + (Assert (eq (string-match "@[^A]" (string ?@ ch0)) 0)) (Assert (not (string-match "@?A" (string ?@ ch0)))) (Assert (not (string-match "A" (string ch1)))) (Assert (not (string-match "[A]" (string ch1)))) @@ -278,10 +275,14 @@ (Assert (not (string-match "@A" (string ?@ ch1)))) (Assert (not (string-match "@[A]" (string ?@ ch1)))) (Assert (eq (string-match "@[^A]" (string ?@ ch1)) 0)) - (Assert (not (string-match "@?A" (string ?@ ch1)))))) + (Assert (not (string-match "@?A" (string ?@ ch1)))) + ) + ) ;; More stale match data tests. ;; Thanks to . +;; These tests used to fail because we cleared match data only on success. +;; Fixed 2003-04-17. (Assert (not (progn (string-match "a" "a") (string-match "b" "a") (match-string 0 "a")))) Index: tests/automated/symbol-tests.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/symbol-tests.el,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- tests/automated/symbol-tests.el 5 May 2002 11:33:21 -0000 1.3 +++ tests/automated/symbol-tests.el 15 Apr 2003 15:56:58 -0000 1.4 @@ -71,10 +71,17 @@ (flet ((check-weak-list-unique (weak-list &optional reversep) "Check that elements of WEAK-LIST are referenced only there." (let ((len (length (weak-list-list weak-list)))) - (Assert (not (zerop len))) - (garbage-collect) - (Assert (eq (length (weak-list-list weak-list)) - (if (not reversep) 0 len)))))) + (if (string-match "Using the new GC algorithms." + Installation-string) + (Implementation-Incomplete-Expect-Failure + (Assert (not (zerop len))) + (garbage-collect) + (Assert (eq (length (weak-list-list weak-list)) + (if (not reversep) 0 len)))) + (Assert (not (zerop len))) + (garbage-collect) + (Assert (eq (length (weak-list-list weak-list)) + (if (not reversep) 0 len))))))) (let ((weak-list (make-weak-list)) (gc-cons-threshold most-positive-fixnum)) ;; Symbols created with `make-symbol' and `gensym' should be fresh Index: tests/automated/test-harness.el =================================================================== RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/test-harness.el,v retrieving revision 1.9 retrieving revision 1.11 diff -u -r1.9 -r1.11 --- tests/automated/test-harness.el 23 Jan 2003 11:24:13 -0000 1.9 +++ tests/automated/test-harness.el 23 Apr 2003 15:42:52 -0000 1.11 @@ -33,7 +33,8 @@ ;;; Assert, Check-Error, Check-Message, and Check-Error-Message functions ;;; to create tests. See `test-harness-from-buffer' below. ;;; Don't suppress tests just because they're due to known bugs not yet -;;; fixed -- use the Known-Bug-Expect-Failure wrapper macro to mark them. +;;; fixed -- use the Known-Bug-Expect-Failure and +;;; Implementation-Incomplete-Expect-Failure wrapper macros to mark them. ;;; A lot of the tests we run push limits; suppress Ebola message with the ;;; Ignore-Ebola wrapper macro. ;;; @@ -47,6 +48,9 @@ (and (not noninteractive) (> (device-baud-rate) search-slow-speed)) "*Non-nil means print messages describing progress of emacs-tester.") +(defvar test-harness-risk-infloops nil + "*Non-nil to run tests that may loop infinitely in buggy implementations.") + (defvar test-harness-current-file nil) (defvar emacs-lisp-file-regexp (purecopy "\\.el\\'") @@ -142,23 +146,26 @@ (with-output-to-temp-buffer "*Test-Log*" (princ (format "Testing %s...\n\n" filename)) - (defconst test-harness-expect-bug nil) + (defconst test-harness-failure-tag "FAIL") + (defconst test-harness-success-tag "PASS") (defmacro Known-Bug-Expect-Failure (&rest body) - `(let ((test-harness-expect-bug t)) ,@body)) + `(let ((test-harness-failure-tag "KNOWN BUG") + (test-harness-success-tag "PASS (FAILURE EXPECTED)")) + ,@body)) + + (defmacro Implementation-Incomplete-Expect-Failure (&rest body) + `(let ((test-harness-failure-tag "IMPLEMENTATION INCOMPLETE") + (test-harness-success-tag "PASS (FAILURE EXPECTED)")) + ,@body)) (defun Print-Failure (fmt &rest args) - (setq fmt (format "%s: %s" - (if test-harness-expect-bug - "KNOWN BUG" - "FAIL") - fmt)) + (setq fmt (format "%s: %s" test-harness-failure-tag fmt)) (if (noninteractive) (apply #'message fmt args)) (princ (concat (apply #'format fmt args) "\n"))) (defun Print-Pass (fmt &rest args) - (setq fmt (concat "PASS: " fmt)) - ;; #### should warn if expecting failure here! + (setq fmt (format "%s: %s" test-harness-success-tag fmt)) (and test-harness-verbose (princ (concat (apply #'format fmt args) "\n")))) cvs server: Diffing tests/gtk cvs server: Diffing tests/mule cvs server: Diffing tests/tooltalk